PageSourceSearch

https://storefront-production-0b10.up.railway.app/_next/static/chunks/1750.f1bbc4f1c6f02fc0.js

js storefront-production-0b10.up.railway.app collected 2026-10-03 12:15:31 UTC 24,048 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1750],{81750:(e,n,l)=>{l.r(n),l.d(n,{default:()=>D});var t=l(67957),a=l(91249),s=l(41121),r=l(89384),i=l(93657),o=l(39929),c=l(26647),u=l(74888),d=l(33319),m=l(58752),y=l(34799),h=l(63648),p=l.n(h),v=l(92883);function j(e){let{docId:n,typeName:l,onSaved:s,onClose:h}=e,j=(0,r.ny)(),x=(0,r.zi)(),k=(0,i.d)(),{bump:f}=(0,r.fP)(),[b,g]=(0,a.useState)(null),[A,N]=(0,a.useState)(()=>new Set),[z,w]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[P,F]=(0,a.useState)(!1),$=(0,a.useRef)(null),{data:T,error:R,loading:E,reload:D}=(0,c.Y)(async()=>{let e=await j.get({id:n}),l=(0,d.EN)(e);return $.current=l,g(l),e},[j,n]),O=x.getType((null==T?void 0:T.type)||l),M=(null==T?void 0:T.type)&&l&&T.type!==l?T.type:null,{role:U}=(0,r.As)(),I=(0,a.useMemo)(()=>(0,u.v)(O,U),[O,U]),K=I.find(e=>e.name===C)||(0,u.jF)(I),L=(0,a.useMemo)(()=>b&&O?x.validateDocument(O,b):{ok:!0,errors:[]},[x,O,b]),Z=(0,a.useMemo)(()=>z?L.errors:L.errors.filter(e=>A.has(e.path)),[L.errors,A,z]),Y=(0,a.useCallback)((e,n)=>{g(l=>(0,d.SO)(l,e,n)),N(n=>new Set(n).add(e))},[]),W=null!=b&&!(0,d.n4)(b,$.current),H=async()=>{if(!L.ok){var e;w(!0);let n=I.find(e=>(0,u.YF)(L.errors,e).length);n&&S(n.name),k.error("Zkontrolujte vyplněn\xe1 pole",{description:null==(e=L.errors[0])?void 0:e.message});return}F(!0);try{let e=await j.update({id:n,data:b,baseVersion:null==T?void 0:T.updatedAt});$.current=(0,d.EN)(e),g((0,d.EN)(e)),N(new Set),w(!1),f(),k.success("Uloženo jako koncept"),null==s||s(e)}catch(e){k.error("Uložen\xed selhalo",{description:null==e?void 0:e.message})}finally{F(!1)}};return E&&!b?(0,t.jsx)("div",{className:v.Ay.setLoading,children:(0,t.jsx)(y.y$,{size:20})}):R?(0,t.jsx)(y.W5,{error:R,onRetry:D}):b?O?(0,t.jsxs)("div",{className:v.Ay.setPane,children:[M?(0,t.jsxs)("p",{className:v.Ay.setProblem,children:["Anotace na str\xe1nce ř\xedk\xe1 „",l,'", uložen\xfd dokument je „',M,'". Formul\xe1ř ukazuje uložen\xfd typ.']}):null,I.length>1?(0,t.jsx)("div",{className:p().tabs,role:"tablist",children:I.map(e=>{let n=(0,u.YF)(Z,e).length,l=e.name===K.name;return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":l,className:"".concat(p().tab," ").concat(l?p().tabActive:""),onClick:()=>S(e.name),children:[e.title||e.name,n?(0,t.jsx)("span",{className:p().tabError,children:n}):null]},e.name||"_")}
1)}):null,(0,t.jsx)("div",{className:v.Ay.docForm,children:(0,t.jsx)("div",{className:p().form,children:null==K?void 0:K.fields.map(e=>(0,t.jsx)(o.A,{field:e,value:b[e.name],path:e.name,errors:Z,doc:b,onChange:n=>Y(e.name,n)},e.name))})}),(0,t.jsxs)("div",{className:v.Ay.setFoot,children:[(0,t.jsx)("span",{className:v.Ay.setCount,children:"Ukl\xe1d\xe1 se jako koncept — na web to nepust\xed."}),(0,t.jsx)("span",{className:v.Ay.grow}),(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:h,children:"Zavř\xedt"}),(0,t.jsx)(m.$n,{variant:"primary",size:"sm",disabled:!W,loading:P,onClick:H,children:"Uložit"})]})]}):(0,t.jsxs)("p",{className:v.Ay.mediaError,children:["Typ „",l||(null==T?void 0:T.type),'" nen\xed v tomto sezen\xed zn\xe1m.']}):null}var x=l(22989),k=l(94257),f=l(82181),b=l(9235);function g(e){let{onPick:n,selectedId:l,accept:a="image/*"}=e;return(0,t.jsx)(b.A,{mode:"pick",onPick:n,selectedId:l,accept:a})}function A(e){let{docId:n,field:l,onPick:s,onAlt:i,onRemove:o,onClose:u}=e,d=(0,r.ny)(),[h,p]=(0,a.useState)(null),[j,b]=(0,a.useState)(!1),[A,N]=(0,a.useState)(null),[z,w]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),P=async e=>{S(null);try{let n=await (0,x.O_)(d,e);if(!n)throw Error("Tenhle soubor nen\xed v knihovně m\xe9di\xed, takže ho nejde oř\xedznout.");N(await d.media.get(n.id))}catch(e){S(e)}},F=async e=>{w(!0),S(null);try{let n=await d.media.crop(A.id,e);N(null),s(n)}catch(e){S(e)}finally{w(!1)}},{data:$,error:T,loading:R,reload:E}=(0,c.Y)(async()=>{let e=await d.get({id:n}),t=(0,k.fK)((0,k.mb)(e),l);return p("string"==typeof(null==t?void 0:t.alt)?t.alt:""),t&&"object"==typeof t?t:null},[d,n,l]);if(R&&null==h)return(0,t.jsx)("div",{className:v.Ay.setLoading,children:(0,t.jsx)(y.y$,{size:20})});if(T)return(0,t.jsx)(y.W5,{error:T,onRetry:E});let D=!!$&&h!==($.alt||"");return A?(0,t.jsxs)(t.Fragment,{children:[C?(0,t.jsx)(y.W5,{error:C,onRetry:()=>S(null)}):null,(0,t.jsx)(f.A,{asset:A,busy:z,onCancel:()=>N(null),onApply:F,onReset:()=>F(null)})]}):(0,t.jsxs)("div",{className:v.Ay.setPane,children:[(0,t.jsxs)("div",{className:v.Ay.imageHead,children:[(0,t.jsx)("figure",{className:v.Ay.imageNow,children:(null==$?void 0:$.url)?(0,t.jsx)("img",{src:$.url,alt:$.alt||""}):(0,t.jsx)("span",{className:v.Ay.imageNone,children:"Pole je pr\xe1zdn\xe9"})}),(0,t.jsxs)("div",{className:v.Ay.imageMeta,children:[(0,t.jsx)("p",{className:v.Ay.imageName,children:(null==$?void 0:$.filename)||(null==$?void 0:$.url)||"Zat\xedm ž\xe1dn\xfd obr\xe1zek"}),(null==$?void 0:$.width)&&(null==$?void 0:$.height)?(0,t.jsxs)("p",{className:v.Ay.setCount,children:[$.width," \xd7 ",$.height," px"]}):null,(0,t.jsx)("label",{className:v.Ay.imageLabel,htmlFor:"cms-image-alt",children:"Popis pro čtečky a vyhled\xe1vače"}),(0,t.jsx)("input",{id:"cms-image-alt",className:v.Ay.input,value:null!=h?h:"",disabled:!$,placeholder:"Co je na obr\xe1zku vidět?",onChange:e=>p(e.target.value),onKeyDown:e=>{"Enter"===e.key&&D&&i(h)}}),(0,t.jsxs)("div",{className:v.Ay.imageActions,children:[(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",disabled:!D,onClick:()=>i(h),children:"Uložit popis"}),(0,x.sI)($)?(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:()=>P($),children:$.crop?"Upravit ořez":"Oř\xedznout"}):null,(0,t.jsx)("span",{className:v.Ay.grow}),j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:v.Ay.setCount,children:"Opravdu odebrat?"}),(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:()=>b(!1),children:"Ne"}),(0,t.jsx)(m.$n,{variant:"danger",size:"sm",onClick:o,children:"Odebrat"})]}):(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",disabled:!$,onClick:()=>b(!0),children:"Odebrat obr\xe1zek"})]})]})]}),(0,t.jsx)("p",{className:v.Ay.setHint,children:"Vyberte obr\xe1zek z knihovny, nebo nahrajte nov\xfd — použije se hned."}),(0,t.jsx)("div",{className:v.Ay.setLibrary,children:(0,t.jsx)(g,{onPick:s,selectedId:null==$?void 0:$.id})}),(0,t.jsxs)("div",{className:v.Ay.setFoot,children:[(0,t.jsx)("span",{className:v.Ay.setCount,children:"Ukl\xe1d\xe1 se jako koncept — na web to nepust\xed."}),(0,t.jsx)("span",{className:v.Ay.grow}),(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:u,children:"Zavř\xedt"})]})]})}var N=l(9233);function z(e){let{docId:n,field:l,hrefField:s,href:i,onCommit:o,onClose:u}=e,d=(0,r.ny)(),[h,p]=(0,a.useState)(null),[j,x]=(0,a.useState)(null),{data:f,error:b,loading:g,reload:A}=(0,c.Y)(async()=>{var e,t;let a=await d.get({id:n}),r=(0,k.mb)(a),o={text:l?(0,k.fK)(r,l):null,href:s?null!=(t=null!=(e=(0,k.fK)(r,s))?e:i)?t:"":null};return p("string"==typeof o.text?o.text:""),x("string"==typeof o.href?o.href:""),o},[d,n,l,s,i]);if(g&&null==h&&null==j)return(0,t.jsx)("div",{className:v.Ay.setLoa
1ding,children:(0,t.jsx)(y.y$,{size:20})});if(b)return(0,t.jsx)(y.W5,{error:b,onRetry:A});let z="string"==typeof(null==f?void 0:f.text)?f.text:"",w="string"==typeof(null==f?void 0:f.href)?f.href:"",C=s?(0,N.Cl)(j):null,S=!!l&&h!==z,P=!!s&&(j||"").trim()!==w,F=P&&C&&!C.ok?C.reason:"",$=S||P,T=()=>{$&&!F&&o({text:S?h:null,href:P?C.value:null})};return(0,t.jsxs)("div",{className:v.Ay.setPane,children:[(0,t.jsxs)("div",{className:v.Ay.linkForm,children:[l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{className:v.Ay.imageLabel,htmlFor:"cms-link-text",children:"Text odkazu"}),(0,t.jsx)("input",{id:"cms-link-text",className:v.Ay.input,value:null!=h?h:"",autoFocus:!0,onChange:e=>p(e.target.value),onKeyDown:e=>"Enter"===e.key&&T()})]}):null,s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{className:v.Ay.imageLabel,htmlFor:"cms-link-href",children:"C\xedl odkazu"}),(0,t.jsx)("input",{id:"cms-link-href",className:v.Ay.input,value:null!=j?j:"",autoFocus:!l,placeholder:"/stranka, https://…, mailto:, tel:","aria-invalid":F?"true":void 0,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&T()}),(0,t.jsx)("p",{className:F?v.Ay.linkRefusal:v.Ay.setCount,children:F||"Přij\xedm\xe1me /cestu na webu, https://…, mailto: nebo tel:"})]}):(0,t.jsx)("p",{className:v.Ay.setCount,children:"Tento odkaz vede na str\xe1nku tohoto webu — měn\xed se jen jeho text, c\xedl patř\xed k navigaci webu."})]}),(0,t.jsxs)("div",{className:v.Ay.setFoot,children:[(0,t.jsx)("span",{className:v.Ay.setCount,children:"Ukl\xe1d\xe1 se jako koncept — na web to nepust\xed."}),(0,t.jsx)("span",{className:v.Ay.grow}),(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:u,children:"Zrušit"}),(0,t.jsx)(m.$n,{variant:"primary",size:"sm",disabled:!$||!!F,onClick:T,children:"Uložit"})]})]})}function w(e){let{docId:n,field:l,onCommit:s,onClose:i}=e,u=(0,r.ny)(),h=(0,r.zi)(),[p,j]=(0,a.useState)(null),x=(0,a.useRef)(null),{data:k,error:f,loading:b,reload:g}=(0,c.Y)(async()=>{let e=await u.get({id:n}),l=(0,d.EN)(e);return x.current=l,j(l),{doc:e,type:h.getType(null==e?void 0:e.type)}},[u,h,n]),A=null==k?void 0:k.type,N=(0,a.useMemo)(()=>(function(e,n){if(!e)return{problem:"Typ dokumentu nen\xed v tomto sezen\xed zn\xe1m."};let l=String(n).split("."),t=null,a=null;for(let s of l){if(null===t)a=(null==(t=(e.fields||[]).find(e=>e.name===s)||null)?void 0:t.type)==="array"?"array":null;else if("array"===t.type){if(!/^(0|[1-9][0-9]*)$/.test(s))return{problem:"Seznam „".concat(t.title||t.name,'" se adresuje č\xedslem položky, ne „').concat(s,'".')};let e=t.members||[];if(1!==e.length)return{problem:"Seznam „".concat(t.title||t.name,'" m\xe1 v\xedc typů položek — takhle se upravit ned\xe1.')};t=e[0],a="entry"}else"object"===t.type?a=(null==(t=(t.fields||[]).find(e=>e.name===s)||null)?void 0:t.type)==="array"?"array":null:t=null;if(!t)return{problem:"Typ „".concat(e.title||e.name,'" nem\xe1 pole „').concat(n,'".')}}return a?{field:t,shape:a,problem:null}:{problem:"Pole „".concat(t.title||t.name,'" nen\xed seznam ani jeho položka.')}})(A,l),[A,l]),z=(0,a.useMemo)(()=>p&&A?h.validateDocument(A,p):{ok:!0,errors:[]},[h,A,p]),w=(0,a.useMemo)(()=>z.errors.filter(e=>e.path===l||String(e.path).startsWith("".concat(l,"."))),[z.errors,l]);if(b&&!p)return(0,t.jsx)("div",{className:v.Ay.setLoading,children:(0,t.jsx)(y.y$,{size:20})});if(f)return(0,t.jsx)(y.W5,{error:f,onRetry:g});if(!p)return null;if(N.problem)return(0,t.jsx)("p",{className:v.Ay.setProblem,children:N.problem});let S=(0,d.Yn)(p,l),P=(0,d.Yn)(x.current,l),F=!(0,d.n4)(S,P),$="array"===N.shape,T=Array.isArray(S)?S.length:0;return(0,t.jsxs)("div",{className:v.Ay.setPane,children:[(0,t.jsx)("div",{className:v.Ay.docForm,children:(0,t.jsx)("div",{className:v.Ay.listForm,children:(0,t.jsx)(o.A,{field:N.field,value:S,path:l,bare:!$,errors:w,doc:p,parent:$?p:(0,d.Yn)(p,l.slice(0,l.lastIndexOf("."))),onChange:e=>j(n=>(0,d.SO)(n,l,e))})})}),(0,t.jsxs)("div",{className:v.Ay.setFoot,children:[(0,t.jsxs)("span",{className:v.Ay.setCount,children:[$?"".concat(T," ").concat(C(T)," \xb7 "):"".concat(Number(l.slice(l.lastIndexOf(".")+1))+1,". položka \xb7 "),"Ukl\xe1d\xe1 se jako koncept — na web to nepust\xed."]}),(0,t.jsx)("span",{className:v.Ay.grow}),(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:i,children:"Zrušit"}),(0,t.jsx)(m.$n,{variant:"primary",size:"sm",disabled:!F||w.length>0,onClick:()=>s(S),children:"Uložit"})]})]})}let C=e=>1===e?"položka":e<5?"položky":"položek";var S=l(85140),P=l(73934);function F(e){let{docId:n,onModerated:l}=e,s=(0,r.ny)(),o=(0,i.d)(),{bump:u}=(0,r.fP)(),[h,p]=(0,a.useState)(null),{data:j,error:x,loading:k,reload:f,setData:b}=(0,c.Y)(()=>s.get({id:n}),[s,n]);
1if(k&&!j)return(0,t.jsx)("div",{className:v.Ay.setLoading,children:(0,t.jsx)(y.y$,{size:20})});if(x)return(0,t.jsx)(y.W5,{error:x,onRetry:f});if(!j)return null;let g=(0,d.EN)(j),A="published"===j.status,N=(0,d.F$)(j),z=async(e,t,a)=>{p(e);try{let r=await s[e]({id:n});b(r),u();let i=(0,P.Zg)(null==r?void 0:r.revalidation);i.ok?o.success(t,{description:"".concat(a," ").concat(i.description).trim()}):o.error(t,{description:"".concat(a," ").concat(i.description).trim(),duration:12e3}),null==l||l(e)}catch(e){o.error("Akce se nepovedla",{description:null==e?void 0:e.message})}finally{p(null)}};return(0,t.jsxs)("div",{className:v.Ay.setPane,children:[(0,t.jsxs)("div",{className:v.Ay.modRead,children:[(0,t.jsxs)("p",{className:v.Ay.modWho,children:[g.customerName||"Bez jm\xe9na",g.consultantName?(0,t.jsxs)("span",{className:v.Ay.setCount,children:[" \xb7 o poradci ",g.consultantName]}):null,(0,t.jsxs)("span",{className:v.Ay.setCount,children:[" \xb7 ",(0,S.om)(g.submittedAt||j.createdAt)]})]}),(0,t.jsx)("blockquote",{className:v.Ay.modQuote,children:g.message||"Recenze nem\xe1 text."})]}),(0,t.jsx)("p",{className:v.Ay.modState,children:N?"V archivu — na webu nen\xed a v seznamech se neukazuje.":A?"Pr\xe1vě je vidět na webu.":"Na webu nen\xed — ček\xe1 ve frontě schvalov\xe1n\xed."}),(0,t.jsxs)("div",{className:v.Ay.modActions,children:[(0,t.jsx)(m.$n,{variant:"secondary",size:"sm",icon:"eyeOff",disabled:!A||!!h,loading:"unpublish"===h,onClick:()=>z("unpublish","Skryto z webu","Recenze zůst\xe1v\xe1 ve frontě schvalov\xe1n\xed."),children:"Skr\xfdt z webu"}),(0,t.jsx)(m.$n,{variant:"secondary",size:"sm",icon:"archive",disabled:N||!!h,loading:"archive"===h,onClick:()=>z("archive","Přesunuto do archivu","Vr\xe1tit ji jde v administraci v z\xe1ložce Archiv."),children:"Do archivu"})]}),(0,t.jsx)("p",{className:v.Ay.setCount+" "+v.Ay.modFoot,children:N?"Zp\xe1tky ji vr\xe1t\xedte v administraci: Recenze → Archiv.":"Oboj\xed se d\xe1 vz\xedt zpět v administraci. Text recenze se tu upravovat ned\xe1 — jsou to slova z\xe1kazn\xedka."})]})}function $(e){var n;let{docId:l,field:s,onCommit:i,onClose:o}=e,u=(0,r.ny)(),d=(0,r.zi)(),[h,p]=(0,a.useState)(null),[j,x]=(0,a.useState)(null),[f,b]=(0,a.useState)(null),[A,N]=(0,a.useState)(""),z=(0,a.useRef)([]),w=(0,a.useRef)(null),{data:C,error:S,loading:P,reload:F}=(0,c.Y)(async()=>{let e=await u.get({id:l}),n=(0,k.mb)(e),t=function(e,n){if(!e)return{problem:"Typ dokumentu nen\xed v tomto sezen\xed zn\xe1m."};let l=null;for(let t of String(n).split("."))if(!(l=null===l?(e.fields||[]).find(e=>e.name===t)||null:"object"===l.type?(l.fields||[]).find(e=>e.name===t)||null:"array"===l.type&&(l.members||[])[0]||null))return{problem:"Typ „".concat(e.title||e.name,'" nem\xe1 pole „').concat(n,'".')};if("array"!==l.type)return{field:l,problem:"Pole „".concat(l.title||l.name,'" nen\xed seznam — sada se do něj neulož\xed.')};let t=(l.members||[])[0];return t&&"image"===t.type?{field:l,ui:l.ui,problem:null}:{field:l,ui:l.ui,problem:"Seznam „".concat(l.title||l.name,'" neobsahuje obr\xe1zky.')}}(d.getType(null==e?void 0:e.type),s);return p((0,k.DD)((0,k.fK)(n,s))),{doc:e,descriptor:t}},[u,d,l,s]);if((0,a.useEffect)(()=>{var e;null!=w.current&&(null==(e=z.current[w.current])||e.focus(),w.current=null)}),P&&null==h)return(0,t.jsx)("div",{className:v.Ay.setLoading,children:(0,t.jsx)(y.y$,{size:20})});if(S)return(0,t.jsx)(y.W5,{error:S,onRetry:F});if(null==h)return null;let $=null==C?void 0:C.descriptor,T=!!(null==$||null==(n=$.ui)?void 0:n.sortable),R=f?(0,k.tw)(h,f.from,f.to):h,E=!(0,k.XV)(R,(0,k.DD)((0,k.fK)((0,k.mb)(null==C?void 0:C.doc),s))),D=e=>N("Přesunuto na ".concat(e+1,". m\xedsto z ").concat(R.length,".")),O=e=>{var n,l,t;let a,s;if(!f||e.pointerId!==f.pointerId)return;let r=(n=z.current,l=e.clientX,t=e.clientY,a=-1,s=1/0,n.forEach((e,n)=>{if(!(null==e?void 0:e.isConnected))return;let r=e.getBoundingClientRect(),i=l-(r.left+r.width/2),o=t-(r.top+r.height/2),c=i*i+o*o;c<s&&(s=c,a=n)}),a);r<0||r===f.to||b(e=>e?{...e,to:r}:e)},M=e=>{if(!f||e.pointerId!==f.pointerId)return;let{from:n,to:l}=f;b(null),n!==l&&(p(e=>(0,k.tw)(e,n,l)),x(null),D(l))};return(0,t.jsxs)("div",{className:v.Ay.setPane,children:[(null==$?void 0:$.problem)?(0,t.jsx)("p",{className:v.Ay.setProblem,children:$.problem}):null,0===R.length?(0,t.jsx)("p",{className:v.Ay.setEmpty,children:"Zat\xedm tu nic nen\xed. Vyberte obr\xe1zek z knihovny n\xedže."}):(0,t.jsx)("ol",{className:v.Ay.setStrip,children:R.map((e,n)=>(0,t.jsxs)("li",{ref:e=>{z.current[n]=e},className:[v.Ay.setTile,j===n?v.Ay.setTileTarget:"",T?v.Ay.setTileDraggable:"",f&&f.to===n?v.Ay.setTileHeld:""].filter(
1Boolean).join(" "),tabIndex:T?0:-1,"aria-label":"".concat(n+1,". obr\xe1zek z ").concat(R.length),onPointerDown:e=>{var l,t;!(!T||0!==e.button||e.target.closest("button"))&&(null==(l=(t=e.currentTarget).setPointerCapture)||l.call(t,e.pointerId),b({from:n,to:n,pointerId:e.pointerId}))},onPointerMove:O,onPointerUp:M,onPointerCancel:()=>b(null),onKeyDown:e=>{if(!T||e.metaKey||e.ctrlKey||e.altKey)return;let l=R.length-1,t="ArrowLeft"===e.key||"ArrowUp"===e.key?n-1:"ArrowRight"===e.key||"ArrowDown"===e.key?n+1:"Home"===e.key?0:"End"===e.key?l:null;null!=t&&(e.preventDefault(),e.stopPropagation(),!T||t<0||t>=h.length||t===n||(p(e=>(0,k.tw)(e,n,t)),x(null),w.current=t,D(t)))},children:[(0,t.jsx)("img",{src:null==e?void 0:e.url,alt:(null==e?void 0:e.alt)||"",draggable:!1}),(0,t.jsx)("span",{className:v.Ay.setCaption,children:n+1}),(0,t.jsxs)("div",{className:v.Ay.setTileBar,children:[(0,t.jsx)("button",{type:"button",className:v.Ay.setMini,title:"Nahradit — pak vyberte z knihovny",onClick:()=>x(e=>e===n?null:n),children:"Nahradit"}),(0,t.jsx)("button",{type:"button",className:"".concat(v.Ay.setMini," ").concat(v.Ay.setMiniDanger),title:"Odebrat ze sady",onClick:()=>{p(e=>(0,k.aH)(e,n)),x(null)},children:"Odebrat"})]})]},"".concat((null==e?void 0:e.id)||(null==e?void 0:e.url)||"item","-").concat(n)))}),(0,t.jsxs)("p",{className:v.Ay.setHint,children:[null==j?"Kliknut\xedm na obr\xe1zek v knihovně ho přid\xe1te na konec sady.":"Vyberte n\xe1hradu za ".concat(j+1,'. obr\xe1zek. Zruš\xedte dalš\xedm kliknut\xedm na „Nahradit".'),T?" Pořad\xed změn\xedte přetažen\xedm, nebo šipkami po v\xfdběru obr\xe1zku tabul\xe1torem.":""]}),(0,t.jsx)("p",{className:v.Ay.setSaid,role:"status","aria-live":"polite",children:A}),(0,t.jsx)("div",{className:v.Ay.setLibrary,children:(0,t.jsx)(g,{onPick:e=>{p(n=>null==j?(0,k.hk)(n,e):(0,k.sP)(n,j,e)),x(null)}})}),(0,t.jsxs)("div",{className:v.Ay.setFoot,children:[(0,t.jsxs)("span",{className:v.Ay.setCount,children:[R.length," ",1===R.length?"obr\xe1zek":R.length<5?"obr\xe1zky":"obr\xe1zků"]}),(0,t.jsx)("span",{className:v.Ay.grow}),(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:o,children:"Zrušit"}),(0,t.jsx)(m.$n,{variant:"primary",size:"sm",disabled:!E,onClick:()=>i(R),children:"Uložit"})]})]})}var T=l(12066);function R(e){let{surface:n,lang:l=null,onClose:i,onSaved:u}=e,h=(0,r.ny)(),p=(0,r.zi)(),{bump:j}=(0,r.fP)(),[x,k]=(0,a.useState)(null),[f,b]=(0,a.useState)(!1),[g,A]=(0,a.useState)(null),N=(0,a.useRef)(null),z=(null==n?void 0:n.copy)||"",{data:w,error:C,loading:S,reload:P}=(0,c.Y)(async()=>{let e=await E(h,z);if(!e)return{doc:null,type:null};let n=(0,d.EN)(e);return N.current=n,k(n),{doc:e,type:p.getType(e.type)}},[h,p,z]),F=(null==w?void 0:w.doc)||null,$=(null==w?void 0:w.type)||null,R=(0,a.useMemo)(()=>(0,T.c)({port:h,typeFor:e=>{var n,l;return null!=(l=null==(n=p.findType)?void 0:n.call(p,e))?l:null}}),[h,p]),D=(0,a.useMemo)(()=>x&&$?p.validateDocument($,x):{ok:!0,errors:[]},[p,$,x]),O=(0,a.useMemo)(()=>l&&$?($.fields||[]).filter(e=>!(0,s.isTranslatable)(e)):[],[l,$]),M=(0,a.useMemo)(()=>new Set(O.map(e=>e.name)),[O]),U=(0,a.useCallback)((e,n)=>{k(l=>(0,d.SO)(l,e,n))},[]),I=(0,a.useMemo)(()=>x&&$?($.fields||[]).map(e=>e.name).filter(e=>{var n;return!M.has(e)&&!(0,d.n4)(x[e],null==(n=N.current)?void 0:n[e])}):[],[x,$,M]),K=(0,a.useCallback)(async()=>{if(!F||!I.length)return;b(!0),A(null);let e=[],n={...N.current};for(let a of I){var t;let s=await R.save({docId:F.id,field:a,value:x[a],lang:l});"saved"===s.status?n[a]=x[a]:e.push("".concat(a,": ").concat((null==(t=s.error)?void 0:t.message)||"z\xe1pis se nezdařil"))}if(N.current=n,j(),b(!1),e.length)return void A(e.join(" \xb7 "));null==u||u(I.length)},[x,j,I,F,l,u,R]);return S&&!x?(0,t.jsx)("div",{className:v.Ay.setLoading,children:(0,t.jsx)(y.y$,{size:20})}):C?(0,t.jsx)(y.W5,{error:C,onRetry:P}):F?$?x?(0,t.jsxs)("div",{className:v.Ay.setPane,children:[O.length?(0,t.jsxs)("p",{className:v.Ay.setNote,children:["Překl\xe1d\xe1te do jazyka ",(0,t.jsx)("strong",{children:l}),"."," ",O.map(e=>e.title||e.name).join(", ")," ",1===O.length?"se nepřekl\xe1d\xe1 a je zamčen\xe9":"se nepřekl\xe1daj\xed a jsou zamčen\xe9"," — maj\xed jednu hodnotu pro všechny jazyky. Upravit je jde ve v\xfdchoz\xedm jazyce."]}):null,g?(0,t.jsx)("p",{className:v.Ay.setProblem,children:g}):null,(0,t.jsx)("div",{className:v.Ay.docForm,children:(0,t.jsx)("div",{className:v.Ay.listForm,children:($.fields||[]).map(e=>(0,t.jsx)(o.A,{field:e,value:x[e.name],path:e.name,errors:D.errors,doc:x,readOnly:M.has(e.name),onChange:n=>U(e.name,n)},e.name))})}),(0,t.jsxs)("div",{className:v.Ay.setFoot,children:[(0,t.jsxs)("span",{className:v.Ay.setCount,children:[I.length?"Změněno: ".concat(I.length," ").concat(1===I.length?"pole":"pol\xed"," \xb7 "):"","Ukl\xe1d\xe1 se jako koncept — na web to nepust\xed."]}),(0,t.jsx)("span",{className:v.Ay.grow}),(0,t.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:i,children:"Zavř\xedt"}),(0,t.jsx)(m.$n,{variant:"primary",size:"sm",loading:f,disabled:!I.length||!D.ok,onClick:K,children:"Uložit"})]})]}):null:(0,t.jsxs)("p",{className:v.Ay.setProblem,children:["Typ „",F.type,'" nen\xed v tomto sezen\xed z
1n\xe1m.']}):(0,t.jsxs)("p",{className:v.Ay.setProblem,children:["Povrch „",(null==n?void 0:n.title)||(null==n?void 0:n.name),'" ukazuje na blok „',z,'", kter\xfd v obsahu nen\xed. Buď se přejmenoval, nebo ještě nevznikl — „copy" u defineSurface mus\xed sedět na „key" dokumentu.']})}async function E(e,n){if(!n)return null;let l=await e.list({search:n,perPage:50});return((null==l?void 0:l.rows)||[]).find(e=>{var l;return(null==(l=(0,d.EN)(e))?void 0:l.key)===n})||null}function D(e){var n,i,o;let{kind:c,actions:u,docId:d,field:m,hrefField:y,href:h,typeName:p,surface:x,lang:k,onClose:f,onPick:b,onAlt:g,onRemove:N,onCommitSet:C,onCommitList:S,onCommitLink:P,onDocSaved:T,onModerated:E}=e,[D,O]=(0,a.useState)(null),[M,U]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!0;return l.e(7691).then(l.bind(l,57691)).then(e=>e.createHttpDataPort()).then(n=>e&&O(n),n=>e&&U(n)),()=>{e=!1}},[]);let I=(0,a.useMemo)(()=>({title:"Knihovna"}),[]),K="surface"===c?R:"document"===c&&"moderate"===u?F:"document"===c?j:"imageSet"===c?$:"list"===c?w:"link"===c?z:A,L=(o=null==(i=s.findType)||null==(n=i.call(s,p))?void 0:n.title,"surface"===c?(null==x?void 0:x.title)||(null==x?void 0:x.name)||"Povrch":"document"===c&&"moderate"===u?"Recenze z\xe1kazn\xedka":"document"===c?o||"Upravit z\xe1znam":"imageSet"===c?"Sada obr\xe1zků":"list"===c?/\.\d+$/.test(String(m||""))?"Položka seznamu":"Seznam položek":"link"===c?"Odkaz":"Obr\xe1zek");return(0,t.jsx)("div",{className:v.Ay.mediaScrim,onMouseDown:e=>e.target===e.currentTarget&&f(),children:(0,t.jsxs)("div",{className:v.Ay.mediaSurface,role:"dialog","aria-modal":"true","aria-label":L,children:[(0,t.jsxs)("header",{className:v.Ay.mediaHead,children:[(0,t.jsx)("h2",{className:v.Ay.mediaTitle,children:L}),(0,t.jsx)("button",{type:"button",className:v.Ay.mediaClose,onClick:f,"aria-label":"Zavř\xedt",children:"✕"})]}),(0,t.jsx)("div",{className:v.Ay.mediaBody,children:M?(0,t.jsxs)("p",{className:v.Ay.mediaError,children:["Panel se nepodařilo nač\xedst: ",String((null==M?void 0:M.message)||M)]}):D?(0,t.jsx)(r.wO,{core:s,port:D,config:I,children:(0,t.jsx)(r.OJ,{children:(0,t.jsx)(K,{docId:d,field:m,hrefField:y,href:h,typeName:p,surface:x,lang:k,onClose:f,onPick:b,onAlt:g,onRemove:N,onSaved:T,onModerated:E,onCommit:"imageSet"===c?C:"list"===c?null!=S?S:C:P})})}):(0,t.jsx)("p",{className:v.Ay.mediaLoading,children:"Nač\xedt\xe1m…"})})]})})}}}]);

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.