```ts
export function parseSpan(text: string): number {
  if (typeof text !== 'string' || !text.trim()) throw new Error('Invalid span text');
  
  const parts = text.split(/\s+/);
  const unitMap: { [key: string]: number } = { yd: 36 * 12, ft: 12, in: 1 };
  let totalInches = 0;
  let lastUnit: string | null = null;

  for (const part of parts) {
    const match = part.match(/(\d+) *(yd|ft|in)?/);
    if (!match) throw new Error('Invalid span text');

    const value = parseInt(match[1], 10);
    if (!Number.isInteger(value) || value < 0 || (value === 0 && match[2])) throw new Error('Invalid span text');
    const unit = match[2] || 'in';

    if (unitMap[unit] === undefined || (lastUnit !== null && unitMap[unit] <= unitMap[lastUnit])) throw new Error('Invalid span text');

    totalInches += value * unitMap[unit];
    lastUnit = unit;
  }

  return totalInches;
}

export function formatSpan(inches: number): string {
  if (!Number.isInteger(inches) || inches < 0) throw new Error('Invalid inches value');

  const yards = Math.floor(inches / (36 * 12));
  inches -= yards * 36 * 12;

  const feet = Math.floor(inches / 12);
  inches -= feet * 12;

  let result = '';
  if (yards > 0) result += `${yards}yd `;
  if (feet > 0) result += `${feet}ft `;
  if (inches > 0 || result === '') result += `${inches}in`;

  return result.trim();
}

export function addSpans(first: string, second: string): string {
  return formatSpan(parseSpan(first) + parseSpan(second));
}
```