1"use strict";(globalThis.webpackChunk_N_E=globalThis.webpackChunk_N_E||[]).push([[3604],{3604:(e,t,n)=>{n.r(t),n.d(t,{default:()=>k});var r=n(97783),i=n(95175),a=n(23796),o=n(30289),p=n(5453),l=n(9100),y=n(87448),u=n(98830),f=n(70297);function s(e,t){let n=e;for(;n;){if(n.name===t||n.type&&n.type.name===t)return!0;n=n.type}return!1}function c(e){return s(e,"reference")}function d(e){let t=e;for(;t;){if(!t.type)return t;t=t.type}}function m(e){return"fields"in e?e.type?m(e.type).concat(e.fields):e.fields:[]}let g=function(e){let t,n,o=(0,r.c)(6),{schemaType:p,theme:l}=e,{theme:u,scheme:s,tone:c}=l;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=new f.E,o[0]=t):t=o[0];let d=t,m=p.icon;return o[1]!==m||o[2]!==s||o[3]!==u||o[4]!==c?(n=m?(0,y.jsx)(f.ID,{sheet:d.instance,children:(0,y.jsx)(i.NP,{theme:u,scheme:s,tone:c,children:(0,a.isValidElement)(m)?m:(0,y.jsx)(m,{})})}):null,o[1]=m,o[2]=s,o[3]=u,o[4]=c,o[5]=n):n=o[5],n},v=e=>({_id:{type:"objectField",name:"_id",value:{type:"string"}},_type:{type:"objectField",name:"_type",value:{type:"string",value:e}},_createdAt:{type:"objectField",name:"_createdAt",value:{type:"string"}},_updatedAt:{type:"objectField",name:"_updatedAt",value:{type:"string"}},_rev:{type:"objectField",name:"_rev",value:{type:"string"}}});function h(e,t=!1){let n={_ref:{type:"objectField",name:"_ref",value:{type:"string"}},_type:{type:"objectField",name:"_type",value:{type:"string",value:"reference"}},_weak:{type:"objectField",name:"_weak",value:{type:"boolean"},optional:!0}};return t&&(n._key={type:"objectField",name:"_key",value:{type:"string"}}),{type:"object",fields:n,dereferencesTo:e}}let b=new Map([["text",{type:"string"}],["url",{type:"string"}],["datetime",{type:"string"}],["date",{type:"string"}],["boolean",{type:"boolean"}],["email",{type:"string"}]]);function j(){return{type:"objectField",name:"_key",value:{type:"string"}}}function _(e){let{path:t,type:n}=e;return[t,n]}function w(e,t){return`"${t}": ${e}[0]._type`}var k=(0,a.memo)(function(e){let t,n,f,k,F,A=(0,r.c)(12),{comlink:E,perspective:T}=e,M=(0,o.hA9)(),S=(0,i.GG)();A[0]!==E||A[1]!==S||A[2]!==M?(t=()=>{try{let e=function(e,t){let n=new Set,{schema:r,basePath:i}=e;return(function(e){let t=new Set,n=new Map;e.getTypeNames().forEach(r=>{let i=e.get(r);
1if(void 0===i||null===i.type)return;let a=new Set;(function e(n,r){if(!t.has(n)){if(t.add(n),"fields"in n)for(let t of m(n)){let i,a=d(t.type);if("document"===a.name){r.add(a);continue}n.type.type?i=t.type.type.name:"jsonType"in n.type&&(i=t.type.jsonType),("object"===i||"block"===i)&&(c(t.type)?t.type.to.forEach(e=>r.add(e.type)):r.add(t.type)),e(t.type,r)}else if("of"in n)for(let t of n.of)e(t,r)}})(i,a),n.set(i,a),t.clear()});let r=[],i=new Set,a=new Set;for(let[e]of n)!function e(t){if(a.has(t)||i.has(t))return;i.add(t);let o=n.get(t);void 0!==o&&o.forEach(t=>e(t)),i.delete(t),a.add(t),r.includes(t.name)||r.unshift(t.name)}(e);return r})(r).map(e=>{let t=r.get(e);if(void 0===t)return;let i=function(e){let t;if(e.type?t=e.type.name:"jsonType"in e&&(t=e.jsonType),"document"===t){let t=o(e);return"unknown"===t.type?null:{type:"document",name:e.name,title:"string"==typeof e.title?e.title:void 0,icon:a(e),fields:{...v(e.name),...t.fields}}}let n=p(e);return"unknown"===n.type?null:"object"===n.type?{name:e.name,type:"type",value:{type:"object",fields:{_type:{type:"objectField",name:"_type",value:{type:"string",value:e.name}},...n.fields}}}:{name:e.name,title:"string"==typeof e.title?e.title:void 0,type:"type",value:n}}(t);if(null!==i)return"type"===i.type&&n.add(t),i}).filter(e=>void 0!==e);function a(e){if(e.icon)return(0,u.F0)((0,y.jsx)(g,{schemaType:e,theme:t}))}function o(e){let t={};for(let n of m(e)){let e=p(n.type);null!==e&&(t[n.name]={type:"objectField",name:n.name,title:"string"==typeof n.type.title?n.type.title:void 0,value:e,optional:!1===function(e){let{validation:t}=e.type;if(!t)return!1;for(let e of Array.isArray(t)?t:[t]){let t=!1,n=new Proxy({},{get:(e,r)=>()=>("required"===r&&(t=!0),n)});if("function"==typeof e&&(e(n),t)||"object"==typeof e&&null!==e&&"_required"in e&&"required"===e._required)return!0}return!1}(n)})}return{type:"object",fields:t}}function p(e){if(d(e)?.name==="document")return h(e.name);if(n.has(e.type)||e.type?.type?.name==="object")return{type:"inline",name:e.type.name};if(s(e,"string")){let t=e.options?.list;return t&&Array.isArray(t)?{type:"union",of:t.map(e=>({type:"string",value:"string"==typeof e?e:e.value}))}:{type:"string"}}if(s(e,"number")){let t=e.options?.list;return t&&Array.isArray(t)?{type:"union",of:t.map(e=>({type:"number",value:"number"==typeof e?e:e.value}))}:{type:"number"}}let t=b.get(e.type?.name||"");if(t)return t;if(e.type&&b.has(e.type.name))return b.get(e.type.name);if(s(e,"crossDatasetReference"))return{type:"unknown"};if(c(e)){var r;let t=(r=e,[...new Set((function e(t){let n="to"in t?t.to:[];return"type"in t&&c(t.type)?[...e(t.type),...n]:n})(r).map(e=>e.name))]);return 1===t.length?h(t[0]):{type:"union",of:t.map(e=>({type:"unionOption",name:e,value:h(e)}))}}if(s(e,"array")){var l=e;let t=[];for(let e of l.of){let n=p(e),r={type:"unionOption",icon:a(e),name:e.name,title:"string"==typeof e.title?e.title:void 0,value:n};"inline"===n.type?n={type:"object",fields:{_key:j()},rest:n}:"object"===n.type&&(n.rest={type:"object",fields:{_key:j()}}),r.value=n,t.push(r)}if(0===t.length)return{type:"null"};if(t.length>1)return{type:"union",of:t,options:function(e,t){let{options:n}=e;if(!n)return;let r={...n};return n.insertMenu&&(r.insertMenu={...n.insertMenu,views:n.insertMenu.views?.map(e=>"grid"===e.name?{name:"grid",previewImageUrls:e.previewImageUrl?t.reduce((t,{name:n})=>{let r=e.previewImageUrl?.(n);if(!r)return t;try{new URL(r),t[n]=r}catch{t[n]=new URL(r,`${window.location.origin}${i?`${i}/`:""}`).toString()}return t},{}):void 0}:e)}),r}(l,t)};let{name:n,title:r,value:o}=t[0];return{type:"array",of:{type:"arrayItem",name:n,title:"string"==typeof r?r:void 0,value:o}}}if(s(e,"object")||"object"===e.jsonType||"fields"in e)return o(e);throw Error(`Type "${e.name}" not found`)}}(M,S);return E.post("presentation/schema",{schema:e}),E.on("visual-editing/schema",()=>({schema:e}))}catch{return}},n=[E,S,M],A[0]=E,A[1]=S,A[2]=M,A[3]=t,A[4]=n):(t=A[3],n=A[4]),(0,a.useEffect)(t,n),A[5]!==T?(f=(0,o.c7e)(T)?o.Ra0:{apiVersion:l.mG},A[5]=T,A[6]=f):f=A[6];let $=(0,o.tH7)(f);return A[7]!==$||A[8]!==E||A[9]!==T?(k=()=>E.on("visual-editing/schema-union-types",async e=>{let t=Object.entries(e.paths.reduce((e,{id:t,path:n})=>(e[t]?e[t].add(n):e[t]=new Set([n]),e),{})),n=await Promise.all(t.map(async e=>{let[t,n]=e,r=Array.from(n),i=`*[_id == $id][0]{${r.map(w).join(",")}}`,a=await $.fetch(i,{id:(0,p.IM)(t)},{tag:"presentation-schema",perspective:T});return{id:t,paths:r.map((e,t)=>({path:e,type:a[t]}))}})),r=new Map;
1return n.forEach(e=>{r.set(e.id,new Map(e.paths.map(_)))}),{types:r}}),F=[E,$,T],A[7]=$,A[8]=E,A[9]=T,A[10]=k,A[11]=F):(k=A[10],F=A[11]),(0,a.useEffect)(k,F),null})}}]);
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.