text: /**
   * Extend the basic ItemSheet with some very simple modifications
   * @extends {ItemSheet}
   */
  export class babylon5rpgPlanetSheet extends ItemSheet {
    /** @override */
    static get defaultOptions() {
      return mergeObject(super.defaultOptions, {
        classes: ['babylon5rpg', 'sheet', 'item', 'planet-system'],
        width: 710,
        height: 665,
        tabs: [{ navSelector: '.sheet-tabs', contentSelector: '.sheet-body', initial: 'details' }],
      });
    }
  
    /** @override */
    get template() {
      const path = 'systems/babylon5rpg/templates/item';
      // Return a single sheet for all item types.
      return `${path}/planet-system-sheet.html`;
      // Alternatively, you could use the following return statement to do a
      // unique item sheet by type, like `weapon-sheet.html`.
  
      // return `${path}/${this.item.data.type}-sheet.html`;
    }
  
    /* -------------------------------------------- */
  
    /** @override */
    getData() {
      const data = super.getData();
      // console.warn('get data', data);
      return data;
    }
  
    /* -------------------------------------------- */
  
    // /** @override */
    // setPosition(options = {}) {
    //   const position = super.setPosition(options);
    //   const sheetBody = this.element.find('.sheet-body');
    //   const bodyHeight = position.height - 192;
    //   sheetBody.css('height', bodyHeight);
    //   return position;
    // }
  
    /* -------------------------------------------- */
  
    /** @override */
    activateListeners(html) {
      super.activateListeners(html);
  
      // Everything below here is only needed if the sheet is editable
      if (!this.options.editable) return;
  
      // Roll handlers, click handlers, etc. would go here.
      html.find('.currency').on('change', this._currencyField.bind(this));
    }
  
    _currencyField(event) {
      event.preventDefault();
      const element = event.currentTarget;
  
      // console.warn(element.dataset);
  
      const currency = 'USD'; // https://www.currency-iso.org/dam/downloads/lists/list_one.xml
  
      // format inital value
      onBlur({ target: event.currentTarget });
  
      function localStringToNumber(s) {
        return Number(String(s).replace(/[^0-9.-]+/g, ''));
      }
  
      function onBlur(e) {
        // console.warn('onblur');
        let value = e.target.value;
  
        let options = {
          maximumFractionDigits: 2,
          currency: currency,
          style: 'currency',
          currencyDisplay: 'symbol',
        };
        e.target.value = value ? localStringToNumber(value).toLocaleString(undefined, options) : '';
        // console.warn(e.target.value);
      }
    }
  }
  