planche 0.8.14 → 0.9.1

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.
Files changed (141) hide show
  1. package/app/assets/7jD5h8Yx.js +4 -0
  2. package/app/assets/7jG9Xw-H.js +1 -0
  3. package/app/assets/84VwJAQi.js +1 -0
  4. package/app/assets/9gOj-Ty3.js +1 -0
  5. package/app/assets/B4S-lOKS.js +2 -0
  6. package/app/assets/B7zF7RU4.js +2 -0
  7. package/app/assets/{CjoKIEBz.js → B9dhM8vw.js} +1 -1
  8. package/app/assets/BDtsGuIR.js +4 -0
  9. package/app/assets/BEH9Jqkv.js +1 -0
  10. package/app/assets/BFw3KCAr.js +1 -0
  11. package/app/assets/BGuDcBB_.js +1 -0
  12. package/app/assets/BGvsBpIS.js +1 -0
  13. package/app/assets/BMBWoD5w.js +1 -0
  14. package/app/assets/BMFLhX-x.js +1 -0
  15. package/app/assets/BNB62Dfu.js +1 -0
  16. package/app/assets/BPPUDpI0.js +1 -0
  17. package/app/assets/BPmMKRmE.js +3 -0
  18. package/app/assets/BQ1Rcyw6.js +1 -0
  19. package/app/assets/BRZhVXRC.js +1 -0
  20. package/app/assets/BSziALTN.js +1 -0
  21. package/app/assets/BTaXXwBP.js +27 -0
  22. package/app/assets/BYvM8E39.js +1 -0
  23. package/app/assets/BbOETtQZ.js +7 -0
  24. package/app/assets/Bbx7_Uyd.js +1 -0
  25. package/app/assets/BhX9zWzC.js +1 -0
  26. package/app/assets/BixvbqFe.js +1 -0
  27. package/app/assets/BjwrN_ch.js +11 -0
  28. package/app/assets/BkXrfAoR.js +1 -0
  29. package/app/assets/BnJGrP6V.js +4 -0
  30. package/app/assets/BrVnzO7b.js +1 -0
  31. package/app/assets/ByKF67UY.js +1 -0
  32. package/app/assets/C1gqjEN3.js +1 -0
  33. package/app/assets/C1kpKIsO.js +1 -0
  34. package/app/assets/C6712dxU.js +1 -0
  35. package/app/assets/C77ZEZfM.js +1 -0
  36. package/app/assets/CExE8dKz.js +959 -0
  37. package/app/assets/CFUkTo-F.js +1 -0
  38. package/app/assets/CFu5QMhX.js +4 -0
  39. package/app/assets/CHx7zgT8.js +1 -0
  40. package/app/assets/CRnmOOqq.js +1 -0
  41. package/app/assets/{CoSpkBZh.js → CTnwm-29.js} +1 -1
  42. package/app/assets/{B1pia_Rg.js → CYz610vE.js} +1 -1
  43. package/app/assets/CaU3pCK6.js +1 -0
  44. package/app/assets/CgQ0qqq4.js +1 -0
  45. package/app/assets/CiL8zoYm.js +1 -0
  46. package/app/assets/CoZCOAph.js +3 -0
  47. package/app/assets/{ClQzFEcL.js → CrhJJH3f.js} +1 -1
  48. package/app/assets/CrlnxAGW.js +1 -0
  49. package/app/assets/Cu_sGzNJ.js +1 -0
  50. package/app/assets/D0Ya12SQ.js +1 -0
  51. package/app/assets/D1kyupCL.js +1 -0
  52. package/app/assets/D3lUezEb.js +1 -0
  53. package/app/assets/D8_hwGjG.js +1 -0
  54. package/app/assets/{CEtGUZGE.js → D8dVzi6I.js} +1 -1
  55. package/app/assets/D9QeXBOk.js +1 -0
  56. package/app/assets/DCHRj2vY.js +1 -0
  57. package/app/assets/DF7EZh_S.js +2 -0
  58. package/app/assets/DHZOxCSJ.js +1 -0
  59. package/app/assets/DNHPk-9r.js +4 -0
  60. package/app/assets/DPyLA6Dl.js +8 -0
  61. package/app/assets/DTkqO0Em.js +1 -0
  62. package/app/assets/DU-Eln5x.js +1 -0
  63. package/app/assets/DaBfnZOJ.js +1 -0
  64. package/app/assets/Djxg54qH.js +1 -0
  65. package/app/assets/Do7KpDxk.js +1 -0
  66. package/app/assets/DpEN2jyA.js +1 -0
  67. package/app/assets/DzRyVlxz.js +41 -0
  68. package/app/assets/DzdX4vRD.js +1 -0
  69. package/app/assets/G06qjCej.js +1 -0
  70. package/app/assets/Nro86Y63.js +1 -0
  71. package/app/assets/S7HbowYz.js +373 -0
  72. package/app/assets/Udlj1Cgf.js +1 -0
  73. package/app/assets/W7D4Svcn.js +1 -0
  74. package/app/assets/{C0bzfYFC.js → XCH_yrJ8.js} +1 -1
  75. package/app/assets/_zaonxnw.js +1 -0
  76. package/app/assets/aIFwnVFr.js +4 -0
  77. package/app/assets/kXDKfUfE.js +4 -0
  78. package/app/assets/qRIRkBN0.js +1 -0
  79. package/app/assets/tJkeLYCp.js +1 -0
  80. package/app/assets/w46wk7KI.css +2 -0
  81. package/app/index.html +35 -27
  82. package/app/landing.css +17 -0
  83. package/dist/{chunk-XAI7WLQN.js → chunk-SDRLD5PK.js} +995 -121
  84. package/dist/embed.js +1 -1
  85. package/dist/index.js +1 -1
  86. package/package.json +6 -2
  87. package/app/assets/8RmjiG1u.js +0 -1
  88. package/app/assets/B6E7IbMa.js +0 -1
  89. package/app/assets/BBLekwhn.js +0 -1
  90. package/app/assets/BCmzDvBt.js +0 -1
  91. package/app/assets/BHsXOlR9.js +0 -2
  92. package/app/assets/BLPGwQub.js +0 -1
  93. package/app/assets/BO_H_8D-.js +0 -1
  94. package/app/assets/BUcTqhSL.js +0 -1
  95. package/app/assets/BX4n4TJQ.js +0 -1
  96. package/app/assets/BZ6aghND.js +0 -959
  97. package/app/assets/BbFio3pA.js +0 -1
  98. package/app/assets/BbdU8Zop.js +0 -2
  99. package/app/assets/Bdp1DKAx.js +0 -1
  100. package/app/assets/BgkATqP8.js +0 -1
  101. package/app/assets/Bpq2Whsw.js +0 -3
  102. package/app/assets/BuhEpB12.js +0 -1
  103. package/app/assets/BxW20weH.js +0 -1
  104. package/app/assets/C-8gMuEc.js +0 -1
  105. package/app/assets/C29gYFqD.js +0 -2
  106. package/app/assets/C3PpGnxB.js +0 -1
  107. package/app/assets/CF6jyexg.js +0 -41
  108. package/app/assets/CNC8pjhK.js +0 -1
  109. package/app/assets/CS2mpWDL.js +0 -1
  110. package/app/assets/CSYxJn5_.js +0 -1
  111. package/app/assets/CVpzA8TC.js +0 -8
  112. package/app/assets/CZoj-eMm.js +0 -1
  113. package/app/assets/Cf8o-5U6.js +0 -2
  114. package/app/assets/CkPnfgzt.js +0 -2
  115. package/app/assets/ClIJYMXh.js +0 -1
  116. package/app/assets/CxGlndnu.js +0 -1
  117. package/app/assets/D0jMUNSI.js +0 -2
  118. package/app/assets/D3ZaTPbf.js +0 -1
  119. package/app/assets/D6kbK-ng.js +0 -1
  120. package/app/assets/DEEGN6UG.js +0 -6
  121. package/app/assets/DF5d9evm.js +0 -1
  122. package/app/assets/DGpfJHer.js +0 -1
  123. package/app/assets/DOU2MWdA.js +0 -1
  124. package/app/assets/DPdwSUSw.js +0 -1
  125. package/app/assets/DXtaGfxh.js +0 -1
  126. package/app/assets/DbqogdCK.js +0 -356
  127. package/app/assets/DdHg_zlz.js +0 -1
  128. package/app/assets/DiIO0MJM.js +0 -1
  129. package/app/assets/DnZlL3PP.js +0 -1
  130. package/app/assets/H8HkC925.js +0 -1
  131. package/app/assets/KuSp3gJs.css +0 -2
  132. package/app/assets/VZqLr_d1.js +0 -7
  133. package/app/assets/_OOlglTI.js +0 -1
  134. package/app/assets/bgQ-QVd7.js +0 -1
  135. package/app/assets/mA5FXiEh.js +0 -2
  136. package/app/assets/mZyfO6B4.js +0 -1
  137. package/app/assets/p4yYbMPY.js +0 -2
  138. package/app/assets/pjlgs2cl.js +0 -1
  139. package/app/assets/pneb1la9.js +0 -1
  140. package/app/assets/uVZVQeN3.js +0 -27
  141. package/app/assets/zspOy9D_.js +0 -2
