1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-CtADqAVq.js";import{t as n,y as r}from"./useTranslation-By_2sPNM.js";import{t as i}from"./compiler-runtime-D29JKvbp.js";import{t as a}from"./jsx-runtime-BdxMnOeJ.js";import{t as o}from"./dataRegion-CRwTpXan.js";import{t as s}from"./classNameConstructor-B_CJRpZB.js";import{t as c}from"./Button-Dyvl9306.js";import{n as l}from"./customDeviceDetect-LDvqA_X7.js";import{N as u}from"./adminQueryRegions-DCpMKJVU.js";import{Q as d,tt as f}from"./Checkbox-DBRuJ7rY.js";import{mt as p}from"./helpers-BmgLMv3r.js";import{t as m}from"./languageRegistry-DxqC0HMf.js";import{t as h}from"./client-CNoUCLk_.js";import{C as g}from"./organizations-DtfZ8ZQM.js";import{n as _}from"./GlobalState-B9VoSuUO.js";import{n as v,t as y}from"./localeDisplay-CWZXmn8l.js";import{t as b}from"./uiFonts-CZEUMGip.js";import{t as x}from"./ListItem-Cn-owJ3w.js";var S=250,C=`id, info_page_id, page_index, title, navigation_label, slug, brief, is_hidden, page_image_prompt, image, updated_at`;async function w(e,t,n){let r=new Map;if(t.length===0)return r;let i=n?.includeContent!==!1,{data:a,error:o}=await e.from(`info_subpages`).select(i?`*`:C).in(`info_page_id`,t).order(`page_index`,{ascending:!0});if(o)throw o;for(let e of a??[]){let t=e.info_page_id,n=r.get(t)??[];n.push(e),r.set(t,n)}return r}async function T(e,t,n){let r=h();if(!await d(r,e,t))return null;let{data:i,error:a}=await r.from(`info_pages`).select(`*`).eq(`id`,n).eq(`project_id`,t).maybeSingle();if(a)throw a;if(!i)return null;let o=await w(r,[n]);return g(i,o.get(n)??[])}async function E(e,t){let n=h();if(!await d(n,e,t))return[];let{data:r,error:i}=await n.from(`info_pages`).select(`*`).eq(`project_id`,t).order(`created_at`,{ascending:!1});if(i)throw i;let a=r??[],o=await w(n,a.map(e=>e.id));return a.map(e=>g(e,o.get(e.id)??[]))}async function D(e,t){let n=h();if(!await d(n,e,t))return!1;let{data:r,error:i}=await n.from(`info_pages`).select(`id`).eq(`project_id`,t).limit(1).maybeSingle();if(i)throw i;return!!r}function O(e,t,n,r,i){let a=h(),s=`info-page:${e}:${t}:${n}`,c={region:o()},l=null,u=async()=>{try{r(await T(e,t,n))}catch(e){i?.(e instanceof Error?e:Error(String(e)))}},d=()=>{l&&clearTimeout(l),l=setTimeout(()=>{l=null,u()},S)},p=f(a,`${s}:info_pages`,{event:`*`,schema:`public`,table:`info_pages`,filter:`id=eq.${n}`},d,c),m=f(a,`${s}:info_subpages`,{event:`*`,schema:`public`,table:`info_subpages`,filter:`info_page_id=eq.${n}`},d,c);return u(),()=>{l&&clearTimeout(l),l=null,p(),m()}}async function k(e,t){let n=h(),{data:r,error:i}=await n.from(`info_pages`).select(`*`).eq(`project_id`,e);if(i)throw i;let a=r??[],o=await w(n,a.map(e=>e.id));return a.map(e=>g(e,o.get(e.id)??[]))}function A(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function j(e,...t){if(!A(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function M(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function N(e,t){j(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function P(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function F(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ee(e,t){return e<<t|e>>>32-t>>>0}var te=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,ne=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function re(e){if(j(e),te)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=ne[e[n]];return t}function I(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function L(e){return typeof e==`string`&&(e=I(e)),j(e),e}var ie=class{};function R(e){let t=t=>e().update(L(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ae(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function z(e,t,n){return e&t^~e&n}var B=class extends ie{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=F(this.buffer)}update(e){M(this),e=L(e),j(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=F(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){M(this),N(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,P(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;
1e<r;e++)t[e]=0;ae(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=F(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},V=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),H=2**32,U=Array.from({length:64},(e,t)=>Math.floor(H*Math.abs(Math.sin(t+1)))),W=V.slice(0,4),G=new Uint32Array(16),K=class extends B{constructor(){super(64,16,8,!0),this.A=W[0]|0,this.B=W[1]|0,this.C=W[2]|0,this.D=W[3]|0}get(){let{A:e,B:t,C:n,D:r}=this;return[e,t,n,r]}set(e,t,n,r){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0}process(e,t){for(let n=0;n<16;n++,t+=4)G[n]=e.getUint32(t,!0);let{A:n,B:r,C:i,D:a}=this;for(let e=0;e<64;e++){let t,o,s;e<16?(t=z(r,i,a),o=e,s=[7,12,17,22]):e<32?(t=z(a,r,i),o=(5*e+1)%16,s=[5,9,14,20]):e<48?(t=r^i^a,o=(3*e+5)%16,s=[4,11,16,23]):(t=i^(r|~a),o=7*e%16,s=[6,10,15,21]),t=t+n+U[e]+G[o],n=a,a=i,i=r,r+=ee(t,s[e%4])}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,this.set(n,r,i,a)}roundClean(){P(G)}destroy(){this.set(0,0,0,0),P(this.buffer)}},q=R(()=>new K);function oe(e){return re(q(I(e)))}var se=``,J=80;async function ce(e,t,n){if(!t.length)return[];let r=[];for(let i=0;i<t.length;i+=J){let a=t.slice(i,i+J),{data:o,error:s}=await e.from(`translation_values`).select(`string_id, text`).eq(`locale`,n).in(`string_id`,a);if(s)throw s;o?.length&&r.push(...o)}return r}async function le(e,t,n){let r=h();if(!await d(r,e,t))return{};let{data:i,error:a}=await r.from(`translation_strings`).select(`id, source_text`).eq(`project_id`,t).eq(`context`,se);
1if(a)throw a;if(!i?.length)return{};let o=await ce(r,i.map(e=>e.id),n),s=new Map(o.map(e=>[e.string_id,e.text])),c={};for(let e of i){let t=s.get(e.id);t!=null&&(c[e.source_text]=t)}return c}async function ue(e,t,n){let r=await le(e,t,n);if(!Object.keys(r).length)return null;let i={},a={};for(let[e,t]of Object.entries(r)){let n=oe(e);i[n]=t,a[n]=e}return{language:n,translations:i,originalToHashedMap:a}}async function de(e,t){let n=h();if(!await d(n,e,t))return!1;let{count:r,error:i}=await n.from(`translation_strings`).select(`id`,{count:`exact`,head:!0}).eq(`project_id`,t);if(i)throw i;return(r??0)>0}var Y=i(),X=e(t(),1),Z=e=>{let[t,n]=_().translationsState;return{fetchTranslations:async t=>{if(!e?.organizationId||!e?.projectId)return;let r=await ue(e.organizationId,e.projectId,t);if(!r)return;let{translations:i,originalToHashedMap:a}=r,o={};for(let[e,t]of Object.entries(i??{})){let n=a?.[e]||e;o[n]=t}n(o)},checkProjectHasTranslations:(0,X.useCallback)(async()=>!e?.organizationId||!e?.projectId?!1:de(e.organizationId,e.projectId),[e?.organizationId,e?.projectId])}},fe=e=>{let t=(0,X.useRef)(null),n=e||t,[r,i]=(0,X.useState)({width:0,height:0}),a=(0,X.useRef)(null);return(0,X.useEffect)(()=>{let e=n.current;return e&&(a.current=new ResizeObserver(e=>{for(let t of e)i({width:t.contentRect.width,height:t.contentRect.height})}),a.current.observe(e),i({width:e.offsetWidth,height:e.offsetHeight})),()=>{a.current&&a.current.disconnect()}},[n.current]),[n,r]},pe={ar:[`«`,`»`],cs:[`â`,`â`],de:[`â`,`â`],en:[`â`,`â`],es:[`«`,`»`],fr:[`«\xA0`,`\xA0»`],it:[`«`,`»`],nl:[`â`,`â`],pl:[`â`,`â`],ru:[`«`,`»`],tr:[`â`,`â`],uk:[`«`,`»`]},me=e=>{let t=(0,Y.c)(2),{i18n:r}=n(),i=e||r.resolvedLanguage,a;return t[0]===i?a=t[1]:(a=e=>{let[t,n]=pe[i]||[`"`,`"`];return`${t}${e}${n}`},t[0]=i,t[1]=a),a},Q=a(),he=r({slots:{base:`bg-surface-default rounded-2xl border-solid border-border-subdued border p-1.5 flex flex-col items-start justify-start w-full relative`},variants:{borderless:{true:{base:`border-none`}}}}),ge=e=>{let t=(0,Y.c)(13),{borderless:n,data:r,divider:i,classNames:a}=e,o;if(t[0]!==n||t[1]!==a?.base){let{base:e}=he({borderless:n});o=e({className:a?.base}),t[0]=n,t[1]=a?.base,t[2]=o}else o=t[2];let s;if(t[3]!==r||t[4]!==i){let e;t[6]===i?e=t[7]:(e=(e,t)=>e.props?e:(0,X.createElement)(x,{...e,divider:i===void 0||i,key:t,index:t}),t[6]=i,t[7]=e),s=r.map(e),t[3]=r,t[4]=i,t[5]=s}else s=t[5];let c;t[8]===s?c=t[9]:(c=(0,Q.jsx)(`div`,{className:`flex flex-col justify-start relative w-full`,children:s}),t[8]=s,t[9]=c);let l;return t[10]!==o||t[11]!==c?(l=(0,Q.jsx)(`div`,{className:o,children:c}),t[10]=o,t[11]=c,t[12]=l):l=t[12],l};function _e(e,t,n){return{label:t(`languages:${e}.${e}`),subLabel:t(`languages:${e}.${n}`)}}var ve=e=>{let t=(0,Y.c)(22),{app:r,project:i}=e,{i18n:a,t:o}=n(),{closeModal:s}=u(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[0]=c):c=t[0],(0,X.useEffect)(ye,c);let{fetchTranslations:l}=Z(i),[,d]=_().translationsState,f,m,h,g,b;if(t[1]!==r||t[2]!==s||t[3]!==l||t[4]!==a||t[5]!==i||t[6]!==d||t[7]!==o){let e=y(),n=r===`dashboard`?e.filterCatalogKeys(Object.keys(v).filter(be)):i?e.filterProjectKeys(Object.keys(v).filter(e=>i?.lang===e||i?.settings?.languages?.includes(e))):e.filterCatalogKeys(Object.keys(v));b=`p-5 pt-0`,f=ge,m=!0,t[13]===Symbol.for(`react.memo_cache_sentinel`)?(h={base:`p-0 -m-2 w-auto`},t[13]=h):h=t[13],g=n.map(t=>{let n=v[t].languageKey,{label:c,subLabel:u}=_e(n,o,a.resolvedLanguage||`de`);return(0,Q.jsx)(x,{onClick:async()=>{t===i?.lang&&d(null),r===`dashboard`?localStorage.setItem(`dashboardLanguage`,t):localStorage.setItem(`language`,t),await p(t),await a.changeLanguage(t),s(),i&&l(t)},id:n,tag:`div`,selected:a.resolvedLanguage===t,classNames:{base:`px-2 py-0 h-11`,textArea:`gap-0`,primaryText:`!font-normal`},primaryContent:c,secondaryContent:u,"aria-label":u,leadingIcon:e.icon(n)},t)}).filter(Boolean),t[1]=r,t[2]=s,t[3]=l,t[4]=a,t[5]=i,t[6]=d,t[7]=o,t[8]=f,t[9]=m,t[10]=h,t[11]=g,t[12]=b}else f=t[8],m=t[9],h=t[10],g=t[11],b=t[12];let S;t[14]!==f||t[15]!==m||t[16]!==h||t[17]!==g?(S=(0,Q.jsx)(f,{borderless:m,classNames:h,data:g}),t[14]=f,t[15]=m,t[16]=h,t[17]=g,t[18]=S):S=t[18];let C;return t[19]!==b||t[20]!==S?(C=(0,Q.jsx)(`div`,{className:b,children:S}),t[19]=b,t[20]=S,t[21]=C):C=t[21],C};function ye(){b()}function be(e){return e!==`ar`}function $(e){if(!e)return;let t=e.toLowerCase().trim();if(t in m)return t;let n=t.split(`-`)[0];if(n in m)return n}var xe=X.memo(e=>{let t=(0,Y.c)(31),{project:r,app:i,size:a,classNameWrapper:o,className:d,variant:f}=e,p=a===void 0?`md`:a,m=f===void 0?`outline`:f,{openModal:h}=u(),{t:g,i18n:_}=n(`languages`),v=l();r?.lang,r?.settings?.languages;let b=r?.lang,x;t[0]===r?.settings?.languages?x=t[1]:(x=r?.settings?.languages||[],t[0]=r?.settings?.languages,t[1]=x);let S;t[2]!==b||t[3]!==x?(S=[b,...x].filter(Se),t[2]=b,t[3]=x,t[4]=S):S=t[4];let C=S,w;t[5]!==C||t[6]!==r?.lang?(w=()=>
1{if(C.length===0)return;let e=typeof window<`u`?localStorage.getItem(`language`):null;return e&&C.includes(e)?e:r?.lang||C[0]},t[5]=C,t[6]=r?.lang,t[7]=w):w=t[7],r?.lang;let T;t[8]===w?T=t[9]:(T=w(),t[8]=w,t[9]=T);let E=T,D;if(t[10]!==_.resolvedLanguage||t[11]!==E){let e=$(_.resolvedLanguage)??$(E)??`de`;D=y().icon(e),t[10]=_.resolvedLanguage,t[11]=E,t[12]=D}else D=t[12];let O=D,k;t[13]===d?k=t[14]:(k=s(`rounded-full bg-white `,d),t[13]=d,t[14]=k);let A;t[15]===g?A=t[16]:(A=g(`global:adjustLanguage`),t[15]=g,t[16]=A);let j;t[17]!==i||t[18]!==v||t[19]!==h||t[20]!==r||t[21]!==g?(j=()=>h((0,Q.jsx)(ve,{project:r,app:i}),{id:`languageModal`,title:g(`global:adjustLanguage`),swipe:!!v,zIndex:9999999999}),t[17]=i,t[18]=v,t[19]=h,t[20]=r,t[21]=g,t[22]=j):j=t[22];let M;return t[23]!==o||t[24]!==O||t[25]!==p||t[26]!==A||t[27]!==j||t[28]!==k||t[29]!==m?(M=(0,Q.jsx)(c,{size:p,variant:m,className:k,leadingIcon:O,"aria-label":A,classNameWrapper:o,trailingIcon:`arrowhead-down-md`,onClick:j}),t[23]=o,t[24]=O,t[25]=p,t[26]=A,t[27]=j,t[28]=k,t[29]=m,t[30]=M):M=t[30],M});function Se(e){return!!e}export{T as a,D as c,me as i,O as l,fe as n,k as o,Z as r,E as s,xe as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.