#!/usr/bin/env python3
"""Look for password-requirement hint text / aria-describedby / placeholder /
maxlength / pattern attributes on the change-password fields. Non-secret."""
import sys, json
sys.path.insert(0, "/home/claude/repos/openclaw/.claude/skills/advancedmd/scripts")
import amd_browser as A
t = A.find_target(url_sub="curogram.com")
pg = A.attach(t); pg.enable()
info = pg.eval(
  "JSON.stringify([...document.querySelectorAll('input[type=password]')].map(p=>({"
  "ph:p.placeholder,maxlength:p.getAttribute('maxlength'),minlength:p.getAttribute('minlength'),"
  "pattern:p.getAttribute('pattern'),required:p.required,"
  "describedby:p.getAttribute('aria-describedby'),"
  "ariaLabel:p.getAttribute('aria-label')})))"
)
print("FIELDS:", info)
# Any visible text that mentions password rules (numbers/length/special)
hints = pg.eval(
  "JSON.stringify([...document.querySelectorAll('p,span,small,div,label')]"
  ".map(e=>(e.innerText||'').trim()).filter(x=>x && /char|least|number|upper|lower|special|symbol|length|strong|digit|must/i.test(x)).slice(0,12))"
)
print("HINTS:", hints)
pg.close()