@@ -0,0 +1,4 @@
1
+ import{d as e,l as t}from"./CYz610vE.js";var n=e=>typeof e==`string`,r=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},i=e=>e==null?``:String(e),a=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},o=/###/g,s=e=>e&&e.includes(`###`)?e.replace(o,`.`):e,c=e=>!e||n(e),l=(e,t,r)=>{let i=n(t)?t.split(`.`):t,a=0;for(;a<i.length-1;){if(c(e))return{};let t=s(i[a]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++a}return c(e)?{}:{obj:e,k:s(i[a])}},u=(e,t,n)=>{let{obj:r,k:i}=l(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=l(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=l(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},d=(e,t,n,r)=>{let{obj:i,k:a}=l(e,t,Object);i[a]=i[a]||[],i[a].push(n)},f=(e,t)=>{let{obj:n,k:r}=l(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},p=(e,t,n)=>{let r=f(e,n);return r===void 0?f(t,n):r},m=(e,t,r)=>{for(let i in t)i!==`__proto__`&&i!==`constructor`&&(Object.prototype.hasOwnProperty.call(e,i)?n(e[i])||e[i]instanceof String||n(t[i])||t[i]instanceof String?r&&(e[i]=t[i]):m(e[i],t[i],r):e[i]=t[i]);return e},h=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),g={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},_=e=>n(e)?e.replace(/[&<>"'\/]/g,e=>g[e]):e,v=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},y=[` `,`,`,`?`,`!`,`;`],b=new v(20),x=(e,t,n)=>{t||=``,n||=``;let r=y.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=b.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},S=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},C=e=>e?.replace(/_/g,`-`),w={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},T=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||w,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,r,i){return i&&!this.debug?null:(e=e.map(e=>n(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),n(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},E=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},D=class extends E{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r,i={}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=i.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:i.ignoreJSONStructure,s;e.includes(`.`)?s=e.split(`.`):(s=[e,t],r&&(Array.isArray(r)?s.push(...r):n(r)&&a?s.push(...r.split(a)):s.push(r)));let c=f(this.data,s);return!c&&!t&&!r&&e.includes(`.`)&&(e=s[0],t=s[1],r=s.slice(2).join(`.`)),c||!o||!n(r)?c:S(this.data?.[e]?.[t],r,a)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),u(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,r,i={silent:!1}){for(let i in r)(n(r[i])||Array.isArray(r[i]))&&this.addResource(e,t,i,r[i],{silent:!0});i.silent||this.emit(`added`,e,t,r)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=f(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?m(s,n,i):s={...s,...n},u(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},O={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},k=Symbol(`i18next/PATH_KEY`);function A(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===k?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function j(e,t){let{[k]:n}=e(A()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var M=e=>!n(e)&&typeof e!=`boolean`&&typeof e!=`number`,N=class e extends E{constructor(e,t={}){super(),a([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=T.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=M(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let r=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;r===void 0&&(r=`:`);let i=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,a=t.ns||this.options.defaultNS||[],o=r&&e.includes(r),s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!x(e,r,i);if(o&&!s){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:n(a)?[a]:a};let o=e.split(r);(r!==i||r===i&&this.options.ns.includes(o[0]))&&(a=o.shift()),e=o.join(i)}return{key:e,namespaces:n(a)?[a]:a}}translate(t,r,i){let a=typeof r==`object`?{...r}:r;if(typeof a!=`object`&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a==`object`&&(a={...a}),a||={},t==null)return``;typeof t==`function`&&(t=j(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?j(e,{...this.options,...a}):String(e));let o=a.returnDetails===void 0?this.options.returnDetails:a.returnDetails,s=a.keySeparator===void 0?this.options.keySeparator:a.keySeparator,{key:c,namespaces:l}=this.extractFromKey(t[t.length-1],a),u=l[l.length-1],d=a.nsSeparator===void 0?this.options.nsSeparator:a.nsSeparator;d===void 0&&(d=`:`);let f=a.lng||this.language,p=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()===`cimode`)return p?o?{res:`${u}${d}${c}`,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:`${u}${d}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:c;let m=this.resolve(t,a),h=m?.res,g=m?.usedKey||c,_=m?.exactUsedKey||c,v=[`[object Number]`,`[object Function]`,`[object RegExp]`],y=a.joinArrays===void 0?this.options.joinArrays:a.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=a.count!==void 0&&!n(a.count),S=e.hasDefaultValue(a),C=x?this.pluralResolver.getSuffix(f,a.count,a):``,w=a.ordinal&&x?this.pluralResolver.getSuffix(f,a.count,{ordinal:!1}):``,T=x&&!a.ordinal&&a.count===0,E=T&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${C}`]||a[`defaultValue${w}`]||a.defaultValue,D=h;b&&!h&&S&&(D=E);let O=M(D),k=Object.prototype.toString.apply(D);if(b&&D&&O&&!v.includes(k)&&!(n(y)&&Array.isArray(D))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,D,{...a,ns:l}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(m.res=e,m.usedParams=this.getUsedParamsDetails(a),m):e}if(s){let e=Array.isArray(D),t=e?[]:{},n=e?_:g;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let r=`${n}${s}${e}`;t[e]=S&&!h?this.translate(r,{...a,defaultValue:M(E)?E[e]:void 0,joinArrays:!1,ns:l}):this.translate(r,{...a,joinArrays:!1,ns:l}),t[e]===r&&(t[e]=D[e])}h=t}}else if(b&&n(y)&&Array.isArray(h))h=h.join(y),h&&=this.extendTranslation(h,t,a,i);else{let e=!1,n=!1;!this.isValidLookup(h)&&S&&(e=!0,h=E),this.isValidLookup(h)||(n=!0,h=c);let r=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:h,o=S&&E!==h&&this.options.updateMissing;if(n||e||o){if(this.logger.log(o?`updateKey`:`missingKey`,f,u,x&&!o?`${c}${this.pluralResolver.getSuffix(f,a.count,a)}`:c,o?E:h),s){let e=this.resolve(c,{...a,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(a.lng||this.language):e.push(a.lng||this.language);let n=(e,t,n)=>{let i=S&&n!==h?n:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,u,t,i,o,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,u,t,i,o,a),this.emit(`missingKey`,e,u,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,a);T&&a[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],c+t,a[`defaultValue${t}`]||E)})}):n(e,c,E))}h=this.extendTranslation(h,t,a,m,i),n&&h===c&&this.options.appendNamespaceToMissingKey&&(h=`${u}${d}${c}`),(n||e)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${c}`:c,e?h:void 0,a))}return o?(m.res=h,m.usedParams=this.getUsedParamsDetails(a),m):h}extendTranslation(e,t,r,i,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});let o=n(e)&&(r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables),s;if(o){let t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let c=r.replace&&!n(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,r.lng||this.language||i.usedLng,r),o){let t=e.match(this.interpolator.nestingRegexp),n=t&&t.length;s<n&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>a?.[0]===e[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),r)),r.interpolation&&this.interpolator.reset()}let o=r.postProcess||this.options.postProcess,s=n(o)?[o]:o;return e!=null&&s?.length&&r.applyPostProcessor!==!1&&(e=O.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,i,a,o,s;return n(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?j(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(r))return;let c=this.extractFromKey(e,t),l=c.key;i=l;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let d=t.count!==void 0&&!n(t.count),f=d&&!t.ordinal&&t.count===0,p=t.context!==void 0&&(n(t.context)||typeof t.context==`number`)&&t.context!==``,m=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(r)||(s=e,!this.checkedLoadedFor[`${m[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${m[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(`, `)}" won't get resolved as namespace "${s}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),m.forEach(n=>{if(this.isValidLookup(r))return;o=n;let i=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,l,n,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(n,t.count,t));let r=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&e.startsWith(a)&&i.push(l+e.replace(a,this.options.pluralSeparator)),i.push(l+e),f&&i.push(l+r)),p){let n=`${l}${this.options.contextSeparator||`_`}${t.context}`;i.push(n),d&&(t.ordinal&&e.startsWith(a)&&i.push(n+e.replace(a,this.options.pluralSeparator)),i.push(n+e),f&&i.push(n+r))}}let s;for(;s=i.pop();)this.isValidLookup(r)||(a=s,r=this.getResource(n,e,s,t))}))})}),{res:r,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],r=e.replace&&!n(e.replace),i=r?e.replace:e;if(r&&e.count!==void 0&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(let e of t)delete i[e]}return i}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},P=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=T.create(`languageUtils`),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=C(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=C(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(n(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),n(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||=e[this.getScriptPartFromCode(t)],r||=e[this.formatLanguageCode(t)],r||=e[this.getLanguagePartFromCode(t)],r||=e.default,r||[]}toResolveHierarchy(e,t){let r=this.options.fallbackLng,i=Array.isArray(r)?r.join(`|`):r;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);let a=t===void 0||t===!1||n(t),o=t===void 0&&typeof this.options.fallbackLng==`function`,s=n(e)&&a&&!o,c=null;if(s){let n;n=t===void 0?`undefined`:t===!1?`boolean:false`:`string:${t}`,c=`${e.length}:${e}|${n}`}if(c!==null){let e=this.resolveHierarchyCache[c];if(e!==void 0)return e.slice()}let l=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),u=[],d=e=>{e&&(this.isSupportedCode(e)?u.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return n(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&d(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&d(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&d(this.getLanguagePartFromCode(e))):n(e)&&d(this.formatLanguageCode(e)),l.forEach(e=>{u.includes(e)||d(this.formatLanguageCode(e))}),c===null?u:(this.resolveHierarchyCache[c]=u,u.slice())}},F={zero:0,one:1,two:2,few:3,many:4,other:5},I={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},L=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=T.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=C(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),I;if(!e.match(/-|_/))return I;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>F[e]-F[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},R=(e,t,r,i=`.`,a=!0)=>{let o=p(e,t,r);return!o&&a&&n(r)&&(o=S(e,r,i),o===void 0&&(o=S(t,r,i))),o},ee=e=>e.replace(/\$/g,`$$$$`),z=class{constructor(e={}){this.logger=T.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:y}=e.interpolation;this.escape=t===void 0?_:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?h(i):a||`{{`,this.suffix=o?h(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?h(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?h(l):``,this.nestingPrefix=d?h(d):f||h(`$t(`),this.nestingSuffix=p?h(p):m||h(`)`),this.nestingOptionsSeparator=g||`,`,this.maxReplaces=v||1e3,this.alwaysFormat=y!==void 0&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,r,a){let o,s,c,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(!e.includes(this.formatSeparator)){let n=R(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,r,{...a,...t,interpolationkey:e}):n}let n=e.split(this.formatSeparator),i=n.shift().trim(),o=n.join(this.formatSeparator).trim();return this.format(R(t,l,i,this.options.keySeparator,this.options.ignoreJSONStructure),o,r,{...a,...t,interpolationkey:i})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let d=a?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=a?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:a.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}].forEach(t=>{for(c=0;o=t.regex.exec(e);){let r=o[1].trim();if(s=u(r),s===void 0){if(typeof d==`function`){let t=d(e,o,a);s=n(t)?t:``}else if(a&&Object.prototype.hasOwnProperty.call(a,r))s=``;else if(f){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),s=``}else!n(s)&&!this.useRawValueToEscape&&(s=i(s));let l=t.safeValue(s);if(e=e.replace(o[0],ee(l)),f?(t.regex.lastIndex+=l.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),e}nest(e,t,r={}){let a,o,s,c=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${h(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,s);let a=i.match(/'/g),o=i.match(/"/g);((a?.length??0)%2==0&&!o||(o?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{s=JSON.parse(i),t&&(s={...t,...s})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return s.defaultValue&&s.defaultValue.includes(this.prefix)&&delete s.defaultValue,e};for(;a=this.nestingRegexp.exec(e);){let l=[];s={...r},s=s.replace&&!n(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=/{.*}/s.test(a[1])?a[1].lastIndexOf(`}`)+1:a[1].indexOf(this.formatSeparator);if(u!==-1&&(l=a[1].slice(u).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),a[1]=a[1].slice(0,u)),o=t(c.call(this,a[1].trim(),s),s),o&&a[0]===e&&!n(o))return o;n(o)||(o=i(o)),o||=(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),``),l.length&&(o=l.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:a[1].trim()}),o.trim())),e=e.replace(a[0],o),this.regexp.lastIndex=0}return e}},B=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},V=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(C(r),i),t[o]=s),s(n)}},te=e=>(t,n,r)=>e(C(n),r)(t),ne=class{constructor(e={}){this.logger=T.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?V:te;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=V(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator),a=[];for(let e=0;e<i.length;e++){let t=i[e];for(;t.indexOf(`(`)>-1&&!t.includes(`)`)&&e+1<i.length;)t=`${t}${this.formatSeparator}${i[++e]}`;a.push(t)}return a.reduce((e,t)=>{let{formatName:i,formatOptions:a}=B(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},re=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},ie=class extends E{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=T.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{d(n.loaded,[i],a),re(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,r={},i){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),i&&i();n(e)&&(e=this.languageUtils.toResolveHierarchy(e)),n(t)&&(t=[t]);let a=this.queueLoad(e,t,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(n!=null&&n!==``){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},H=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),n(e[1])&&(t.defaultValue=e[1]),n(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),U=e=>(n(e.ns)&&(e.ns=[e.ns]),n(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),n(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),W=()=>{},G=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},K=class e extends E{constructor(e={},t){if(super(),this.options=U(e),this.services={},this.logger=T,this.modules={external:[]},G(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(n(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let i=H();this.options={...i,...this.options,...U(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);let a=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?T.init(a(this.modules.logger),this.options):T.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:ne;let t=new P(this.options);this.store=new D(this.options.resources,this.options);let n=this.services;n.logger=T,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new L(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=a(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new z(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new ie(a(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=a(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=a(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new N(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=W,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=r(),s=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),o.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),o}loadResources(e,t=W){let r=t,i=n(e)?e:this.language;if(typeof e==`function`&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return r();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};i?t(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(e)})}else r(null)}reloadResources(e,t,n){let i=r();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=W,this.services.backendConnector.reload(e,t,e=>{i.resolve(),n(e)}),i}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&O.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let i=r();this.emit(`languageChanging`,e);let a=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(n,r)=>{r?this.isLanguageChangingTo===e&&(a(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,r),this.logger.log(`languageChanged`,r)):this.isLanguageChangingTo=void 0,i.resolve((...e)=>this.t(...e)),t&&t(n,(...e)=>this.t(...e))},s=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let r=n(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(n(t)?[t]:t);i&&(this.language||a(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,e=>{o(e,i)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),i}getFixedT(e,t,r,i){let a=i?.scopeNs,o=(e,t,...n)=>{let i;i=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(n)),i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs;let s=i.ns!==void 0&&i.ns!==null;i.ns=i.ns||o.ns,i.keyPrefix!==``&&(i.keyPrefix=i.keyPrefix||r||o.keyPrefix);let c={...this.options,...i};Array.isArray(a)&&!s&&(c.ns=a),typeof i.keyPrefix==`function`&&(i.keyPrefix=j(i.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return i.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=j(e,c)),`${i.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=j(e,c)),u=i.keyPrefix?`${i.keyPrefix}${l}${e}`:e),this.t(u,i)};return n(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=r,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let i=r();return this.options.ns?(n(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{i.resolve(),t&&t(e)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){let i=r();n(e)&&(e=[e]);let a=this.options.preload||[],o=e.filter(e=>!a.includes(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=a.concat(o),this.loadResources(e=>{i.resolve(),t&&t(e)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new P(H());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=W){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new D(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...H().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new z(n)}return a.translator=new N(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();K.createInstance,K.dir,K.init,K.loadResources,K.reloadResources,K.use,K.changeLanguage,K.getFixedT,K.t,K.exists,K.setDefaultNamespace,K.hasLoadedNamespace,K.loadNamespaces,K.loadLanguages;var q={type:`3rdParty`,init(n){e(n.options.react),t(n)}},J={app:{reconnecting:`Reconnecting…`,dropSqlite:`Drop to open the SQLite file`,dropSqliteHint:`Opened in your browser with WebAssembly — the file stays on your computer. Drop the -wal sidecar together with it if there is one.`,dropFailedTitle:`Could not open the dropped file`,dropNotSqlite:`{{name}} is not a SQLite database file.`,crashTitle:`Something went wrong`,crashBody:`The app hit an unexpected error. Reloading restores your connections and tabs; unsaved grid edits are lost.`,crashReload:`Reload`,dialogFailed:`The dialog could not open: {{message}}`},language:{auto:`System language ({{name}})`,en:`English`,ko:`한국어`,zh:`中文(简体)`,ja:`日本語`,de:`Deutsch`,fr:`Français`},settings:{title:`Safety`,description:`Guard rails against accidental data loss. Read-only, environment colour and transaction mode are set per connection.`,language:`Language`,languageHint:`Applies immediately. "System language" follows your browser.`,resetDefaults:`Reset to defaults`,done:`Done`,analytics:`Share anonymous usage statistics`,analyticsHint:`Sends anonymous usage events (engine, feature, statement type) to Google Analytics. Never SQL text, host names, table or user names.`,analyticsUnavailableHint:`Not active in this build (no measurement id configured).`,persistHistory:`Keep query history across reloads`,persistHistoryHint:`Statement text is stored in this browser (password literals are masked; the open editor tabs themselves are always kept). Off: history and versions live only until the tab closes.`,ai:{intro:`Planche can ask a model why a statement failed or why a plan is slow. The question is put together here in the app and sent by your local agent to the provider below — nothing about your SQL or your schema reaches planche.dev.`,provider:`Provider`,openaiCompatible:`OpenAI-compatible`,model:`Model`,baseUrl:`Base URL`,baseUrlHint:`Leave empty for the provider's own endpoint. Any OpenAI-compatible server works — Azure, OpenRouter, a local Ollama.`,key:`API key`,keyHint:`Handed to the local agent and used there. It is never kept in this browser and never sent to planche.dev.`,remember:`Remember this key on this machine`,rememberHint:`Writes it to {{path}}, readable only by you. Without this the key lives in the running agent and is gone when it stops.`,save:`Save`,forget:`Forget key`,saved:`Saved.`,none:`No key set.`,configuredSession:`A key is set for this agent session only.`,configuredFile:`A key is stored at {{path}}.`,configuredEnv:`This agent's AI settings come from its environment and cannot be changed here.`,unreachable:`The agent is not reachable, so AI settings cannot be changed.`,title:`AI explanations`,description:`Which model explains a failure or a plan, and whose key pays for it.`,cli:`Local CLI (no key)`,cliCommand:`Command`,cliHint:`Runs an agent CLI already installed and signed in on this machine, so there is no key to enter. It explains failures and plans; the AI panel needs a provider that can call tools.`,cliNone:`No agent CLI was found on this machine. Install Claude Code or Codex, or pick another provider.`,profile:`Anthropic (this machine's login)`,profileHint:"Uses the credential this machine is already signed in with — the SDK finds it on its own after `ant auth login`. Nothing to paste, and unlike a local CLI this is the real API, so the AI panel works too.",profileNone:"No Anthropic credential was found on this machine. Run `ant auth login`, or set a key instead.",configuredChoice:`Using {{provider}} — no key held; the choice is kept in {{path}}.`},query:{title:`Query`,description:`How a statement is run: what F9 executes, how many rows come back, and what is previewed first.`},general:{title:`General`,description:`Language, what survives a reload, and what leaves this machine.`}},menu:{settings:{safety:`Safety…`,language:`Language`,title:`Settings`,theme:`Theme`,query:`Query…`,general:`General…`,ai:`AI…`},help:{gettingStarted:`Getting Started`,about:`About Planche`,title:`Help`,documentation:`Documentation`,learn:`Learn SQL`,terms:`Terms of Use`,license:`Licence`,support:`Contact support`,mcp:`Connect an AI agent (MCP)…`,privacy:`Privacy policy`,whatsNew:`What's New`},connection:{title:`Connection`,connect:`Connect`,disconnect:`Disconnect`,readOnly:`Read-only`,manualTransactions:`Manual Transactions`,saveDatabaseFile:`Save Database File`,saveDatabaseFileBlocked:`Save Database File (load -wal first)`,exit:`Exit`,sync:`Connection sync`},query:{title:`Query`,execute:`Execute`,executeStatementAtCursor:`Execute Statement at Cursor`,executeWholeScript:`Execute Whole Script`,newQueryTab:`New Query Tab`,findReplace:`Find & Replace`,localHistory:`Local History…`,explainPlan:`Explain Plan`,explainAnalyze:`Explain Analyze (runs the statement)`,structure:`Query Structure`},edit:{title:`Edit`,undo:`Undo`,redo:`Redo`,cut:`Cut`,copy:`Copy`,paste:`Paste`,selectAll:`Select All`},database:{title:`Database`,create:`Create Database`,alter:`Alter Database`,drop:`Drop Database`,copy:`Copy Database`,compare:`Compare Schemas…`,truncate:`Truncate Database`,compareData:`Compare Data…`,groupBy:`Group and Count…`},table:{title:`Table`,create:`Create Table`,alter:`Alter Table`,drop:`Drop Table`,rename:`Rename Table`,truncate:`Truncate Table`,duplicateStructure:`Duplicate Table Structure`},export:{title:`Export`,csv:`Download to CSV`,tsv:`Download to TSV`,schemaHtml:`Schema to HTML`,links:`Export column links…`,importLinks:`Import column links…`},tools:{title:`Tools`,userManager:`User Manager`,processList:`Process List`,variables:`Variables`,status:`Status`,flush:`Flush`,quickCommand:`Quick Command`,viewErd:`View ERD`,scratchpad:`Scratchpad (in-browser SQLite)`,federated:`Federated query (join across connections)…`,federatedTab:`Federated {{n}}`,ai:`AI assistant`},messages:{databaseFileSaved:`Database file saved`,databaseExported:`Database exported as download`,databaseExportedWithReason:`Database exported as download — {{reason}}`,errorSavingDatabase:`Error saving database: {{message}}`,noDatabaseSelected:`No database selected`,noTableSelected:`No table selected`,noActiveConnection:`No active connection`,databaseDropped:`Database "{{database}}" dropped successfully`,errorDroppingDatabase:`Error dropping database: {{message}}`,noTablesInDatabase:`No tables found in database "{{database}}"`,databaseTruncated_one:`All {{count}} table in "{{database}}" truncated successfully`,databaseTruncated_other:`All {{count}} tables in "{{database}}" truncated successfully`,errorTruncatingDatabase:`Error truncating database: {{message}}`,tableDropped:`Table "{{table}}" dropped successfully`,errorDroppingTable:`Error dropping table: {{message}}`,tableTruncated:`Table "{{table}}" truncated successfully`,errorTruncatingTable:`Error truncating table: {{message}}`,renameTablePrompt:`Rename table "{{table}}" to:`,tableRenamed:`Table "{{table}}" renamed to "{{newName}}" successfully`,errorRenamingTable:`Error renaming table: {{message}}`,truncateDatabaseTitle:`Truncate all tables in "{{name}}"?`,truncateDatabaseDescription:`Every row in {{count}} table(s) of "{{name}}" will be deleted. Table structures are kept. This cannot be undone.`,truncateDatabaseConfirm:`Truncate all tables`,renameTableTitle:`Rename table`,renameTableConfirm:`Rename`,noLinksToExport:`No column links to export.`,linksExported:`Exported {{count}} column links.`,linksImported:`Imported {{count}} column links.`,linksImportedPartial:`Imported {{count}} column links; no matching profile for: {{profiles}}`,linksImportFailed:`Could not import column links: {{reason}}`}},about:{title:`About Planche`,tagline:`A database client for MySQL, MariaDB, PostgreSQL and SQLite.`,version:`Version`,website:`Website`,licenses:`Licenses`,licensesLink:`Third-party notices`,disclaimer:`Planche is provided "as is", without warranty of any kind. The authors are not liable for any damage or data loss arising from its use. Back up your data before running destructive statements.`,rights:`All rights reserved.`,legal:`Legal`,terms:`Terms`,privacy:`Privacy`,refund:`Refunds`},connection:JSON.parse('{"dialog":{"title":"Connect to Database","firstQueryTab":"Query 1","colHostName":"Host Name","colTarget":"Target","colDbms":"DBMS","noSaved":"No saved connections","unnamed":"(unnamed)","pickOnConnect":"(pick on connect)","noFile":"(no file)","selectPrompt":"Select a connection or add a new one","addNew":"Add New","delete":"Delete","testConnection":"Test Connection","connect":"Connect","close":"Close","unknownError":"Unknown error","browserTestHint":"In-browser SQLite connections open a local file when you click Connect.","testSuccess":"Connection successful","restoredUnsaved":"{{file}}: restored unsaved changes from the cached copy","restoredUnsavedDiskChanged":"{{file}}: restored unsaved changes from the cached copy — note the file on disk changed since","walPending":"{{file}} is in WAL mode: recent changes may still be in its -wal file. Use \\"Load -wal file\\" above to include them.","walApplied":"{{file}} opened with its -wal changes applied","connectFailedTitle":"Connection failed","testSuccessDescription":"The server accepted the credentials.","testFailedTitle":"Connection test failed","privacy":"Nothing you enter here is sent to or stored on planche.dev servers. Connection profiles live only in this browser\'s local storage; queries go straight from the local agent to your database.","hostKeyTitle":"Unknown SSH host key","hostKeyDescription":"{{host}}:{{port}} presented a {{type}} key with fingerprint {{fingerprint}}. Compare it with the fingerprint your server administrator gave you; accepting the wrong key lets an attacker read your traffic.","hostKeyAccept":"Trust this host","gatewayTitle":"Gateway profiles","gatewayAdd":"Add","gatewayAdded":"Added gateway profile {{name}}.","gatewayReadOnly":"read-only","gatewayWritable":"writable","gatewayProfileHint":"This connection uses the profile \\"{{name}}\\" held by the gateway; there is nothing to configure here.","gatewayLoadFailed":"Could not load the gateway profiles: {{error}}","export":"Export…","exportWithoutSecrets":"Without password","exportWithSecrets":"With password and keys","import":"Import…","exported":"Exported connection \\"{{name}}\\".","imported":"Imported connection \\"{{name}}\\".","importFailedTitle":"Could not import the connection"},"form":{"hostName":"Host Name","hostNamePlaceholder":"My Connection","dataSource":"Data Source","openVia":"Open Via","viaBrowser":"Browser (local file)","viaAgent":"Local agent","viaBrowserHint":"Nothing to install. Best for files no other program is using: the browser works on an in-memory copy and cannot lock the file, so edits made elsewhere while it is open are not seen and Save overwrites them.","viaAgentHint":"Opens the file with SQLite itself via npx planche — proper locking and WAL, safe alongside other programs using the same database.","databaseFile":"Database File","changeFile":"Change file","filePickerHint":"A file picker opens when you click Connect (tip: ⌘⇧. shows hidden files, ⌘⇧G lets you type a path).","fileRememberedHint":"The chosen file is remembered (Chromium) so reconnecting only asks for permission. Use Connection > Save Database File to write changes back.","authToken":"Auth Token","authTokenPlaceholder":"Leave empty to use the paired agent token","filePathPlaceholder":"/path/to/database.sqlite or :memory:","createIfMissing":"Create If Missing","createIfMissingHint":"Path is resolved on the tunneling server host","host":"Host","port":"Port","database":"Database","serviceName":"Service name","user":"User","password":"Password","savePassword":"Save password","savePasswordHint":"Off: the password is kept only for this browser session and never written to disk.","charset":"Charset","autoConnection":"Auto Connection","safety":"Safety","environment":"Environment","environmentHint":"tints the tab and workspace","readOnly":"Read-only","readOnlyHint":"Refuse statements that modify data or schema","transactions":"Transactions","txAuto":"Auto-commit","txManual":"Manual — Commit / Rollback from the toolbar","ssh":"SSH","sshTunnel":"SSH tunnel","sshTunnelHint":"Reach the database through an SSH jump host (opened by the local agent)","sshHost":"SSH Host","sshPort":"SSH port","sshUser":"SSH User","sshAuth":"SSH Auth","sshAuthKey":"Private key","sshAuthPassword":"Password","sshAuthAgent":"ssh-agent","sshAuthAgentHint":"Uses the keys loaded in the ssh-agent of the machine running npx planche (SSH_AUTH_SOCK).","sshPassword":"SSH Password","sshKey":"Private Key","sshKeyPick":"Choose key file…","sshKeyLoaded":"Key loaded","sshKeyHint":"Leave empty to use the IdentityFile from ~/.ssh/config (or ~/.ssh/id_*) on the agent\'s machine; a picked key is stored with this profile","sshPassphrase":"Passphrase","sshPassphrasePlaceholder":"Leave empty if the key has none","sshSecretsHint":"The SSH password, private key and passphrase follow the \\"Save password\\" setting above. Unknown host keys are shown for you to verify before the first connection and saved to ~/.planche/known_hosts on the agent\'s machine.","sshHostPlaceholder":"bastion.example.com or a Host alias from ~/.ssh/config","sshUserPlaceholder":"Leave empty to use ~/.ssh/config","sshTargetHint":"The database host and port are resolved on the jump host — use the database\'s real address (e.g. the RDS endpoint), not localhost or a local port forward.","connectionString":"Connection string","connectionStringApplied":"Applied to the fields below. The string itself is not saved — only the fields are.","connectionStringInvalid":"Not a PostgreSQL URI (expected postgresql://user:password@host/database).","neonHint":"Paste the URI from the Neon console (Connect > Connection string); the fields below are filled in from it.","supabaseHint":"Paste the URI from Supabase (Connect > Session pooler or Direct connection); the fields below are filled in from it.","supabasePoolerWarning":"Port 6543 is the transaction-mode pooler: each statement may run on a different backend, so switching schemas, temp tables, prepared statements and manual transactions do not work. Use the session pooler (port 5432) or the direct connection.","managedTlsHint":"TLS is always on for this service; the connection goes straight from the local agent to the service (no SSH tunnel).","d1AccountId":"Account ID","d1DatabaseId":"Database ID","d1ApiToken":"API Token","d1Hint":"Account ID: Cloudflare dashboard, right side of the account home. Database ID: Storage & Databases > D1 > your database. Token: My Profile > API Tokens > Create Token with the \\"D1 Edit\\" permission (or \\"D1 Read\\" for read-only). The local agent calls the Cloudflare API with it.","d1LimitsHint":"D1 runs each request on its own and auto-commits, so manual transactions are unavailable; the database appears as the single schema \\"main\\".","doDevUrl":"wrangler dev URL","doHint":"Start `wrangler dev` in your Worker project and paste the URL it prints (the port is 8787 unless you changed it). The local agent reads the Durable Objects of that session — including other `wrangler dev` sessions running at the same time.","doLimitsHint":"Local development only: deployed Durable Objects are reachable only from a Worker, so Cloudflare offers no API to query them. Each object appears as a database named \\"<namespace>/<object>\\"; every request auto-commits, so manual transactions are unavailable.","tls":"TLS","tlsEnable":"Encrypt the connection","tlsVerify":"Verify server certificate","tlsVerifyHint":"Off: self-signed certificates are accepted (encrypted, but the server is not authenticated). Not available over an SSH tunnel.","d1DevUrl":"Local dev URL","d1DevUrlHint":"Leave empty to use a Cloudflare account. Filled in, Planche reads the database that `wrangler dev` is running on this machine — no account and no API token, and the account fields below are ignored. Leave the Database ID empty when the dev server binds only one.","d1PickDatabase":"Pick a database","searchAuthHint":"User and password sign in with basic auth. Leave the user empty to send the password as an API key (the encoded id:key)."},"agent":{"copy":"Copy","looking":"Looking for the Planche agent…","online":"Agent <b>v{{version}}</b> is running at <mono>{{url}}</mono>","outdated":"Agent v{{version}} speaks protocol {{protocol}}, but this app needs a newer one. Restart it with <cmd/>","unauthorized":"Agent <b>v{{version}}</b> is running at <mono>{{url}}</mono>, but this app is not paired with it (the token changes on every start). Open the link printed in the agent\'s terminal, or paste the token under Configure.","offline":"No agent at <mono>{{url}}</mono>. Start it in a terminal — it opens this app already paired.","close":"Close","configure":"Configure","checkAgain":"Check again","urlLabel":"Agent URL","urlPlaceholder":"http://127.0.0.1:8888 (default)","tokenLabel":"Token","tokenPlaceholder":"Printed by the agent","reset":"Reset","save":"Save","remoteWarning":"This agent is not on your computer ({{host}}): every connection sends its passwords and SSH keys there.","remoteRefusedTitle":"Remote agent not allowed","remoteRefused":"The agent must run on this computer (127.0.0.1 or localhost). To use one on another machine, forward its port with `ssh -L 8888:127.0.0.1:8888 user@host` and keep the URL at http://127.0.0.1:8888.","gateway":"Gateway \\"{{name}}\\": {{count}} server-side profiles. Credentials stay on the gateway; pick a profile below."},"tab":{"noConnections":"No connections open. Press Connect to get started.","theSqliteFile":"the SQLite file","reopened":"Reopened {{file}}","reopenFailed":"Could not reopen file: {{message}}","reopenPrompt":"The browser needs your permission again to read <b>{{file}}</b>.","reopenFile":"Reopen file","closeConnection":"Close connection","reconnected":"Reconnected {{file}}","accessNotGranted":"File access was not granted; Save will export a download instead.","detachedPrompt":"Working on a cached copy of <b>{{file}}</b>. Reconnect the file to save changes in place.","reconnectFile":"Reconnect file","detachedHide":"Hide (Save will ask for the file when needed)","walFramesApplied_one":"Applied {{count}} WAL frame from {{file}}-wal","walFramesApplied_other":"Applied {{count}} WAL frames from {{file}}-wal","walNoChanges":"The -wal file had no committed changes","walLoadFailed":"Could not load -wal file: {{message}}","walPrompt":"<b>{{file}}</b> is in WAL mode: it may not show the latest data until its <mono>{{file}}-wal</mono> file is loaded, and saving is disabled until then. If no such file exists next to it (the database was closed cleanly), confirm that instead. If another program is still using this database, open it through the local agent (<mono>npx planche</mono>) instead: the browser cannot share the file safely.","loadWal":"Load -wal file","noWalHint":"I checked: there is no -wal file next to the database","noWal":"No -wal file","dismiss":"Dismiss","walHide":"Hide (saving stays disabled)","readOnlyBadge":"read-only"}}'),toolbar:{connect:`Connect (Alt+N)`,disconnect:`Disconnect`,newQueryTab:`New Query Tab (Alt+T)`,execute:`Execute (F9)`,executeStatement:`Execute statement at cursor / selection (Ctrl+Enter)`,commit:`Commit`,commitHint:`Commit the open transaction`,noOpenTransaction:`No open transaction`,rollback:`Rollback`,rollbackHint:`Discard the open transaction`,readOnlyBadge:`read-only`,readOnlyHint:`This connection refuses statements that modify data or schema`,userManager:`User Manager (Alt+U)`,quickCommand:`Quick Command`,processList:`Process List`,variables:`Variables`,status:`Status`,flush:`Flush`,fullscreen:`Fullscreen`},footer:{readOnly:`read-only`,txOpen:`tx open`,manualTx:`manual tx`},palette:{title:`Quick Command`,description:`Search for a command to run...`,inputPlaceholder:`Type a command or search...`,empty:`No commands found.`,groups:{connection:`Connection`,query:`Query`,database:`Database`,table:`Table`,tools:`Tools`},commands:{connect:`Connect`,disconnect:`Disconnect`,executeQuery:`Execute Query`,newQueryTab:`New Query Tab`,createDatabase:`Create Database`,dropDatabase:`Drop Database`,createTable:`Create Table`,alterTable:`Alter Table`,dropTable:`Drop Table`,processList:`Process List`,serverVariables:`Server Variables`,serverStatus:`Server Status`,flush:`Flush`,userManager:`User Manager`}},welcome:{title:`Welcome to Planche`,intro:`A SQL client that runs in your browser. Your databases are reached through a small agent on your machine, so credentials and data never leave your computer.`,skip:`Skip`,skipTitle:`Hide this screen (Help > Getting Started brings it back)`,copy:`Copy`,copied:`Copied`,sampleOpenFailed:`Could not open the sample database: {{message}}`,steps:{agent:{title:`Run the local agent`,body:`Run one of these in a terminal. It starts the agent and pairs it with this page.`},connection:{title:`Add a connection`,body:`Pick your database to open the connection form with the right defaults.`},sample:{title:`No database at hand? Try the sample`,body:`Load a sample web-shop database (24 tables, ~50k rows, views and triggers) into the browser to try the editor, grid and schema tree.`,loading:`Loading sample…`,button:`Try the sample database`}},terms:{title:`Before you start`,local:`Everything runs locally: credentials, queries and results stay on your machine and are never sent to us.`,asIs:`Planche is provided as is, without warranty. The safeguards (destructive confirms, read-only mode) are conveniences, not guarantees.`,dataLoss:`You are responsible for every statement executed through Planche. Back up your data before running anything destructive.`,agree:`I have read and agree to the Terms of Use.`,accepted:`You accepted the Terms of Use.`,readFull:`Read the full terms`}},schema:{treeLabel:`Schema`,unreachableHint:`Not the database this connection is bound to; create a profile for it to browse it`,objectType:{table:`Table`,view:`View`,procedure:`Procedure`,function:`Function`,trigger:`Trigger`,event:`Event`},menu:{showCreate:`Show Create {{type}}`,alter:`Alter {{type}}`,drop:`Drop {{type}}`,create:`Create {{type}}`,refresh:`Refresh`,unreachable:`Connect with a profile bound to this database to browse it`,openDatabase:`Open Database`,createSchema:`Create Schema…`,createTable:`Create Table`,dropDatabase:`Drop Database`,openSchema:`Open Schema`,dropSchema:`Drop Schema`,newQueryTab:`New Query Tab`,generateSql:`Generate SQL`,openTable:`Open Table`,alterTable:`Alter Table`,showCreateTable:`Show Create Table`,duplicateStructure:`Duplicate Structure`,copyTable:`Copy Table to…`,compare:`Compare {{type}}…`,truncateTable:`Truncate Table`,dropTable:`Drop Table`,exportCsv:`Export to CSV`,exportTsv:`Export to TSV…`,openView:`Open View`,alterView:`Alter View`,showCreateView:`Show Create View`,dropView:`Drop View`,compareData:`Compare Data…`,groupBy:`Group and Count…`,copyKey:`Copy key name`,openKey:`Open`,copyName:`Copy name`},actions:{createStatementUnavailable:`-- Could not retrieve CREATE statement for {{type}} {{name}}`,getCreateFailed:`Failed to get CREATE {{type}}: {{message}}`,createTabTitle:`Create {{type}}`,createSchemaTabTitle:`Create Schema`,generateSqlFailed:`Could not generate SQL: {{message}}`,dropTableTitle:`Drop table "{{name}}"?`,dropTableDescription:`This permanently deletes the table and every row in it{{from}}. This cannot be undone.`,dropTableConfirm:`Drop table`,dropObjectTitle:`Drop {{type}} "{{name}}"?`,dropObjectDescription:`The {{type}} definition will be removed{{from}}. This cannot be undone.`,dropObjectConfirm:`Drop {{type}}`,fromDatabase:` from database "{{database}}"`,dropped:`Dropped {{type}} {{name}}`,dropFailed:`Failed to drop {{type}}`,dropDatabaseTitle:`Drop database "{{name}}"?`,dropDatabaseDescription:`This permanently deletes the database with all of its tables and data. This cannot be undone.`,dropDatabaseConfirm:`Drop database`,droppedDatabase:`Dropped database {{name}}`,dropDatabaseFailed:`Failed to drop database`,dropSchemaTitle:`Drop schema "{{name}}"?`,dropSchemaDescription:`This permanently deletes the schema with all of its tables and data. This cannot be undone.`,dropSchemaConfirm:`Drop schema`,droppedSchema:`Dropped schema {{name}}`,dropSchemaFailed:`Failed to drop schema`,truncateTitle:`Truncate table "{{name}}"?`,truncateDescription:`Every row in "{{name}}" will be deleted. The table structure is kept. This cannot be undone.`,truncateConfirm:`Truncate table`,truncated:`Truncated {{name}}`,truncateFailed:`Failed to truncate`},tree:{loadDatabasesFailed:`Failed to load databases: {{message}}`},root:{newQuery:`New query tab`,newConsole:`New console tab`,createIndex:`Create index…`,clusterHealth:`Cluster health`,nodes:`Nodes`,shards:`Shards`,templates:`Index templates`},topology:{cluster:`This Redis is a node of a cluster: Planche shows the keys on this node only and does not follow cluster redirects yet.`}},query:{editor:{destructiveMarker:`Destructive: {{what}}`,readOnlyMarker:`Connection is read-only; this statement modifies data or schema`,actionExecute:`Execute (per settings)`,actionExecuteStatement:`Execute Statement at Cursor / Selection`,actionExecuteScript:`Execute Whole Script`,actionExplainPlan:`Explain Plan`,actionQueryStructure:`Query Structure`},tabs:{newQuery:`New Query`,queryTitle:`Query {{n}}`,erdViewer:`ERD Viewer`,close:`Close`,closeOthers:`Close Others`,closeLeft:`Close Tabs to the Left`,closeRight:`Close Tabs to the Right`,closeAll:`Close All`},executor:{noActiveConnection:`No active connection`,uncommittedTitle:`Uncommitted transaction`,uncommittedDescription:`This connection has an open transaction. Disconnecting will roll back its changes.`,uncommittedConfirm:`Rollback and disconnect`,unsavedTitle:`Unsaved changes`,unsavedDescription:`{{file}} has changes that were not saved to its file. Disconnecting discards them (use Connection > Save Database File first to keep them).`,theSqliteDatabase:`The SQLite database`,unsavedConfirm:`Discard and disconnect`}},result:JSON.parse('{"tabs":{"message":"Message","info":"Info","history":"History","result":"Result","resultN":"Result {{n}}","plan":"Plan","structure":"Structure","structureN":"Structure {{n}}"},"message":{"executing":"Executing query...","error":"Error: {{message}}","total":" (Total: {{ms}}ms)","ready":"Ready.","log":"Execution log","statementN":"Statement {{n}}","limitedBadge":"limit hit","insertId":"insert id {{id}}","failed":"Failed","failedStatement":"Failed statement","summary":"{{ok}} succeeded · {{failed}} failed · {{ms}} total","copy":"Copy","copied":"Copied","showSql":"Show SQL","hideSql":"Hide SQL"},"hints":{"title":"Hint","unknownColumn":"No column named {{name}} here. Did you mean {{suggestions}}?","unknownTable":"No table named {{name}} here. Did you mean {{suggestions}}?","syntaxSwap":"{{engine}} writes {{expected}} where this uses {{found}}.","doubleQuotedLiteral":"{{engine}} reads \\"{{value}}\\" as a column name, not text. Write \'{{value}}\' for a string."},"ai":{"title":"AI explanation","explain":"Explain with AI","thinking":"Reading the failure…","by":"by {{model}}","applyFix":"Open the fix in a new tab","failed":"Could not explain this: {{message}}","noFailure":"There is no failed statement to explain.","noPack":"The prompt could not be fetched from planche.dev.","badShape":"The model did not answer in the expected shape.","noPlan":"There is no plan to explain yet.","explainPlan":"Explain this plan"},"info":{"empty":"No query information available.","resultN":"Result {{n}}","metadata":"Query Metadata","executionTime":"Execution Time","notAvailable":"N/A","affectedRows":"Affected Rows","fields":"Fields","fieldDetails":"Field Details","colName":"Name","colType":"Type","colTable":"Table","resultSets":"Result Sets","rowsReturned":"Rows Returned","insertId":"Last Insert ID","lastQuery":"Last executed statement","copy":"Copy","copied":"Copied","colOrigin":"Origin","primaryKey":"Primary key","rowsAndFields":"{{rows}} rows × {{fields}} fields","noFields":"This statement returned no columns."},"rowForm":{"colColumn":"Column","colValue":"Value","insertTitle":"Insert row","editTitle":"Edit row","loading":"Loading columns...","preview":"Statement","nothingToWrite":"Nothing to write","insert":"Insert","update":"Update","stageInsert":"Add as pending row","stageEdit":"Apply to grid","stageHint":"Put the values in the grid without running anything; commit later with the other edits.","inserted":"Row inserted into {{table}}","updated":"Row updated in {{table}}","confirmInsertTitle":"Insert a row into {{table}}?","confirmUpdateTitle":"Update a row in {{table}}?","inTransaction":"Runs inside the open transaction","pickDate":"Pick a date","now":"Now","formatJson":"Format","binaryUnsupported":"Binary columns cannot be edited here; leave NULL / DEFAULT or set them with SQL.","generateUuid":"Generate UUID","defaultValue":"Default value","clickToChange":"Click to change","empty":"(empty)","autoHint":"Generated by the server","mode":{"keep":"Keep","auto":"Auto","value":"Value"},"invalid":{"integer":"Enter a whole number","unsigned":"This column does not accept negative numbers","number":"Enter a number","json":"Invalid JSON","date":"Use YYYY-MM-DD","datetime":"Use YYYY-MM-DD HH:MM:SS","time":"Use HH:MM:SS","length":"At most {{max}} characters"}},"history":{"copied":"Copied to clipboard","searchPlaceholder":"Search history...","all":"All","success":"Succeeded","failed":"Failed","thisTab":"This tab only","noMatch":"No entries match.","count":"{{count}} entries","clear":"Clear","clearTitle":"Clear query history?","clearDescription":"All {{count}} entries for this connection will be removed. This cannot be undone.","clearConfirm":"Clear history","insert":"Insert into editor","inserted":"Inserted into the editor","copy":"Copy","rows":"{{count}} rows","affected":"{{count}} affected","today":"Today","yesterday":"Yesterday","empty":"No query history."},"json":{"arrayLength":"Array[{{count}}]","keys_one":"{{count}} key","keys_other":"{{count}} keys","invalid":"Invalid JSON","clickToView":"Click to view JSON","expandAll":"Expand all","collapseAll":"Collapse all","edit":"Edit","view":"View","copied":"Copied","copy":"Copy","shortcutHint":"{{mod}}+Enter to save · Esc to cancel","cancel":"Cancel","save":"Save"},"text":{"clickToView":"Click to view text","size":"{{chars}} chars · {{lines}} lines","wrap":"Wrap","preview":"Preview","source":"Source"},"grid":{"readOnlyConnection":"Read-only connection","readOnlyWal":"Read-only: -wal file not loaded","readOnlyNoPk":"Read-only: table has no primary key","commitTitle":"Commit {{count}} change(s) to {{table}}?","commitDescription":"The following statements will be executed.","commitConfirm":"Commit","rowPrefix":"Row {{row}}:","cancelled":"cancelled","commitFailed":"Commit failed: {{message}}","executedInTransaction":"Executed {{count}} change(s) inside the open transaction — press Commit in the toolbar to make them permanent (reloading rolls them back)","committed":"Committed {{count}} change(s) to {{table}}","noData":"No data to display.","commit":"Commit","discard":"Discard","addRow":"Add row","removeNewRow":"Cancel this new row","addRowForm":"Add with form","addRowFormHint":"Open a form with an input per column (committed as INSERT)","editRowForm":"Edit this row in a form","addRowHint":"Add a new row (committed as INSERT)","delete":"Delete","deleteCount":"Delete ({{count}})","deleteHint":"Delete the selected rows (committed as DELETE). Select rows with the row-number column.","field":"Field","searchPlaceholder":"Search...","orderBy":"Order by","none":"None","refresh":"Refresh","dismiss":"Dismiss","clearSelection":"Clear selection","columns":"Columns","showAllColumns":"Show all","hideAllColumns":"Hide all","resetWidths":"Reset widths","selectAll":"Select all rows","emptyTable":"This table has no rows.","noRows":"No rows returned.","addARow":"Add a row","markedForDeletion":"Marked for deletion — click to restore","newRow":"New row","clickToSelect":"Click to select; Shift/Ctrl for multiple","rows":"Rows: {{count}}","rowsWithNew":"Rows: {{count}} (+{{added}})","sortedBy":"Sorted by: {{column}} {{direction}}","pageRange":"Rows {{from}}–{{to}}","firstPage":"First page","prevPage":"Previous page","nextPage":"Next page","lastPage":"Last page","pagingBlocked":"Commit or discard your changes before changing page","selected":"{{count}} selected","cellsModified":"{{count}} cell(s) modified","newCount":"{{count}} new","toDelete":"{{count}} to delete","searchMode":"Match mode","contains":"contains","equals":"equals","followLink":"Open {{table}} where {{column}} = value","linkColumn":"Link \\"{{column}}\\" to another table…","editLink":"Edit link of \\"{{column}}\\"…","removeLink":"Remove link","copyValue":"Copy value","filterByValue":"Filter: {{column}} = this value","clearFilter":"Clear filter","copyColumnName":"Copy column name","editCell":"Edit cell","setNull":"Set NULL","setEmpty":"Set empty string","restoreRow":"Restore row","hideColumn":"Hide column \\"{{column}}\\"","copyRowsTsv_one":"Copy row as TSV (with header)","copyRowsTsv_other":"Copy {{count}} rows as TSV (with header)","copyRowsCsv_one":"Copy row as CSV","copyRowsCsv_other":"Copy {{count}} rows as CSV","copyRowsJson_one":"Copy row as JSON","copyRowsJson_other":"Copy {{count}} rows as JSON","copyRowsInsert_one":"Copy row as INSERT","copyRowsInsert_other":"Copy {{count}} rows as INSERT","deleteRowsPending_one":"Delete row (pending until Commit)","deleteRowsPending_other":"Delete {{count}} rows (pending until Commit)","sendRowsToScratchpad_one":"Send row to scratchpad","sendRowsToScratchpad_other":"Send {{count}} rows to scratchpad","sendAllToScratchpad":"Send all {{count}} loaded rows to scratchpad","sentToScratchpad":"{{count}} rows copied into scratchpad table {{table}}.","changesSince":"Since last load: {{changed}} changed · {{added}} new · {{gone}} gone","changesToggle":"Toggle highlighting of what changed since the previous load","changesDismiss":"Forget these changes","previousValue":"Previous value: {{value}}","groupByValue":"Group and count by {{column}}","openItem":"Open {{name}}"},"link":{"title":"Link column to another table","source":"Column","hint":"Values of this column become links: clicking one opens the target table filtered to the matching row(s). Real foreign keys are linked automatically.","targetDatabase":"Target database","targetTable":"Target table","targetColumn":"Target column","pickTable":"Choose a table","pickColumn":"Choose a column","remove":"Remove link","cancel":"Cancel","save":"Save link","targetConnection":"Target connection","targetNotConnected":"The linked connection is not open. Connect it first."},"running":{"label":"Querying…","elapsed":"{{seconds}}s","stop":"Stop","stopping":"Stopping…","cannotCancel":"This engine cannot interrupt a statement once it is running.","agentOutdated":"The local agent is too old to stop a query. Update it with `npx planche@latest` (or `planche upgrade`) and reconnect.","cancelFailed":"The agent could not be reached to stop the query.","abandoned":"Stopped waiting for the request. This engine has no cancel of its own, so the query may still finish upstream."},"plan":{"empty":"Run Explain Plan (Ctrl+Shift+E) to see how the engine will execute the statement at the cursor.","unreadable":"The plan could not be read as a tree; the engine output is shown as-is.","estimated":"Estimated","analyzed":"Measured","estimatedHint":"The planner’s estimates. The statement was not executed.","analyzedHint":"The statement was executed; row counts and timings are real.","totalCost":"Highest node cost","totalTime":"Slowest node","rows":"Estimated rows","actualRows":"Actual rows","cost":"Cost","time":"Time","showRaw":"Raw output","showTree":"Plan tree","selectNode":"Select a node to see what the engine reported about it.","noDetails":"The engine reported nothing else about this node.","warnings":{"fullScan":"Full scan","noIndex":"No index","estimateOff":"Estimate off","temporary":"Temp table","filesort":"Sort"},"hints":{"fullScan":"Every row of the table is read. An index on the filtered columns would avoid it.","noIndex":"The engine found no usable index for this access.","estimateOff":"The planner expected a very different number of rows. Refreshing table statistics often fixes the plan.","temporary":"Rows are materialized into a temporary table before the next step.","filesort":"Rows are sorted outside an index. An index matching the ORDER BY would remove the sort."}},"structure":{"empty":"Show Query Structure (Ctrl+Shift+G) to see where the rows of the statement at the cursor come from.","notQuery":"Only SELECT statements have a structure graph.","unsupported":"{{engine}} statements cannot be read as a structure graph.","parseError":"The statement could not be parsed: {{message}}","columns_one":"{{count}} column","columns_other":"{{count}} columns","columnsUnknown":"width unknown","fit":"Fit","reveal":"Select this in the editor","notDrawn":"Not drawn: {{what}}","kindTable":"TABLE","kindCte":"CTE","kindCteRef":"REF","kindDerived":"SUBQUERY","kindScalar":"SCALAR","kindSetop":"SET","kindResult":"RESULT","fullscreen":"Fullscreen","exitFullscreen":"Exit fullscreen"},"viewer":{"fullscreen":"Full screen","exitFullscreen":"Exit full screen","textTitle":"Text value"},"reply":{"table":"Table"}}'),confirm:{defaultDescription:`This action cannot be undone.`,typeToConfirm:`Type <name/> to confirm`,cancel:`Cancel`,confirm:`Confirm`,ok:`OK`},table:{dialog:{createTitle:`Create Table`,alterTitle:`Alter Table`,duplicateTitle:`Duplicate Table Structure`,create:`Create`,alter:`Alter`,cancel:`Cancel`,tableName:`Table Name`,tableNamePlaceholder:`Enter table name...`,loading:`Loading table schema...`,tabSchema:`Schema`,tabIndexes:`Indexes`,tabProperties:`Properties`,applying:`Applying…`,cannotAlterColumns:`{{engine}} cannot change a column that already exists ({{columns}}). Adding, dropping and renaming columns and changing indexes all work; to change a column definition, recreate the table.`},schema:{colField:`Field Name`,colType:`Datatype`,colLength:`Length`,colDefault:`Default`,colPk:`PK`,colNotNull:`Not Null`,colUnsigned:`Unsigned`,colAutoIncrement:`Auto Incr`,colZerofill:`Zerofill`,colComment:`Comment`,empty:`No columns defined. Click "Add Column" to add one.`,add:`Add Column`,remove:`Remove Column`},indexes:{colName:`Index Name`,colType:`Index Type`,colColumns:`Columns`,empty:`No indexes defined. Click "Add Index" to add one.`,add:`Add Index`,remove:`Remove Index`},index:{addTitle:`Add Index`,editTitle:`Edit Index`,name:`Index Name`,namePlaceholder:`Enter index name`,type:`Index Type`,columns:`Columns`,noColumns:`No columns available. Define columns in the Schema tab first.`,unnamed:`(unnamed)`,cancel:`Cancel`,ok:`OK`},properties:{engine:`Engine`,charset:`Charset`,collation:`Collation`,autoIncrement:`Auto Increment`,autoIncrementPlaceholder:`Default`,comment:`Comment`},info:{engine:`Engine`,version:`Version`,rowFormat:`Row Format`,rows:`Rows`,avgRowLength:`Avg Row Length`,dataLength:`Data Length`,createTime:`Create Time`,updateTime:`Update Time`,collation:`Collation`,comment:`Comment`},copy:{title:`Copy Table`,source:`Source`,targetConnection:`Target connection`,targetDatabase:`Target database`,targetTable:`Target table name`,what:`Copy`,structureAndData:`Structure & data`,structureOnly:`Structure only`,ifExists:`If the target table exists`,abort:`Abort (default)`,dropAndRecreate:`Drop and recreate (asks to retype the name)`,preview:`CREATE TABLE on the target (editable)`,crossEngineHint:`The target is {{engine}}: review the types below, MySQL-specific attributes were dropped.`,readOnly:`read-only`,loading:`Loading…`,progressCreate:`Creating table…`,progressCount:`Counting rows…`,progressRows:`Copied {{copied}} of {{total}} rows`,progressDone:`Done`,doneTitle:`Table copied`,doneRows:`{{count}} rows copied into {{table}}.`,doneStructure:`Structure of {{table}} created.`,noColumns:`The source table has no columns.`,exists:`Table {{table}} already exists in the target. Choose another name or "Drop and recreate".`,dropTitle:`Drop existing table {{table}}?`,dropDescription:`The target table and all of its rows will be dropped before the copy. This cannot be undone.`,dropConfirm:`Drop and copy`,cancelled:`Copy cancelled.`,stop:`Stop`,cancel:`Cancel`,copy:`Copy`}},database:{copy:{title:`Copy Database`,source:`Source Database`,target:`Target Database Name`,targetPlaceholder:`Enter target database name`,options:`Options`,structureAndData:`Structure & Data`,structureOnly:`Structure Only`,cancel:`Cancel`,copy:`Copy`,creating:`Creating {{database}}…`,copying:`Copying {{table}} ({{index}} of {{total}})…`},diff:{title:`Compare Schemas`,source:`Source`,target:`Target`,pickConnection:`Connection`,pickDatabase:`Database`,crossEngineHint:`Different engines: type names differ by dialect, so most columns will show a type change.`,sameSide:`Source and target are the same database.`,summary:`{{changed}} changed, {{missingTarget}} missing in target, {{missingSource}} only in target, {{identical}} identical`,showIdentical:`Show identical tables`,identicalAll:`The tables are identical.`,column:`Column`,index:`Index`,object:`Object`,selectTable:`Select a table to see its differences.`,missingInTarget:`{{table}} does not exist in the target; the script creates it.`,missingInSource:`{{table}} exists only in the target; the script drops it (commented out unless DROPs are included).`,includeDrops:`Include DROP statements as live SQL (default: commented out)`,tabTitle:`Sync {{database}}`,close:`Close`,compare:`Compare`,comparing:`Comparing…`,openScript:`Open script in editor`,noDefinition:`No CREATE statement available`},create:{title:`Create Database`,name:`Database Name`,namePlaceholder:`Enter database name`,charset:`Character Set`,collation:`Collation`,cancel:`Cancel`,create:`Create`},csv:{title:`Download to {{format}}`,target:`Target`,targetQueryResult:`Current Query Result`,targetTableData:`Table Data`,tableName:`Table Name`,tableNamePlaceholder:`Enter table name`,delimiter:`Delimiter`,delimiterComma:`Comma (,)`,delimiterTab:`Tab (\\t)`,delimiterSemicolon:`Semicolon (;)`,delimiterPipe:`Pipe (|)`,includeHeaders:`Include Headers`,cancel:`Cancel`,download:`Download`,downloading:`Downloading...`,progress:`{{loaded}} of {{total}} rows written`,progressUnknown:`{{loaded}} rows written`,stop:`Stop`,done:`Exported {{count}} rows of {{table}} to {{format}}.`,database:`Database`,databasePlaceholder:`Choose a database`},html:{title:`Schema to HTML`,database:`Database`,selectDatabase:`Select database`,tables:`Tables to Include`,selectAll:`Select All`,deselectAll:`Deselect All`,noTables:`No tables available.`,include:`Include`,includeColumns:`Columns`,includeIndexes:`Indexes`,includeProperties:`Properties`,cancel:`Cancel`,generate:`Generate`,generating:`Generating...`,sectionColumns:`Columns`,sectionIndexes:`Indexes`,sectionProperties:`Properties`,docTitle:`Schema: {{database}}`,heading:`Database: {{database}}`,summary:`Tables: {{count}} | Generated: {{date}}`,footer:`Generated by Planche 2026`},dataDiff:{title:`Compare Data`,pickTable:`Table`,hint:`Rows are matched by the source table's primary key and compared as text. Up to {{cap}} rows per side are loaded; narrow big tables with a filter first.`,sameSide:`Source and target are the same table.`,noPrimaryKey:`{{table}} has no primary key; the comparison needs one to match rows.`,keyMissingInTarget:`The target table lacks the key column(s): {{columns}}`,summary:`Key: {{key}} — {{added}} missing in target, {{changed}} different, {{removed}} only in target, {{identical}} identical`,capped:`Only the first {{cap}} rows of each side were compared.`,ignoredColumns:`Columns ignored (one side only): {{columns}}`,added_one:`{{count}} missing in target`,added_other:`{{count}} missing in target`,changed_one:`{{count}} different`,changed_other:`{{count}} different`,removed_one:`{{count}} only in target`,removed_other:`{{count}} only in target`,none:`Nothing in this group.`,more:`… {{count}} more not listed`,includeDeletes:`Include DELETE statements as live SQL (default: commented out)`,tabTitle:`Sync data {{table}}`,loading:`Loading rows — source: {{source}}, target: {{target}}`},schema:{createTitle:`Create Schema`,name:`Schema name`,namePlaceholder:`Enter schema name`,create:`Create`,cancel:`Cancel`},groupBy:{title:`Group and Count`,description:`Count rows of {{table}} by the columns you pick.`,columns:`Group by`,aggregate:`Extra aggregate`,countOnly:`Count only`,column:`Column`,minCount:`Minimum rows per group`,useFilter:`Apply the grid's current filter`,noIndexWarning:`No grouped column leads an index, so the database has to read and sort the whole table. On a large table that can take a while.`,preview:`Query`,pickColumn:`Pick at least one column to group by.`,openInTab:`Open in new tab`,run:`Run`,tabTitle:`Group {{table}}`,indexed:`Leads an index`,connection:`Connection`,database:`Database`,table:`Table`}},user:{manager:{title:`User Manager`,addUser:`Add User`,removeUser:`Remove User`,noUsers:`No users loaded`,grantScope:`Grant Scope`,apply:`Apply`,close:`Close`,removed:`User '{{user}}'@'{{host}}' removed`,selectUserFirst:`Please select a user first`,applied:`Changes applied successfully`,noChanges:`No privilege changes to apply.`},add:{title:`Add User`,username:`Username`,usernamePlaceholder:`Enter username`,host:`Host`,password:`Password`,passwordPlaceholder:`Enter password`,confirmPassword:`Confirm Password`,confirmPasswordPlaceholder:`Confirm password`,plugin:`Plugin`,cancel:`Cancel`,add:`Add`,usernameRequired:`Username is required`,passwordMismatch:`Passwords do not match`,added:`User '{{user}}'@'{{host}}' added`},privileges:{globalTitle:`Global Privileges`,databaseTitle:`Database Privileges`,tableTitle:`Table Privileges`,checkAll:`Check All`,uncheckAll:`Uncheck All`,categoryData:`Data`,categoryStructure:`Structure`,categoryAdministration:`Administration`},grantTree:{globalPrivileges:`Global Privileges`}},command:{close:`Close`,noActiveConnection:`No active connection`,variableName:`Variable Name`,value:`Value`,scope:{session:`Session`,global:`Global`},findReplace:{findPlaceholder:`Find`,replacePlaceholder:`Replace`,found:`{{count}} found`,noResults:`No results`,previous:`Previous`,next:`Next`,close:`Close`,replace:`Replace`,all:`All`,caseSensitive:`Case Sensitive`,regex:`Regex`,wholeWord:`Whole Word`},flush:{title:`Flush`,executed:`Executed: {{command}}`,executeError:`Error executing {{command}}: {{message}}`},localHistory:{title:`Local History`,description:`Versions of the editor text for this connection: on each run, after a pause in typing, and when a tab is closed.`,empty:`No versions recorded yet.`,noMatch:`No version matches this search.`,notPersisted:`“Keep query history across reloads” is off in Settings > Safety, so versions are kept for this session only.`,searchPlaceholder:`Search versions`,scopeTab:`This tab`,scopeAll:`All tabs`,compareCurrent:`vs current`,comparePrevious:`vs previous`,diffAgainstCurrent:`Compared with the current editor text`,diffAgainstPrevious:`Compared with the version from {{time}}`,noPrevious:`No earlier version of this tab to compare with`,restored:`Editor content restored from local history`,restore:`Restore this version`,openInNewTab:`Open in new tab`,openedInTab:`Version opened in a new tab`,delete:`Delete this version`,clearAll:`Clear history`,chars:`{{count}} chars`,reason:{execute:`before run`,edit:`while editing`,replaced:`before overwrite`,restore:`before restore`,close:`before close`}},processList:{title:`Process List`,refresh:`Refresh`,autoRefresh:`Auto-refresh`,empty:`No processes to display`,kill:`Kill`,killProcess:`Kill Process`,selectToKill:`Please select a process to kill`,killed:`Process {{id}} killed successfully`,killError:`Error killing process: {{message}}`,loadError:`Error loading process list: {{message}}`,updatedAt:`updated {{time}}`,filterPlaceholder:`Filter by user, host, db, SQL...`,hideIdle:`Hide idle`,noMatch:`No processes match the filter`,self:`me`,selfHint:`This is Planche's own session`,statementOf:`Statement of #{{id}}`,noStatement:`No statement`,copy:`Copy`,copied:`Copied`,killConfirmTitle:`Kill process {{id}}?`,killConfirmDescription:`The session of {{user}}@{{host}} will be terminated and its running statement aborted. An open transaction is rolled back.`,stats:{total:`Total`,active:`Active`,idle:`Idle`,longest:`Longest running`},columns:{id:`Id`,user:`User`,host:`Host`,db:`db`,command:`Command`,time:`Time`,state:`State`,info:`Info`,action:`Action`}},status:{title:`Server Status`,filterPlaceholder:`Filter status variables...`,empty:`No status variables to display`,loadError:`Error loading status: {{message}}`},variables:{title:`Server Variables`,filterPlaceholder:`Filter variables...`,empty:`No variables to display`,loadError:`Error loading variables: {{message}}`}},erd:{empty:{title:`Open a Prisma schema file (.prisma) to view the ERD`,description:`Models, enums, and relations will be automatically analyzed`,openFile:`Open .prisma File`,dropHint:`or drag and drop a file onto this area`},entity:{enumBadge:`ENUM`,modelBadge:`MODEL`,columns:{value:`Value`,comment:`Comment`,type:`Type`,column:`Column`},linkBadge:`LINK`,externalTitle:`Linked table on {{location}} (column link, not a real foreign key)`,nullable:`Nullable column`},toolbar:{refresh:`Refresh`,zoomIn:`Zoom In`,zoomOut:`Zoom Out`,resetView:`Reset View`,center:`Center`,fitAll:`Fit All`,spreadAll:`Untangle`,resetLayout:`Reset Layout`,legendOneToMany:`1:N (FK)`,tables:`Tables:`,relations:`Relations:`,columns:`Columns:`,fullscreen:`Fullscreen`,exitFullscreen:`Exit fullscreen`},viewer:{noServerConnection:`No active server connection`,loading:`Loading schema from {{database}}...`,loadFailed:`Failed to load ERD`,noDatabase:`No database selected.`,selectDatabaseHint:`Select a database in the Schema Tree, then open View ERD.`}},services:{runAnyway:`Run anyway`,query:{rowsReturned:`{{count}} row(s) returned`,rowsAffected:`{{count}} row(s) affected`,rowsReturnedLimited:`{{count}} row(s) returned (limited to {{limit}}; add LIMIT to fetch more)`,notConnected:`Not connected`,fileNotOpen:`The SQLite file is not open yet — click "Reopen file" above to grant access again.`,failed:`Query failed`,nothingToExecute:`Nothing to execute`,dryRunMismatch:`Dry run expected {{predicted}} rows, {{actual}} were changed. The data may have changed since the preview was read; if it did not, the preview did not match this statement.`},destructive:{title_one:`Run destructive statement?`,title_other:`Run {{count}} destructive statements?`,description:`The following will permanently modify or delete data. This cannot be undone.`,unknownTarget:`(unknown)`,deleteAll:`DELETE all rows from {{target}}`,updateAll:`UPDATE all rows in {{target}}`,alterDrop:`DROP COLUMN/PARTITION on {{target}}`},readOnly:{refused:`Connection "{{label}}" is read-only. {{count}} statement(s) would modify data or schema.`,title:`"{{label}}" is read-only`,description:`These statements modify data or schema. Run them on this connection anyway?`},transaction:{startFailed:`Could not start transaction`,started:`Transaction started — Commit or Rollback when done`,implicitCommit:`{{kind}} caused an implicit COMMIT of the open transaction`,committed:`Transaction committed`,rolledBack:`Transaction rolled back`,commandFailed:`{{name}} failed`,commandFailedWith:`{{name}} failed: {{message}}`},save:{notBrowserSqlite:`Not a browser SQLite connection.`,inMemory:`In-memory database: it can only be exported as a download.`,noFileSystemAccess:`This browser has no File System Access API (Chrome/Edge only): the database is exported as a download instead of written in place.`,noWritableHandle:`The file was opened without a writable handle: it is exported as a download.`},agent:{devProxyUrl:`{{url}} (via dev proxy)`,notPlanche:`Something answered, but it is not a Planche agent`,unreachable:"Planche agent unreachable at {{url}} — run `npx planche` ({{message}})",httpError:`HTTP error: {{status}} {{statusText}}`,emptyResponse:`Tunneling server returned an empty response`,reconnected:`Reconnected to {{name}} — the agent had dropped the connection (restart or idle timeout).`,driverUnsupported:`This agent cannot open {{driver}} connections yet. Update it: run npx planche@latest, or planche upgrade for a standalone install.`},sample:{profileName:`Sample shop (in-browser)`,downloadFailed:`Could not download the sample database ({{status}})`,tabTitle:`Query 1`},sqliteFile:{tooSmall:`File is too small to be a SQLite database.`,notSqlite:`Not a SQLite database (or an encrypted one, e.g. SQLCipher). The 16-byte header does not read "SQLite format 3".`,badPageSize:`Corrupt SQLite header: invalid page size {{size}}.`,unreadable:`SQLite could not read the file: {{message}}`,pickerDescription:`SQLite database`,walNotLoaded:`This database is in WAL mode and its -wal file was not loaded. Load it, or confirm in the banner that no -wal file exists, before saving.`,changedOnDisk:`{{name}} changed on disk after it was loaded (another program wrote to it). Saving would overwrite those changes — reopen the file and redo your edits, or use the tunneling server.`,walHasChanges:`{{name}}-wal contains new changes; load it before saving.`,walChangedOnDisk:`{{name}}-wal was written by another program after it was loaded; reopen the file before saving.`,writeDenied:`Write access to {{name}} was not granted. Allow it in the browser prompt, or export as a download instead.`},environment:{none:`None`,green:`Green (dev)`,blue:`Blue`,yellow:`Yellow (staging)`,orange:`Orange`,red:`Red (production)`,purple:`Purple`},scratchpad:{profileName:`Scratchpad`,namePromptTitle:`Scratchpad table name`,namePromptDescription:`A table named {{table}} already exists in the scratchpad. Choose another name.`,nameTaken:`Table {{table}} already exists.`},federated:{pulling:`Pulling {{table}} from {{connection}}…`,capped:`{{table}}: only the first {{limit}} rows were pulled.`,templateLine1:`Reference a table of any open connection as "Connection name".database.table; it is copied into this scratchpad before the statement runs.`,templateLine2:`Tables are capped at {{limit}} rows. The query itself runs in SQLite (in your browser).`,templateConnections:`Open connections: {{names}}`,templateNone:`No other connection is open yet. Connect one, then reference it here.`,done:`Pulled {{rows}} rows from {{tables}} remote tables into the scratchpad.`,pullingProgress:`Pulling {{table}} from {{connection}}: {{loaded}} / {{total}} rows…`},paged:{noColumns:`{{table}} has no columns.`,cancelled:`Cancelled.`},console:{unreadable:`Line {{line}}: {{message}}`}},terms:{title:`Terms of Use`,version:`Version {{version}}`,englishOnly:`The terms are provided in English. The summary on the welcome screen is available in your language.`,privacyLink:`Privacy policy`,refundLink:`Refund policy`,online:`Read on planche.dev`,updated:`Last updated {{date}}`},dryRun:{title:`{{kind}} would affect {{count}} rows`,titleUnknown:`{{kind}} — affected rows unknown`,description:`These are the rows the statement would touch right now, read with a SELECT. Nothing has been written yet.`,previewFailed:`The preview query failed: {{error}}
2
+ You can still run the statement.`,noRows:`No rows match — the statement would change nothing.`,truncated:`Showing the first {{shown}} of {{count}} rows.`,previewQuery:`Preview query`,run:`Run {{kind}} ({{count}} rows)`,runAnyway:`Run anyway`},pro:{badge:`PRO`,tooltip:`Requires a Pro licence.`,noticeTitle:`Pro features`,notice:`Features marked PRO need a Pro licence.`,licenseTitle:`Planche Pro`,licenseDescription:`Paste the licence key from your purchase email. It is checked on this computer; nothing is sent anywhere.`,blocked:`{{feature}} needs a Pro licence.`,keyLabel:`Licence key`,activate:`Activate`,remove:`Remove licence`,active:`Pro is active.`,licensedTo:`Licensed to {{email}}`,validUntil:`Valid until {{date}}`,expiredOn:`This licence ran out on {{date}}. Renew it to keep using Pro features.`,invalidKey:`That is not a Planche licence key.`,notConfigured:`This build cannot check licence keys. Please report it.`,noWebcrypto:`This browser cannot check licence keys.`,pricing:`See pricing`,features:{ssh_tunnel:`SSH tunnels`,compare_schemas:`Compare Schemas`,compare_data:`Compare Data`,copy_table:`Copy Table`,dry_run:`Dry run`,federated:`Federated queries`,scratchpad:`Scratchpad`,column_link:`Column links`,sync:`Connection sync`,ai_explain:`AI explanations`},included:`Pro includes`,haveKey:`Already have a licence key?`,perMonth:`/ month`,priceNote:`Billed {{annual}} once a year. Month to month is {{monthly}}.`,featureDetails:{sync:`Your profiles on every computer, encrypted in the browser before they leave it`,ssh_tunnel:`Reach a database behind a jump host with a password, a key or ssh-agent`,compare_schemas:`Diff two open connections and get the ALTER script`,compare_data:`Diff rows between two tables and get the INSERT and UPDATE script`,copy_table:`Rebuild a table on another connection, or another engine`,dry_run:`See how many rows an UPDATE or DELETE changes, and which, before it runs`,federated:`Join tables that live in different connections`,scratchpad:`A local SQLite database for working data`,column_link:`Virtual foreign keys you can follow in the grid`,ai_explain:`Ask a model why a statement failed, or why a plan is slow — with your schema attached`}},install:{npxNote:`Needs Node.js 22 or newer. Nothing is installed permanently — npx runs the agent straight from the npm registry.`,installNote:`No Node.js needed. It installs under your home directory without an administrator; afterwards the planche command starts it any time.`},explain:{unsupported:`{{engine}} does not report query plans.`,oneStatement:`Explain works on one statement at a time. Put the cursor in the statement to explain, or select it.`},ai:{title:`AI assistant`,intro:`Ask for a query, or tell it what to do — it reads the schema, writes SQL into a tab and runs it. It works on the connection you have open, and each one keeps its own conversation.`,privacy:`What the tools read — including sample rows — is sent to your provider. Nothing reaches planche.dev.`,placeholder:`e.g. build a monthly revenue query on the demo database`,send:`Send`,stop:`Stop`,clear:`New conversation`,working:`Working…`,tabTitle:`AI query`,approvalTitle:`This one writes. Run it?`,approve:`Run`,reject:`Skip`,rejected:`The user declined to run this.`,notConfigured:`No AI key is set on the agent. Add one in Settings ▸ AI.`,needsAgent:`This local agent cannot run tools yet. Update it and pair again.`,failed:`Failed`,empty:`Nothing asked yet.`,steps:`{{count}} steps`,tooManySteps:`Stopped after {{count}} steps without reaching an answer.`,collapse:`Collapse`,planWarningTitle:`That query is a full scan. Run it anyway?`,interrupted:`Interrupted by a reload.`,external:`Asked for from outside Planche`},mcp:{title:`Connect an AI agent (MCP)`,description:`Let an AI agent that speaks MCP use Planche's tools.`,readsLabel:`Reads`,reads:`It reads the open database, and the results go to that program.`,writesLabel:`Writes`,writes:`A statement that writes data needs your approval. DROP and TRUNCATE it cannot run.`,needsLabel:`Needs`,needs:`The AI panel has to be open.`,tokenLabel:`Token`,token:`One token, shared by every program you give it to. Revoking it disconnects them all.`,command:`Add to Claude Code`,json:`Configure by hand`,stored:`Stored at {{path}}.`,revoke:`Revoke token`,revoked:`Revoked. Open this again to issue a new one.`},sync:{title:`Connection sync`,description:`Your connection profiles, encrypted in this browser and kept on planche.dev so your other computers can use them.`,stored:`The service stores one encrypted blob. It cannot read your hosts, users, passwords or SSH keys.`,unavailable:`Sync runs on planche.dev only. This copy of Planche is served by your local agent, which is not allowed to reach out to the internet.`,signIn:`Sign in with GitHub`,signedInAs:`Signed in as {{email}}`,signOut:`Sign out`,createTitle:`Choose a passphrase`,createHint:`This passphrase is what encrypts your profiles. It never reaches the server, so if you lose it the stored copy cannot be recovered — only re-created from a computer that still has your profiles.`,passphrase:`Passphrase`,confirm:`Confirm passphrase`,mismatch:`The two passphrases do not match.`,tooShort:`Use at least {{count}} characters.`,enable:`Turn on sync`,unlockTitle:`Unlock your profiles`,unlockHint:`Enter the passphrase you chose when you turned sync on.`,unlock:`Unlock`,wrongPassphrase:`Wrong passphrase, or the stored copy is damaged.`,syncNow:`Sync now`,lastSynced:`Last synced {{when}}`,neverSynced:`Not synced yet`,profiles_one:`{{count}} profile`,profiles_other:`{{count}} profiles`,changePassphrase:`Change passphrase`,deleteVault:`Delete from server`,deleteVaultConfirm:`Remove the encrypted copy from planche.dev? The profiles on this computer are not touched.`,offline:`Cannot reach planche.dev.`,working:`Working…`,serverError:`planche.dev could not complete that. Try again in a moment.`,signInShort:`Sign in`,needsPro:`You are signed in. Syncing your profiles needs a Pro licence — it starts working as soon as you have one.`,deleteAccount:`Delete account`,deleteAccountConfirm:`Delete your account? The stored copy and your sign-in go with it. The profiles on this computer are not touched.`,notDeployed:`Connection sync is not switched on for this site yet.`},desktop:{closeTitle:`Close Planche?`,closeDescription:`There is unsaved work: an open transaction, uncommitted edits or a running query. Closing discards it and rolls back.`,closeAnyway:`Close anyway`},keyViewer:{add:`Add`,addRow:`Add`,cancel:`Cancel`,save:`Save`,edit:`Edit`,revert:`Revert`,deleteRow:`Remove`,empty:`Nothing here.`,filterPlaceholder:`Filter (text or glob), Enter`,loadMore:`Load more`,loading:`Loading…`,formatJson:`Format JSON`,prettyReadOnly:`Turn off Format JSON to edit`,truncated:`Showing the first {{size}}`,loadFull:`Load all`,field:`Field`,value:`Value`,member:`Member`,score:`Score`,index:`Index`,pushTail:`to the end`,pushHead:`to the start`,entryId:`ID`,fields:`Fields`,entryFieldsPlaceholder:`field value; field value`,entryFieldsRequired:`An entry needs at least one field.`,rename:`Rename`,renameTaken:`A key named {{name}} already exists.`,ttlEdit:`Set expiry`,ttlPlaceholder:`seconds (empty: none)`,ttlInvalid:`Expiry must be a positive number of seconds, or empty for none.`,noExpiry:`No expiry`,memory:`Memory {{size}}`,encoding:`Encoding: {{encoding}}`,refresh:`Refresh`,openInConsole:`Open in console`,delete:`Delete key`,deleteTitle:`Delete {{name}}?`,deleteDescription:`The key and its value are removed. This cannot be undone.`,notConnected:`Not connected. Reconnect to see this key.`,gone:`This key no longer exists (it was deleted or expired).`,unsupported:`Keys of type {{type}} have no viewer yet; open it in the console.`,noViewer:`This connection has no viewer for this item.`,shown_one:`{{count}} shown`,shown_other:`{{count}} shown`,shownOf_one:`{{count}} of {{total}} shown`,shownOf_other:`{{count}} of {{total}} shown`,bytes_one:`{{count}} byte`,bytes_other:`{{count}} bytes`,length_one:`{{count}} item`,length_other:`{{count}} items`,viewTree:`Tree`,viewText:`Text`,viewHtml:`HTML`,htmlPreviewTitle:`HTML preview (scripts disabled)`},docViewer:{meta:`version {{version}} · seq_no {{seqNo}} · primary_term {{primaryTerm}}`,delete:`Delete document`,deleteTitle:`Delete document {{id}}?`,deleteDescription:`The document is removed from {{index}}. This cannot be undone.`,gone:`This document no longer exists.`,invalidJson:`Not valid JSON: {{message}}`,conflict:`The document changed since it was loaded, so it was not saved. Refresh to see the current version, then edit again.`},tools:{unavailable:`This tool is not available for this connection.`,autoRefresh:`Refresh every {{seconds}}s`,filter:`Filter`,redis:{server:`Server info`,slowlog:`Slow log`,clients:`Clients`,cardServer:`Server`,cardMemory:`Memory`,cardActivity:`Activity`,cardPersistence:`Persistence & replication`,unlimited:`unlimited`,keyspace:`Keyspace`,allFields:`All INFO fields`,slowlogThreshold:`Logged when slower than {{ms}} ms`,slowlogReset:`Clear slow log`,slowlogResetTitle:`Clear the slow log?`,slowlogResetDescription:`Every entry is removed for everyone looking at this server.`,slowlogEmpty:`The slow log is empty.`,time:`Time`,duration:`Duration`,command:`Command`,client:`Client`,thisApp:`this app`,kill:`Disconnect`,killTitle:`Disconnect {{addr}}?`,killDescription:`The client loses its connection and whatever it was running. It may reconnect on its own.`,memory:`Memory analysis`,delete:`Delete keys by pattern`,deleteUnder:`Delete keys under this prefix…`,analyze:`Analyze`,upTo:`up to {{count}} keys`,memoryNote:`Reads every key’s size, type and expiry with SCAN and MEMORY USAGE, in batches. On a busy production server this adds load; MEMORY USAGE estimates large collections from a sample of their elements.`,scanned:`{{scanned}} of {{total}} keys scanned`,partial:`partial result`,keysAnalyzed:`Keys analyzed`,totalMemory:`Memory`,average:`Average per key`,missingSizes_other:`{{count}} keys had no size (MEMORY USAGE refused, or they expired during the scan) and count as 0 bytes.`,missingSizes_one:`{{count}} key had no size (MEMORY USAGE refused, or it expired during the scan) and counts as 0 bytes.`,byType:`By type`,byTtl:`By expiry`,byPrefix:`By prefix`,largest:`Largest keys`,ttlNone:`no expiry`,prefixHint:`Click a prefix to delete its keys, a key to open it.`,deleteIntro:`Find the keys matching a pattern, check them, then delete them. Patterns use Redis glob syntax: * any characters, ? one character, [abc] a set.`,preview:`Find matching keys`,deleteAllWarning:`* matches every key in this database.`,matchCount:`{{count}} keys match in {{database}}`,matchCapped:`(stopped at {{cap}}; run again afterwards for the rest)`,deleteConfirm:`Type {{pattern}} to confirm.`,deleteKeys:`Delete {{count}} keys`,deleteNote:`Deletes with UNLINK in chunks of 500. Keys created after the search are not included.`,deletedCount:`{{count}} keys deleted.`,deleteReadOnly:`This connection is read-only.`,noKeys:`{{database}} has no keys.`,pubsub:`Pub/Sub`,monitor:`Monitor`,subscribePlaceholder:`channels or patterns, e.g. news orders.*`,subscribe:`Subscribe`,unsubscribe:`Unsubscribe`,listening:`Listening to {{targets}}`,publish:`Publish`,channel:`Channel`,message:`Message`,send:`Send`,receivers_other:`received by {{count}} subscribers`,receivers_one:`received by {{count}} subscriber`,waitingMessages:`Waiting for messages…`,pubsubIntro:`Subscribe to channels (news) or patterns (orders.*) to see messages as they are published. Subscriptions use a connection of their own and end when you unsubscribe or close the tab.`,feedLimit:`Showing the newest {{count}}; older ones were let go.`,startMonitor:`Start monitor`,monitoring:`Watching every command`,dropped_other:`{{count}} commands skipped to keep up`,dropped_one:`{{count}} command skipped to keep up`,monitorWarning:`MONITOR shows every command from every client and makes Redis copy each one to this feed — on a busy production server that costs real throughput. Run it briefly and stop it.`,monitorReadOnly:`MONITOR is not available on a read-only connection: it shows every client’s commands.`},stop:`Stop`,clear:`Clear`},whatsNew:{title:`What's new in Planche`,description:`What changed since you last opened Planche.`,agentOutdated:`To use these, update the agent to {{required}} or later (you have {{current}}). Run in a terminal:`,allChanges:`See all changes`,close:`Got it`},failureHint:{pairFailedTitle:`Couldn't pair with the agent`,agentOffline:`Nothing answered on this computer. Start the agent in a terminal with the command below, then open the link it prints.
3
+ If the agent is already running, Chrome may be blocking this page from reaching it: click the icon at the left of the address bar and allow local network access.`,agentOutdated:`The agent on this computer is too old for this. Stop it and run the command below to update it, then start it again.`,agentToken:`The agent was restarted, so the token this page saved no longer works. Open the new link printed in the agent's terminal.`,codeRejected:`Each pairing link works once and only for 10 minutes. Open the most recent link printed in the agent's terminal.`,agentLocked:`After too many wrong attempts the agent stops accepting them for 30 seconds. Wait a moment, then open the most recent link in the agent's terminal.`,originBlocked:`The agent only accepts the app from planche.dev and local development servers. Open Planche at planche.dev, or start the agent with --origin followed by this page's address.`,sshAuth:`The SSH server refused the login. Check the SSH user and the password or private key in the SSH section.`,dbAuth:`The database refused the login. Check the user name and password.`,network:`The agent could not reach the database server. Check the host and port, and that the server is running. The agent runs on your computer, so localhost means your computer; a server on another network may need an SSH tunnel.`,tls:`The server's TLS certificate could not be verified. If it is self-signed, turn off “{{verify}}” in the TLS section.`,agentOfflineUnknown:`Nothing answered on this computer. Start the agent in a terminal with the command below (or run planche if you installed it with install.sh), then open the link it prints.
4
+ If the agent is already running, Chrome may be blocking this page from reaching it: click the icon at the left of the address bar and allow local network access.`,agentOutdatedUnknown:`The agent on this computer is too old for this. Stop it and start the latest version with the command below (if you installed it with install.sh, run planche upgrade instead).`}},ae=`modulepreload`,Y=function(e){return`/`+e},X={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Y(t,n),t=s(t),t in X)return;X[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ae,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Q=[`en`,`ko`,`zh`,`ja`,`de`,`fr`];function $(e=navigator.languages??[navigator.language]){for(let t of e){let e=t.toLowerCase().split(`-`)[0];if(Q.includes(e))return e}return`en`}function oe(e){return e===`auto`?$():e}var se={ko:()=>Z(()=>import(`./7jD5h8Yx.js`),[]),zh:()=>Z(()=>import(`./aIFwnVFr.js`),[]),ja:()=>Z(()=>import(`./DNHPk-9r.js`),[]),de:()=>Z(()=>import(`./kXDKfUfE.js`),[]),fr:()=>Z(()=>import(`./CFu5QMhX.js`),[])};K.use(q).init({lng:`en`,fallbackLng:`en`,resources:{en:{translation:J}},interpolation:{escapeValue:!1},returnNull:!1});async function ce(e){let t=oe(e);if(t!==`en`&&!K.hasResourceBundle(t,`translation`)){let e=await se[t]();K.addResourceBundle(t,`translation`,e.default,!0,!0)}K.language!==t&&await K.changeLanguage(t),document.documentElement.lang=t}export{K as a,Z as i,ce as n,j as o,$ as r,Q as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./hePW80VL.js";import{o as t,p as n}from"./CYz610vE.js";import{t as r}from"./CiL8zoYm.js";import{i,r as a}from"./Cu_sGzNJ.js";import{a as o,i as ee,n as te,o as ne,r as re,t as ie}from"./DzRyVlxz.js";import{a as s,i as c,n as l,r as u,t as d}from"./G06qjCej.js";import{t as f}from"./S7HbowYz.js";import{n as p,t as m}from"./D8_hwGjG.js";import{a as h}from"./BkXrfAoR.js";import{r as g}from"./BRZhVXRC.js";import{n as ae,s as _}from"./BnJGrP6V.js";import{Bt as oe,Ct as se,c as v,l as ce,pt as y,vt as le}from"./CExE8dKz.js";var b=e(n(),1),ue=[`SUM`,`AVG`,`MIN`,`MAX`],x=`row_count`;function S(e,t){if(t.columns.length===0)return``;let n=t=>e.quoteIdentifier(t),r=t.columns.map(n),i=[...r,`COUNT(*) AS ${n(x)}`];if(t.aggregate){let{fn:e,column:r}=t.aggregate;i.push(`${e}(${n(r)}) AS ${n(`${e.toLowerCase()}_${r}`)}`)}let a=[];return t.where&&a.push(t.where),a.push(`GROUP BY ${r.join(`, `)}`),t.minCount&&t.minCount>1&&a.push(`HAVING COUNT(*) >= ${Math.floor(t.minCount)}`),a.push(`ORDER BY COUNT(*) DESC`),t.limit>0&&a.push(e.limitClause(t.limit)),e.getQuery(`SELECT_TABLE`,t.database,t.table,i.join(`, `),a.join(` `))}function C(e){let t=new Set;for(let n of e){let e=n.columns[0];e&&t.add(e.toLowerCase())}return t}function w(e,t){return t.has(e.toLowerCase())}function de(e,t){let n=C(t);return e.some(e=>w(e,n))}var T=a(),E=`none`,fe=/\b(int|dec|numeric|number|float|double|real|money|serial)/i;function D(){let{t:e}=i(),n=p(e=>e.activeDialog),a=p(e=>e.closeDialog),x=m(`group-by`),D=n===`group-by`,O=f(e=>e.activeConnections),pe=f(e=>e.activeConnectionId),me=(0,b.useMemo)(()=>O.filter(e=>e.serverConnectionId),[O]),[k,he]=(0,b.useState)(()=>x?.connectionId??pe??``),[A,j]=(0,b.useState)(()=>x?.database??``),[M,N]=(0,b.useState)(()=>x?.table??``),[P,F]=(0,b.useState)([]),[I,L]=(0,b.useState)([]),R=x&&k===x.connectionId&&A===x.database&&M===x.table?x.where??``:``,[z,ge]=(0,b.useState)([]),[B,_e]=(0,b.useState)([]),[V,H]=(0,b.useState)(()=>x?.column?[x.column]:[]),[U,ve]=(0,b.useState)(E),[W,ye]=(0,b.useState)(``),[G,be]=(0,b.useState)(`1`),[K,xe]=(0,b.useState)(!0),[q,J]=(0,b.useState)(``),[Se,Y]=(0,b.useState)(!1),X=e=>f.getState().activeConnections.find(t=>t.id===e)?.serverConnectionId;(0,b.useEffect)(()=>{if(!D||!k)return;let e=X(k);if(!e)return;let t=!1;return(async()=>{try{let n=await g(k).introspect.listDatabases(h(e));if(t)return;F(n),j(e=>e&&n.includes(e)?e:n[0]??``)}catch(e){t||J(e instanceof Error?e.message:String(e))}})(),()=>{t=!0}},[D,k]),(0,b.useEffect)(()=>{if(!D||!k||!A)return;let e=X(k);if(!e)return;let t=!1;return(async()=>{try{let n=await g(k).introspect.listTables(h(e),A);if(t)return;let r=n.map(e=>e.name);L(r),N(e=>e&&r.includes(e)?e:r[0]??``)}catch(e){t||J(e instanceof Error?e.message:String(e))}})(),()=>{t=!0}},[D,k,A]),(0,b.useEffect)(()=>{if(!D||!k||!M)return;let e=X(k);if(!e)return;let t=!1;return(async()=>{let n=h(e),r=g(k).introspect;try{let[e,i]=await Promise.all([r.listColumns(n,A,M),r.listIndexes(n,A,M).catch(()=>[])]);if(t)return;ge(e),_e(i),H(t=>t.filter(t=>e.some(e=>e.name===t)))}catch(e){t||J(e instanceof Error?e.message:String(e))}})(),()=>{t=!0}},[D,k,A,M]);let Ce=(0,b.useMemo)(()=>C(B),[B]),we=(0,b.useMemo)(()=>z.filter(e=>fe.test(e.type)),[z]),Z=(0,b.useMemo)(()=>!k||V.length===0?``:S(g(k),{database:A,table:M,columns:V,aggregate:U!==E&&W?{fn:U,column:W}:null,where:K?R:``,minCount:Number(G)||1,limit:_()}),[k,A,M,V,U,W,G,K,R]),Q=V.length>0&&B.length>0&&!de(V,B);function Te(e){H(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}function $(e){t(`group_by`,{action:e,dbms:g(k).id,columns:V.length,aggregate:U,filtered:!!(K&&R),indexed:!Q})}function Ee(){Z&&($(`open`),y(k,Z,A,e(`database.groupBy.tabTitle`,{table:M})),a())}async function De(){if(!Z)return;$(`run`),Y(!0);let t=y(k,Z,A,e(`database.groupBy.tabTitle`,{table:M}));a();try{await ae(k,t)}finally{Y(!1)}}return(0,T.jsx)(ie,{open:D,onOpenChange:e=>{e||a()},children:(0,T.jsxs)(te,{className:`flex max-h-[85vh] flex-col sm:max-w-[720px]`,children:[(0,T.jsxs)(o,{children:[(0,T.jsx)(ne,{children:e(`database.groupBy.title`)}),(0,T.jsx)(re,{children:e(`database.groupBy.description`,{table:M})})]}),q&&(0,T.jsx)(`p`,{className:`rounded-md border border-destructive/40 px-3 py-2 text-xs text-destructive`,children:q}),(0,T.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(v,{className:`text-xs`,children:e(`database.groupBy.connection`)}),(0,T.jsxs)(d,{value:k,onValueChange:he,children:[(0,T.jsx)(c,{className:`h-8 text-xs`,children:(0,T.jsx)(s,{})}),(0,T.jsx)(l,{children:me.map(e=>(0,T.jsx)(u,{value:e.id,children:e.hostName||e.host||e.file||e.id},e.id))})]})]}),(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(v,{className:`text-xs`,children:e(`database.groupBy.database`)}),(0,T.jsxs)(d,{value:A,onValueChange:j,children:[(0,T.jsx)(c,{className:`h-8 text-xs`,children:(0,T.jsx)(s,{})}),(0,T.jsx)(l,{children:P.map(e=>(0,T.jsx)(u,{value:e,children:e},e))})]})]}),(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(v,{className:`text-xs`,children:e(`database.groupBy.table`)}),(0,T.jsxs)(d,{value:M,onValueChange:N,children:[(0,T.jsx)(c,{className:`h-8 text-xs`,children:(0,T.jsx)(s,{})}),(0,T.jsx)(l,{children:I.map(e=>(0,T.jsx)(u,{value:e,children:e},e))})]})]})]}),(0,T.jsxs)(`div`,{className:`grid min-h-0 grid-cols-[1fr_1fr] gap-4`,children:[(0,T.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-1.5`,children:[(0,T.jsx)(v,{className:`text-xs`,children:e(`database.groupBy.columns`)}),(0,T.jsx)(le,{className:`h-[260px] rounded-md border`,children:(0,T.jsx)(`ul`,{className:`p-1`,children:z.map(t=>{let n=w(t.name,Ce);return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1 text-xs hover:bg-accent`,children:[(0,T.jsx)(`input`,{type:`checkbox`,checked:V.includes(t.name),onChange:()=>Te(t.name)}),(0,T.jsx)(`span`,{className:`truncate font-medium`,children:t.name}),(0,T.jsx)(`span`,{className:`truncate text-muted-foreground`,children:t.type}),n&&(0,T.jsx)(oe,{className:`ml-auto h-3 w-3 shrink-0 text-muted-foreground`,"aria-label":e(`database.groupBy.indexed`)})]})},t.name)})})})]}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,T.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,T.jsx)(v,{className:`text-xs`,children:e(`database.groupBy.aggregate`)}),(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[(0,T.jsxs)(d,{value:U,onValueChange:ve,children:[(0,T.jsx)(c,{className:`h-8 w-[110px] text-xs`,children:(0,T.jsx)(s,{})}),(0,T.jsxs)(l,{children:[(0,T.jsx)(u,{value:E,children:e(`database.groupBy.countOnly`)}),ue.map(e=>(0,T.jsx)(u,{value:e,children:e},e))]})]}),(0,T.jsxs)(d,{value:W,onValueChange:ye,disabled:U===E,children:[(0,T.jsx)(c,{className:`h-8 flex-1 text-xs`,children:(0,T.jsx)(s,{placeholder:e(`database.groupBy.column`)})}),(0,T.jsx)(l,{children:we.map(e=>(0,T.jsx)(u,{value:e.name,children:e.name},e.name))})]})]})]}),(0,T.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,T.jsx)(v,{htmlFor:`gb-min`,className:`text-xs`,children:e(`database.groupBy.minCount`)}),(0,T.jsx)(ce,{id:`gb-min`,type:`number`,min:1,value:G,onChange:e=>be(e.target.value),className:`h-8 text-xs`})]}),R&&(0,T.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,T.jsx)(`input`,{type:`checkbox`,checked:K,onChange:e=>xe(e.target.checked)}),e(`database.groupBy.useFilter`)]}),Q&&(0,T.jsxs)(`p`,{className:`flex gap-1.5 rounded-md border border-dashed px-2 py-1.5 text-xs text-muted-foreground`,children:[(0,T.jsx)(se,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,T.jsx)(`span`,{children:e(`database.groupBy.noIndexWarning`)})]})]})]}),(0,T.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,T.jsx)(v,{className:`text-xs`,children:e(`database.groupBy.preview`)}),(0,T.jsx)(`pre`,{className:`max-h-[120px] overflow-auto rounded-md border bg-muted p-2 font-mono text-xs whitespace-pre-wrap`,children:Z||e(`database.groupBy.pickColumn`)})]}),(0,T.jsxs)(ee,{children:[(0,T.jsx)(r,{variant:`outline`,onClick:a,children:e(`command.close`)}),(0,T.jsx)(r,{variant:`outline`,onClick:Ee,disabled:!Z,children:e(`database.groupBy.openInTab`)}),(0,T.jsx)(r,{onClick:De,disabled:!Z||Se,children:e(`database.groupBy.run`)})]})]})})}export{D as GroupByDialog};
@@ -0,0 +1 @@
1
+ import{n as e}from"./Cu_sGzNJ.js";var t=e(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./hePW80VL.js";import{p as t}from"./CYz610vE.js";import{a as n,s as r,u as i}from"./CiL8zoYm.js";import{r as a}from"./Cu_sGzNJ.js";import{O as o}from"./DzRyVlxz.js";var s=e(t(),1),c=a(),l=Object.defineProperty,u=(e,t)=>l(e,`name`,{value:t,configurable:!0}),d=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),f=s.forwardRef(u(function(e,t){return(0,c.jsx)(n.span,{...e,ref:t,style:{...d,...e.style}})},`VisuallyHidden`)),p=Object.defineProperty,m=(e,t)=>p(e,`name`,{value:t,configurable:!0});function h(e){let t=e+`CollectionProvider`,[n,a]=o(t),[l,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=m(e=>{let{scope:t,children:n}=e,r=s.useRef(null),i=s.useRef(new Map).current;return(0,c.jsx)(l,{scope:t,itemMap:i,collectionRef:r,children:n})},`CollectionProvider`);d.displayName=t;let f=e+`CollectionSlot`,p=r(f),h=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=u(f,n),o=i(t,a.collectionRef);return(0,c.jsx)(p,{ref:o,children:r})});h.displayName=f;let g=e+`CollectionItemSlot`,_=`data-radix-collection-item`,v=r(g),y=s.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,o=s.useRef(null),l=i(t,o),d=u(g,n);return s.useEffect(()=>(d.itemMap.set(o,{ref:o,...a}),()=>void d.itemMap.delete(o))),(0,c.jsx)(v,{[_]:``,ref:l,children:r})});y.displayName=g;function b(t){let n=u(e+`CollectionConsumer`,t);return s.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${_}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return m(b,`useCollection`),[{Provider:d,Slot:h,ItemSlot:y},b,a]}m(h,`createCollection`);var g=new WeakMap,_=class e extends Map{static{m(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],g.set(this,!0)}set(e,t){return g.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=b(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=v(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=v(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return v(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function v(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=y(e,t);return n===-1?void 0:e[n]}m(v,`at`);function y(e,t){let n=e.length,r=b(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}m(y,`toSafeIndex`);function b(e){return e!==e||e===0?0:Math.trunc(e)}m(b,`toSafeInteger`);function x(e){let t=e+`CollectionProvider`,[n,a]=o(t),[l,u]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new _,setItemMap:m(()=>void 0,`setItemMap`)}),d=m(({state:e,...t})=>e?(0,c.jsx)(p,{...t,state:e}):(0,c.jsx)(f,{...t}),`CollectionProvider`);d.displayName=t;let f=m(e=>{let t=C();return(0,c.jsx)(p,{...e,state:t})},`CollectionInit`);f.displayName=t+`Init`;let p=m(e=>{let{scope:t,children:n,state:r}=e,a=s.useRef(null),[o,u]=s.useState(null),d=i(a,u),[f,p]=r;return s.useEffect(()=>{if(!o)return;let e=T(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,c.jsx)(l,{scope:t,itemMap:f,setItemMap:p,collectionRef:d,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);p.displayName=t+`Impl`;let h=e+`CollectionSlot`,g=r(h),v=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=u(h,n),o=i(t,a.collectionRef);return(0,c.jsx)(g,{ref:o,children:r})});v.displayName=h;let y=e+`CollectionItemSlot`,b=r(y),x=s.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,o=s.useRef(null),[l,d]=s.useState(null),f=i(t,o,d),{setItemMap:p}=u(y,n),m=s.useRef(a);S(m.current,a)||(m.current=a);let h=m.current;return s.useEffect(()=>{let e=h;return p(t=>l?t.has(l)?t.set(l,{...e,element:l}).toSorted(w):(t.set(l,{...e,element:l}),t.toSorted(w)):t),()=>{p(e=>!l||!e.has(l)?e:(e.delete(l),new _(e)))}},[l,h,p]),(0,c.jsx)(b,{"data-radix-collection-item":``,ref:f,children:r})});x.displayName=y;function C(){return s.useState(new _)}m(C,`useInitCollection`);function E(t){let{itemMap:n}=u(e+`CollectionConsumer`,t);return n}return m(E,`useCollection`),[{Provider:d,Slot:v,ItemSlot:x},{createCollectionScope:a,useCollection:E,useInitCollection:C}]}m(x,`createCollection`);function S(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}m(S,`shallowEqual`);function C(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}m(C,`isElementPreceding`);function w(e,t){return!e[1].element||!t[1].element?0:C(e[1].element,t[1].element)?-1:1}m(w,`sortByDocumentPosition`);function T(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}m(T,`getChildListObserver`);export{f as n,d as r,h as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./hePW80VL.js";import{p as t}from"./CYz610vE.js";import{i as n,r}from"./Cu_sGzNJ.js";import{F as i,t as a}from"./S7HbowYz.js";import{t as o}from"./BQ1Rcyw6.js";import{n as s}from"./BixvbqFe.js";var c=e(t(),1),l=r(),u=0;function d({connectionId:e}){let{t}=n(),r=a(t=>t.activeConnections.find(t=>t.id===e)?.readOnly??!1),[d,f]=(0,c.useState)(``),p=s(e,e=>e.type===`command`?{id:++u,time:e.time,db:e.db,client:e.client,command:e.args.map(i).join(` `)}:null),m=(0,c.useMemo)(()=>d?p.rows.filter(e=>e.command.toLowerCase().includes(d.toLowerCase())||e.client.includes(d)):p.rows,[p.rows,d]);return(0,l.jsx)(o,{title:t(`tools.redis.monitor`),onRefresh:async()=>{},error:p.error,onDismissError:p.dismissError,children:(0,l.jsxs)(`div`,{className:`flex h-full flex-col text-xs`,children:[(0,l.jsxs)(`div`,{className:`flex flex-shrink-0 flex-wrap items-center gap-2 border-b px-3 py-2`,children:[p.running?(0,l.jsx)(`button`,{type:`button`,onClick:p.stop,className:`h-7 rounded border bg-background px-2 text-muted-foreground hover:text-foreground`,children:t(`tools.stop`)}):(0,l.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void p.start({kind:`monitor`}),className:`h-7 rounded border border-primary/30 bg-primary/10 px-2 text-primary hover:bg-primary/20 disabled:opacity-40`,children:t(`tools.redis.startMonitor`)}),p.running&&(0,l.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,l.jsx)(`span`,{className:`size-2 animate-pulse rounded-full bg-red-500`}),t(`tools.redis.monitoring`)]}),(0,l.jsx)(`input`,{className:`h-7 w-64 rounded border bg-background px-2`,placeholder:t(`tools.filter`),value:d,onChange:e=>f(e.target.value)}),p.dropped>0&&(0,l.jsx)(`span`,{className:`text-catppuccin-yellow`,children:t(`tools.redis.dropped`,{count:p.dropped})}),(0,l.jsx)(`div`,{className:`flex-1`}),(0,l.jsx)(`button`,{type:`button`,onClick:p.clear,className:`h-7 rounded border bg-background px-2 text-muted-foreground hover:text-foreground`,children:t(`tools.clear`)})]}),(0,l.jsx)(`p`,{className:`flex-shrink-0 border-b bg-catppuccin-yellow/10 px-3 py-1.5 text-muted-foreground`,children:t(r?`tools.redis.monitorReadOnly`:`tools.redis.monitorWarning`)}),(0,l.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,l.jsxs)(`table`,{className:`w-full border-collapse`,children:[(0,l.jsx)(`thead`,{className:`sticky top-0 bg-muted text-left text-muted-foreground`,children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{className:`w-28 px-3 py-1.5`,children:t(`tools.redis.time`)}),(0,l.jsx)(`th`,{className:`w-14 px-3 py-1.5`,children:`db`}),(0,l.jsx)(`th`,{className:`w-44 px-3 py-1.5`,children:t(`tools.redis.client`)}),(0,l.jsx)(`th`,{className:`px-3 py-1.5`,children:t(`tools.redis.command`)})]})}),(0,l.jsx)(`tbody`,{children:m.map(e=>(0,l.jsxs)(`tr`,{className:`border-b border-border/50 hover:bg-muted/40`,children:[(0,l.jsxs)(`td`,{className:`whitespace-nowrap px-3 py-0.5 tabular-nums text-muted-foreground`,children:[new Date(e.time).toLocaleTimeString(void 0,{hour12:!1}),`.`,String(e.time%1e3).padStart(3,`0`)]}),(0,l.jsx)(`td`,{className:`px-3 py-0.5 font-mono`,children:e.db}),(0,l.jsx)(`td`,{className:`px-3 py-0.5 font-mono text-muted-foreground`,children:e.client}),(0,l.jsx)(`td`,{className:`break-all px-3 py-0.5 font-mono`,children:e.command})]},e.id))})]})}),p.rows.length>=2e3&&(0,l.jsx)(`p`,{className:`flex-shrink-0 border-t px-3 py-1 text-muted-foreground`,children:t(`tools.redis.feedLimit`,{count:2e3})})]})})}export{d as Monitor};
@@ -0,0 +1 @@
1
+ import{r as e}from"./hePW80VL.js";import{o as t,p as n}from"./CYz610vE.js";import{a as r,i,t as a,u as o}from"./CiL8zoYm.js";import{i as s,r as c}from"./Cu_sGzNJ.js";import{C as l,D as u,O as d,T as f,a as p,i as m,n as ee,o as h,t as g}from"./DzRyVlxz.js";import{a as _,i as v,n as y,r as b,t as x}from"./G06qjCej.js";import{r as S,t as C}from"./Nro86Y63.js";import{A as w,f as T,j as E,t as D,w as O}from"./S7HbowYz.js";import{O as k,g as A,m as te,o as ne}from"./BjwrN_ch.js";import{n as j,t as re}from"./D8_hwGjG.js";import{n as ie}from"./C1gqjEN3.js";import{C as ae,_ as oe,f as M,i as se,r as ce,u as N}from"./BkXrfAoR.js";import{At as le,C as ue,H as de,Jt as fe,N as pe,P as me,S as P,T as F,a as he,an as I,b as ge,c as L,ct as _e,en as ve,i as ye,in as be,l as R,lt as xe,n as Se,nn as Ce,o as z,r as we,rn as Te,s as B,st as Ee,tn as V,u as H,vt as De,w as Oe,x as ke,z as Ae}from"./CExE8dKz.js";import{t as U}from"./CnYBZPf9.js";var W=e(n(),1),G=c(),K=Object.defineProperty,q=(e,t)=>K(e,`name`,{value:t,configurable:!0}),je=`DropdownMenu`,[Me,Ne]=d(je,[I]),J=I(),[Pe,Fe]=Me(je),Ie=q(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=J(t),u=W.useRef(null),[d,p]=f({prop:i,defaultProp:a??!1,onChange:o,caller:je});return(0,G.jsx)(Pe,{scope:t,triggerId:l(),triggerRef:u,contentId:l(),open:d,onOpenChange:p,onOpenToggle:W.useCallback(()=>p(e=>!e),[p]),modal:s,children:(0,G.jsx)(be,{...c,open:d,onOpenChange:p,dir:r,modal:s,children:n})})},`DropdownMenu`),Le=`DropdownMenuTrigger`,Re=W.forwardRef(q(function(e,t){let{__scopeDropdownMenu:n,disabled:i=!1,...a}=e,s=Fe(Le,n),c=J(n),l=o(t,s.triggerRef);return(0,G.jsx)(ve,{asChild:!0,...c,children:(0,G.jsx)(r.button,{type:`button`,id:s.triggerId,"aria-haspopup":`menu`,"aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:l,onPointerDown:u(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(s.onOpenToggle(),s.open||e.preventDefault())}),onKeyDown:u(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&s.onOpenToggle(),e.key===`ArrowDown`&&s.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),ze=q(e=>{let{__scopeDropdownMenu:t,...n}=e,r=J(t);return(0,G.jsx)(Te,{...r,...n})},`DropdownMenuPortal`),Be=`DropdownMenuContent`,Ve=W.forwardRef(q(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Fe(Be,n),a=J(n),o=W.useRef(!1);return(0,G.jsx)(V,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:u(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:u(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),He=W.forwardRef(q(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,G.jsx)(Ce,{...i,...r,ref:t})},`DropdownMenuItem`)),Ue=Ie,We=Re,Ge=ze,Ke=Ve,qe=He,Je=new Set([`postgres:`,`postgresql:`]);function Ye(e){let t=e.trim().replace(/^psql\s+(['"])?/,``).replace(/['"]$/,``);if(!/^postgres(ql)?:\/\//i.test(t))return null;let n;try{n=new URL(t)}catch{return null}if(!Je.has(n.protocol.toLowerCase())||!n.hostname)return null;let r=e=>{try{return decodeURIComponent(e)}catch{return e}},i={host:n.hostname};n.port&&(i.port=Number(n.port)),n.username&&(i.user=r(n.username)),n.password&&(i.pass=r(n.password));let a=r(n.pathname.replace(/^\//,``));return a&&(i.database=a),i}var Xe=new Set([`localhost`,`127.0.0.1`,`[::1]`,`::1`,`0.0.0.0`]);async function Ze(e,t){let n;try{let t=new URL(e);if(!Xe.has(t.hostname.toLowerCase()))return[];n=t.origin}catch{return[]}try{let e=await fetch(`${n}/cdn-cgi/local/explorer/api/d1/database`,{signal:t});if(!e.ok)return[];let r=await e.json(),i=new Map;for(let e of r.result??[])e.uuid&&i.set(e.uuid,{name:e.name??e.uuid,id:e.uuid});return[...i.values()]}catch{return[]}}var Qe=[`utf8`,`utf8mb4`,`latin1`,`ascii`,`euckr`,`sjis`,`big5`],$e={enabled:!1,host:``,port:22,user:``,auth:`key`};function Y({label:e,htmlFor:t,children:n}){return(0,G.jsxs)(`div`,{className:`grid grid-cols-[120px_minmax(0,1fr)] items-center gap-2`,children:[(0,G.jsx)(L,{htmlFor:t,children:e}),n]})}function et({value:e,onChange:t}){let{t:n}=s();function r(n,r){t({...e,[n]:r})}let[i,o]=(0,W.useState)([]),c=e.dbms===`d1`?e.devUrl??``:``;(0,W.useEffect)(()=>{if(!c){o([]);return}let e=new AbortController,t=setTimeout(()=>{Ze(c,e.signal).then(o)},300);return()=>{clearTimeout(t),e.abort()}},[c]);let l=e.dbms===`sqlite`,u=e.transport??`browser`,d=l&&u===`browser`,f=C.has(e.dbms),p=e.dbms===`d1`,m=e.dbms===`do`,ee=w.find(t=>t.id===e.dbms)?.capabilities,h=e.ssh??$e,[g,T]=(0,W.useState)(``),D=g.trim()===``?`empty`:Ye(g)?`applied`:`invalid`,O=e.dbms===`supabase`&&e.port===6543;function k(n){T(n);let r=Ye(n);r&&t({...e,host:r.host??e.host,port:r.port??w.find(t=>t.id===e.dbms)?.defaultPort??e.port,user:r.user??e.user,pass:r.pass??e.pass,database:r.database??e.database})}function A(n){t({...e,ssh:{...h,...n}})}async function te(e){e&&A({privateKey:await e.text(),privateKeyName:e.name})}return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,G.jsx)(Y,{label:n(`connection.form.hostName`),htmlFor:`conn-hostName`,children:(0,G.jsx)(R,{id:`conn-hostName`,placeholder:n(`connection.form.hostNamePlaceholder`),value:e.hostName,onChange:e=>r(`hostName`,e.target.value)})}),(0,G.jsx)(Y,{label:n(`connection.form.dataSource`),children:(0,G.jsxs)(x,{value:e.dbms,onValueChange:n=>{let r=w.find(e=>e.id===n);if(!r)return;let i=r.id,a=C.has(i)||i===`d1`||i===`do`;T(``),t({...e,dbms:i,transactionMode:r.capabilities.transactions?e.transactionMode:`auto`,port:r.defaultPort??e.port,host:a&&e.host===`localhost`?``:!a&&e.host===``?`localhost`:e.host,user:a||f||p||m||e.user===B(e.dbms)?B(i):e.user,devUrl:i===`do`?e.devUrl||`http://localhost:8787`:e.devUrl,database:e.database&&!a&&!f&&!p&&!m?e.database:z(i)??e.database})},children:[(0,G.jsx)(v,{id:`conn-dbms`,className:`w-full`,children:(0,G.jsx)(_,{})}),(0,G.jsx)(y,{children:w.map(e=>(0,G.jsx)(b,{value:e.id,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(H,{dbms:e.id}),e.label]})},e.id))})]})}),f&&(0,G.jsx)(Y,{label:n(`connection.form.connectionString`),htmlFor:`conn-uri`,children:(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(R,{id:`conn-uri`,type:`password`,autoComplete:`new-password`,spellCheck:!1,className:`font-mono text-xs`,placeholder:e.dbms===`neon`?`postgresql://neondb_owner:npg_…@ep-….neon.tech/neondb?sslmode=require`:`postgresql://postgres.[ref]:[password]@aws-0-….pooler.supabase.com:5432/postgres`,value:g,onChange:e=>k(e.target.value)}),(0,G.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed ${D===`invalid`?`text-destructive`:`text-muted-foreground`}`,children:n(D===`invalid`?`connection.form.connectionStringInvalid`:D===`applied`?`connection.form.connectionStringApplied`:e.dbms===`neon`?`connection.form.neonHint`:`connection.form.supabaseHint`)})]})}),l&&(0,G.jsxs)(Y,{label:n(`connection.form.openVia`),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm cursor-pointer`,children:[(0,G.jsx)(`input`,{type:`radio`,name:`transport`,value:`browser`,checked:u===`browser`,onChange:()=>r(`transport`,`browser`),className:`accent-primary`}),n(`connection.form.viaBrowser`)]}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm cursor-pointer`,children:[(0,G.jsx)(`input`,{type:`radio`,name:`transport`,value:`tunnel`,checked:u===`tunnel`,onChange:()=>r(`transport`,`tunnel`),className:`accent-primary`}),n(`connection.form.viaAgent`)]})]}),(0,G.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(u===`browser`?`connection.form.viaBrowserHint`:`connection.form.viaAgentHint`)})]}),d?(0,G.jsx)(Y,{label:n(`connection.form.databaseFile`),children:(0,G.jsxs)(`div`,{className:`min-w-0 text-xs text-muted-foreground leading-relaxed`,children:[e.file?(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,G.jsx)(`span`,{className:`min-w-0 break-all text-foreground`,title:e.file,children:e.file}),(0,G.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>{N(e.id),r(`file`,``)},children:n(`connection.form.changeFile`)})]}):(0,G.jsx)(`p`,{children:n(`connection.form.filePickerHint`)}),(0,G.jsx)(`p`,{className:`mt-1`,children:n(`connection.form.fileRememberedHint`)})]})}):null,!d&&(0,G.jsx)(Y,{label:n(`connection.form.authToken`),htmlFor:`conn-authToken`,children:(0,G.jsx)(R,{id:`conn-authToken`,type:`password`,autoComplete:`new-password`,placeholder:n(`connection.form.authTokenPlaceholder`),value:e.authToken,onChange:e=>r(`authToken`,e.target.value.trim())})}),d?null:m?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Y,{label:n(`connection.form.doDevUrl`),htmlFor:`conn-do-url`,children:(0,G.jsx)(R,{id:`conn-do-url`,className:`font-mono text-xs`,spellCheck:!1,placeholder:`http://localhost:8787`,value:e.devUrl??``,onChange:e=>r(`devUrl`,e.target.value.trim())})}),(0,G.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.doHint`)}),(0,G.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.doLimitsHint`)})]}):p?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Y,{label:n(`connection.form.d1DevUrl`),htmlFor:`conn-d1-dev`,children:(0,G.jsx)(R,{id:`conn-d1-dev`,autoComplete:`off`,className:`font-mono text-xs`,spellCheck:!1,placeholder:`http://localhost:8787`,value:e.devUrl??``,onChange:e=>r(`devUrl`,e.target.value.trim())})}),(0,G.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.d1DevUrlHint`)}),(0,G.jsx)(Y,{label:n(`connection.form.d1AccountId`),htmlFor:`conn-d1-account`,children:(0,G.jsx)(R,{id:`conn-d1-account`,autoComplete:`off`,className:`font-mono text-xs`,spellCheck:!1,placeholder:`023e105f4ecef8ad9ca31a8372d0c353`,value:e.accountId??``,onChange:e=>r(`accountId`,e.target.value.trim())})}),(0,G.jsx)(Y,{label:n(`connection.form.d1DatabaseId`),htmlFor:`conn-d1-database`,children:i.length>0?(0,G.jsxs)(x,{value:e.databaseId??``,onValueChange:e=>r(`databaseId`,e),children:[(0,G.jsx)(v,{id:`conn-d1-database`,children:(0,G.jsx)(_,{placeholder:n(`connection.form.d1PickDatabase`)})}),(0,G.jsx)(y,{children:i.map(e=>(0,G.jsxs)(b,{value:e.id,children:[e.name,` · `,e.id]},e.id))})]}):(0,G.jsx)(R,{id:`conn-d1-database`,autoComplete:`off`,className:`font-mono text-xs`,spellCheck:!1,placeholder:`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`,value:e.databaseId??``,onChange:e=>r(`databaseId`,e.target.value.trim())})}),(0,G.jsx)(Y,{label:n(`connection.form.d1ApiToken`),htmlFor:`conn-pass`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(R,{id:`conn-pass`,type:`password`,autoComplete:`new-password`,value:e.pass,onChange:e=>r(`pass`,e.target.value.trim())}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs whitespace-nowrap cursor-pointer`,title:n(`connection.form.savePasswordHint`),children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:e.savePassword??!0,onChange:e=>r(`savePassword`,e.target.checked)}),n(`connection.form.savePassword`)]})]})}),(0,G.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.d1Hint`)}),(0,G.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.d1LimitsHint`)})]}):l?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Y,{label:n(`connection.form.databaseFile`),htmlFor:`conn-file`,children:(0,G.jsx)(R,{id:`conn-file`,placeholder:n(`connection.form.filePathPlaceholder`),value:e.file??``,onChange:e=>r(`file`,e.target.value)})}),(0,G.jsx)(Y,{label:n(`connection.form.createIfMissing`),htmlFor:`conn-create`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`input`,{id:`conn-create`,type:`checkbox`,checked:e.createIfMissing??!1,onChange:e=>r(`createIfMissing`,e.target.checked),className:`size-4 accent-primary cursor-pointer`}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`connection.form.createIfMissingHint`)})]})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Y,{label:n(`connection.form.host`),htmlFor:`conn-host`,children:(0,G.jsx)(R,{id:`conn-host`,placeholder:e.dbms===`neon`?`ep-….aws.neon.tech`:e.dbms===`supabase`?`aws-0-….pooler.supabase.com`:`localhost`,value:e.host,onChange:e=>r(`host`,e.target.value)})}),(0,G.jsx)(Y,{label:n(`connection.form.port`),htmlFor:`conn-port`,children:(0,G.jsx)(R,{id:`conn-port`,type:`number`,value:e.port,onChange:t=>r(`port`,Number(t.target.value)||w.find(t=>t.id===e.dbms)?.defaultPort||3306)})}),O&&(0,G.jsx)(`p`,{className:`col-start-2 rounded-md border border-yellow-500/40 bg-yellow-500/10 px-2 py-1.5 text-xs leading-relaxed text-foreground`,children:n(`connection.form.supabasePoolerWarning`)}),z(e.dbms)!==void 0&&(0,G.jsx)(Y,{label:e.dbms===`oracle`?n(`connection.form.serviceName`):n(`connection.form.database`),htmlFor:`conn-database`,children:(0,G.jsx)(R,{id:`conn-database`,placeholder:z(e.dbms),value:e.database??``,onChange:e=>r(`database`,e.target.value.trim())})}),(0,G.jsx)(Y,{label:n(`connection.form.user`),htmlFor:`conn-user`,children:(0,G.jsx)(R,{id:`conn-user`,autoComplete:`off`,placeholder:B(e.dbms),value:e.user,onChange:e=>r(`user`,e.target.value)})}),(0,G.jsx)(Y,{label:n(`connection.form.password`),htmlFor:`conn-pass`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(R,{id:`conn-pass`,type:`password`,autoComplete:`new-password`,value:e.pass,onChange:e=>r(`pass`,e.target.value)}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs whitespace-nowrap cursor-pointer`,title:n(`connection.form.savePasswordHint`),children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:e.savePassword??!0,onChange:e=>r(`savePassword`,e.target.checked)}),n(`connection.form.savePassword`)]})]})}),f&&(0,G.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.managedTlsHint`)}),(()=>{let t=E(e.dbms),r=`formHint`in t?t.formHint:void 0;return r?(0,G.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(r)}):null})(),!f&&e.dbms!==`oracle`&&(0,G.jsx)(Y,{label:n(`connection.form.tls`),children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs cursor-pointer`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:e.ssl??!1,onChange:e=>r(`ssl`,e.target.checked),className:`size-4 accent-primary`}),n(`connection.form.tlsEnable`)]}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs cursor-pointer ${e.ssl?``:`opacity-50`}`,title:n(`connection.form.tlsVerifyHint`),children:[(0,G.jsx)(`input`,{type:`checkbox`,disabled:!e.ssl,checked:e.sslVerify??!1,onChange:e=>r(`sslVerify`,e.target.checked),className:`size-4 accent-primary`}),n(`connection.form.tlsVerify`)]})]})}),!f&&S(E(e.dbms))&&(0,G.jsx)(Y,{label:n(`connection.form.charset`),children:(0,G.jsxs)(x,{value:e.charset,onValueChange:e=>r(`charset`,e),children:[(0,G.jsx)(v,{className:`w-full`,children:(0,G.jsx)(_,{})}),(0,G.jsx)(y,{children:Qe.map(e=>(0,G.jsx)(b,{value:e,children:e},e))})]})})]}),!l&&!f&&!p&&!m&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`mt-1 flex items-center border-t pt-3 text-xs font-medium text-muted-foreground`,children:[n(`connection.form.ssh`),(0,G.jsx)(de,{className:`ml-2`})]}),(0,G.jsx)(Y,{label:n(`connection.form.sshTunnel`),htmlFor:`conn-ssh`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`input`,{id:`conn-ssh`,type:`checkbox`,checked:h.enabled,onChange:e=>{(!e.target.checked||Ae(`ssh_tunnel`))&&A({enabled:e.target.checked})},className:`size-4 accent-primary cursor-pointer`}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`connection.form.sshTunnelHint`)})]})}),h.enabled&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Y,{label:n(`connection.form.sshHost`),htmlFor:`conn-ssh-host`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(R,{id:`conn-ssh-host`,placeholder:n(`connection.form.sshHostPlaceholder`),value:h.host,onChange:e=>A({host:e.target.value.trim()})}),(0,G.jsx)(R,{"aria-label":n(`connection.form.sshPort`),type:`number`,className:`w-24 shrink-0`,value:h.port,onChange:e=>A({port:Number(e.target.value)||22})})]})}),(0,G.jsx)(Y,{label:n(`connection.form.sshUser`),htmlFor:`conn-ssh-user`,children:(0,G.jsx)(R,{id:`conn-ssh-user`,placeholder:n(`connection.form.sshUserPlaceholder`),value:h.user,onChange:e=>A({user:e.target.value.trim()})})}),(0,G.jsx)(Y,{label:n(`connection.form.sshAuth`),children:(0,G.jsxs)(x,{value:h.auth,onValueChange:e=>A({auth:e}),children:[(0,G.jsx)(v,{className:`w-full`,children:(0,G.jsx)(_,{})}),(0,G.jsxs)(y,{children:[(0,G.jsx)(b,{value:`key`,children:n(`connection.form.sshAuthKey`)}),(0,G.jsx)(b,{value:`password`,children:n(`connection.form.sshAuthPassword`)}),(0,G.jsx)(b,{value:`agent`,children:n(`connection.form.sshAuthAgent`)})]})]})}),h.auth===`password`&&(0,G.jsx)(Y,{label:n(`connection.form.sshPassword`),htmlFor:`conn-ssh-pass`,children:(0,G.jsx)(R,{id:`conn-ssh-pass`,type:`password`,autoComplete:`new-password`,value:h.password??``,onChange:e=>A({password:e.target.value})})}),h.auth===`key`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Y,{label:n(`connection.form.sshKey`),htmlFor:`conn-ssh-key`,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`input`,{id:`conn-ssh-key`,type:`file`,className:`hidden`,onChange:e=>{te(e.target.files?.[0]),e.target.value=``}}),(0,G.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 shrink-0 px-2 text-xs`,onClick:()=>document.getElementById(`conn-ssh-key`)?.click(),children:h.privateKey?n(`connection.form.changeFile`):n(`connection.form.sshKeyPick`)}),(0,G.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,title:h.privateKeyName,children:h.privateKey?h.privateKeyName||n(`connection.form.sshKeyLoaded`):n(`connection.form.sshKeyHint`)})]})}),(0,G.jsx)(Y,{label:n(`connection.form.sshPassphrase`),htmlFor:`conn-ssh-passphrase`,children:(0,G.jsx)(R,{id:`conn-ssh-passphrase`,type:`password`,autoComplete:`new-password`,placeholder:n(`connection.form.sshPassphrasePlaceholder`),value:h.passphrase??``,onChange:e=>A({passphrase:e.target.value})})})]}),h.auth===`agent`&&(0,G.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.sshAuthAgentHint`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.sshTargetHint`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.sshSecretsHint`)})]})]}),(0,G.jsx)(Y,{label:n(`connection.form.autoConnection`),htmlFor:`conn-auto`,children:(0,G.jsx)(`div`,{className:`flex items-center`,children:(0,G.jsx)(`input`,{id:`conn-auto`,type:`checkbox`,checked:e.autoConnection,onChange:e=>r(`autoConnection`,e.target.checked),className:`size-4 accent-primary cursor-pointer`})})}),(0,G.jsx)(`div`,{className:`mt-1 border-t pt-3 text-xs font-medium text-muted-foreground`,children:n(`connection.form.safety`)}),(0,G.jsx)(Y,{label:n(`connection.form.environment`),children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[pe.map(t=>{let n=(e.environmentColor??`none`)===t.id;return(0,G.jsx)(`button`,{type:`button`,title:me(t.id),"aria-label":me(t.id),"aria-pressed":n,onClick:()=>r(`environmentColor`,t.id),className:`size-6 rounded-full border-2 transition-transform ${n?`scale-110 border-foreground`:`border-transparent hover:scale-105`}`,style:{background:t.id===`none`?`repeating-linear-gradient(45deg, transparent, transparent 3px, var(--muted-foreground) 3px, var(--muted-foreground) 4px)`:t.hex}},t.id)}),(0,G.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:n(`connection.form.environmentHint`)})]})}),(0,G.jsx)(Y,{label:n(`connection.form.readOnly`),htmlFor:`conn-readonly`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`input`,{id:`conn-readonly`,type:`checkbox`,checked:e.readOnly??!1,onChange:e=>r(`readOnly`,e.target.checked),className:`size-4 accent-primary cursor-pointer`}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`connection.form.readOnlyHint`)})]})}),ee?.transactions!==!1&&(0,G.jsx)(Y,{label:n(`connection.form.transactions`),children:(0,G.jsxs)(x,{value:e.transactionMode??`auto`,onValueChange:e=>r(`transactionMode`,e),children:[(0,G.jsx)(v,{className:`w-full`,children:(0,G.jsx)(_,{})}),(0,G.jsxs)(y,{children:[(0,G.jsx)(b,{value:`auto`,children:n(`connection.form.txAuto`)}),(0,G.jsx)(b,{value:`manual`,children:n(`connection.form.txManual`)})]})]})})]})}var tt=[`id`,`serverConnectionId`,`sample`,`scratchpad`,`autoConnection`];function nt(e){return!e.sample&&!e.scratchpad}function rt(e,t,n=new Date){let r=t?e:O(e),i={...r};for(let e of tt)delete i[e];if(i.pass||delete i.pass,i.authToken||delete i.authToken,r.ssh){let e={...r.ssh};for(let t of[`password`,`passphrase`,`privateKey`])e[t]||delete e[t];i.ssh=e}return{planche:`connection`,version:1,exportedAt:n.toISOString(),secrets:t,connection:i}}function it(e){let t;try{t=JSON.parse(e)}catch{throw Error(`Not a JSON file`)}let n=t;if(!n||n.planche!==`connection`||!n.connection||typeof n.connection!=`object`)throw Error(`Not a Planche connection file`);if(typeof n.connection.dbms!=`string`||!n.connection.dbms)throw Error(`The connection has no database type`);return n}var X=(e,t=``)=>typeof e==`string`?e:t,Z=e=>typeof e==`boolean`?e:void 0,at=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:t,Q=e=>e===void 0||e===``?void 0:e;function ot(e){if(!e||typeof e!=`object`)return;let t=e,n=t.auth===`key`||t.auth===`agent`?t.auth:`password`;return{enabled:t.enabled===!0,host:X(t.host),port:at(t.port,22),user:X(t.user),auth:n,password:Q(X(t.password)),privateKey:Q(X(t.privateKey)),privateKeyName:Q(X(t.privateKeyName)),passphrase:Q(X(t.passphrase))}}function st(e,t,n=crypto.randomUUID()){let r=e.connection,i=Z(r.savePassword),a={id:n,hostName:ct(X(r.hostName),t),host:X(r.host),user:X(r.user),pass:X(r.pass),charset:X(r.charset,`utf8`),port:at(r.port,0),dbms:r.dbms,database:Q(X(r.database)),transport:r.transport===`tunnel`||r.transport===`browser`?r.transport:void 0,file:Q(X(r.file)),createIfMissing:Z(r.createIfMissing),ssl:Z(r.ssl),sslVerify:Z(r.sslVerify),accountId:Q(X(r.accountId)),databaseId:Q(X(r.databaseId)),devUrl:Q(X(r.devUrl)),ssh:ot(r.ssh),gatewayProfile:Q(X(r.gatewayProfile)),autoConnection:!1,savePassword:i??!0,authToken:X(r.authToken),readOnly:Z(r.readOnly),environmentColor:Q(X(r.environmentColor)),transactionMode:Q(X(r.transactionMode))};for(let e of Object.keys(a))a[e]===void 0&&delete a[e];return a}function ct(e,t){if(!e||!t.some(t=>t.hostName===e))return e;for(let n=2;;n++){let r=`${e} (${n})`;if(!t.some(e=>e.hostName===r))return r}}async function lt(e,t,n=`application/json`){let r=U(e);if(typeof window.showSaveFilePicker==`function`)try{let e=await(await window.showSaveFilePicker({suggestedName:r,types:[{accept:{[n]:[`.${r.split(`.`).pop()??`txt`}`]}}]})).createWritable();return await e.write(t),await e.close(),!0}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return!1}let i=URL.createObjectURL(new Blob([t],{type:n})),a=document.createElement(`a`);return a.href=i,a.download=r,a.click(),URL.revokeObjectURL(i),!0}function ut(e=`.json,application/json`){return new Promise(t=>{let n=document.createElement(`input`);n.type=`file`,n.accept=e,n.onchange=async()=>{let e=n.files?.[0];t(e?await e.text():null)},n.oncancel=()=>t(null),n.click()})}function dt({...e}){return(0,G.jsx)(Ue,{"data-slot":`dropdown-menu`,...e})}function ft({...e}){return(0,G.jsx)(We,{"data-slot":`dropdown-menu-trigger`,...e})}function pt({className:e,sideOffset:t=4,...n}){return(0,G.jsx)(Ge,{children:(0,G.jsx)(Ke,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:i(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function mt({className:e,inset:t,variant:n=`default`,...r}){return(0,G.jsx)(qe,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function $(e,n,r){let i=_e(r);return t(`connection_error`,{action:e,dbms:n,reason:i}),Ee(i)}function ht(){let{t:e}=s(),{activeDialog:t,closeDialog:n,showMessage:r}=j(),[i,o]=(0,W.useState)(!1),{savedConnections:c,addSavedConnection:l,updateSavedConnection:u,deleteSavedConnection:d,openConnection:f}=D(),_=re(`connect`)?.profileId,[v,y]=(0,W.useState)(()=>_??null),[b,x]=(0,W.useState)(()=>{let e=_?c.find(e=>e.id===_):void 0;return e?{...e}:null}),S=t===`connect`,[C,w]=(0,W.useState)(null),[O,N]=(0,W.useState)(null),de=xe(e=>e.url),pe=xe(e=>e.token);(0,W.useEffect)(()=>{if(!S)return;let e=!1;return(async()=>{try{let t=await ne();if(e||t.state!==`online`||!t.gateway){e||w(null);return}let n=await te();e||(w({name:n.gateway,profiles:n.profiles}),N(null))}catch(t){e||N(t instanceof Error?t.message:String(t))}})(),()=>{e=!0}},[S,de,pe]);function me(t){let n=c.find(e=>e.gatewayProfile===t.name);if(n){L(n);return}let r=we(t);l(r),L(r),j.getState().setFooterMessage(e(`connection.dialog.gatewayAdded`,{name:t.name}))}function I(e){e||(n(),y(null),x(null))}function L(e){y(e.id),x({...e})}function _e(e){x(e),u(e.id,e)}function ve(){let e=he();l(e),y(e.id),x(e)}function be(){v&&(d(v),y(null),x(null))}async function R(t){let n=c.find(e=>e.id===v);if(!n||!nt(n))return;let r=n.hostName||e(`connection.dialog.unnamed`),i=rt(D.getState().resolveCredentials(n),t);await lt(`planche-connection-${r}.json`,JSON.stringify(i,null,2))&&j.getState().setFooterMessage(e(`connection.dialog.exported`,{name:r}))}async function Ce(){let t=await ut();if(t!==null)try{let n=st(it(t),D.getState().savedConnections);l(n),y(n.id),x(n),j.getState().setFooterMessage(e(`connection.dialog.imported`,{name:n.hostName||e(`connection.dialog.unnamed`)}))}catch(t){r({tone:`error`,title:e(`connection.dialog.importFailedTitle`),description:t instanceof Error?t.message:String(t)})}}let z=v!==null&&c.some(e=>e.id===v&&nt(e)),[Te,B]=(0,W.useState)(!1),Ee=ie(e=>e.addQueryTab);function V(t){let r=D.getState().activeConnections.some(e=>e.id===t.id);if(f(t),ae.getState().removeTree(t.id),T(t.id),r){n(),y(null),x(null);return}Ee(t.id,{id:`tab-${Date.now()}`,title:e(`connection.dialog.firstQueryTab`),query:``,database:``,isExecuting:!1,results:[],error:null,executionTime:null}),n(),y(null),x(null)}async function Ae(t){let n=await ce(t.id,{interactive:!0});if(!n)return;let r={...t,file:n.fileName,serverConnectionId:n.connectionId};u(t.id,{file:n.fileName}),V(r),D.getState().setFileDetached(t.id,n.fileDetached),n.restoredUnsaved?j.getState().setFooterMessage(e(n.diskChanged?`connection.dialog.restoredUnsavedDiskChanged`:`connection.dialog.restoredUnsaved`,{file:n.fileName})):n.wal&&!n.walApplied?j.getState().setFooterMessage(e(`connection.dialog.walPending`,{file:n.fileName})):n.walApplied&&j.getState().setFooterMessage(e(`connection.dialog.walApplied`,{file:n.fileName}))}async function U(t,n){try{return await n(t)}catch(r){let i=A(r);if(!i||!(`ssh`in t)||!t.ssh||!await j.getState().requestDestructiveConfirm({title:e(`connection.dialog.hostKeyTitle`),description:e(`connection.dialog.hostKeyDescription`,i),confirmLabel:e(`connection.dialog.hostKeyAccept`)}))throw r;return n({...t,ssh:{...t.ssh,acceptHostKey:i.fingerprint}})}}async function K(){if(b){B(!0);try{if(M(b)===`browser`){await Ae(b);return}let t=await U(k(b),e=>se(e,b.authToken||void 0));if(t.success)V({...b,serverConnectionId:t.connectionId});else{let n=$(`connect`,b.dbms,Error(t.message??``));r({tone:`error`,title:e(`connection.dialog.connectFailedTitle`),description:t.message??e(`connection.dialog.unknownError`),...n})}}catch(t){let n=$(`connect`,b.dbms,t);r({tone:`error`,title:e(`connection.dialog.connectFailedTitle`),description:t instanceof Error?t.message:String(t),...n})}finally{B(!1)}}}async function q(){if(b){if(M(b)===`browser`){r({tone:`info`,title:e(`connection.dialog.testConnection`),description:e(`connection.dialog.browserTestHint`)});return}o(!0);try{let t=await U(k(b),e=>oe(e,b.authToken||void 0));if(t.success)r({tone:`success`,title:e(`connection.dialog.testSuccess`),description:e(`connection.dialog.testSuccessDescription`)});else{let n=$(`test`,b.dbms,Error(t.message??``));r({tone:`error`,title:e(`connection.dialog.testFailedTitle`),description:t.message??e(`connection.dialog.unknownError`),...n})}}catch(t){let n=$(`test`,b.dbms,t);r({tone:`error`,title:e(`connection.dialog.testFailedTitle`),description:t instanceof Error?t.message:String(t),...n})}finally{o(!1)}}}return(0,G.jsx)(g,{open:S,onOpenChange:I,children:(0,G.jsxs)(ee,{className:`sm:max-w-[1100px] h-[85vh] max-h-[85vh] flex flex-col`,children:[(0,G.jsx)(p,{children:(0,G.jsx)(h,{children:e(`connection.dialog.title`)})}),(0,G.jsxs)(`p`,{className:`flex items-start gap-2 rounded-md border border-catppuccin-green/40 bg-catppuccin-green/10 px-3 py-2 text-xs leading-relaxed text-foreground`,children:[(0,G.jsx)(le,{className:`mt-0.5 size-4 shrink-0 text-catppuccin-green`,"aria-hidden":!0}),(0,G.jsx)(`span`,{children:e(`connection.dialog.privacy`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 gap-4 overflow-hidden min-h-0`,children:[(0,G.jsxs)(`div`,{className:`w-[460px] shrink-0 border rounded-md overflow-hidden flex flex-col`,children:[(C||O)&&(0,G.jsxs)(`div`,{className:`border-b p-2 text-xs space-y-1 max-h-40 overflow-auto`,children:[(0,G.jsxs)(`p`,{className:`font-medium`,children:[e(`connection.dialog.gatewayTitle`),C?` — ${C.name}`:``]}),O&&(0,G.jsx)(`p`,{className:`text-destructive`,children:e(`connection.dialog.gatewayLoadFailed`,{error:O})}),C?.profiles.map(t=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[(0,G.jsx)(H,{dbms:Se[t.driver],className:`size-3.5`}),(0,G.jsx)(`span`,{className:`truncate`,children:t.name}),(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,t.readOnly?e(`connection.dialog.gatewayReadOnly`):e(`connection.dialog.gatewayWritable`),`)`]})]}),(0,G.jsx)(a,{size:`sm`,variant:`outline`,className:`h-6 px-2 text-xs`,onClick:()=>me(t),children:e(`connection.dialog.gatewayAdd`)})]},t.name))]}),(0,G.jsx)(De,{className:`h-full`,children:(0,G.jsxs)(ge,{className:`table-fixed`,children:[(0,G.jsx)(Oe,{children:(0,G.jsxs)(F,{children:[(0,G.jsx)(ue,{className:`w-[32%]`,children:e(`connection.dialog.colHostName`)}),(0,G.jsx)(ue,{className:`w-[40%]`,children:e(`connection.dialog.colTarget`)}),(0,G.jsx)(ue,{className:`w-[28%]`,children:e(`connection.dialog.colDbms`)})]})}),(0,G.jsx)(ke,{children:c.length===0?(0,G.jsx)(F,{children:(0,G.jsx)(P,{colSpan:3,className:`text-center text-muted-foreground`,children:e(`connection.dialog.noSaved`)})}):c.map(t=>(0,G.jsxs)(F,{"data-state":v===t.id?`selected`:void 0,className:`cursor-pointer`,onClick:()=>L(t),onDoubleClick:()=>{L(t),K()},children:[(0,G.jsx)(P,{className:`truncate font-medium`,title:t.hostName,children:t.hostName||e(`connection.dialog.unnamed`)}),(0,G.jsx)(P,{className:`truncate`,title:t.dbms===`sqlite`?t.file:t.dbms===`d1`?t.databaseId:t.dbms===`do`?t.devUrl:`${t.user?`${t.user}@`:``}${t.host}:${t.port}`,children:t.dbms===`sqlite`?t.file||(M(t)===`browser`?e(`connection.dialog.pickOnConnect`):e(`connection.dialog.noFile`)):t.dbms===`d1`?t.databaseId||`—`:t.dbms===`do`?t.devUrl||`—`:`${t.user?`${t.user}@`:``}${t.host}:${t.port}`}),(0,G.jsx)(P,{className:`truncate`,title:E(t.dbms).label,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(H,{dbms:t.dbms,className:`size-3.5`}),(0,G.jsx)(`span`,{className:`truncate`,children:E(t.dbms).label})]})})]},t.id))})]})})]}),(0,G.jsx)(`div`,{className:`flex-1 border rounded-md overflow-auto`,children:b?(0,G.jsxs)(G.Fragment,{children:[M(b)!==`browser`&&(0,G.jsx)(`div`,{className:`p-4 pb-0`,children:(0,G.jsx)(ye,{})}),b.gatewayProfile?(0,G.jsxs)(`div`,{className:`p-4 space-y-2 text-sm`,children:[(0,G.jsxs)(`p`,{className:`font-medium flex items-center gap-2`,children:[(0,G.jsx)(H,{dbms:b.dbms,className:`size-4`}),b.hostName]}),(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:e(`connection.dialog.gatewayProfileHint`,{name:b.gatewayProfile})}),(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[b.readOnly?e(`connection.dialog.gatewayReadOnly`):e(`connection.dialog.gatewayWritable`),b.database?` · ${b.database}`:``]})]}):(0,G.jsx)(et,{value:b,onChange:_e})]}):(0,G.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm`,children:e(`connection.dialog.selectPrompt`)})})]}),(0,G.jsxs)(m,{className:`sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(a,{variant:`outline`,onClick:ve,children:e(`connection.dialog.addNew`)}),(0,G.jsx)(a,{variant:`destructive`,onClick:be,disabled:!v,children:e(`connection.dialog.delete`)}),(0,G.jsxs)(dt,{children:[(0,G.jsx)(ft,{asChild:!0,children:(0,G.jsxs)(a,{variant:`outline`,disabled:!z,children:[e(`connection.dialog.export`),(0,G.jsx)(fe,{className:`ml-1 size-3.5`,"aria-hidden":!0})]})}),(0,G.jsxs)(pt,{align:`start`,children:[(0,G.jsx)(mt,{onSelect:()=>void R(!1),children:e(`connection.dialog.exportWithoutSecrets`)}),(0,G.jsx)(mt,{onSelect:()=>void R(!0),children:e(`connection.dialog.exportWithSecrets`)})]})]}),(0,G.jsx)(a,{variant:`outline`,onClick:()=>void Ce(),children:e(`connection.dialog.import`)})]}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(a,{variant:`outline`,onClick:q,disabled:!b||i,children:e(`connection.dialog.testConnection`)}),(0,G.jsx)(a,{onClick:K,disabled:!b||Te,children:e(`connection.dialog.connect`)}),(0,G.jsx)(a,{variant:`outline`,onClick:()=>I(!1),children:e(`connection.dialog.close`)})]})]})]})})}export{ht as ConnectDialog};
@@ -0,0 +1 @@
1
+ import{r as e}from"./hePW80VL.js";import{p as t}from"./CYz610vE.js";import{i as n,t as r}from"./CiL8zoYm.js";import{i,n as a,r as o}from"./Cu_sGzNJ.js";import{a as s,i as c,n as l,o as u,t as d}from"./DzRyVlxz.js";import{I as f,t as p}from"./S7HbowYz.js";import{n as m}from"./D8_hwGjG.js";import{a as h}from"./BkXrfAoR.js";import{r as g}from"./BRZhVXRC.js";import{a as _}from"./BnJGrP6V.js";import{Et as v,Ut as y,c as b,qt as x,vt as S,wt as C}from"./CExE8dKz.js";import{n as w,t as T}from"./XCH_yrJ8.js";var E=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),D=a(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),O=e(t(),1),k=o();function A({databases:e,tables:t,onSelectScope:r}){let{t:a}=i(),[o,s]=(0,O.useState)(new Set),[c,l]=(0,O.useState)(`global`),u=(0,O.useCallback)(e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),d=[{id:`global`,text:a(`user.grantTree.globalPrivileges`),type:`global`,children:e.map(e=>({id:`db:${e}`,text:e,type:`database`,database:e,children:(t[e]??[]).map(t=>({id:`tbl:${e}.${t}`,text:t,type:`table`,database:e,table:t}))}))}];function f(e){l(e.id),r({level:e.type,database:e.database,table:e.table})}function p(e,t){let r=e.children&&e.children.length>0,i=o.has(e.id),a=c===e.id,s=E;return e.type===`database`&&(s=y),e.type===`table`&&(s=v),(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:n(`flex items-center gap-1 px-2 py-0.5 cursor-pointer text-sm hover:bg-accent rounded-sm`,a&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${t*16+4}px`},onClick:()=>{f(e),r&&u(e.id)},children:[r?(0,k.jsx)(x,{className:n(`h-3 w-3 transition-transform shrink-0`,i&&`rotate-90`)}):(0,k.jsx)(`span`,{className:`w-3 shrink-0`}),(0,k.jsx)(s,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,k.jsx)(`span`,{className:`truncate`,children:e.text})]}),i&&e.children?.map(e=>p(e,t+1))]},e.id)}return(0,k.jsx)(S,{className:`h-full`,children:(0,k.jsx)(`div`,{className:`py-1`,children:d.map(e=>p(e,0))})})}var j={Data:[`SELECT`,`INSERT`,`UPDATE`,`DELETE`],Structure:[`CREATE`,`ALTER`,`DROP`,`INDEX`,`REFERENCES`],Administration:[`GRANT OPTION`,`SUPER`,`PROCESS`,`RELOAD`,`SHUTDOWN`,`SHOW DATABASES`,`LOCK TABLES`,`EXECUTE`,`REPLICATION SLAVE`,`REPLICATION CLIENT`,`CREATE VIEW`,`SHOW VIEW`,`CREATE ROUTINE`,`ALTER ROUTINE`,`CREATE USER`,`EVENT`,`TRIGGER`,`CREATE TABLESPACE`]},M={Data:[`SELECT`,`INSERT`,`UPDATE`,`DELETE`],Structure:[`CREATE`,`ALTER`,`DROP`,`INDEX`,`REFERENCES`],Administration:[`GRANT OPTION`,`LOCK TABLES`,`EXECUTE`,`CREATE VIEW`,`SHOW VIEW`,`CREATE ROUTINE`,`ALTER ROUTINE`,`EVENT`,`TRIGGER`]},N={Data:[`SELECT`,`INSERT`,`UPDATE`,`DELETE`],Structure:[`CREATE`,`ALTER`,`DROP`,`INDEX`,`REFERENCES`],Administration:[`GRANT OPTION`,`TRIGGER`]},P={global:`user.privileges.globalTitle`,database:`user.privileges.databaseTitle`,table:`user.privileges.tableTitle`},F={Data:`user.privileges.categoryData`,Structure:`user.privileges.categoryStructure`,Administration:`user.privileges.categoryAdministration`};function I({scope:e,privileges:t,onChange:n}){let{t:a}=i(),o=(0,O.useMemo)(()=>e===`global`?j:e===`database`?M:N,[e]),s=(0,O.useMemo)(()=>Object.values(o).flat(),[o]);function c(e){n({...t,[e]:!t[e]})}function l(){let e={...t};for(let t of s)e[t]=!0;n(e)}function u(){let e={...t};for(let t of s)e[t]=!1;n(e)}return(0,k.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2 p-2 border-b`,children:[(0,k.jsx)(`span`,{className:`text-sm font-medium`,children:a(P[e])}),(0,k.jsxs)(`div`,{className:`ml-auto flex gap-1`,children:[(0,k.jsx)(r,{variant:`outline`,size:`sm`,onClick:l,children:a(`user.privileges.checkAll`)}),(0,k.jsx)(r,{variant:`outline`,size:`sm`,onClick:u,children:a(`user.privileges.uncheckAll`)})]})]}),(0,k.jsx)(S,{className:`flex-1`,children:(0,k.jsx)(`div`,{className:`p-3 space-y-4`,children:Object.entries(o).map(([e,n])=>(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h4`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2`,children:F[e]?a(F[e]):e}),(0,k.jsx)(`div`,{className:`grid grid-cols-2 gap-1`,children:n.map(e=>(0,k.jsxs)(b,{className:`flex items-center gap-2 text-sm font-normal cursor-pointer py-1`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:t[e]??!1,onChange:()=>c(e),className:`rounded border-input`}),e]},e))})]},e))})})]})}var L={SELECT:`Select_priv`,INSERT:`Insert_priv`,UPDATE:`Update_priv`,DELETE:`Delete_priv`,CREATE:`Create_priv`,ALTER:`Alter_priv`,DROP:`Drop_priv`,INDEX:`Index_priv`,REFERENCES:`References_priv`,"GRANT OPTION":`Grant_priv`,SUPER:`Super_priv`,PROCESS:`Process_priv`,RELOAD:`Reload_priv`,SHUTDOWN:`Shutdown_priv`,"SHOW DATABASES":`Show_db_priv`,"LOCK TABLES":`Lock_tables_priv`,EXECUTE:`Execute_priv`,"REPLICATION SLAVE":`Repl_slave_priv`,"REPLICATION CLIENT":`Repl_client_priv`,"CREATE VIEW":`Create_view_priv`,"SHOW VIEW":`Show_view_priv`,"CREATE ROUTINE":`Create_routine_priv`,"ALTER ROUTINE":`Alter_routine_priv`,"CREATE USER":`Create_user_priv`,EVENT:`Event_priv`,TRIGGER:`Trigger_priv`,"CREATE TABLESPACE":`Create_tablespace_priv`,"CREATE TEMPORARY TABLES":`Create_tmp_table_priv`,FILE:`File_priv`};function R(e){let t={};for(let n of e.split(`,`)){let e=n.trim().toUpperCase();e&&(t[e]=!0)}return t}function z(e){let t={};for(let[n,r]of Object.entries(L)){let i=e[r];i!==void 0&&(t[n]=String(i).toUpperCase()===`Y`)}return t}function B(e,t){let n=t=>e.quoteIdentifier(t);return t.level===`global`?`*.*`:t.level===`database`?`${n(t.database??``)}.*`:`${n(t.database??``)}.${n(t.table??``)}`}async function V(e,t,n,r,i){if(i.level===`global`){let i=await e(t.getQuery(`USER_PRIV`,n,r)),a=f(i)[0];return a?z(a):{}}if(i.level===`database`){let a=await e(t.getQuery(`USER_DATABASE_PRIV`,n,r)),o=f(a).find(e=>String(e.Db)===i.database);return o?z(o):{}}let a=await e(t.getQuery(`USER_TABLE_PRIV`,n,r)),o=f(a).find(e=>String(e.Db)===i.database&&String(e.Table_name)===i.table);return o?R(String(o.Table_priv??``)):{}}function H(e,t,n,r,i,a){let o=B(e,r),s=[],c=[],l=null;for(let e of new Set([...Object.keys(i),...Object.keys(a)])){let t=i[e]===!0,n=a[e]===!0;if(t!==n){if(e===`GRANT OPTION`){l=n;continue}(n?s:c).push(e)}}let u=[];if(s.length>0||l===!0){let r=s.length>0?s.join(`, `):`USAGE`;u.push(e.getQuery(`GRANT`,r,t,n,o,l===!0?`WITH GRANT OPTION`:``))}return c.length>0&&u.push(e.getQuery(`REVOKE`,c.join(`, `),t,n,o)),l===!1&&u.push(e.getQuery(`REVOKE`,`GRANT OPTION`,t,n,o)),u}function U(e){return p.getState().activeConnections.find(t=>t.id===e)?.serverConnectionId??null}function W(){let{t:e}=i(),{activeDialog:t,closeDialog:a,openDialog:o,setFooterMessage:f}=m(),v=p(e=>e.activeConnectionId)??``,y=w(e=>e.users[v]??T),b=w(e=>e.selectedUser[v]??null),x=w(e=>e.setSelectedUser),E=w(e=>e.removeUser),j=e=>x(v,e),M=(e,t)=>E(v,e,t),[N,P]=(0,O.useState)({level:`global`}),[F,L]=(0,O.useState)({}),[R,z]=(0,O.useState)([]),[B,W]=(0,O.useState)({}),[G,K]=(0,O.useState)({}),[q,J]=(0,O.useState)(!1),Y=t===`user-manager`;(0,O.useEffect)(()=>{if(!Y||!v)return;let e=U(v);if(!e)return;let t=!1;return g(v).introspect.listDatabases(h(e)).then(e=>{t||z(e)}).catch(()=>{t||z([])}),()=>{t=!0}},[Y,v]),(0,O.useEffect)(()=>{let e=N.database;if(!Y||!v||!e||B[e])return;let t=U(v);if(!t)return;let n=!1;return g(v).introspect.listTables(h(t),e).then(t=>{n||W(n=>({...n,[e]:t.map(e=>e.name)}))}).catch(()=>void 0),()=>{n=!0}},[Y,v,N.database,B]),(0,O.useEffect)(()=>{if(!Y||!v||!b){K({}),L({});return}let e=U(v);if(!e)return;let t=!1;return V(h(e),g(v),b.user,b.host,N).then(e=>{t||(K(e),L(e))}).catch(()=>{t||(K({}),L({}))}),()=>{t=!0}},[Y,v,b,N]);function X(e){e||(a(),j(null),P({level:`global`}),L({}))}let Z=(0,O.useCallback)(e=>{P(e),L({})},[]);function Q(){o(`user-add`)}async function $(){if(!b||!v)return;let{user:t,host:n}=b;J(!0);try{await _(v,g(v).getQuery(`DELETE_USER`,t,n)),M(n,t),j(null),f(e(`user.manager.removed`,{user:t,host:n}))}catch(e){f(e instanceof Error?e.message:String(e))}finally{J(!1)}}async function ee(){if(!b||!v){f(e(`user.manager.selectUserFirst`));return}let t=H(g(v),b.user,b.host,N,G,F);if(t.length===0){f(e(`user.manager.noChanges`));return}J(!0);try{for(let e of t)await _(v,e);K(F),f(e(`user.manager.applied`))}catch(e){f(e instanceof Error?e.message:String(e))}finally{J(!1)}}return(0,k.jsx)(d,{open:Y,onOpenChange:X,children:(0,k.jsxs)(l,{className:`sm:max-w-[80vw] max-h-[70vh] flex flex-col`,children:[(0,k.jsx)(s,{children:(0,k.jsx)(u,{children:e(`user.manager.title`)})}),(0,k.jsxs)(`div`,{className:`flex flex-1 gap-0 overflow-hidden min-h-0 border rounded-md`,children:[(0,k.jsxs)(`div`,{className:`w-[200px] shrink-0 border-r flex flex-col`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-1 p-2 border-b`,children:[(0,k.jsx)(r,{variant:`ghost`,size:`sm`,onClick:Q,title:e(`user.manager.addUser`),children:(0,k.jsx)(D,{className:`h-4 w-4`})}),(0,k.jsx)(r,{variant:`ghost`,size:`sm`,onClick:()=>void $(),disabled:!b||q,title:e(`user.manager.removeUser`),children:(0,k.jsx)(C,{className:`h-4 w-4`})})]}),(0,k.jsx)(S,{className:`flex-1`,children:(0,k.jsx)(`div`,{className:`py-1`,children:y.length===0?(0,k.jsx)(`div`,{className:`px-3 py-4 text-sm text-muted-foreground text-center`,children:e(`user.manager.noUsers`)}):y.map(e=>{let t=b?.user===e.user&&b?.host===e.host;return(0,k.jsx)(`div`,{className:n(`flex items-center gap-2 px-3 py-1.5 cursor-pointer text-sm hover:bg-accent`,t&&`bg-accent text-accent-foreground`),onClick:()=>j(e),children:(0,k.jsxs)(`span`,{className:`truncate`,children:[e.user,`@`,e.host]})},`${e.user}@${e.host}`)})})})]}),(0,k.jsxs)(`div`,{className:`w-[250px] shrink-0 border-r`,children:[(0,k.jsx)(`div`,{className:`p-2 border-b text-sm font-medium`,children:e(`user.manager.grantScope`)}),(0,k.jsx)(A,{connectionId:``,databases:R,tables:B,onSelectScope:Z})]}),(0,k.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,k.jsx)(I,{scope:N.level,privileges:F,onChange:L})})]}),(0,k.jsxs)(c,{children:[(0,k.jsx)(r,{onClick:()=>void ee(),disabled:q,children:e(`user.manager.apply`)}),(0,k.jsx)(r,{variant:`outline`,onClick:()=>X(!1),children:e(`user.manager.close`)})]})]})})}export{W as UserManagerDialog};
@@ -0,0 +1 @@
1
+ import{t as e}from"./CiL8zoYm.js";import{i as t,r as n}from"./Cu_sGzNJ.js";import{a as r,i,n as a,o,r as s,t as c}from"./DzRyVlxz.js";import{n as l,t as u}from"./DU-Eln5x.js";import{n as d}from"./D8_hwGjG.js";import{t as f}from"./CrhJJH3f.js";var p=n();function m(){let n=d(e=>e.activeDialog),m=d(e=>e.closeDialog),h=l(),g=h.update,{t:_}=t();return(0,p.jsx)(c,{open:n===`safety-settings`,onOpenChange:e=>{e||m()},children:(0,p.jsxs)(a,{className:`sm:max-w-[560px]`,children:[(0,p.jsxs)(r,{children:[(0,p.jsx)(o,{children:_(`settings.title`)}),(0,p.jsx)(s,{children:_(`settings.description`)})]}),(0,p.jsxs)(`div`,{className:`grid gap-2`,children:[(0,p.jsx)(f,{id:`s-confirm`,checked:h.confirmDestructive,onChange:e=>g({confirmDestructive:e}),label:`Confirm destructive statements`,hint:`Ask before DROP TABLE/DATABASE, TRUNCATE, DELETE or UPDATE without WHERE, and ALTER … DROP COLUMN.`}),(0,p.jsx)(f,{id:`s-warn`,checked:h.warnInEditor,onChange:e=>g({warnInEditor:e}),label:`Warn in the editor`,hint:`Underline destructive statements and statements a read-only connection would refuse.`}),(0,p.jsx)(f,{id:`s-override`,checked:h.allowReadOnlyOverride,onChange:e=>g({allowReadOnlyOverride:e}),label:`Allow "Run anyway" on read-only connections`,hint:`When off, writes on a read-only connection are refused with no override.`}),(0,p.jsx)(f,{id:`s-preview`,checked:h.previewGridCommit,onChange:e=>g({previewGridCommit:e}),label:`Preview SQL before committing grid edits`,hint:`Show the generated UPDATE statements and ask for confirmation.`})]}),(0,p.jsxs)(i,{children:[(0,p.jsx)(e,{variant:`ghost`,onClick:()=>g(u),children:_(`settings.resetDefaults`)}),(0,p.jsx)(e,{onClick:m,children:_(`settings.done`)})]})]})})}export{m as SafetySettingsDialog};
@@ -0,0 +1 @@
1
+ import{t as e}from"./CiL8zoYm.js";import{i as t,r as n}from"./Cu_sGzNJ.js";import{a as r,i,n as a,o,r as s,t as c}from"./DzRyVlxz.js";import"./DU-Eln5x.js";import{n as l}from"./D8_hwGjG.js";import{Y as u}from"./CExE8dKz.js";var d=`<a href="mailto:planche.dev@gmail.com">planche.dev@gmail.com</a>`,f=`2 September 2026`,p=`Planche is made and operated by <strong>deploy</strong>, a sole proprietorship registered in the Republic of Korea and owned by Juwon Jeong (“we”, “us”), at 1114 Gyeongui-ro, 4th floor, Room 405, Paju-si, Gyeonggi-do, Republic of Korea. Contact: ${d}.`,m={title:`Terms of Service — Planche`,description:`The terms under which the Planche SQL client, the local agent and Planche Pro are provided.`,ogTitle:`Planche terms of service`,h1:`Terms of Service`,intro:`Last updated ${f}. These terms cover the website and web application at planche.dev, the local agent published on npm as <code>planche</code> and by the install scripts, and the Planche Pro subscription. By using any of them you agree to these terms. ${p}`,cta:`Open Planche`,static:!0,sections:[{heading:`1. What Planche is`,body:[`Planche is a SQL client. The application runs in your browser. For MySQL, MariaDB, PostgreSQL, SQL Server, Oracle and the hosted services it supports, a small program — the local agent — runs on your own computer, holds the database connections and answers the browser over the loopback interface. SQLite files are opened inside the browser itself.`,`We host the application as a static site and nothing else. Your connection profiles, passwords, queries and results travel between your browser, the agent on your machine and your databases; none of them pass through a server of ours. The <a href="{privacy}">privacy policy</a> lists the few things that do reach us or a service we use.`,`Planche is free to use for personal and commercial purposes without an account. A set of advanced features, listed on the <a href="{pricing}">pricing page</a>, requires a Pro licence.`]},{heading:`2. Licence to use the software`,body:[`We grant you a non-exclusive, non-transferable licence to use the Planche application and the local agent, on any number of computers you own or control, for the purpose of working with databases you are authorised to access.`,`You may not redistribute, sell, rent or sublicense Planche or the agent, offer either to third parties as part of a product or service, modify or create derivative works of them, reverse engineer or decompile them except where the law grants you that right regardless of this clause, or remove any copyright or proprietary notice. Planche is proprietary software; it is not open source.`,`The agent package ships with its own licence agreement (the <code>LICENSE</code> file in the package). For the agent, that agreement applies together with these terms; if the two differ, the package licence prevails for the copy you installed.`,`Planche includes third-party open-source components, each under its own licence. Those licences govern those components and nothing here limits the rights they give you. The list is at <a href="/third-party-notices.txt">third-party-notices.txt</a>.`]},{heading:`3. Planche Pro`,body:[`Pro is a subscription, billed monthly or yearly, that unlocks the features listed on the <a href="{pricing}">pricing page</a>. It is sold through a payment provider acting as our merchant of record and authorised reseller: the provider is the seller on the transaction, processes the payment, and collects and remits any VAT or sales tax that applies. The provider’s name, the price, the currency and any tax are shown at checkout before you pay, and the provider’s own terms apply to the purchase itself.`,`After payment you receive a licence key, on the order page and by email. A key is a signed statement of who bought it, which plan and for which period; the application verifies it on your computer without contacting anyone. A key covers <strong>one person</strong> on every computer that person uses. It may not be shared, published, or resold, and a key found published may be excluded from renewal. For several people, buy one licence each or write to us about a team licence.`,`Because a key is verified offline, it cannot be withdrawn before it expires. Keys are therefore issued for exactly the period that was paid for. While your subscription stays paid you receive a key that covers each new period; when it ends, the Pro features stop at the end of the last paid period and everything else keeps working. Nothing you have stored — profiles, history, saved files — is touched.`,`You can cancel at any time from the customer portal linked in your receipt, or by writing to us. Cancelling stops future charges; the current period runs to its end. Refunds are described in the <a href="{refund}">refund policy</a>.`,`If we change the price of Pro, the new price applies from your next renewal at the earliest, and we tell you by email at least 30 days before that renewal so you can cancel first.`]},{heading:`4. Connection sync`,body:[`Connection sync is an optional Pro feature that keeps your connection profiles on more than one computer. Using it means signing in with a GitHub or Google account; that is the only case in which an account exists. Your profiles are encrypted in the browser with a passphrase you choose before they are uploaded, and the passphrase never leaves your machine. We cannot read the vault and we cannot recover it if you lose the passphrase.`,`Sync is only offered on planche.dev. You can delete your account and vault from the application at any time, or by writing to us. We may discontinue sync with at least 30 days’ notice, during which your profiles remain available on every signed-in computer.`]},{heading:`5. AI features`,body:[`Some features can ask a language model to explain a failed statement or a query plan. They only work if you configure a provider, and what is sent goes from the agent on your computer directly to that provider, under that provider’s terms and privacy policy — not through us. The material sent is narrow: the statement with its secrets masked, the database’s own error message, and the column names of the tables the statement refers to. No rows, hosts or credentials.`,`A model’s answer can be wrong. Suggested statements are shown for you to review; running them is your decision, and section 7 applies to it.`]},{heading:`6. Acceptable use`,body:[`You may only use Planche with databases you own or are authorised to access. You may not use it to gain access you do not have, to interfere with a service, or in breach of any law that applies to you. You may not circumvent or disable the licence check, and you may not expose the local agent to the network in a way that lets others use it as a proxy to your databases or to other hosts.`]},{heading:`7. Your data, your responsibility`,body:[`Planche executes the SQL you give it, and SQL can change or delete data. The safeguards in the application — read-only connections, confirmation of destructive statements, dry run — are aids and not guarantees. You are responsible for keeping backups of your databases and for reviewing statements before you run them, and we accept no responsibility for the effect of a statement you ran.`,`Planche stores your connection profiles, and if you choose so your passwords, in your browser’s storage and, for the agent, in a directory under your home folder. Protecting that computer is your responsibility.`]},{heading:`8. Changes to the service`,body:[`We improve Planche continuously and may add, change or remove features. A feature that is free today may become part of Pro in a later version; a version you already have keeps working as it did. We may stop offering the hosted application at planche.dev; the agent can serve its own copy of the application, so an installed Planche keeps working without it.`]},{heading:`9. No warranty`,body:[`PLANCHE IS PROVIDED “AS IS” AND “AS AVAILABLE”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. We do not promise that it will be uninterrupted, error-free or compatible with every database version.`]},{heading:`10. Limitation of liability`,body:[`TO THE EXTENT PERMITTED BY LAW, WE ARE NOT LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES, OR FOR LOSS OF DATA, PROFITS OR BUSINESS, ARISING FROM OR IN CONNECTION WITH PLANCHE. OUR TOTAL LIABILITY FOR ALL CLAIMS TOGETHER IS LIMITED TO THE AMOUNT YOU PAID US FOR PLANCHE IN THE TWELVE MONTHS BEFORE THE CLAIM AROSE.`,`Nothing in these terms excludes or limits liability that cannot be excluded under the law that applies to you, including liability for intent or gross negligence, or any right you have as a consumer under mandatory law.`]},{heading:`11. Termination`,body:[`You can stop using Planche at any time; there is no account to close unless you use sync. We may end your licence if you materially breach these terms, in which case you must stop using the software. Sections 7, 9, 10 and 13 survive termination.`]},{heading:`12. Changes to these terms`,body:[`We may update these terms. The date at the top says when they last changed. A change that affects Pro subscribers materially is announced by email at least 30 days before it takes effect; continued use after that date is acceptance. If you do not agree, cancel before the change takes effect.`]},{heading:`13. Governing law`,body:[`These terms are governed by the laws of the Republic of Korea, and disputes are subject to the courts of Seoul, Republic of Korea. If you are a consumer, this does not take away the protection of the mandatory consumer laws of the country you live in, or your right to bring a claim there.`]},{heading:`14. Contact`,body:[`Questions about these terms: ${d}.`]}]};`${f}${p}`,`${d}`,`${f}${p}`,`${d}`,`${d}`;var h=m.sections,g=n();function _(e){return e.replace(/\{([a-z]+)\}/g,(e,t)=>t in u?u[t]:e).replace(/<a href="/g,`<a target="_blank" rel="noreferrer" href="`)}function v(){let n=l(e=>e.activeDialog),d=l(e=>e.closeDialog),{t:p}=t();return(0,g.jsx)(c,{open:n===`terms`,onOpenChange:e=>{e||d()},children:(0,g.jsxs)(a,{className:`flex max-h-[85vh] flex-col sm:max-w-[640px]`,children:[(0,g.jsxs)(r,{children:[(0,g.jsx)(o,{children:p(`terms.title`)}),(0,g.jsxs)(s,{children:[p(`terms.version`,{version:1}),` · `,p(`terms.updated`,{date:f})]})]}),(0,g.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-md border bg-muted/40 p-4 text-sm`,children:[(0,g.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:p(`terms.englishOnly`)}),h.map(e=>(0,g.jsxs)(`section`,{className:`mb-4 last:mb-0`,children:[(0,g.jsx)(`h3`,{className:`mb-1 font-semibold`,children:e.heading}),e.body.map((e,t)=>(0,g.jsx)(`p`,{className:`mb-2 leading-relaxed text-muted-foreground last:mb-0 [&_a]:underline [&_a]:underline-offset-2 [&_code]:rounded [&_code]:bg-muted [&_code]:px-1`,dangerouslySetInnerHTML:{__html:_(e)}},t))]},e.heading))]}),(0,g.jsxs)(i,{className:`sm:justify-between`,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs`,children:[(0,g.jsx)(`a`,{href:u.terms,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:p(`terms.online`)}),(0,g.jsx)(`a`,{href:u.privacy,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:p(`terms.privacyLink`)}),(0,g.jsx)(`a`,{href:u.refund,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:p(`terms.refundLink`)})]}),(0,g.jsx)(e,{onClick:d,children:p(`settings.done`)})]})]})})}export{v as TermsDialog};
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./hePW80VL.js";import{p as t}from"./CYz610vE.js";import{i as n,r,t as i}from"./Cu_sGzNJ.js";import{t as a}from"./CgQ0qqq4.js";import{P as o,R as s}from"./S7HbowYz.js";import{n as c}from"./D8_hwGjG.js";import{n as l}from"./C1gqjEN3.js";import{C as u}from"./BkXrfAoR.js";import{g as d}from"./BnJGrP6V.js";import{E as f,Ft as p,Gt as m,Mt as h,Nt as g,Yt as _,d as v,jt as y,pt as b,wt as x,y as S}from"./CExE8dKz.js";import{a as C,c as w,d as T,f as E,h as D,i as O,l as k,m as A,n as j,o as M,p as N,r as P,s as F,t as I,u as L}from"./B7zF7RU4.js";import{n as R}from"./84VwJAQi.js";var z=e(t(),1),B=r(),V=300;function H({columns:e,rows:t,rowKey:r,readOnly:a,onEdit:o,onDelete:s,addColumns:c,onAdd:l,addExtra:u}){let{t:d}=n(),[f,m]=(0,z.useState)(null),[h,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)({}),[S,C]=(0,z.useState)(!1),w=async e=>{v(!0);try{await e()}catch{}finally{v(!1)}},T=e=>w(async()=>{!f||!o||(await o(e,f.column,f.value),m(null))}),E=()=>w(async()=>{l&&(await l(y),b({}),C(!1))});return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[!a&&l&&c&&(0,B.jsx)(`div`,{className:`flex flex-shrink-0 flex-wrap items-center gap-2 border-b px-3 py-1.5`,children:S?(0,B.jsxs)(B.Fragment,{children:[c.map(e=>(0,B.jsx)(`input`,{className:`h-7 rounded border bg-background px-2 text-xs ${e.numeric?`w-24`:`min-w-40 flex-1`}`,placeholder:e.label,value:y[e.key]??``,onChange:t=>b({...y,[e.key]:t.target.value}),onKeyDown:e=>{e.key===`Enter`&&E()}},e.key)),u,(0,B.jsxs)(`button`,{type:`button`,disabled:h,onClick:()=>void E(),className:`flex h-7 items-center gap-1 rounded border border-primary/30 bg-primary/10 px-2 text-xs text-primary hover:bg-primary/20 disabled:opacity-40`,children:[(0,B.jsx)(_,{className:`size-3`}),d(`keyViewer.add`)]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{C(!1),b({})},className:`flex h-7 items-center rounded border px-2 text-xs text-muted-foreground hover:text-foreground`,children:d(`keyViewer.cancel`)})]}):(0,B.jsxs)(`button`,{type:`button`,onClick:()=>C(!0),className:`flex h-7 items-center gap-1 rounded border bg-background px-2 text-xs text-muted-foreground hover:text-foreground`,children:[(0,B.jsx)(g,{className:`size-3`}),d(`keyViewer.addRow`)]})}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,B.jsx)(`thead`,{className:`sticky top-0 z-10 bg-muted`,children:(0,B.jsxs)(`tr`,{children:[e.map(e=>(0,B.jsx)(`th`,{className:`border-b px-3 py-1.5 text-left font-medium text-muted-foreground ${e.numeric?`w-28`:``}`,children:e.label},e.key)),!a&&(o||s)&&(0,B.jsx)(`th`,{className:`w-16 border-b`})]})}),(0,B.jsx)(`tbody`,{children:t.map((t,n)=>{let c=r(t,n);return(0,B.jsxs)(`tr`,{className:`group border-b border-border/50 hover:bg-muted/40`,children:[e.map(e=>{let n=f?.row===c&&f.column===e.key,r=t[e.key]??``;return(0,B.jsx)(`td`,{className:`px-3 py-1 align-top font-mono ${e.numeric?`text-right tabular-nums`:``}`,children:n?(0,B.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,B.jsx)(`textarea`,{autoFocus:!0,className:`min-h-7 w-full resize-y rounded border bg-background px-1.5 py-1 font-mono text-xs`,rows:Math.min(8,Math.max(1,r.split(`
2
+ `).length)),value:f.value,onChange:e=>m({...f,value:e.target.value}),onKeyDown:e=>{e.key===`Escape`&&m(null),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&T(t)}}),(0,B.jsx)(`button`,{type:`button`,disabled:h,title:d(`keyViewer.save`),onClick:()=>void T(t),className:`rounded p-1 text-primary hover:bg-primary/10`,children:(0,B.jsx)(_,{className:`size-3.5`})}),(0,B.jsx)(`button`,{type:`button`,title:d(`keyViewer.cancel`),onClick:()=>m(null),className:`rounded p-1 text-muted-foreground hover:bg-muted`,children:(0,B.jsx)(i,{className:`size-3.5`})})]}):e.render?e.render(r):(0,B.jsx)(`span`,{className:`whitespace-pre-wrap break-all`,title:r.length>V?r:void 0,children:r.length>V?`${r.slice(0,V)}…`:r})},e.key)}),!a&&(o||s)&&(0,B.jsx)(`td`,{className:`px-1 py-1 align-top`,children:(0,B.jsxs)(`div`,{className:`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100`,children:[o&&e.some(e=>e.editable)&&(0,B.jsx)(`button`,{type:`button`,title:d(`keyViewer.edit`),onClick:()=>{let n=e.find(e=>e.editable);m({row:c,column:n.key,value:t[n.key]??``})},className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,B.jsx)(p,{className:`size-3`})}),s&&(0,B.jsx)(`button`,{type:`button`,disabled:h,title:d(`keyViewer.deleteRow`),onClick:()=>void w(()=>s(t)),className:`rounded p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive`,children:(0,B.jsx)(x,{className:`size-3`})})]})})]},c)})})]}),t.length===0&&(0,B.jsx)(`p`,{className:`p-6 text-center text-xs text-muted-foreground`,children:d(`keyViewer.empty`)})]})]})}var U=e=>e instanceof Error?e.message:String(e);function W(e){let{access:t,onChanged:n,onError:r}=e;return(0,z.useCallback)(async(e,i)=>{try{await t.write(e),await i?.(),n()}catch(e){if(e instanceof Error&&e.name===`ExecutionCancelled`)return;throw r(U(e)),e}},[t,n,r])}function G({onApply:e}){let{t}=n(),[r,i]=(0,z.useState)(``);return(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(y,{className:`size-3.5 text-muted-foreground`}),(0,B.jsx)(`input`,{className:`h-7 w-56 rounded border bg-background px-2 text-xs`,placeholder:t(`keyViewer.filterPlaceholder`),value:r,onChange:e=>i(e.target.value),onKeyDown:t=>{t.key===`Enter`&&e(j(r))}})]})}function K({shown:e,total:t,hasMore:r,onMore:i,loading:a}){let{t:o}=n();return(0,B.jsxs)(`div`,{className:`flex flex-shrink-0 items-center gap-3 border-t px-3 py-1 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:t===null?o(`keyViewer.shown`,{count:e}):o(`keyViewer.shownOf`,{count:e,total:t})}),r&&(0,B.jsx)(`button`,{type:`button`,disabled:a,onClick:i,className:`rounded border bg-background px-2 py-0.5 hover:text-foreground disabled:opacity-40`,children:o(`keyViewer.loadMore`)})]})}function q({props:e,load:t,save:r}){let{t:i}=n(),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(!1),[d,p]=(0,z.useState)(`preview`),[m,h]=(0,z.useState)(!1),{onError:g}=e,_=(0,z.useCallback)(async(e=!1)=>{try{let n=await t(e);o(n.text),c(n.text),u(n.partial)}catch(e){g(U(e))}},[t,g]);(0,z.useEffect)(()=>{Promise.resolve().then(()=>_())},[_]);let y=S(s),b=d===`preview`&&y.kind!==`text`,x=a!==null&&s!==a,C=async()=>{h(!0);try{await r(s),o(s)}catch{}finally{h(!1)}};if(a===null)return(0,B.jsx)(`p`,{className:`p-6 text-xs text-muted-foreground`,children:i(`keyViewer.loading`)});let w=e=>`rounded px-2 py-0.5 ${e?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`}`;return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex flex-shrink-0 items-center gap-2 border-b px-3 py-1.5 text-xs`,children:[y.kind!==`text`&&(0,B.jsxs)(`div`,{className:`flex items-center gap-0.5 rounded border p-0.5`,children:[(0,B.jsx)(`button`,{type:`button`,className:w(b),onClick:()=>p(`preview`),children:i(y.kind===`json`?`keyViewer.viewTree`:`keyViewer.viewHtml`)}),(0,B.jsx)(`button`,{type:`button`,className:w(!b),onClick:()=>p(`text`),children:i(`keyViewer.viewText`)})]}),!b&&y.kind===`json`&&!e.access.readOnly&&!l&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>c(A(s)??s),className:`rounded border bg-background px-2 py-0.5 text-muted-foreground hover:text-foreground`,children:i(`keyViewer.formatJson`)}),l&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`text-catppuccin-yellow`,children:i(`keyViewer.truncated`,{size:P(1048576)})}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>void _(!0),className:`rounded border bg-background px-2 py-0.5 text-muted-foreground hover:text-foreground`,children:i(`keyViewer.loadFull`)})]}),(0,B.jsx)(`div`,{className:`flex-1`}),!e.access.readOnly&&!l&&(0,B.jsxs)(B.Fragment,{children:[x&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>c(a),className:`rounded border bg-background px-2 py-0.5 text-muted-foreground hover:text-foreground`,children:i(`keyViewer.revert`)}),(0,B.jsx)(`button`,{type:`button`,disabled:!x||m,onClick:()=>void C(),className:`rounded border border-primary/30 bg-primary/10 px-2 py-0.5 text-primary hover:bg-primary/20 disabled:opacity-40`,children:i(`keyViewer.save`)})]})]}),b&&y.kind===`json`?(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto py-3 pl-7 pr-3 font-mono text-xs`,children:(0,B.jsx)(f,{value:y.document,defaultExpanded:!0})}):b&&y.kind===`html`?(0,B.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,B.jsx)(v,{html:s})}):(0,B.jsx)(`textarea`,{className:`min-h-0 flex-1 resize-none bg-background p-3 font-mono text-xs outline-none`,spellCheck:!1,readOnly:e.access.readOnly||l,value:s,onChange:e=>c(e.target.value)})]})}function J(e){let{access:t,keyName:n,length:r,ttl:i}=e,a=W(e),o=(0,z.useCallback)(async e=>{let i=!e&&r!==null&&r>1048576,a=await t.read(C.getString(n,i?I:void 0));return{text:a==null?``:String(a),partial:i}},[t,n,r]),s=(0,z.useCallback)(async e=>{try{await a(C.setString(n,e))}catch(t){if(!/syntax|KEEPTTL/i.test(U(t)))throw t;await a(C.setStringWithTtl(n,e,i))}},[a,n,i]);return(0,B.jsx)(q,{props:e,load:o,save:s})}function Y(e){let{access:t,keyName:n}=e,r=W(e),i=(0,z.useCallback)(async()=>{let e=await t.read(C.getJson(n));return{text:e==null?``:String(e),partial:!1}},[t,n]),a=(0,z.useCallback)(async e=>{JSON.parse(e),await r(C.setJson(n,e))},[r,n]);return(0,B.jsx)(q,{props:e,load:i,save:a})}function X(e,t,n){let{access:r,onError:i}=e,[a,o]=(0,z.useState)([]),[s,c]=(0,z.useState)(`0`),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)(!1),h=(0,z.useCallback)(async(e,a,s)=>{f(!0);try{let i=e,l=[];do{let e=n(await r.read(t(i,a)));l.push(...e.items),i=e.cursor}while(i!==`0`&&l.length===0);o(e=>s?[...e,...l]:l),c(i),m(!0)}catch(e){i(U(e))}finally{f(!1)}},[r,t,n,i]);return(0,z.useEffect)(()=>{Promise.resolve().then(()=>h(`0`,l,!1))},[h,l]),{items:a,setItems:o,loading:d,started:p,hasMore:p&&s!==`0`,loadMore:()=>void h(s,l,!0),applyFilter:u,reload:()=>void h(`0`,l,!1)}}function Z(e){let{t}=n(),{keyName:r,length:i,access:a}=e,o=W(e),s=X(e,(0,z.useCallback)((e,t)=>C.scan(r,`hash`,e,t),[r]),w),c=[{key:`field`,label:t(`keyViewer.field`)},{key:`value`,label:t(`keyViewer.value`),editable:!0}];return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(`div`,{className:`flex flex-shrink-0 items-center gap-2 border-b px-3 py-1.5`,children:(0,B.jsx)(G,{onApply:s.applyFilter})}),(0,B.jsx)(H,{columns:c,rows:s.items.map(e=>({field:e.field,value:e.value})),rowKey:e=>e.field,readOnly:a.readOnly,onEdit:(e,t,n)=>o(C.hashSet(r,e.field,n),()=>{s.setItems(t=>t.map(t=>t.field===e.field?{...t,value:n}:t))}),onDelete:e=>o(C.hashDelete(r,e.field),()=>{s.setItems(t=>t.filter(t=>t.field!==e.field))}),addColumns:c.map(e=>({...e,editable:!1})),onAdd:e=>o(C.hashSet(r,e.field??``,e.value??``),s.reload)}),(0,B.jsx)(K,{shown:s.items.length,total:i,hasMore:s.hasMore,onMore:s.loadMore,loading:s.loading})]})}function Q(e){let{t}=n(),{keyName:r,length:i,access:a}=e,o=W(e),s=X(e,(0,z.useCallback)((e,t)=>C.scan(r,`set`,e,t),[r]),L),c=[{key:`member`,label:t(`keyViewer.member`)}];return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(`div`,{className:`flex flex-shrink-0 items-center gap-2 border-b px-3 py-1.5`,children:(0,B.jsx)(G,{onApply:s.applyFilter})}),(0,B.jsx)(H,{columns:c,rows:s.items.map(e=>({member:e})),rowKey:e=>e.member,readOnly:a.readOnly,onDelete:e=>o(C.setRemove(r,e.member),()=>{s.setItems(t=>t.filter(t=>t!==e.member))}),addColumns:c,onAdd:e=>o(C.setAdd(r,e.member??``),s.reload)}),(0,B.jsx)(K,{shown:s.items.length,total:i,hasMore:s.hasMore,onMore:s.loadMore,loading:s.loading})]})}function ee(e){let{t}=n(),{keyName:r,length:i,access:a}=e,o=W(e),s=X(e,(0,z.useCallback)((e,t)=>C.scan(r,`zset`,e,t),[r]),N),c=[{key:`member`,label:t(`keyViewer.member`)},{key:`score`,label:t(`keyViewer.score`),editable:!0,numeric:!0}],l=[...s.items].sort((e,t)=>Number(e.score)-Number(t.score)).map(e=>({member:e.member,score:e.score}));return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(`div`,{className:`flex flex-shrink-0 items-center gap-2 border-b px-3 py-1.5`,children:(0,B.jsx)(G,{onApply:s.applyFilter})}),(0,B.jsx)(H,{columns:c,rows:l,rowKey:e=>e.member,readOnly:a.readOnly,onEdit:(e,t,n)=>o(C.zsetAdd(r,e.member,n.trim()),()=>{s.setItems(t=>t.map(t=>t.member===e.member?{...t,score:n.trim()}:t))}),onDelete:e=>o(C.zsetRemove(r,e.member),()=>{s.setItems(t=>t.filter(t=>t.member!==e.member))}),addColumns:[{key:`member`,label:t(`keyViewer.member`)},{key:`score`,label:t(`keyViewer.score`),numeric:!0}],onAdd:e=>o(C.zsetAdd(r,e.member??``,(e.score??`0`).trim()||`0`),s.reload)}),(0,B.jsx)(K,{shown:s.items.length,total:i,hasMore:s.hasMore,onMore:s.loadMore,loading:s.loading})]})}function te(e){let{t}=n(),{keyName:r,length:i,access:a,onError:o}=e,s=W(e),[c,l]=(0,z.useState)([]),[u,d]=(0,z.useState)(!1),[f,p]=(0,z.useState)(!1),m=(0,z.useCallback)(async e=>{d(!0);try{let t=k(await a.read(C.listRange(r,e)));l(n=>e===0?t:[...n,...t])}catch(e){o(U(e))}finally{d(!1)}},[a,r,o]);(0,z.useEffect)(()=>{Promise.resolve().then(()=>m(0))},[m]);let h=[{key:`index`,label:t(`keyViewer.index`),numeric:!0},{key:`value`,label:t(`keyViewer.value`),editable:!0}];return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(H,{columns:h,rows:c.map((e,t)=>({index:String(t),value:e})),rowKey:e=>e.index,readOnly:a.readOnly,onEdit:(e,t,n)=>s(C.listSet(r,Number(e.index),n),()=>{l(t=>t.map((t,r)=>r===Number(e.index)?n:t))}),onDelete:async e=>{let t=M();await s(C.listSet(r,Number(e.index),t)),await s(C.listRemoveOne(r,t),()=>m(0))},addColumns:[{key:`value`,label:t(`keyViewer.value`)}],addExtra:(0,B.jsxs)(`select`,{value:f?`head`:`tail`,onChange:e=>p(e.target.value===`head`),className:`h-7 rounded border bg-background px-1 text-xs`,children:[(0,B.jsx)(`option`,{value:`tail`,children:t(`keyViewer.pushTail`)}),(0,B.jsx)(`option`,{value:`head`,children:t(`keyViewer.pushHead`)})]}),onAdd:e=>s(C.listPush(r,e.value??``,f),()=>m(0))}),(0,B.jsx)(K,{shown:c.length,total:i,hasMore:i!==null&&c.length<i,onMore:()=>void m(c.length),loading:u})]})}function ne(e){let{t}=n(),{keyName:r,length:i,access:a,onError:o}=e,s=W(e),[c,l]=(0,z.useState)([]),[u,d]=(0,z.useState)(!1),f=(0,z.useCallback)(async e=>{d(!0);try{let t=T(await a.read(C.streamRange(r,e)));l(n=>e?[...n,...t]:t)}catch(e){o(U(e))}finally{d(!1)}},[a,r,o]);(0,z.useEffect)(()=>{Promise.resolve().then(()=>f())},[f]);let p=c.map(e=>({id:e.id,fields:JSON.stringify(e.fields)})),m=[{key:`id`,label:t(`keyViewer.entryId`)},{key:`fields`,label:t(`keyViewer.fields`),render:e=>(0,B.jsx)(`dl`,{className:`grid grid-cols-[max-content_1fr] gap-x-3`,children:JSON.parse(e).map(([e,t],n)=>(0,B.jsxs)(`div`,{className:`contents`,children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,B.jsx)(`dd`,{className:`break-all`,children:t})]},n))})}];return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(H,{columns:m,rows:p,rowKey:e=>e.id,readOnly:a.readOnly,onDelete:e=>s(C.streamDelete(r,e.id),()=>{l(t=>t.filter(t=>t.id!==e.id))}),addColumns:[{key:`fields`,label:t(`keyViewer.entryFieldsPlaceholder`)}],onAdd:e=>{let n=F((e.fields??``).replaceAll(`;`,`
3
+ `));return n.length===0?(o(t(`keyViewer.entryFieldsRequired`)),Promise.reject(Error(t(`keyViewer.entryFieldsRequired`)))):s(C.streamAdd(r,n),()=>f())}}),(0,B.jsx)(K,{shown:c.length,total:i,hasMore:i!==null&&c.length<i,onMore:()=>void f(c[c.length-1]?.id),loading:u})]})}var re={string:J,hash:Z,list:te,set:Q,zset:ee,stream:ne,"ReJSON-RL":Y};function $(e,t,n,r=null){for(let i of e){if(i.type===s.KEY&&i.metadata?.database===t&&i.metadata.key===n)return r;let e=$(i.children,t,n,i);if(e)return e}return null}function ie({connectionId:e,tabId:t,item:r}){let{t:s}=n(),f=R(e,t,r),{loadChildren:g}=d(),[v,y]=(0,z.useState)(null),[S,w]=(0,z.useState)(!1),[T,k]=(0,z.useState)(null),[A,j]=(0,z.useState)(0),[M,N]=(0,z.useState)(null),[F,I]=(0,z.useState)(null),L=r.name,V=(0,z.useCallback)(async()=>{if(f.connected)try{let e=String(await f.read(C.type(L)));if(e===`none`){w(!0),y(null);return}let t=C.length(L,e),[n,r,i,a]=await Promise.all([f.read(C.ttl(L)),t?f.tryRead(t):Promise.resolve(null),f.tryRead(C.memory(L)),f.tryRead(C.encoding(L))]),o=E(n);w(o===`gone`),y({type:e,ttl:o===`gone`?null:o,length:D(r),memory:D(i),encoding:typeof a==`string`?a:null})}catch(e){k(e instanceof Error?e.message:String(e))}},[f,L]);(0,z.useEffect)(()=>{Promise.resolve().then(()=>V())},[V]);let H=(0,z.useCallback)(t=>{let n=$(u.getState().trees[e]??[],r.database,t);n&&g(e,n)},[e,r.database,g]),U=async e=>{try{k(null),await e()}catch(e){if(e instanceof Error&&e.name===`ExecutionCancelled`)return;k(e instanceof Error?e.message:String(e))}},W=n=>U(async()=>{if(!n||n===L){N(null);return}let i=await f.write(C.renameIfFree(L,n));if(Number(i)!==1)throw Error(s(`keyViewer.renameTaken`,{name:n}));N(null),H(L),l.getState().setSourceItem(e,t,{database:r.database,name:n})}),G=e=>U(async()=>{let t=Number(e);if(e.trim()===``)await f.write(C.persist(L));else if(!Number.isInteger(t)||t<=0)throw Error(s(`keyViewer.ttlInvalid`));else await f.write(C.expire(L,t));I(null),await V()}),K=()=>U(async()=>{let n=C.remove(L);await c.getState().requestDestructiveConfirm({title:s(`keyViewer.deleteTitle`,{name:L}),description:s(`keyViewer.deleteDescription`),statements:[n],confirmLabel:s(`keyViewer.delete`)})&&(await f.write(n,{confirmed:!0}),H(L),l.getState().removeQueryTab(e,t))}),q=()=>{v&&b(e,o(v.type,L),r.database,L)};if(!f.connected)return(0,B.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:s(`keyViewer.notConnected`)});let J=v?re[v.type]:void 0,Y=`flex h-7 items-center gap-1 rounded border bg-background px-2 text-xs text-muted-foreground hover:text-foreground disabled:opacity-40`;return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex flex-shrink-0 flex-wrap items-center gap-x-3 gap-y-1.5 border-b bg-muted/30 px-3 py-1.5 text-xs`,children:[v&&(0,B.jsx)(`span`,{className:`rounded bg-primary/15 px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase text-primary`,children:v.type===`ReJSON-RL`?`json`:v.type}),M===null?(0,B.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-sm font-medium`,children:[L,!f.readOnly&&!S&&(0,B.jsx)(`button`,{type:`button`,title:s(`keyViewer.rename`),onClick:()=>N(L),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,B.jsx)(p,{className:`size-3`})})]}):(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`input`,{autoFocus:!0,className:`h-7 w-72 rounded border bg-background px-2 font-mono text-xs`,value:M,onChange:e=>N(e.target.value),onKeyDown:e=>{e.key===`Enter`&&W(M),e.key===`Escape`&&N(null)}}),(0,B.jsx)(`button`,{type:`button`,title:s(`keyViewer.save`),onClick:()=>void W(M),className:`rounded p-1 text-primary hover:bg-primary/10`,children:(0,B.jsx)(_,{className:`size-3.5`})}),(0,B.jsx)(`button`,{type:`button`,title:s(`keyViewer.cancel`),onClick:()=>N(null),className:`rounded p-1 text-muted-foreground hover:bg-muted`,children:(0,B.jsx)(i,{className:`size-3.5`})})]}),v&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-1 text-muted-foreground`,children:[(0,B.jsx)(m,{className:`size-3`}),F===null?(0,B.jsx)(`button`,{type:`button`,disabled:f.readOnly,onClick:()=>I(v.ttl===null?``:String(v.ttl)),className:`rounded px-1 hover:bg-muted hover:text-foreground disabled:hover:bg-transparent`,title:f.readOnly?void 0:s(`keyViewer.ttlEdit`),children:v.ttl===null?s(`keyViewer.noExpiry`):O(v.ttl)}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`input`,{autoFocus:!0,className:`h-6 w-24 rounded border bg-background px-1.5 text-xs`,placeholder:s(`keyViewer.ttlPlaceholder`),value:F,onChange:e=>I(e.target.value),onKeyDown:e=>{e.key===`Enter`&&G(F),e.key===`Escape`&&I(null)}}),(0,B.jsx)(`button`,{type:`button`,title:s(`keyViewer.save`),onClick:()=>void G(F),className:`rounded p-1 text-primary hover:bg-primary/10`,children:(0,B.jsx)(_,{className:`size-3.5`})}),(0,B.jsx)(`button`,{type:`button`,title:s(`keyViewer.cancel`),onClick:()=>I(null),className:`rounded p-1 hover:bg-muted`,children:(0,B.jsx)(i,{className:`size-3.5`})})]})]}),v.length!==null&&(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:s(v.type===`string`?`keyViewer.bytes`:`keyViewer.length`,{count:v.length})}),(0,B.jsx)(`span`,{className:`text-muted-foreground`,title:v.encoding?s(`keyViewer.encoding`,{encoding:v.encoding}):void 0,children:s(`keyViewer.memory`,{size:P(v.memory)})})]}),(0,B.jsx)(`div`,{className:`flex-1`}),(0,B.jsxs)(`button`,{type:`button`,className:Y,onClick:()=>{k(null),j(e=>e+1),V()},children:[(0,B.jsx)(h,{className:`size-3`}),s(`keyViewer.refresh`)]}),(0,B.jsxs)(`button`,{type:`button`,className:Y,disabled:!v,onClick:q,children:[(0,B.jsx)(a,{className:`size-3`}),s(`keyViewer.openInConsole`)]}),!f.readOnly&&!S&&(0,B.jsxs)(`button`,{type:`button`,className:`${Y} hover:border-destructive/40 hover:text-destructive`,onClick:()=>void K(),children:[(0,B.jsx)(x,{className:`size-3`}),s(`keyViewer.delete`)]})]}),T&&(0,B.jsxs)(`div`,{className:`flex flex-shrink-0 items-start gap-2 border-b border-destructive/30 bg-destructive/10 px-3 py-1.5 text-xs text-destructive`,children:[(0,B.jsx)(`span`,{className:`flex-1 whitespace-pre-wrap`,children:T}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>k(null),children:(0,B.jsx)(i,{className:`size-3.5`})})]}),S?(0,B.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:s(`keyViewer.gone`)}):v?J?(0,B.jsx)(J,{access:f,keyName:L,length:v.length,ttl:v.ttl,onChanged:()=>void V(),onError:k},`${L}:${A}`):(0,B.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:s(`keyViewer.unsupported`,{type:v.type})}):(0,B.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:s(`keyViewer.loading`)})]})}export{ie as RedisKeyViewer};
@@ -0,0 +1 @@
1
+ import{r as e}from"./hePW80VL.js";import{p as t}from"./CYz610vE.js";import{i as n,r,t as i}from"./Cu_sGzNJ.js";import{Mt as a}from"./CExE8dKz.js";var o=e(t(),1),s=r(),c=5;function l({title:e,onRefresh:t,autoRefresh:r,actions:l,error:u,onDismissError:d,children:f}){let{t:p}=n(),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1),v=(0,o.useRef)(t);(0,o.useEffect)(()=>{v.current=t},[t]),(0,o.useEffect)(()=>{if(!m)return;let e=setInterval(()=>{v.current()},c*1e3);return()=>clearInterval(e)},[m]);let y=async()=>{_(!0);try{await t()}finally{_(!1)}};return(0,s.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,s.jsxs)(`div`,{className:`flex flex-shrink-0 flex-wrap items-center gap-2 border-b bg-muted/30 px-3 py-1.5 text-xs`,children:[(0,s.jsx)(`span`,{className:`text-sm font-medium`,children:e}),(0,s.jsx)(`div`,{className:`flex-1`}),l,r&&(0,s.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-muted-foreground`,children:[(0,s.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked),className:`accent-primary`}),p(`tools.autoRefresh`,{seconds:c})]}),(0,s.jsxs)(`button`,{type:`button`,disabled:g,onClick:()=>void y(),className:`flex h-7 items-center gap-1 rounded border bg-background px-2 text-muted-foreground hover:text-foreground disabled:opacity-40`,children:[(0,s.jsx)(a,{className:`size-3 ${g?`animate-spin`:``}`}),p(`keyViewer.refresh`)]})]}),u&&(0,s.jsxs)(`div`,{className:`flex flex-shrink-0 items-start gap-2 border-b border-destructive/30 bg-destructive/10 px-3 py-1.5 text-xs text-destructive`,children:[(0,s.jsx)(`span`,{className:`flex-1 whitespace-pre-wrap`,children:u}),(0,s.jsx)(`button`,{type:`button`,onClick:d,children:(0,s.jsx)(i,{className:`size-3.5`})})]}),(0,s.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:f})]})}export{l as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./Nro86Y63.js";import{M as t,t as n}from"./S7HbowYz.js";function r(e){let r=n.getState().activeConnections.find(t=>t.id===e);return t(r)}function i(e){let r=n.getState().activeConnections.find(t=>t.serverConnectionId===e);return t(r)}function a(){return r(n.getState().activeConnectionId)}var o=class extends Error{constructor(e){super(`${e} does not support SQL`),this.name=`NotSqlEngineError`}};function s(t){if(!e(t))throw new o(t.label);return t}function c(e){return s(r(e))}function l(e){return s(i(e))}function u(){return s(a())}export{s as a,l as i,r as n,c as r,u as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./hePW80VL.js";import{p as t}from"./CYz610vE.js";import{t as n}from"./CiL8zoYm.js";import{i as r,r as i}from"./Cu_sGzNJ.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./DzRyVlxz.js";import{a as d,i as f,n as p,o as m}from"./DU-Eln5x.js";import{o as h}from"./BjwrN_ch.js";import{n as g,t as _}from"./D8_hwGjG.js";import{Ot as v,X as y}from"./CExE8dKz.js";var b=e(t(),1);function x(e,t){let n=e=>e.split(/[.+-]/).slice(0,3).map(e=>Number.parseInt(e,10)||0),r=n(e),i=n(t);for(let e=0;e<3;e++)if(r[e]!==i[e])return r[e]<i[e];return!1}var S=i();function C(){let e=g(e=>e.activeDialog),t=g(e=>e.closeDialog),i=_(`whats-new`),{t:C,i18n:w}=r(),T=d.includes(w.resolvedLanguage??``)?w.resolvedLanguage:`en`,E=e===`whats-new`,[D]=(0,b.useState)(()=>p.getState().changelogSeen),O=(0,b.useMemo)(()=>i?.all?f:m(D),[i?.all,D]),k=O.find(e=>e.agent)?.agent,[A,j]=(0,b.useState)(null);(0,b.useEffect)(()=>{if(!E||!k)return;let e=!0;return h().then(t=>{e&&t.state!==`offline`&&j(t.version)}),()=>{e=!1}},[E,k]);let M=k&&A&&x(A,k),N=()=>{p.getState().markChangelogSeen(),t()};return(0,S.jsx)(u,{open:E,onOpenChange:e=>{e||N()},children:(0,S.jsxs)(s,{className:`flex max-h-[85vh] flex-col sm:max-w-[560px]`,children:[(0,S.jsxs)(a,{children:[(0,S.jsxs)(c,{className:`flex items-center gap-2`,children:[(0,S.jsx)(v,{className:`size-4 text-primary`}),C(`whatsNew.title`)]}),(0,S.jsx)(l,{children:C(`whatsNew.description`)})]}),(0,S.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto pr-1 text-sm`,children:[O.map(e=>(0,S.jsxs)(`section`,{children:[(0,S.jsx)(`h3`,{className:`font-semibold`,children:e.title[T]}),(0,S.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:e.id}),(0,S.jsx)(`ul`,{className:`list-disc space-y-1.5 pl-5 [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:font-mono [&_code]:text-xs`,children:e.items[T].map((e,t)=>(0,S.jsx)(`li`,{dangerouslySetInnerHTML:{__html:e}},t))})]},e.id)),M&&(0,S.jsxs)(`p`,{className:`rounded-md border border-amber-500/40 bg-amber-500/5 p-3 text-xs text-muted-foreground`,children:[C(`whatsNew.agentOutdated`,{current:A,required:k}),` `,(0,S.jsx)(`code`,{className:`rounded bg-muted px-1 font-mono`,children:`npx planche@latest`}),` · `,(0,S.jsx)(`code`,{className:`rounded bg-muted px-1 font-mono`,children:`planche upgrade`})]})]}),(0,S.jsxs)(o,{className:`sm:justify-between`,children:[(0,S.jsx)(`a`,{href:y(),target:`_blank`,rel:`noreferrer`,className:`self-center text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground`,children:C(`whatsNew.allChanges`)}),(0,S.jsx)(n,{onClick:N,children:C(`whatsNew.close`)})]})]})})}export{C as WhatsNewDialog};