import{LitElement as e,html as t,css as r}from"../../lit/index.js";import{SchemaBehaviors as o}from"../schema-behaviors/schema-behaviors.js";import{OERSchema as i}from"./lib/oerschema.js";class OerSchemaElement extends(o(e)){static get styles(){return[r`
        :host {
          display: inline-block;
        }
      `]}render(){return t`
      <span property="oer:${this.oerProperty}">
        <slot></slot> ${this.text}
      </span>
    `}static get tag(){return"oer-schema"}constructor(){super(),this.text="",this.oerProperty="name",this.typeof="Resource"}updated(e){super.updated&&super.updated(e),e.forEach(((e,t)=>{"relatedResource"==t&&(this._OERLink=this._generateforComponentLink(this.relatedResource))}))}static get properties(){return{...super.properties,text:{type:String},oerProperty:{type:String,attribute:"oer-property"},typeof:{type:String},relatedResource:{type:String,attribute:"related-resource"}}}static get haxProperties(){return{canScale:!1,canEditSource:!0,gizmo:{title:"Schema",description:"Schematized element area",icon:"hax:oerschema",color:"blue",tags:["Other","developer","Instructional","pedagogical","SEO","Search engine"],handles:[],meta:{author:"HAXTheWeb core team",inlineOnly:!0}},settings:{configure:[{slot:"",title:"Text",inputMethod:"textfield",icon:"editor:title"},{property:"typeof",title:"Schema typeof",inputMethod:"select",allowNull:!0,options:(new i).types},{property:"oerProperty",title:"Schema property",description:"The OER Schema property this represents",inputMethod:"select",allowNull:!0,options:{name:"name",additionalType:"additionalType",description:"description",image:"image",mainEntityOfPage:"mainEntityOfPage",sameAs:"sameAs",uri:"uri"}},{property:"relatedResource",title:"Related resource",description:"A reference to the related Schema resource",inputMethod:"textfield",icon:"editor:title"}],advanced:[]},saveOptions:{unsetAttributes:["_oerlink"]}}}_generateforComponentLink(e){if(globalThis.document&&globalThis.document.head){this._OERLink&&globalThis.document.head.removeChild(this._OERLink);let e=globalThis.document.createElement("link");return e.setAttribute("property","oer:forComponent"),e.setAttribute("content",this.relatedResource),globalThis.document.head.appendChild(e),e}}}customElements.define(OerSchemaElement.tag,OerSchemaElement);export{OerSchemaElement};