sanity-plugin-taxonomy-manager 4.0.2 → 4.0.3

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.
@@ -1,5 +1,5 @@
1
- import{useFormValue as e,set as n,useDocumentStore as t,useClient as i,isPublishedId as o,useColorSchemeValue as r,usePerspective as c,isDraftId as a,isVersionId as s,unset as d,defineField as l,defineType as p,defineArrayMember as h,definePlugin as m}from"sanity";import{usePaneRouter as u,structureTool as f}from"sanity/structure";import{useCallback as g,useState as y,useRef as b,useEffect as C,useMemo as v,createContext as w,useContext as I}from"react";import{hues as _}from"@sanity/color";import k,{styled as x,css as V}from"styled-components";import{jsxs as N,jsx as T,Fragment as z}from"react/jsx-runtime";import{isVersionId as S,getVersionNameFromId as $,getVersionId as H,DocumentId as P,getDraftId as L,getPublishedId as E}from"@sanity/id-utils";import{Stack as O,Text as M,useToast as R,Inline as A,Button as D,Card as Z,Dialog as F,Box as U,Label as K,Tooltip as B,TextInput as q,TextArea as j,Flex as G,Spinner as W,Container as J,Grid as Q}from"@sanity/ui";import{InfoOutlineIcon as Y,ToggleArrowRightIcon as X,SquareIcon as ee,AddCircleIcon as ne,TrashIcon as te,ErrorOutlineIcon as ie,AddIcon as oe,WarningOutlineIcon as re,EditIcon as ce}from"@sanity/icons";import{nanoid as ae}from"nanoid";import se from"react-fast-compare";import{distinctUntilChanged as de,catchError as le}from"rxjs/operators";import{RouterContext as pe}from"sanity/router";import{AiOutlineTags as he,AiOutlineTag as me}from"react-icons/ai";const ue=e=>{const{onChange:t}=e,i=R(),o=g(()=>{t(n(ae(6))),i.push({status:"success",title:"Identifier created.",closable:!0})},[t,i]);/* @__PURE__ */
2
- return T(O,{space:2,children:/* @__PURE__ */T(A,{space:[3,3,4],children:/* @__PURE__ */T(D,{tone:"primary",fontSize:2,onClick:o,text:"Generate Identifier"})})})};var fe=Object.defineProperty,ge=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,Ce=(e,n,t)=>n in e?fe(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ve=(e,n)=>{for(var t in n||(n={}))ye.call(n,t)&&Ce(e,t,n[t]);if(ge)for(var t of ge(n))be.call(n,t)&&Ce(e,t,n[t]);return e};x((e={})=>/* @__PURE__ */T(Z,ve({as:"table"},e)))(()=>V`
1
+ import{useFormValue as e,set as n,useDocumentStore as t,useClient as i,isPublishedId as r,useColorSchemeValue as o,usePerspective as c,isDraftId as a,isVersionId as s,unset as d,defineField as l,defineType as p,defineArrayMember as h,definePlugin as m}from"sanity";import{usePaneRouter as u,structureTool as f}from"sanity/structure";import{useCallback as g,useState as y,useRef as b,useEffect as C,useMemo as v,createContext as w,useContext as I}from"react";import{hues as _}from"@sanity/color";import k,{styled as x,css as V}from"styled-components";import{jsxs as N,jsx as T,Fragment as z}from"react/jsx-runtime";import{isVersionId as S,getVersionNameFromId as $,getVersionId as H,DocumentId as P,getDraftId as L,getPublishedId as E}from"@sanity/id-utils";import{Stack as O,Text as M,useToast as R,Inline as A,Button as D,Card as Z,Dialog as F,Box as U,Label as K,Tooltip as B,TextInput as q,TextArea as j,Flex as G,Spinner as W,Container as J,Grid as Q}from"@sanity/ui";import{InfoOutlineIcon as Y,ToggleArrowRightIcon as X,SquareIcon as ee,AddCircleIcon as ne,TrashIcon as te,ErrorOutlineIcon as ie,AddIcon as re,WarningOutlineIcon as oe,EditIcon as ce}from"@sanity/icons";import{nanoid as ae}from"nanoid";import se from"react-fast-compare";import{distinctUntilChanged as de,catchError as le}from"rxjs/operators";import{RouterContext as pe}from"sanity/router";import{AiOutlineTags as he,AiOutlineTag as me}from"react-icons/ai";const ue=e=>{const{onChange:t}=e,i=R(),r=g(()=>{t(n(ae(6))),i.push({status:"success",title:"Identifier created.",closable:!0})},[t,i]);/* @__PURE__ */
2
+ return T(O,{space:2,children:/* @__PURE__ */T(A,{space:[3,3,4],children:/* @__PURE__ */T(D,{tone:"primary",fontSize:2,onClick:r,text:"Generate Identifier"})})})};var fe=Object.defineProperty,ge=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,Ce=(e,n,t)=>n in e?fe(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ve=(e,n)=>{for(var t in n||(n={}))ye.call(n,t)&&Ce(e,t,n[t]);if(ge)for(var t of ge(n))be.call(n,t)&&Ce(e,t,n[t]);return e};x((e={})=>/* @__PURE__ */T(Z,ve({as:"table"},e)))(()=>V`
3
3
  display: table;
4
4
  width: 100%;
5
5
  border-collapse: collapse;
@@ -20,7 +20,7 @@ return T(O,{space:2,children:/* @__PURE__ */T(A,{space:[3,3,4],children:/* @__PU
20
20
  &:not([hidden]) {
21
21
  display: table-cell;
22
22
  }
23
- `);const we={},Ie={apiVersion:"v2023-05-01"};function _e(e){const n=v(()=>JSON.stringify(e||{}),[e]);return v(()=>JSON.parse(n),[n])}function ke(e,{params:n=we,options:i=Ie,initialValue:o=null}){const[r,c]=y(!0),[a,s]=y(!1),[d,l]=y(o),p=_e(n),h=_e(i),m=b(null),u=t();return C(()=>{if(e&&!a&&!m.current)try{m.current=u.listenQuery(e,p,h).pipe(de(se),le(e=>(console.error(e),s(e),c(!1),l(null),e))).subscribe(e=>{l(n=>se(n,e)?n:e),c(!1),s(!1)})}catch(e){console.error(e),c(!1),s(e)}return a&&m.current&&m.current.unsubscribe(),()=>{var e;m.current&&(null==(e=m?.current)||e.unsubscribe(),m.current=null)}},[e,a,p,h,u]),{data:d,loading:r,error:a}}const xe=w(null),Ve=w({editControls:!1}),Ne=w(void 0),Te=(e=1)=>{let n="^.^.concepts[]._ref",t=1;for(;e>t;)n=`^.${n}`,t++;return e>6?"":`"childConcepts": *[_id in ${n} && ^._id in broader[]._ref]|order(prefLabel)\n {\n "id": _id,\n "level": ${e},\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te(e+1)||""}\n }`},ze=k.details`
23
+ `);const we={},Ie={apiVersion:"v2023-05-01"};function _e(e){const n=v(()=>JSON.stringify(e||{}),[e]);return v(()=>JSON.parse(n),[n])}function ke(e,{params:n=we,options:i=Ie,initialValue:r=null}){const[o,c]=y(!0),[a,s]=y(!1),[d,l]=y(r),p=_e(n),h=_e(i),m=b(null),u=t();return C(()=>{if(e&&!a&&!m.current)try{m.current=u.listenQuery(e,p,h).pipe(de(se),le(e=>(console.error(e),s(e),c(!1),l(null),e))).subscribe(e=>{l(n=>se(n,e)?n:e),c(!1),s(!1)})}catch(e){console.error(e),c(!1),s(e)}return a&&m.current&&m.current.unsubscribe(),()=>{var e;m.current&&(null==(e=m?.current)||e.unsubscribe(),m.current=null)}},[e,a,p,h,u]),{data:d,loading:o,error:a}}const xe=w(null),Ve=w({editControls:!1}),Ne=w(void 0),Te=(e=1)=>{let n="^.^.concepts[]._ref",t=1;for(;e>t;)n=`^.${n}`,t++;return e>6?"":`"childConcepts": *[_id in ${n} && ^._id in broader[]._ref]|order(prefLabel)\n {\n "id": _id,\n "level": ${e},\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te(e+1)||""}\n }`},ze=k.details`
24
24
  summary {
25
25
  cursor: pointer;
26
26
  }
@@ -160,54 +160,54 @@ return T(O,{space:2,children:/* @__PURE__ */T(A,{space:[3,3,4],children:/* @__PU
160
160
  &:hover {
161
161
  text-decoration: underline;
162
162
  }
163
- `,De=k.p``;var Ze,Fe=new Uint8Array(16);function Ue(){if(!Ze&&!(Ze=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ze(Fe)}for(var Ke=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Be=[],qe=0;qe<256;++qe)Be.push((qe+256).toString(16).substr(1));function je(e,n,t){var i=(e=e||{}).random||(e.rng||Ue)();return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Be[e[n+0]]+Be[e[n+1]]+Be[e[n+2]]+Be[e[n+3]]+"-"+Be[e[n+4]]+Be[e[n+5]]+"-"+Be[e[n+6]]+Be[e[n+7]]+"-"+Be[e[n+8]]+Be[e[n+9]]+"-"+Be[e[n+10]]+Be[e[n+11]]+Be[e[n+12]]+Be[e[n+13]]+Be[e[n+14]]+Be[e[n+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Ke.test(e)}(t))throw TypeError("Stringified UUID is invalid");return t}(i)}function Ge(e){const n=R(),t=i({apiVersion:"2025-02-19"}),r=function(){const e=I(pe),{routerPanesState:n,groupIndex:t}=u();return g(i=>{if(!e||!i)return;const o=[...n];o.splice(t+1,t+1,[{id:i,params:{type:"skosConcept"}}]);const r=e.resolvePathFromState({panes:o});e.navigateUrl({path:r})},[e,n,t])}(),c=e.displayed.baseIri;return g((i,a)=>{const{id:s,_originalId:d=""}=a||{},l=S(e.displayed._id),p=l?$(e.displayed._id):void 0,h=l?H(P(e.displayed._id),p):L(P(e.displayed._id)),m=l?H(P(je()),p):L(P(je())),u={_id:m,_type:"skosConcept",conceptId:`${ae(6)}`,prefLabel:"",baseIri:c,broader:[],related:[]};if(s){const e=o(P(d));u.broader=[{_key:je(),_ref:E(P(s)),_type:"reference",_weak:!e,_strengthenOnPublish:e?void 0:{type:"skosConcept",template:{id:"skosConcept"}}}]}const f={_ref:E(m),_type:"reference",_key:je(),_strengthenOnPublish:{type:"skosConcept",template:{id:"skosConcept"}},_weak:!0};t.transaction().createIfNotExists({...e.displayed,_id:h}).create(u).patch(h,e=>"topConcept"===i?e.setIfMissing({topConcepts:[]}).append("topConcepts",[f]):e.setIfMissing({concepts:[]}).append("concepts",[f])).commit({autoGenerateArrayKeys:!0}).then(e=>{n.push({closable:!0,status:"success",title:"Created new concept"}),r(m)}).catch(e=>{n.push({closable:!0,status:"error",title:"Error creating concept",description:e instanceof Error?e.message:"Unknown error occurred"})})},[e.displayed,t,c,n,r])}function We(e){const n=R(),t=i({apiVersion:"2025-02-19"});return g((i,o,r)=>{const c="topConcept"==o?"topConcepts":"concepts",a=S(e.displayed._id),s=a?$(e.displayed._id):void 0,d=a?H(P(e.displayed._id),s):L(P(e.displayed._id));t.transaction().createIfNotExists({...e.displayed,_id:d}).patch(d,e=>e.unset([`${c}[_ref=="${i}"]`])).commit().then(e=>{n.push({closable:!0,status:"success",title:(r?`"${r}"`:"Concept")+" removed from scheme"})}).catch(e=>{n.push({closable:!0,status:"error",title:"Error removing concept",description:e instanceof Error?e.message:"Unknown error occurred"})})},[t,e.displayed,n])}function Je(){return"dark"==r()?_.gray[50].hex:_.gray[800].hex}const Qe=({concept:e})=>{const[n,t]=y(!1),i=g(()=>t(!1),[]),o=g(()=>t(!0),[]),r=Je();return e&&(e.definition||e.example||e.scopeNote)?/* @__PURE__ */N(z,{children:[
164
- /* @__PURE__ */T(Pe,{className:"action","aria-label":"info",onClick:o,type:"button",children:/* @__PURE__ */T(Y,{className:"info",style:{color:r}})}),n&&/* @__PURE__ */T(F,{header:e.prefLabel,id:"dialog-example",onClose:i,zOffset:1e3,width:1,children:/* @__PURE__ */T(U,{padding:4,paddingBottom:5,children:/* @__PURE__ */N(O,{space:4,children:[e.definition&&/* @__PURE__ */N(O,{space:2,children:[
163
+ `,De=k.p``;var Ze,Fe=new Uint8Array(16);function Ue(){if(!Ze&&!(Ze=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ze(Fe)}for(var Ke=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Be=[],qe=0;qe<256;++qe)Be.push((qe+256).toString(16).substr(1));function je(e,n,t){var i=(e=e||{}).random||(e.rng||Ue)();return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Be[e[n+0]]+Be[e[n+1]]+Be[e[n+2]]+Be[e[n+3]]+"-"+Be[e[n+4]]+Be[e[n+5]]+"-"+Be[e[n+6]]+Be[e[n+7]]+"-"+Be[e[n+8]]+Be[e[n+9]]+"-"+Be[e[n+10]]+Be[e[n+11]]+Be[e[n+12]]+Be[e[n+13]]+Be[e[n+14]]+Be[e[n+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Ke.test(e)}(t))throw TypeError("Stringified UUID is invalid");return t}(i)}function Ge(e){const n=R(),t=i({apiVersion:"2025-02-19"}),o=function(){const e=I(pe),{routerPanesState:n,groupIndex:t}=u();return g(i=>{if(!e||!i)return;const r=[...n];r.splice(t+1,t+1,[{id:i,params:{type:"skosConcept"}}]);const o=e.resolvePathFromState({panes:r});e.navigateUrl({path:o})},[e,n,t])}(),c=e.displayed.baseIri;return g((i,a)=>{const{id:s,_originalId:d=""}=a||{},l=S(e.displayed._id),p=l?$(e.displayed._id):void 0,h=l?H(P(e.displayed._id),p):L(P(e.displayed._id)),m=l?H(P(je()),p):L(P(je())),u={_id:m,_type:"skosConcept",conceptId:`${ae(6)}`,prefLabel:"",baseIri:c,broader:[],related:[]};if(s){const e=r(P(d));u.broader=[{_key:je(),_ref:E(P(s)),_type:"reference",_weak:!e,_strengthenOnPublish:e?void 0:{type:"skosConcept",template:{id:"skosConcept"}}}]}const f={_ref:E(m),_type:"reference",_key:je(),_strengthenOnPublish:{type:"skosConcept",template:{id:"skosConcept"}},_weak:!0};t.transaction().createIfNotExists({...e.displayed,_id:h}).create(u).patch(h,e=>"topConcept"===i?e.setIfMissing({topConcepts:[]}).append("topConcepts",[f]):e.setIfMissing({concepts:[]}).append("concepts",[f])).commit({autoGenerateArrayKeys:!0}).then(e=>{n.push({closable:!0,status:"success",title:"Created new concept"}),o(m)}).catch(e=>{n.push({closable:!0,status:"error",title:"Error creating concept",description:e instanceof Error?e.message:"Unknown error occurred"})})},[e.displayed,t,c,n,o])}function We(e){const n=R(),t=i({apiVersion:"2025-02-19"});return g((i,r,o)=>{const c="topConcept"==r?"topConcepts":"concepts",a=S(e.displayed._id),s=a?$(e.displayed._id):void 0,d=a?H(P(e.displayed._id),s):L(P(e.displayed._id));t.transaction().createIfNotExists({...e.displayed,_id:d}).patch(d,e=>e.unset([`${c}[_ref=="${i}"]`])).commit().then(e=>{n.push({closable:!0,status:"success",title:(o?`"${o}"`:"Concept")+" removed from scheme"})}).catch(e=>{n.push({closable:!0,status:"error",title:"Error removing concept",description:e instanceof Error?e.message:"Unknown error occurred"})})},[t,e.displayed,n])}function Je(){return"dark"==o()?_.gray[50].hex:_.gray[800].hex}const Qe=({concept:e})=>{const[n,t]=y(!1),i=g(()=>t(!1),[]),r=g(()=>t(!0),[]),o=Je();return e&&(e.definition||e.example||e.scopeNote)?/* @__PURE__ */N(z,{children:[
164
+ /* @__PURE__ */T(Pe,{className:"action","aria-label":"info",onClick:r,type:"button",children:/* @__PURE__ */T(Y,{className:"info",style:{color:o}})}),n&&/* @__PURE__ */T(F,{header:e.prefLabel,id:"dialog-example",onClose:i,zOffset:1e3,width:1,children:/* @__PURE__ */T(U,{padding:4,paddingBottom:5,children:/* @__PURE__ */N(O,{space:4,children:[e.definition&&/* @__PURE__ */N(O,{space:2,children:[
165
165
  /* @__PURE__ */T(K,{size:1,children:"Definition"}),
166
166
  /* @__PURE__ */T(M,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.definition})]}),e.example&&/* @__PURE__ */N(O,{space:2,children:[
167
167
  /* @__PURE__ */T(K,{size:1,children:"Example"}),
168
168
  /* @__PURE__ */T(M,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.example})]}),e.scopeNote&&/* @__PURE__ */N(O,{space:2,children:[
169
169
  /* @__PURE__ */T(K,{size:1,children:"Scope Note"}),
170
- /* @__PURE__ */T(M,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.scopeNote})]})]})})})]}):null};function Ye({concept:e}){const n=I(pe),{routerPanesState:t,groupIndex:i}=u(),o=Je(),{id:r,prefLabel:c}=e??{},a=g(()=>{if(!n||!r)return;const e=[...t];e.splice(i+1,i+1,[{id:r,params:{type:"skosConcept"}}]);const o=n.resolvePathFromState({panes:e});n.navigateUrl({path:o})},[r,n,t,i]);/* @__PURE__ */
171
- return T(Ae,{href:"#",onClick:a,style:{color:o},children:c})}function Xe({concept:e,selectConcept:n}){const{prefLabel:t,id:i,_originalId:o}=e??{},r=Je(),c=g(()=>{n({_ref:i,_type:"reference",_originalId:o})},[i,o,n]);/* @__PURE__ */
172
- return T(z,{children:n?/* @__PURE__ */T(Ae,{href:"#",onClick:c,style:{color:r},children:t}):/* @__PURE__ */T(De,{children:t})})}const en=({concept:e,selectConcept:n,inputComponent:t=!1})=>{const i=I(xe)||{},o=I(Ne),{globalVisibility:{treeVisibility:r}}=I(Ve)||{},c=Ge(i),a=We(i),s=g(()=>{c("concept",e)},[e,c]),d=g(()=>{a(e.id,"concept",e?.prefLabel)},[e.id,e?.prefLabel,a]),[l,p]=y(r),h=g(()=>{"open"==l?p("closed"):"closed"==l&&p("open")},[l]);/* @__PURE__ */
170
+ /* @__PURE__ */T(M,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.scopeNote})]})]})})})]}):null};function Ye({concept:e}){const n=I(pe),{routerPanesState:t,groupIndex:i}=u(),r=Je(),{id:o,prefLabel:c}=e??{},a=g(()=>{if(!n||!o)return;const e=[...t];e.splice(i+1,i+1,[{id:o,params:{type:"skosConcept"}}]);const r=n.resolvePathFromState({panes:e});n.navigateUrl({path:r})},[o,n,t,i]);/* @__PURE__ */
171
+ return T(Ae,{href:"#",onClick:a,style:{color:r},children:c})}function Xe({concept:e,selectConcept:n}){const{prefLabel:t,id:i,_originalId:r}=e??{},o=Je(),c=g(()=>{n&&n({_ref:i,_type:"reference",_originalId:r})},[i,r,n]),a=function(e,n=45){return e?e.length>n?`${e.slice(0,n).trimEnd()}…`:e:""}(t);/* @__PURE__ */
172
+ return T(z,{children:n?/* @__PURE__ */T(Ae,{href:"#",onClick:c,style:{color:o},title:t,children:a}):/* @__PURE__ */T(De,{children:a})})}const en=({concept:e,selectConcept:n,inputComponent:t=!1})=>{const i=I(xe)||{},r=I(Ne),{globalVisibility:{treeVisibility:o}}=I(Ve)||{},c=Ge(i),a=We(i),s=g(()=>{c("concept",e)},[e,c]),d=g(()=>{a(e.id,"concept",e?.prefLabel)},[e.id,e?.prefLabel,a]),[l,p]=y(o),h=g(()=>{"open"==l?p("closed"):"closed"==l&&p("open")},[l]);/* @__PURE__ */
173
173
  return N(Re,{className:l,children:[
174
174
  /* @__PURE__ */N(A,{space:2,children:[
175
175
  /* @__PURE__ */N(A,{space:1,children:[
176
- /* @__PURE__ */N(A,{space:1,children:[e?.childConcepts&&e.childConcepts.length>0&&/* @__PURE__ */T(Le,{onClick:h,type:"button","aria-expanded":"open"==l,children:/* @__PURE__ */T(X,{})}),e?.childConcepts&&0==e.childConcepts.length&&/* @__PURE__ */T(ee,{className:"spacer"}),!e?.prefLabel&&/* @__PURE__ */T("span",{className:"untitled",children:"[new concept]"}),t?/* @__PURE__ */T(Xe,{concept:e,selectConcept:n}):/* @__PURE__ */T(Ye,{concept:e})]}),t&&/* @__PURE__ */T(Qe,{concept:e})]}),!t&&"published"!==o&&e?.level&&e.level<5&&/* @__PURE__ */N(A,{space:2,children:[
176
+ /* @__PURE__ */N(A,{space:1,children:[e?.childConcepts&&e.childConcepts.length>0&&/* @__PURE__ */T(Le,{onClick:h,type:"button","aria-expanded":"open"==l,children:/* @__PURE__ */T(X,{})}),e?.childConcepts&&0==e.childConcepts.length&&/* @__PURE__ */T(ee,{className:"spacer"}),!e?.prefLabel&&/* @__PURE__ */T("span",{className:"untitled",children:"[new concept]"}),t?/* @__PURE__ */T(Xe,{concept:e,selectConcept:n}):/* @__PURE__ */T(Ye,{concept:e})]}),t&&/* @__PURE__ */T(Qe,{concept:e})]}),!t&&"published"!==r&&e?.level&&e.level<5&&/* @__PURE__ */N(A,{space:2,children:[
177
177
  /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Add a child concept below this concept"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:s,type:"button",className:"action","aria-label":"Add a child concept below this concept",children:/* @__PURE__ */T(ne,{className:"add"})})}),
178
- /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Remove this concept from this scheme"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:d,type:"button",className:"action","aria-label":"Remove this concept from this scheme",children:/* @__PURE__ */T(te,{className:"remove"})})})]}),!t&&"published"!==o&&0==e.childConcepts?.length&&5==e.level&&/* @__PURE__ */N(A,{space:2,children:[
178
+ /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Remove this concept from this scheme"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:d,type:"button",className:"action","aria-label":"Remove this concept from this scheme",children:/* @__PURE__ */T(te,{className:"remove"})})})]}),!t&&"published"!==r&&0==e.childConcepts?.length&&5==e.level&&/* @__PURE__ */N(A,{space:2,children:[
179
179
  /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"This concept is at the maximum Taxonomy Manager hierarchy depth of 5 levels."})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Y,{className:"info warning"})}),
180
180
  /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Remove this concept from this scheme"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:d,type:"button",className:"action","aria-label":"Remove concept from scheme",children:/* @__PURE__ */T(te,{className:"remove"})})})]}),e?.childConcepts&&e?.childConcepts?.length>0&&5==e.level&&/* @__PURE__ */N(A,{space:1,children:[
181
- /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"This concept has unlisted child concepts. The maximum validated hierarchy depth is 5 levels."})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(ie,{className:"info error"})}),!t&&"published"!==o&&/* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Remove this concept from this scheme"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:d,type:"button",className:"action","aria-label":"Remove concept from scheme",children:/* @__PURE__ */T(te,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&e?.level&&e.level<5&&/* @__PURE__ */T(nn,{concepts:e.childConcepts,selectConcept:n,inputComponent:t})]})},nn=({concepts:e,inputComponent:n=!1,selectConcept:t})=>/* @__PURE__ */T(Me,{children:e.map(e=>/* @__PURE__ */T(en,{concept:e,selectConcept:t,inputComponent:n},e.id))}),tn=({concept:e,treeVisibility:n,inputComponent:t,selectConcept:i})=>{const o=I(xe)||{},r=I(Ne),c=Ge(o),a=We(o),[s,d]=y(n),l=g(()=>{"open"==s?d("closed"):"closed"==s&&d("open")},[s]),p=g(()=>{c("concept",e)},[e,c]),h=g(()=>{a(e.id,"concept",e?.prefLabel)},[e.id,e?.prefLabel,a]);/* @__PURE__ */
181
+ /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"This concept has unlisted child concepts. The maximum validated hierarchy depth is 5 levels."})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(ie,{className:"info error"})}),!t&&"published"!==r&&/* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Remove this concept from this scheme"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:d,type:"button",className:"action","aria-label":"Remove concept from scheme",children:/* @__PURE__ */T(te,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&e?.level&&e.level<5&&/* @__PURE__ */T(nn,{concepts:e.childConcepts,selectConcept:n,inputComponent:t})]})},nn=({concepts:e,inputComponent:n=!1,selectConcept:t})=>/* @__PURE__ */T(Me,{children:e.map(e=>/* @__PURE__ */T(en,{concept:e,selectConcept:t,inputComponent:n},e.id))}),tn=({concept:e,treeVisibility:n,inputComponent:t,selectConcept:i})=>{const r=I(xe)||{},o=I(Ne),c=Ge(r),a=We(r),[s,d]=y(n),l=g(()=>{"open"==s?d("closed"):"closed"==s&&d("open")},[s]),p=g(()=>{c("concept",e)},[e,c]),h=g(()=>{a(e.id,"concept",e?.prefLabel)},[e.id,e?.prefLabel,a]);/* @__PURE__ */
182
182
  return N(Oe,{className:s,children:[
183
- /* @__PURE__ */N(A,{space:2,children:[e?.childConcepts&&e.childConcepts.length>0&&/* @__PURE__ */T(Le,{onClick:l,type:"button","aria-expanded":"open"==s,children:/* @__PURE__ */T(X,{})}),e?.childConcepts&&0==e.childConcepts.length&&/* @__PURE__ */T(ee,{className:"spacer"}),!e?.prefLabel&&/* @__PURE__ */T("span",{className:"untitled",children:"[new concept]"}),t?/* @__PURE__ */T(Xe,{concept:e,selectConcept:i}):/* @__PURE__ */T(Ye,{concept:e}),o.displayed?.topConcepts?.length&&/* @__PURE__ */T(M,{size:1,muted:!0,children:"orphan"}),t&&/* @__PURE__ */T(Qe,{concept:e}),!t&&"published"!==r&&/* @__PURE__ */N(A,{space:2,children:[
183
+ /* @__PURE__ */N(A,{space:2,children:[e?.childConcepts&&e.childConcepts.length>0&&/* @__PURE__ */T(Le,{onClick:l,type:"button","aria-expanded":"open"==s,children:/* @__PURE__ */T(X,{})}),e?.childConcepts&&0==e.childConcepts.length&&/* @__PURE__ */T(ee,{className:"spacer"}),!e?.prefLabel&&/* @__PURE__ */T("span",{className:"untitled",children:"[new concept]"}),t?/* @__PURE__ */T(Xe,{concept:e,selectConcept:i}):/* @__PURE__ */T(Ye,{concept:e}),r.displayed?.topConcepts?.length&&/* @__PURE__ */T(M,{size:1,muted:!0,children:"orphan"}),t&&/* @__PURE__ */T(Qe,{concept:e}),!t&&"published"!==o&&/* @__PURE__ */N(A,{space:2,children:[
184
184
  /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Add a child concept below this concept"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:p,type:"button",className:"action","aria-label":"Add a child concept below this concept",children:/* @__PURE__ */T(ne,{className:"add"})})}),
185
- /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Remove this concept from this scheme"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:h,type:"button",className:"action","aria-label":"Remove this concept from this scheme",children:/* @__PURE__ */T(te,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&/* @__PURE__ */T(nn,{concepts:e.childConcepts,selectConcept:i,inputComponent:t})]})},on=({document:e})=>{const[n,t]=y(!1),[o,r]=y(""),[c,a]=y(""),s=g(()=>t(!1),[]),d=g(()=>t(!0),[]),l=g(e=>{r(e.currentTarget.value)},[]),p=g(e=>{a(e.currentTarget.value)},[]),h=function(){const e=R(),n=i({apiVersion:"2021-10-21"});return g((t,i,o)=>{const r=t.displayed?._id,c=t.displayed?.baseIri,a=t.displayed?.schemeId,s={_id:`drafts.${r}`,_type:"skosConceptScheme",schemeId:a,baseIri:c,title:i,description:o||""};n.createIfNotExists(s).then(n=>o?e.push({closable:!0,status:"success",title:"Title and Description added."}):e.push({closable:!0,status:"success",title:"Title added."})).catch(n=>{e.push({closable:!0,status:"error",title:"There has been an error",description:n.message})})},[n,e])}(),m=g(()=>{h(e,o,c)},[h,c,e,o]);/* @__PURE__ */
185
+ /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Remove this concept from this scheme"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:h,type:"button",className:"action","aria-label":"Remove this concept from this scheme",children:/* @__PURE__ */T(te,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&/* @__PURE__ */T(nn,{concepts:e.childConcepts,selectConcept:i,inputComponent:t})]})},rn=({document:e})=>{const[n,t]=y(!1),[r,o]=y(""),[c,a]=y(""),s=g(()=>t(!1),[]),d=g(()=>t(!0),[]),l=g(e=>{o(e.currentTarget.value)},[]),p=g(e=>{a(e.currentTarget.value)},[]),h=function(){const e=R(),n=i({apiVersion:"2021-10-21"});return g((t,i,r)=>{const o=t.displayed?._id,c=t.displayed?.baseIri,a=t.displayed?.schemeId,s={_id:`drafts.${o}`,_type:"skosConceptScheme",schemeId:a,baseIri:c,title:i,description:r||""};n.createIfNotExists(s).then(n=>r?e.push({closable:!0,status:"success",title:"Title and Description added."}):e.push({closable:!0,status:"success",title:"Title added."})).catch(n=>{e.push({closable:!0,status:"error",title:"There has been an error",description:n.message})})},[n,e])}(),m=g(()=>{h(e,r,c)},[h,c,e,r]);/* @__PURE__ */
186
186
  return N(Se,{children:[
187
187
  /* @__PURE__ */T(Z,{padding:[3,3,4],radius:2,shadow:1,tone:"primary",children:/* @__PURE__ */N(O,{space:6,children:[
188
188
  /* @__PURE__ */N(O,{space:4,children:[
189
189
  /* @__PURE__ */T(K,{size:4,children:"New Concept Scheme"}),
190
190
  /* @__PURE__ */T(M,{size:2,children:'To start using hierarchy view taxonomy builder, first give your concept scheme a name and optional description. You can also use the "Editor" tab to add concepts to the tree manually.'})]}),
191
- /* @__PURE__ */T(D,{tone:"primary",fontSize:2,icon:oe,onClick:d,text:"Add Title"})]})}),n&&/* @__PURE__ */T(F,{header:"Title & Description",id:"title-description",onClose:s,zOffset:1e3,width:1,children:/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */N(O,{space:4,children:[
191
+ /* @__PURE__ */T(D,{tone:"primary",fontSize:2,icon:re,onClick:d,text:"Add Title"})]})}),n&&/* @__PURE__ */T(F,{header:"Title & Description",id:"title-description",onClose:s,zOffset:1e3,width:1,children:/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */N(O,{space:4,children:[
192
192
  /* @__PURE__ */N(O,{space:2,children:[
193
193
  /* @__PURE__ */T(K,{size:1,children:"Title"}),
194
194
  /* @__PURE__ */T(M,{size:1,muted:!0,children:"Describe the concept scheme in one or two words."})]}),
195
- /* @__PURE__ */T(q,{fontSize:2,onChange:l,padding:3,placeholder:"",value:o}),
195
+ /* @__PURE__ */T(q,{fontSize:2,onChange:l,padding:3,placeholder:"",value:r}),
196
196
  /* @__PURE__ */N(O,{space:2,children:[
197
197
  /* @__PURE__ */T(K,{size:1,children:"Description (optional)"}),
198
198
  /* @__PURE__ */T(M,{size:1,muted:!0,children:"Describe the intended use of this concept scheme."})]}),
199
199
  /* @__PURE__ */T(j,{fontSize:2,onChange:p,padding:3,placeholder:"",value:c,rows:3}),
200
- /* @__PURE__ */T(D,{tone:"primary",fontSize:2,onClick:m,text:"Save"})]})})})]})},rn=()=>/* @__PURE__ */T(Se,{children:/* @__PURE__ */T(Z,{padding:[3,3,4],radius:2,shadow:1,tone:"primary",children:/* @__PURE__ */N(O,{space:4,children:[
200
+ /* @__PURE__ */T(D,{tone:"primary",fontSize:2,onClick:m,text:"Save"})]})})})]})},on=()=>/* @__PURE__ */T(Se,{children:/* @__PURE__ */T(Z,{padding:[3,3,4],radius:2,shadow:1,tone:"primary",children:/* @__PURE__ */N(O,{space:4,children:[
201
201
  /* @__PURE__ */T(K,{size:4,children:"No Concepts"}),
202
- /* @__PURE__ */T(M,{size:2,children:"There are not yet any concepts assigned to this scheme. To create a multi-level hierarchy with specific entry points, create Top Concepts first, then add child concepts to them. To create a flat list of concepts, create Concepts directly."})]})})}),cn=({concept:e,treeVisibility:n,inputComponent:t,selectConcept:i})=>{const o=I(xe)||{},r=I(Ne),c=Ge(o),a=We(o),[s,d]=y(n),l=g(()=>{"open"==s?d("closed"):"closed"==s&&d("open")},[s]),p=g(()=>{c("concept",e)},[e,c]),h=g(()=>{a(e?.id,"topConcept",e?.prefLabel)},[e?.id,e?.prefLabel,a]);/* @__PURE__ */
202
+ /* @__PURE__ */T(M,{size:2,children:"There are not yet any concepts assigned to this scheme. To create a multi-level hierarchy with specific entry points, create Top Concepts first, then add child concepts to them. To create a flat list of concepts, create Concepts directly."})]})})}),cn=({concept:e,treeVisibility:n,inputComponent:t,selectConcept:i})=>{const r=I(xe)||{},o=I(Ne),c=Ge(r),a=We(r),[s,d]=y(n),l=g(()=>{"open"==s?d("closed"):"closed"==s&&d("open")},[s]),p=g(()=>{c("concept",e)},[e,c]),h=g(()=>{a(e?.id,"topConcept",e?.prefLabel)},[e?.id,e?.prefLabel,a]);/* @__PURE__ */
203
203
  return N(Ee,{className:s,children:[
204
204
  /* @__PURE__ */N(A,{space:2,children:[
205
205
  /* @__PURE__ */N(A,{space:0,children:[e?.childConcepts&&e.childConcepts.length>0&&/* @__PURE__ */T(Le,{onClick:l,type:"button","aria-expanded":"open"==s,children:/* @__PURE__ */T(X,{})}),e?.childConcepts&&0==e.childConcepts.length&&/* @__PURE__ */T(ee,{className:"spacer"}),!e?.prefLabel&&/* @__PURE__ */T("span",{className:"untitled",children:"[new concept]"}),t?/* @__PURE__ */T(Xe,{concept:e,selectConcept:i}):/* @__PURE__ */T(Ye,{concept:e})]}),
206
- /* @__PURE__ */T(M,{size:1,muted:!0,children:"top concept"}),t&&/* @__PURE__ */T(Qe,{concept:e}),!t&&"published"!==r&&/* @__PURE__ */N(A,{space:2,children:[
206
+ /* @__PURE__ */T(M,{size:1,muted:!0,children:"top concept"}),t&&/* @__PURE__ */T(Qe,{concept:e}),!t&&"published"!==o&&/* @__PURE__ */N(A,{space:2,children:[
207
207
  /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Add a child concept below this concept"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:p,type:"button",className:"action","aria-label":"Add child a child concept",children:/* @__PURE__ */T(ne,{className:"add"})})}),
208
- /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Remove this concept from this scheme"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:h,type:"button",className:"action","aria-label":"Remove concept from scheme",children:/* @__PURE__ */T(te,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&/* @__PURE__ */T(nn,{concepts:e.childConcepts,selectConcept:i,inputComponent:t})]})},an=({concepts:e,inputComponent:n,selectConcept:t})=>{const{globalVisibility:{treeId:i,treeVisibility:o}={treeId:123,treeVisibility:"open"}}=I(Ve)||{};return e?.topConcepts?.length||e?.concepts?.length?/* @__PURE__ */N($e,{children:[e.topConcepts?.map(e=>/* @__PURE__ */T(cn,{concept:e,treeVisibility:o,inputComponent:n,selectConcept:t},`${e?.id}+${i}`)),e.concepts?.filter(e=>e?.isOrphan).map(e=>/* @__PURE__ */T(tn,{concept:e,treeVisibility:o,inputComponent:n,selectConcept:t},`${e.id}+${i}`))]}):/* @__PURE__ */T(rn,{})},sn=({branchId:e="",selectConcept:n,inputComponent:t})=>{const i=I(xe)||{},o=E(i.displayed?._id),r=I(Ne),{data:c,loading:a,error:s}=ke({fetch:`\n select($branchId != null => \n *[_id == $id][0] {\n _updatedAt,\n "topConcepts":*[_type == "skosConcept" && conceptId == $branchId]{\n "id": _id,\n "level": 0,\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""} \n }, \n "concepts": []\n },\n *[_id == $id][0] {\n _updatedAt,\n "topConcepts":topConcepts[]->|order(prefLabel){\n "id": _id,\n "level": 0,\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""}\n }, \n "concepts": concepts[]->|order(prefLabel){\n "id": _id,\n "level": 0,\n "isOrphan": \n coalesce(\n !array::intersects(\n broader[]._ref, (\n coalesce(^.concepts[]._ref, []) + coalesce(^.topConcepts[]._ref, [])\n )\n ), \n true),\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""}\n }\n }\n )`,listen:'*[_type == "skosConcept" || _id == $id]'},{params:{id:o,branchId:e},options:{perspective:void 0===r?"drafts":[r]}});return a?/* @__PURE__ */T(U,{padding:5,children:/* @__PURE__ */N(G,{align:"center",direction:"column",gap:5,height:"fill",justify:"center",style:{paddingTop:"1rem"},children:[
208
+ /* @__PURE__ */T(B,{delay:{open:750},content:/* @__PURE__ */T(U,{padding:1,sizing:"content",children:/* @__PURE__ */T(M,{muted:!0,size:1,children:"Remove this concept from this scheme"})}),fallbackPlacements:["right","left"],placement:"top",children:/* @__PURE__ */T(Pe,{onClick:h,type:"button",className:"action","aria-label":"Remove concept from scheme",children:/* @__PURE__ */T(te,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&/* @__PURE__ */T(nn,{concepts:e.childConcepts,selectConcept:i,inputComponent:t})]})},an=({concepts:e,inputComponent:n,selectConcept:t})=>{const{globalVisibility:{treeId:i,treeVisibility:r}={treeId:123,treeVisibility:"open"}}=I(Ve)||{};return e?.topConcepts?.length||e?.concepts?.length?/* @__PURE__ */N($e,{children:[e.topConcepts?.map(e=>/* @__PURE__ */T(cn,{concept:e,treeVisibility:r,inputComponent:n,selectConcept:t},`${e?.id}+${i}`)),e.concepts?.filter(e=>e?.isOrphan).map(e=>/* @__PURE__ */T(tn,{concept:e,treeVisibility:r,inputComponent:n,selectConcept:t},`${e.id}+${i}`))]}):/* @__PURE__ */T(on,{})},sn=({branchId:e="",selectConcept:n,inputComponent:t})=>{const i=I(xe)||{},r=E(i.displayed?._id),o=I(Ne),{data:c,loading:a,error:s}=ke({fetch:`\n select($branchId != null => \n *[_id == $id][0] {\n _updatedAt,\n "topConcepts":*[_type == "skosConcept" && conceptId == $branchId]{\n "id": _id,\n "level": 0,\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""} \n }, \n "concepts": []\n },\n *[_id == $id][0] {\n _updatedAt,\n "topConcepts":topConcepts[]->|order(prefLabel){\n "id": _id,\n "level": 0,\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""}\n }, \n "concepts": concepts[]->|order(prefLabel){\n "id": _id,\n "level": 0,\n "isOrphan": \n coalesce(\n !array::intersects(\n broader[]._ref, (\n coalesce(^.concepts[]._ref, []) + coalesce(^.topConcepts[]._ref, [])\n )\n ), \n true),\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""}\n }\n }\n )`,listen:'*[_type == "skosConcept" || _id == $id]'},{params:{id:r,branchId:e},options:{perspective:void 0===o?"drafts":[o]}});return a?/* @__PURE__ */T(U,{padding:5,children:/* @__PURE__ */N(G,{align:"center",direction:"column",gap:5,height:"fill",justify:"center",style:{paddingTop:"1rem"},children:[
209
209
  /* @__PURE__ */T(W,{muted:!0}),
210
- /* @__PURE__ */T(M,{muted:!0,size:1,children:"Loading hierarchy…"})]})}):s?(console.warn(s),/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(Z,{padding:[3],radius:2,shadow:1,tone:"caution",children:/* @__PURE__ */T(M,{size:1,children:"There was a problem loading terms. Please check the scheme configuration and try again."})})})):c?/* @__PURE__ */T(Ve.Provider,{value:{globalVisibility:{treeId:"123",treeVisibility:"open"}},children:/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(an,{concepts:c,inputComponent:t||!1,selectConcept:n||(()=>{})})})}):/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(Z,{padding:[3],radius:2,shadow:1,tone:"caution",children:/* @__PURE__ */T(M,{size:1,children:"This configuration does not have any terms associated with it. Please check the scheme and branch supplied and try again."})})})},dn=({inputComponent:e=!1,branchId:n="",selectConcept:t})=>{const i=I(xe)||{},o=E(i.displayed?._id),r=I(Ne),c=Ge(i),a=g(()=>{c("topConcept")},[c]),s=g(()=>{c("concept")},[c]),[d,l]=y({treeId:ae(6),treeVisibility:"open"}),p=g(()=>{l({treeId:ae(6),treeVisibility:"open"})},[]),h=g(()=>{l({treeId:ae(6),treeVisibility:"closed"})},[]),{data:m,loading:u,error:f}=ke({fetch:`*[_id == $id][0] {\n _updatedAt,\n "topConcepts": topConcepts[]->|order(prefLabel) {\n "id": _id,\n "level": 0,\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""}\n },\n "concepts": concepts[]->|order(prefLabel) {\n "id": _id,\n "level": 0,\n "isOrphan": \n coalesce(\n !array::intersects(\n broader[]._ref, (\n coalesce(^.concepts[]._ref, []) + coalesce(^.topConcepts[]._ref, [])\n )\n ),\n true),\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""}\n }\n }`,listen:'*[_type == "skosConcept" || _type == "skosConceptScheme" ]'},{params:{id:o,branchId:n},options:{perspective:void 0===r?"drafts":[r]}});return u?/* @__PURE__ */T(U,{padding:5,children:/* @__PURE__ */N(G,{align:"center",direction:"column",gap:5,height:"fill",justify:"center",style:{paddingTop:"1rem"},children:[
210
+ /* @__PURE__ */T(M,{muted:!0,size:1,children:"Loading hierarchy…"})]})}):s?(console.warn(s),/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(Z,{padding:[3],radius:2,shadow:1,tone:"caution",children:/* @__PURE__ */T(M,{size:1,children:"There was a problem loading terms. Please check the scheme configuration and try again."})})})):c?/* @__PURE__ */T(Ve.Provider,{value:{globalVisibility:{treeId:"123",treeVisibility:"open"}},children:/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(an,{concepts:c,inputComponent:t||!1,selectConcept:n||(()=>{})})})}):/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(Z,{padding:[3],radius:2,shadow:1,tone:"caution",children:/* @__PURE__ */T(M,{size:1,children:"This configuration does not have any terms associated with it. Please check the scheme and branch supplied and try again."})})})},dn=({inputComponent:e=!1,branchId:n="",selectConcept:t})=>{const i=I(xe)||{},r=E(i.displayed?._id),o=I(Ne),c=Ge(i),a=g(()=>{c("topConcept")},[c]),s=g(()=>{c("concept")},[c]),[d,l]=y({treeId:ae(6),treeVisibility:"open"}),p=g(()=>{l({treeId:ae(6),treeVisibility:"open"})},[]),h=g(()=>{l({treeId:ae(6),treeVisibility:"closed"})},[]),{data:m,loading:u,error:f}=ke({fetch:`*[_id == $id][0] {\n _updatedAt,\n "topConcepts": topConcepts[]->|order(prefLabel) {\n "id": _id,\n "level": 0,\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""}\n },\n "concepts": concepts[]->|order(prefLabel) {\n "id": _id,\n "level": 0,\n "isOrphan": \n coalesce(\n !array::intersects(\n broader[]._ref, (\n coalesce(^.concepts[]._ref, []) + coalesce(^.topConcepts[]._ref, [])\n )\n ),\n true),\n _originalId,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Te()||""}\n }\n }`,listen:'*[_type == "skosConcept" || _type == "skosConceptScheme" ]'},{params:{id:r,branchId:n},options:{perspective:void 0===o?"drafts":[o]}});return u?/* @__PURE__ */T(U,{padding:5,children:/* @__PURE__ */N(G,{align:"center",direction:"column",gap:5,height:"fill",justify:"center",style:{paddingTop:"1rem"},children:[
211
211
  /* @__PURE__ */T(W,{muted:!0}),
212
212
  /* @__PURE__ */T(M,{muted:!0,size:1,children:"Loading hierarchy…"})]})}):f?(console.error(f),/* @__PURE__ */T("div",{children:"Error here"})):m?/* @__PURE__ */T(Ve.Provider,{value:{globalVisibility:d},children:/* @__PURE__ */T(U,{padding:4,paddingTop:2,children:/* @__PURE__ */N(z,{children:[
213
213
  /* @__PURE__ */T(O,{space:4,children:/* @__PURE__ */T(Z,{borderBottom:!0,paddingBottom:1,display:"flex",flex:1,children:/* @__PURE__ */N(G,{justify:"space-between",flex:1,children:[
@@ -215,16 +215,16 @@ return N(Ee,{className:s,children:[
215
215
  /* @__PURE__ */T(He,{type:"button",onClick:h,children:/* @__PURE__ */T(M,{weight:"semibold",muted:!0,size:1,children:"Collapse"})}),
216
216
  /* @__PURE__ */T(M,{weight:"semibold",muted:!0,size:1,children:"|"}),
217
217
  /* @__PURE__ */T(He,{type:"button",onClick:p,children:/* @__PURE__ */T(M,{weight:"semibold",muted:!0,size:1,children:"Expand"})})]})}),
218
- /* @__PURE__ */T(Z,{children:"published"!==r&&/* @__PURE__ */N(A,{space:1,children:[
218
+ /* @__PURE__ */T(Z,{children:"published"!==o&&/* @__PURE__ */N(A,{space:1,children:[
219
219
  /* @__PURE__ */T(He,{type:"button",className:"add",onClick:a,children:/* @__PURE__ */N(M,{weight:"semibold",muted:!0,size:1,children:[
220
220
  /* @__PURE__ */T(ne,{})," Add Top Concept"]})}),
221
221
  /* @__PURE__ */T(He,{type:"button",className:"add",onClick:s,children:/* @__PURE__ */N(M,{weight:"semibold",muted:!0,size:1,children:[
222
222
  /* @__PURE__ */T(ne,{})," Add Concept"]})})]})})]})})}),
223
- /* @__PURE__ */T(an,{concepts:m,inputComponent:e,selectConcept:t||(()=>{})})]})})}):/* @__PURE__ */T(on,{document:i})},ln=({document:e,branchId:n,inputComponent:t=!1,selectConcept:i})=>{const{selectedPerspectiveName:o}=c();/* @__PURE__ */
224
- return T(xe.Provider,{value:e||{},children:/* @__PURE__ */T(Ne.Provider,{value:o,children:t?/* @__PURE__ */T(sn,{inputComponent:t,branchId:n,selectConcept:i}):/* @__PURE__ */N(J,{width:1,style:{paddingTop:"1.25rem"},children:[e?.displayed?.description&&/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(O,{space:4,children:/* @__PURE__ */N(O,{space:2,children:[
223
+ /* @__PURE__ */T(an,{concepts:m,inputComponent:e,selectConcept:t||(()=>{})})]})})}):/* @__PURE__ */T(rn,{document:i})},ln=({document:e,branchId:n,inputComponent:t=!1,selectConcept:i})=>{const{selectedPerspectiveName:r}=c();/* @__PURE__ */
224
+ return T(xe.Provider,{value:e||{},children:/* @__PURE__ */T(Ne.Provider,{value:r,children:t?/* @__PURE__ */T(sn,{inputComponent:t,branchId:n,selectConcept:i}):/* @__PURE__ */N(J,{width:1,style:{paddingTop:"1.25rem"},children:[e?.displayed?.description&&/* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(O,{space:4,children:/* @__PURE__ */N(O,{space:2,children:[
225
225
  /* @__PURE__ */T(M,{size:1,weight:"semibold",children:"Description"}),
226
226
  /* @__PURE__ */T(M,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e?.displayed.description})]})})}),
227
- /* @__PURE__ */T(dn,{inputComponent:t,branchId:n})]})})})};function pn(n){const t=i({apiVersion:"2025-02-19"}),o=e(["_id"]),{name:r,title:s}=n,d=S(o),l=a(o),{selectedPerspectiveName:p}=c(),[h,m]=y(!0),[u,f]=y(!0),[b,v]=y(!1),[w,I]=y({}),[_,k]=y(),{schemeId:x,branchId:V=null}=_?.params||{},{filter:z}=n.schemaType.options;C(()=>{(async function(){try{const e=await z({getClient:()=>t});k(e),f(!1)}catch(e){console.error("Error fetching filter values: ",e)}})().catch(e=>console.error("Error fetching filter values: ",e))},[z,t]),C(()=>{x&&t.fetch(`{"displayed": *[schemeId == "${x}"][0]}`).then(e=>{e?.displayed&&(I(e),m(!1))}).catch(e=>console.warn(e))},[t,x]);const $=g(()=>{v(!0)},[]),H=g(()=>{v(!1)},[]),P=g(e=>{(a(e?._originalId)||S(e?._originalId))&&(e._strengthenOnPublish={type:"skosConcept",template:{id:"skosConcept"}},e._weak=!0),delete e._originalId,l||d?t.patch(o).set({[r]:e}).commit().then(()=>v(!1)).catch(e=>console.error(e)):t.fetch(`*[_id == "${o}"][0]`).then(n=>{n._id=`drafts.${n._id}`,n[r]=e,t.create(n).catch(e=>console.error("Error creating draft: ",e))}).then(()=>v(!1)).catch(e=>console.error(e))},[t,o,l,d,r]);return n.schemaType.options?.filter?0===n.schemaType.options?.filter.length?/* @__PURE__ */N(O,{space:3,children:[n.renderDefault(n),
227
+ /* @__PURE__ */T(dn,{inputComponent:t,branchId:n})]})})})};function pn(n){const t=i({apiVersion:"2025-02-19"}),r=e(["_id"]),{name:o,title:s}=n,d=S(r),l=a(r),{selectedPerspectiveName:p}=c(),[h,m]=y(!0),[u,f]=y(!0),[b,v]=y(!1),[w,I]=y({}),[_,k]=y(),{schemeId:x,branchId:V=null}=_?.params||{},{filter:z}=n.schemaType.options;C(()=>{(async function(){try{const e=await z({getClient:()=>t});k(e),f(!1)}catch(e){console.error("Error fetching filter values: ",e)}})().catch(e=>console.error("Error fetching filter values: ",e))},[z,t]),C(()=>{x&&t.fetch(`{"displayed": *[schemeId == "${x}"][0]}`).then(e=>{e?.displayed&&(I(e),m(!1))}).catch(e=>console.warn(e))},[t,x]);const $=g(()=>{v(!0)},[]),H=g(()=>{v(!1)},[]),P=g(e=>{(a(e?._originalId)||S(e?._originalId))&&(e._strengthenOnPublish={type:"skosConcept",template:{id:"skosConcept"}},e._weak=!0),delete e._originalId,l||d?t.patch(r).set({[o]:e}).commit().then(()=>v(!1)).catch(e=>console.error(e)):t.fetch(`*[_id == "${r}"][0]`).then(n=>{n._id=`drafts.${n._id}`,n[o]=e,t.create(n).catch(e=>console.error("Error creating draft: ",e))}).then(()=>v(!1)).catch(e=>console.error(e))},[t,r,l,d,o]);return n.schemaType.options?.filter?0===n.schemaType.options?.filter.length?/* @__PURE__ */N(O,{space:3,children:[n.renderDefault(n),
228
228
  /* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(Z,{padding:[3],radius:2,shadow:1,tone:"caution",children:/* @__PURE__ */N(M,{size:1,children:["There was a problem loading your filter settings. Please check the"," ",
229
229
  /* @__PURE__ */T("code",{children:"schemeFilter()"})," or ",
230
230
  /* @__PURE__ */T("code",{children:"branchFilter()"})," configuration for the"," ",s," field."]})})})]}):h||u?/* @__PURE__ */T(U,{padding:5,children:/* @__PURE__ */N(G,{align:"center",direction:"column",gap:5,height:"fill",justify:"center",style:{paddingTop:"1rem"},children:[
@@ -234,7 +234,7 @@ return T(xe.Provider,{value:e||{},children:/* @__PURE__ */T(Ne.Provider,{value:o
234
234
  /* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(Z,{padding:[3],radius:2,shadow:1,tone:"caution",children:/* @__PURE__ */N(M,{size:1,children:["The ",
235
235
  /* @__PURE__ */T("code",{children:"ReferenceHierarchyInput()"})," component must be used with an accompanying"," ",
236
236
  /* @__PURE__ */T("code",{children:"schemeFilter()"})," or ",
237
- /* @__PURE__ */T("code",{children:"branchFilter()"}),". Please add an appropriate filter to the configuration for the ",s," field."]})})})]})}function hn(n){const t=i({apiVersion:"2025-02-19"}),o=e(["_id"]),{name:r,title:d,value:l=[]}=n,p=s(o),h=a(o),{selectedPerspectiveName:m}=c(),[u,f]=y(!0),[b,v]=y(!0),[w,I]=y(!1),[_,k]=y({}),[x,V]=y(),{schemeId:z,branchId:S=null}=x?.params||{},{filter:$}=n.schemaType.of[0].options,H=R();C(()=>{(async function(){try{const e=await $({getClient:()=>t});V(e),v(!1)}catch(e){console.error("Error fetching filter values: ",e)}})().catch(e=>console.error("Error fetching filter values: ",e))},[$,t]),C(()=>{z&&t.fetch(`{"displayed": *[schemeId == "${z}"][0]}`).then(e=>{e?.displayed&&(k(e),f(!1))}).catch(e=>console.warn(e))},[t,z]);const P=g(()=>{I(!0)},[]),L=g(()=>{I(!1)},[]),E=g(e=>{if((a(e?._originalId)||s(e?._originalId))&&(e._strengthenOnPublish={type:"skosConcept",template:{id:"skosConcept"}},e._weak=!0),delete e._originalId,l?.map(e=>e._ref).includes(e._ref))return I(!1),void H.push({status:"warning",title:"Taxonomy Term Not Added",description:"The selected concept is already included in this field.",duration:5e3,closable:!0});h||p?t.patch(o).setIfMissing({[r]:[]}).append(r,[e]).commit({autoGenerateArrayKeys:!0}).then(()=>I(!1)).catch(e=>console.error(e)):t.fetch(`*[_id == "${o}"][0]`).then(e=>{e._id=`drafts.${e._id}`,t.create(e).catch(e=>console.error("Error creating draft: ",e))}).then(()=>{t.patch(`drafts.${o}`).setIfMissing({[r]:[]}).append(r,[e]).commit({autoGenerateArrayKeys:!0}).then(()=>I(!1)).catch(e=>console.error(e))}).catch(e=>console.error(e))},[l,h,p,t,o,H,r]);return n.schemaType.of[0].options?.filter?0===n.schemaType.of[0].options?.filter?.length?/* @__PURE__ */N(O,{space:3,children:[n.renderDefault(n),
237
+ /* @__PURE__ */T("code",{children:"branchFilter()"}),". Please add an appropriate filter to the configuration for the ",s," field."]})})})]})}function hn(n){const t=i({apiVersion:"2025-02-19"}),r=e(["_id"]),{name:o,title:d,value:l=[]}=n,p=s(r),h=a(r),{selectedPerspectiveName:m}=c(),[u,f]=y(!0),[b,v]=y(!0),[w,I]=y(!1),[_,k]=y({}),[x,V]=y(),{schemeId:z,branchId:S=null}=x?.params||{},{filter:$}=n.schemaType.of[0].options,H=R();C(()=>{(async function(){try{const e=await $({getClient:()=>t});V(e),v(!1)}catch(e){console.error("Error fetching filter values: ",e)}})().catch(e=>console.error("Error fetching filter values: ",e))},[$,t]),C(()=>{z&&t.fetch(`{"displayed": *[schemeId == "${z}"][0]}`).then(e=>{e?.displayed&&(k(e),f(!1))}).catch(e=>console.warn(e))},[t,z]);const P=g(()=>{I(!0)},[]),L=g(()=>{I(!1)},[]),E=g(e=>{if((a(e?._originalId)||s(e?._originalId))&&(e._strengthenOnPublish={type:"skosConcept",template:{id:"skosConcept"}},e._weak=!0),delete e._originalId,l?.map(e=>e._ref).includes(e._ref))return I(!1),void H.push({status:"warning",title:"Taxonomy Term Not Added",description:"The selected concept is already included in this field.",duration:5e3,closable:!0});h||p?t.patch(r).setIfMissing({[o]:[]}).append(o,[e]).commit({autoGenerateArrayKeys:!0}).then(()=>I(!1)).catch(e=>console.error(e)):t.fetch(`*[_id == "${r}"][0]`).then(e=>{e._id=`drafts.${e._id}`,t.create(e).catch(e=>console.error("Error creating draft: ",e))}).then(()=>{t.patch(`drafts.${r}`).setIfMissing({[o]:[]}).append(o,[e]).commit({autoGenerateArrayKeys:!0}).then(()=>I(!1)).catch(e=>console.error(e))}).catch(e=>console.error(e))},[l,h,p,t,r,H,o]);return n.schemaType.of[0].options?.filter?0===n.schemaType.of[0].options?.filter?.length?/* @__PURE__ */N(O,{space:3,children:[n.renderDefault(n),
238
238
  /* @__PURE__ */T(U,{padding:4,children:/* @__PURE__ */T(Z,{padding:[3],radius:2,shadow:1,tone:"caution",children:/* @__PURE__ */N(M,{size:1,children:["There was a problem loading your filter settings. Please check the"," ",
239
239
  /* @__PURE__ */T("code",{children:"schemeFilter()"})," or ",
240
240
  /* @__PURE__ */T("code",{children:"branchFilter()"})," configuration for the"," ",d," field."]})})})]}):n.schemaType.of.length>1?/* @__PURE__ */N(O,{space:3,children:[n.renderDefault(n),
@@ -251,7 +251,7 @@ return T(xe.Provider,{value:e||{},children:/* @__PURE__ */T(Ne.Provider,{value:o
251
251
  /* @__PURE__ */T("code",{children:"branchFilter()"}),". Please add an appropriate filter to the configuration for the ",d," field."]})})})]})}const mn=e=>{const{onChange:n}=e,t=R(),i=g(()=>{n(d()),t.push({status:"success",title:"Value removed.",duration:2500,closable:!0})},[n,t]);/* @__PURE__ */
252
252
  return T(O,{space:2,children:/* @__PURE__ */N(A,{space:[3,3,4],children:[e.renderDefault(e),
253
253
  /* @__PURE__ */T(D,{tone:"primary",fontSize:2,onClick:i,text:"Remove Value"})]})})};function un(){/* @__PURE__ */
254
- return T("svg",{"data-sanity-icon":!0,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:/* @__PURE__ */T("path",{d:"M5.5 6.5V5.9H4.9V6.5H5.5ZM11.5 6.5H12.1V5.9H11.5V6.5ZM5.5 9H4.9V9.6H5.5V9ZM11.5 9V9.6H12.1V9H11.5ZM13.5 11V10.4H12.9V11H13.5ZM19.5 11H20.1V10.4H19.5V11ZM13.5 13.5H12.9V14.1H13.5V13.5ZM19.5 13.5V14.1H20.1V13.5H19.5ZM13.5 16V15.4H12.9V16H13.5ZM19.5 16H20.1V15.4H19.5V16ZM13.5 18.5H12.9V19.1H13.5V18.5ZM19.5 18.5V19.1H20.1V18.5H19.5ZM5.5 7.1H11.5V5.9H5.5V7.1ZM6.1 9V6.5H4.9V9H6.1ZM11.5 8.4H5.5V9.6H11.5V8.4ZM10.9 6.5V9H12.1V6.5H10.9ZM13.5 11.6H19.5V10.4H13.5V11.6ZM14.1 13.5V11H12.9V13.5H14.1ZM19.5 12.9H13.5V14.1H19.5V12.9ZM18.9 11V13.5H20.1V11H18.9ZM13.5 16.6H19.5V15.4H13.5V16.6ZM14.1 18.5V16H12.9V18.5H14.1ZM19.5 17.9H13.5V19.1H19.5V17.9ZM18.9 16V18.5H20.1V16H18.9ZM8 17.85H13.5V16.65H8V17.85ZM8 12.85H13.5V11.65H8V12.85ZM7.9 9.5V17.85H9.1V9.5H7.9Z",fill:"currentColor"})})}const fn=e=>{const{schemeId:n}=e||{};if(!n||"string"!=typeof n)throw new Error("Invalid or missing schemeId: scheme Id must be a string");return async e=>{const t=e?.getClient({apiVersion:"2025-02-19"});if(!t)throw new Error("Client not available");const{concepts:i,topConcepts:o}=await t.fetch(`{\n "concepts": *[_type=="skosConceptScheme" && schemeId == "${n}"].concepts[]._ref,\n "topConcepts": *[_type=="skosConceptScheme" && schemeId == "${n}"].topConcepts[]._ref\n }`);return{filter:"(_id in $concepts\n || _id in $topConcepts)",params:{concepts:i,topConcepts:o,schemeId:n}}}},gn=e=>{const{schemeId:n,branchId:t=null}=e||{};if(!n||"string"!=typeof n)throw new Error("Invalid or missing schemeId: scheme Id must be a string");if(!t||"string"!=typeof t)throw new Error("Invalid or missing branchId: branch Id must be a string");return async e=>{const i=e?.getClient({apiVersion:"2023-01-01"});if(!i)throw new Error("Client not available");const{concepts:o}=await i.fetch('{ \n "concepts": *[\n _id in *[_type=="skosConceptScheme" && schemeId == $schemeId].concepts[]._ref\n && ($branchId in broader[]->conceptId\n || $branchId in broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->broader[]->broader[]->conceptId)\n ]._id\n }',{schemeId:n,branchId:t});return{filter:"_id in $concepts",params:{concepts:o,schemeId:n,branchId:t}}}};var yn=[l({name:"baseIri",title:"Base URI",type:"url",validation:e=>e.required().error("Please supply a base URI in the format 'http://example.com/'"),description:/* @__PURE__ */N(ze,{children:[
254
+ return T("svg",{"data-sanity-icon":!0,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:/* @__PURE__ */T("path",{d:"M5.5 6.5V5.9H4.9V6.5H5.5ZM11.5 6.5H12.1V5.9H11.5V6.5ZM5.5 9H4.9V9.6H5.5V9ZM11.5 9V9.6H12.1V9H11.5ZM13.5 11V10.4H12.9V11H13.5ZM19.5 11H20.1V10.4H19.5V11ZM13.5 13.5H12.9V14.1H13.5V13.5ZM19.5 13.5V14.1H20.1V13.5H19.5ZM13.5 16V15.4H12.9V16H13.5ZM19.5 16H20.1V15.4H19.5V16ZM13.5 18.5H12.9V19.1H13.5V18.5ZM19.5 18.5V19.1H20.1V18.5H19.5ZM5.5 7.1H11.5V5.9H5.5V7.1ZM6.1 9V6.5H4.9V9H6.1ZM11.5 8.4H5.5V9.6H11.5V8.4ZM10.9 6.5V9H12.1V6.5H10.9ZM13.5 11.6H19.5V10.4H13.5V11.6ZM14.1 13.5V11H12.9V13.5H14.1ZM19.5 12.9H13.5V14.1H19.5V12.9ZM18.9 11V13.5H20.1V11H18.9ZM13.5 16.6H19.5V15.4H13.5V16.6ZM14.1 18.5V16H12.9V18.5H14.1ZM19.5 17.9H13.5V19.1H19.5V17.9ZM18.9 16V18.5H20.1V16H18.9ZM8 17.85H13.5V16.65H8V17.85ZM8 12.85H13.5V11.65H8V12.85ZM7.9 9.5V17.85H9.1V9.5H7.9Z",fill:"currentColor"})})}const fn=e=>{const{schemeId:n}=e||{};if(!n||"string"!=typeof n)throw new Error("Invalid or missing schemeId: scheme Id must be a string");return async e=>{const t=e?.getClient({apiVersion:"2025-02-19"});if(!t)throw new Error("Client not available");const{concepts:i,topConcepts:r}=await t.fetch(`{\n "concepts": *[_type=="skosConceptScheme" && schemeId == "${n}"].concepts[]._ref,\n "topConcepts": *[_type=="skosConceptScheme" && schemeId == "${n}"].topConcepts[]._ref\n }`);return{filter:"(_id in $concepts\n || _id in $topConcepts)",params:{concepts:i,topConcepts:r,schemeId:n}}}},gn=e=>{const{schemeId:n,branchId:t=null}=e||{};if(!n||"string"!=typeof n)throw new Error("Invalid or missing schemeId: scheme Id must be a string");if(!t||"string"!=typeof t)throw new Error("Invalid or missing branchId: branch Id must be a string");return async e=>{const i=e?.getClient({apiVersion:"2023-01-01"});if(!i)throw new Error("Client not available");const{concepts:r}=await i.fetch('{ \n "concepts": *[\n _id in *[_type=="skosConceptScheme" && schemeId == $schemeId].concepts[]._ref\n && ($branchId in broader[]->conceptId\n || $branchId in broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->broader[]->broader[]->conceptId)\n ]._id\n }',{schemeId:n,branchId:t});return{filter:"_id in $concepts",params:{concepts:r,schemeId:n,branchId:t}}}};var yn=[l({name:"baseIri",title:"Base URI",type:"url",validation:e=>e.required().error("Please supply a base URI in the format 'http://example.com/'"),description:/* @__PURE__ */N(ze,{children:[
255
255
  /* @__PURE__ */T("summary",{children:"The root URI (Uniform Resource Identifier) used to create unique concept identifiers."}),
256
256
  /* @__PURE__ */N("div",{children:["Unique identifiers allow for the clear an unambiguous identification of concepts across namespaces, for example between ",
257
257
  /* @__PURE__ */T("code",{children:"https://shipparts.com/vocab#Bow"})," and ",
@@ -281,12 +281,12 @@ return N(O,{space:2,children:[n.renderDefault(n),
281
281
  /* @__PURE__ */N("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),l({name:"altLabel",title:"Alternate Label(s)",type:"array",description:/* @__PURE__ */N(ze,{children:[
282
282
  /* @__PURE__ */T("summary",{children:"Synonyms, near-synonyms, abbreviations, and acronyms to a concept."}),
283
283
  /* @__PURE__ */T("div",{children:/* @__PURE__ */N("p",{children:[
284
- /* @__PURE__ */T(re,{})," Preferred, alternative, and hidden label sets must not overlap."]})})]}),of:[{type:"string"}],validation:e=>e.unique()}),l({name:"hiddenLabel",title:"Hidden Label(s)",type:"array",description:/* @__PURE__ */N(ze,{children:[
284
+ /* @__PURE__ */T(oe,{})," Preferred, alternative, and hidden label sets must not overlap."]})})]}),of:[{type:"string"}],validation:e=>e.unique()}),l({name:"hiddenLabel",title:"Hidden Label(s)",type:"array",description:/* @__PURE__ */N(ze,{children:[
285
285
  /* @__PURE__ */T("summary",{children:"Character strings that need to be accessible to applications performing text-based indexing and search operations, but which should not be displayed to end users."}),
286
286
  /* @__PURE__ */N("div",{children:[
287
287
  /* @__PURE__ */T("p",{children:"Hidden labels may for instance be used to include misspelled variants of other lexical labels."}),
288
288
  /* @__PURE__ */N("p",{children:[
289
- /* @__PURE__ */T(re,{})," Preferred, alternative, and hidden label sets must not overlap."]})]})]}),of:[{type:"string"}],validation:e=>e.unique()}),...yn,l({name:"conceptId",title:"Identifier",description:"This concept does not yet have a unique identifier.",type:"string",initialValue:()=>`${ae(6)}`,hidden:({document:e})=>!!e?.conceptId,readOnly:({document:e})=>!!e?.conceptId,components:{input:ue}}),l({name:"broader",title:"Broader Concept(s)",description:/* @__PURE__ */N(ze,{children:[
289
+ /* @__PURE__ */T(oe,{})," Preferred, alternative, and hidden label sets must not overlap."]})]})]}),of:[{type:"string"}],validation:e=>e.unique()}),...yn,l({name:"conceptId",title:"Identifier",description:"This concept does not yet have a unique identifier.",type:"string",initialValue:()=>`${ae(6)}`,hidden:({document:e})=>!!e?.conceptId,readOnly:({document:e})=>!!e?.conceptId,components:{input:ue}}),l({name:"broader",title:"Broader Concept(s)",description:/* @__PURE__ */N(ze,{children:[
290
290
  /* @__PURE__ */T("summary",{children:"Create hierarchy between concepts, for example to create category/subcategory, part/whole, or class/instance relationships."}),
291
291
  /* @__PURE__ */T("div",{children:/* @__PURE__ */T("p",{children:"Broader and Associated relationships are mutually exclusive."})})]}),type:"array",of:[{type:"reference",to:{type:"skosConcept"},options:{filter:bn}}]}),l({name:"related",title:"Related Concept(s)",description:/* @__PURE__ */N(ze,{children:[
292
292
  /* @__PURE__ */T("summary",{children:'Indicate that two concepts are inherently "related", but that one is not in any way more general than the other.'}),