deepsky-core 1.86.0 → 1.89.2
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.
- package/dist/chunk/3837-18c422270456d7d0252a.js +1 -0
- package/dist/index.css +81 -72
- package/dist/index.d.ts +79 -48
- package/dist/index.js +1 -1
- package/package.json +65 -64
- package/dist/chunk/3837-5c6eef65d3ff33959f4f.js +0 -1
- /package/dist/chunk/{1037-5c6eef65d3ff33959f4f.js → 1037-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1066-5c6eef65d3ff33959f4f.js → 1066-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1216-5c6eef65d3ff33959f4f.js → 1216-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1230-5c6eef65d3ff33959f4f.js → 1230-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1425-5c6eef65d3ff33959f4f.js → 1425-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1432-5c6eef65d3ff33959f4f.js → 1432-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1476-5c6eef65d3ff33959f4f.js → 1476-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1545-5c6eef65d3ff33959f4f.js → 1545-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{16-5c6eef65d3ff33959f4f.js → 16-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1624-5c6eef65d3ff33959f4f.js → 1624-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1631-5c6eef65d3ff33959f4f.js → 1631-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1655-5c6eef65d3ff33959f4f.js → 1655-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1708-5c6eef65d3ff33959f4f.js → 1708-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{172-5c6eef65d3ff33959f4f.js → 172-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1729-5c6eef65d3ff33959f4f.js → 1729-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1757-5c6eef65d3ff33959f4f.js → 1757-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1803-5c6eef65d3ff33959f4f.js → 1803-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1839-5c6eef65d3ff33959f4f.js → 1839-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1857-5c6eef65d3ff33959f4f.js → 1857-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{1931-5c6eef65d3ff33959f4f.js → 1931-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2062-5c6eef65d3ff33959f4f.js → 2062-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2068-5c6eef65d3ff33959f4f.js → 2068-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2071-5c6eef65d3ff33959f4f.js → 2071-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2108-5c6eef65d3ff33959f4f.js → 2108-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{212-5c6eef65d3ff33959f4f.js → 212-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2142-5c6eef65d3ff33959f4f.js → 2142-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2173-5c6eef65d3ff33959f4f.js → 2173-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2184-5c6eef65d3ff33959f4f.js → 2184-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2215-5c6eef65d3ff33959f4f.js → 2215-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{224-5c6eef65d3ff33959f4f.js → 224-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2266-5c6eef65d3ff33959f4f.js → 2266-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2354-5c6eef65d3ff33959f4f.js → 2354-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2419-5c6eef65d3ff33959f4f.js → 2419-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{245-5c6eef65d3ff33959f4f.js → 245-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2473-5c6eef65d3ff33959f4f.js → 2473-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2492-5c6eef65d3ff33959f4f.js → 2492-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2505-5c6eef65d3ff33959f4f.js → 2505-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2535-5c6eef65d3ff33959f4f.js → 2535-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2660-5c6eef65d3ff33959f4f.js → 2660-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2691-5c6eef65d3ff33959f4f.js → 2691-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2723-5c6eef65d3ff33959f4f.js → 2723-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{284-5c6eef65d3ff33959f4f.js → 284-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2860-5c6eef65d3ff33959f4f.js → 2860-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2861-5c6eef65d3ff33959f4f.js → 2861-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{2934-5c6eef65d3ff33959f4f.js → 2934-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3032-5c6eef65d3ff33959f4f.js → 3032-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3043-5c6eef65d3ff33959f4f.js → 3043-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3052-5c6eef65d3ff33959f4f.js → 3052-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3124-5c6eef65d3ff33959f4f.js → 3124-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3170-5c6eef65d3ff33959f4f.js → 3170-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{321-5c6eef65d3ff33959f4f.js → 321-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3227-5c6eef65d3ff33959f4f.js → 3227-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3247-5c6eef65d3ff33959f4f.js → 3247-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{327-5c6eef65d3ff33959f4f.js → 327-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3279-5c6eef65d3ff33959f4f.js → 3279-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3330-5c6eef65d3ff33959f4f.js → 3330-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3403-5c6eef65d3ff33959f4f.js → 3403-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3454-5c6eef65d3ff33959f4f.js → 3454-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3492-5c6eef65d3ff33959f4f.js → 3492-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3516-5c6eef65d3ff33959f4f.js → 3516-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3593-5c6eef65d3ff33959f4f.js → 3593-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3646-5c6eef65d3ff33959f4f.js → 3646-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3702-5c6eef65d3ff33959f4f.js → 3702-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3720-5c6eef65d3ff33959f4f.js → 3720-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3874-5c6eef65d3ff33959f4f.js → 3874-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3894-5c6eef65d3ff33959f4f.js → 3894-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3906-5c6eef65d3ff33959f4f.js → 3906-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3941-5c6eef65d3ff33959f4f.js → 3941-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3947-5c6eef65d3ff33959f4f.js → 3947-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3949-5c6eef65d3ff33959f4f.js → 3949-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{396-5c6eef65d3ff33959f4f.js → 396-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{3972-5c6eef65d3ff33959f4f.js → 3972-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4007-5c6eef65d3ff33959f4f.js → 4007-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4009-5c6eef65d3ff33959f4f.js → 4009-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{402-5c6eef65d3ff33959f4f.js → 402-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4081-5c6eef65d3ff33959f4f.js → 4081-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{41-5c6eef65d3ff33959f4f.js → 41-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4108-5c6eef65d3ff33959f4f.js → 4108-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4112-5c6eef65d3ff33959f4f.js → 4112-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{415-5c6eef65d3ff33959f4f.js → 415-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4199-5c6eef65d3ff33959f4f.js → 4199-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4214-5c6eef65d3ff33959f4f.js → 4214-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4236-5c6eef65d3ff33959f4f.js → 4236-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4283-5c6eef65d3ff33959f4f.js → 4283-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4292-5c6eef65d3ff33959f4f.js → 4292-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4311-5c6eef65d3ff33959f4f.js → 4311-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4354-5c6eef65d3ff33959f4f.js → 4354-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4385-5c6eef65d3ff33959f4f.js → 4385-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4408-5c6eef65d3ff33959f4f.js → 4408-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4445-5c6eef65d3ff33959f4f.js → 4445-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4451-5c6eef65d3ff33959f4f.js → 4451-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4452-5c6eef65d3ff33959f4f.js → 4452-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4465-5c6eef65d3ff33959f4f.js → 4465-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4520-5c6eef65d3ff33959f4f.js → 4520-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{454-5c6eef65d3ff33959f4f.js → 454-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4546-5c6eef65d3ff33959f4f.js → 4546-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4552-5c6eef65d3ff33959f4f.js → 4552-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4598-5c6eef65d3ff33959f4f.js → 4598-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4614-5c6eef65d3ff33959f4f.js → 4614-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4660-5c6eef65d3ff33959f4f.js → 4660-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4697-5c6eef65d3ff33959f4f.js → 4697-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4709-5c6eef65d3ff33959f4f.js → 4709-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4714-5c6eef65d3ff33959f4f.js → 4714-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4780-5c6eef65d3ff33959f4f.js → 4780-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4838-5c6eef65d3ff33959f4f.js → 4838-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4843-5c6eef65d3ff33959f4f.js → 4843-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4862-5c6eef65d3ff33959f4f.js → 4862-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4877-5c6eef65d3ff33959f4f.js → 4877-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4886-5c6eef65d3ff33959f4f.js → 4886-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{489-5c6eef65d3ff33959f4f.js → 489-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4914-5c6eef65d3ff33959f4f.js → 4914-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4940-5c6eef65d3ff33959f4f.js → 4940-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{4962-5c6eef65d3ff33959f4f.js → 4962-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5026-5c6eef65d3ff33959f4f.js → 5026-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5034-5c6eef65d3ff33959f4f.js → 5034-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5050-5c6eef65d3ff33959f4f.js → 5050-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5099-5c6eef65d3ff33959f4f.js → 5099-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5119-5c6eef65d3ff33959f4f.js → 5119-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5141-5c6eef65d3ff33959f4f.js → 5141-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5143-5c6eef65d3ff33959f4f.js → 5143-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5177-5c6eef65d3ff33959f4f.js → 5177-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5203-5c6eef65d3ff33959f4f.js → 5203-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5283-5c6eef65d3ff33959f4f.js → 5283-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5314-5c6eef65d3ff33959f4f.js → 5314-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{535-5c6eef65d3ff33959f4f.js → 535-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5363-5c6eef65d3ff33959f4f.js → 5363-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{542-5c6eef65d3ff33959f4f.js → 542-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5424-5c6eef65d3ff33959f4f.js → 5424-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5443-5c6eef65d3ff33959f4f.js → 5443-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5521-5c6eef65d3ff33959f4f.js → 5521-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5536-5c6eef65d3ff33959f4f.js → 5536-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5542-5c6eef65d3ff33959f4f.js → 5542-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5585-5c6eef65d3ff33959f4f.js → 5585-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5589-5c6eef65d3ff33959f4f.js → 5589-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5601-5c6eef65d3ff33959f4f.js → 5601-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5611-5c6eef65d3ff33959f4f.js → 5611-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5628-5c6eef65d3ff33959f4f.js → 5628-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5638-5c6eef65d3ff33959f4f.js → 5638-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5647-5c6eef65d3ff33959f4f.js → 5647-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5709-5c6eef65d3ff33959f4f.js → 5709-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5728-5c6eef65d3ff33959f4f.js → 5728-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5731-5c6eef65d3ff33959f4f.js → 5731-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5744-5c6eef65d3ff33959f4f.js → 5744-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5814-5c6eef65d3ff33959f4f.js → 5814-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5827-5c6eef65d3ff33959f4f.js → 5827-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5884-5c6eef65d3ff33959f4f.js → 5884-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5891-5c6eef65d3ff33959f4f.js → 5891-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5936-5c6eef65d3ff33959f4f.js → 5936-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{5954-5c6eef65d3ff33959f4f.js → 5954-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6010-5c6eef65d3ff33959f4f.js → 6010-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6045-5c6eef65d3ff33959f4f.js → 6045-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6083-5c6eef65d3ff33959f4f.js → 6083-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6124-5c6eef65d3ff33959f4f.js → 6124-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6173-5c6eef65d3ff33959f4f.js → 6173-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6239-5c6eef65d3ff33959f4f.js → 6239-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6262-5c6eef65d3ff33959f4f.js → 6262-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6283-5c6eef65d3ff33959f4f.js → 6283-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6297-5c6eef65d3ff33959f4f.js → 6297-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6324-5c6eef65d3ff33959f4f.js → 6324-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6343-5c6eef65d3ff33959f4f.js → 6343-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6356-5c6eef65d3ff33959f4f.js → 6356-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{638-5c6eef65d3ff33959f4f.js → 638-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6405-5c6eef65d3ff33959f4f.js → 6405-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6514-5c6eef65d3ff33959f4f.js → 6514-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6517-5c6eef65d3ff33959f4f.js → 6517-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6563-5c6eef65d3ff33959f4f.js → 6563-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6577-5c6eef65d3ff33959f4f.js → 6577-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6677-5c6eef65d3ff33959f4f.js → 6677-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6736-5c6eef65d3ff33959f4f.js → 6736-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6757-5c6eef65d3ff33959f4f.js → 6757-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6865-5c6eef65d3ff33959f4f.js → 6865-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6940-5c6eef65d3ff33959f4f.js → 6940-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6957-5c6eef65d3ff33959f4f.js → 6957-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6964-5c6eef65d3ff33959f4f.js → 6964-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6967-5c6eef65d3ff33959f4f.js → 6967-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{697-5c6eef65d3ff33959f4f.js → 697-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{6980-5c6eef65d3ff33959f4f.js → 6980-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7095-5c6eef65d3ff33959f4f.js → 7095-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7141-5c6eef65d3ff33959f4f.js → 7141-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7145-5c6eef65d3ff33959f4f.js → 7145-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7148-5c6eef65d3ff33959f4f.js → 7148-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7217-5c6eef65d3ff33959f4f.js → 7217-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7258-5c6eef65d3ff33959f4f.js → 7258-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7328-5c6eef65d3ff33959f4f.js → 7328-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7374-5c6eef65d3ff33959f4f.js → 7374-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7434-5c6eef65d3ff33959f4f.js → 7434-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7470-5c6eef65d3ff33959f4f.js → 7470-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7504-5c6eef65d3ff33959f4f.js → 7504-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{753-5c6eef65d3ff33959f4f.js → 753-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7549-5c6eef65d3ff33959f4f.js → 7549-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7561-5c6eef65d3ff33959f4f.js → 7561-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7567-5c6eef65d3ff33959f4f.js → 7567-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7611-5c6eef65d3ff33959f4f.js → 7611-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7615-5c6eef65d3ff33959f4f.js → 7615-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7625-5c6eef65d3ff33959f4f.js → 7625-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7642-5c6eef65d3ff33959f4f.js → 7642-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7670-5c6eef65d3ff33959f4f.js → 7670-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7681-5c6eef65d3ff33959f4f.js → 7681-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7688-5c6eef65d3ff33959f4f.js → 7688-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7765-5c6eef65d3ff33959f4f.js → 7765-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7768-5c6eef65d3ff33959f4f.js → 7768-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7788-5c6eef65d3ff33959f4f.js → 7788-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7789-5c6eef65d3ff33959f4f.js → 7789-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{780-5c6eef65d3ff33959f4f.js → 780-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7817-5c6eef65d3ff33959f4f.js → 7817-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7824-5c6eef65d3ff33959f4f.js → 7824-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7831-5c6eef65d3ff33959f4f.js → 7831-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7900-5c6eef65d3ff33959f4f.js → 7900-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7922-5c6eef65d3ff33959f4f.js → 7922-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7927-5c6eef65d3ff33959f4f.js → 7927-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{794-5c6eef65d3ff33959f4f.js → 794-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{7966-5c6eef65d3ff33959f4f.js → 7966-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8003-5c6eef65d3ff33959f4f.js → 8003-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8093-5c6eef65d3ff33959f4f.js → 8093-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8107-5c6eef65d3ff33959f4f.js → 8107-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8201-5c6eef65d3ff33959f4f.js → 8201-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8212-5c6eef65d3ff33959f4f.js → 8212-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8234-5c6eef65d3ff33959f4f.js → 8234-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8235-5c6eef65d3ff33959f4f.js → 8235-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8237-5c6eef65d3ff33959f4f.js → 8237-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8249-5c6eef65d3ff33959f4f.js → 8249-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8320-5c6eef65d3ff33959f4f.js → 8320-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8389-5c6eef65d3ff33959f4f.js → 8389-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8393-5c6eef65d3ff33959f4f.js → 8393-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8418-5c6eef65d3ff33959f4f.js → 8418-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8426-5c6eef65d3ff33959f4f.js → 8426-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8436-5c6eef65d3ff33959f4f.js → 8436-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{845-5c6eef65d3ff33959f4f.js → 845-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8485-5c6eef65d3ff33959f4f.js → 8485-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8499-5c6eef65d3ff33959f4f.js → 8499-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8553-5c6eef65d3ff33959f4f.js → 8553-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8617-5c6eef65d3ff33959f4f.js → 8617-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8684-5c6eef65d3ff33959f4f.js → 8684-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8700-5c6eef65d3ff33959f4f.js → 8700-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8709-5c6eef65d3ff33959f4f.js → 8709-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8711-5c6eef65d3ff33959f4f.js → 8711-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{874-5c6eef65d3ff33959f4f.js → 874-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8753-5c6eef65d3ff33959f4f.js → 8753-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8849-5c6eef65d3ff33959f4f.js → 8849-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{8931-5c6eef65d3ff33959f4f.js → 8931-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9017-5c6eef65d3ff33959f4f.js → 9017-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9045-5c6eef65d3ff33959f4f.js → 9045-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9057-5c6eef65d3ff33959f4f.js → 9057-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9077-5c6eef65d3ff33959f4f.js → 9077-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9079-5c6eef65d3ff33959f4f.js → 9079-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9096-5c6eef65d3ff33959f4f.js → 9096-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9104-5c6eef65d3ff33959f4f.js → 9104-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{914-5c6eef65d3ff33959f4f.js → 914-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9175-5c6eef65d3ff33959f4f.js → 9175-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9179-5c6eef65d3ff33959f4f.js → 9179-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9198-5c6eef65d3ff33959f4f.js → 9198-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9206-5c6eef65d3ff33959f4f.js → 9206-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9225-5c6eef65d3ff33959f4f.js → 9225-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9270-5c6eef65d3ff33959f4f.js → 9270-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9281-5c6eef65d3ff33959f4f.js → 9281-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9294-5c6eef65d3ff33959f4f.js → 9294-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9478-5c6eef65d3ff33959f4f.js → 9478-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9524-5c6eef65d3ff33959f4f.js → 9524-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9526-5c6eef65d3ff33959f4f.js → 9526-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9556-5c6eef65d3ff33959f4f.js → 9556-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9641-5c6eef65d3ff33959f4f.js → 9641-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9661-5c6eef65d3ff33959f4f.js → 9661-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9681-5c6eef65d3ff33959f4f.js → 9681-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9689-5c6eef65d3ff33959f4f.js → 9689-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9692-5c6eef65d3ff33959f4f.js → 9692-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9728-5c6eef65d3ff33959f4f.js → 9728-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9730-5c6eef65d3ff33959f4f.js → 9730-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9780-5c6eef65d3ff33959f4f.js → 9780-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9788-5c6eef65d3ff33959f4f.js → 9788-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9806-5c6eef65d3ff33959f4f.js → 9806-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9809-5c6eef65d3ff33959f4f.js → 9809-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9819-5c6eef65d3ff33959f4f.js → 9819-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9831-5c6eef65d3ff33959f4f.js → 9831-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9845-5c6eef65d3ff33959f4f.js → 9845-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9876-5c6eef65d3ff33959f4f.js → 9876-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9904-5c6eef65d3ff33959f4f.js → 9904-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9910-5c6eef65d3ff33959f4f.js → 9910-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9965-5c6eef65d3ff33959f4f.js → 9965-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9976-5c6eef65d3ff33959f4f.js → 9976-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9982-5c6eef65d3ff33959f4f.js → 9982-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9983-5c6eef65d3ff33959f4f.js → 9983-18c422270456d7d0252a.js} +0 -0
- /package/dist/chunk/{9984-5c6eef65d3ff33959f4f.js → 9984-18c422270456d7d0252a.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deepsky=t():e.deepsky=t()}(self,()=>(()=>{var e,t,n={1068:e=>{var t;self,t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ArrayTools:()=>h,DateTime:()=>c,DomAnimation:()=>d,DragDiff:()=>f,DragList:()=>p,Iteration:()=>a,MathBase:()=>_,MathLine:()=>v,MathPoint:()=>b,MathPolygon:()=>y,MathRect:()=>g,Notice:()=>o,_RectPosition:()=>s});var n,i,r,s=function(e){return e.left_mid="left-mid",e.left_top="left-top",e.left_bottom="left-bottom",e.top_mid="top-mid",e.bottom_mid="bottom-mid",e.right_top="right-top",e.right_mid="right-mid",e.right_bottom="right_bottom",e.center="center",e}({});class o{static rope(e,t){return(...n)=>{let i=Symbol();return this.scope[e]=i,t(()=>i===this.scope[e],...n)}}static throttle(e,t=100){let n;return function(...i){n||(n=setTimeout(()=>{e(...i),n=void 0},t))}}static debounce(e,t=100){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}}r={},(i="scope")in(n=o)?Object.defineProperty(n,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[i]=r;class a{static*zip(...e){let t=e.map(e=>Array.isArray(e)?e:[e]),n=t.map(e=>e.length),i=Math.min(...n);for(let e=0;e<i;e++){let n=[];for(let i=0;i<t.length;i++)n.push(t[i][e]);yield n}}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c{static get_month_name(e){let t;return t=e||new Date,this.month_names[t.getMonth()]}static get_week_name(e){let t;return t=e||new Date,this.weeks_names[t.getDay()]}static get_date_string(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}static get_week_string(e){let t;t=e||new Date;const n=t.getDate(),i=t.getDay(),r=new Date(t.getFullYear(),t.getMonth(),n-i),s=new Date(t.getFullYear(),t.getMonth(),n+(6-i));return`${this.get_date_string(r)}:${this.get_date_string(s)}`}static get_week_days(e){const t=[];let n;n=e||new Date;const i=n.getFullYear(),r=n.getMonth(),s=n.getDate(),o=n.getDay(),a=new Date(i,r,s-o),l=a.getFullYear(),c=a.getMonth(),d=a.getDate();t.push(a);for(let e=1;e<=6;e++)t.push(new Date(l,c,d+e));return t}}l(c,"month_names",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),l(c,"weeks_names",["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);class d{static scroll_element(e,t,n="vertical"){let i=t;const r=()=>{if(Math.abs(i)>2){let t=i/10;i-=t,"vertical"===n?e.scrollTop+=t:e.scrollLeft+=t,requestAnimationFrame(r)}"vertical"===n?e.scrollTop+=i:e.scrollLeft+=i};r()}}class h{static swap(e,t,n){const i=e[t],r=e[n];e[t]=r,e[n]=i}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class p{init(){const e=this.order,t=new Set;this.order=[];for(let e=0;e<this.container.children.length;e++){const n=this.container.children[e],i=n.getAttribute(this.attr);i&&n instanceof HTMLElement&&(n.setAttribute("draggable","true"),n.style.position="absolute","horizental"===this.dir?n.style.left="0px":n.style.top="0px",this.order_origin.push(i),t.add(i),this.map.has(i)||this.register(n),this.map.set(i,n))}const n=this.init_container();this.container.addEventListener("dragenter",e=>{e.preventDefault()}),this.container.addEventListener("dragover",e=>{e.preventDefault()});for(let n of e)t.has(n)?(this.order.push(n),t.delete(n)):this.map.delete(n);for(let e of t)this.order.push(e);return this.sort(),n}sort(){for(let e=0;e<this.order.length;e++){const t=this.order[e],n=this.map.get(t);if(!n)continue;const i=this.sum_translate(this.order.slice(0,e));"horizental"===this.dir?n.style.transform=`translateX(${i}px)`:n.style.transform=`translateY(${i}px)`}for(let e of this.callback)e([...this.order])}init_container(){let e=0;for(const[t,n]of this.map)"horizental"===this.dir?e+=n.getBoundingClientRect().width/this.scale_h:e+=n.getBoundingClientRect().height/this.scale_v;return"horizental"===this.dir?this.container.style.width=e+"px":this.container.style.height=e+"px",e}sum_translate(e){let t=0;for(let n of e){const e=this.map.get(n);e&&("horizental"===this.dir?t+=e.getBoundingClientRect().width/this.scale_h:t+=e.getBoundingClientRect().height/this.scale_v)}return t}register(e){this._func_start=this.on_dragstart.bind(this),this._func_over=this.on_dragover.bind(this),this._func_enter=this.on_dragenter.bind(this),this._func_end=this.on_dragend.bind(this),e.addEventListener("dragstart",this._func_start,{capture:!0}),e.addEventListener("dragover",this._func_over,{capture:!0}),e.addEventListener("dragenter",this._func_enter,{capture:!0}),e.addEventListener("dragend",this._func_end,{capture:!0}),this.realtime||e.addEventListener("drop",this.on_drop.bind(this),{capture:!0})}on_dragstart(e){e.stopPropagation();const t=e.currentTarget;if(t instanceof HTMLElement&&(this.drag_id=t.getAttribute(this.attr),this.drag_id))for(let t of this.callback_start)t(e,this.drag_id);this.container.style.setProperty(this.css_var_point_events,"none")}on_dragenter(e){if(e.stopPropagation(),e.preventDefault(),!this.realtime)return;const t=e.currentTarget;if(e.target!==t)return;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),i=this.drag_id;if(!n||!i||n===i)return;const r=this.order.indexOf(n),s=this.order.indexOf(i);r<0||s<0||("swap"===this.effect?h.swap(this.order,r,s):(this.order.splice(s,1),this.order.splice(r,0,i)),this.init_container(),this.sort())}on_dragover(e){e.preventDefault(),e.stopPropagation()}on_drop(e){e.stopPropagation();const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),i=this.drag_id;if(!n||!i||n===i)return;const r=this.order.indexOf(n),s=this.order.indexOf(i);r<0||s<0||("swap"===this.effect?h.swap(this.order,r,s):(this.order.splice(s,1),this.order.splice(r,0,i)),this.sort())}on_dragend(e){this.container.style.setProperty(this.css_var_point_events,"auto");for(let t of this.callback_end)t(e)}register_start(e){this.callback_start.add(e)}register_dropend(e){this.callback_end.add(e)}register_callback(e){this.callback.add(e)}off_callback(e){this.callback.delete(e)}off_callback_start(e){this.callback_start.delete(e)}off_callback_drop(e){this.callback_end.delete(e)}constructor(e,t,n,i,r=!0){u(this,"container",void 0),u(this,"drag_id",void 0),u(this,"dir","vertical"),u(this,"effect",void 0),u(this,"attr",void 0),u(this,"realtime",!0),u(this,"order_origin",[]),u(this,"order",[]),u(this,"css_var_point_events","--drag-item-point-event"),u(this,"map",new Map),u(this,"callback",new Set),u(this,"callback_start",new Set),u(this,"callback_end",new Set),u(this,"scale_h",1),u(this,"scale_v",1),u(this,"_func_start",void 0),u(this,"_func_over",void 0),u(this,"_func_enter",void 0),u(this,"_func_end",void 0),u(this,"_callback_start",void 0),this.container=e,this.dir=t,this.attr=n,this.realtime=r,this.effect=i,e.style.position="relative"}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class f{get el(){return this._el}init(){this._handler_down=e=>this._pointdown(e),this._handler_move=e=>this._pointmove(e),this._handler_up=e=>this._pointup(e),this._handler_cancel=e=>this._pointercancel(e),this.el.addEventListener("pointerdown",this._handler_down),document.documentElement.addEventListener("pointermove",this._handler_move),document.documentElement.addEventListener("pointerup",this._handler_up),document.documentElement.addEventListener("pointercancel",this._handler_cancel)}_pointdown(e){e.stopPropagation(),e.preventDefault();const t=e.target;this.el.contains(t)&&(this._is_down=!0,this._down_point={x:e.clientX,y:e.clientY},this._func_down&&this._func_down())}_pointmove(e){if(!this._is_down||!this._down_point||e.buttons<=0)return;e.stopPropagation(),e.preventDefault(),this._is_move=!0;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._func_move&&this._func_move(t,n)}_pointup(e){if(e.preventDefault(),e.stopPropagation(),!this._is_down||!this._is_move)return;if(this._is_down=!1,this._is_move=!1,!this._down_point)return;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._down_point=void 0,this._func_up&&this._func_up(t,n)}_pointercancel(e){this._is_down&&this._is_move&&(this._is_down=!1,this._is_move=!1,this._down_point=void 0,this._func_cancel&&this._func_cancel())}off(){this.el.removeEventListener("pointerdown",this._handler_down),document.documentElement.removeEventListener("pointermove",this._handler_move),document.documentElement.removeEventListener("pointerup",this._handler_up),document.documentElement.removeEventListener("pointercancel",this._handler_cancel)}register_down(e){this._func_down=e}register_move(e){this._func_move=e}register_up(e){this._func_up=e}register_cancel(e){this._func_cancel=e}constructor(e){m(this,"_el",void 0),m(this,"_handler_down",void 0),m(this,"_handler_move",void 0),m(this,"_handler_up",void 0),m(this,"_handler_cancel",void 0),m(this,"_func_down",void 0),m(this,"_func_move",void 0),m(this,"_func_up",void 0),m(this,"_func_cancel",void 0),m(this,"_is_down",!1),m(this,"_is_move",!1),m(this,"_down_point",void 0),this._el=e,this.init()}}class _{static sum(e){let t=0;for(let n of e)t+=n;return t}}class g{static get_rect_point(e,t){const{x:n,y:i,width:r,height:o}=e,a=i+o,l=n+r,c=n+r/2,d=i+o/2;if(t===s.left_bottom)return{x:n,y:a};if(t===s.left_top)return{x:n,y:i};if(t===s.left_mid)return{x:n,y:d};if(t===s.right_top)return{x:l,y:i};if(t===s.right_mid)return{x:l,y:d};if(t===s.right_bottom)return{x:l,y:a};if(t===s.bottom_mid)return{x:c,y:a};if(t===s.top_mid)return{x:c,y:i};if(t===s.center)return{x:c,y:d};throw Error("MathRect: the position keyword is invalid")}static is_point_in_rect(e,t,n=!0){const i=e.x===t.x||e.x===t.x+t.width,r=e.y===t.y||e.y===t.y+t.height,s=e.x>t.x&&e.x<t.x+t.width,o=e.y>t.y&&e.y<t.y+t.height;return n?(s||i)&&(o||r):s&&o}static get_point_in_rects(e,t,n=!0){const i=[];for(let r of t)this.is_point_in_rect(e,r,n)&&i.push(r);return i}static get_point_center(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}static move_rect_to_other(e,t,n,i=5){const r={width:e.width,height:Math.abs(e.y-n.y)},s={width:e.width,height:Math.abs(e.height-(n.y+n.height))},o={width:Math.abs(n.x-e.x),height:e.height},a={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(g.can_include(s,t)){const r=t.width+n.x-e.width,s=n.y+n.height+i;return{x:r<0?n.x:n.x-r,y:s}}if(g.can_include(r,t)){const r=t.width+n.x-e.width,s=n.y-t.height-i;return{x:r<0?n.x:n.x-r,y:s}}if(g.can_include(o,t)){const r=n.y+t.height-e.height;return{x:n.x-t.width-i,y:r<0?n.y:n.y-r}}if(g.can_include(a,t)){const r=n.y+t.height-e.height;return{x:n.x+n.width+i,y:r<0?n.y:n.y-r}}if(g.can_include(e,t)){const i=e.y+e.height-t.height;let r=n.x;return a.width>=t.width?r=n.x+n.width:o.width>=t.width&&(r=n.x-t.width),{x:r,y:i}}return{x:n.x,y:0}}static move_rect_in_other(e,t){if(g.can_contain(t,e))return{dx:0,dy:0};let n=0,i=0;return e.x<t.x?n=t.x-e.x:e.x+e.width>t.x+t.width&&(n=t.x+t.width-(e.x+e.width)),e.y<t.y?i=t.y-e.y:e.y+e.height>t.y+t.height&&(i=t.y+t.height-(e.y+e.height)),{dx:n,dy:i}}static can_include(e,t){return t.width<=e.width&&t.height<=e.height}static can_contain(e,t){return!(!this.can_include(e,t)||t.x<e.x||t.x>e.x+e.width-t.width||t.y<e.y||t.y>e.y+e.height-t.height)}static check_intersection(e,t){const n=e.x+e.width/2,i=e.y+e.height/2,r=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-r),a=Math.abs(i-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}static limit_point_in_rect(e,t){const n=t.x,i=t.y,r=t.x+t.width,s=t.y+t.height;let o=e.x,a=e.y;return o<n&&(o=n),o>r&&(o=r),a<i&&(a=i),a>s&&(a=s),{x:o,y:a}}static point_distance_with_rect(e,t){if(this.is_point_in_rect(e,t,!0))return 0;const n=t.x+t.width/2,i=t.y+t.height/2,r=t.width/2,s=t.height/2,o=Math.abs(n-e.x),a=Math.abs(i-e.y);return o<=r&&a>s?a-s:a<=s&&o>r?o-r:Math.sqrt(Math.pow(o-r,2)+Math.pow(a-s,2))}static distance_with(e,t){const n=this.get_point_center(e),i=this.get_point_center(t),r=Math.abs(n.x-i.x),s=Math.abs(n.y-i.y),o=(e.width+t.width)/2,a=(e.height+t.height)/2;if(r<=o&&s<=a)return 0;if(r>o&&s<=a)return r-o;if(r<=o&&s>a)return s-a;{let e=Math.pow(r-o,2),t=Math.pow(s-a,2);return Math.sqrt(e+t)}}static get_nearest_rect(e,t){if(0===t.length)return;let n,i=Number.POSITIVE_INFINITY;for(let r of t){let t=this.point_distance_with_rect(e,r);t<i&&(i=t,n=r)}return n}static get_shadow_point_horizental(e,t){let n=t.x,i=t.y+t.height/2;return n=e.x<=t.x?t.x:e.x>=t.x+t.width?t.x+t.width:e.x,{x:n,y:i}}static merge(...e){const t=e[0];let n=t.x,i=t.x+t.width,r=t.y,s=t.y+t.height;for(let t of e.slice(1)){const{x:e,y:o,width:a,height:l}=t;e<n&&(n=e),e+a>i&&(i=e+a),o<r&&(r=o),o+l>s&&(s=o+l)}return{x:n,y:r,width:i-n,height:s-r}}}class b{static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],i=this.path.getTotalLength()/t;for(let e=0;e<t;e++){const t=e*i,r=this.path.getPointAtLength(t);n.push({x:r.x,y:r.y})}return n}static get_line_k(e,t,n=100){const i=t.y-e.y,r=t.x-e.x;return 0===r?Number.POSITIVE_INFINITY:i/r}static distance(e,t){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}static find_closet_point(e,t){let n=1/0,i=e[0];const{x:r,y:s}=t;for(let t of e){let e=Math.pow(r-t.x,2)+Math.pow(s-t.y,2);e<n&&(n=e,i=t)}return i}static offset_points(e,t){const n=[],{x:i,y:r}=t;for(let t of e)n.push({x:t.x+i,y:t.y+r});return n}static find_closest_points(e,t){let n=1/0,i=e[0],r=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,i=o,r=s)}}return{from:i,to:r}}}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(b,"path",document.createElementNS("http://www.w3.org/2000/svg","path"));class y{static polygon_center(e){let t=0,n=0,i=0;const r=e.length;for(let s=0;s<r;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%r],d=o*c-l*a;i+=d,t+=(o+l)*d,n+=(a+c)*d}return i*=.5,t/=6*i,n/=6*i,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let i=0;i<n;i++){const{x:r,y:s}=e[i],{x:o,y:a}=e[(i+1)%n];t+=r*a-o*s}return t/2}}class v{static check_intersection(e,t){const{from:n,to:i}=e,{from:r,to:s}=t;let o,a;if(o=n.x===i.x?Number.POSITIVE_INFINITY:(i.y-n.y)/(i.x-n.x),a=r.x===s.x?Number.POSITIVE_INFINITY:(s.y-r.y)/(s.x-r.x),o===a)return!1;const l=Math.min(n.x,i.x),c=Math.max(n.x,i.x),d=Math.min(n.y,i.y),h=Math.max(n.y,i.y),u=Math.min(r.x,s.x),p=Math.max(r.x,s.x),m=Math.min(r.y,s.y),f=Math.max(r.y,s.y);if(o===Number.POSITIVE_INFINITY){const e=n.x,t=a*(e-r.x)+r.y;return e>=l&&e<=c&&e>=u&&e<=p&&t>=d&&t<=h&&t>=m&&t<=f}if(a===Number.POSITIVE_INFINITY){const e=r.x,t=(i.y-n.y)/(i.x-n.x)*(e-n.x)+n.y;return e>=l&&e<=c&&e>=u&&e<=p&&t>=d&&t<=h&&t>=m&&t<=f}{const e=(r.y-n.y+o*n.x-a*r.x)/(o-a),t=o*(e-n.x)+n.y;return e>=l&&e<=c&&e>=u&&e<=p&&t>=d&&t<=h&&t>=m&&t<=f}}}return t})(),e.exports=t()},5856:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n}}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var s=i[e]={exports:{}};return n[e](s,s.exports,r),s.exports}r.m=n,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"chunk/"+e+"-"+r.h()+".js",r.miniCssF=e=>{},r.h=()=>"5c6eef65d3ff33959f4f",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="deepsky:",r.l=(n,i,s,o)=>{if(e[n])e[n].push(i);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var h=c[d];if(h.getAttribute("src")==n||h.getAttribute("data-webpack")==t+s){a=h;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",t+s),a.src=n),e[n]=[i];var u=(t,i)=>{a.onerror=a.onload=null,clearTimeout(p);var r=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(e=>e(i)),t)return t(i)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),l&&document.head.appendChild(a)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={3057:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var s=new Promise((n,r)=>i=e[t]=[n,r]);n.push(i[2]=s);var o=r.p+r.u(t),a=new Error;r.l(o,n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var s=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,i[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,s,[o,a,l]=n,c=0;if(o.some(t=>0!==e[t])){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);l&&l(r)}for(t&&t(n);c<o.length;c++)s=o[c],r.o(e,s)&&e[s]&&e[s][0](),e[s]=0},n=self.webpackChunkdeepsky=self.webpackChunkdeepsky||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s={};return(()=>{"use strict";r.r(s),r.d(s,{BoundBox:()=>Fc,CodeLanguageMap:()=>Xm,CommandApi:()=>Zc,CommandBoxFolder:()=>Tl,CommandBoxRoot:()=>fl,CommandCode:()=>Md,CommandCube:()=>ds,CommandCursor:()=>hs,CommandDetailList:()=>td,CommandFomula:()=>Qy,CommandLinker:()=>nc,CommandListOrdered:()=>yd,CommandMap:()=>fs,CommandNode:()=>ms,CommandRt:()=>Mv,CommandTable:()=>ev,CommandText:()=>Jo,CommandTextLink:()=>Go,CommandTodo:()=>ad,CubeAnnotation:()=>jo,CubeApi:()=>Qc,CubeBase:()=>_s,CubeBox:()=>kl,CubeBoxColumns:()=>Cv,CubeBoxFolder:()=>Al,CubeBoxRoot:()=>ml,CubeChild:()=>Es,CubeCode:()=>Qm,CubeDetailList:()=>od,CubeDoc:()=>_l,CubeFomula:()=>Zy,CubeHandler:()=>bs,CubeImg:()=>ko,CubeLine:()=>bl,CubeLinker:()=>Nc,CubeList:()=>bd,CubeListOrdered:()=>Cd,CubeLost:()=>Ao,CubeMap:()=>Vc,CubeNode:()=>Hc,CubePostil:()=>Ko,CubeRoot:()=>Ls,CubeRt:()=>Pv,CubeSubMap:()=>Pc,CubeTable:()=>fv,CubeText:()=>Zo,CubeTextLink:()=>Vo,CubeTip:()=>vv,CubeTodo:()=>pd,LinkerLine:()=>ec,LinkerPoint:()=>tc,MapBase:()=>Ds,MapInteraction:()=>mc,MapNodeBase:()=>js,MapTools:()=>es,Matrix2D:()=>Zr,NodeObserver:()=>Oc,NodeShape:()=>$c,NoteApi:()=>ns,NoteBase:()=>ts,NoteClipBoard:()=>Ps,NoteCourier:()=>Rs,NoteCubes:()=>xs,NoteCursor:()=>Os,NoteEvent:()=>As,NoteHistory:()=>ls,NoteHotkeys:()=>Ms,NoteIcons:()=>Ro,NoteListener:()=>ws,NoteManager:()=>rs,NotePainter:()=>Ts,NotePlayer:()=>as,NoteScope:()=>vs,NoteStats:()=>zs,NoteTools:()=>ss,Recorder:()=>cs,Waiter:()=>os,_ApiCommandNames:()=>p,_CodeCommandNames:()=>g,_CubeCommandName:()=>i,_CursorCommandName:()=>o,_DetaiListCommandName:()=>m,_DocCommandName:()=>d,_FomulaCommandNames:()=>v,_FomulaSize:()=>y,_HotKeys:()=>A,_HotKeysGroup:()=>T,_Keys:()=>N,_LinkerAnchor:()=>x,_LinkerCommandNames:()=>k,_ListCommandNames:()=>f,_ListOrderedCommandNames:()=>_,_MapCommandName:()=>a,_MapGroup:()=>h,_NavigationKey:()=>P,_NodeCommandName:()=>l,_NoteCores:()=>t,_NoteCubeTypes:()=>n,_NoteEvents:()=>M,_NoteMode:()=>z,_PlayStatus:()=>C,_RtCommandNames:()=>S,_TableCommandNames:()=>w,_TextCommandName:()=>c,_TextLinkCommandNames:()=>u,_TodoCommandNames:()=>b,cmd:()=>ys,key:()=>Cs,keymap:()=>Ss,node_observer:()=>Rc});var e={};r.r(e),r.d(e,{boolean:()=>ru,booleanish:()=>su,commaOrSpaceSeparated:()=>du,commaSeparated:()=>cu,number:()=>au,overloadedBoolean:()=>ou,spaceSeparated:()=>lu});var t=function(e){return e.courier="courier",e.cursor="cursor",e.config="config",e.cubes="cubes",e.clipboard="clipboard",e.event="event",e.fomula="fomula",e.painter="painter",e.player="player",e.hotkeys="hotkeys",e.history="history",e.scope="scope",e.stats="stats",e}({}),n=function(e){return e.api="api",e.annotation="annotation",e.box="box",e.box_root="box-root",e.box_folder="box-folder",e.box_columns="box-columns",e.code="code",e.doc="doc",e.detail_list="detail-list",e.fomula="fomula",e.img="img",e.lost="lost",e.line="line",e.list="list",e.list_ordered="list-ordered",e.linker="linker",e.link="link",e.map="map",e.submap="submap",e.node="node",e.postil="postil",e.rt="rt",e.text="text",e.tip="tip",e.todo="todo",e.table="table",e}({}),i=function(e){return e.cube_insert_child="cube-insert-child",e.cube_delete_child="cube-delete-child",e.cube_reset="cube-reset",e.cube_delete_adjacent="cube-delete-adjacent",e.cube_set_selection_css="cube-set-selection-css",e.cube_insert="cube-insert",e.cube_delete="cube-delete",e.cube_partition="cube-partition",e.cube_reorder="cube-reorder",e.cube_set_css="cube-set-css",e.cube_set_attr="cube-set-attr",e.cube_move="cube-move",e.cube_merge="cube-merge",e.cube_postil_add="cube-postil-add",e.cube_postil_remove="cube-postil-remove",e}({}),o=function(e){return e.cursor_in_head="cursor:in-head",e.cursor_in_tail="cursor:in-tail",e.loc="cursor:loc",e}({}),a=function(e){return e.node_add="node-add",e.node_remove="node-remove",e.linker_add="linker-add",e.linker_remove="linker-remove",e.update_attrs="update-attrs",e}({}),l=function(e){return e.layout_update="node:layout-update",e.append_child="node:append-child",e}({}),c=function(e){return e.text_reset="cube-text:text-reset",e.text_merge="cube-text:text-merge",e.text_break="cube-text:text-break",e}({}),d=function(){return{}}(),h=function(e){return e.markers="markers",e.nodes="nodes",e.linkers="linkers",e.placeholder="placeholder",e}({}),u=function(e){return e.update="text-link:update",e}({}),p=function(e){return e.reset="cube-api:reset",e}({}),m=function(e){return e.insert_row="cube-detail-list:insert-row",e.remove_row="cube-detail-list:remove-row",e.change_width_col1="cube-detail-list:change-width-col1",e}({}),f=function(e){return e.add="cube-list:add",e.remove="cube-list:remove",e.indent="cube-list:indent",e.reset="cube-list:reset",e.transform="cube-list:transform",e}({}),_=function(e){return e.add="cube-list-ordered:add",e.remove="cube-list-ordered:remove",e.indent="cube-list-ordered:indent",e.reset="cube-list-ordered:reset",e}({}),g=function(e){return e.change_lang="cube-code:change-lang",e.change_active="cube-code:change-active",e.change_theme="cube-code:change-theme",e.code_update="cube-code:update-code",e.code_add="cube-code:code-add",e.code_remove="cube-code:code-remove",e.code_rename="cube-code:code-rename",e}({}),b=function(e){return e.add="cube-todo:add",e.remove="cube-todo:remove",e.indent="cube-todo:indent",e.status="cube-todo:status",e.reset="cube-todo:reset",e}({}),y=function(e){return e.h1="\\Huge ",e.h2="\\huge ",e.h3="\\Large ",e.h4="\\normalsize ",e.h5="\\small ",e.h6="\\tiny ",e}({}),v=function(e){return e.update="cube-fomula:update",e}({}),w=function(e){return e.add_title="cube-table:add-title",e.remove_title="cube-table:remove-title",e.add_cell="cube-table:add-cell",e.remove_cell="cube-table:remove-cell",e.add_row="cube-table:add-row",e.remove_row="cube-table:remove-row",e.add_col="cube-table:add-col",e.remove_col="cube-table:remove-col",e.add_grid_col="cube-table:add-grid-col",e.remove_grid_col="cube-table:remove-grid-col",e.merge="cube-table:merge",e.moveto="cube-table:moveto",e.update_area="cube-table:update-area",e.reorder="cube-table:reorder",e.col_resize="cube-table:col-resize",e}({}),x=function(e){return e.arrow="marker-arrow",e.point="marker-point",e.square="marker-square",e.rhomb="marker-rhomb",e}({}),k=function(e){return e.update="linker:update",e}({}),S=function(e){return e.reset_explanation="cube-rt:reset-explanation",e}({}),C=function(e){return e.pending="pending",e.playing="playing",e.pause="pause",e.stop="stop",e}({}),M=function(e){return e["asset-save"]="note-event:asset-save",e["asset-download"]="note-event:asset-download",e["asset-copy"]="note-event:asset-copy",e.export="note-event:export",e["replace-id"]="note-event:replace-id",e["edit-before"]="note-event:edit-before",e["edit-after"]="note-event:edit-after",e["text-merge"]="note-event:text-merge",e.esc="note-event:esc",e["selection-change"]="note-event:selection-change",e["cursor-nav-before"]="note-event:cursor-nav-before",e["cursor-nav-after"]="note-event:cursor-nav-after",e["enter-before"]="note-event:enter-before",e["enter-after"]="note-event:enter-after",e["show-cube-editor"]="note-event:show-cube-editor",e["text-link-edit"]="note-event:text-link-edit",e["note-input-before"]="note-event:note-input-before",e["note-input-compositionend"]="note-event:note-input-compositionend",e["note-input-compositionend-before"]="note-event:note-input-compositionend-before",e["note-input-compositionupdate"]="note-event:note-input-compositionupdate",e["status-update"]="note-event:status-update",e["node-status-clicked"]="note-event:node-status-clicked",e["fig-click"]="note-event:fig-click",e}({}),z=function(e){return e.read="read",e.edit="edit",e.export="export",e}({}),A=function(e){return e["break-line"]="换行",e["cursor-nav"]="光标导航",e["cursor-nav-extend"]="光标复选",e["format-brush-apply"]="应用格式刷",e["format-brush-copy"]="复制格式刷",e.undo="撤销",e.redo="重做",e["indent-line"]="缩进",e["unindent-line"]="反向缩进",e["clear-css"]="重置样式",e["scope-clear"]="清空块选区",e["scope-add"]="添加块选区",e["root-add-next"]="向后添加根级块",e["root-add-prev"]="向前添加根级块",e["break-root"]="分裂根级块",e["break-text"]="文本块换行",e["fold-block"]="折叠所在块",e["text-add-annotation"]="添加批注",e["text-italic"]="斜体",e["text-bold"]="加粗",e["text-underline"]="下划线",e["text-align-left"]="左对齐",e["text-align-center"]="居中对齐",e["text-align-right"]="右对齐",e["text-partition"]="分裂文本块",e}({}),T=function(e){return e.core="核心",e.common="通用",e.text="文本块",e.block="块",e.scope="块选区",e.dict="字典",e.bookmark="书签",e.search="搜索",e.css="样式",e.float="面板",e.other="其他",e}({}),P=function(e){return e.left="arrowleft",e.right="arrowright",e.up="arrowup",e.down="arrowdown",e.end="end",e.home="home",e}({}),N=function(e){return e.enter="Enter",e}({});function O(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const R={},L=[],E=()=>{},D=()=>!1,I=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),B=e=>e.startsWith("onUpdate:"),j=Object.assign,q=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},H=Object.prototype.hasOwnProperty,F=(e,t)=>H.call(e,t),$=Array.isArray,G=e=>"[object Map]"===Q(e),V=e=>"[object Set]"===Q(e),U=e=>"function"==typeof e,W=e=>"string"==typeof e,Y=e=>"symbol"==typeof e,X=e=>null!==e&&"object"==typeof e,K=e=>(X(e)||U(e))&&U(e.then)&&U(e.catch),J=Object.prototype.toString,Q=e=>J.call(e),Z=e=>"[object Object]"===Q(e),ee=e=>W(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,te=O(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ne=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ie=/-\w/g,re=ne(e=>e.replace(ie,e=>e.slice(1).toUpperCase())),se=/\B([A-Z])/g,oe=ne(e=>e.replace(se,"-$1").toLowerCase()),ae=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),le=ne(e=>e?`on${ae(e)}`:""),ce=(e,t)=>!Object.is(e,t),de=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},he=(e,t,n,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},ue=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let pe;const me=()=>pe||(pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:{});function fe(e){if($(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],r=W(i)?ye(i):fe(i);if(r)for(const e in r)t[e]=r[e]}return t}if(W(e)||X(e))return e}const _e=/;(?![^(]*\))/g,ge=/:([^]+)/,be=/\/\*[^]*?\*\//g;function ye(e){const t={};return e.replace(be,"").split(_e).forEach(e=>{if(e){const n=e.split(ge);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ve(e){let t="";if(W(e))t=e;else if($(e))for(let n=0;n<e.length;n++){const i=ve(e[n]);i&&(t+=i+" ")}else if(X(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const we=O("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function xe(e){return!!e||""===e}const ke=e=>!(!e||!0!==e.__v_isRef),Se=e=>W(e)?e:null==e?"":$(e)||X(e)&&(e.toString===J||!U(e.toString))?ke(e)?Se(e.value):JSON.stringify(e,Ce,2):String(e),Ce=(e,t)=>ke(t)?Ce(e,t.value):G(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],i)=>(e[Me(t,i)+" =>"]=n,e),{})}:V(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Me(e))}:Y(t)?Me(t):!X(t)||$(t)||Z(t)?t:String(t),Me=(e,t="")=>{var n;return Y(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let ze,Ae;class Te{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ze,!e&&ze&&(this.index=(ze.scopes||(ze.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=ze;try{return ze=this,e()}finally{ze=t}}}on(){1===++this._on&&(this.prevScope=ze,ze=this)}off(){this._on>0&&0===--this._on&&(ze=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const Pe=new WeakSet;class Ne{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ze&&ze.active&&ze.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,Pe.has(this)&&(Pe.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||Ee(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,Ye(this),Be(this);const e=Ae,t=Ge;Ae=this,Ge=!0;try{return this.fn()}finally{je(this),Ae=e,Ge=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)Fe(e);this.deps=this.depsTail=void 0,Ye(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?Pe.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){qe(this)&&this.run()}get dirty(){return qe(this)}}let Oe,Re,Le=0;function Ee(e,t=!1){if(e.flags|=8,t)return e.next=Re,void(Re=e);e.next=Oe,Oe=e}function De(){Le++}function Ie(){if(--Le>0)return;if(Re){let e=Re;for(Re=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Oe;){let t=Oe;for(Oe=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function Be(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function je(e){let t,n=e.depsTail,i=n;for(;i;){const e=i.prevDep;-1===i.version?(i===n&&(n=e),Fe(i),$e(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=e}e.deps=t,e.depsTail=n}function qe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(He(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function He(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===Xe)return;if(e.globalVersion=Xe,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!qe(e)))return;e.flags|=2;const t=e.dep,n=Ae,i=Ge;Ae=e,Ge=!0;try{Be(e);const n=e.fn(e._value);(0===t.version||ce(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Ae=n,Ge=i,je(e),e.flags&=-3}}function Fe(e,t=!1){const{dep:n,prevSub:i,nextSub:r}=e;if(i&&(i.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Fe(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function $e(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ge=!0;const Ve=[];function Ue(){Ve.push(Ge),Ge=!1}function We(){const e=Ve.pop();Ge=void 0===e||e}function Ye(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=Ae;Ae=void 0;try{t()}finally{Ae=e}}}let Xe=0;class Ke{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Je{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Ae||!Ge||Ae===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==Ae)t=this.activeLink=new Ke(Ae,this),Ae.deps?(t.prevDep=Ae.depsTail,Ae.depsTail.nextDep=t,Ae.depsTail=t):Ae.deps=Ae.depsTail=t,Qe(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Ae.depsTail,t.nextDep=void 0,Ae.depsTail.nextDep=t,Ae.depsTail=t,Ae.deps===t&&(Ae.deps=e)}return t}trigger(e){this.version++,Xe++,this.notify(e)}notify(e){De();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Ie()}}}function Qe(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Qe(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ze=new WeakMap,et=Symbol(""),tt=Symbol(""),nt=Symbol("");function it(e,t,n){if(Ge&&Ae){let t=Ze.get(e);t||Ze.set(e,t=new Map);let i=t.get(n);i||(t.set(n,i=new Je),i.map=t,i.key=n),i.track()}}function rt(e,t,n,i,r,s){const o=Ze.get(e);if(!o)return void Xe++;const a=e=>{e&&e.trigger()};if(De(),"clear"===t)o.forEach(a);else{const r=$(e),s=r&&ee(n);if(r&&"length"===n){const e=Number(i);o.forEach((t,n)=>{("length"===n||n===nt||!Y(n)&&n>=e)&&a(t)})}else switch((void 0!==n||o.has(void 0))&&a(o.get(n)),s&&a(o.get(nt)),t){case"add":r?s&&a(o.get("length")):(a(o.get(et)),G(e)&&a(o.get(tt)));break;case"delete":r||(a(o.get(et)),G(e)&&a(o.get(tt)));break;case"set":G(e)&&a(o.get(et))}}Ie()}function st(e){const t=Ft(e);return t===e?t:(it(t,0,nt),qt(e)?t:t.map(Gt))}function ot(e){return it(e=Ft(e),0,nt),e}const at={__proto__:null,[Symbol.iterator](){return lt(this,Symbol.iterator,Gt)},concat(...e){return st(this).concat(...e.map(e=>$(e)?st(e):e))},entries(){return lt(this,"entries",e=>(e[1]=Gt(e[1]),e))},every(e,t){return dt(this,"every",e,t,void 0,arguments)},filter(e,t){return dt(this,"filter",e,t,e=>e.map(Gt),arguments)},find(e,t){return dt(this,"find",e,t,Gt,arguments)},findIndex(e,t){return dt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return dt(this,"findLast",e,t,Gt,arguments)},findLastIndex(e,t){return dt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return dt(this,"forEach",e,t,void 0,arguments)},includes(...e){return ut(this,"includes",e)},indexOf(...e){return ut(this,"indexOf",e)},join(e){return st(this).join(e)},lastIndexOf(...e){return ut(this,"lastIndexOf",e)},map(e,t){return dt(this,"map",e,t,void 0,arguments)},pop(){return pt(this,"pop")},push(...e){return pt(this,"push",e)},reduce(e,...t){return ht(this,"reduce",e,t)},reduceRight(e,...t){return ht(this,"reduceRight",e,t)},shift(){return pt(this,"shift")},some(e,t){return dt(this,"some",e,t,void 0,arguments)},splice(...e){return pt(this,"splice",e)},toReversed(){return st(this).toReversed()},toSorted(e){return st(this).toSorted(e)},toSpliced(...e){return st(this).toSpliced(...e)},unshift(...e){return pt(this,"unshift",e)},values(){return lt(this,"values",Gt)}};function lt(e,t,n){const i=ot(e),r=i[t]();return i===e||qt(e)||(r._next=r.next,r.next=()=>{const e=r._next();return e.value&&(e.value=n(e.value)),e}),r}const ct=Array.prototype;function dt(e,t,n,i,r,s){const o=ot(e),a=o!==e&&!qt(e),l=o[t];if(l!==ct[t]){const t=l.apply(e,s);return a?Gt(t):t}let c=n;o!==e&&(a?c=function(t,i){return n.call(this,Gt(t),i,e)}:n.length>2&&(c=function(t,i){return n.call(this,t,i,e)}));const d=l.call(o,c,i);return a&&r?r(d):d}function ht(e,t,n,i){const r=ot(e);let s=n;return r!==e&&(qt(e)?n.length>3&&(s=function(t,i,r){return n.call(this,t,i,r,e)}):s=function(t,i,r){return n.call(this,t,Gt(i),r,e)}),r[t](s,...i)}function ut(e,t,n){const i=Ft(e);it(i,0,nt);const r=i[t](...n);return-1!==r&&!1!==r||!Ht(n[0])?r:(n[0]=Ft(n[0]),i[t](...n))}function pt(e,t,n=[]){Ue(),De();const i=Ft(e)[t].apply(e,n);return Ie(),We(),i}const mt=O("__proto__,__v_isRef,__isVue"),ft=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(Y));function _t(e){Y(e)||(e=String(e));const t=Ft(this);return it(t,0,e),t.hasOwnProperty(e)}class gt{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(i?r?Rt:Ot:r?Nt:Pt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=$(e);if(!i){let e;if(s&&(e=at[t]))return e;if("hasOwnProperty"===t)return _t}const o=Reflect.get(e,t,Ut(e)?e:n);return(Y(t)?ft.has(t):mt(t))?o:(i||it(e,0,t),r?o:Ut(o)?s&&ee(t)?o:o.value:X(o)?i?Dt(o):Lt(o):o)}}class bt extends gt{constructor(e=!1){super(!1,e)}set(e,t,n,i){let r=e[t];if(!this._isShallow){const t=jt(r);if(qt(n)||jt(n)||(r=Ft(r),n=Ft(n)),!$(e)&&Ut(r)&&!Ut(n))return t||(r.value=n),!0}const s=$(e)&&ee(t)?Number(t)<e.length:F(e,t),o=Reflect.set(e,t,n,Ut(e)?e:i);return e===Ft(i)&&(s?ce(n,r)&&rt(e,"set",t,n):rt(e,"add",t,n)),o}deleteProperty(e,t){const n=F(e,t),i=(e[t],Reflect.deleteProperty(e,t));return i&&n&&rt(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return Y(t)&&ft.has(t)||it(e,0,t),n}ownKeys(e){return it(e,0,$(e)?"length":et),Reflect.ownKeys(e)}}class yt extends gt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const vt=new bt,wt=new yt,xt=new bt(!0),kt=e=>e,St=e=>Reflect.getPrototypeOf(e);function Ct(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Mt(e,t){const n=function(e,t){const n={get(n){const i=this.__v_raw,r=Ft(i),s=Ft(n);e||(ce(n,s)&&it(r,0,n),it(r,0,s));const{has:o}=St(r),a=t?kt:e?Vt:Gt;return o.call(r,n)?a(i.get(n)):o.call(r,s)?a(i.get(s)):void(i!==r&&i.get(n))},get size(){const t=this.__v_raw;return!e&&it(Ft(t),0,et),t.size},has(t){const n=this.__v_raw,i=Ft(n),r=Ft(t);return e||(ce(t,r)&&it(i,0,t),it(i,0,r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,i){const r=this,s=r.__v_raw,o=Ft(s),a=t?kt:e?Vt:Gt;return!e&&it(o,0,et),s.forEach((e,t)=>n.call(i,a(e),a(t),r))}};return j(n,e?{add:Ct("add"),set:Ct("set"),delete:Ct("delete"),clear:Ct("clear")}:{add(e){t||qt(e)||jt(e)||(e=Ft(e));const n=Ft(this);return St(n).has.call(n,e)||(n.add(e),rt(n,"add",e,e)),this},set(e,n){t||qt(n)||jt(n)||(n=Ft(n));const i=Ft(this),{has:r,get:s}=St(i);let o=r.call(i,e);o||(e=Ft(e),o=r.call(i,e));const a=s.call(i,e);return i.set(e,n),o?ce(n,a)&&rt(i,"set",e,n):rt(i,"add",e,n),this},delete(e){const t=Ft(this),{has:n,get:i}=St(t);let r=n.call(t,e);r||(e=Ft(e),r=n.call(t,e)),i&&i.call(t,e);const s=t.delete(e);return r&&rt(t,"delete",e,void 0),s},clear(){const e=Ft(this),t=0!==e.size,n=e.clear();return t&&rt(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const r=this.__v_raw,s=Ft(r),o=G(s),a="entries"===e||e===Symbol.iterator&&o,l="keys"===e&&o,c=r[e](...i),d=n?kt:t?Vt:Gt;return!t&&it(s,0,l?tt:et),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[d(e[0]),d(e[1])]:d(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}(e,t);return(t,i,r)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(F(n,i)&&i in t?n:t,i,r)}const zt={get:Mt(!1,!1)},At={get:Mt(!1,!0)},Tt={get:Mt(!0,!1)},Pt=new WeakMap,Nt=new WeakMap,Ot=new WeakMap,Rt=new WeakMap;function Lt(e){return jt(e)?e:It(e,!1,vt,zt,Pt)}function Et(e){return It(e,!1,xt,At,Nt)}function Dt(e){return It(e,!0,wt,Tt,Ot)}function It(e,t,n,i,r){if(!X(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=(o=e).__v_skip||!Object.isExtensible(o)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>Q(e).slice(8,-1))(o));var o;if(0===s)return e;const a=r.get(e);if(a)return a;const l=new Proxy(e,2===s?i:n);return r.set(e,l),l}function Bt(e){return jt(e)?Bt(e.__v_raw):!(!e||!e.__v_isReactive)}function jt(e){return!(!e||!e.__v_isReadonly)}function qt(e){return!(!e||!e.__v_isShallow)}function Ht(e){return!!e&&!!e.__v_raw}function Ft(e){const t=e&&e.__v_raw;return t?Ft(t):e}function $t(e){return!F(e,"__v_skip")&&Object.isExtensible(e)&&he(e,"__v_skip",!0),e}const Gt=e=>X(e)?Lt(e):e,Vt=e=>X(e)?Dt(e):e;function Ut(e){return!!e&&!0===e.__v_isRef}function Wt(e){return Yt(e,!1)}function Yt(e,t){return Ut(e)?e:new Xt(e,t)}class Xt{constructor(e,t){this.dep=new Je,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Ft(e),this._value=t?e:Gt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||qt(e)||jt(e);e=n?e:Ft(e),ce(e,t)&&(this._rawValue=e,this._value=n?e:Gt(e),this.dep.trigger())}}function Kt(e){return Ut(e)?e.value:e}const Jt={get:(e,t,n)=>"__v_raw"===t?e:Kt(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const r=e[t];return Ut(r)&&!Ut(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};function Qt(e){return Bt(e)?e:new Proxy(e,Jt)}class Zt{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Je(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Xe-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||Ae===this))return Ee(this,!0),!0}get value(){const e=this.dep.track();return He(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const en={},tn=new WeakMap;let nn;function rn(e,t=1/0,n){if(t<=0||!X(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,Ut(e))rn(e.value,t,n);else if($(e))for(let i=0;i<e.length;i++)rn(e[i],t,n);else if(V(e)||G(e))e.forEach(e=>{rn(e,t,n)});else if(Z(e)){for(const i in e)rn(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&rn(e[i],t,n)}return e}function sn(e,t,n,i){try{return i?e(...i):e()}catch(e){an(e,t,n)}}function on(e,t,n,i){if(U(e)){const r=sn(e,t,n,i);return r&&K(r)&&r.catch(e=>{an(e,t,n)}),r}if($(e)){const r=[];for(let s=0;s<e.length;s++)r.push(on(e[s],t,n,i));return r}}function an(e,t,n,i=!0){t&&t.vnode;const{errorHandler:r,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||R;if(t){let i=t.parent;const s=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,s,o))return;i=i.parent}if(r)return Ue(),sn(r,null,10,[e,s,o]),void We()}!function(e,t,n,i=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,i,s)}const ln=[];let cn=-1;const dn=[];let hn=null,un=0;const pn=Promise.resolve();let mn=null;function fn(e){const t=mn||pn;return e?t.then(this?e.bind(this):e):t}function _n(e){if(!(1&e.flags)){const t=vn(e),n=ln[ln.length-1];!n||!(2&e.flags)&&t>=vn(n)?ln.push(e):ln.splice(function(e){let t=cn+1,n=ln.length;for(;t<n;){const i=t+n>>>1,r=ln[i],s=vn(r);s<e||s===e&&2&r.flags?t=i+1:n=i}return t}(t),0,e),e.flags|=1,gn()}}function gn(){mn||(mn=pn.then(wn))}function bn(e,t,n=cn+1){for(;n<ln.length;n++){const t=ln[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;ln.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function yn(e){if(dn.length){const e=[...new Set(dn)].sort((e,t)=>vn(e)-vn(t));if(dn.length=0,hn)return void hn.push(...e);for(hn=e,un=0;un<hn.length;un++){const e=hn[un];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}hn=null,un=0}}const vn=e=>null==e.id?2&e.flags?-1:1/0:e.id;function wn(e){try{for(cn=0;cn<ln.length;cn++){const e=ln[cn];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),sn(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;cn<ln.length;cn++){const e=ln[cn];e&&(e.flags&=-2)}cn=-1,ln.length=0,yn(),mn=null,(ln.length||dn.length)&&wn(e)}}let xn=null,kn=null;function Sn(e){const t=xn;return xn=e,kn=e&&e.type.__scopeId||null,t}function Cn(e,t){if(null===xn)return e;const n=Kr(xn),i=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[r,s,o,a=R]=t[e];r&&(U(r)&&(r={mounted:r,updated:r}),r.deep&&rn(s),i.push({dir:r,instance:n,value:s,oldValue:void 0,arg:o,modifiers:a}))}return e}function Mn(e,t,n,i){const r=e.dirs,s=t&&t.dirs;for(let o=0;o<r.length;o++){const a=r[o];s&&(a.oldValue=s[o].value);let l=a.dir[i];l&&(Ue(),on(l,n,8,[e.el,a,e,t]),We())}}const zn=Symbol("_vte"),An=Symbol("_leaveCb");Symbol("_enterCb");function Tn(e,t){6&e.shapeFlag&&e.component?(e.transition=t,Tn(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Pn(e,t){return U(e)?(()=>j({name:e.name},t,{setup:e}))():e}function Nn(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function On(e){const t=Br(),n=Yt(null,!0);if(t){const i=t.refs===R?t.refs={}:t.refs;Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}Boolean,Boolean;const Rn=new WeakMap;function Ln(e,t,n,i,r=!1){if($(e))return void e.forEach((e,s)=>Ln(e,t&&($(t)?t[s]:t),n,i,r));if(Dn(i)&&!r)return void(512&i.shapeFlag&&i.type.__asyncResolved&&i.component.subTree.component&&Ln(e,t,n,i.component.subTree));const s=4&i.shapeFlag?Kr(i.component):i.el,o=r?null:s,{i:a,r:l}=e,c=t&&t.r,d=a.refs===R?a.refs={}:a.refs,h=a.setupState,u=Ft(h),p=h===R?D:e=>F(u,e);if(null!=c&&c!==l)if(En(t),W(c))d[c]=null,p(c)&&(h[c]=null);else if(Ut(c)){c.value=null;const e=t;e.k&&(d[e.k]=null)}if(U(l))sn(l,a,12,[o,d]);else{const t=W(l),i=Ut(l);if(t||i){const a=()=>{if(e.f){const n=t?p(l)?h[l]:d[l]:l.value;if(r)$(n)&&q(n,s);else if($(n))n.includes(s)||n.push(s);else if(t)d[l]=[s],p(l)&&(h[l]=d[l]);else{const t=[s];l.value=t,e.k&&(d[e.k]=t)}}else t?(d[l]=o,p(l)&&(h[l]=o)):i&&(l.value=o,e.k&&(d[e.k]=o))};if(o){const t=()=>{a(),Rn.delete(e)};t.id=-1,Rn.set(e,t),qi(t,n)}else En(e),a()}}}function En(e){const t=Rn.get(e);t&&(t.flags|=8,Rn.delete(e))}me().requestIdleCallback,me().cancelIdleCallback;const Dn=e=>!!e.type.__asyncLoader,In=e=>e.type.__isKeepAlive;function Bn(e,t){qn(e,"a",t)}function jn(e,t){qn(e,"da",t)}function qn(e,t,n=Ir){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Fn(t,i,n),n){let e=n.parent;for(;e&&e.parent;)In(e.parent.vnode)&&Hn(i,t,n,e),e=e.parent}}function Hn(e,t,n,i){const r=Fn(t,e,i,!0);Xn(()=>{q(i[t],r)},n)}function Fn(e,t,n=Ir,i=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{Ue();const r=Hr(n),s=on(t,n,e,i);return r(),We(),s});return i?r.unshift(s):r.push(s),s}}RegExp,RegExp;const $n=e=>(t,n=Ir)=>{Ur&&"sp"!==e||Fn(e,(...e)=>t(...e),n)},Gn=$n("bm"),Vn=$n("m"),Un=$n("bu"),Wn=$n("u"),Yn=$n("bum"),Xn=$n("um"),Kn=$n("sp"),Jn=$n("rtg"),Qn=$n("rtc");function Zn(e,t=Ir){Fn("ec",e,t)}const ei="components",ti=Symbol.for("v-ndc");function ni(e){return W(e)?function(e,t,n=!0,i=!1){const r=xn||Ir;if(r){const n=r.type;if(e===ei){const e=function(e,t=!0){return U(e)?e.displayName||e.name:e.name||t&&e.__name}(n,!1);if(e&&(e===t||e===re(t)||e===ae(re(t))))return n}const s=ii(r[e]||n[e],t)||ii(r.appContext[e],t);return!s&&i?n:s}}(ei,e,!1)||e:e||ti}function ii(e,t){return e&&(e[t]||e[re(t)]||e[ae(re(t))])}function ri(e,t,n,i){let r;const s=n&&n[i],o=$(e);if(o||W(e)){let n=!1,i=!1;o&&Bt(e)&&(n=!qt(e),i=jt(e),e=ot(e)),r=new Array(e.length);for(let o=0,a=e.length;o<a;o++)r[o]=t(n?i?Vt(Gt(e[o])):Gt(e[o]):e[o],o,void 0,s&&s[o])}else if("number"==typeof e){r=new Array(e);for(let n=0;n<e;n++)r[n]=t(n+1,n,void 0,s&&s[n])}else if(X(e))if(e[Symbol.iterator])r=Array.from(e,(e,n)=>t(e,n,void 0,s&&s[n]));else{const n=Object.keys(e);r=new Array(n.length);for(let i=0,o=n.length;i<o;i++){const o=n[i];r[i]=t(e[o],o,i,s&&s[i])}}else r=[];return n&&(n[i]=r),r}const si=e=>e?$r(e)?Kr(e):si(e.parent):null,oi=j(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>si(e.parent),$root:e=>si(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>pi(e),$forceUpdate:e=>e.f||(e.f=()=>{_n(e.update)}),$nextTick:e=>e.n||(e.n=fn.bind(e.proxy)),$watch:e=>Ji.bind(e)}),ai=(e,t)=>e!==R&&!e.__isScriptSetup&&F(e,t),li={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;let c;if("$"!==t[0]){const a=o[t];if(void 0!==a)switch(a){case 1:return i[t];case 2:return r[t];case 4:return n[t];case 3:return s[t]}else{if(ai(i,t))return o[t]=1,i[t];if(r!==R&&F(r,t))return o[t]=2,r[t];if((c=e.propsOptions[0])&&F(c,t))return o[t]=3,s[t];if(n!==R&&F(n,t))return o[t]=4,n[t];di&&(o[t]=0)}}const d=oi[t];let h,u;return d?("$attrs"===t&&it(e.attrs,0,""),d(e)):(h=a.__cssModules)&&(h=h[t])?h:n!==R&&F(n,t)?(o[t]=4,n[t]):(u=l.config.globalProperties,F(u,t)?u[t]:void 0)},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;return ai(r,t)?(r[t]=n,!0):i!==R&&F(i,t)?(i[t]=n,!0):!(F(e.props,t)||"$"===t[0]&&t.slice(1)in e||(s[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:r,propsOptions:s,type:o}},a){let l,c;return!!(n[a]||e!==R&&"$"!==a[0]&&F(e,a)||ai(t,a)||(l=s[0])&&F(l,a)||F(i,a)||F(oi,a)||F(r.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:F(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ci(e){return $(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let di=!0;function hi(e,t,n){on($(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ui(e,t,n,i){let r=i.includes(".")?Qi(n,i):()=>n[i];if(W(e)){const n=t[e];U(n)&&Xi(r,n)}else if(U(e))Xi(r,e.bind(n));else if(X(e))if($(e))e.forEach(e=>ui(e,t,n,i));else{const i=U(e.handler)?e.handler.bind(n):t[e.handler];U(i)&&Xi(r,i,e)}}function pi(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:r.length||n||i?(l={},r.length&&r.forEach(e=>mi(l,e,o,!0)),mi(l,t,o)):l=t,X(t)&&s.set(t,l),l}function mi(e,t,n,i=!1){const{mixins:r,extends:s}=t;s&&mi(e,s,n,!0),r&&r.forEach(t=>mi(e,t,n,!0));for(const r in t)if(i&&"expose"===r);else{const i=fi[r]||n&&n[r];e[r]=i?i(e[r],t[r]):t[r]}return e}const fi={data:_i,props:vi,emits:vi,methods:yi,computed:yi,beforeCreate:bi,created:bi,beforeMount:bi,mounted:bi,beforeUpdate:bi,updated:bi,beforeDestroy:bi,beforeUnmount:bi,destroyed:bi,unmounted:bi,activated:bi,deactivated:bi,errorCaptured:bi,serverPrefetch:bi,components:yi,directives:yi,watch:function(e,t){if(!e)return t;if(!t)return e;const n=j(Object.create(null),e);for(const i in t)n[i]=bi(e[i],t[i]);return n},provide:_i,inject:function(e,t){return yi(gi(e),gi(t))}};function _i(e,t){return t?e?function(){return j(U(e)?e.call(this,this):e,U(t)?t.call(this,this):t)}:t:e}function gi(e){if($(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function bi(e,t){return e?[...new Set([].concat(e,t))]:t}function yi(e,t){return e?j(Object.create(null),e,t):t}function vi(e,t){return e?$(e)&&$(t)?[...new Set([...e,...t])]:j(Object.create(null),ci(e),ci(null!=t?t:{})):t}function wi(){return{app:null,config:{isNativeTag:D,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let xi=0;function ki(e,t){return function(n,i=null){U(n)||(n=j({},n)),null==i||X(i)||(i=null);const r=wi(),s=new WeakSet,o=[];let a=!1;const l=r.app={_uid:xi++,_component:n,_props:i,_container:null,_context:r,_instance:null,version:Qr,get config(){return r.config},set config(e){},use:(e,...t)=>(s.has(e)||(e&&U(e.install)?(s.add(e),e.install(l,...t)):U(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,o,c){if(!a){const d=l._ceVNode||Mr(n,i);return d.appContext=r,!0===c?c="svg":!1===c&&(c=void 0),o&&t?t(d,s):e(d,s,c),a=!0,l._container=s,s.__vue_app__=l,Kr(d.component)}},onUnmount(e){o.push(e)},unmount(){a&&(on(o,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){const t=Si;Si=l;try{return e()}finally{Si=t}}};return l}}let Si=null;function Ci(e,t,n=!1){const i=Br();if(i||Si){let r=Si?Si._context.provides:i?null==i.parent||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&U(t)?t.call(i&&i.proxy):t}}const Mi={},zi=()=>Object.create(Mi),Ai=e=>Object.getPrototypeOf(e)===Mi;function Ti(e,t,n,i){const[r,s]=e.propsOptions;let o,a=!1;if(t)for(let l in t){if(te(l))continue;const c=t[l];let d;r&&F(r,d=re(l))?s&&s.includes(d)?(o||(o={}))[d]=c:n[d]=c:ir(e.emitsOptions,l)||l in i&&c===i[l]||(i[l]=c,a=!0)}if(s){const t=Ft(n),i=o||R;for(let o=0;o<s.length;o++){const a=s[o];n[a]=Pi(r,t,a,i[a],e,!F(i,a))}}return a}function Pi(e,t,n,i,r,s){const o=e[n];if(null!=o){const e=F(o,"default");if(e&&void 0===i){const e=o.default;if(o.type!==Function&&!o.skipFactory&&U(e)){const{propsDefaults:s}=r;if(n in s)i=s[n];else{const o=Hr(r);i=s[n]=e.call(null,t),o()}}else i=e;r.ce&&r.ce._setProp(n,i)}o[0]&&(s&&!e?i=!1:!o[1]||""!==i&&i!==oe(n)||(i=!0))}return i}const Ni=new WeakMap;function Oi(e,t,n=!1){const i=n?Ni:t.propsCache,r=i.get(e);if(r)return r;const s=e.props,o={},a=[];let l=!1;if(!U(e)){const i=e=>{l=!0;const[n,i]=Oi(e,t,!0);j(o,n),i&&a.push(...i)};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}if(!s&&!l)return X(e)&&i.set(e,L),L;if($(s))for(let e=0;e<s.length;e++){const t=re(s[e]);Ri(t)&&(o[t]=R)}else if(s)for(const e in s){const t=re(e);if(Ri(t)){const n=s[e],i=o[t]=$(n)||U(n)?{type:n}:j({},n),r=i.type;let l=!1,c=!0;if($(r))for(let e=0;e<r.length;++e){const t=r[e],n=U(t)&&t.name;if("Boolean"===n){l=!0;break}"String"===n&&(c=!1)}else l=U(r)&&"Boolean"===r.name;i[0]=l,i[1]=c,(l||F(i,"default"))&&a.push(t)}}const c=[o,a];return X(e)&&i.set(e,c),c}function Ri(e){return"$"!==e[0]&&!te(e)}const Li=e=>"_"===e||"_ctx"===e||"$stable"===e,Ei=e=>$(e)?e.map(Nr):[Nr(e)],Di=(e,t,n)=>{if(t._n)return t;const i=function(e,t=xn){if(!t)return e;if(e._n)return e;const n=(...i)=>{n._d&&gr(-1);const r=Sn(t);let s;try{s=e(...i)}finally{Sn(r),n._d&&gr(1)}return s};return n._n=!0,n._c=!0,n._d=!0,n}((...e)=>Ei(t(...e)),n);return i._c=!1,i},Ii=(e,t,n)=>{const i=e._ctx;for(const n in e){if(Li(n))continue;const r=e[n];if(U(r))t[n]=Di(0,r,i);else if(null!=r){const e=Ei(r);t[n]=()=>e}}},Bi=(e,t)=>{const n=Ei(t);e.slots.default=()=>n},ji=(e,t,n)=>{for(const i in t)!n&&Li(i)||(e[i]=t[i])},qi=function(e,t){t&&t.pendingBranch?$(e)?t.effects.push(...e):t.effects.push(e):(n=e,$(n)?dn.push(...n):hn&&-1===n.id?hn.splice(un+1,0,n):1&n.flags||(dn.push(n),n.flags|=1),gn());var n};function Hi(e,t){me().__VUE__=!0;const{insert:n,remove:i,patchProp:r,createElement:s,createText:o,createComment:a,setText:l,setElementText:c,parentNode:d,nextSibling:h,setScopeId:u=E,insertStaticContent:p}=e,m=(e,t,n,i=null,r=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!xr(e,t)&&(i=G(e),B(e,r,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:h}=t;switch(c){case dr:f(e,t,n,i);break;case hr:_(e,t,n,i);break;case ur:null==e&&g(t,n,i,o);break;case cr:C(e,t,n,i,r,s,o,a,l);break;default:1&h?b(e,t,n,i,r,s,o,a,l):6&h?M(e,t,n,i,r,s,o,a,l):(64&h||128&h)&&c.process(e,t,n,i,r,s,o,a,l,W)}null!=d&&r?Ln(d,e&&e.ref,s,t||e,!t):null==d&&e&&null!=e.ref&&Ln(e.ref,null,s,e,!0)},f=(e,t,i,r)=>{if(null==e)n(t.el=o(t.children),i,r);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,i,r)=>{null==e?n(t.el=a(t.children||""),i,r):t.el=e.el},g=(e,t,n,i)=>{[e.el,e.anchor]=p(e.children,t,n,i,e.el,e.anchor)},b=(e,t,n,i,r,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?y(t,n,i,r,s,o,a,l):x(e,t,r,s,o,a,l)},y=(e,t,i,o,a,l,d,h)=>{let u,p;const{props:m,shapeFlag:f,transition:_,dirs:g}=e;if(u=e.el=s(e.type,l,m&&m.is,m),8&f?c(u,e.children):16&f&&w(e.children,u,null,o,a,Fi(e,l),d,h),g&&Mn(e,null,o,"created"),v(u,e,e.scopeId,d,o),m){for(const e in m)"value"===e||te(e)||r(u,e,null,m[e],l,o);"value"in m&&r(u,"value",null,m.value,l),(p=m.onVnodeBeforeMount)&&Lr(p,o,e)}g&&Mn(e,null,o,"beforeMount");const b=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(a,_);b&&_.beforeEnter(u),n(u,t,i),((p=m&&m.onVnodeMounted)||b||g)&&qi(()=>{p&&Lr(p,o,e),b&&_.enter(u),g&&Mn(e,null,o,"mounted")},a)},v=(e,t,n,i,r)=>{if(n&&u(e,n),i)for(let t=0;t<i.length;t++)u(e,i[t]);if(r){let n=r.subTree;if(t===n||lr(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=r.vnode;v(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},w=(e,t,n,i,r,s,o,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Or(e[c]):Nr(e[c]);m(null,l,t,n,i,r,s,o,a)}},x=(e,t,n,i,s,o,a)=>{const l=t.el=e.el;let{patchFlag:d,dynamicChildren:h,dirs:u}=t;d|=16&e.patchFlag;const p=e.props||R,m=t.props||R;let f;if(n&&$i(n,!1),(f=m.onVnodeBeforeUpdate)&&Lr(f,n,t,e),u&&Mn(t,e,n,"beforeUpdate"),n&&$i(n,!0),(p.innerHTML&&null==m.innerHTML||p.textContent&&null==m.textContent)&&c(l,""),h?k(e.dynamicChildren,h,l,n,i,Fi(t,s),o):a||N(e,t,l,null,n,i,Fi(t,s),o,!1),d>0){if(16&d)S(l,p,m,n,s);else if(2&d&&p.class!==m.class&&r(l,"class",null,m.class,s),4&d&&r(l,"style",p.style,m.style,s),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const i=e[t],o=p[i],a=m[i];a===o&&"value"!==i||r(l,i,o,a,s,n)}}1&d&&e.children!==t.children&&c(l,t.children)}else a||null!=h||S(l,p,m,n,s);((f=m.onVnodeUpdated)||u)&&qi(()=>{f&&Lr(f,n,t,e),u&&Mn(t,e,n,"updated")},i)},k=(e,t,n,i,r,s,o)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],h=l.el&&(l.type===cr||!xr(l,c)||198&l.shapeFlag)?d(l.el):n;m(l,c,h,null,i,r,s,o,!0)}},S=(e,t,n,i,s)=>{if(t!==n){if(t!==R)for(const o in t)te(o)||o in n||r(e,o,t[o],null,s,i);for(const o in n){if(te(o))continue;const a=n[o],l=t[o];a!==l&&"value"!==o&&r(e,o,l,a,s,i)}"value"in n&&r(e,"value",t.value,n.value,s)}},C=(e,t,i,r,s,a,l,c,d)=>{const h=t.el=e?e.el:o(""),u=t.anchor=e?e.anchor:o("");let{patchFlag:p,dynamicChildren:m,slotScopeIds:f}=t;f&&(c=c?c.concat(f):f),null==e?(n(h,i,r),n(u,i,r),w(t.children||[],i,u,s,a,l,c,d)):p>0&&64&p&&m&&e.dynamicChildren?(k(e.dynamicChildren,m,i,s,a,l,c),(null!=t.key||s&&t===s.subTree)&&Gi(e,t,!0)):N(e,t,i,u,s,a,l,c,d)},M=(e,t,n,i,r,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,i,o,l):z(t,n,i,r,s,o,l):A(e,t,l)},z=(e,t,n,i,r,s,o)=>{const a=e.component=function(e,t,n){const i=e.type,r=(t?t.appContext:e.appContext)||Er,s={uid:Dr++,vnode:e,type:i,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Te(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Oi(i,r),emitsOptions:nr(i,r),emit:null,emitted:null,propsDefaults:R,inheritAttrs:i.inheritAttrs,ctx:R,data:R,props:R,attrs:R,slots:R,refs:R,setupState:R,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=er.bind(null,s),e.ce&&e.ce(s),s}(e,i,r);if(In(e)&&(a.ctx.renderer=W),function(e,t=!1,n=!1){t&&qr(t);const{props:i,children:r}=e.vnode,s=$r(e);!function(e,t,n,i=!1){const r={},s=zi();e.propsDefaults=Object.create(null),Ti(e,t,r,s);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=i?r:Et(r):e.type.props?e.props=r:e.props=s,e.attrs=s}(e,i,s,t),((e,t,n)=>{const i=e.slots=zi();if(32&e.vnode.shapeFlag){const e=t._;e?(ji(i,t,n),n&&he(i,"_",e,!0)):Ii(t,i)}else t&&Bi(e,t)})(e,r,n||t);const o=s?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,li);const{setup:i}=n;if(i){Ue();const n=e.setupContext=i.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,Xr),slots:e.slots,emit:e.emit,expose:t}}(e):null,r=Hr(e),s=sn(i,e,0,[e.props,n]),o=K(s);if(We(),r(),!o&&!e.sp||Dn(e)||Nn(e),o){if(s.then(Fr,Fr),t)return s.then(n=>{Wr(e,n,t)}).catch(t=>{an(t,e,0)});e.asyncDep=s}else Wr(e,s,t)}else Yr(e,t)}(e,t):void 0;t&&qr(!1)}(a,!1,o),a.asyncDep){if(r&&r.registerDep(a,T,o),!e.el){const i=a.subTree=Mr(hr);_(null,i,t,n),e.placeholder=i.el}}else T(a,e,t,n,r,s,o)},A=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:r,component:s}=e,{props:o,children:a,patchFlag:l}=t,c=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||i!==o&&(i?!o||ar(i,o,c):!!o);if(1024&l)return!0;if(16&l)return i?ar(i,o,c):!!o;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(o[n]!==i[n]&&!ir(c,n))return!0}}return!1}(e,t,n)){if(i.asyncDep&&!i.asyncResolved)return void P(i,t,n);i.next=t,i.update()}else t.el=e.el,i.vnode=t},T=(e,t,n,i,r,s,o)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:i,parent:l,vnode:c}=e;{const n=Vi(e);if(n)return t&&(t.el=c.el,P(e,t,o)),void n.asyncDep.then(()=>{e.isUnmounted||a()})}let h,u=t;$i(e,!1),t?(t.el=c.el,P(e,t,o)):t=c,n&&de(n),(h=t.props&&t.props.onVnodeBeforeUpdate)&&Lr(h,l,t,c),$i(e,!0);const p=rr(e),f=e.subTree;e.subTree=p,m(f,p,d(f.el),G(f),e,r,s),t.el=p.el,null===u&&function({vnode:e,parent:t},n){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.el=e.el),i!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),i&&qi(i,r),(h=t.props&&t.props.onVnodeUpdated)&&qi(()=>Lr(h,l,t,c),r)}else{let o;const{el:a,props:l}=t,{bm:c,m:d,parent:h,root:u,type:p}=e,f=Dn(t);if($i(e,!1),c&&de(c),!f&&(o=l&&l.onVnodeBeforeMount)&&Lr(o,h,t),$i(e,!0),a&&X){const t=()=>{e.subTree=rr(e),X(a,e.subTree,e,r,null)};f&&p.__asyncHydrate?p.__asyncHydrate(a,e,t):t()}else{u.ce&&!1!==u.ce._def.shadowRoot&&u.ce._injectChildStyle(p);const o=e.subTree=rr(e);m(null,o,n,i,e,r,s),t.el=o.el}if(d&&qi(d,r),!f&&(o=l&&l.onVnodeMounted)){const e=t;qi(()=>Lr(o,h,e),r)}(256&t.shapeFlag||h&&Dn(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&qi(e.a,r),e.isMounted=!0,t=n=i=null}};e.scope.on();const l=e.effect=new Ne(a);e.scope.off();const c=e.update=l.run.bind(l),h=e.job=l.runIfDirty.bind(l);h.i=e,h.id=e.uid,l.scheduler=()=>_n(h),$i(e,!0),c()},P=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=Ft(r),[l]=e.propsOptions;let c=!1;if(!(i||o>0)||16&o){let i;Ti(e,t,r,s)&&(c=!0);for(const s in a)t&&(F(t,s)||(i=oe(s))!==s&&F(t,i))||(l?!n||void 0===n[s]&&void 0===n[i]||(r[s]=Pi(l,a,s,void 0,e,!0)):delete r[s]);if(s!==a)for(const e in s)t&&F(t,e)||(delete s[e],c=!0)}else if(8&o){const n=e.vnode.dynamicProps;for(let i=0;i<n.length;i++){let o=n[i];if(ir(e.emitsOptions,o))continue;const d=t[o];if(l)if(F(s,o))d!==s[o]&&(s[o]=d,c=!0);else{const t=re(o);r[t]=Pi(l,a,t,d,e,!1)}else d!==s[o]&&(s[o]=d,c=!0)}}c&&rt(e.attrs,"set","")}(e,t.props,i,n),((e,t,n)=>{const{vnode:i,slots:r}=e;let s=!0,o=R;if(32&i.shapeFlag){const e=t._;e?n&&1===e?s=!1:ji(r,t,n):(s=!t.$stable,Ii(t,r)),o=t}else t&&(Bi(e,t),o={default:1});if(s)for(const e in r)Li(e)||null!=o[e]||delete r[e]})(e,t.children,n),Ue(),bn(e),We()},N=(e,t,n,i,r,s,o,a,l=!1)=>{const d=e&&e.children,h=e?e.shapeFlag:0,u=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(128&p)return void D(d,u,n,i,r,s,o,a,l);if(256&p)return void O(d,u,n,i,r,s,o,a,l)}8&m?(16&h&&$(d,r,s),u!==d&&c(n,u)):16&h?16&m?D(d,u,n,i,r,s,o,a,l):$(d,r,s,!0):(8&h&&c(n,""),16&m&&w(u,n,i,r,s,o,a,l))},O=(e,t,n,i,r,s,o,a,l)=>{t=t||L;const c=(e=e||L).length,d=t.length,h=Math.min(c,d);let u;for(u=0;u<h;u++){const i=t[u]=l?Or(t[u]):Nr(t[u]);m(e[u],i,n,null,r,s,o,a,l)}c>d?$(e,r,s,!0,!1,h):w(t,n,i,r,s,o,a,l,h)},D=(e,t,n,i,r,s,o,a,l)=>{let c=0;const d=t.length;let h=e.length-1,u=d-1;for(;c<=h&&c<=u;){const i=e[c],d=t[c]=l?Or(t[c]):Nr(t[c]);if(!xr(i,d))break;m(i,d,n,null,r,s,o,a,l),c++}for(;c<=h&&c<=u;){const i=e[h],c=t[u]=l?Or(t[u]):Nr(t[u]);if(!xr(i,c))break;m(i,c,n,null,r,s,o,a,l),h--,u--}if(c>h){if(c<=u){const e=u+1,h=e<d?t[e].el:i;for(;c<=u;)m(null,t[c]=l?Or(t[c]):Nr(t[c]),n,h,r,s,o,a,l),c++}}else if(c>u)for(;c<=h;)B(e[c],r,s,!0),c++;else{const p=c,f=c,_=new Map;for(c=f;c<=u;c++){const e=t[c]=l?Or(t[c]):Nr(t[c]);null!=e.key&&_.set(e.key,c)}let g,b=0;const y=u-f+1;let v=!1,w=0;const x=new Array(y);for(c=0;c<y;c++)x[c]=0;for(c=p;c<=h;c++){const i=e[c];if(b>=y){B(i,r,s,!0);continue}let d;if(null!=i.key)d=_.get(i.key);else for(g=f;g<=u;g++)if(0===x[g-f]&&xr(i,t[g])){d=g;break}void 0===d?B(i,r,s,!0):(x[d-f]=c+1,d>=w?w=d:v=!0,m(i,t[d],n,null,r,s,o,a,l),b++)}const k=v?function(e){const t=e.slice(),n=[0];let i,r,s,o,a;const l=e.length;for(i=0;i<l;i++){const l=e[i];if(0!==l){if(r=n[n.length-1],e[r]<l){t[i]=r,n.push(i);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<l?s=a+1:o=a;l<e[n[s]]&&(s>0&&(t[i]=n[s-1]),n[s]=i)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}(x):L;for(g=k.length-1,c=y-1;c>=0;c--){const e=f+c,h=t[e],u=t[e+1],p=e+1<d?u.el||u.placeholder:i;0===x[c]?m(null,h,n,p,r,s,o,a,l):v&&(g<0||c!==k[g]?I(h,n,p,2):g--)}}},I=(e,t,r,s,o=null)=>{const{el:a,type:l,transition:c,children:d,shapeFlag:u}=e;if(6&u)I(e.component.subTree,t,r,s);else if(128&u)e.suspense.move(t,r,s);else if(64&u)l.move(e,t,r,W);else if(l!==cr)if(l!==ur)if(2!==s&&1&u&&c)if(0===s)c.beforeEnter(a),n(a,t,r),qi(()=>c.enter(a),o);else{const{leave:s,delayLeave:o,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?i(a):n(a,t,r)},h=()=>{a._isLeaving&&a[An](!0),s(a,()=>{d(),l&&l()})};o?o(a,d,h):h()}else n(a,t,r);else(({el:e,anchor:t},i,r)=>{let s;for(;e&&e!==t;)s=h(e),n(e,i,r),e=s;n(t,i,r)})(e,t,r);else{n(a,t,r);for(let e=0;e<d.length;e++)I(d[e],t,r,s);n(e.anchor,t,r)}},B=(e,t,n,i=!1,r=!1)=>{const{type:s,props:o,ref:a,children:l,dynamicChildren:c,shapeFlag:d,patchFlag:h,dirs:u,cacheIndex:p}=e;if(-2===h&&(r=!1),null!=a&&(Ue(),Ln(a,null,n,e,!0),We()),null!=p&&(t.renderCache[p]=void 0),256&d)return void t.ctx.deactivate(e);const m=1&d&&u,f=!Dn(e);let _;if(f&&(_=o&&o.onVnodeBeforeUnmount)&&Lr(_,t,e),6&d)H(e.component,n,i);else{if(128&d)return void e.suspense.unmount(n,i);m&&Mn(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,W,i):c&&!c.hasOnce&&(s!==cr||h>0&&64&h)?$(c,t,n,!1,!0):(s===cr&&384&h||!r&&16&d)&&$(l,t,n),i&&j(e)}(f&&(_=o&&o.onVnodeUnmounted)||m)&&qi(()=>{_&&Lr(_,t,e),m&&Mn(e,null,t,"unmounted")},n)},j=e=>{const{type:t,el:n,anchor:r,transition:s}=e;if(t===cr)return void q(n,r);if(t===ur)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)})(e);const o=()=>{i(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:i}=s,r=()=>t(n,o);i?i(e.el,o,r):r()}else o()},q=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},H=(e,t,n)=>{const{bum:i,scope:r,job:s,subTree:o,um:a,m:l,a:c}=e;Ui(l),Ui(c),i&&de(i),r.stop(),s&&(s.flags|=8,B(o,e,t,n)),a&&qi(a,t),qi(()=>{e.isUnmounted=!0},t)},$=(e,t,n,i=!1,r=!1,s=0)=>{for(let o=s;o<e.length;o++)B(e[o],t,n,i,r)},G=e=>{if(6&e.shapeFlag)return G(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=h(e.anchor||e.el),n=t&&t[zn];return n?h(n):t};let V=!1;const U=(e,t,n)=>{null==e?t._vnode&&B(t._vnode,null,null,!0):m(t._vnode||null,e,t,null,null,null,n),t._vnode=e,V||(V=!0,bn(),yn(),V=!1)},W={p:m,um:B,m:I,r:j,mt:z,mc:w,pc:N,pbc:k,n:G,o:e};let Y,X;return t&&([Y,X]=t(W)),{render:U,hydrate:Y,createApp:ki(U,Y)}}function Fi({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function $i({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Gi(e,t,n=!1){const i=e.children,r=t.children;if($(i)&&$(r))for(let e=0;e<i.length;e++){const t=i[e];let s=r[e];1&s.shapeFlag&&!s.dynamicChildren&&((s.patchFlag<=0||32===s.patchFlag)&&(s=r[e]=Or(r[e]),s.el=t.el),n||-2===s.patchFlag||Gi(t,s)),s.type===dr&&-1!==s.patchFlag&&(s.el=t.el),s.type!==hr||s.el||(s.el=t.el)}}function Vi(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Vi(t)}function Ui(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const Wi=Symbol.for("v-scx"),Yi=()=>Ci(Wi);function Xi(e,t,n){return Ki(e,t,n)}function Ki(e,t,n=R){const{immediate:i,deep:r,flush:s,once:o}=n,a=j({},n),l=t&&i||!t&&"post"!==s;let c;if(Ur)if("sync"===s){const e=Yi();c=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=E,e.resume=E,e.pause=E,e}const d=Ir;a.call=(e,t,n)=>on(e,d,t,n);let h=!1;"post"===s?a.scheduler=e=>{qi(e,d&&d.suspense)}:"sync"!==s&&(h=!0,a.scheduler=(e,t)=>{t?e():_n(e)}),a.augmentJob=e=>{t&&(e.flags|=4),h&&(e.flags|=2,d&&(e.id=d.uid,e.i=d))};const u=function(e,t,n=R){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,c=e=>r?e:qt(e)||!1===r||0===r?rn(e,1):rn(e);let d,h,u,p,m=!1,f=!1;if(Ut(e)?(h=()=>e.value,m=qt(e)):Bt(e)?(h=()=>c(e),m=!0):$(e)?(f=!0,m=e.some(e=>Bt(e)||qt(e)),h=()=>e.map(e=>Ut(e)?e.value:Bt(e)?c(e):U(e)?l?l(e,2):e():void 0)):h=U(e)?t?l?()=>l(e,2):e:()=>{if(u){Ue();try{u()}finally{We()}}const t=nn;nn=d;try{return l?l(e,3,[p]):e(p)}finally{nn=t}}:E,t&&r){const e=h,t=!0===r?1/0:r;h=()=>rn(e(),t)}const _=ze,g=()=>{d.stop(),_&&_.active&&q(_.effects,d)};if(s&&t){const e=t;t=(...t)=>{e(...t),g()}}let b=f?new Array(e.length).fill(en):en;const y=e=>{if(1&d.flags&&(d.dirty||e))if(t){const e=d.run();if(r||m||(f?e.some((e,t)=>ce(e,b[t])):ce(e,b))){u&&u();const n=nn;nn=d;try{const n=[e,b===en?void 0:f&&b[0]===en?[]:b,p];b=e,l?l(t,3,n):t(...n)}finally{nn=n}}}else d.run()};return a&&a(y),d=new Ne(h),d.scheduler=o?()=>o(y,!1):y,p=e=>function(e,t=!1,n=nn){if(n){let t=tn.get(n);t||tn.set(n,t=[]),t.push(e)}}(e,!1,d),u=d.onStop=()=>{const e=tn.get(d);if(e){if(l)l(e,4);else for(const t of e)t();tn.delete(d)}},t?i?y(!0):b=d.run():o?o(y.bind(null,!0),!0):d.run(),g.pause=d.pause.bind(d),g.resume=d.resume.bind(d),g.stop=g,g}(e,t,a);return Ur&&(c?c.push(u):l&&u()),u}function Ji(e,t,n){const i=this.proxy,r=W(e)?e.includes(".")?Qi(i,e):()=>i[e]:e.bind(i,i);let s;U(t)?s=t:(s=t.handler,n=t);const o=Hr(this),a=Ki(r,s.bind(i),n);return o(),a}function Qi(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const Zi=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${re(t)}Modifiers`]||e[`${oe(t)}Modifiers`];function er(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||R;let r=n;const s=t.startsWith("update:"),o=s&&Zi(i,t.slice(7));let a;o&&(o.trim&&(r=n.map(e=>W(e)?e.trim():e)),o.number&&(r=n.map(ue)));let l=i[a=le(t)]||i[a=le(re(t))];!l&&s&&(l=i[a=le(oe(t))]),l&&on(l,e,6,r);const c=i[a+"Once"];if(c){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,on(c,e,6,r)}}const tr=new WeakMap;function nr(e,t,n=!1){const i=n?tr:t.emitsCache,r=i.get(e);if(void 0!==r)return r;const s=e.emits;let o={},a=!1;if(!U(e)){const i=e=>{const n=nr(e,t,!0);n&&(a=!0,j(o,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return s||a?($(s)?s.forEach(e=>o[e]=null):j(o,s),X(e)&&i.set(e,o),o):(X(e)&&i.set(e,null),null)}function ir(e,t){return!(!e||!I(t))&&(t=t.slice(2).replace(/Once$/,""),F(e,t[0].toLowerCase()+t.slice(1))||F(e,oe(t))||F(e,t))}function rr(e){const{type:t,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:d,props:h,data:u,setupState:p,ctx:m,inheritAttrs:f}=e,_=Sn(e);let g,b;try{if(4&n.shapeFlag){const e=r||i,t=e;g=Nr(c.call(t,e,d,h,p,u,m)),b=a}else{const e=t;g=Nr(e.length>1?e(h,{attrs:a,slots:o,emit:l}):e(h,null)),b=t.props?a:sr(a)}}catch(t){pr.length=0,an(t,e,1),g=Mr(hr)}let y=g;if(b&&!1!==f){const e=Object.keys(b),{shapeFlag:t}=y;e.length&&7&t&&(s&&e.some(B)&&(b=or(b,s)),y=zr(y,b,!1,!0))}return n.dirs&&(y=zr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Tn(y,n.transition),g=y,Sn(_),g}const sr=e=>{let t;for(const n in e)("class"===n||"style"===n||I(n))&&((t||(t={}))[n]=e[n]);return t},or=(e,t)=>{const n={};for(const i in e)B(i)&&i.slice(9)in t||(n[i]=e[i]);return n};function ar(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let r=0;r<i.length;r++){const s=i[r];if(t[s]!==e[s]&&!ir(n,s))return!0}return!1}const lr=e=>e.__isSuspense;const cr=Symbol.for("v-fgt"),dr=Symbol.for("v-txt"),hr=Symbol.for("v-cmt"),ur=Symbol.for("v-stc"),pr=[];let mr=null;function fr(e=!1){pr.push(mr=e?null:[])}let _r=1;function gr(e,t=!1){_r+=e,e<0&&mr&&t&&(mr.hasOnce=!0)}function br(e){return e.dynamicChildren=_r>0?mr||L:null,pr.pop(),mr=pr[pr.length-1]||null,_r>0&&mr&&mr.push(e),e}function yr(e,t,n,i,r,s){return br(Cr(e,t,n,i,r,s,!0))}function vr(e,t,n,i,r){return br(Mr(e,t,n,i,r,!0))}function wr(e){return!!e&&!0===e.__v_isVNode}function xr(e,t){return e.type===t.type&&e.key===t.key}const kr=({key:e})=>null!=e?e:null,Sr=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?W(e)||Ut(e)||U(e)?{i:xn,r:e,k:t,f:!!n}:e:null);function Cr(e,t=null,n=null,i=0,r=null,s=(e===cr?0:1),o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&kr(t),ref:t&&Sr(t),scopeId:kn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:xn};return a?(Rr(l,n),128&s&&e.normalize(l)):n&&(l.shapeFlag|=W(n)?8:16),_r>0&&!o&&mr&&(l.patchFlag>0||6&s)&&32!==l.patchFlag&&mr.push(l),l}const Mr=function(e,t=null,n=null,i=0,r=null,s=!1){if(e&&e!==ti||(e=hr),wr(e)){const i=zr(e,t,!0);return n&&Rr(i,n),_r>0&&!s&&mr&&(6&i.shapeFlag?mr[mr.indexOf(e)]=i:mr.push(i)),i.patchFlag=-2,i}if(o=e,U(o)&&"__vccOpts"in o&&(e=e.__vccOpts),t){t=function(e){return e?Ht(e)||Ai(e)?j({},e):e:null}(t);let{class:e,style:n}=t;e&&!W(e)&&(t.class=ve(e)),X(n)&&(Ht(n)&&!$(n)&&(n=j({},n)),t.style=fe(n))}var o;return Cr(e,t,n,i,r,W(e)?1:lr(e)?128:(e=>e.__isTeleport)(e)?64:X(e)?4:U(e)?2:0,s,!0)};function zr(e,t,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=e,c=t?function(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const e in i)if("class"===e)t.class!==i.class&&(t.class=ve([t.class,i.class]));else if("style"===e)t.style=fe([t.style,i.style]);else if(I(e)){const n=t[e],r=i[e];!r||n===r||$(n)&&n.includes(r)||(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=i[e])}return t}(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&kr(c),ref:t&&t.ref?n&&s?$(s)?s.concat(Sr(t)):[s,Sr(t)]:Sr(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==cr?-1===o?16:16|o:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&zr(e.ssContent),ssFallback:e.ssFallback&&zr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&Tn(d,l.clone(d)),d}function Ar(e=" ",t=0){return Mr(dr,null,e,t)}function Tr(e,t){const n=Mr(ur,null,e);return n.staticCount=t,n}function Pr(e="",t=!1){return t?(fr(),vr(hr,null,e)):Mr(hr,null,e)}function Nr(e){return null==e||"boolean"==typeof e?Mr(hr):$(e)?Mr(cr,null,e.slice()):wr(e)?Or(e):Mr(dr,null,String(e))}function Or(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:zr(e)}function Rr(e,t){let n=0;const{shapeFlag:i}=e;if(null==t)t=null;else if($(t))n=16;else if("object"==typeof t){if(65&i){const n=t.default;return void(n&&(n._c&&(n._d=!1),Rr(e,n()),n._c&&(n._d=!0)))}{n=32;const i=t._;i||Ai(t)?3===i&&xn&&(1===xn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=xn}}else U(t)?(t={default:t,_ctx:xn},n=32):(t=String(t),64&i?(n=16,t=[Ar(t)]):n=8);e.children=t,e.shapeFlag|=n}function Lr(e,t,n,i=null){on(e,t,7,[n,i])}const Er=wi();let Dr=0;let Ir=null;const Br=()=>Ir||xn;let jr,qr;{const e=me(),t=(t,n)=>{let i;return(i=e[t])||(i=e[t]=[]),i.push(n),e=>{i.length>1?i.forEach(t=>t(e)):i[0](e)}};jr=t("__VUE_INSTANCE_SETTERS__",e=>Ir=e),qr=t("__VUE_SSR_SETTERS__",e=>Ur=e)}const Hr=e=>{const t=Ir;return jr(e),e.scope.on(),()=>{e.scope.off(),jr(t)}},Fr=()=>{Ir&&Ir.scope.off(),jr(null)};function $r(e){return 4&e.vnode.shapeFlag}let Gr,Vr,Ur=!1;function Wr(e,t,n){U(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:X(t)&&(e.setupState=Qt(t)),Yr(e,n)}function Yr(e,t,n){const i=e.type;if(!e.render){if(!t&&Gr&&!i.render){const t=i.template||pi(e).template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:s,compilerOptions:o}=i,a=j(j({isCustomElement:n,delimiters:s},r),o);i.render=Gr(t,a)}}e.render=i.render||E,Vr&&Vr(e)}{const t=Hr(e);Ue();try{!function(e){const t=pi(e),n=e.proxy,i=e.ctx;di=!1,t.beforeCreate&&hi(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:d,beforeMount:h,mounted:u,beforeUpdate:p,updated:m,activated:f,deactivated:_,beforeDestroy:g,beforeUnmount:b,destroyed:y,unmounted:v,render:w,renderTracked:x,renderTriggered:k,errorCaptured:S,serverPrefetch:C,expose:M,inheritAttrs:z,components:A,directives:T,filters:P}=t;if(c&&function(e,t){$(e)&&(e=gi(e));for(const n in e){const i=e[n];let r;r=X(i)?"default"in i?Ci(i.from||n,i.default,!0):Ci(i.from||n):Ci(i),Ut(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(c,i),o)for(const e in o){const t=o[e];U(t)&&(i[e]=t.bind(n))}if(r){const t=r.call(n,n);X(t)&&(e.data=Lt(t))}if(di=!0,s)for(const e in s){const t=s[e],r=U(t)?t.bind(n,n):U(t.get)?t.get.bind(n,n):E,o=!U(t)&&U(t.set)?t.set.bind(n):E,a=Jr({get:r,set:o});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(a)for(const e in a)ui(a[e],i,n,e);if(l){const e=U(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if(Ir){let n=Ir.provides;const i=Ir.parent&&Ir.parent.provides;i===n&&(n=Ir.provides=Object.create(i)),n[e]=t}}(t,e[t])})}function N(e,t){$(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(d&&hi(d,e,"c"),N(Gn,h),N(Vn,u),N(Un,p),N(Wn,m),N(Bn,f),N(jn,_),N(Zn,S),N(Qn,x),N(Jn,k),N(Yn,b),N(Xn,v),N(Kn,C),$(M))if(M.length){const t=e.exposed||(e.exposed={});M.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});w&&e.render===E&&(e.render=w),null!=z&&(e.inheritAttrs=z),A&&(e.components=A),T&&(e.directives=T),C&&Nn(e)}(e)}finally{We(),t()}}}const Xr={get:(e,t)=>(it(e,0,""),e[t])};function Kr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Qt($t(e.exposed)),{get:(t,n)=>n in t?t[n]:n in oi?oi[n](e):void 0,has:(e,t)=>t in e||t in oi})):e.proxy}const Jr=(e,t)=>{const n=function(e,t,n=!1){let i,r;return U(e)?i=e:(i=e.get,r=e.set),new Zt(i,r,n)}(e,0,Ur);return n},Qr="3.5.21";class Zr{static get_default(){return{a:1,b:0,c:0,d:1,e:0,f:0}}static to_array(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static is_default(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f}static get_matrix(e,t,n,i,r,s){return{a:e,b:t,c:n,d:i,e:r,f:s}}static get_matrix_translate(e,t){return{a:1,b:0,c:0,d:1,e,f:t}}static get_matrix_scale(e,t){return{a:e,b:0,c:0,d:t,e:0,f:0}}static get_matrix_reflection_horizental(){return{a:1,b:0,c:0,d:-1,e:0,f:0}}static get_matrix_reflection_vertical(){return{a:-1,b:0,c:0,d:1,e:0,f:0}}static multiply(e,t){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}static translate(e,t,n){const i=this.get_matrix_translate(t,n);return this.multiply(e,i)}static get_dom_string(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=e;return`matrix(${t.toFixed(1)},${n},${i},${r.toFixed(1)},${s.toFixed(1)},${o.toFixed(1)})`}static map_point_to_view(e,t){return{x:e.x+t.x,y:e.y+t.y}}static view_point_to_map(e,t){return{x:e.x-t.x,y:e.y-t.y}}}class es{static path=document.createElementNS("http://www.w3.org/2000/svg","path");static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],i=this.path.getTotalLength()/t;for(let e=0;e<=t;e++){const t=e*i,r=this.path.getPointAtLength(t);n.push({x:r.x,y:r.y})}return n}static get_line_k(e,t){const n=t.y-e.y,i=t.x-e.x;return 0===i?Number.POSITIVE_INFINITY:n/i}static find_closet_point(e,t){let n=1/0,i=e[0];const{x:r,y:s}=t;for(let t of e){let e=(r-t.x)**2+(s-t.y)**2;e<n&&(n=e,i=t)}return i}static offset_points(e,t){const n=[],{x:i,y:r}=t;for(let t of e)n.push({x:t.x+i,y:t.y+r});return n}static find_closest_points(e,t){let n=1/0,i=e[0],r=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,i=o,r=s)}}return{from:i,to:r}}static polygonCentroid(e){let t=0,n=0,i=0;const r=e.length;for(let s=0;s<r;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%r],d=o*c-l*a;i+=d,t+=(o+l)*d,n+=(a+c)*d}return i*=.5,t/=6*i,n/=6*i,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let i=0;i<n;i++){const{x:r,y:s}=e[i],{x:o,y:a}=e[(i+1)%n];t+=r*a-o*s}return t/2}static find_line_to_layout_root(e,t=new Set){if(e.is_layout_root)return{has_root:!0,line:[e]};t.add(e.id);for(let n of e.from){if(t.has(n))continue;const i=e.pcube.get_node(n);if(i){if(i.is_layout_root)return{has_root:!0,line:[e,i]};{const n=this.find_line_to_layout_root(i,t);if(n.has_root)return n.line.unshift(e),n}}}return{has_root:!1,line:[]}}static get_linker_id(e,t){return e+"-"+t}static wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}static create_linker_info(e,t,n){const i=e.get_node(t),r=e.get_node(n),s=i?.to.size||0,o=r?.from.size||0;return{linker:Nc.get_default(t,n),index_from:o,index_to:s}}}class ts{_root;get root(){return this._root}get doc(){const e=this.root;if(e instanceof _l)return e}get courier(){return this.root.courier}get history(){return this.root.history}get cursor(){return this.root.cursor}get event(){return this.root.event}get listener(){return this.root.listener}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get config(){return this.root.config}get stats(){return this.root.stats}get hotkeys(){return this.root.hotkeys}constructor(e){this._root=e}}class ns{static _funcs=new Map;static get url(){return this._funcs.get("asset-url")}static get tips(){return this._funcs.get("tip")}static register_asset_url(e){this._funcs.set("asset-url",e)}static register_tip(e){this._funcs.set("tip",e)}}let is=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};class rs{static docs=new Map;static maps=new Map;static _cubes=new Map;static _metas_cube=new Map;static get metas_cube(){const e=new Map;for(let[t,n]of this._cubes)e.set(t,n.meta);return e}static init(){this.register_cube_core()}static add_doc(e){this.docs.set(e.id,e)}static add_map(e){this.maps.set(e.id,e)}static register_cube(e){const t=e.meta;t||console.error(`NoteManager: can't find static member meta in ${e}`),this._cubes.set(t.type,e)}static find_cube(e){return this._cubes.get(e)}static export_versions(){const e={[_l.meta.type]:_l.meta.version};for(const[t,n]of this._cubes)e[t]=n.meta.version;return e}static get_sdk_meta(){return{version:"1.86.0",time_publish:1767833498362}}static register_cube_core(){rs.register_cube(Zo),rs.register_cube(bl),rs.register_cube(ko),rs.register_cube(Ko),rs.register_cube(Vo),rs.register_cube(jo),rs.register_cube(ml),rs.register_cube(bd),rs.register_cube(Cd),rs.register_cube(pd),rs.register_cube(vv),rs.register_cube(od),rs.register_cube(fv),rs.register_cube(Zy),rs.register_cube(Qm),rs.register_cube(Qc),rs.register_cube(kl),rs.register_cube(Al),rs.register_cube(Hc),rs.register_cube(Nc),rs.register_cube(Cv),rs.register_cube(Pc),rs.register_cube(Pv)}}class ss{static get_id(){return is()}static async sleep(e=100){return new Promise(t=>{setTimeout(t,e)})}static is_same_style(e,t){let n=new Set(Object.keys(e)),i=new Set(Object.keys(t)),r=new Set([...n,...i]);if(n.size!==r.size||n.size!==i.size)return!1;for(let i of n)if(e[i]!==t[i])return!1;return!0}static is_same_attrs(e,t){let n=new Set(Object.keys(e)),i=new Set(Object.keys(t)),r=new Set([...n,...i]);if(n.size!==r.size||n.size!==i.size)return!1;for(let i of n)if(e[i]!==t[i])return!1;return!0}async locate(e,t,n=!0){const{courier:i,history:r}=e,s=e.find_cube(t),o=ns.tips;if(s instanceof Es&&s.top){const e=s.top;if(s.find_upstream_untill(e)!==e.child_first){const t=i.get_recorder();t.tell(e,ds.fold(e.id,!1)),r.record(t)}}const a=document.getElementById(t);if(!a)return o?.tip_error("未发现书签锚点");let l=a.style.backgroundColor;a.style.backgroundColor="var(--locate-anchor-bg)",setTimeout(()=>{"var(--locate-anchor-bg)"===a.style.backgroundColor&&(a.style.backgroundColor=l)},3e3),n&&a.scrollIntoView({block:"center",behavior:"instant"})}static exports(e){const t=[];for(let n of e)t.push(n.export());return t}static build_cubes(e,t){const n=[];for(let i of e){if(!i)continue;let e=rs.find_cube(i.type);if(e)n.push(new e(i,t));else{const e=new Ao(i,t,"未注册cube");n.push(e)}}return n}static get_client_rects(e){const t=document.getElementById(e);if(t)return t.getClientRects()}static pick(e,t=!1){const i=rs.metas_cube;let r=[],s=[],o=[],a=[],l=null,c=-1,d=-1,h=e,u=[];for(let t=0;t<e.length;t++){const i=e[t];if(i.type===n.box_root){h=e.slice(0,t),u=e.slice(t+1),l=i,a.push(l);break}}for(let e=0;e<h.length;e++){const t=h[e];i.get(t.type)?.block&&(c<0?c=e:d=e)}if(c>=0&&d>=0){const e=h.slice(0,c),t=h.slice(d+1),n=[];let a=bl.get_default();a.info=[];for(let e of h.slice(c,d+1))i.get(e.type)?.block?(n.push(e),a.info.length>0&&(n.push(a),a=bl.get_default(),a.info=[])):a.info.push(e);r=e,s=n,o=t}else c>=0&&d<0?(r=h.slice(0,c),s=h.slice(c,c+1),o=h.slice(c+1)):(r=h,s=[],o=[]);if(l){let e=bl.get_default();e.info=[];for(let t of u)t.type===n.box_root?(l=t,a.push(t)):i.get(t.type)?.block?(t.type===n.box?l.info.push(...t.info):l.info.push(t),e.info.length>0&&l&&(l.info.push(e),e=bl.get_default())):e.info.push(t);e.info.length>0&&l&&l.info.push(e)}const p=[];if(r.length>0&&p.push(bl.get_default(r)),s.length>0&&p.push(...s),o.length>0&&p.push(bl.get_default(o)),a.length>0)if(t)for(let e of a)p.push(...e.info);else p.push(...a);return{head:r,body:s,tail:o,root:a,sort:p}}static find_line(e,t="first"){if(e instanceof bl)return e;const n=rs.metas_cube.get(e.type);if(!n||!n.block)return;const i="first"===t?e.children:e.children.reverse();for(let e of i){let n=this.find_line(e,t);if(n)return n}}static filter_out_empty(e){return e.filter(e=>!Zo.is_empty_text(e))}static get_flat_cube(e,t=!0){const n=e.children,i=[];if(t)for(let e of n)i.push(e),i.push(...this.get_flat_cube(e));else{i.push(...n);for(let e of i)i.push(...e.children)}return i}static replace_id(e,t,n,i={}){const r=[];for(let s of n){const n=rs.find_cube(s.type);if(!n||!n.replace_id)continue;const o=t[n.meta.type]||1,a=n.update_data(o,s);r.push(n.replace_id(e,a.data,i))}return r}static insert_cubes(e,t){const{courier:n,history:i,cursor:r}=e,{cube_selection:s,cube_start:o,cube_end:a,offset_end:l,offset_start:c}=r;if(!s||!o||!a)return;const d=new cs(n);return r.has_selection&&d.tell(s,ds.delete(s.id,"backward",o.id,a.id,c,l)),d.tell(o,ds.insert(o.id,t,o.id,o.id,c,c)),d}static check_mouse_key(e,t){let n={left:{pointermove:{button:-1,buttons:1},pointerdown:{button:0,buttons:1},pointerup:{button:0,buttons:0}},right:{pointermove:{button:-1,buttons:2},pointerdown:{button:2,buttons:2},pointerup:{button:2,buttons:0}},mid:{pointermove:{button:-1,buttons:4},pointerdown:{button:1,buttons:4},pointerup:{button:1,buttons:0}}}[t][e.type];return e.button==n.button&&e.buttons==n.buttons}}class os{ps;resolve;reject;constructor(){this.ps=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class as extends ts{_record;_resolve;_status=C.pending;_p=Promise.resolve();_prev_tip_remove;get meta(){return as.meta}get status(){return this._status}constructor(e,t){const n=ns.tips;super(e),this._record=t,this._prev_tip_remove=n?.tip_info("播放器已就绪,点我播放",1/0,this.play.bind(this))}waiting(){return new Promise(e=>{this._resolve=e,[C.pending,C.playing].includes(this.status)&&e()})}clear_message(){this._prev_tip_remove&&this._prev_tip_remove()}async play(){const e=ns.tips;this.clear_message(),this.status!==C.stop&&(this._status=C.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)));for(let e of this._record.stack){const t=this.courier.get_recorder();for(let n of e.do){await ss.sleep(this.config.data.player_speed),await fn(),this.stats.showing=!0;let e=this.root.find_cube(n.id);e?(e.dom?.scrollIntoView({inline:"nearest",block:"nearest",behavior:"smooth"}),t.tell(e,n)):console.warn(`未发现演示cube:${n}`)}await fn(),this.history.record(t),await this.waiting()}this._status=C.stop,this.clear_message(),this.stats.showing=!1,e?.tip_success("演示完毕",9e3)}pause(){const e=ns.tips;this.clear_message(),this._status!==C.stop&&(this._status=C.pause,this.stats.showing=!1,this._prev_tip_remove=e?.tip_info("暂停演示,点此恢复",1/0,this.continue.bind(this)))}continue(){const e=ns.tips;this.clear_message(),this._status!==C.stop&&(this._resolve&&this._resolve(),this._status=C.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)))}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.player,version:1}}}class ls extends ts{stack_undo=Et([]);stack_redo=Et([]);get meta(){return ls.meta}get len_undo(){return this.stack_undo.length}get len_redo(){return this.stack_redo.length}constructor(e){super(e)}execute_command_group(e){let t=Promise.resolve();for(let n of e)t.then(()=>fn(()=>this.courier.pass(n)))}undo(){const e=ns.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_undo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_redo.push(t);const n=t.stack_undo;this.execute_command_group(n),this.event.emit_status_update()}redo(){const e=ns.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_redo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_undo.push(t);const n=t.stack_do;this.execute_command_group(n),this.event.emit_status_update()}record(e){if(!this.stats.is_read_mode&&0!==e.stack_undo.length){if(this.config.data.history_length>0&&this.config.data.history_length<Number.POSITIVE_INFINITY){const e=this.stack_undo.length-this.config.data.history_length;e>0&&this.stack_undo.splice(0,e)}this.stack_undo.push(e),this.event.emit_status_update()}}play(e){return new as(this.root,e)}export(e=0){const t=this.stack_undo.slice(e),n={version:this.meta.version,stack:[],docid:this.root.id};for(let e of t)n.stack.push({do:e.stack_do,undo:e.stack_undo});return n}download(e="record.json"){const t=this.export(),n=document.createElement("a");n.download="filename";const i=new Blob([JSON.stringify(t)],{type:"text/plain"});n.href=URL.createObjectURL(i),n.click()}update_data(...e){return{}}clear_stack(){this.stack_undo.length=0,this.stack_redo.length=0,this.event.emit_status_update()}static get meta(){return{type:t.history,version:1}}}class cs{do=[];undo=[];courier;get stack_do(){const e=[];return e.push(...this.do),e}get stack_undo(){const e=[];return e.push(...this.undo),e}constructor(e){this.courier=e}add_cmd(e){this.do.push(structuredClone(Ft(e)))}add_recover(e){e&&this.undo.unshift(e)}pass(e){let t=this.courier.pass(e);t instanceof cs&&this.merge(t)}tick(e,t){fn(()=>{t?this.tell(t,e):this.courier.pass(e)})}get_cube_upstream(e,t=!0){let n=[],i=t?e:e.pcube;for(;i;)n.push(i),i=i.pcube;return n}tell(e,...t){const n=ns.tips;if(!e)return this;if(this.courier.stats.mode===z.read)return n?.tip_info("只读模式不可操作"),this;const i=this.get_cube_upstream(e,!1).reverse();if(e instanceof Es)for(let n of i){const r={recorder:this,path:[...i],tcube:e,cmds:structuredClone(t)};if(n.event_capture(r).stop)return this}for(let n of t)e&&e.id===n.id&&(console.log("🟩",e,e.type,n),this.courier.event.emit_edit_before(e,n),this.merge(e.on(n)),this.courier.event.emit_edit_after(e,n));if(e instanceof Es)for(let n of i){const r={recorder:this,path:[...i],tcube:e,cmds:structuredClone(t)};if(n.event_bubble(r).stop)return this}return this}merge(e){return e instanceof cs?(this.do.push(...structuredClone(Ft(e.stack_do))),this.undo.unshift(...structuredClone(Ft(e.stack_undo))),this):this}}class ds{static insert_child(e,t,n){return{id:e,name:i.cube_insert_child,data:t,pos:n}}static delete_child(e,t,n,r=!1){return{id:e,name:i.cube_delete_child,dir:t,range:n,reserve:r}}static insert(e,t,n,r,s,o){return{id:e,name:i.cube_insert,data:t,start_id:n,end_id:r,offset_end:o,offset_start:s}}static delete(e,t,n,r,s,o,a=!1){return{id:e,name:i.cube_delete,dir:t,start_id:n,end_id:r,offset_start:s,offset_end:o,reserve:a}}static delete_adjacent(e,t,n,r){return{id:e,name:i.cube_delete_adjacent,from:t,offset:r,from_id:n}}static set_selection_css(e,t,n,r,s,o,a=!1,l=!1){return{id:e,name:i.cube_set_selection_css,css:t,start_id:n,end_id:r,offset_start:s,offset_end:o,toggle:a,replace:l}}static set_css(e,t,n=!1,r=!1){return{id:e,name:i.cube_set_css,css:t,toggle:n,replace:r}}static partition(e,t,n,r,s){return{name:i.cube_partition,id:e,start_id:t,end_id:n,offset_start:r,offset_end:s}}static reorder(e,t,n){return{id:e,name:i.cube_reorder,cubeid:t,index:n}}static reset(e,t){return{id:e,name:i.cube_reset,data:t}}static merge(e,t,n,r){return{id:e,name:i.cube_merge,method:t,cubeid:n,offset:r}}static postil_add(e,t=[]){return{name:i.cube_postil_add,id:e,data:t}}static postil_remove(e,t){return{name:i.cube_postil_remove,id:e,range:t}}static set_attr(e,t){return{id:e,name:i.cube_set_attr,attr:t}}static resize(e,t,n=-1){return n>0?this.set_attr(e,{width:t,height:n}):this.set_attr(e,{width:t})}static fold(e,t){return this.set_attr(e,{fold:t})}}class hs{static loc(e,t,n,i){return{name:o.loc,id:e,from:n,from_offset:i,offset:t}}static in_head(e){return{id:e,name:o.cursor_in_head}}static in_tail(e){return{id:e,name:o.cursor_in_tail}}}var us=r(1068);class ps{static layout_tree(e,t){if(0==e.count_to)return;const n=e.env.layout_type;return"right"===n?this.right(e,t):"left"===n?this.left(e,t):"down"===n?this.down(e,t):"up"===n?this.up(e,t):"time-down"===n?this.time_down(e,t):"time-right"===n?this.time_right(e,t):void 0}static right(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos_tree:s,size_bound:o}=r;let a=s.x+n+o.width,l=s.y,c=0;for(let e=0;e<t.length;e++){const n=t[e].bound;n.update_pos_tree(a,l+c+e*i),c+=n.size_tree.height}}static left(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos_tree:s,size_bound:o,size_tree:a}=r;let l=s.x+a.width-o.width-n,c=s.y,d=0;for(let e=0;e<t.length;e++){const n=t[e].bound;n.update_pos_tree(l-n.size_tree.width,c+d+e*i),d+=n.size_tree.height}}static down(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos_tree:s,size_bound:o}=r;let a=s.x,l=s.y+i+o.height,c=0;for(let e=0;e<t.length;e++){const i=t[e].bound;i.update_pos_tree(a+c+e*n,l),c+=i.size_tree.width}}static up(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos_tree:s,size_bound:o,size_tree:a}=r;let l=s.x,c=s.y+a.height-o.height-i,d=0;for(let e=0;e<t.length;e++){const i=t[e].bound;i.update_pos_tree(l+d+e*n,c-i.size_tree.height),d+=i.size_tree.width}}static time_right(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos:s,size_bound:o}=r;let a=s.x+o.width+n,l=s.y+o.height/2,c=0;for(let e=0;e<t.length;e++){const i=t[e],r=i.bound,{size_bound:s,size_tree:o}=r,d=i.attrs.layout;"right"===d||"left"===d?r.update_pos_tree(a+c+e*n,l-o.height/2):"up"===d?r.update_pos_tree(a+c+e*n,l-(o.height-s.height/2)):r.update_pos_tree(a+c+e*n,l-s.height/2),c+=r.size_tree.width}}static time_down(e,t){const{map_node_vgap:n}=e.config.data,i=e.bound,{pos:r,size_bound:s}=i,{sum_tree_height:o,sum_tree_width:a,max_tree_height:l,max_tree_width:c,max_tree_width_node:d,max_tree_height_node:h}=e.bound.stat_downstream_nodes_size(t);Math.max(d.width,s.width);let u=r.x+s.width/2,p=r.y+s.height+n,m=0;for(let e=0;e<t.length;e++){const i=t[e],r=i.bound,s=i.attrs.layout,{size_bound:o,size_tree:a}=r;"left"===s?r.update_pos_tree(u-(a.width-o.width/2),p+m+e*n):"down"===s||"up"===s?r.update_pos_tree(u-a.width/2,p+m+e*n):r.update_pos_tree(u-o.width/2,p+m+e*n),m+=r.size_tree.height}}}class ms{static layout_change(e,t){return{id:e,name:l.layout_update,attrs:t}}static append_child(e,t){return{id:e,name:l.append_child,previd:t}}}class fs{static node_add(e,t){return{id:e,name:a.node_add,data:t}}static node_remove(e,t){return{id:e,name:a.node_remove,data:t}}static linker_add(e,t){return{id:e,name:a.linker_add,data:t}}static linker_remove(e,t){return{id:e,name:a.linker_remove,data:t}}static update_attr(e,t){return{id:e,name:a.update_attrs,data:t}}}class _s{handler=new Map;vip_handler=new Map;constructor(){}on(e){const t=this.get_vip_cmd_handler(e.name)||this.get_cmd_handler(e.name);if(t)return t(e)}get_cmd_handler(e){return this.handler.get(e)}get_vip_cmd_handler(e){return this.vip_handler.get(e)}set_cmd_handler(e,t){this.handler.set(e,t)}set_vip_cmd_handler(e,t){this.vip_handler.set(e,t)}event_capture(e){return{stop:!1}}event_bubble(e){return{stop:!1}}static get_default(...e){throw Error("sub-cube have't implement get_default method")}static get meta(){throw Error("sub-cube have't implement attribution meta")}}const gs=new Map;class bs{static get_cmd_handler(e,t){const n=gs.get(e);return n?.get(t)}static set_cmd_handler(e,t,n){let i=gs.get(e);i?i.set(t,n):(i=new Map,i.set(t,n),gs.set(e,i))}static init_cmd_handler(e){const t=e.meta,n=gs.get(t.type);if(n)for(let[t,i]of n)e.set_vip_cmd_handler(t,i.bind(e))}}function ys(e){return(t,n)=>{const i=t[n];if(!i)return;const r=t.meta;bs.set_cmd_handler(r.type,e,i)}}class vs extends ts{_id=is();scroll_offset=100;_freeze=Wt(!1);get meta(){return vs.meta}get id(){return this._id}pos=Lt({x:0,y:0,width:0,height:0});css=Lt({});get freeze(){return this._freeze.value}set freeze(e){this._freeze.value=e}_direction=null;get focus_cube(){return this.selection_line[this.selection_line.length-1]}get second_cube(){return this.selection_line.length<=1?void 0:this.selection_line[this.selection_line.length-2]}get len(){return this.selection_line.length}selection_line=[];constructor(e,t){super(e),this.selection_line.push(t),this.listener.check_float()}expand(e){if(!(this.focus_cube instanceof Ko&&this._direction===e))if("up"===e){if("down"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.prev_cube||this.focus_cube.pcube;if(!e||e instanceof Ls)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="up"),this.selection_line.push(e),this.update_area())}else{if("up"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.next_cube||this.focus_cube.pcube;if(!e||e instanceof Ls)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="down"),this.selection_line.push(e),this.update_area())}}shrink(){1!==this.selection_line.length&&(this.selection_line.pop(),this.update_area())}update_area(e=!0){if(e){const e=[];for(let t of this.selection_line){const n=t.clientRect;n&&e.push(n)}if(0===e.length)return this.remove();const t=us.MathRect.merge(...e);this.css.width=`${t.width}px`,this.css.height=`${t.height}px`,this.css.left=t.x+"px",this.css.top=t.y+"px",this.pos.x=t.x+document.documentElement.scrollLeft,this.pos.y=t.y+document.documentElement.scrollTop,this.pos.width=t.width,this.pos.height=t.height}else{const e=this.pos.x-document.documentElement.scrollLeft,t=this.pos.y-document.documentElement.scrollTop;this.css.left=e+"px",this.css.top=t+"px"}}find_line_next(e){if(this.selection_line.indexOf(e)<this.selection_line.length)return this.selection_line[this.selection_line.length-1]}find_line_prev(e){const t=this.selection_line.indexOf(e);if(t>0)return this.selection_line[t-1]}get_scope_info(){let e=this.focus_cube.level;const t=this.focus_cube.pcube,n=[],i=[];for(let t of this.selection_line){const r=t.level,s=t.index;r===e&&(n.push(t),i.push(s))}return{cube:t,range:[Math.min(...i),Math.max(...i)+1],from:this.id}}remove(){this.root.remove_scope(this.id),this.event.emit_status_update()}find_scope_lines(){const e=this.root.get_scope_cubes(),t=[],n=[];for(let n of e)t.push(...ss.get_flat_cube(n.cube));for(let e of t)e instanceof bl&&n.push(e);return n}find_inline_data(){const e=[],t=this.find_scope_lines();for(let n of t)e.push(...n.children);return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.scope,version:1}}}class ws extends ts{timer_float_check=!1;constructor(e){super(e),this.init()}init(){}check_float(){const{stats:e,cubes:t}=this.root;this.timer_float_check||requestAnimationFrame(()=>{let e=!0;for(let t of this.root.scope)e=!1,t.update_area();for(let[n,i]of t.postils)i.show&&(e=!1,i.update_pos());e||this.check_float()})}}class xs extends ts{_map=Et({});_types=Et(new Map);_count=Et({});constructor(e){super(e)}get postils(){return this._types.get(n.postil)||new Map}get meta(){return xs.meta}get_types_cube(e){return this._types.get(e)||new Map}add_cube(e){const t=e.id,n=e.meta.type;void 0===this._count[t]?this._count[t]=1:this._count[t]++,this._map[t]=e;const i=this._types.get(n);i?i.set(t,e):this._types.set(n,Et(new Map([[t,e]])))}remove_cube(e){const t=e.id,n=e.meta.type;0===--this._count[t]&&(delete this._map[t],this._types.get(n)?.delete(t))}find_cube(e){return this._map[e]}find_postil(e){for(let t of Object.values(this.postils)){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}clear_all_map_selected(){const e=this.get_types_cube(n.submap);if(e)for(let[t,n]of e)n.clear_node_selected();this.root instanceof Vc&&this.root.clear_node_selected()}static get meta(){return{type:t.cubes,version:1}}}function ks(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const Ss=new Map;function Cs(e){return(t,n)=>{let i=t[n];Ss.set(e,i)}}class Ms extends ts{handlers=Lt(new Map);data;get meta(){return Ms.meta}constructor(e){super(e),this.data=Lt(Ms.default_hotkeys)}listen(e){this.listen_cursor_hotkey(e),this.listen_uncursor_hotkey(e),this.listen_cvx(e)}listen_cursor_hotkey(e){const t=this;e.addEventListener("keydown",e=>{const n=t.stats.mode,i=e.key.toLowerCase(),r=document.activeElement;let s=!1;if(n===z.edit&&r!==document.body){for(let[n,i]of Ss){let r=t.data[n];r.cursor&&t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),s=!0,i.bind(t)(e))}for(let[n,i]of t.handlers){let r=t.data[n];r.cursor&&t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),s=!0,i(e))}if(!s&&"tab"===i){s=!0;const{cursor:t,courier:n,history:i}=this,{cube_end:r,cube_start:o,offset_start:a,offset_end:l,has_selection:c,cube_selection:d}=t,h=n.get_recorder();if(!d||!r||!o)return;e.preventDefault(),c&&h.tell(d,ds.delete(d.id,"backward",o.id,r.id,a,l,!0));const u=o.text,p=u.slice(0,a)+"\t"+u.slice(a),m=Jo.reset(o.id,p),f=hs.loc(o.id,a+1,o.id,l);h.tell(o,m,f),i.record(h)}}})}listen_uncursor_hotkey(e){const t=this;document.documentElement.addEventListener("keydown",e=>{const n=t.stats.mode,i=document.activeElement,r=[P.down,P.left,P.right,P.up],s=e.key.toLowerCase();this.root;let o=!1;if(this.cursor.cube_end||i===document.body){for(let[n,i]of Ss){let r=t.data[n];r.cursor||t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),o=!0,i.bind(t)(e))}for(let[n,i]of t.handlers){let r=t.data[n];r.cursor||t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),o=!0,i(e))}}o||i!==document.body||n!==z.edit||(" "===s?this.listen_map_space(e):"backspace"===s||"delete"===s?this.listen_map_delete(e):"enter"===s?this.listen_map_enter(e):"tab"===s?this.listen_map_tab(e):r.includes(s)&&this.listen_map_nav(e))})}listen_map_nav(e){const t=this.root,i=e.key.toLowerCase(),r=this.cubes.get_types_cube(n.submap),s=[P.down,P.left,P.right,P.up];if(t instanceof Vc&&t.get_nodes_selected().size>0)s.includes(i)&&t.move_select(i);else for(let[e,t]of r)t.move_select(i)}listen_map_delete(e){const{courier:t,history:i}=this,r=t.get_recorder();if(this.root instanceof Vc){const e=[...this.root.get_nodes_selected()].map(e=>e.id);r.tell(this.root,fs.node_remove(this.root.id,e))}const s=this.cubes.get_types_cube(n.submap);for(let[e,t]of s){const e=[...t.get_nodes_selected()].map(e=>e.id);r.tell(t,fs.node_remove(t.id,e))}i.record(r)}listen_map_enter(e){const{courier:t,history:i}=this,r=t.get_recorder();let s=!1;if(this.root instanceof Vc){const t=this.root.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){s=!0;continue}let i=n.id;e.shiftKey&&(i=n.env.prev_node?.id||null);const o=ms.append_child(t.id,i);r.tell(t,o)}}const o=this.cubes.get_types_cube(n.submap);for(let[t,n]of o){const t=n.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){s=!0;continue}let i=n.id;e.shiftKey&&(i=n.env.prev_node?.id||null);const o=ms.append_child(t.id,i);r.tell(t,o)}}s&&ns.tips?.tip_warning("无法在没有布局上游的节点添加同级"),i.record(r)}listen_map_tab(e){e.preventDefault();const{courier:t,history:i}=this,r=t.get_recorder();if(this.root instanceof Vc){const e=this.root.get_nodes_selected();for(let t of e){const e=ms.append_child(t.id);r.tell(t,e)}}const s=this.cubes.get_types_cube(n.submap);for(let[e,t]of s){const e=t.get_nodes_selected();for(let t of e){const e=ms.append_child(t.id);r.tell(t,e)}}i.record(r)}listen_map_space(e){const t=this.root;if(e.preventDefault(),t instanceof Vc){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}const i=t.cubes.get_types_cube(n.submap);for(let[e,t]of i){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}}listen_cvx(e){let t=e;this.root instanceof Vc&&(t=document.documentElement),t.addEventListener("paste",async e=>{const t=e.clipboardData,{cursor:n}=this,{cube_end:i}=n;if(i instanceof Zo&&t){e.preventDefault();const n=await this.clipboard.paste(t);this.history.record(n)}}),t.addEventListener("copy",e=>{const t=e.clipboardData,{doc:n,hotkeys:i,cursor:r}=this;t&&(this.root.scope_count_normal>0||r.has_selection||r.cube_end instanceof Zo)&&(e.preventDefault(),this.clipboard.copy(t))}),t.addEventListener("cut",e=>{const t=e.clipboardData,{root:n,cursor:i}=this;t&&(n.scope_count_normal>0||i.cube_end instanceof Zo)&&(e.preventDefault(),this.clipboard.cut(t))})}register(e,t){this.data[t.name]=t,this.handlers.set(t.name,e)}reset(e){Object.assign(this.data,e)}reset_handler(e,t){this.handlers.set(e,t)}export(){return structuredClone(Ft(this.data))}update_data(...e){return{}}validate(e,t){return t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&t.ctrl===e.ctrlKey&&(0===t.key.length||t.key.includes(e.key.toLocaleLowerCase()))}which(e){for(let t of Object.values(this.data))if(this.validate(e,t))return t}validate_hotkeys(e){for(let t of Object.values(this.data))if(this.validate(e,t))return!0;return!1}get_hotkey_str(e){const t=this.data[e];if(!t)return"";let n="";return t.meta&&(n+="meta + "),t.ctrl&&(n+="ctrl + "),t.alt&&(n+="alt + "),t.shift&&(n+="shift + "),n+=t.key,n}clear_scope(e){e.preventDefault(),this.root.clear_scope(!1)}clear_css(e){e.preventDefault();const{cursor:t}=this;this.root.painter.clear()}bold(e){e.preventDefault(),this.root.painter.paint({"font-weight":"700"},!0)}unindent_line(e){e.preventDefault(),this.root.painter.unindent()}indent_line(e){e.preventDefault(),this.root.painter.indent()}undo(e){e.preventDefault(),this.root.history.undo()}redo(e){e.preventDefault(),this.root.history.redo()}cursor_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;if(!t)return;if(!n.range)return;e.preventDefault();const i=[P.down,P.end,P.home,P.left,P.right,P.up],r=e.key.toLocaleLowerCase();i.includes(r)&&this.event.emit_cursor_nav_before(e).some(e=>!1===e)||(r===P.left?n.move_left():r===P.right?n.move_right():r===P.up?n.move_up():r===P.down?n.move_down():r===P.home?n.move_home():r===P.end&&n.move_end(),this.event.emit_cursor_nav_after(e))}cursor_extend_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;t&&n.cube_end instanceof Zo&&(e.preventDefault(),e.key.toLocaleLowerCase()===P.left?n.extend_left():e.key.toLocaleLowerCase()===P.right?n.extend_right():e.key.toLocaleLowerCase()===P.up?n.extend_up():e.key.toLocaleLowerCase()===P.down?n.extend_down():e.key.toLocaleLowerCase()===P.home?n.extend_home():e.key.toLocaleLowerCase()===P.end&&n.extend_end())}text_break(e){const{courier:t,cursor:n,history:i,doc:r}=this;if(n.has_selection)return;e.preventDefault();const s=new cs(t),{cube_end:o,cube_start:a,cube_selection:l,offset_end:c,offset_start:d}=n;if(o){if(o instanceof Zo){const e=o.text.slice(0,c)+"\n"+o.text.slice(c),t=o.id,n=Jo.reset(t,e),i=hs.loc(t,c+2,t,c);s.tell(o,n,i)}i.record(s)}}break(e){if(this.event.emit_enter_before(e).some(e=>"stop"===e))return;if(!this.cursor.get_focus_line())return;e.preventDefault();const{courier:t,history:n,cursor:i,doc:r}=this,{cube_end:s,cube_start:o,cube_selection:a,offset_end:l,offset_start:c}=i;if(!a||!s||!o)return;const d=new cs(t),h=o.id,u=s.id;i.has_selection&&d.tell(a,ds.delete(a.id,"backward",h,u,c,l,!0)),d.tell(o,Jo.break(o.id,c)),n.record(d),this.event.emit_enter_after(e)}async break_root(e){const{cursor:t,courier:n,history:i}=this,{cube_end:r,offset_end:s}=t;if(!r)return;const o=r.find_upstream_target(e=>e instanceof ml);if(!o)return;const a=r.find_upstream_untill(o);if(!a)return;const l=[],c=a.index,d=o.children.slice(c);for(let e of d)l.push(e.export());const h=ml.get_default(l),u=n.get_recorder(),p=o.pcube;u.tell(p,ds.insert_child(p.id,[h],o.index+1)),u.tell(o,ds.delete_child(o.id,"backward",[c,o.child_count])),r instanceof Zo&&(await fn(),r.set_cursor_in_head(s)),i.record(u)}text_partition(e){const{cursor:t,history:n,courier:i}=this,r=ns.tips,{cube_selection:s,offset_end:o,offset_start:a}=t;if(!(s instanceof Zo))return r?.tip_warning("选区必须在一个文本块内");const l=i.get_recorder(),c=s.id;l.tell(s,ds.partition(c,c,c,a,o)),n.record(l)}add_scope(e){this.root.add_scope()}underline(e){const{cursor:t,courier:n,history:i}=this,{cube_selection:r,cube_end:s,cube_start:o,offset_start:a,offset_end:l}=t,c=new cs(n);r&&o&&s&&(c.tell(r,ds.set_selection_css(r.id,{"text-decoration-line":"underline"},o.id,s.id,a,l,!0)),i.record(c))}copy_format(e){const{root:t}=this;e.preventDefault(),t.painter.copy_format()}apply_format(e){const{root:t}=this;e.preventDefault(),t.painter.apply_format_brush()}italic(e){e.preventDefault(),this.painter.paint({"font-style":"italic"},!0)}align_left(e){e.preventDefault(),this.painter.paint({"text-align":"left"},!0)}align_center(e){e.preventDefault(),this.painter.paint({"text-align":"center"},!0)}align_right(e){e.preventDefault(),this.painter.paint({"text-align":"right"},!0)}next_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:i}=t;if(!i)return;const r=i.find_upstream_target(e=>e instanceof ml);if(!r)return;const s=r.pcube,o=new cs(this.courier),a=ml.get_default();o.tell(s,ds.insert_child(s.id,[a],r.index+1)),n.record(o)}prev_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:i}=t;if(!i)return;const r=i.find_upstream_target(e=>e instanceof ml);if(!r)return;const s=r.pcube,o=new cs(this.courier),a=ml.get_default();o.tell(s,ds.insert_child(s.id,[a],r.index)),n.record(o)}add_annotation(e){e.preventDefault();const t=ns.tips,{cursor:n,courier:i,history:r}=this,{cube_selection:s,cube_start:o,cube_end:a,offset_end:l,offset_start:c}=n,d=new cs(i);if(!s||!o||!a)return t?.tip_warning("未发现光标或选区");const h=o.id,u=a.id,p=jo.get_default();if(n.has_selection)if(s instanceof Zo)if(d.tell(s,ds.partition(s.id,h,u,c,l)),0===c){if(s.postil?.has_annotation)return t?.tip_warning("已添加批注"),d;d.tell(s,ds.postil_add(s.id,[p])),d.tell(s,hs.loc(s.id,l,s.id,l))}else{const e=s.next_cube;if(e instanceof Zo){if(e.postil?.has_annotation)return t?.tip_warning("已添加批注"),d;d.tell(e,ds.postil_add(e.id,[p])),d.tell(e,hs.loc(e.id,e.len,e.id,e.len))}}else t?.tip_warning("选区跨越多个文本块");else a instanceof Zo&&(d.merge(a.add_annotation()),d.tell(a,hs.loc(a.id,l,a.id,l)));r.record(d)}fold_block(e){e.preventDefault();const{cursor:t}=this,{cube_end:n,offset_end:i}=t;if(!n)return;let r,s=n;for(;!r;){let e=s.pcube;if(e instanceof Al||e instanceof ml)r=e;else if(e instanceof Ls)return;s=e}if(r){const e=r.child_first,t=n.find_upstream_untill(r)===e,s=this.courier.get_recorder(),o=!r.attrs.fold,a=ds.set_attr(r.id,{fold:o});s.tell(r,a),t?s.tell(n,hs.loc(n.id,i,n.id,i)):o&&e&&s.tell(e,hs.in_tail(e.id)),this.history.record(s)}}static get meta(){return{type:t.hotkeys,version:1}}static get default_hotkeys(){return{[A["fold-block"]]:{name:A["fold-block"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["z"],cursor:!0,group:T.block},[A["text-partition"]]:{name:A["text-partition"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["x"],cursor:!0,group:T.text},[A["text-add-annotation"]]:{name:A["text-add-annotation"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["a"],cursor:!0,group:T.text},[A["scope-clear"]]:{name:A["scope-clear"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["c"],group:T.scope},[A["clear-css"]]:{name:A["clear-css"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:T.css},[A["root-add-prev"]]:{name:A["root-add-prev"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:T.block},[A["root-add-next"]]:{name:A["root-add-next"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:T.block},[A["text-align-left"]]:{name:A["text-align-left"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["l"],cursor:!0,group:T.common},[A["text-align-center"]]:{name:A["text-align-center"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["e"],cursor:!0,group:T.common},[A["text-align-right"]]:{name:A["text-align-right"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:T.common},[A["break-text"]]:{name:A["break-text"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:T.text},[A["break-line"]]:{name:A["break-line"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:T.core},[A["break-root"]]:{name:A["break-root"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["enter"],cursor:!0,group:T.block},[A["cursor-nav"]]:{name:A["cursor-nav"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,cursor:!0,key:[P.down,P.left,P.right,P.up,P.home,P.end],group:T.core},[A["cursor-nav-extend"]]:{name:A["cursor-nav-extend"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,cursor:!0,key:[P.down,P.left,P.right,P.up,P.home,P.end],group:T.core},[A.undo]:{name:A.undo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["z"],cursor:!1,group:T.common},[A.redo]:{name:A.redo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["y"],cursor:!1,group:T.common},[A["indent-line"]]:{name:A["indent-line"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:T.common},[A["unindent-line"]]:{name:A["unindent-line"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:T.common},[A["text-bold"]]:{name:A["text-bold"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["b"],cursor:!0,group:T.text},[A["scope-add"]]:{name:A["scope-add"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["s"],cursor:!1,group:T.scope},[A["text-underline"]]:{name:A["text-underline"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["u"],cursor:!0,group:T.text},[A["text-italic"]]:{name:A["text-italic"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["i"],cursor:!0,group:T.text},[A["format-brush-copy"]]:{name:A["format-brush-copy"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["c"],cursor:!0,group:T.common},[A["format-brush-apply"]]:{name:A["format-brush-apply"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["v"],cursor:!0,group:T.common}}}}ks([Cs(A["scope-clear"])],Ms.prototype,"clear_scope",null),ks([Cs(A["clear-css"])],Ms.prototype,"clear_css",null),ks([Cs(A["text-bold"])],Ms.prototype,"bold",null),ks([Cs(A["unindent-line"])],Ms.prototype,"unindent_line",null),ks([Cs(A["indent-line"])],Ms.prototype,"indent_line",null),ks([Cs(A.undo)],Ms.prototype,"undo",null),ks([Cs(A.redo)],Ms.prototype,"redo",null),ks([Cs(A["cursor-nav"])],Ms.prototype,"cursor_navigation",null),ks([Cs(A["cursor-nav-extend"])],Ms.prototype,"cursor_extend_navigation",null),ks([Cs(A["break-text"])],Ms.prototype,"text_break",null),ks([Cs(A["break-line"])],Ms.prototype,"break",null),ks([Cs(A["break-root"])],Ms.prototype,"break_root",null),ks([Cs(A["text-partition"])],Ms.prototype,"text_partition",null),ks([Cs(A["scope-add"])],Ms.prototype,"add_scope",null),ks([Cs(A["text-underline"])],Ms.prototype,"underline",null),ks([Cs(A["format-brush-copy"])],Ms.prototype,"copy_format",null),ks([Cs(A["format-brush-apply"])],Ms.prototype,"apply_format",null),ks([Cs(A["text-italic"])],Ms.prototype,"italic",null),ks([Cs(A["text-align-left"])],Ms.prototype,"align_left",null),ks([Cs(A["text-align-center"])],Ms.prototype,"align_center",null),ks([Cs(A["text-align-right"])],Ms.prototype,"align_right",null),ks([Cs(A["root-add-next"])],Ms.prototype,"next_root",null),ks([Cs(A["root-add-prev"])],Ms.prototype,"prev_root",null),ks([Cs(A["text-add-annotation"])],Ms.prototype,"add_annotation",null),ks([Cs(A["fold-block"])],Ms.prototype,"fold_block",null);class zs extends ts{_count_word=Wt(0);_active_root_index=Wt(0);_anchor_root_id=Wt("");_mode=Wt(z.read);_view=Wt("doc");_in_composition_mode=Wt(!1);_in_recording=Wt(!1);_showing=Wt(!1);view_point=Lt({x:0,y:0});get view(){return this._view.value}set view(e){this._view.value=e}get is_doc_view(){return"doc"===this.view}get is_map_view(){return"map"===this.view}get mode_name(){return{[z.edit]:"编辑模式",[z.read]:"阅读模式",[z.export]:"导出模式"}[this.mode]}get showing(){return this._showing.value}set showing(e){this._showing.value=e,this.event.emit_status_update()}get is_recording(){return this._in_recording.value}set is_recording(e){this._in_recording.value=e,this.event.emit_status_update()}get len_undo(){return this.history.len_undo}get len_redo(){return this.history.len_redo}get is_read_mode(){return this._mode.value===z.read}get is_edit_mode(){return this._mode.value===z.edit}get in_composition_mode(){return this._in_composition_mode.value}set in_composition_mode(e){this._in_composition_mode.value=e,this.event.emit_status_update()}get mode(){return this._mode.value}set mode(e){const t=this.mode;this._mode.value=e,t!==e&&this.event.emit_status_update()}get anchor_root_id(){return this._anchor_root_id.value}set anchor_root_id(e){this._anchor_root_id.value=e,this.event.emit_status_update()}get anchor_root(){return this.root instanceof _l?this.root.children.find(e=>e.id===this.anchor_root_id):this.root.find_cube(this.anchor_root_id)}get count_root(){return this.root.child_count}get count_word(){return this._count_word.value}get active_root(){return this.root.children[this.active_root_index-1]}get active_root_index(){return this._active_root_index.value}set active_root_index(e){this._active_root_index.value=e,this.event.emit_status_update()}get count_scope(){return this.root.scope.size}get count_scope_freeze(){return this.root.scope_count_freeze}get count_scope_normal(){return this.root.scope_count_normal}get meta(){return zs.meta}constructor(e){super(e)}update_count_word(e){this._count_word.value+=e,this.event.emit_status_update()}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.stats,version:1}}}class As extends ts{_listener=new Map;_updating_status=!1;get meta(){return As.meta}constructor(e){super(e),this._listen()}_listen(){document.documentElement.addEventListener("keyup",e=>{"Escape"===e.key&&this.emit_esc()}),document.addEventListener("selectionchange",e=>{this.emit_selection_change(e)})}on(e,t){const n=this._listener.get(e);n?n.add(t):this._listener.set(e,new Set([t]))}emit(e,...t){const n=this._listener.get(e);if(!n)return[];const i=[];for(let e of n)i.push(e(...t));return i}off(e){for(let[t,n]of this._listener)for(let t of n)e===t&&n.delete(t)}on_asset_save(e){const t=ns.tips,n=this._listener.get(M["asset-save"]);n?(n.clear(),t?.tip_info("唯一事件-资源保存:回调已覆盖"),n.add(e)):this._listener.set(M["asset-save"],new Set([e]))}async emit_asset_save(e,t,n){const i=ns.tips,r=this._listener.get(M["asset-save"]);if(!r)return i?.tip_warning("未注册保存函数"),!1;const s=[...r][0];return!!s&&await s(e,t,n)}on_asset_download(e){const t=ns.tips,n=this._listener.get(M["asset-download"]);n?(n.clear(),t?.tip_info("唯一事件-资源下载:回调已覆盖"),n.add(e)):this._listener.set(M["asset-download"],new Set([e]))}async emit_asset_download(e,t){const n=ns.tips,i=this._listener.get(M["asset-download"]);if(!i)return n?.tip_warning("未注册保存函数"),!1;const r=[...i][0];return!!r&&await r(e,t)}on_asset_copy(e){const t=ns.tips,n=this._listener.get(M["asset-copy"]);n?(n.clear(),t?.tip_info("唯一事件-资源复制:回调已覆盖"),n.add(e)):this._listener.set(M["asset-copy"],new Set([e]))}async emit_asset_copy(e,t,n){const i=ns.tips,r=this._listener.get(M["asset-copy"]);if(!r)return i?.tip_warning("未注册保存函数"),!1;const s=[...r][0];return!!s&&await s(e,t,n)}emit_replace_id(e,t){const n=this._listener.get(M["replace-id"]);if(!n)return!1;for(let i of n)i(e,t)}on_replace_id(e){const t=this._listener.get(M["replace-id"]);t?t.add(e):this._listener.set(M["replace-id"],new Set([e]))}emit_edit_before(e,t){const n=this._listener.get(M["edit-before"]);if(!n)return!1;for(let i of n)i(e,t)}on_edit_before(e){const t=this._listener.get(M["edit-before"]);t?t.add(e):this._listener.set(M["edit-before"],new Set([e]))}emit_edit_after(e,t){const n=this._listener.get(M["edit-after"]);if(!n)return!1;for(let i of n)i(e,t)}on_edit_after(e){const t=this._listener.get(M["edit-after"]);t?t.add(e):this._listener.set(M["edit-after"],new Set([e]))}emit_text_merge(e,t){const n=this._listener.get(M["text-merge"]);if(!n)return!1;for(let i of n)i(e,t)}on_text_merge(e){const t=this._listener.get(M["text-merge"]);t?t.add(e):this._listener.set(M["text-merge"],new Set([e]))}on_esc(e){const t=this._listener.get(M.esc);t?t.add(e):this._listener.set(M.esc,new Set([e]))}emit_esc(){const e=this._listener.get(M.esc);if(!e)return!1;for(let t of e)t()}on_selection_change(e){this.on(M["selection-change"],e)}emit_selection_change(e){this.emit(M["selection-change"],e)}emit_cursor_nav_before(e){return this.emit(M["cursor-nav-before"],e)}on_cursor_nav_before(e){this.on(M["cursor-nav-before"],e)}emit_cursor_nav_after(e){return this.emit(M["cursor-nav-after"],e)}on_cursor_nav_after(e){this.on(M["cursor-nav-after"],e)}on_enter_before(e){this.on(M["enter-before"],e)}emit_enter_before(e){return this.emit(M["enter-before"],e)}on_enter_after(e){this.on(M["enter-after"],e)}emit_enter_after(e){return this.emit(M["enter-after"],e)}on_show_cube_editor(e){this.on(M["show-cube-editor"],e)}emit_show_cube_editor(e){return this.emit(M["show-cube-editor"],e)}on_text_link_edit(e){this.on(M["text-link-edit"],e)}emit_text_link_edit(e){return this.emit(M["text-link-edit"],e)}on_note_input_before(e){return this.on(M["note-input-before"],e)}emit_note_input_before(e){return this.emit(M["note-input-before"],e)}on_note_compositionend_before(e){return this.on(M["note-input-compositionend-before"],e)}emit_note_compositionend_before(e){return this.emit(M["note-input-compositionend-before"],e)}on_note_compositionend(e){return this.on(M["note-input-compositionend"],e)}emit_note_compositionend(e){return this.emit(M["note-input-compositionend"],e)}on_note_compositionupdate(e){return this.on(M["note-input-compositionupdate"],e)}emit_note_compositionupdate(e){return this.emit(M["note-input-compositionupdate"],e)}on_status_update(e){return this.on(M["status-update"],e)}emit_status_update(){this._updating_status||(this._updating_status=!0,Promise.resolve().then(()=>{const{root:e}=this,t=e,n={mode:this.stats.mode,count_word:this.stats.count_word,count_scope_normal:this.stats.count_scope_normal,count_scope_all:this.root.scope.size,count_stack_redo:this.history.len_redo,count_stack_undo:this.history.len_undo,count_root:this.stats.count_root,active_root_index:this.stats.active_root_index,anchor_root_id:this.stats.anchor_root_id,note_recording:this.stats.is_recording,note_composition_input:this.stats.in_composition_mode,note_showing:this.stats.showing,map_matrix:{...t.matrix2d}};this.emit(M["status-update"],n),this._updating_status=!1}))}on_node_status_click(e){return this.on(M["node-status-clicked"],e)}emit_node_status_click(e,t){return this.emit(M["node-status-clicked"],e,t)}on_fig_click(e){return this.on(M["fig-click"],e)}emit_fig_click(e){return this.emit(M["fig-click"],e)}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.event,version:1}}}class Ts extends ts{_format_brush=null;get meta(){return Ts.meta}get format_brush(){const e={};return this._format_brush&&Object.assign(e,this._format_brush),e}constructor(e){super(e)}paint(e,t=!1){const{root:n,cursor:i,history:r,courier:s}=this,o=new cs(s);if(!e)return;const a=structuredClone(Ft(e));if(a["text-align"]){const t=e["text-align"];o.merge(this.text_align(t)),delete a["text-align"]}if(n.scope_count_normal>0){const e=n.get_scope_cubes();for(let n of e){const e=n.cube;for(let i of e.children.slice(...n.range))o.tell(i,ds.set_css(i.id,structuredClone(a),t))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:l}=i;if(!e||!n||!r)return;const c=ds.set_selection_css(e.id,a,n.id,r.id,s,l,t);o.tell(e,c)}r.record(o)}clear(){const{root:e,cursor:t,history:n,courier:i}=this,r=new cs(i),s={};if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range))r.tell(n,ds.set_css(n.id,structuredClone(s),!1,!0))}}else{const{cube_selection:e,cube_start:n,cube_end:i,offset_start:o,offset_end:a}=t;if(!e||!n||!i)return;const l=ds.set_selection_css(e.id,s,n.id,i.id,o,a,!1,!0);r.tell(e,l)}n.record(r)}text_align(e){const{root:t,cursor:n,history:i,courier:r}=this,s=new cs(r),o={"text-align":e};if(t.scope_count_normal>0){const e=t.get_scope_cubes();for(let t of e){const e=t.cube;for(let n of e.children.slice(...t.range))s.tell(n,ds.set_css(n.id,structuredClone(o)))}}else{const e=t.cursor.find_selection_lines();for(let t of e){const e=ds.set_css(t.id,structuredClone(o));s.tell(t,e)}}return s}indent(){const{root:e,cursor:t,history:n,courier:i,config:r}=this,s=new cs(i);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range)){const e=n.attrs.indent>0?n.attrs.indent+1:1;s.tell(n,ds.set_attr(n.id,{indent:e}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0,n=e>0?e+1:1;s.tell(t,ds.set_attr(t.id,{indent:n}))}}n.record(s)}unindent(){const{root:e,cursor:t,history:n,courier:i}=this,r=new cs(i);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube.children.slice(...e.range);for(let e of t){let t=e.attrs.indent;t>0&&r.tell(e,ds.set_attr(e.id,{indent:t-1}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0;e>0&&r.tell(t,ds.set_attr(t.id,{indent:e-1}))}}n.record(r)}copy_format(){const{root:e,cursor:t}=this;if(e.scope_count_normal>0){const t=[...e.scope_normal][0].focus_cube;this._format_brush=structuredClone(Ft(t.css))}else{const{cube_focus:e}=t;if(!e)return;this._format_brush=structuredClone(Ft(e.css))}}apply_format_brush(){const e=this._format_brush;if(!e)return;const{root:t,courier:n,history:i}=this,r=new cs(n);if(t.scope_count_normal>0){const n=t.get_scope_cubes();for(let t of n)for(let n of t.cube.children.slice(...t.range)){const t=ds.set_css(n.id,e,!1,!0);r.tell(n,t)}}else{const{cube_selection:e,cube_end:t,cube_start:n,offset_start:i,offset_end:s}=this.cursor;if(!e||!t||!n)return;const o=ds.set_selection_css(e.id,this.format_brush,n.id,t.id,i,s,!1,!0);r.tell(e,o)}i.record(r)}static get meta(){return{type:t.painter,version:1}}}class Ps extends ts{_copy_data=[];_img_mime=["image/png","image/jpeg","image/gif"];_paste_stack=[];get pasted_from(){return this._paste_stack[this._paste_stack.length-1]}get copy_data(){return[...this._copy_data]}get meta(){return Ps.meta}constructor(e){super(e)}async copy(e){const{root:t,cursor:n}=this;return t.scope_count_normal>0?this.copy_scope(e):this.copy_selection(e)}async copy_selection(e){const{root:t,cursor:i}=this;if(i.has_selection){this._copy_data=i.find_inline_data();let n=i.get_selection_text();const r={noteid:t.id,versions:rs.export_versions(),cubedata:this._copy_data},s=JSON.stringify(r);return e.setData("application/json",s),e.setData("text/plain",n),!0}{const{cube_end:r}=i;if(!r)return!1;const s=[r.export()];this._copy_data=s;let o="";for(let e of this._copy_data)e.type===n.text&&(o+=e.info);const a={noteid:t.id,versions:rs.export_versions(),cubedata:s},l=JSON.stringify(a);return e.setData("application/json",l),e.setData("text/plain",o),!0}}async copy_scope(e){const t=ns.tips;if(0===this.root.scope.size)return t?.tip_info("无块选区,未复制内容"),!1;if(0===this.root.scope_count_normal)return t?.tip_info("无正常块选区,未复制内容"),!1;const n=this.root.get_scope_cubes();this.root.clear_scope();const i=[];let r="";for(let e of n){for(let t of e.cube.children.slice(...e.range))r+=t.text;i.push(...e.cube.copy(...e.range))}this._copy_data=i;const s={noteid:this.root.id,versions:rs.export_versions(),cubedata:this._copy_data},o=JSON.stringify(s);return e.setData("application/json",o),e.setData("text/plain",r),!0}set_clipboard_cubedata(e,t){const n={noteid:this.root.id,versions:rs.export_versions(),cubedata:t},i=JSON.stringify(n),r=(new TextEncoder).encode(i),s=JSON.stringify([...r]),o=new Blob([e],{type:"text/plain"}),a=new Blob([s],{type:"text/html"}),l=new ClipboardItem({[o.type]:o,[a.type]:a});return this.set_clipboard_data(l)}async paste(e){const{cursor:t,courier:n}=this,i=e.items,r=n.get_recorder();let s=[];r.merge(this.delete()),await fn();for(let e=0;e<i.length;e++){const t=i[e];if(t.type.startsWith("image")){const e=t.getAsFile();e&&s.push(e)}}if(s.length>0){for(let e of s){const t=await this.paste_img(e);r.merge(t)}return r}const o=e.getData("application/json");if(o){let e=!1;try{const t=JSON.parse(o);if(t&&t.cubedata&&t.noteid)return this._paste_stack.push(t),e=!0,r.merge(this.paste_cubes(t.versions||{},t.cubedata)),r}catch(e){}finally{e&&this._paste_stack.pop()}}const a=e.getData("text/html");if(a)try{const e=(new DOMParser).parseFromString(a,"text/html").body.textContent.trim(),t=JSON.parse(e),n=new Uint8Array(t),i=(new TextDecoder).decode(n),s=JSON.parse(i);let o=!1;try{if(s&&s.cubedata&&s.noteid)return this._paste_stack.push(s),o=!0,r.merge(this.paste_cubes(s.versions,s.cubedata)),r}catch(e){}finally{o&&this._paste_stack.pop()}}catch(e){console.error("🟥paste",e)}const l=e.getData("text/plain");if(l){const e=this.get_cubedata_from_text(l);return r.merge(this.paste_cubes(this.root.cube_versions,e)),r}return r}get_cubedata_from_text(e){const t=e.replace("\r","").split("\n"),n=[];if(1===t.length){const e=Zo.get_default(t[0]);n.push(e)}else for(let e of t){if(!e.trim())continue;const t=bl.get_default_by_string(e);n.push(t)}return n}paste_cubes(e,t){if(0===t.length)return;const{courier:n,history:i,cursor:r}=this,s=new cs(n),{cube_selection:o,cube_end:a,cube_start:l,offset_start:c,offset_end:d}=r;if(!o||!a||!l)return;r.has_selection&&s.tell(o,ds.delete(o.id,"backward",l.id,a.id,c,d,!0));const h=ss.replace_id(this.root,e,t);return s.tell(l,ds.insert(l.id,h,l.id,l.id,c,c)),s}async paste_img(e){const{courier:t,history:n,cursor:i}=this,r=new cs(t),{cube_selection:s,cube_end:o,cube_start:a,offset_start:l,offset_end:c}=i;if(!s||!o||!a)return;const d=ko.get_default();if(this.root.isdev)d.info=URL.createObjectURL(e),r.tell(o,ds.insert(o.id,[d],a.id,o.id,l,c));else{const t=d.id+".png",n=t;await this.event.emit_asset_save("image",t,e),d.info=n,r.tell(o,ds.insert(o.id,[d],a.id,o.id,l,c))}return r}delete(){const{root:e,courier:t,cursor:n}=this;return e.scope_count_normal>0?this.delete_scope():n.has_selection?this.delete_selection():void 0}delete_selection(){const{courier:e,cursor:t,history:n}=this,i=new cs(e),{cube_end:r,cube_start:s,cube_selection:o,offset_start:a,offset_end:l}=t;if(!o||!r||!s)return;const c=s.id,d=r.id,h=o.id,u=ds.delete(h,"backward",c,d,a,l);return i.tell(o,u),i}delete_scope(){const e=ns.tips,{root:t,courier:n,history:i,cursor:r}=this;if(0===t.scope.size)return void e?.tip_info("无块选区");if(0===t.scope_count_normal)return void e?.tip_info("无常规块选区");const s=new cs(n),o=this._root.get_scope_cubes(),a=new Map;for(let e of o){let t=a.get(e.cube);t?t.push(e.range):a.set(e.cube,[e.range])}const l=new Set;for(let[e,t]of a){const n=e.children;for(let e of t){const t=n.slice(e[0],e[1]);for(let e of t)l.add(e)}for(let e of l)s.merge(e.remove_self())}return this.root.clear_scope(),s}cut(e){const{root:t,courier:n,cursor:i}=this;t.scope_count_normal>0?this.cut_scope(e):this.cut_selection(e)}cut_scope(e){const{root:t,courier:i,history:r,cursor:s}=this,o=ns.tips;if(0===t.scope.size)return o?.tip_info("无块选区"),!1;if(0===t.scope_count_normal)return o?.tip_info("无常规块选区"),!1;const a=new cs(i),l=this._root.get_scope_cubes(),c=new Map;for(let e of l){let t=c.get(e.cube);t?t.push(e.range):c.set(e.cube,[e.range])}const d=[];for(let[e,t]of c){const n=new Set;e.children;for(let i of t){const t=e.children.slice(i[0],i[1]);for(let e of t)n.add(e);d.push(...e.copy(...i))}for(let e of n)a.merge(e.remove_self())}this._copy_data=d;let h="";for(let e of this._copy_data)e.type===n.text&&(h+=e.info);const u={noteid:this.root.id,versions:rs.export_versions(),cubedata:d},p=JSON.stringify(u);e.setData("text/plain",h),e.setData("application/json",p),this.root.clear_scope(),r.record(a)}cut_selection(e){const{courier:t,cursor:i,history:r}=this,s=new cs(t),{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=i;if(l&&o&&a)if(i.has_selection){this._copy_data=i.find_inline_data();let t="";for(let e of this._copy_data)e.type===n.text&&(t+=e.info);const h={noteid:this.root.id,versions:rs.export_versions(),cubedata:this._copy_data},u=JSON.stringify(h);e.setData("text/plain",t),e.setData("application/json",u);const p=a.id,m=o.id,f=l.id,_=ds.delete(f,"backward",p,m,c,d);s.tell(l,_),r.record(s)}else{const t=o.export();this._copy_data=[t];let i="";for(let e of this._copy_data)e.type===n.text&&(i+=e.info);const a={noteid:this.root.id,versions:rs.export_versions(),cubedata:this._copy_data},l=JSON.stringify(a);e.setData("text/plain",i),e.setData("application/json",l);const c=o.pcube,d=o.index,h=ds.delete_child(c.id,"backward",[d,d+1]);s.tell(c,h),r.record(s)}}set_clipboard_data(e){return new Promise((t,n)=>{navigator.clipboard?navigator.clipboard.write([e]).then(e=>t(!0)).catch(e=>{t(!1),console.error("写入粘贴板数据失败",e)}):t(!1)})}read_clipboard(){return new Promise(e=>{navigator.clipboard?navigator.clipboard.read().then(async t=>{const n=new Map;for(let e of t)if(e instanceof ClipboardItem){const t=e.types;for(let i of t)await e.getType(i).then(async e=>n.set(e.type,e))}e(n)}):e(new Map)})}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.clipboard,version:1}}}class Ns extends ts{static config;cp=Ns.default_config;data;get meta(){return Ns.meta}get css_vars(){const e=this.data;return{"--text-transition":e.text_transition?"0.5s":"none","--text-family":`${e.text_family}`,"--text-fontsize":`${e.text_fontsize||16}px`,"--node-max-width":`${e.map_node_max_width}px`}}constructor(e){super(e),this.data=Lt(Ns.default_config),Ns.config=this.data,this.watch()}init(e){Object.assign(this.data,e),this.cp=structuredClone(Ft(this.data))}watch(){Xi(()=>this.data.map_perf,(e,t)=>{if(e){this.root instanceof Vc&&this.root.check_show();const e=this.root.cubes.get_types_cube(n.submap);for(let[t,n]of e)n.check_show()}else{this.root instanceof Vc&&this.root.show_all();const e=this.root.cubes.get_types_cube(n.submap);for(let[t,n]of e)n.show_all()}})}export(){return structuredClone(Ft(this.data))}static get meta(){return{type:t.config,version:4}}static get default_config(){return{text_transition:!0,text_family:'"Comic Sans MS"',text_fontsize:16,code_theme:"dracula",line_indent:40,history_length:1/0,player_speed:150,revert_scope:!1,map_node_hgap:40,map_node_vgap:40,map_node_padding:4,map_node_max_width:800,map_node_exit_by_esc:!0,map_scale_max:5,map_scale_min:.1,map_scale_step:.1,scroll_distance:20,map_linker_anchor_left:x.point,map_linker_anchor_right:x.arrow,map_linker_line:"bezier2",map_linker_stroke:"black",map_linker_stroke_width:2,map_perf:!0}}}class Os extends ts{selection;cursor_step=20;scroll_distance=50;safa_distance=20;get meta(){return Os.meta}get has_selection(){return!this.selection.isCollapsed}get client_rect(){return this.range?.getBoundingClientRect()}get client_rects(){return this.range?.getClientRects()}get range(){if(0!==this.selection?.rangeCount)return this.selection?.getRangeAt(0)}get ranges(){const e=[];for(let t=0;t<this.selection.rangeCount;t++)e.push(this.selection.getRangeAt(0));return e}get offset_start(){return this.range?this.range?.startOffset:-1}get offset_end(){return this.range?this.range?.endOffset:-1}get node_start(){return this.range?.startContainer}get node_end(){return this.range?.endContainer}get node_focus(){return this.selection.focusNode}get node_anchor(){return this.selection.anchorNode}get top_edge(){return this.safa_distance}get bottom_edge(){return document.documentElement.clientHeight-this.safa_distance}get cube_selection(){if(!this.range)return;const e=this.range.commonAncestorContainer,t=this.stats.active_root;return t&&this.get_node_cube(e,t)||this.get_node_cube(e,this.root)}get cube_start(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.startContainer,i=this.get_node_cube(n,t);return i instanceof Es?i:void 0}get cube_end(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.endContainer,i=this.get_node_cube(n,t);return i instanceof Es?i:void 0}get cube_focus(){const e=this.cube_selection,t=this.node_focus;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof Es?n:void 0}get cube_anchor(){const e=this.cube_selection,t=this.node_anchor;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof Es?n:void 0}constructor(e){super(e);let t=window.getSelection();if(!t)throw Error("NoteCursor : can't find Selection API");this.selection=t}move_up_by_coor(){}locate_next_line(e,t,n){let i="up"===e?t.prev_line:t.next_line;const r=t.clientRect;let s=i?.clientRect;for(;i&&s&&r&&(s.left>=r.right||s.right<=r.left);){let t="up"===e?i.prev_line:i.next_line;if(!t)break;i=t,s=t.clientRect}if(!i)return;const o=[],a=new Map;for(let e of i.children)if(e instanceof Zo){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++)o.push(t[n]),a.set(t[n],e)}const l="up"===e?us.MathRect.get_rect_point(n.left,us._RectPosition.left_mid):us.MathRect.get_rect_point(n.left,us._RectPosition.right_mid),c=us.MathRect.get_nearest_rect(l,o);if(!c)return;const d=us.MathRect.get_shadow_point_horizental(l,c),h=document.caretPositionFromPoint(d.x,d.y);if(h&&h.offsetNode instanceof Text)this.set_cursor(h.offsetNode,h.offset);else if(h&&!(h.offsetNode instanceof Text)){const e=a.get(c);if(!e)return;e.set_cursor_in_tail()}}locate_current_line(e,t,n){const i=[],r=[],s=new Map;for(let e of t.children)if(e instanceof Zo){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++){const r=t[n];i.push(r),s.set(r,e)}}if(1===i.length)return!1;if("up"===e){const e=n.left.top;for(let t of i)t.bottom<=e&&r.push(t)}else if("down"===e){const e=n.right.bottom;for(let t of i)t.y>=e&&r.push(t)}if(r.length>0){const t="down"===e?{x:n.right.x,y:n.right.y}:{x:n.left.x,y:n.left.y},i=us.MathRect.get_nearest_rect(t,r);if(!i)return!1;const o=us.MathRect.get_shadow_point_horizental(t,i),a=document.caretPositionFromPoint(o.x,o.y);if(a&&a.offsetNode instanceof Text)return this.set_cursor(a.offsetNode,a.offset),!0;{const e=s.get(i);if(!e)return!1;e.set_cursor_in_tail()}}return!1}move_vertical(e){const{cube_start:t,cube_end:n}=this;if(!(t instanceof Zo&&n instanceof Zo))return;const i="up"===e?t.line:n.line,r=this.get_selection_edge_position();i&&r&&(this.locate_current_line(e,i,r)||this.locate_next_line(e,i,r))}move_left(){if(!this.range)return;const{cube_start:e,offset_start:t,offset_end:n,node_end:i}=this,{doc:r,courier:s}=this,o=new cs(s);if(e instanceof Zo){if(this.has_selection)return this.set_cursor(this.range.startContainer,this.range.startOffset);if(e.drop_zero_width_space(t).pos>0)if(e.is_empty){let t=e.prev_cube_deep;t&&o.tell(t,hs.in_tail(t.id))}else{const n=e.find_text_nav_pos(t,"left");i&&this.set_cursor(i,n)}else{const t=e.prev_cube_deep;t&&o.tell(t,hs.in_tail(t.id))}}}move_right(){if(!this.range)return;const{cube_end:e,offset_start:t,offset_end:n,node_end:i}=this,{doc:r,courier:s}=this,o=new cs(s);if(e instanceof Zo){if(this.has_selection)return this.set_cursor(this.range.endContainer,this.range.endOffset);if(n<e.drop_zero_width_space(n).len)if(e.is_empty){let t=e.next_cube_deep;t&&o.tell(t,hs.in_head(t.id))}else{const t=e.find_text_nav_pos(n,"right");i&&this.set_cursor(i,t)}else{const t=e.next_cube_deep;t&&o.tell(t,hs.in_head(t.id))}}}move_up(){this.move_vertical("up")}move_down(){return this.move_vertical("down")}move_end(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=this.range;if(!e)return;this.set_cursor(this.range.endContainer,this.range.endOffset);const s=this.range.getClientRects();if(0===s.length)return;const o=us.MathRect.get_rect_point(s[s.length-1],us._RectPosition.center);let a=ss.get_client_rects(e.id);if(!a)return;let l=a.length,c=a[0],d=a[a.length-1],h=d;if(l>1){for(let e=0;e<l;e++){const t=a[e];if(us.MathRect.is_point_in_rect(o,t)){h=t;break}}if(h!==d)return this.locate_cursor_on_rect(h,us._RectPosition.right_mid)}let u=e.next_cube;if(!u)return this.locate_cursor_on_rect(h,us._RectPosition.right_mid);for(a=ss.get_client_rects(u.id);a;){if(l=a.length,c=a[0],c.x<h.right)return this.locate_cursor_on_rect(h,us._RectPosition.right_mid);if(l>1)return this.locate_cursor_on_rect(c,us._RectPosition.right_mid);if(u=u?.next_cube,!u)return this.locate_cursor_on_rect(c,us._RectPosition.right_mid);a=ss.get_client_rects(u.id)}}move_home(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=this.range;if(this.set_cursor(this.range.startContainer,this.range.startOffset),!e)return;const s=this.range.getClientRects();if(0===s.length)return;const o=us.MathRect.get_rect_point(s[s.length-1],us._RectPosition.center);let a=ss.get_client_rects(e.id);if(!a)return;let l=a.length,c=a[0],d=a[a.length-1],h=c;if(l>1){for(let e=0;e<l;e++){const t=a[e];if(us.MathRect.is_point_in_rect(o,t)){h=t;break}}if(h!==c)return this.locate_cursor_on_rect(h,us._RectPosition.left_mid)}let u=e.prev_cube;if(!u)return this.locate_cursor_on_rect(h,us._RectPosition.left_mid);for(a=ss.get_client_rects(u.id);a;){if(l=a.length,d=a[a.length-1],d.right>h.left)return this.locate_cursor_on_rect(h,us._RectPosition.left_mid);if(l>1)return this.locate_cursor_on_rect(d,us._RectPosition.left_mid);if(u=u?.prev_cube,!u)return this.locate_cursor_on_rect(d,us._RectPosition.left_mid);a=ss.get_client_rects(u.id)}}extend_left(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_left(),fn(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_right(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_right(),fn(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_up(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_up();const u=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,u,p)}extend_down(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_down();const u=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,u,p)}extend_home(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_home();const u=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,u,p)}extend_end(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_end();const u=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,u,p)}is_contains_selection(e){const t=[];for(let e of this.ranges)t.push(e.commonAncestorContainer);for(let n of t)if(!this.get_node_cube(n,e))return!1;return!0}get_node_cube(e,t){let n=e instanceof Element?e:e.parentElement;const i=[];for(;n;){if(n.id){let e;if(i.push(n.id),this.root,e=t.find_cube(n.id),e)return e}n=n.parentElement}}get_focus_line(){const{cube_end:e}=this;if(e)return e instanceof Zo?e.line:void 0}set_cursor(e,t){if(!(e instanceof Text))throw Error("NoteCursor : curosr only be set in TextNode");let n=Math.min(e.length,t);this.selection?.setPosition(e,n),e.parentElement&&e.parentElement.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}locate_cursor_on_rect(e,t){let n=us.MathRect.get_rect_point(e,t);const i=document.caretPositionFromPoint(n.x,n.y),r=window.getSelection();if(i&&r&&i.offsetNode instanceof Text)return r.setPosition(i.offsetNode,i.offset)}locate_cursor_by_coor(e,t){const{courier:n,history:i,root:r}=this,s=document.caretPositionFromPoint(e,t),o=s?.offsetNode,a=new cs(n);if(o){if(o instanceof Text)s.offsetNode instanceof Text&&(o.parentElement?.parentElement?.focus(),this.set_cursor(s.offsetNode,s.offset));else{const e=r.cursor.get_node_cube(o,r);if(e?.in_postil)return;const t=e?.pcube;if(!e||!t)return;const n=e.meta;e.next_cube,n.block||a.tell(e,hs.in_head(e.id))}i.record(a)}}set_cursor_by_coor(e,t){if(t<=this.top_edge){let e=document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;us.DomAnimation.scroll_element(document.documentElement,-this.scroll_distance,"vertical"),t+=n}else if(t>=this.bottom_edge){let e=document.documentElement.scrollHeight-document.documentElement.clientHeight-document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;us.DomAnimation.scroll_element(document.documentElement,this.scroll_distance,"vertical"),t-=n}const n=document.caretPositionFromPoint(e,t);if(n&&n.offsetNode instanceof Text){this.set_cursor(n.offsetNode,n.offset);let e=this.get_selection_edge_position()?.right;if(!e)return;return e.y<=this.top_edge?window.scrollBy({top:-this.scroll_distance,behavior:"smooth"}):e.y>=this.bottom_edge&&window.scrollBy({top:this.scroll_distance,behavior:"smooth"}),n}}get_selection_edge_position(){if(!this.range)return;const e=this.range.getClientRects();if(0===e.length)return;const t=e[0],n=e[e.length-1];return{left:new DOMRect(t.x,t.y,0,t.height),right:new DOMRect(n.x,n.y,0,n.height)}}set_selection_between(e,t,n,i){this.selection.setBaseAndExtent(e,t,n,i)}get_selection_text(e=!0){const{cube_end:t,cube_start:n,offset_start:i,offset_end:r}=this;let s="";if(e&&!this.has_selection&&n instanceof Zo)return n.text;if(this.cube_selection instanceof Zo)return this.cube_selection.text.slice(i,r);{let e=!1,o=!1;const a=this.find_inline_cube();for(let l of a){for(let a of l){if(o)break;e||a!==n||(e=!0,a instanceof Zo&&(s+=a.text.slice(i))),o||a!==t||(o=!0,a instanceof Zo&&(s+=a.text.slice(0,r))),e&&!o&&a instanceof Zo&&a!==n&&a!==t&&(s+=a.text)}s+="\n"}}return s}find_cube_by_coor(e){const{x:t,y:n}=e,i=document.elementFromPoint(t,n);if(i)return this.get_node_cube(i,this.root)}find_selection_lines(){const e=[],{cube_selection:t,cube_start:n,cube_end:i}=this;if(t instanceof Zo){let e=t.line;if(e)return[e]}else{if(t instanceof bl)return[t];if(n instanceof Zo&&i instanceof Zo){const t=n.line,r=i.line;if(t&&r){let n=t;for(;n&&(e.push(n),n!==r);)n=n.next_line}}}return e}find_inline_cube(){const e=[],{cube_start:t,cube_end:n,offset_start:i,offset_end:r}=this;if(!t||!n)return e;if(!(t instanceof Zo&&n instanceof Zo))return e;const s=this.find_selection_lines();if(0===s.length)return[];const o=s[0],a=s[s.length-1],l=t.index,c=n.index;if(1===s.length){const t=[];for(let e of o.children.slice(l,c+1))t.push(e);e.push(t)}else{let t=[];for(let e of o.children.slice(l))t.push(e);e.push(t),t=[];for(let n of s.slice(1,-1)){for(let e of n.children)t.push(e);e.push(t),t=[]}for(let e of a.children.slice(0,c+1))t.push(e);e.push(t)}return e}find_inline_data(){const e=[],t=this.find_inline_cube();if(0===t.length)return e;const n=t[0],i=t[t.length-1],r=n[0],s=i[i.length-1],{cube_start:o,cube_end:a,offset_start:l,offset_end:c}=this;if(!o||!a)return e;if(o===a){const t=o.export();t.info=t.info.slice(l,c),e.push(t)}else if(n===i){if(o instanceof Zo&&o===r){const t=o.export();t.info=t.info.slice(l),e.push(t)}for(let t of n.slice(1,-1))e.push(t.export());if(a instanceof Zo&&a===s){const t=a.export();t.info=t.info.slice(0,c),e.push(t)}}else{if(o instanceof Zo&&o===r){const t=o.export();t.info=t.info.slice(l),e.push(t)}e.push(...n.slice(1).map(e=>e.export()));for(let n of t.slice(1,-1)){const t=bl.get_default(n.map(e=>e.export()));e.push(t)}const d=bl.get_default(i.slice(0,-1).map(e=>e.export()));if(a instanceof Zo&&a===s){const e=a.export();e.info=e.info.slice(0,c),d.info.push(e)}e.push(d)}return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.cursor,version:1}}}class Rs extends ts{command_group_do=[];command_group_undo=[];get meta(){return Rs.meta}execute_command_group(e){if(this.stats.mode===z.read)return;const t=(e,n,i)=>{n<i.length&&fn(()=>{this.pass(e),t(i[n+1],n+1,i)})};t(e[0],0,e)}constructor(e){super(e)}get_recorder(){return new cs(this)}pass(e){if(this.stats.mode===z.read)return;const t=e,n=e.id,i=this.root.find_cube(n);if(!i)return console.error("未发现cube:",n);console.log("🟡",i,e);const r=new cs(this);let s=i.on(t);return s instanceof cs&&r.merge(s),r}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.courier,version:1}}}class Ls extends _s{_scopes=Et(new Set);_dom;_children=Et([]);_courier;_history;_cursor;_config;_clipboard;_painter;_event;_stats;_hotkeys;_cubes;_listener;_isdev=!1;constructor(){super(),this._cubes=new xs(this),this._hotkeys=new Ms(this),this._config=new Ns(this),this._cursor=new Os(this),this._courier=new Rs(this),this._history=new ls(this),this._clipboard=new Ps(this),this._painter=new Ts(this),this._event=new As(this),this._stats=new zs(this),this._listener=new ws(this),Promise.resolve().then(()=>this._cubes.add_cube(this)),this.set_cmd_handler(i.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(i.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(i.cube_insert_child,this.on_insert_cube.bind(this)),this.set_cmd_handler(i.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(i.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(i.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(o.cursor_in_tail,this.on_cursor_in_tail.bind(this)),bs.init_cmd_handler(this)}get editable(){return!0}get config(){return this._config}get hotkeys(){return this._hotkeys}get stats(){return this._stats}get cubes(){return this._cubes}get cursor(){return this._cursor}get listener(){return this._listener}get courier(){return this._courier}get history(){return this._history}get clipboard(){return this._clipboard}get painter(){return this._painter}get event(){return this._event}get root(){return this}get isdev(){return this._isdev}get dom(){return document.getElementById(this.id)}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get pid(){}get index(){return 0}get css(){return Object.assign({},this.data.css)}get attrs(){return Object.assign({},this.data.attrs)}get info(){return this.data.info}get child_count(){return this._children.length}get child_first(){return this._children[0]}get child_last(){return this._children[this._children.length-1]}get id(){return this.data.id}get pcube(){}get type(){return this.data.type}get versions(){return Object.assign({},this.data.versions)}get level(){return 0}get in_postil(){return!1}get host_postil(){return null}get next_cube_deep(){}get prev_cube_deep(){}get root_dom(){return this._dom}get is_empty(){const e=1===this.child_count,t=this.child_first.is_empty;return e&&t}get prev_cube(){}get next_cube(){}get host_node(){}get cube_versions(){return rs.export_versions()}get scope(){return new Set([...this._scopes])}get scope_normal(){const e=new Set;for(let t of this.scope)t.freeze||e.add(t);return e}get scope_freeze(){const e=new Set;for(let t of this.scope)t.freeze&&e.add(t);return e}get scope_count_normal(){return this._scopes.size-this.scope_count_freeze}get scope_count_freeze(){let e=0;for(let t of this.scope)t.freeze&&e++;return e}set_dev(e=!0){this._isdev=e,window.root=this}find_child_cube(e){return this._children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}is_contains_cube(e){return!!e&&e.root===this}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}copy(e,t){const n=this._children.slice(e,t),i=[];for(let e of n){let t=e.export();i.push(t)}return i}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_upstream_untill(){}add_scope_by_cube(e){const t=new vs(this,e);this._scopes.add(t),this.event.emit_status_update()}add_scope(e=!1){if(e){const e=this.cursor.cube_end;if(!e||e instanceof Ls)return ns.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(e)}else{const e=this.stats.view_point,t=this.cursor.find_cube_by_coor(e);if(!t||t instanceof Ls)return ns.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(t)}}remove_scope(e){for(let t of this._scopes)if(t.id===e){this._scopes.delete(t);break}}clear_scope(e=!0){for(let t of this._scopes)e&&t.freeze||this._scopes.delete(t)}freeze_scopes(){for(let e of this._scopes)e.freeze=!0}sort_scope(){const e=[...this._scopes];return e.sort((e,t)=>e.pos.y-t.pos.y),e}get_scope_cubes(e=!1,t=!0){if(0===this._scopes.size)return[];const n=[],i=e?this.sort_scope():this.scope;for(let e of i)t&&e.freeze||n.push(e.get_scope_info());return n}get_scope_cubes_data(){const e=this.get_scope_cubes(),t=[];for(let n of e)t.push(...n.cube.copy(n.range[0],n.range[1]));return t}delete_edge(e,t){const{courier:n}=this,i=new cs(n);if("backward"===t){const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.prev_cube_deep;if(n&&n.is_empty)return n.remove_self();const r=n?.next_cube;if(r&&n.type===r.type)return r.merge("left");if(n)return i.tell(n,hs.in_tail(n.id))}else{const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.next_cube_deep;if(n&&n.is_empty)return n.remove_self();const r=n?.prev_cube;if(r&&n.type===r.type)return n.merge("left");if(n)return i.tell(n,hs.in_tail(n.id))}}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return{children:i,data:r}}get_sdk_version(){return rs.get_sdk_meta()}on_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=this.export().info,s=ss.build_cubes(n,this);return this.splice(0,this.child_count,...s),i.add_recover(ds.reset(this.id,r)),i}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new cs(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(ds.reorder(this.id,o.id,c)),a}on_insert_cube(e){const{courier:t}=this,i=t.get_recorder();i.add_cmd(e);const{pos:r,data:s}=e;if(0===s.length)return i;const o=[];for(let e of s)e.type===n.box_root&&o.push(new ml(e,this));let a=this.get_valid_index(r);this.splice(a,0,...o);const l=o[o.length-1];return l&&i.tell(l,hs.in_tail(l.id)),i.add_recover(ds.delete_child(this.id,"backward",[a,a+o.length])),i}on_delete_cube(e){const{courier:t,pcube:n,pid:i}=this,{dir:r,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],h=a-o;if(o!==a){if(o<=0&&a>=this.child_count){const e=this.child_first;return this.child_count>1&&l.tell(this,ds.delete_child(this.id,r,[1,this.child_count])),e.is_empty||l.tell(e,ds.reset(e.id,[])),l}{let e=this.splice(o,h);c&&"backward"===r||!d?l.tell(c,hs.in_tail(c.id)):(d&&"forward"===r||!c)&&l.tell(d,hs.in_head(d.id));const t=e.data;l.add_recover(ds.insert_child(this.id,t,o))}return l}}on_cube_set_selection_css(e){const{cursor:t,courier:n,pcube:i,pid:r}=this,{css:s,start_id:o,end_id:a,offset_end:l,offset_start:c}=e,d=new cs(n);if(o!==a||l!==c){if(a&&!o){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)d.tell(e,ds.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d.tell(t,ds.set_selection_css(t.id,s,null,a,"head",l)),d}if(o&&!a){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)d.tell(e,ds.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d.tell(t,ds.set_selection_css(t.id,s,o,null,c,"tail")),d}if("tail"===l&&"head"===c){for(let e of this.children)d.tell(e,ds.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d}if(a&&o){const e=this.find_cube(o),t=this.find_cube(a),n=e?.find_upstream_untill(this),i=t?.find_upstream_untill(this);if(!n||!i)return;const r=this.children.slice(n.index+1,i.index);for(let e of r)d.tell(e,ds.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d.tell(n,ds.set_selection_css(n.id,s,o,null,c,"tail")),d.tell(i,ds.set_selection_css(i.id,s,null,a,"head",l)),d}}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i,pcube:r}=this,s=new cs(t),{data:o,end_id:a,start_id:l,offset_end:c,offset_start:d}=e,h=this.find_cube(l),u=this.find_cube(a),p=h?.find_upstream_untill(this),m=u?.find_upstream_untill(this);if(!p||!m)return s;if(u!==h||d!==c)if(p&&p===m)s.tell(p,ds.delete(p.id,"backward",l,a,d,c)),s.tell(p,ds.insert(p.id,o,l,a,d,c));else{s.tell(m,ds.delete(m.id,"backward",null,a,"head",c)),s.tell(this,ds.delete_child(this.id,"backward",[p.index+1,m.index])),s.tell(this,ds.insert_child(this.id,e.data,p.index+1)),s.tell(p,ds.delete(p.id,"backward",l,null,d,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,hs.in_tail(t.id))}}else s.tell(u,ds.insert(a,o,l,a,d,c));return s}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:i,start_id:r,end_id:s,offset_end:o,offset_start:a,reserve:l}=e,c=new cs(t);if(!r&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,ds.delete_child(this.id,i,[0,t.index])),c.tell(t,ds.delete(t.id,i,r,s,"head",o)),c}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,ds.delete_child(this.id,i,[t.index+1,this.child_count])),c.tell(t,ds.delete(t.id,i,r,s,a,o)),c}if("head"===a&&"tail"===o)return c.tell(this,ds.reset(this.id,[])),c;if(r&&s){const e=this.find_cube(r),t=this.find_cube(s);if(!(e instanceof Zo&&t instanceof Zo))return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return c;const d=n.index,h=l.index;if(r!==s||a!==o)if(n===l)c.tell(n,ds.delete(n.id,i,r,s,a,o,!0));else{c.tell(l,ds.delete(l.id,i,null,s,"head",o)),c.tell(this,ds.delete_child(this.id,"backward",[d+1,h])),c.tell(n,ds.delete(n.id,i,r,null,a,"tail",!0));let t=0;if("number"==typeof a&&(t=a),c.tell(n,ds.merge(n.id,"right",r,t)),n.is_empty)c.tell(this,ds.delete_child(this.id,"backward",[n.index,n.index+1]));else if(e instanceof Zo){const n=e.pcube;c.tell(n,ds.merge(n.id,"right",r,t))}}return c}}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===Object.keys(i).length)return;const s={};for(let e in i){const t=i[e];s[e]=structuredClone(Ft(this.attrs[e]))||null,null===t?delete this.attrs[e]:this.attrs[e]=t}return r.add_recover(ds.set_attr(this.id,s)),r}on_cursor_in_tail(e){const{courier:t}=this,n=this.child_last,i=new cs(t);if(n)return i.tell(n,hs.in_tail(n.id)),i}}class Es extends _s{_children=Et([]);_has_postil=Wt(!1);postil=null;pcube;data;constructor(e,t){super(),this.pcube=t}get domain(){return"doc"}get text(){let e="";for(let t of this.children)e+=t.text,t instanceof bl&&(e+="\n");return this instanceof bl&&(e+="\n"),e}get top(){let e=this;for(;e;){if(e.pcube instanceof Ls)return e;e=e.pcube}return e}get is_empty(){const e=this.children;return 0===e.length||1===e.length&&this.child_first.is_empty}get children(){return[...this._children]}get has_postil(){return this._has_postil.value}set has_postil(e){this._has_postil.value=e}get dom(){return document.getElementById(this.id)}get level(){return this.pcube.level+1}get host_postil(){return this instanceof Ko?this:this.pcube.host_postil}get host_node(){let e=this.pcube;for(;e&&e instanceof Es;){if("map"===e.domain&&e instanceof js)return e;e=e.pcube}}get in_postil(){return this instanceof Ko||this.pcube.in_postil}get child_count(){return this.children.length}get child_first(){return this.children[0]}get child_first_line(){for(let e of this._children)if(e instanceof bl)return e}get child_last(){return this.children[this.children.length-1]}get pid(){return this.pcube.id}get id(){return this.data.id}get css(){return this.data.css||(this.data.css={}),{...this.data.css,"margin-left":this.attrs.indent>0?this.attrs.indent*this.root.config.data.line_indent+"px":"0px"}}get attrs(){return this.data.attrs||(this.data.attrs={}),this.data.attrs}get info(){return this.data.info}get type(){return this.data.type}get root(){return this.pcube.root}get courier(){return this.root.courier}get config(){return this.root.config}get history(){return this.root.history}get hotkeys(){return this.root.hotkeys}get cursor(){return this.root.cursor}get event(){return this.root.event}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get stats(){return this.root.stats}get versions(){return this.root.versions}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get prev_cube(){return this.pcube.find_prev_cube(this.id)}get next_cube(){return this.pcube.find_next_cube(this.id)}get prev_cube_deep(){let e=this;for(;e;){let t=e.prev_cube;if(t instanceof Es)return t;e=e.pcube}}get next_cube_deep(){let e=this;for(;e;){let t=e.next_cube;if(t instanceof Es)return t;e=e.pcube}}get index(){return this.pcube?this.pcube.find_child_index(this.id):0}_setup(){this.set_cmd_handler(i.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.cube_insert,this.on_insert.bind(this)),this.set_cmd_handler(i.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.cube_set_css,this.on_cube_set_css.bind(this)),this.set_cmd_handler(i.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(i.cube_delete_adjacent,this.on_cube_delete_adjacent.bind(this)),this.set_cmd_handler(i.cube_postil_add,this.on_postil_add.bind(this)),this.set_cmd_handler(i.cube_postil_remove,this.on_postil_remove.bind(this)),this.set_cmd_handler(o.cursor_in_head,this.on_cursor_in_head.bind(this)),this.set_cmd_handler(o.cursor_in_tail,this.on_cursor_in_tail.bind(this)),bs.init_cmd_handler(this)}setup(e,t){let n;try{n=structuredClone(Ft(e))}catch(n){return new Ao(e,t,"克隆数据失败")}if(!n)return new Ao(e,t,"克隆数据为空");try{const i=this.clipboard.pasted_from?.versions,r=i||this.root.versions,s=this.update_data(r[this.meta.type],n);if(!s.data)return new Ao(e,t,"升级后数据为空");if(!s.usable)return new Ao(e,t,"高版本数据,请升级软件");this.data=Lt(s.data),this._setup(),this.build_child(s.data),this.cubes.add_cube(this)}catch(n){return console.error(n),new Ao(e,t,"数据升级失败")}return this}create_child_block(e){const t=ss.pick(e);return ss.build_cubes(t.sort,this)}gc(){this.base_gc()}base_gc(){this.cubes.remove_cube(this);for(let e of this.children)e.gc()}base_export(){const e=structuredClone(Ft(this.data));return this.postil&&(e.attrs.postil=this.postil.export()),e}copy(e,t){const n=this.children.slice(e,t),i=[];for(let e of n){let t=e.export();i.push(t)}return i}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof Pc||t instanceof Vc)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}delete_edge(e,t){const{courier:n}=this,i=new cs(n);if("backward"===t){const t=e.prev_cube_deep,n=t?.next_cube;let r=e.pcube;if(r.is_empty&&r instanceof Es){const e=r.prev_cube_deep;return i.merge(r.remove_self()),e&&i.tell(e,hs.in_tail(e.id)),i}if(t&&t.is_empty)return i.merge(t.remove_self()),n&&i.tell(n,hs.in_head(n.id)),i;if(n&&t.type===n.type)return i.merge(n.merge("left"));if(t)return i.tell(t,hs.in_tail(t.id))}else{const t=e.next_cube_deep,n=t?.prev_cube;let r=e.pcube;for(;r&&r!==this;){const e=r.next_cube_deep;if(r.is_empty&&r instanceof Es)return i.merge(r.remove_self()),e&&i.tell(e,hs.in_head(e.id)),i;r=r.pcube}if(t&&t.is_empty)return i.merge(t.remove_self()),n&&i.tell(n,hs.in_tail(n.id)),i;if(n&&t.type===n.type)return i.merge(t.merge("left"));if(t)return i.tell(t,hs.in_tail(t.id))}}remove_self(e="backward"){const{pcube:t,courier:n,index:i}=this,r=new cs(n);return r.tell(t,ds.delete_child(t.id,e,[i,i+1])),r}merge(e){const{pcube:t,cursor:n,courier:i}=this,{cube_end:r,offset_end:s}=n;if(!r)return;const o=i.get_recorder();return o.tell(this,ds.merge(this.id,e,r.id,s)),o}find_cube(e){if(e===this.id)return this;for(let t of this.children){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];e(this)&&t.push(this);for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}is_contains_cube(e){if(e===this)return!0;let t=e;for(;t;){if(t.pcube===this)return!0;t=t.pcube}return!1}find_upstream_untill(e){if(!e.is_contains_cube(this))return;let t=this;for(;t;){if(t instanceof Es&&t.pcube===e)return t;t=t.pcube}}find_upstream_target(e){let t=this;for(;t instanceof Es;)if(t=t.pcube,e(t))return t}find_child_cube(e){return this.children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}on_cube_set_selection_css(e){const{cursor:t,courier:n}=this,{css:i,start_id:r,end_id:s,offset_end:o,offset_start:a,toggle:l,replace:c}=e,d=new cs(n);if(r!==s||o!==a){if(s&&!r){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)d.tell(e,ds.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,ds.set_selection_css(t.id,i,null,s,"head",o,l,c)),d}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)d.tell(e,ds.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,ds.set_selection_css(t.id,i,r,null,a,"tail",l,c)),d}if("tail"===o&&"head"===a){for(let e of this.children)d.tell(e,ds.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d}if(s&&r){const e=this.find_cube(r),t=this.find_cube(s),n=e?.find_upstream_untill(this),h=t?.find_upstream_untill(this);if(!n||!h)return;const u=this.children.slice(n.index+1,h.index);for(let e of u)d.tell(e,ds.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(n,ds.set_selection_css(n.id,i,r,null,a,"tail",l,c)),n!==h&&d.tell(h,ds.set_selection_css(h.id,i,null,s,"head",o,l,c)),d}}}on_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i}=this,r=new cs(t),{data:s,end_id:o,start_id:a,offset_end:l,offset_start:c}=e,d=this.find_cube(a),h=this.find_cube(o),u=d?.find_upstream_untill(this),p=h?.find_upstream_untill(this);if(!u||!p)return r;if(h!==d||c!==l)if(u&&u===p)r.tell(u,ds.delete(u.id,"backward",a,o,c,l)),r.tell(u,ds.insert(u.id,s,a,o,c,l));else{r.tell(p,ds.delete(p.id,"backward",null,o,"head",l)),r.tell(this,ds.delete_child(this.id,"backward",[u.index+1,p.index])),r.tell(this,ds.insert_child(this.id,s,u.index+1)),r.tell(u,ds.delete(u.id,"backward",a,null,c,"tail"));let e=s[s.length-1];const t=this.top.find_cube(e.id);t&&r.tell(t,hs.in_tail(e.id))}else r.tell(h,ds.insert(o,s,a,o,c,l));return r}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:i,start_id:r,end_id:s,offset_end:o,offset_start:a,reserve:l}=e,c=new cs(t);if(!r&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,ds.delete_child(this.id,i,[0,t.index],l)),c.tell(t,ds.delete(t.id,i,r,s,"head",o,l)),c}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,ds.delete_child(this.id,i,[t.index+1,this.child_count],l)),c.tell(t,ds.delete(t.id,i,r,s,a,o,l)),c}if("head"===a&&"tail"===o){if(l){if(this.is_empty)return;c.tell(this,ds.delete_child(this.id,i,[1,this.child_count]));const e=this.child_first;e.meta.block?c.tell(e,ds.delete_child(e.id,i,[0,e.child_count],l)):e instanceof Zo?(c.tell(e,Jo.reset(e.id,"")),c.tell(e,hs.loc(e.id,1,e.id,1))):c.tell(e,ds.reset(e.id,[]))}else c.tell(this.pcube,ds.delete_child(this.pid,"backward",[this.index,this.index+1]));return c}if(r&&s){const e=this.find_cube(r),t=this.find_cube(s);if(!e||!t)return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return c;const d=n.index,h=l.index;if(r!==s||a!==o)if(n===l)c.tell(n,ds.delete(n.id,i,r,s,a,o,!0));else if(c.tell(l,ds.delete(l.id,i,null,s,"head",o)),c.tell(this,ds.delete_child(this.id,"backward",[d+1,h])),c.tell(n,ds.delete(n.id,i,r,null,a,"tail",!0)),e instanceof Zo){const t=e.get_valid_index(a);e.set_cursor_in_head(t)}return c}}on_cube_set_css(e){const{courier:t,cursor:n}=this,{css:i,toggle:r,replace:s}=e,o=t.get_recorder();if(o.add_cmd(e),s){const e=structuredClone(Ft(this.css));return this.data.css=i,o.add_recover(ds.set_css(this.id,e,!1,!0)),o}if(0===Object.keys(i).length)return;let a=!0;const l=structuredClone(Ft(this.css)),c=structuredClone(Ft(this.css));for(let e in i){const t=i[e],n=this.css[e]||null;l[e]=n,null===t||r&&t===n?(a=!1,delete c[e]):t!==n&&(a=!1,c[e]=t)}return this.data.css=c,a?void 0:(o.add_recover(ds.set_css(this.id,l)),o)}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===Object.keys(i).length)return;const s={};for(let e in i){const t=i[e];s[e]=structuredClone(Ft(this.attrs[e]))||null,null===t?delete this.data.attrs[e]:this.data.attrs[e]=t}return r.add_recover(ds.set_attr(this.id,s)),r}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:i,index:r}=this,{from:s,from_id:o,offset:a}=e,l=new cs(t);if(this.meta.block){const e=this.child_first,t=this.child_last;this.is_empty&&l.tell(n,ds.delete_child(i,"backward",[this.index,this.index+1])),"left"===s?l.tell(e,hs.in_head(e.id)):l.tell(t,hs.in_tail(t.id))}else l.tell(n,ds.delete_child(i,"backward",[this.index,this.index+1]));return l}on_postil_add(e){const{courier:t}=this,{data:n}=e;if(this.postil){const e=new cs(t),i=this.postil;return e.tell(i,ds.insert_child(i.id,n,i.child_count)),this.has_postil=!0,this.postil.show=!0,e}{const i=t.get_recorder();i.add_cmd(e);const r=Ko.get_default(n),s=new Ko(r,this);return this.postil=s,i.add_recover(ds.postil_remove(this.id,[0,s.child_count])),this.postil.show=!0,this.has_postil=!0,i}}on_postil_remove(e){const{courier:t}=this,{range:n}=e,[i,r]=n,s=this.postil;if(!s)return;let o=i<0?0:i,a=r>s.child_count?s.child_count:r;if(o<=0&&a>=s.child_count){const n=t.get_recorder();n.add_cmd(e);const i=s.export();return n.add_recover(ds.postil_add(this.id,i.info)),this.postil=null,this.has_postil=!1,s.gc(),n}{const e=new cs(t);return e.tell(s,ds.delete_child(s.id,"backward",[o,a])),e}}on_cursor_in_head(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new cs(t);if(this.meta.block){const e=this.child_first;if(!e)return s;s.tell(e,hs.in_head(e.id))}else if(this instanceof Zo)this.prev_cube instanceof Zo&&this.len>=1?this.set_cursor_in_head(1):this.set_cursor_in_head(0);else if(r&&r instanceof Zo)r.set_cursor_in_head();else{const e=Zo.get_default();s.tell(i,ds.insert_child(i.id,[e],this.index+1))}return s}on_cursor_in_tail(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new cs(t);if(this.meta.block){const e=this.child_last;if(!e)return s;s.tell(e,hs.in_tail(e.id))}else if(this instanceof Zo)this.next_cube instanceof Zo&&this.len>=1?this.set_cursor_in_tail(1):this.set_cursor_in_tail(0);else if(n&&n instanceof Zo)n.set_cursor_in_tail();else{const e=Zo.get_default();s.tell(i,ds.insert_child(i.id,[e],this.index))}return s}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}get_valid_range(e){let[t,n]=e;return t<0&&(t=0),n>this.child_count&&(n=this.child_count),[t,n]}}class Ds extends Es{}class Is{_node;_map;_bound;_env=Lt({upstream:void 0,downstream:[],layout:null});_all_downstream_nodes=Jr(()=>this.get_layout_downstream_nodes());_siblings_info=Jr(()=>this.get_siblings_info());_folded_upstream=Jr(()=>{let e=this.upstream;for(;e;){if(e.attrs.fold||e.is_layout_root)return e.attrs.fold;e=e.env.upstream}return!1});get siblings(){return this._siblings_info.value}get bound(){return this._bound}get map(){return this._map}get to(){return this.node.to}get from(){return this.node.from}get nodes_to(){return this.node.nodes_to}get nodes_from(){return this.node.nodes_from}get node(){return this._node}get index(){return this.upstream?this.upstream.env.downstream.indexOf(this.node):0}get prev_node(){if(!this.upstream)return;const e=this.index;return this.upstream.env.downstream[e-1]}get next_node(){if(!this.upstream)return;const e=this.index;return this.upstream.env.downstream[e+1]}get level(){return this.node.is_layout_root||!this.upstream?0:this.layout_line.length-1}get upstream(){return this._env.upstream}get downstream(){return[...this._env.downstream]}get downstream_nodes(){return[...this._all_downstream_nodes.value]}get is_captive(){return!(this.node.is_layout_root||!this.layout_root||!this.layout_root.attrs.layout||!this.upstream)}get layout_line(){const e=[];if(!this.upstream)return e;let t=this.node;for(;t;){if(e.unshift(t),t.is_layout_root)return e;t=t.env.upstream}return[]}get layout_root(){return this.layout_line[0]}get folded_upstream(){return!this.node.is_layout_root&&this._folded_upstream.value}get folded_self(){return this._node.attrs.fold}get folded(){return this.folded_self||this.folded_upstream}get layout_from(){if(this.node.attrs.layout)return this.node;const e=this.layout_line;for(let t of e.reverse())if(t.is_layout_root||t.attrs.layout)return t;return this.node}get layout_type(){return this._node.attrs.layout||this._env.layout}constructor(e){this._node=e,this._map=e.pcube,this._bound=e.bound}clear(){this._env.upstream=void 0,this._env.downstream.length=0}update(e){const{upstream:t,downstream:n}=e;t&&(this._env.upstream=t),n&&(this._env.downstream=[...n])}flow(e){e?(this._env.upstream=e.node,this._env.layout=this._node.attrs.layout||e.get_downstream_layout_type(this.node)):this._node.is_layout_root&&(this._env.upstream=this._node),this._env.downstream.length=0;for(let e of this.nodes_to){const{has_root:t,line:n}=es.find_line_to_layout_root(e);t&&n[1]===this.node&&this._env.downstream.push(e)}for(let e of this._env.downstream)e.env.flow(this)}get_layout_downstream_nodes(){const e=[...this.downstream];for(let t of e)e.push(...t.env.downstream);return e}get_downstream_layout_type(e){const t=this.layout_type||this.node.attrs.layout;if(!t)return null;if(e===this.node)return t;if(["down","up","left","right"].includes(t))return t;const n=e.env.level-this.level;return"time-right"===t?1===n?"time-down":"right":"time-down"===t?"right":t}get_siblings_info(){const e=this.upstream;if(!e)return;const t=e.env.downstream,n=t.indexOf(this.node);return n<0?void 0:{prev:t[n-1],next:t[n+1],index:n}}}class Bs{_node;_map;_in_view=Wt(!0);_env;_bound;_wacher=null;_watcher_line=null;get env(){return this._env}get bound(){return this._bound}get node(){return this._node}get map(){return this._map}get in_view(){return this._in_view.value}set in_view(e){this._in_view.value=e}get show(){const e=!this.env.folded_upstream,t=!this.node.pcube.perf||this.in_view;return e&&t}constructor(e){this._node=e,this._map=e.pcube,this._env=e.env,this._bound=e.bound}gc(){this._wacher&&this._wacher.stop(),this._watcher_line&&this._watcher_line.stop()}start_watcher(){this._wacher=Xi(()=>this.show,(e,t)=>{this._map.set_graph_visible(this.node,e),this.node.check_show_line()},{immediate:!0}),this._watcher_line=Xi(()=>this.env.folded,()=>{this.node.check_show_line()},{immediate:!0})}check_show(){if(this.env.folded_upstream||!this.map.perf)return!1;const e=this.map.view_rect;us.MathRect.check_intersection(e,this.node.rect)?this.in_view=!0:this.in_view=!1}}class js extends Ds{_editable=Wt(!1);_waiter=new Set;_layout_self_success=!1;_show=Wt(!0);_mis=2;_env;_checker;bound;data;pcube;icons={right:"icon-right iconfont",left:"icon-left iconfont",up:"icon-up iconfont",down:"icon-down iconfont","time-down":"icon-time-down iconfont","time-right":"icon-time-right iconfont"};shape=Lt({type:"rect",path:"",sample:[]});constructor(e,t){super(e,t),this.pcube=t,this._init_handler(),this._env=new Is(this),this._checker=new Bs(this),this.bound=new Fc(this,e.attrs.matrix2d||Zr.get_default()),this.shape.type=e.attrs.shape||"rect"}get is_selected(){return this.pcube.is_node_selected(this)}get env(){return this._env}get checker(){return this._checker}get mis(){return this._mis}get matrix2d(){return this.attrs.matrix2d}get rect(){return this.bound.rect}get show(){return this.checker.show}_sample=Jr(()=>{if(this.is_layout_root||!this.env.upstream){const e={x:this.matrix2d.e,y:this.matrix2d.f};return es.offset_points(this.shape.sample,e)}return es.offset_points(this.shape.sample,this.bound.pos)});get layout_self_success(){return this._layout_self_success}get attrs(){return this.data.attrs}get path(){return this.shape.path}get sample_count(){return 8}get sample(){return this._sample.value}get editable(){return this._editable.value}set editable(e){e?this.pcube.register_node_editing(this):this.pcube.remove_node_editing(this),this._editable.value=e;const t=this.courier.get_recorder(),n=this.child_last,i=hs.in_tail(n.id);t.tell(n,i),this.history.record(t)}get is_layout_root(){return this.attrs.root||!1}get domain(){return"map"}get from(){const e=this.pcube.get_node_from(this.id);return new Set(e||[])}get to(){const e=this.pcube.get_node_to(this.id);return new Set(e||[])}get node_last(){const e=this.pcube.get_node_to(this.id),t=e?e[e.length-1]:this.id;return this.pcube.get_node(t)||this}get count_from(){return this.from.size}get count_to(){return this.to.size}get nodes_to(){const e=[];for(let t of this.to){const n=this.pcube.get_node(t);n&&e.push(n)}return e}get nodes_from(){const e=[];for(let t of this.from){const n=this.pcube.get_node(t);n&&e.push(n)}return e}get matrix2d_dom_string(){const{a:e,b:t,c:n,d:i,e:r,f:s}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return Zr.get_dom_string(this.matrix2d);{const r=this.bound.pos;return`matrix(${e.toFixed(1)},${t},${n},${i.toFixed(1)},${r.x.toFixed(1)},${r.y.toFixed(1)})`}}get matrix2d_real(){const{a:e,b:t,c:n,d:i,e:r,f:s}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return{...this.matrix2d};{const r=this.bound.pos;return{a:e,b:t,c:n,d:i,e:r.x,f:r.y}}}_init_handler(){this.set_cmd_handler(i.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(i.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(i.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(i.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(i.cube_insert_child,this.on_insert_child.bind(this)),this.set_cmd_handler(l.append_child,this.on_append_child.bind(this)),this.set_cmd_handler(l.layout_update,this.on_layout_update.bind(this))}check_show(){return this.checker.check_show()}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof Pc||t instanceof Vc)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}move_to_center(){const e=this.pcube.get_view_center(),t=this.pcube.transform_point(e),n=this.bound.pos_center,i=this.pcube.real_point_to_fig(n),r=t.x-i.x,s=t.y-i.y,o=Zr.multiply(this.pcube.matrix2d,Zr.get_matrix_translate(r,s));this.pcube.reset_matrix(o)}move_in_fig_view(){if(this.check_in_fig_view(!0))return;const e=this.pcube,t=e.view_rect,{dx:n,dy:i}=us.MathRect.move_rect_in_other(this.bound.rect,t),r=Zr.multiply(e.matrix2d,Zr.get_matrix_translate(n,i));e.reset_matrix(r),e.check_show()}check_in_fig_view(e=!1){const t=this.pcube.view_rect;return e?us.MathRect.can_contain(t,this.rect):us.MathRect.check_intersection(t,this.rect)}check_show_downstream(){return this.env.folded||this.pcube.perf}layout(){let e=Date.now();if(this.is_layout_root&&this.bound.update_pos_tree_root(),this.env.layout_type||this.is_layout_root){const t=this.env.downstream;if(ps.layout_tree(this,t),!this.env.folded_self)for(let e of this.env.downstream)e.layout();if(this.pcube.perf&&!this.env.folded_self)for(let e of t)e.check_show();this.is_layout_root&&console.log("⚫布局根布局",this.id,Date.now()-e)}}layout_throttle=us.Notice.throttle(this.layout.bind(this),50);layout_self(e){const t=e.borderBoxSize[0];if(!t)return;const{blockSize:n,inlineSize:i}=t,r=this.bound.size;if(this.layout_self_success&&Math.abs(r.width-i)<this.mis&&Math.abs(r.height-n)<this.mis)return;this._layout_self_success=!0;const s={width:Math.ceil(i),height:Math.ceil(n)};this.bound.update_size(s.width,s.height),this.shape.path=$c.get_shaple(this),this.shape.sample=this.get_sample(),!this.env.upstream&&this.pcube.perf&&this.check_show();for(let e of this._waiter)e()}wait_layout_self(){return new Promise(e=>{this._layout_self_success?e(!0):this._waiter.add(e)})}check_show_line(){const e=this.id;for(let t of this.to){const n=es.get_linker_id(e,t),i=this.pcube.get_linker(n);i&&(this.attrs.fold?i.show=!1:i.to_node?.show||this.show?i.show=!0:i.show=!1)}for(let t of this.from){const n=es.get_linker_id(t,e),i=this.pcube.get_linker(n);if(!i)continue;let r=i.from_node;const s=!r?.attrs.fold,o=this.show||r?.show;i.show=!(!s||!o)}}get_sample(){if("rect"===this.shape.type){const e={x:0,y:0,...this.bound.size_bound},t=us.MathRect.get_rect_point;return[t(e,us._RectPosition.left_top),t(e,us._RectPosition.top_mid),t(e,us._RectPosition.right_top),t(e,us._RectPosition.right_mid),t(e,us._RectPosition.right_bottom),t(e,us._RectPosition.bottom_mid),t(e,us._RectPosition.left_bottom),t(e,us._RectPosition.left_mid),t(e,us._RectPosition.left_top)]}return es.svg_path_sample(this.shape.path,this.sample_count)}gc(){this.checker.gc(),this.base_gc()}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return{children:i,data:r}}reset_matrix(e){Object.assign(this.matrix2d,e),this.bound.update_pos()}get_node(e){if(e)return this.pcube.get_node(e)}get_layout_index(e){return e.indexOf(this)}translate(e,t){const n=Zr.translate(this.matrix2d,e,t);this.reset_matrix(n)}break_link_node(e){this.from.delete(e),this.to.delete(e)}remove_self(){for(let e of this.from){const t=this.pcube.find_child_cube(e);t&&t instanceof js&&t.break_link_node(this.id)}for(let e of this.to){const t=this.pcube.find_child_cube(e);t&&t instanceof js&&t.break_link_node(this.id)}return super.remove_self()}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}on_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=this.export().info,s=ss.build_cubes(n,this);return this.splice(0,this.child_count,...s),i.add_recover(ds.reset(this.id,r)),i}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new cs(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(ds.reorder(this.id,o.id,c)),a}on_insert_child(e){const{courier:t}=this,i=t.get_recorder();i.add_cmd(e);const{pos:r,data:s}=e;if(0===s.length)return i;const o=[];for(let e of s)e.type===n.box_root&&o.push(new ml(e,this));let a=this.get_valid_index(r);this.splice(a,0,...o);const l=o[o.length-1];return l&&i.tell(l,hs.in_tail(l.id)),i.add_recover(ds.delete_child(this.id,"backward",[a,a+o.length])),i}on_delete_cube(e){const{courier:t,pcube:n,pid:i}=this,{dir:r,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],h=a-o;if(o!==a){if(o<=0&&a>=this.child_count){this.child_first,l.tell(this,ds.reset(this.id,[]));const e=ds.insert_child(this.id,[ml.get_default()],0);return l.tell(this,e),l}{let e=this.splice(o,h);c&&"backward"===r||!d?l.tell(c,hs.in_tail(c.id)):(d&&"forward"===r||!c)&&l.tell(d,hs.in_head(d.id));const t=e.data;l.add_recover(ds.insert_child(this.id,t,o))}return l}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i,pcube:r}=this,s=new cs(t),{data:o,end_id:a,start_id:l,offset_end:c,offset_start:d}=e,h=this.find_cube(l),u=this.find_cube(a),p=h?.find_upstream_untill(this),m=u?.find_upstream_untill(this);if(!p||!m)return s;if(u!==h||d!==c)if(p&&p===m)s.tell(p,ds.delete(p.id,"backward",l,a,d,c)),s.tell(p,ds.insert(p.id,o,l,a,d,c));else{s.tell(m,ds.delete(m.id,"backward",null,a,"head",c)),s.tell(this,ds.delete_child(this.id,"backward",[p.index+1,m.index])),s.tell(this,ds.insert_child(this.id,e.data,p.index+1)),s.tell(p,ds.delete(p.id,"backward",l,null,d,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,hs.in_tail(t.id))}}else s.tell(u,ds.insert(a,o,l,a,d,c));return s}on_layout_update(e){const{courier:t,history:n}=this,{attrs:i}=e,r=t.get_recorder(),s=structuredClone(Ft(this.data.attrs));let o=!1;r.add_cmd(e);const a=this.attrs.fold;for(let e in i){const t=i[e];t!==this.attrs[e]&&(this.attrs[e]=t,o=!0)}if("matrix2d"in i&&i.matrix2d){const e=i.matrix2d;this.reset_matrix(e)}"fold"in i&&a!==i.fold&&(this.bound.flow("downstream"),this.bound.flow("upstream")),o&&(this.is_layout_root?(this.env.flow(),this.layout_throttle()):this.env.layout_root?.layout_throttle());const l=ms.layout_change(this.id,s);return r.add_recover(l),r}on_append_child(e){const{courier:t,history:n,pcube:i}=this,{previd:r}=e,{map_node_hgap:s,map_node_vgap:o}=this.config.data,a=t.get_recorder(),l=this.node_last.bound,c={x:l.pos.x,y:l.pos.y+l.size_bound.height+o},d=Hc.get_default(c),h=fs.node_add(i.id,[d]);a.tell(i,h);const u=es.create_linker_info(this.pcube,this.id,d.id),p=fs.linker_add(i.id,[u]);a.tell(i,p);const m=i.get_node_to(this.id),f=m?.indexOf(d.id);if(m&&void 0!==f&&f>=0)if(null===r)m.splice(f,1),m.unshift(d.id);else if(r){const e=m.indexOf(r);e>=0&&(m.splice(f,1),m.splice(e+1,0,d.id))}return this.env.flow(),a}static get_default_node_size(e=0){return{width:120+2*e,height:36+2*e}}static get_default_node_pos(e,t){const{map_node_padding:n}=t.config.data,i=t.view_point_to_real(e),r=js.get_default_node_size(n);return{x:i.x-r.width/2,y:i.y-r.height/2}}}function qs(e,t){return t.css.width?Number.parseInt(t.css.width.trim().slice(0,-2)):e.getBoundingClientRect().width}function Hs(e,t,n,i){e.stopPropagation(),e.preventDefault(),i.isdown=!0,i.dir=n,i.dom=t.dom;const r=e.currentTarget,s=r.parentElement?.parentElement;if(!s)return;i.x=e.clientX,i.width_origin=t.css.width;const o=qs(s,t);i.width=o,i.width_result=o}const Fs=Lt({point:{x:0,y:0},css:{},cube:void 0,menu:void 0,stack_pos:[],stack_menus:[],stack_rect:[]}),$s=Lt({open:!1,data:{},submit(){}});function Gs(e,t){$s.open=!0,$s.submit=t,$s.data=e}function Vs(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=ns.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row,l.col-1))return o?.tip_info("左侧已存在单元格");if(l.col-1<0)return o?.tip_info("左侧已达边界");{const t=i.get_recorder(),n={row:l.row,col:l.col-1,rowspan:1,colspan:1,data:kl.get_default()};t.tell(e,ev.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_col_left(t.left))return o?.tip_info("左侧不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[0];t++)r.push(kl.get_default());n.tell(e,ev.add_col(e.id,l.col,r)),s.record(n)}}function Us(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=ns.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row,l.col+1))return o?.tip_info("右侧已存在单元格");if(l.col+1>=e.size[1])return o?.tip_info("右侧已达边界");{const t=i.get_recorder(),n={row:l.row,col:l.col+1,rowspan:1,colspan:1,data:kl.get_default()};t.tell(e,ev.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_col_right(t.right))return o?.tip_info("右侧不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[0];t++)r.push(kl.get_default());n.tell(e,ev.add_col(e.id,l.col+l.colspan,r)),s.record(n)}}function Ws(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=ns.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row-1,l.col))return o?.tip_info("上方已存在单元格");if(l.row-1<0)return o?.tip_info("上方已达边界");{const t=i.get_recorder(),n={row:l.row-1,col:l.col,rowspan:1,colspan:1,data:kl.get_default()};t.tell(e,ev.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_row_top(t.top))return o?.tip_info("上方不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[1];t++)r.push(kl.get_default());n.tell(e,ev.add_row(e.id,l.row,r)),s.record(n)}}function Ys(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=ns.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row+1,l.col))return o?.tip_info("下方已存在单元格");if(l.row+1>=e.size[0])return o?.tip_info("下方已达边界");{const t=i.get_recorder(),n={row:l.row+1,col:l.col,rowspan:1,colspan:1,data:kl.get_default()};t.tell(e,ev.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_row_bottom(t.bottom))return o?.tip_info("下方不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[1];t++)r.push(kl.get_default());n.tell(e,ev.add_row(e.id,l.row+l.rowspan,r)),s.record(n)}}function Xs(e,t){const{cursor:n,courier:i,stats:r,history:s,id:o}=e,a=ns.tips,{cube_end:l}=n,c=e.get_active_cell();if(!c)return a?.tip_info("未发现激活单元格");const d=i.get_recorder(),h=e.get_cell_area(c);d.tell(e,ev.col_resize(o,[h.left,h.right],t)),s.record(d)}let Ks,Js,Qs=!1,Zs=null,eo=null;function to(e){const{courier:t,history:n,id:i,cubes:r}=e,s=t.get_recorder();s.tell(e,ds.fold(i,!e.attrs.fold)),n.record(s);for(let t of Object.values(r.postils))t.pcube?.top===e&&t.visible(!1);const o=e.child_first.id;if(!o)return;const a=document.getElementById(o);a?.scrollIntoView({block:"nearest",behavior:"smooth"})}function no(e,t){to(t)}function io(e,t){e.preventDefault();const{root:n,stats:i}=t;i.anchor_root_id===t.id?i.anchor_root_id="":n.stats.anchor_root_id=t.id}function ro(e,t){const{courier:n,history:i}=e,r=n.get_recorder();r.tell(e,ds.set_attr(e.id,{column_count:t,column_width:null})),i.record(r)}function so(e,t){const{courier:n,history:i}=e,r=n.get_recorder();r.tell(e,ds.set_attr(e.id,{column_width:t,column_count:null})),i.record(r)}class oo{static reset(e,t){return{id:e,name:f.reset,data:t}}static add(e,t,n){return{id:e,name:f.add,data:t,pos:n}}static remove(e,t){return{id:e,name:f.remove,range:t}}static indent(e,t){return{id:e,name:f.indent,items:t}}}function ao(e,t=!1){const n=e,{cursor:i,courier:r,history:s}=e,{cube_start:o,cube_end:a}=i;if(!o||!a)return;const l=r.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,oo.indent(n.id,r)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,oo.indent(n.id,r)),s.record(l)}}function lo(e,t=!1){const n=e,{cursor:i,courier:r,history:s}=e,{cube_start:o,cube_end:a}=i;if(!o||!a)return;const l=r.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,yd.indent(n.id,r)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,yd.indent(n.id,r)),s.record(l)}}function co(e,t=!1){const n=e,{cursor:i,courier:r,history:s}=e,{cube_start:o,cube_end:a}=i;if(!o||!a)return;const l=r.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,ad.indent(n.id,r)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,ad.indent(n.id,r)),s.record(l)}}function ho(e,t="tail"){const{courier:n,history:i}=e,r=new cs(n),s=[kl.get_default(),kl.get_default()],o=td.insert_row(e.id,t,[s]);r.tell(e,o),i.record(r)}async function uo(e,t){e.preventDefault(),e.stopPropagation(),Fs.cube=t,Fs.point={x:e.clientX,y:e.clientY},Fs.stack_pos.length=0,Fs.stack_rect.length=0,Fs.stack_menus.length=0,t instanceof Qm?Fs.menu=function(e){const t=[...fo(e,!0),{usable:!0,title:"语言",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){return{title:"选择语言",active:[e.active_tab?.lang||""],menus:e.langs.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:i,history:r,id:s,active_tab:o}=e;if(!o)return;const a=i.get_recorder();a.tell(e,Md.change_lang(s,o.id,t)),r.record(a)}}))}}(e),click(e){}},{usable:!0,title:"主题",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){return{title:"选择主题",active:[e.active_tab?.theme||""],menus:e.themes.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:i,history:r,id:s,active_tab:o}=e;if(!o)return;const a=i.get_recorder();a.tell(e,Md.change_theme(s,o.id,t)),r.record(a)}}))}}(e),click(e){}},{usable:!0,title:"添加代码块",icon:["iconfont","icon-add"],click(t){Gs({文件名:""},t=>{const n=t["文件名"],i=n.lastIndexOf(".");let r="typescript";if(i>=0){const e=n.slice(i);r=Xm[e]||r}const{code_theme:s}=e.config.data,o=e.create_tab(r,n,s),a=e.courier.get_recorder();a.tell(e,Md.add(e.id,o)),e.history.record(a)})},mouseenter(e){}},{usable:!0,title:"重命名",icon:["iconfont","icon-rename"],click(t){Gs({文件名:e.active_tab?.name||""},t=>{const n=e.active_tab;if(!n)return;const i=t["文件名"],r=e.courier.get_recorder();r.tell(e,Md.rename(e.id,n.id,i)),e.history.record(r)})},mouseenter(e){}},{usable:!0,title:"复制代码",icon:["iconfont","icon-copy"],click(t){e.copy_code()},mouseenter(e){}},{usable:!0,title:"清空代码",icon:["iconfont","icon-eraser"],click(t){const n=e.active_tab;if(!n)return;const i=e.courier.get_recorder();i.tell(e,Md.update(e.id,n.id,"")),e.history.record(i)},mouseenter(e){}},{usable:!0,title:"删除代码",icon:["iconfont","icon-close"],click(t){const n=e.active_tab;if(!n)return;const i=e.courier.get_recorder();i.tell(e,Md.remove(e.id,n.id)),e.history.record(i)},mouseenter(e){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof fv?Fs.menu=function(e){const t=e.get_active_cell(),n=[...fo(e),{usable:!0,title:e.title?"移除标题":"添加标题",icon:["iconfont","icon-a-Addheader2x"],has_submenu:!1,mouseenter(e){},click(t){const{history:n,courier:i,id:r}=e,s=i.get_recorder();if(e.title){const t=ev.remove_title(r);s.tell(e,t)}else{const t=kl.get_default(),n=ev.add_title(r,t);s.tell(e,n)}n.record(s)}},{usable:e.selection_cells.length>0,title:"复制子表",icon:["iconfont","icon-grid"],has_submenu:!1,mouseenter(e){},click(t){const{clipboard:n}=e,i=ns.tips,r=e.copy_selection_table();if(!r)return ns.tips?.tip_error("复制子表失败");const s=e.get_selection_text();n.set_clipboard_cubedata(s,[r]),i?.tip_success("复制子表成功")}},{usable:e.selection_cells.length>0,title:"合并单元格",icon:["iconfont","icon-hebingdanyuange"],has_submenu:!1,mouseenter(e){},click(t){!function(e){const{courier:t,id:n,history:i}=e,r=ns.tips,s=t.get_recorder(),o=e.get_selection_area();if(!o)return r?.tip_info("无选中单元格");s.tell(e,ev.merge(n,o)),i.record(s)}(e)}},{usable:!!t,title:"扩大当前列宽",icon:["iconfont","icon-expand-horizontal-1--expand-resize-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){Xs(e,1)}},{usable:!!t,title:"缩小当前列宽",icon:["iconfont","icon-shrink-horizontal-1--resize-shrink-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){Xs(e,-1)}},{usable:!!t,title:"向左插入列",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇠",mouseenter(e){},click(t){Vs(e)}},{usable:!!t,title:"向右插入列",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇢",mouseenter(e){},click(t){Us(e)}},{usable:!!t,title:"向上插入行",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + shift + ↑",mouseenter(e){},click(t){Ws(e)}},{usable:!!t,title:"向下插入行",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇣",mouseenter(e){},click(t){Ys(e)}},{usable:!!t,title:"向左插入单元格",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + ⇠",mouseenter(e){},click(t){Vs(e,!0)}},{usable:!!t,title:"向右插入单元格",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + ⇢",mouseenter(e){},click(t){Us(e,!0)}},{usable:!!t,title:"向上插入单元格",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + ↑",mouseenter(e){},click(t){Ws(e,!0)}},{usable:!!t,title:"向下插入单元格",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + ⇣",mouseenter(e){},click(t){Ys(e,!0)}},{usable:!!t,title:"删除当前行",icon:["iconfont","icon-shanchuhang"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:s}=e,o=ns.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(!e.check_orderly_row(l.row))return o?.tip_info("当前行不整齐");{const t=n.get_recorder();t.tell(e,ev.remove_row(s,l.row)),r.record(t)}}(e)}},{usable:!!t,title:"删除当前列",icon:["iconfont","icon-shanchulie"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:s}=e,o=ns.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(!e.check_orderly_col(l.col))return o?.tip_info("当前列不整齐");{const t=n.get_recorder();t.tell(e,ev.remove_col(s,l.col)),r.record(t)}}(e)}},{usable:!!t,title:"删除当前单元格",icon:["iconfont","icon-list-delete-cell"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:s}=e,o=ns.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");const c=n.get_recorder();c.tell(e,ev.remove_cell(s,l.box.id)),r.record(c)}(e)}}];return{title:e.meta.cubename,active:[],menus:n}}(t):t instanceof ml?Fs.menu=function(e){const t=[...fo(e),{usable:!e.attrs.fold,title:"折叠",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){to(e)}},{usable:!!e.attrs.fold,title:"展开",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){to(e)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof Cv?Fs.menu=function(e){const t=[...fo(e),{usable:!0,title:"添加块",shortcut:"",has_submenu:!1,icon:["iconfont","icon-add"],mouseenter(){},click(){!function(e){const{courier:t,history:n}=e,i=t.get_recorder(),r=[kl.get_default()];i.tell(e,ds.insert_child(e.id,r,e.child_count)),n.record(i)}(e)}},{usable:!0,title:"布局•限定列宽",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:120,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){so(e,120)}},{usable:!0,title:140,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){so(e,140)}},{usable:!0,title:160,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){so(e,160)}},{usable:!0,title:180,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){so(e,180)}},{usable:!0,title:200,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){so(e,200)}}];return{title:"限定列宽",active:[e.attrs.column_width],menus:t}}(e),click(){}},{usable:!0,title:"布局•限定列数",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:2,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){ro(e,2)}},{usable:!0,title:3,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){ro(e,3)}},{usable:!0,title:4,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){ro(e,4)}},{usable:!0,title:5,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){ro(e,5)}},{usable:!0,title:6,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){ro(e,6)}}];return{title:"限定列数",active:[e.attrs.column_count],menus:t}}(e),click(){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof bd?Fs.menu=function(e){const t=[{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){ao(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){ao(e,!0)}},{get usable(){return!(e.pcube instanceof Qc)},title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=ss.get_id(),s.type=n.list_ordered;const o=e.pcube,a=e.index,l=i.get_recorder(),c=ds.delete_child(o.id,"backward",[a,a+1],!0),d=ds.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}},{get usable(){return!(e.pcube instanceof Qc)},title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=ss.get_id(),s.type=n.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=i.get_recorder(),c=ds.delete_child(o.id,"backward",[a,a+1],!0),d=ds.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}}];return e.pcube instanceof Qc||t.unshift(...fo(e)),{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof Cd?Fs.menu=function(e){const t=[...fo(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){lo(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){lo(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=ss.get_id(),s.type=n.list;const o=e.pcube,a=e.index,l=i.get_recorder(),c=ds.delete_child(o.id,"backward",[a,a+1],!0),d=ds.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=ss.get_id(),s.type=n.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=i.get_recorder(),c=ds.delete_child(o.id,"backward",[a,a+1],!0),d=ds.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof pd?Fs.menu=function(e){const t=[...fo(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){co(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){co(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=ss.get_id(),s.type=n.list;const o=e.pcube,a=e.index,l=i.get_recorder(),c=ds.delete_child(o.id,"backward",[a,a+1],!0),d=ds.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=ss.get_id(),s.type=n.list_ordered;const o=e.pcube,a=e.index,l=i.get_recorder(),c=ds.delete_child(o.id,"backward",[a,a+1],!0),d=ds.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof ko?Fs.menu=function(e){const t=[{usable:!0,title:"下载",icon:["iconfont","icon-download"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){e.event.emit_asset_download("image",e.info)}},{usable:!0,title:"复制到粘贴板",icon:["iconfont","icon-copy"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.dom?.querySelector("img");if(!n)return ns.tips?.tip_error("复制失败");fetch(n.src).then(e=>e.blob()).then(async t=>{const n=new ClipboardItem({"image/png":t});await e.clipboard.set_clipboard_data(n)&&ns.tips?.tip_success("复制成功🍊")})}},{usable:!0,title:"文字环绕",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!0,mouseenter:()=>function(e){return{title:"文字环绕",active:[],menus:[{usable:!0,title:"无环绕",icon:["iconfont","icon-close"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.clear_float())}},{usable:!0,title:"左环绕",icon:["iconfont","icon-floatleft"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float("L"))}},{usable:!0,title:"右环绕",icon:["iconfont","icon-floatright"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float("R"))}}]}}(e),click(e){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof od?Fs.menu=function(e){const t=[...fo(e,!1),{usable:!0,title:"向下插入行",shortcut:"ctrl + enter",icon:["iconfont","icon-cc-arrow-down-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const i=n.find_upstream_untill(e);i instanceof kl&&ho(e,Math.floor(i.index/2)+1)}},{usable:!0,title:"向上插入行",shortcut:"ctrl + shift + enter",icon:["iconfont","icon-cc-arrow-up-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const i=n.find_upstream_untill(e);i instanceof kl&&ho(e,Math.floor(i.index/2))}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof Qc&&(Fs.menu=function(e){const t=[...fo(e),{usable:!e.exceptions,title:"添加异常块",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){e.add_exceptions()}}];return{title:e.meta.cubename,active:[],menus:t}}(t))}function po(e,t,n,i=5){e.width,Math.abs(e.y-n.y),e.width,Math.abs(e.height-(n.y+n.height)),Math.abs(n.x-e.x),e.height;const r={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(us.MathRect.can_include(r,t)){const r=n.y+t.height-e.height;return{x:n.x+n.width+i,y:r<0?n.y:n.y-r}}{const r=n.y+t.height-e.height;return{x:n.x-t.width-i,y:r<0?n.y:n.y-r}}}function mo(e,t){const{courier:n,history:i}=e,r=n.get_recorder(),s=e.pcube;if("A"===t)if(e instanceof ml){const t=ml.get_default();r.tell(s,ds.insert_child(s.id,[t],e.index+1))}else{const t=bl.get_default(),n=ds.insert_child(s.id,[t],e.index+1);r.tell(s,n)}else if("B"===t&&e)if(e instanceof ml){const t=ml.get_default();r.tell(s,ds.insert_child(s.id,[t],e.index))}else{const t=bl.get_default(),n=ds.insert_child(s.id,[t],e.index);r.tell(s,n)}i.record(r)}function fo(e,t=!1){const n=[{usable:!0,title:"向前插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){mo(e,"B")}},{usable:!0,title:"向后插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){mo(e,"A")}}],i={usable:!0,title:"全屏",icon:["iconfont","icon-square"],has_submenu:!1,mouseenter(e){},click(t){e.dom?.requestFullscreen()}};return t&&n.push(i),n}const _o=["id","data-type"],go={class:"tools-left"},bo={class:"tools-right"},yo=["src","loading"],vo=Pn({__name:"cube-img",props:{cube:{}},setup(e){const{root:t,stats:i}=e.cube,r={isdown:!1,ismove:!1,x:0,width:-1,dir:"left",width_origin:500},s=Lt({resize_origin_width:-1,resize_result:-1,resize_scroll:!1}),o=t.id,a=ns.url,l=t=>Hs(t,e.cube,"left",r),c=t=>Hs(t,e.cube,"right",r),d=t=>function(e,t,n){if(!n.isdown||!n.dom)return;n.ismove=!0,e.preventDefault();const i="left"===n.dir?1:-1,r=e.clientX-n.x,s=Math.abs(n.width-r*i);t.data.css.width=s+"px",n.width_result=s}(t,e.cube,r),h=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:r}=t.root,s=new cs(i);s.tell(t,ds.set_css(t.id,{width:n.width_result+"px"})),r.record(s)}(0,e.cube,r),u=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:r}=t.root,s=new cs(i);s.tell(t,ds.set_css(t.id,{width:n.width_result+"px"})),r.record(s)}(0,e.cube,r);function p(t){const n=t.currentTarget.parentElement;Object.assign(n.style,e.cube.css),n.classList.add("cube-img-load-failed")}function m(t){if(!s.resize_scroll)return;const{deltaY:n}=t,i=t.currentTarget;if(!i)return;t.preventDefault(),t.stopPropagation();let r=qs(i,e.cube)+10*Math.sign(n);e.cube.data.css.width=r+"px",s.resize_result=r}return Vn(()=>{document.documentElement.addEventListener("pointermove",d),document.documentElement.addEventListener("pointerup",h),document.documentElement.addEventListener("pointercancel",u)}),Xn(()=>{document.documentElement.removeEventListener("pointermove",d),document.documentElement.removeEventListener("pointerup",h),document.documentElement.removeEventListener("pointercancel",u)}),(r,d)=>(fr(),yr("div",{class:ve(["cube-img",{"resize-scroll":s.resize_scroll}]),style:fe(r.cube.css),id:r.cube.id,"data-type":Kt(n).img,onContextmenu:d[1]||(d[1]=e=>Kt(uo)(e,r.cube)),onWheel:m},[Cr("div",go,[Cr("div",{class:"dragger",onPointerdown:l},null,32)]),Cr("div",bo,[Cr("div",{class:"dragger",onPointerdown:c},null,32)]),Cr("img",{style:fe(r.cube.css),src:t.isdev?e.cube.info:a?a(o,"image",e.cube.info):void 0,alt:"",onErrorOnce:p,onClick:d[0]||(d[0]=t=>function(t){const n=t.currentTarget;if(s.resize_scroll=!s.resize_scroll)s.resize_origin_width=qs(n,e.cube);else{if(s.resize_origin_width<0||s.resize_result<0)return;const{courier:t,history:n}=e.cube.root;e.cube.data.css.width=s.resize_origin_width+"px";const i=t.get_recorder();i.tell(e.cube,ds.set_css(e.cube.id,{width:s.resize_result+"px"})),n.record(i)}}(t)),loading:Kt(i).mode===Kt(z).export?"eager":"lazy"},null,44,yo),Pr(' <div class="tools-img">\r\n <div class="iconfont icon-floatleft" @click="() => float(\'L\')"></div>\r\n <div class="iconfont icon-floatright" @click="() => float(\'R\')"></div>\r\n <div class="iconfont icon-close" @click="clear"></div>\r\n </div> ')],46,_o))}});var wo=r(5856);const xo=(0,wo.A)(vo,[["__scopeId","data-v-14032bda"]]);class ko extends Es{_component=xo;_children=[];get is_empty(){return 0===this.data.info.trim().length}get children(){return this._children}get meta(){return ko.meta}get component(){return this._component}constructor(e,t){super(e,t);const n=this.setup(e,t),i=this.clipboard.pasted_from;return i&&this.event.emit_asset_copy(i.noteid,"image",e.info),n}build_child(){}update_data(e,t){return ko.update_data(e,t)}float(e){const{courier:t}=this.root,n={float:"L"===e?"inline-start":"inline-end"},i=t.get_recorder(),r=ds.set_css(this.id,n,!0);return i.tell(this,r),i}clear_float(){const{courier:e}=this.root,t=e.get_recorder(),n=ds.set_css(this.id,{float:null},!0);return t.tell(this,n),t}gc(){super.base_gc()}export(){return this.base_export()}replace_id(e,t={}){return ko.replace_id(this.root,e,t)}static get meta(){return{type:n.img,cubename:"图片",block:!1,version:2,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,t}static get_default(e="",t={},i={}){return{id:ss.get_id(),type:n.img,info:e,css:t,attrs:i}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:(1===e&&t.info.startsWith("image://")&&(t.info=t.info.slice(8)),{data:t,usable:!0})}}const So=["id","data-type"],Co={class:"lost-info"},Mo=Pn({__name:"cube-lost",props:{cube:{}},setup:e=>(e,t)=>(fr(),yr("div",{class:"cube-lost",id:e.cube.id,"data-type":Kt(n).lost,style:fe(e.cube.css)},[t[2]||(t[2]=Cr("div",{class:"lost-title"},"异常方块",-1)),Cr("div",Co,[t[0]||(t[0]=Cr("div",null,"方块类型:",-1)),Cr("div",null,Se(e.cube.cube_name),1),t[1]||(t[1]=Cr("div",null,"异常原因:",-1)),Cr("div",null,Se(e.cube.msg),1)])],12,So))}),zo=(0,wo.A)(Mo,[["__scopeId","data-v-0b0feb78"]]);class Ao extends Es{_msg=Wt("");get msg(){return this._msg.value}set msg(e){this._msg.value=e}_component=zo;get component(){return this._component}get meta(){return Ao.meta}get cube_name(){return this.data.type}get is_empty(){return!1}get children(){return[]}constructor(e,t,n){super(e,t),e&&this.setup(e,t),this.msg=n}build_child(){}update_data(e,t){return Ao.update_data(e,t)}gc(){}replace_id(e,t={}){return Ao.replace_id(this.root,e,t)}export(){const e=this.base_export();return e.attrs.postil&&(e.info.attrs.postil=e.attrs.postil),e}on_cursor_in_head(e){const{courier:t,next_cube:n}=this,i=new cs(t);return n&&i.tell(n,hs.in_head(n.id)),i}on_cursor_in_tail(e){const{courier:t,prev_cube:n}=this,i=new cs(t);return n&&i.tell(n,hs.in_head(n.id)),i}static get_default(e){return{id:is(),type:n.lost,info:e,css:{},attrs:{}}}static get meta(){return{cubename:"异常方块",type:n.lost,block:!1,version:1,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}const To=["id","data-type"],Po=Pn({__name:"cube-text",props:{cube:{}},setup(e){function t(){const t=e.cube.postil;t&&t.visible(!t.show)}return(e,i)=>(fr(),yr("span",{class:ve(["cube-text",{"text-mark":e.cube.has_postil}]),style:fe(e.cube.css),onClick:t,id:e.cube.id,"data-type":Kt(n).text},Se(e.cube.text),15,To))}}),No=(0,wo.A)(Po,[["__scopeId","data-v-494c8a06"]]),Oo=Pn({__name:"cube-view",props:{cube:{}},setup:e=>(e,t)=>(fr(),vr(ni(e.cube.component),{cube:$t(e.cube)},null,8,["cube"]))});class Ro{static get icons(){return{annotation:"icon-Annotation",down:"icon-cc-arrow-down-square",left:"icon-cc-arrow-left-square",right:"icon-cc-arrow-right-square",up:"icon-cc-arrow-up-square",eraser:"icon-eraser",table_merge:"icon-hebingdanyuange",table_unmerge:"icon-quxiaohebingdanyuange",img:"icon-img",table:"icon-grid",table_delete_row:"icon-shanchuhang",table_delete_col:"icon-shanchulie",table_delete_cell:"icon-list-delete-cell",table_title:"icon-a-Addheader2x",table_expand_col:"icon-expand-horizontal-1--expand-resize-bigger-horizont",table_shrink_col:"icon-shrink-horizontal-1--resize-shrink-bigger-horizont",info:"icon-info",info2:"icon-error",rename:"icon-rename",copy:"icon-copy",delete:"icon-Delete",close:"icon-close",add:"icon-add",fold:"icon-fold"}}}const Lo=["id","data-type"],Eo={class:"iconbox"},Do=Pn({__name:"cube-annotation",props:{cube:{}},setup(e){const t=Lt({fold:!1});function i(){const{courier:t,history:n}=e.cube.root,i=e.cube.pcube,r=e.cube.index,s=new cs(t);s.tell(i,ds.delete_child(i.id,"backward",[r,r+1])),n.record(s)}function r(){t.fold=!t.fold}return(e,s)=>(fr(),yr("div",{class:"cube-annotation",style:fe(e.cube.css),id:e.cube.id,"data-type":Kt(n).annotation},[Cr("div",Eo,[Cr("div",{class:ve(["iconfont",Kt(Ro).icons.fold,t.fold?"annotation-icon-active":""]),onClick:r,title:"折叠批注块"},null,2),Cr("div",{class:"iconfont icon-Delete",onClick:i,title:"删除批注块"})]),t.fold?Pr("v-if",!0):(fr(),yr("div",{key:0,class:ve(["annotation-contents",{"annotation-fold":t.fold}])},[(fr(!0),yr(cr,null,ri(e.cube.children,e=>(fr(),vr(Oo,{key:e.id,cube:e,class:"annotation-box"},null,8,["cube"]))),128))],2))],12,Lo))}}),Io=(0,wo.A)(Do,[["__scopeId","data-v-b157e116"]]);function Bo(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class jo extends Es{constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get component(){return Io}get meta(){return jo.meta}init(){}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}build_child(e){const t=ss.build_cubes(e.info,this);this._children.push(...t)}update_data(e,t){return jo.update_data(e,t)}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof Es&&r.push(e.export());return{children:i,data:r}}replace_id(e,t={}){return jo.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(ds.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,hs.in_head(a.id)):r.tell(this.child_last,hs.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,s=t.get_recorder();s.add_cmd(e);const{dir:o,range:a}=e,[l,c]=a;let d=l<0?0:l,h=c>this.child_count?this.child_count:c;if(d>=h)return;if(d<=0&&h>=this.child_count)return this.is_empty?s.tell(r,ds.delete_child(n,o,[i,i+1])):s.tell(this,ds.reset(this.id,[])),s;const u=this.children[d-1],p=this.children[h],m=h-d;let f=this.splice(l,m);return s.add_recover(ds.insert_child(this.id,f.data,l)),"backward"===o?u?s.tell(u,hs.in_tail(u.id)):p&&s.tell(p,hs.in_head(p.id)):"forward"===o&&(p?s.tell(p,hs.in_head(p.id)):u&&s.tell(u,hs.in_tail(u.id))),s}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new cs(t),s=[];for(let e of this.children)s.push(e.export());const o=ss.build_cubes(i,this);return this.splice(0,this.child_count,...o),r.add_recover(ds.reset(this.id,s)),r}static get meta(){return{cubename:"批注",type:n.annotation,block:!0,version:1,show:!1}}static get_default(e={},t={}){const i={id:is(),type:n.text,info:"",attrs:{},css:{}},r={id:is(),type:n.line,info:[i],attrs:{},css:{}},s={id:is(),type:n.box,info:[r],attrs:{},css:{}};return{id:is(),type:n.annotation,info:[s],css:e,attrs:t}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;let s=[];for(let i of t.info){const t=rs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Bo([ys(i.cube_insert_child)],jo.prototype,"on_insert_child",null),Bo([ys(i.cube_delete_child)],jo.prototype,"on_delete_child",null),Bo([ys(i.cube_reset)],jo.prototype,"on_reset",null);const qo=["id","data-type"],Ho={class:"title"},Fo=Pn({__name:"cube-text-link",props:{cube:{}},setup(e){function t(){const t=document.createElement("a");t.href=e.cube.data.info.url,t.target="_blank",t.click()}function i(){e.cube.event.emit_text_link_edit(e.cube)}function r(){const{courier:t,history:n}=e.cube.root,{pcube:i,index:r}=e.cube,s=new cs(t);s.tell(i,ds.delete_child(i.id,"backward",[r,r+1])),n.record(s)}return(e,s)=>(fr(),yr("div",{class:"cube-link",style:fe(e.cube.css),id:e.cube.id,"data-type":Kt(n).link},[Cr("div",Ho,Se(e.cube.data.info.title),1),Cr("div",{class:"link",onClick:t},Se(e.cube.data.info.url),1),Cr("div",{class:"iconbox"},[Cr("div",{class:"iconfont icon-rename",onClick:i}),Cr("div",{class:"iconfont icon-Delete",onClick:r})])],12,qo))}}),$o=(0,wo.A)(Fo,[["__scopeId","data-v-2946c9fa"]]);class Go{static update(e,t,n){return{id:e,name:u.update,title:t,url:n}}}class Vo extends Es{constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return $o}get meta(){return Vo.meta}get url(){return this.data.info.url}get title(){return this.data.info.title}build_child(e){}gc(){}export(){return this.base_export()}replace_id(e,t={}){return Vo.replace_id(this.root,e,t)}update_data(e,t){return Vo.update_data(e,t)}on_update_info(e){const{courier:t,cursor:n}=this,{url:i,title:r}=e,s=t.get_recorder();s.add_cmd(e);const o=this.info.title,a=this.info.url;return this.info.url=i,this.info.title=r,s.add_recover(Go.update(this.id,o,a)),s}static get meta(){return{cubename:"文本链接",type:n.link,block:!0,show:!1,version:1}}static get_default(e,t,i={},r={}){return{id:is(),type:n.link,info:{url:e,title:t},css:i,attrs:r}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([ys(u.update)],Vo.prototype,"on_update_info",null);const Uo=["id","data-type"],Wo=Pn({__name:"cube-postil",props:{cube:{}},setup(e){const t=Jr(()=>e.cube.children.filter(e=>e instanceof Vo)),i=Jr(()=>e.cube.children.filter(e=>!(e instanceof Vo))),r=Jr(()=>({...e.cube.css}));function s(){e.cube.visible(!1)}function o(){const{courier:t,history:n}=e.cube.root,i=e.cube.pcube,r=new cs(t);r.tell(i,ds.postil_remove(i.id,[0,e.cube.child_count])),n.record(r)}function a(e){e.preventDefault(),e.stopPropagation();const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const{deltaY:n}=e;n>0?us.DomAnimation.scroll_element(t,20,"vertical"):us.DomAnimation.scroll_element(t,-20,"vertical")}return(e,l)=>e.cube.show?(fr(),yr("div",{key:0,class:"cube-postil",style:fe(r.value),id:e.cube.id,"data-type":Kt(n).postil},[Cr("div",{class:"iconbox"},[Cr("div",{class:"iconfont icon-Delete delete",title:"清空",onClick:o}),Cr("div",{class:"iconfont icon-close close",title:"关闭",onClick:s})]),Cr("div",{class:"mark-contents",onWheel:a},[(fr(!0),yr(cr,null,ri(t.value,e=>(fr(),vr(Oo,{key:e.id,cube:e},null,8,["cube"]))),128)),(fr(!0),yr(cr,null,ri(i.value,e=>(fr(),vr(Oo,{key:e.id,cube:e},null,8,["cube"]))),128))],32)],12,Uo)):Pr("v-if",!0)}}),Yo=(0,wo.A)(Wo,[["__scopeId","data-v-7ca0a800"]]);function Xo(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Ko extends Es{_handler_update_pos;_handler_corrent;_timer_corrent;_show=Wt(!1);constructor(e,t){super(e,t);const n=this.setup(e,t);return t.has_postil=!0,n}get default_size(){return{x:0,y:0,width:180,height:130}}get show(){return this._show.value}set show(e){this._show.value=e,e&&this.root.listener.check_float()}get has_annotation(){for(let e of this.children)if(e instanceof jo)return!0;return!1}get meta(){return Ko.meta}get component(){return Yo}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}build_child(e){const t=ss.build_cubes(e.info,this);this._children.push(...t)}update_data(e,t){return Ko.update_data(e,t)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}gc(){super.base_gc(),this.root.cubes.remove_cube(this),this._handler_update_pos&&(this.root.event.off(this._handler_update_pos),this._handler_update_pos=null)}replace_id(e,t={}){return Ko.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(ds.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,hs.in_head(a.id)):r.tell(this.child_last,hs.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,s=t.get_recorder();s.add_cmd(e);const{dir:o,range:a}=e,[l,c]=a;let d=l<0?0:l,h=c>this.child_count?this.child_count:c;if(d>=h)return;if(d<=0&&h>=this.child_count)return s.tell(this,ds.reset(this.id,[])),s;const u=this.children[d-1],p=this.children[h],m=h-d;let f=this.splice(l,m);return s.add_recover(ds.insert_child(this.id,f.data,l)),"backward"===o?u?s.tell(u,hs.in_tail(u.id)):p&&s.tell(p,hs.in_head(p.id)):"forward"===o&&(p?s.tell(p,hs.in_head(p.id)):u&&s.tell(u,hs.in_tail(u.id))),s}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new cs(t),s=[];for(let e of this.children)s.push(e.export());const o=ss.build_cubes(i,this);return this.splice(0,this.child_count,...o),r.add_recover(ds.reset(this.id,s)),r}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof Es&&r.push(e.export());return{children:i,data:r}}visible(e){if(e){const{courier:e,child_last:t}=this;this.update_pos(),this.show=!0,fn(()=>{const n=e.get_recorder();n.tell(t,hs.in_tail(t.id)),this.history.record(n)})}else this.show=!1}update_pos(e=!0){fn(()=>{const e=this.pcube.clientRect,t=this.clientRect||this.default_size;if(!e)return void(this.show=!1);const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},i=us.MathRect.move_rect_to_other(n,t,e,5);this.data.css.left=`${i.x}px`,this.data.css.top=`${i.y}px`})}static get_default(e=[],t={}){return{id:is(),type:n.postil,info:e,attrs:{},css:t}}static get meta(){return{cubename:"标注内容",type:n.postil,show:!1,version:1,block:!0}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=rs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Xo([ys(i.cube_insert_child)],Ko.prototype,"on_insert_child",null),Xo([ys(i.cube_delete_child)],Ko.prototype,"on_delete_child",null),Xo([ys(i.cube_reset)],Ko.prototype,"on_reset",null);class Jo{static reset(e,t){return{id:e,name:c.text_reset,info:t}}static break(e,t){return{id:e,name:c.text_break,offset:t}}}function Qo(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Zo extends Es{_component=No;get attrs(){return this.data.attrs}get component(){return this._component}get meta(){return Zo.meta}get is_empty(){return Zo.is_empty_text(this.data)}get len(){return this.text.length}get text(){return this.data.info}get text_node(){const e=this.dom?.firstChild;if(e instanceof Text)return e}get children(){return[]}get line(){let e=this.pcube;for(;e;){if(e instanceof bl)return e;e=e.pcube}}constructor(e,t){super(e,t);const n=this.setup(e,t);return this.data.info=this.data.info.replace("\r",""),this.data.info||(this.data.info=""),this.init(),n}init(){this.root.stats.update_count_word(this.len)}build_child(e){const t=e.attrs?.postil;t&&(this.postil=new Ko(t,this))}gc(){super.base_gc(),this.root.stats.update_count_word(-this.len)}replace_id(e,t={}){return Zo.replace_id(this.root,e,t)}find_child_cube(e){}export(){return this.base_export()}update_data(e,t){return Zo.update_data(e,t)}merge_text(e){const{courier:t}=this,n=t.get_recorder(),i=this.prev_cube,r=this.next_cube,s=i instanceof Zo,o=r instanceof Zo;if(s&&o){const t=ds.merge(this.id,"both",this.id,e);n.tell(this,t)}else if(s){const t=ds.merge(this.id,"left",this.id,e);n.tell(this,t)}else if(o){const t=ds.merge(this.id,"right",this.id,e);n.tell(this,t)}return n}on_cursor_loc(e){const{from:t,from_offset:n,offset:i}=e,{courier:r}=this,s=r.get_recorder();return s.add_cmd(e),this.set_cursor_in_head(i),s.add_recover(hs.loc(t,n,this.id,i)),s}on_partition(e){const{courier:t,cursor:n,pcube:i}=this,{start_id:r,end_id:s,offset_end:o,offset_start:a}=e,l=this.get_valid_index(a),c=this.get_valid_index(o),d=new cs(t),h=this.text.slice(0,l),u=this.text.slice(l,c),p=this.text.slice(c);if(u){const e=Zo.get_default(u,structuredClone(Ft(this.css)));if(h){if(h){const t=Jo.reset(this.id,h),n=hs.loc(this.id,h.length,this.id,h.length);if(d.tell(this,t,n),p){const e=Zo.get_default(p,structuredClone(Ft(this.css)));d.tell(i,ds.insert_child(i.id,[e],this.index+1))}d.tell(i,ds.insert_child(i.id,[e],this.index+1))}}else{const e=Jo.reset(this.id,u),t=hs.loc(this.id,u.length,this.id,u.length);if(d.tell(this,e,t),p){const e=Zo.get_default(p,structuredClone(Ft(this.css)));d.tell(i,ds.insert_child(i.id,[e],this.index+1))}}return d}if(0===l){const e=Zo.get_default();d.tell(i,ds.insert_child(i.id,[e],this.index))}else if(l===this.len){const e=Zo.get_default();d.tell(i,ds.insert_child(i.id,[e],this.index+1))}else if(l>0&&l<this.len){const e=Zo.get_default(p,structuredClone(Ft(this.css))),t=ds.insert_child(i.id,[e],this.index+1),n=Jo.reset(this.id,h),r=hs.loc(this.id,h.length,this.id,h.length);return d.tell(i,t),d.tell(this,n,r),d}return d}on_cube_merge(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r,pid:s,index:o}=this,{method:a,offset:l,cubeid:c}=e;let d=this.get_valid_index(l);const h=new cs(t);if("left"===a&&n instanceof Zo&&this.can_merge_with(n)){const e=n.id,t=ds.delete_child(s,"forward",[o-1,o]),r=Jo.reset(this.id,n.text+this.text),a=hs.loc(this.id,d+n.len,this.id,d);h.tell(i,t),h.tell(this,r,a),this.event.emit_text_merge(e,this.id)}else if("right"===a&&r instanceof Zo&&this.can_merge_with(r)){const e=r.id,t=ds.delete_child(s,"backward",[o+1,o+2]),n=Jo.reset(this.id,this.text+r.text),a=hs.loc(this.id,d,this.id,d);h.tell(i,t),h.tell(this,n,a),this.event.emit_text_merge(e,this.id)}else if("both"===a)if(n instanceof Zo&&r instanceof Zo&&this.can_merge_with(n)&&this.can_merge_with(r)){const e=n.len+d,t=n.id,s=r.id;h.tell(i,ds.delete_child(this.pid,"backward",[this.index-1,this.index])),h.tell(i,ds.delete_child(this.pid,"backward",[this.index+1,this.index+2])),h.tell(this,Jo.reset(this.id,n.text+this.text+r.text)),h.tell(this,hs.loc(this.id,e,this.id,d)),this.event.emit_text_merge(t,this.id),this.event.emit_text_merge(s,this.id)}else if(n instanceof Zo&&this.can_merge_with(n)){const e=n.id;h.tell(i,ds.delete_child(s,"forward",[o-1,o])),h.tell(this,Jo.reset(this.id,n.text+this.text)),h.tell(this,hs.loc(this.id,d+n.len,this.id,d)),this.event.emit_text_merge(e,this.id)}else if(r instanceof Zo&&this.can_merge_with(r)){const e=r.id;h.tell(i,ds.delete_child(s,"backward",[o+1,o+2])),h.tell(this,Jo.reset(this.id,this.text+r.text)),h.tell(this,hs.loc(this.id,d,this.id,d)),this.event.emit_text_merge(e,this.id)}return h}on_cube_insert(e){const{data:t,start_id:n,end_id:i,offset_end:r,offset_start:s}=e,{courier:o,pid:a,pcube:l}=this,c=new cs(o);this.cursor.has_selection;let d=s,h=r;if(d<0&&(d=0),h>this.text.length&&(h=this.text.length),r!==s){const e=ds.delete(this.id,"backward",this.id,this.id,s,r,!0);c.tell(this,e)}const u=ss.pick(t),p=this.text.slice(0,d),m=this.text.slice(h);if(u.head.length>0)if(p)if(p&&m){const e=Jo.reset(this.id,p),t=hs.loc(this.id,p.length,this.id,p.length);c.tell(this,e,t);const n=Zo.get_default(m,structuredClone(Ft(this.css)),structuredClone(Ft(this.attrs)));c.tell(l,ds.insert_child(a,[n],this.index+1)),c.tell(l,ds.insert_child(a,u.head,this.index+1))}else m||c.tell(l,ds.insert_child(a,u.head,this.index+1));else c.tell(l,ds.insert_child(a,u.head,this.index));const f=[...u.body];if(u.tail.length>0&&f.push(bl.get_default(u.tail)),u.root.length>0)for(let e of u.root)f.push(...e.info);if(f.length>0){if(0===u.head.length&&r>0&&r<this.len){const e=Jo.reset(this.id,p),t=hs.loc(this.id,p.length,this.id,p.length);c.tell(this,e,t);const n=Zo.get_default(m,structuredClone(Ft(this.css)),structuredClone(Ft(this.attrs)));c.tell(l,ds.insert_child(a,[n],this.index+1))}c.tell(l,ds.insert_child(this.pid,f,this.index+u.head.length+1))}return c}on_cube_delete(e){const{courier:t,index:n,pcube:i,pid:r}=this,{dir:s,start_id:o,end_id:a,offset_start:l,offset_end:c,reserve:d}=e,h=new cs(t),u=this.get_valid_index(l),p=this.get_valid_index(c),m=u!==p||"head"===l||"tail"===c;if(0===u&&p===this.len){if(d){const e=Jo.reset(this.id,""),t=hs.loc(this.id,1,this.id,this.len);h.tell(this,e,t)}else h.tell(i,ds.delete_child(r,"backward",[n,n+1]));return h}const f=this.text.slice(0,u),_=this.text.slice(p);if(m){const e=Jo.reset(this.id,f+_),t=hs.loc(this.id,u,this.id,p);h.tell(this,e,t)}else{const e=u;if("backward"===s)if(0===e||0===Zo.drop_zero_width_space(this.text,u).pos)if(this.pcube.is_empty&&this.pcube instanceof Es)h.merge(this.pcube.remove_self());else{const e=this.prev_cube_deep;if(!e)return;if(e.meta.block){const t=e.pcube;t&&h.merge(t.delete_edge(this,s))}else h.tell(e,ds.delete_adjacent(e.id,"right",this.id,0))}else if(this.is_empty)h.tell(i,ds.delete_child(r,"backward",[n,n+1]));else{const e=this.find_text_deleted(u,"left"),t=Jo.reset(this.id,e.text),n=hs.loc(this.id,e.pos,this.id,f.length);h.tell(this,t,n),e.text&&h.tell(this,ds.merge(this.id,"both",this.id,f.length-1))}else if("forward"===s)if(e===this.len||e===Zo.drop_zero_width_space(this.text,u).len)if(this.pcube.is_empty&&this.pcube instanceof Es)h.merge(this.pcube.remove_self());else{const e=this.next_cube_deep;if(!e)return;if(e.meta.block){const t=e?.pcube;t&&h.merge(t.delete_edge(this,s))}else h.tell(e,ds.delete_adjacent(e.id,"left",this.id,this.len))}else if(this.is_empty)h.tell(i,ds.delete_child(r,"forward",[n,n+1]));else{const t=this.find_text_deleted(e,"right"),n=Jo.reset(this.id,t.text),i=hs.loc(this.id,f.length,this.id,f.length),r=ds.merge(this.id,"both",this.id,f.length);h.tell(this,n,i),h.tell(this,r)}}return h}on_text_reset(e){const{courier:t,pid:n,index:i,pcube:r,len:s}=this,{info:o}=e,a=t.get_recorder();a.add_cmd(e);let l=this.text;!o&&this.is_empty;const c=Zo.drop_zero_intelligence(o,0);return this.data.info=c.text,this.root.stats.update_count_word(c.len-s),a.add_recover(Jo.reset(this.id,l)),a}on_cube_set_selection_css(e){const{courier:t,pid:n,pcube:i}=this,{css:r,start_id:s,end_id:o,offset_start:a,offset_end:l,toggle:c,replace:d}=e;if(0===Object.keys(r).length&&!d)return;const h=new cs(t),u=this.get_valid_index(a),p=this.get_valid_index(l),m=Zo.drop_zero_width_space(this.text.slice(0,u),0).text,f=Zo.drop_zero_width_space(this.text.slice(u,p),0).text,_=Zo.drop_zero_width_space(this.text.slice(p),0).text;if(0===u&&p===this.len||u===p&&s===o)h.tell(this,ds.set_css(this.id,r,c,d)),h.tell(this,ds.merge(this.id,"both",this.id,p));else if(0===u&&f){const e=structuredClone(Ft(this.css)),t=Jo.reset(this.id,f),s=hs.loc(this.id,p,this.id,p);if(h.tell(this,t,s),h.tell(this,ds.set_css(this.id,r,c,d)),_){const t=Zo.get_default(_,e);h.tell(i,ds.insert_child(n,[t],this.index+1));const r=i.find_cube(t.id);r&&h.tell(r,ds.merge(t.id,"both",t.id,0))}h.tell(this,hs.in_tail(this.id)),h.tell(this,ds.merge(this.id,"left",this.id,this.len))}else if(u>0){if(m){const e=Jo.reset(this.id,m),t=hs.loc(this.id,u,this.id,u),n=ds.merge(this.id,"left",this.id,p);h.tell(this,e,t,n)}if(_){const e=Zo.get_default(_,structuredClone(Ft(this.css))),t=[e];h.tell(i,ds.insert_child(n,t,this.index+1));const r=i.find_cube(e.id);r&&h.tell(r,ds.merge(r.id,"right",r.id,0))}if(f){const e=Zo.get_default(f,structuredClone(Ft(this.css)));h.tell(i,ds.insert_child(n,[e],this.index+1));const t=i.find_cube(e.id);t&&(h.tell(t,ds.set_css(e.id,r,c,d)),h.tell(t,ds.merge(e.id,"both",e.id,m.length+u)))}}return h}on_cube_break(e){const{courier:t,cursor:n,pcube:i,pid:r,index:s}=this,o=i.pcube;if(!o)return;const{offset:a}=e;let l=s+1;const c=new cs(t),d=this.text[a-1],h=this.text[a];let u=a,p=!1;if(d){const e=d.charCodeAt(0);55296<=e&&e<=56319&&(p=!0)}if(h&&!p){const e=h.charCodeAt(0);56320<=e&&e<=57343&&(p=!0)}p&&(u+=1),c.tell(this,ds.partition(this.id,this.id,this.id,u,u));const m=[];for(let e of i.children.slice(l))m.push(e.export());c.tell(i,ds.delete_child(i.id,"backward",[l,i.child_count]));const f=bl.get_default(m),_=this.line;_&&_.inherit_line([f]),c.tell(o,ds.insert_child(o.id,[f],i.index+1));const g=i.next_cube;return g?.id===f.id&&c.tell(g,hs.in_head(g.id)),c}on_cube_delete_adjacent(e){const{courier:t,pcube:n}=this,{from:i,from_id:r,offset:s}=e,o=new cs(t);if("left"===i)if(this.is_empty)o.merge(this.remove_self());else{const e=this.prev_cube_deep;e?.meta.block?o.tell(this,hs.in_head(this.id)):o.tell(this,ds.delete(this.id,"forward",this.id,this.id,0,0))}else if(this.is_empty)o.merge(this.remove_self());else{const e=this.next_cube_deep;e?.meta.block?o.tell(this,hs.in_tail(this.id)):o.tell(this,ds.delete(this.id,"backward",this.id,this.id,this.len,this.len))}return o}add_link(e,t){const{cursor:n,courier:i}=this,r=i.get_recorder(),s=Vo.get_default(t,e);return r.tell(this,ds.postil_add(this.id,[s])),r}add_annotation(e){const t=this.courier.get_recorder(),n=e||jo.get_default();return t.tell(this,ds.postil_add(this.id,[n])),t}get_valid_index(e){return"head"===e?0:"tail"===e?this.text.length:e<0?0:e>this.text.length?this.text.length:e}set_cursor_in_head(e=0){const t=this.get_valid_index(e);fn(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}set_cursor_in_tail(e=0){let t=this.len-this.get_valid_index(e);fn(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}find_text_nav_pos(e,t){const n=this.text;let i=e;if(e<0&&(i=0),e>n.length&&(i=n.length),"left"===t){let e=i-1,t=n[e];for(;""===t&&e>=0;)e-=1,t=n[e];if(t){const n=t.charCodeAt(0);56320<=n&&n<=57343&&(e-=1)}return e<0?0:e}{let e=i+1,t=n[e];for(;""===t&&e<n.length;)e+=1,t=n[e];if(t){const n=t.charCodeAt(0);55296<=n&&n<=56319&&(e+=1)}return e>n.length?n.length:e}}find_text_deleted(e,t){if(e<0)return{text:this.text,pos:0};if(e>this.len)return{text:this.text,pos:this.len};if("left"===t){let n=this.find_text_nav_pos(e,t),i=this.text.slice(0,n),r=this.text.slice(e),s=i[i.length-1];if(s){const t=s.charCodeAt(0);55296<=t&&t<=56319&&(i=i.slice(0,-1),e-=1)}return{text:i+r,pos:n}}{let n=this.find_text_nav_pos(e,t),i=this.text.slice(0,e),r=this.text.slice(n),s=r[0];if(s){const e=s.charCodeAt(0);56320<=e&&e<=57343&&(r=r.slice(1))}return{text:i+r,pos:e}}}is_text_remain(e,t){if(0===this.len)return!1;const[n,i]=t;if(n===i)return"backward"===e?0!==this.find_text_nav_pos(n,"left")||this.find_text_nav_pos(i-1,"right")!==this.len:this.find_text_nav_pos(n,"right")!==this.len||0!==this.find_text_nav_pos(n,"left");{if(0===n&&i===this.len)return!1;const e=this.find_text_nav_pos(n+1,"left"),t=this.find_text_nav_pos(i-1,"right");return e>0||t<this.len}}drop_zero_width_space(e){return Zo.drop_zero_width_space(this.text,e)}can_merge_with(e){const t=ss.is_same_style(this.css,e.css)||0===Object.keys(e.css).length,n=ss.is_same_attrs(this.attrs,e.attrs),i=!this.postil&&!e.postil;return t&&n&&i}static drop_zero_width_space(e,t){let n="",i=t;i<0&&(i=0),i>e.length&&(i=e.length);const r=e.slice(0,i),s=e.slice(i);if(r){for(let e of r)""!==e&&(n+=e);i=n.length}if(s)for(let e of s)""!==e&&(n+=e);return{text:n,pos:i,get len(){return this.text.length}}}static drop_zero_intelligence(e,t){let n="",i=t;i<0&&(i=0),i>e.length&&(i=e.length);const r=e.slice(0,i),s=e.slice(i);if(r){for(let e=0;e<r.length;e++){let t=r[e],i=r[e-1];""===t&&"\n"!==i||(n+=t)}i=n.length}if(s)for(let e=0;e<s.length;e++){let t=s[e],i=s[e-1];""===t&&"\n"!==i||(n+=t)}return n||(n="",i=1),{text:n,pos:i,get len(){return this.text.length}}}static is_empty_text(e){if(e.type!==n.text)return!1;let t="";for(let n of e.info)if(""!==n&&(t+=n),t.length>0)return!1;return 0===t.length}static get meta(){return{version:1,type:n.text,cubename:"文本",block:!1,show:!1}}static get_default(e="",t={},i={}){const r=e||"";return{id:is(),type:n.text,info:r,css:structuredClone(Ft(t)),attrs:structuredClone(Ft(i))}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,e.event.emit_replace_id(i,r),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Qo([ys(o.loc)],Zo.prototype,"on_cursor_loc",null),Qo([ys(i.cube_partition)],Zo.prototype,"on_partition",null),Qo([ys(i.cube_merge)],Zo.prototype,"on_cube_merge",null),Qo([ys(i.cube_insert)],Zo.prototype,"on_cube_insert",null),Qo([ys(i.cube_delete)],Zo.prototype,"on_cube_delete",null),Qo([ys(c.text_reset)],Zo.prototype,"on_text_reset",null),Qo([ys(i.cube_set_selection_css)],Zo.prototype,"on_cube_set_selection_css",null),Qo([ys(c.text_break)],Zo.prototype,"on_cube_break",null),Qo([ys(i.cube_delete_adjacent)],Zo.prototype,"on_cube_delete_adjacent",null);const ea=["id","data-type","contenteditable"],ta=Pn({__name:"cube-line",props:{cube:{}},setup:e=>(e,t)=>(fr(),yr("div",{class:ve(["cube-line",{"line-first-letter-lower":e.cube.attrs.first_letter_lower}]),id:e.cube.id,"data-type":Kt(n).line,style:fe(e.cube.css),contenteditable:e.cube.editable,spellcheck:"false"},[(fr(!0),yr(cr,null,ri(e.cube.children,e=>(fr(),vr(Oo,{key:e.id,cube:e},null,8,["cube"]))),128))],14,ea))}),na=(0,wo.A)(ta,[["__scopeId","data-v-f72cf81e"]]);let ia;const ra="undefined"!=typeof window&&window.trustedTypes;if(ra)try{ia=ra.createPolicy("vue",{createHTML:e=>e})}catch(e){}const sa=ia?e=>ia.createHTML(e):e=>e,oa="undefined"!=typeof document?document:null,aa=oa&&oa.createElement("template"),la={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r="svg"===t?oa.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?oa.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?oa.createElement(e,{is:n}):oa.createElement(e);return"select"===e&&i&&null!=i.multiple&&r.setAttribute("multiple",i.multiple),r},createText:e=>oa.createTextNode(e),createComment:e=>oa.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>oa.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,r,s){const o=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==s&&(r=r.nextSibling););else{aa.innerHTML=sa("svg"===i?`<svg>${e}</svg>`:"mathml"===i?`<math>${e}</math>`:e);const r=aa.content;if("svg"===i||"mathml"===i){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ca=Symbol("_vtc");Boolean;const da=Symbol("_vod"),ha=Symbol("_vsh"),ua=Symbol(""),pa=/(?:^|;)\s*display\s*:/,ma=/\s*!important$/;function fa(e,t,n){if($(n))n.forEach(n=>fa(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=ga[t];if(n)return n;let i=re(t);if("filter"!==i&&i in e)return ga[t]=i;i=ae(i);for(let n=0;n<_a.length;n++){const r=_a[n]+i;if(r in e)return ga[t]=r}return t}(e,t);ma.test(n)?e.setProperty(oe(i),n.replace(ma,""),"important"):e[i]=n}}const _a=["Webkit","Moz","ms"],ga={},ba="http://www.w3.org/1999/xlink";function ya(e,t,n,i,r,s=we(t)){i&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(ba,t.slice(6,t.length)):e.setAttributeNS(ba,t,n):null==n||s&&!xe(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Y(n)?String(n):n)}function va(e,t,n,i,r){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?sa(n):n));const s=e.tagName;if("value"===t&&"PROGRESS"!==s&&!s.includes("-")){const i="OPTION"===s?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);return i===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let o=!1;if(""===n||null==n){const i=typeof e[t];"boolean"===i?n=xe(n):null==n&&"string"===i?(n="",o=!0):"number"===i&&(n=0,o=!0)}try{e[t]=n}catch(e){}o&&e.removeAttribute(r||t)}function wa(e,t,n,i){e.addEventListener(t,n,i)}const xa=Symbol("_vei");const ka=/(?:Once|Passive|Capture)$/;let Sa=0;const Ca=Promise.resolve(),Ma=()=>Sa||(Ca.then(()=>Sa=0),Sa=Date.now()),za=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;"undefined"!=typeof HTMLElement&&HTMLElement,Symbol("_moveCb"),Symbol("_enterCb");const Aa=e=>{const t=e.props["onUpdate:modelValue"]||!1;return $(t)?e=>de(t,e):t};function Ta(e){e.target.composing=!0}function Pa(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Na=Symbol("_assign"),Oa={created(e,{modifiers:{lazy:t,trim:n,number:i}},r){e[Na]=Aa(r);const s=i||r.props&&"number"===r.props.type;wa(e,t?"change":"input",t=>{if(t.target.composing)return;let i=e.value;n&&(i=i.trim()),s&&(i=ue(i)),e[Na](i)}),n&&wa(e,"change",()=>{e.value=e.value.trim()}),t||(wa(e,"compositionstart",Ta),wa(e,"compositionend",Pa),wa(e,"change",Pa))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(e[Na]=Aa(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:ue(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(i&&t===n)return;if(r&&e.value.trim()===a)return}e.value=a}}},Ra=j({patchProp:(e,t,n,i,r,s)=>{const o="svg"===r;"class"===t?function(e,t,n){const i=e[ca];i&&(t=(t?[t,...i]:[...i]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,o):"style"===t?function(e,t,n){const i=e.style,r=W(n);let s=!1;if(n&&!r){if(t)if(W(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&fa(i,t,"")}else for(const e in t)null==n[e]&&fa(i,e,"");for(const e in n)"display"===e&&(s=!0),fa(i,e,n[e])}else if(r){if(t!==n){const e=i[ua];e&&(n+=";"+e),i.cssText=n,s=pa.test(n)}}else t&&e.removeAttribute("style");da in e&&(e[da]=s?i.display:"",e[ha]&&(i.display="none"))}(e,n,i):I(t)?B(t)||function(e,t,n,i,r=null){const s=e[xa]||(e[xa]={}),o=s[t];if(i&&o)o.value=i;else{const[n,a]=function(e){let t;if(ka.test(e)){let n;for(t={};n=e.match(ka);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):oe(e.slice(2)),t]}(t);if(i){const o=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();on(function(e,t){if($(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Ma(),n}(i,r);wa(e,n,o,a)}else o&&(function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,o,a),s[t]=void 0)}}(e,t,0,i,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,i){if(i)return"innerHTML"===t||"textContent"===t||!!(t in e&&za(t)&&U(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!za(t)||!W(n))&&t in e}(e,t,i,o))?(va(e,t,i),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||ya(e,t,i,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&W(i)?("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),ya(e,t,i,o)):va(e,re(t),i,0,t)}},la);let La;const Ea=(...e)=>{const t=(La||(La=Hi(Ra))).createApp(...e),{mount:n}=t;return t.mount=e=>{const i=function(e){if(W(e))return document.querySelector(e);return e}(e);if(!i)return;const r=t._component;U(r)||r.render||r.template||(r.template=i.innerHTML),1===i.nodeType&&(i.textContent="");const s=n(i,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t};function Da(e,t){if(t.freeze)return;e.preventDefault(),e.stopPropagation();const{doc:n,stats:i}=t,{deltaY:r,currentTarget:s}=e,o=t.config.data.revert_scope;r>0&&!o?t.expand("down"):t.expand("up")}const Ia={class:"iconbox"},Ba=Pn({__name:"note-scope",props:{selection:{}},setup(e){const t=Jr(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);return 0!==t?{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px"}:void 0}),n=Jr(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);return 0!==t?{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px",display:e.selection.pos.width<30?"none":"unset"}:void 0});function i(){e.selection.freeze=!e.selection.freeze}function r(t,n,i){t.stopPropagation();const{root:r}=e.selection,s=new cs(r.courier),o=n.get_scope_info(),a=o.cube.children[o.range[0]],l=o.cube.children[o.range[1]-1];if("A"===i&&l)if(l instanceof ml){const e=ml.get_default();s.tell(o.cube,ds.insert_child(o.cube.id,[e],l.index+1))}else{const e=bl.get_default(),t=ds.insert_child(o.cube.id,[e],l.index+1);s.tell(o.cube,t)}else if("B"===i&&a)if(a instanceof ml){const e=ml.get_default();s.tell(o.cube,ds.insert_child(o.cube.id,[e],a.index))}else{const e=bl.get_default(),t=ds.insert_child(o.cube.id,[e],a.index);s.tell(o.cube,t)}r.history.record(s)}function s(t){t.preventDefault(),t.stopPropagation(),e.selection.remove()}return(e,o)=>(fr(),yr("div",{class:ve(["doc-scope",{freeze:e.selection.freeze}]),style:fe(e.selection.css),onWheel:o[3]||(o[3]=t=>Kt(Da)(t,e.selection)),onClick:i,onContextmenu:s},[Cr("div",Ia,[Cr("div",{class:"iconfont icon-a-copy",style:fe(n.value),title:"在上方插入行",onClick:o[0]||(o[0]=t=>r(t,e.selection,"A"))},null,4),Cr("div",{class:"iconfont icon-force_vortex-copy",title:"取消选区",style:fe(t.value),onClick:o[1]||(o[1]=()=>e.selection.remove())},null,4),Cr("div",{class:"iconfont icon-B-copy",style:fe(n.value),title:"在上方插入行",onClick:o[2]||(o[2]=t=>r(t,e.selection,"B"))},null,4)])],38))}}),ja=(0,wo.A)(Ba,[["__scopeId","data-v-bdec0da6"]]);class qa extends ts{has_down=!1;down_caret=void 0;constructor(e){super(e)}get root(){return this._root}pointerdown(e){if(this.root.stats.is_read_mode)return e.preventDefault();e.preventDefault(),this.has_down=!0,this.down_caret=document.caretPositionFromPoint(e.clientX,e.clientY),this.click_selection_text(e),this.cursor.locate_cursor_by_coor(e.clientX,e.clientY)}pointermove(e){this.stats.view_point={x:e.clientX,y:e.clientY},this.drag_selection_text(e)}pointercancel(e){this.has_down=!1,this.down_caret=null}pointerup(e){e.preventDefault(),this.has_down=!1,this.down_caret=null}beforeinput(e){if(this.stats.in_composition_mode)return;if(this.event.emit_note_input_before(e).some(e=>"stop"===e))return;e.preventDefault();const{courier:t,cursor:n,history:i}=this,r=e.data,{cube_end:s,cube_start:o,cube_selection:a,offset_start:l,offset_end:c}=n;if(!a||!s||!o)return;const d=o.id,h=s.id,u=a.id;if("insertText"===e.inputType){if(!(a instanceof Zo&&r)){const e=t.get_recorder(),n=Zo.get_default(r||""),s=ds.insert(u,[n],d,h,l,c);return e.tell(a,s),i.record(e)}{const e=t.get_recorder();this.ins(e,this.root,r,a,l,c),i.record(e)}}else if("deleteContentBackward"===e.inputType||"deleteContentForward"===e.inputType){const n=t.get_recorder();if(!this.root.scope_count_normal){let t="deleteContentBackward"===e.inputType?"backward":"forward";const r=ds.delete(u,t,d,h,l,c);return n.tell(a,r),i.record(n)}{const e=this.clipboard.delete_scope();e&&this.history.record(e)}}}compositionstart(e){this.stats.in_composition_mode=!0,this.clear_selection_text()}compositionupdate(e){this.event.emit_note_compositionupdate(e).some(e=>"stop"===e)}compositionend(e){if(this.event.emit_note_compositionend_before(e).some(e=>"stop"===e))return;const{courier:t,cursor:n,history:i,stats:r,event:s}=this.root;if(n.has_selection)return;if(!r.in_composition_mode)return;const{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n,h=e.data,u=new cs(t);if(l&&o&&a){if(l instanceof Zo){const e=l.text,t=d-h.length,n=`${e.slice(0,t)}${h}${e.slice(t)}`,i=Jo.reset(l.id,n),r=hs.loc(l.id,d,l.id,t);u.tell(l,i,r)}else console.error("编辑目标无法在内存结构中找到,此问题多由于未将子cube计算到children属性");r.in_composition_mode=!1,i.record(u),s.emit_note_compositionend(e)}}clear_selection_text(){const{cursor:e,courier:t,history:n}=this;if(!e.has_selection)return;const{cube_end:i,cube_start:r,cube_selection:s,offset_start:o,offset_end:a}=e;if(!s||!i||!r)return;const l=new cs(t);l.tell(s,ds.delete(s.id,"backward",r.id,i.id,o,a)),n.record(l)}ins(e,t,n,i,r,s){const{courier:o,history:a}=t,l=i.text,c=l.slice(0,r)+n+l.slice(s),d=r+n.length,h=Jo.reset(i.id,c),u=hs.loc(i.id,d,i.id,r);e.tell(i,h,u);const p=ds.merge(i.id,"both",i.id,d);return e.tell(i,p),e}click_selection_text(e){if(!this.down_caret||!e.shiftKey)return;const{offset_end:t,node_end:n}=this.cursor,{offset:i,offsetNode:r}=this.down_caret;n instanceof Text&&r instanceof Text&&Promise.resolve().then(()=>{this.cursor.set_selection_between(n,t,r,i)})}drag_selection_text(e){if(!this.has_down||!this.down_caret||!ss.check_mouse_key(e,"left"))return;const t=document.caretPositionFromPoint(e.clientX,e.clientY);t&&this.down_caret.offsetNode instanceof Text&&t.offsetNode instanceof Text&&this.cursor.set_selection_between(this.down_caret.offsetNode,this.down_caret.offset,t.offsetNode,t.offset)}}class Ha extends qa{dragenter(e){e.preventDefault()}dragover(e){e.preventDefault()}dragleave(e){e.preventDefault()}drop(e){e.preventDefault();const{cursor:t}=this.root,{cube_end:n,offset_end:i}=t,r=e.dataTransfer;if(!r)return;const s=new DOMParser,o=r.getData("text/plain"),a=r.getData("text/html"),l=r.files;if(console.log("🍊",{files:l,html:a,text:o}),console.log("❤",(new DOMParser).parseFromString(a,"text/html")),o){const e=this.courier.get_recorder();console.log("💠text",o);const{offset_end:t,offset_start:n,cube_selection:i}=this.cursor;if(!(i instanceof Zo))return;this.ins(e,this._root,o,i,n,t),this.history.record(e)}if(a){const e=s.parseFromString(a,"text/html");console.log("💠html",e)}}handler_click_foot(e){e.preventDefault();const{courier:t,cursor:n,history:i}=this.root,r=this.root.child_last;if(r&&r.is_empty){let e=r;for(;e;){if(e instanceof Zo){e.line?.dom?.focus(),e.set_cursor_in_tail();break}e=e.child_last}}else{const e=new cs(t),n=ml.get_default();e.tell(this.root,ds.insert_child(this.root.id,[n],this.root.child_count)),i.record(e)}}}class Fa extends qa{}const $a={class:"dialog-form"},Ga={class:"form-grid"},Va={class:"label"},Ua=["onUpdate:modelValue"],Wa=Pn({__name:"menu-dialog",setup(e){const t=Wt();function n(){const e=t.value;e&&($s.open=!1,e.close())}function i(){n(),$s.submit($s.data)}return Xi(()=>$s.open,()=>{const e=t.value;e&&($s.open?e.showModal():e.close())}),(e,r)=>(fr(),yr("dialog",{class:"menu-dialog",ref_key:"root",ref:t,onClose:n},[Cr("div",$a,[Cr("div",{class:"close-corner",onClick:n}),Cr("div",Ga,[(fr(!0),yr(cr,null,ri(Object.keys(Kt($s).data),e=>(fr(),yr(cr,{key:e},[Cr("div",Va,Se(e),1),Cn(Cr("input",{type:"text",autofocus:"","onUpdate:modelValue":t=>Kt($s).data[e]=t},null,8,Ua),[[Oa,Kt($s).data[e]]])],64))),128))]),Cr("div",{class:"dialog-submit",onClick:i},"确认")])],544))}}),Ya=(0,wo.A)(Wa,[["__scopeId","data-v-13d4fd0e"]]),Xa={class:"menu-title iconfont icon-sp"},Ka=["onPointerdown","onMouseenter"],Ja={class:"item-shortcut"},Qa={key:0,class:"iconfont icon-arrow-right"},Za={class:"menu-title iconfont icon-sp"},el=["onPointerdown","onMouseenter"],tl={class:"item-shortcut"},nl={key:0,class:"iconfont icon-arrow-right"},il=Pn({__name:"note-menu",props:{root:{}},setup(e){const t=Wt(),n=Wt([]);function i(e,t=!1){t?(Fs.stack_menus.length=e,Fs.stack_rect.length=e,Fs.menu=void 0):(Fs.stack_menus.length=e,Fs.stack_rect.length=e)}function r(e,t,n){if(i(t),!n.has_submenu)return;const r=e.currentTarget;Fs.stack_rect.push(r.getBoundingClientRect());const s=n.mouseenter(e);Fs.stack_menus.push(s)}function s(e,t){i(0,!0),t.click(e)}function o(e){return{cursor:e.usable?"unset":"not-allowed",color:e.usable?"unset":"var(--menu-item-disable-color)"}}function a(e){e.stopPropagation()}return Xi(()=>Fs.point,async()=>{const e=t.value;if(!e)return;await fn(),Fs.stack_pos.length=0;const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},i=e.getBoundingClientRect(),r={x:Fs.point.x,y:Fs.point.y,width:0,height:0},s=us.MathRect.move_rect_to_other(n,i,r);Fs.css={left:s.x+"px",top:s.y+"px"}}),Xi(Fs.stack_menus,async()=>{await fn();const e=n.value;if(!e)return;Fs.stack_pos.length=0;const t={x:0,y:0,width:window.innerWidth,height:window.innerHeight};for(let n=0;n<Fs.stack_menus.length;n++){const i=Fs.stack_rect[n],r=po(t,e[n].getBoundingClientRect(),i);Fs.stack_pos.push({left:r.x+"px",top:r.y+"px"})}}),Vn(()=>{document.documentElement.addEventListener("pointerdown",e=>{const n=t.value;if(!n)return;const i=e.target;i&&!n.contains(i)&&(Fs.menu=void 0,Fs.stack_menus.length=0,Fs.stack_pos.length=0,Fs.stack_rect.length=0)},{capture:!0})}),(e,i)=>(fr(),yr("div",{class:"note-menus",style:fe(Kt(Fs).css),ref_key:"dom",ref:t,onWheel:a},[Pr(" 弹窗 "),Mr(Ya),Pr(" 主菜单列表 "),Kt(Fs).menu?(fr(),yr("div",{key:0,class:"menu-list",ref_key:"ms",ref:n},[Cr("div",Xa,Se(Kt(Fs).menu.title),1),(fr(!0),yr(cr,null,ri(Kt(Fs).menu.menus,e=>(fr(),yr("div",{class:ve(["menu-item",{"active-item":Kt(Fs).menu.active.includes(e.title)}]),style:fe(o(e)),key:e.title,onPointerdown:t=>s(t,e),onMouseenter:t=>r(t,0,e)},[Cr("div",{class:ve(["item-title",e.icon])},Se(e.title),3),Cr("div",Ja,Se(e.shortcut),1),e.has_submenu?(fr(),yr("div",Qa)):Pr("v-if",!0)],46,Ka))),128))],512)):Pr("v-if",!0),Pr(" 子菜单列表 "),(fr(!0),yr(cr,null,ri(Kt(Fs).stack_menus,(e,t)=>(fr(),yr("div",{class:"submenu-list",ref_for:!0,ref_key:"ms",ref:n,style:fe(Kt(Fs).stack_pos[t])},[Cr("div",Za,Se(e.title),1),(fr(!0),yr(cr,null,ri(e.menus,n=>(fr(),yr("div",{class:ve(["menu-item",{"active-item":e.active.includes(n.title)}]),style:fe(o(n)),key:n.title,onPointerdown:e=>s(e,n),onMouseenter:e=>r(e,t+1,n)},[Cr("div",{class:ve(["item-title",n.icon])},Se(n.title),3),Cr("div",tl,Se(n.shortcut),1),n.has_submenu?(fr(),yr("div",nl)):Pr("v-if",!0)],46,el))),128))],4))),256))],36))}}),rl=(0,wo.A)(il,[["__scopeId","data-v-43e0bd72"]]),sl=["id","data-type"],ol={class:"doc-postils"},al=Pn({__name:"cube-doc",props:{cube:{}},setup(e){const t=e.cube,{config:i}=e.cube,r=new Ha(t),s=e=>r.pointerdown(e),o=e=>r.pointermove(e),a=e=>r.pointerup(e),l=e=>r.pointercancel(e),c=e=>r.handler_click_foot(e),d=e=>r.compositionstart(e),h=e=>r.compositionupdate(e),u=e=>r.compositionend(e),p=e=>r.beforeinput(e),m=e=>r.dragover(e),f=e=>r.dragenter(e),_=e=>r.dragleave(e),g=e=>r.drop(e);return Vn(()=>{document.documentElement.addEventListener("pointerup",a),document.documentElement.addEventListener("pointermove",o),document.documentElement.addEventListener("pointercancel",l)}),(e,r)=>(fr(),yr("div",{class:"cube-doc",id:Kt(t).id,"data-type":Kt(n).doc,style:fe(Kt(i).css_vars),onDragover:m,onDragenter:f,onDragleave:_,onDrop:g},[Cr("div",{class:"note",onPointerdown:s,onCompositionstart:d,onCompositionupdate:h,onCompositionend:u,onBeforeinput:p},[(fr(!0),yr(cr,null,ri(Kt(t).children,e=>(fr(),vr(ni(e.component),{key:e.id,cube:e,id:e.id},null,8,["cube","id"]))),128)),Pr(" doc-cubes "),Cr("div",ol,[(fr(!0),yr(cr,null,ri(Kt(t).cubes.postils,([e,t])=>(fr(),vr(Oo,{key:t.id,cube:t},null,8,["cube"]))),128))]),Pr(" footer "),Cr("div",{class:"cube-doc-footer",onPointerdown:c},null,32)],32),Pr(" scope selection "),(fr(!0),yr(cr,null,ri(Kt(t).scope,e=>(fr(),vr(ja,{key:e.id,selection:$t(e)},null,8,["selection"]))),128)),Pr(" menus "),Mr(rl,{root:e.cube},null,8,["root"])],44,sl))}}),ll=(0,wo.A)(al,[["__scopeId","data-v-728e5342"]]),cl=["id","data-type"],dl={class:"cube-box-root-content"},hl=Pn({__name:"cube-box-root",props:{cube:{}},setup(e){const t=e.cube,{stats:i}=e.cube,r=Jr(()=>({opacity:(e.cube.child_count+10)/60})),s=e=>function(e,t){if(e.stopPropagation(),!Qs)return void e.preventDefault();const n=e.currentTarget;n instanceof HTMLElement&&(Zs=n,Ks=t,document.body.style.setProperty("--box-root-pointer-events","none"))}(e,t),o=e=>function(e,t){if(!Qs||!Ks)return;e.stopPropagation();const n=e.currentTarget;n instanceof HTMLElement&&t!==Ks&&(n!==eo&&eo?.classList.remove("drag-enter"),eo=n,Js=t,eo.classList.add("drag-enter"))}(e,t),a=e=>function(e,t){Qs&&(e.preventDefault(),e.stopPropagation(),Ks&&Js&&Zs&&eo&&Ks!==Js&&(Zs.style["view-transition-name"]=Ks.id,document.startViewTransition(()=>{if(!(Ks&&Js&&Zs&&eo))return;const{courier:e,history:n}=t,i=new cs(e),r=Zs.getBoundingClientRect(),s=Js.index,o=Ks.export(),a=Js.pcube;Ks.pcube===a?i.tell(Ks.pcube,ds.reorder(Ks.pid,Ks.id,Js.index)):(i.merge(Ks.remove_self()),i.tell(a,ds.insert_child(a.id,[o],s))),n.record(i);const l=eo.getBoundingClientRect(),c=l.x-r.x,d=l.y-r.y;document.body.style.setProperty("--x",c+"px"),document.body.style.setProperty("--y",d+"px")}),Qs=!1))}(e,t),l=e=>(eo&&eo.classList.remove("drag-enter"),Zs&&Zs.classList.remove("drag-enter"),void(Qs=!1)),c=e=>function(e){e.preventDefault(),e.stopPropagation(),eo&&eo.classList.add("drag-enter")}(e),d=e=>function(e){e.stopPropagation(),eo&&eo.classList.remove("drag-enter")}(e),h=e=>function(e){const t=e.target;t instanceof HTMLElement&&"cube-box-root-dragger"===t.dataset.tag&&(Qs=!0,e.stopPropagation())}(e),u=e=>function(e,t){const{stats:n}=t.root,i=t.index+1;n.active_root_index=i}(0,t);function p(e){const{stats:t}=e;return{"anchor-root":t.anchor_root_id===e.id,"fold-root":e.attrs.fold}}return(e,i)=>(fr(),yr("div",{class:"cube-box-root",style:fe(Kt(t).css),draggable:"true",id:e.cube.id,"data-type":Kt(n).box_root,onContextmenu:i[2]||(i[2]=t=>Kt(uo)(t,e.cube)),onFocusin:u,onDragstart:s,onDragenter:o,onDrop:a,onDragend:l,onDragover:c,onDragleave:d,onPointerdown:h},[Cr("div",{class:ve(["cube-dragger",p(e.cube)]),style:fe(r.value),onClick:i[0]||(i[0]=t=>Kt(no)(t,e.cube)),onContextmenu:i[1]||(i[1]=t=>Kt(io)(t,e.cube)),"data-tag":"cube-box-root-dragger"},null,38),Cr("div",dl,[e.cube.attrs.fold?(fr(),vr(Oo,{key:0,cube:e.cube.child_first},null,8,["cube"])):(fr(!0),yr(cr,{key:1},ri(Kt(t).children,e=>(fr(),vr(Oo,{key:e.id,cube:$t(e)},null,8,["cube"]))),128))])],44,cl))}}),ul=(0,wo.A)(hl,[["__scopeId","data-v-76631106"]]);function pl(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class ml extends Es{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return ul}get meta(){return ml.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof bl&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof Es&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=ss.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return ml.update_data(e,t)}replace_id(e,t={}){return ml.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:i,from_id:r}=e,s=new cs(t);return"left"===n?this.prev_cube_deep instanceof ml?s.tell(this,ds.merge(this.id,"left",r,i)):s.tell(this,hs.in_head(this.id)):"right"===n&&(this.next_cube_deep instanceof ml?s.merge(this.on(ds.merge(this.id,"right",r,i))):s.tell(this,hs.in_tail(this.id))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s}=this,{method:o,cubeid:a,offset:l}=e,c=new cs(t);if("left"===o&&n instanceof ml){const e=this.export().info;c.tell(n,ds.insert_child(n.id,e,"tail")),c.tell(this.pcube,ds.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}else if("right"===o&&i instanceof ml){const e=i.export().info;c.tell(this,ds.insert_child(this.id,e,"tail")),c.tell(this.pcube,ds.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}else if("both"===o)if(n instanceof ml&&i instanceof ml){const e=this.export().info,t=i.export().info;c.tell(n,ds.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,ds.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=hs.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof ml&&!(i instanceof ml)){const e=this.export().info;c.tell(n,ds.insert_child(n.id,e,"tail")),c.tell(this.pcube,ds.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof ml)&&i instanceof ml){const e=i.export().info;c.tell(this,ds.insert_child(this.id,e,"tail")),c.tell(this.pcube,ds.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}return c}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new cs(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(ds.reorder(this.id,o.id,c)),a}on_cube_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=ss.filter_out_empty(n);if(0===r.length){const e=this.children[0];if(1===this.child_count&&e instanceof Zo&&e.is_empty)return;const t=this.export().info,n=new bl(bl.get_default(),this);this.splice(0,this.child_count,n),i.add_recover(ds.reset(this.id,t)),i.tell(n,hs.in_tail(n.id))}else{const e=this.export().info,t=ss.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(ds.reset(this.id,e))}return i}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;let s=this.get_valid_index(n);const o=ss.pick(i,!0),a=ss.build_cubes(o.sort,this);this.splice(s,0,...a),r.add_recover(ds.delete_child(this.id,"backward",[s,s+a.length]));const l=a[a.length-1],c=this.children[s+1];return l?r.tell(l,hs.in_tail(l.id)):r.tell(c,hs.in_head(c.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=o;let h=c<0?0:c,u=d>this.child_count?this.child_count:d;if(!(h>=u)){if(h<=0&&u>=this.child_count&&!a){if(a){if(this.is_empty)return;l.tell(this,ds.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,ds.delete_child(e.id,s,[0,e.child_count],a))}else this.is_empty?l.tell(r,ds.delete_child(n,s,[i,i+1])):l.tell(this,ds.reset(this.id,[]));return l}{const e=this.children[h-1],t=this.children[u],n=u-h;let i=this.splice(c,n);l.add_recover(ds.insert_child(this.id,i.data,c)),"backward"===s?e?l.tell(e,hs.in_tail(e.id)):t&&l.tell(t,hs.in_head(t.id)):"forward"===s&&(t?l.tell(t,hs.in_head(t.id)):e&&l.tell(e,hs.in_tail(e.id)))}return l}}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!Zo.is_empty_text(e))}static get meta(){return{type:n.box_root,cubename:"根级块",version:1,block:!0,show:!1}}static get_default(e=[],t={},i={fold:!1}){const r=0===e.length?[bl.get_default()]:e;return{id:ss.get_id(),type:n.box_root,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=rs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}pl([ys(i.cube_delete_adjacent)],ml.prototype,"on_cube_delete_adjacent",null),pl([ys(i.cube_merge)],ml.prototype,"on_merge",null),pl([ys(i.cube_reorder)],ml.prototype,"on_cube_reorder",null),pl([ys(i.cube_reset)],ml.prototype,"on_cube_reset",null),pl([ys(i.cube_insert_child)],ml.prototype,"on_insert_child",null),pl([ys(i.cube_delete_child)],ml.prototype,"on_delete_child",null);class fl{}class _l extends Ls{_app;data;constructor(e){super();const t=this.update_data(e.versions[this.meta.type],e).data;this.data=Lt(t),this.build_child(t),bs.init_cmd_handler(this),rs.add_doc(this),this._app=Ea(ll,{cube:this})}get domain(){return"doc"}get app(){return this._app}get component(){return ll}get meta(){return _l.meta}get doc(){return this}get children(){const e=[];for(let t of this._children)e.push(t);return e}build_child(e){const t=ss.build_cubes(e.info,this);return this._children.push(...t),t}gc(){}export(){const e=Ft(this.data);e.css=structuredClone(Ft(this.css)),e.attrs=structuredClone(Ft(this.attrs)),e.info=[],e.versions=rs.export_versions();for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return _l.update_data(e,t)}replace_id(e,t={}){return _l.replace_id(this.root,e,t)}render(e){this._dom=e,this.hotkeys.listen(e),this.app.mount(e),this.event.emit_status_update()}static get meta(){return{type:n.doc,cubename:"文档",version:1,block:!0,show:!1}}static get_default(){return ml.get_default(),{id:is(),type:n.doc,versions:rs.export_versions(),info:[],css:{},attrs:{}}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=rs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}function gl(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class bl extends Es{_component=na;get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return this._component}get editable(){if(this.stats.is_read_mode)return!1;const e=this.host_postil,t=this.host_node;return!e&&t?t.editable:!(!e||t)||!e||!t||e.level>t.level||t.editable}get meta(){return bl.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}get attrs(){return this.data.attrs}get child_first_text(){for(let e of this._children)if(e instanceof Zo)return e}get child_last_text(){for(let e of[...this._children].reverse())if(e instanceof Zo)return e}get next_line(){let e=this.next_cube_deep;for(;e;){if(e instanceof _l)return;let t=ss.find_line(e,"first");if(t)return t;e=e.next_cube_deep}}get prev_line(){let e=this.prev_cube_deep;for(;e;){if(e instanceof _l)return;let t=ss.find_line(e,"last");if(t)return t;e=e.prev_cube_deep}}constructor(e,t){return super(e,t),this.setup(e,t)}gc(){super.base_gc()}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof Es&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=ss.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}update_data(e,t){return bl.update_data(e,t)}replace_id(e,t={}){return bl.replace_id(this.root,e,t)}inherit_line(e){const t=Math.min(...e.map(e=>e.attrs.indent||0));for(let n of e){const e=this.attrs.indent;if(e){const i=n.attrs.indent||0;n.attrs.indent=e+i-t}this.css["text-indent"]&&n.type===this.type&&(n.css["text-indent"]=this.css["text-indent"])}}on_cube_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s,pcube:o}=this,{method:a,cubeid:l,offset:c}=e,d=new cs(t);if("left"===a&&n instanceof bl){const e=ss.exports(this.children),t=ss.filter_out_empty(e);d.tell(n,ds.insert_child(n.id,t,"tail")),d.merge(this.remove_self("backward"));const i=n.find_child_cube(l);if(i){const e=hs.loc(l,c,l,c);d.tell(i,e)}}else if("right"===a&&i instanceof bl){const e=i.export().info,t=ss.filter_out_empty(e);d.tell(this,ds.insert_child(this.id,t,"tail")),d.tell(o,ds.delete_child(s,"backward",[r+1,r+2]));const n=this.find_child_cube(l);n&&d.tell(n,hs.loc(l,c,l,c))}else if("both"===a)if(n instanceof bl&&i instanceof bl){const e=ss.filter_out_empty(this.export().info),t=ss.filter_out_empty(i.export().info);d.tell(n,ds.insert_child(n.id,e.concat(t),"tail")),d.tell(o,ds.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_child_cube(l);r&&d.tell(r,hs.loc(l,c,l,c))}else if(n instanceof bl&&!(i instanceof bl)){const e=ss.filter_out_empty(this.export().info);d.tell(n,ds.insert_child(n.id,e,"tail")),d.tell(o,ds.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_child_cube(l);t&&d.tell(t,hs.loc(l,c,l,c))}else if(!(n instanceof bl)&&i instanceof bl){const e=ss.filter_out_empty(i.export().info);d.tell(this,ds.insert_child(this.id,e,"tail")),d.tell(o,ds.delete_child(s,"backward",[r+1,r+2]));const t=this.find_child_cube(l);t&&d.tell(t,hs.loc(l,c,l,c))}return d}on_cube_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=ss.filter_out_empty(n);if(0===r.length){if(this.is_empty)return;const e=this.export().info,t=new Zo(Zo.get_default(),this);this.splice(0,this.child_count,t),i.add_recover(ds.reset(this.id,e)),i.tell(t,hs.in_tail(t.id))}else{const e=this.export().info,t=ss.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(ds.reset(this.id,e))}return i}on_insert_child(e){const{courier:t,pid:n,pcube:i}=this,{pos:r,data:s}=e,o=new cs(t);if(0===s.length)return o;let a=this.get_valid_index(r);const l=ss.pick(s);if(l.head.length>0){o.add_cmd(e);const t=ss.build_cubes(s,this),n=t[t.length-1];this.splice(a,0,...t),o.add_recover(ds.delete_child(this.id,"backward",[a,a+t.length])),n&&o.tell(n,hs.in_tail(n.id))}const c=[...l.body];if(l.tail.length>0&&c.push(bl.get_default(l.tail)),l.root.length>0)for(let e of l.root)c.push(...e.info);if(c.length>0)if(this.inherit_line(c),this.is_empty)o.tell(i,ds.insert_child(n,c,this.index)),o.tell(i,ds.delete_child(n,"backward",[this.index,this.index+1]));else{const e=this.get_valid_index(a+l.head.length);if(e<this.child_count){const t=this._children.slice(e);if(t.length>0){const r=t.map(e=>e.export()),s=bl.get_default(r);this.inherit_line([s]),o.tell(this,ds.delete_child(this.id,"backward",[e,this.child_count])),o.tell(i,ds.insert_child(n,[s],this.index+1))}}o.tell(i,ds.insert_child(n,c,this.index+1))}return o}on_delete_child(e){const{dir:t,range:n,reserve:i}=e,{courier:r,pid:s,index:o,pcube:a}=this,l=r.get_recorder();l.add_cmd(e);const[c,d]=n;let h=c<0?0:c,u=d>this.child_count?this.child_count:d;if(!(h>=u)){if(h<=0&&u>=this.child_count)if(i){if(this.is_empty)return;const e=this.child_first;e instanceof Zo?(l.tell(this,ds.delete_child(this.id,t,[1,this.child_count])),l.tell(e,Jo.reset(e.id,"")),l.tell(e,hs.loc(e.id,1,e.id,1))):l.tell(this,ds.reset(this.id,[]))}else this.is_empty?l.tell(a,ds.delete_child(s,t,[o,o+1])):l.tell(this,ds.reset(this.id,[]));else{const e=this.children[h-1],n=this.children[u],i=u-h;if(h>=this.child_count||i<=0)return;let r=this.splice(h,i);l.add_recover(ds.insert_child(this.id,r.data,c)),"backward"===t?e?l.tell(e,hs.in_tail(e.id)):n&&l.tell(n,hs.in_head(n.id)):"forward"===t&&(n?l.tell(n,hs.in_head(n.id)):e&&l.tell(e,hs.in_tail(e.id)))}return l}}on_cube_delete_adjacent(e){const{courier:t,pid:n,prev_cube:i,next_cube:r,pcube:s}=this,{from:o,from_id:a,offset:l}=e,c=new cs(t);return"left"===o?this.prev_cube_deep instanceof bl?c.tell(this,ds.merge(this.id,"left",a,l)):c.tell(this,hs.in_head(this.id)):"right"===o&&(this.next_cube_deep instanceof bl?c.tell(this,ds.merge(this.id,"right",a,l)):c.tell(this,hs.in_tail(this.id))),c}static filter_out_empty(e){return e.filter(e=>!Zo.is_empty_text(e))}static get meta(){return{version:1,type:n.line,cubename:"行",block:!0,show:!1}}static get_default(e=[],t={},i={}){const r=0===e.length?[Zo.get_default()]:e;return{id:is(),type:n.line,info:r,css:t,attrs:i}}static get_default_by_string(e="",t={},i={}){const r=[Zo.get_default(e||"")];return{id:is(),type:n.line,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=rs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}gl([ys(i.cube_merge)],bl.prototype,"on_cube_merge",null),gl([ys(i.cube_reset)],bl.prototype,"on_cube_reset",null),gl([ys(i.cube_insert_child)],bl.prototype,"on_insert_child",null),gl([ys(i.cube_delete_child)],bl.prototype,"on_delete_child",null),gl([ys(i.cube_delete_adjacent)],bl.prototype,"on_cube_delete_adjacent",null);const yl=["id","data-type"],vl=Pn({__name:"cube-box",props:{cube:{}},setup(e){function t(t){if(t.target===t.currentTarget){t.stopPropagation();const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=hs.in_tail(e.cube.id);r.tell(e.cube,s),i.record(r)}}return(e,i)=>(fr(),yr("div",{class:"cube-box",style:fe(e.cube.css),id:e.cube.id,"data-type":Kt(n).box,onPointerup:t},[(fr(!0),yr(cr,null,ri(e.cube.children,e=>(fr(),vr(Oo,{key:e.id,cube:e},null,8,["cube"]))),128))],44,yl))}}),wl=(0,wo.A)(vl,[["__scopeId","data-v-b4213ca8"]]);function xl(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class kl extends Es{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return $t(wl)}get attrs(){return this.data.attrs}get meta(){return kl.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof Es&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=ss.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return kl.update_data(e,t)}gc(){super.base_gc()}replace_id(e,t={}){return kl.replace_id(this.root,e,t)}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s}=this,{method:o,cubeid:a,offset:l}=e,c=new cs(t);if("left"===o&&n instanceof kl){const e=this.export().info;c.tell(n,ds.insert_child(n.id,e,"tail")),c.tell(this.pcube,ds.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_child_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}else if("right"===o&&i instanceof kl){const e=i.export().info;c.tell(this,ds.insert_child(this.id,e,"tail")),c.tell(this.pcube,ds.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}else if("both"===o)if(n instanceof kl&&i instanceof kl){const e=this.export().info,t=i.export().info;c.tell(n,ds.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,ds.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=hs.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof kl&&!(i instanceof kl)){const e=this.export().info;c.tell(n,ds.insert_child(n.id,e,"tail")),c.tell(this.pcube,ds.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof kl)&&i instanceof kl){const e=i.export().info;c.tell(this,ds.insert_child(this.id,e,"tail")),c.tell(this.pcube,ds.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}return c}on_box_order(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new cs(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(ds.reorder(this.id,o.id,c)),a}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(ds.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,hs.in_head(a.id)):r.tell(this.child_last,hs.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=o;let h=c<0?0:c,u=d>this.child_count?this.child_count:d;if(!(h>=u)){if(h<=0&&u>=this.child_count)if(a){if(this.is_empty)return;l.tell(this,ds.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,ds.delete_child(e.id,s,[0,e.child_count],a))}else this.is_empty?l.tell(r,ds.delete_child(n,s,[i,i+1])):l.tell(this,ds.reset(this.id,[]));else{const e=this.children[h-1],t=this.children[u],n=u-h;if(h>=this.child_count||n<=0)return;let i=this.splice(h,n);l.add_recover(ds.insert_child(this.id,i.data,c)),"backward"===s?e?l.tell(e,hs.in_tail(e.id)):t&&l.tell(t,hs.in_head(t.id)):"forward"===s&&(t?l.tell(t,hs.in_head(t.id)):e&&l.tell(e,hs.in_tail(e.id)))}return l}}on_box_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=ss.filter_out_empty(n);if(0===r.length){if(this.is_empty)return;const e=this.export().info,t=new bl(bl.get_default(),this);this.splice(0,this.child_count,t),i.add_recover(ds.reset(this.id,e)),i.tell(t,hs.in_tail(t.id))}else{const e=this.export().info,t=ss.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(ds.reset(this.id,e))}return i}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:i}=this,{from:r,from_id:s,offset:o}=e,a=new cs(t);if("left"===r)if(this.prev_cube_deep instanceof kl)a.tell(this,ds.merge(this.id,"left",s,o));else{const e=this.export().info,t=this.child_first.id;a.tell(n,ds.insert_child(i,e,this.index)),a.merge(this.remove_self());const l=n.find_cube(t);l&&a.tell(l,ds.delete_adjacent(t,r,s,o))}else if("right"===r)if(this.next_cube_deep instanceof kl)a.merge(this.on(ds.merge(this.id,"right",s,o)));else{const e=this.export().info,t=this.child_first.id;a.tell(n,ds.insert_child(i,e,this.index)),a.merge(this.remove_self());const l=n.find_cube(t);l&&a.tell(l,ds.delete_adjacent(t,r,s,o))}return a}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static get meta(){return{type:n.box,cubename:"块",version:1,block:!0,show:!0}}static get_default(e=[],t={},i={}){const r=[];return 0===e.length?r.push(bl.get_default()):r.push(...ss.pick(e).sort),{id:ss.get_id(),type:n.box,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=rs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}xl([ys(i.cube_merge)],kl.prototype,"on_merge",null),xl([ys(i.cube_reorder)],kl.prototype,"on_box_order",null),xl([ys(i.cube_insert_child)],kl.prototype,"on_insert_child",null),xl([ys(i.cube_delete_child)],kl.prototype,"on_delete_child",null),xl([ys(i.cube_reset)],kl.prototype,"on_box_reset",null),xl([ys(i.cube_delete_adjacent)],kl.prototype,"on_cube_delete_adjacent",null);const Sl=["id","data-type"],Cl=Pn({__name:"cube-box-folder",props:{cube:{}},setup(e){const t=e.cube,{stats:i}=e.cube;return(e,i)=>(fr(),yr("div",{class:ve(["cube-box-folder",{"cube-box-folder-active":e.cube.attrs.fold}]),id:e.cube.id,style:fe(Kt(t).css),"data-type":Kt(n).box_folder},[e.cube.attrs.fold?(fr(),vr(Oo,{key:0,cube:e.cube.child_first},null,8,["cube"])):(fr(!0),yr(cr,{key:1},ri(Kt(t).children,e=>(fr(),vr(Oo,{key:e.id,cube:$t(e)},null,8,["cube"]))),128)),Cr("div",{class:ve(["folder-tag",{"folder-tag-active":e.cube.attrs.fold}]),onClick:i[0]||(i[0]=t=>function(e,t){const{courier:n,history:i,cubes:r,id:s,pcube:o}=t,a=n.get_recorder();a.tell(t,ds.fold(s,!t.attrs.fold)),i.record(a);for(let e of Object.values(r.postils))e.find_upstream_untill(o)===t&&e.visible(!1);const l=t.child_first.id;if(!l)return;const c=document.getElementById(l);c?.scrollIntoView({block:"nearest",behavior:"smooth"})}(0,e.cube))},null,2)],14,Sl))}}),Ml=(0,wo.A)(Cl,[["__scopeId","data-v-e4ce51da"]]);function zl(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Al extends Es{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return Ml}get meta(){return Al.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof bl&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof Es&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=ss.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return Al.update_data(e,t)}replace_id(e,t){return Al.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:i,from_id:r}=e,s=new cs(t);return"left"===n?this.prev_cube_deep instanceof Al?s.tell(this,ds.merge(this.id,"left",r,i)):s.tell(this,hs.in_head(this.id)):"right"===n&&(this.next_cube_deep instanceof Al?s.merge(this.on(ds.merge(this.id,"right",r,i))):s.tell(this,hs.in_tail(this.id))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s}=this,{method:o,cubeid:a,offset:l}=e,c=new cs(t);if("left"===o&&n instanceof Al){const e=this.export().info;c.tell(n,ds.insert_child(n.id,e,"tail")),c.tell(this.pcube,ds.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}else if("right"===o&&i instanceof Al){const e=i.export().info;c.tell(this,ds.insert_child(this.id,e,"tail")),c.tell(this.pcube,ds.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}else if("both"===o)if(n instanceof Al&&i instanceof Al){const e=this.export().info,t=i.export().info;c.tell(n,ds.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,ds.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=hs.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof Al&&!(i instanceof Al)){const e=this.export().info;c.tell(n,ds.insert_child(n.id,e,"tail")),c.tell(this.pcube,ds.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof Al)&&i instanceof Al){const e=i.export().info;c.tell(this,ds.insert_child(this.id,e,"tail")),c.tell(this.pcube,ds.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=hs.loc(a,l,a,l);c.tell(t,e)}}return c}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new cs(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(ds.reorder(this.id,o.id,c)),a}on_cube_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=ss.filter_out_empty(n);if(0===r.length){const e=this.children[0];if(1===this.child_count&&e instanceof Zo&&e.is_empty)return;const t=this.export().info,n=new bl(bl.get_default(),this);this.splice(0,this.child_count,n),i.add_recover(ds.reset(this.id,t)),i.tell(n,hs.in_tail(n.id))}else{const e=this.export().info,t=ss.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(ds.reset(this.id,e))}return i}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(ds.delete_child(this.id,"backward",[s,s+o.length]));const a=o[o.length-1],l=this.children[s+1];return a?r.tell(a,hs.in_tail(a.id)):r.tell(l,hs.in_head(l.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=o;let h=c<0?0:c,u=d>this.child_count?this.child_count:d;if(h>=u)return;if(h<=0&&u>=this.child_count){if(a){if(this.is_empty)return;l.tell(this,ds.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,ds.delete_child(e.id,s,[0,e.child_count],a))}else this.is_empty?l.tell(r,ds.delete_child(n,s,[i,i+1])):l.tell(this,ds.reset(this.id,[]));return l}const p=this.children[h-1],m=this.children[u],f=u-h;let _=this.splice(c,f);return l.add_recover(ds.insert_child(this.id,_.data,c)),"backward"===s?p?l.tell(p,hs.in_tail(p.id)):m&&l.tell(m,hs.in_head(m.id)):"forward"===s&&(m?l.tell(m,hs.in_head(m.id)):p&&l.tell(p,hs.in_tail(p.id))),l}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!Zo.is_empty_text(e))}static get meta(){return{type:n.box_folder,cubename:"折叠块",version:1,block:!0,show:!0}}static get_default(e=[],t={},i={fold:!1}){const r=0===e.length?[bl.get_default()]:e;return{id:ss.get_id(),type:n.box_folder,info:r,css:t,attrs:i}}static replace_id(e,t,n){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=rs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}zl([ys(i.cube_delete_adjacent)],Al.prototype,"on_cube_delete_adjacent",null),zl([ys(i.cube_merge)],Al.prototype,"on_merge",null),zl([ys(i.cube_reorder)],Al.prototype,"on_cube_reorder",null),zl([ys(i.cube_reset)],Al.prototype,"on_cube_reset",null),zl([ys(i.cube_insert_child)],Al.prototype,"on_insert_child",null),zl([ys(i.cube_delete_child)],Al.prototype,"on_delete_child",null);class Tl{}const Pl=["d","id","data-type","stroke-width","stroke","marker-start","marker-end"],Nl=Pn({__name:"cube-linker",props:{cube:{}},setup:e=>(t,i)=>(fr(),yr("path",{d:t.cube.path,id:t.cube.id,class:ve(["cube-linker",{"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}]),style:fe(t.cube.css),"data-type":Kt(n).linker,"stroke-width":t.cube.attrs.stroke_width,stroke:t.cube.attrs.stroke,"marker-start":`url(#${t.cube.anchor_left})`,"marker-end":`url(#${t.cube.anchor_right})`},null,14,Pl))}),Ol=(0,wo.A)(Nl,[["__scopeId","data-v-b6ed5542"]]),Rl=["cx","cy"],Ll=Pn({__name:"op-node-drag",props:{interaction:{}},setup(e){const{info_node_drag:t}=e.interaction;return(e,n)=>(fr(),yr(cr,null,[Kt(t).show?(fr(),yr("circle",{key:0,cx:Kt(t).x,cy:Kt(t).y,r:"20",stroke:"black","stroke-width":"2","stroke-dasharray":"4 4",fill:"none"},null,8,Rl)):Pr("v-if",!0),Pr(' <g data-flag="drag-nodes" :transform="get_matrix()" style="pointer-events: none; user-select: none; opacity: 0.8" v-if="info_node_drag.show">\r\n <path d="M -54.5 -18 L 54.5 -18 Q 56.5 -18 56.5 -16 L 56.5 16 Q 56.5 18 54.5 18 L -54.5 18 Q -56.5 18 -56.5 16 L -56.5 -16 Q -56.5 -18 -54.5 -18 z" style="fill: rgba(255, 255, 255, 0.05); stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <path d="M -54.5 -18 L -54.5 -20 Q -54.5 -22 -52.5 -22 L 58.5 -22 Q 60.5 -22 60.5 -20 L 60.5 14 Q 60.5 16 58.5 16 L 56.5 16" style="fill: none; stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <text x="0" y="7" text-anchor="middle" font-size="14" style="fill: rgb(113 117 122)">已选择{{info_node_drag.count}}个节点</text>\r\n </g> ')],2112))}}),El={class:"map-status"},Dl={class:"tool-item map-scale"},Il={class:"tool-item map-nodes"},Bl=Pn({__name:"map-status",props:{cube:{}},setup(e){const t=e.cube,i=Jr(()=>e.cube.cubes.get_types_cube(n.node));function r(e){const n=t.dom_rect,i={x:n.x+n.width/2,y:n.y+n.height/2};t.scale_by_point(i,e,e)}return(t,n)=>(fr(),yr("div",El,[Cr("div",Dl,[Cr("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:n[0]||(n[0]=e=>r(-.1))}),Cr("span",null,Se((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),Cr("span",{class:"iconfont icon-add",onClick:n[1]||(n[1]=e=>r(.1))})]),Cr("div",Il,[Cr("span",null,"节点 : "+Se(i.value.size),1)])]))}}),jl=(0,wo.A)(Bl,[["__scopeId","data-v-9874579a"]]),ql=new os,Hl=["id","data-type"],Fl=["transform"],$l=["data-group"],Gl=["data-group"],Vl=["data-group"],Ul=["data-group"],Wl=["d"],Yl=["d","stroke-width","stroke","marker-start","marker-end"],Xl=["d"],Kl=["x","y","width","height"],Jl={class:"doc-postils"},Ql=Pn({__name:"cube-map",props:{cube:{}},setup(e){const t=e.cube,{placeholder:i,config:r}=e.cube,s=r.data,o=new Fa(t),a=Wt(),l=new ResizeObserver(e=>{t.get_view_rect(),ql.resolve()});Vn(()=>{const t=a.value;t&&l.observe(t),window.addEventListener("resize",t=>{e.cube.check_show_throttle()})});const c=e=>o.pointerdown(e),d=e=>o.pointermove(e),u=e=>o.pointerup(e),p=e=>o.pointercancel(e),m=e=>o.compositionstart(e),f=e=>o.compositionupdate(e),_=e=>o.compositionend(e),g=e=>o.beforeinput(e);return Vn(()=>{document.documentElement.addEventListener("pointerup",u),document.documentElement.addEventListener("pointermove",d),document.documentElement.addEventListener("pointercancel",p)}),(e,o)=>(fr(),yr("div",{class:"cube-map",id:e.cube.id,"data-type":Kt(n).map},[Cr("div",{class:"note",onPointerdown:c,onCompositionstart:m,onCompositionupdate:f,onCompositionend:_,onBeforeinput:g},[(fr(),yr("svg",{ref_key:"svg",ref:a,style:fe(Kt(r).css_vars)},[Cr("g",{transform:Kt(t).matrix2d_dom_string},[Cr("g",{"data-group":Kt(h).markers,class:"group-defs"},[...o[0]||(o[0]=[Tr('<defs data-v-8855d478>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-8855d478><path d="M 0 0 L 6 3 L 0 6 z" data-v-8855d478></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-8855d478><circle cx="3" cy="3" r="3" data-v-8855d478></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-8855d478><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-8855d478></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-8855d478><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-8855d478></rect></marker></defs>',1)])],8,$l),Cr("g",{"data-group":Kt(h).linkers,class:"group-linkers"},[(fr(!0),yr(cr,null,ri(Kt(t).get_linkers_view(),e=>(fr(),vr(Ol,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Gl),Cr("g",{"data-group":Kt(h).nodes,class:"group-nodes"},[(fr(!0),yr(cr,null,ri(e.cube.get_nodes_view(),e=>(fr(),vr(Oo,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Vl),Cr("g",{"data-group":Kt(h).placeholder,class:"group-placeholder"},[Kt(i).box_selector?(fr(),yr("path",{key:0,class:"placeholder-box-selector",d:Kt(i).box_selector},null,8,Wl)):Pr("v-if",!0),(fr(!0),yr(cr,null,ri(Kt(i).linker,e=>(fr(),yr(cr,null,[e?(fr(),yr("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":Kt(s).map_linker_stroke_width,stroke:Kt(s).map_linker_stroke,"marker-start":`url(#${Kt(s).map_linker_anchor_left})`,"marker-end":`url(#${Kt(s).map_linker_anchor_right})`},null,8,Yl)):Pr("v-if",!0)],64))),256)),Kt(i).line_delete?(fr(),yr("path",{key:1,class:"placeholder-line-delete",d:Kt(i).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,Xl)):Pr("v-if",!0),Pr(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),Mr(Ll,{interaction:e.cube.interaction},null,8,["interaction"])],8,Ul),Pr(" --------------------------------------------------------以下是测试信息----------------------------------------------------------- "),Pr(" ------------------节点信息---------------------- "),e.cube.isdev?(fr(!0),yr(cr,{key:0},ri(e.cube.nodes_test,e=>(fr(),yr(cr,null,[Pr(" 采样点 "),Pr(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of node.sample"></circle> '),Pr(" 中心点 "),Pr(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),Pr(" 左上角 "),Pr(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),Pr(" 边界框 "),Pr(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),Pr(" 树边界框 "),Cr("rect",{x:e.bound.pos_tree.x,y:e.bound.pos_tree.y,width:e.bound.size_tree.width,height:e.bound.size_tree.height,stroke:"red",fill:"none"},null,8,Kl)],64))),256)):Pr("v-if",!0),Pr(" ------------------连线信息---------------------- "),Pr(' <template v-if="cube.root.isdev" v-for="linker of Object.values(cube.linkers)"> '),Pr(" 采样点 "),Pr(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of linker.sample"></circle> '),Pr(" 中心点 "),Pr(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),Pr(" 左上角 "),Pr(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),Pr(" 边界框 "),Pr(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),Pr(" 树边界框 "),Pr(' <rect :x="node.bound.pos_tree.x" :y="node.bound.pos_tree.y" :width="node.bound.size_tree.width" :height="node.bound.size_tree.height" stroke="red" fill="none"></rect> '),Pr(" </template> "),Pr(" ------------------意图区域---------------------- "),Pr(' <rect :x="PP.prev.x" :y="PP.prev.y" :width="PP.prev.width" :height="PP.prev.height" stroke="red" fill="none"></rect>\r\n <rect :x="PP.next.x" :y="PP.next.y" :width="PP.next.width" :height="PP.next.height" stroke="blue" fill="none"></rect>\r\n <rect :x="PP.child.x" :y="PP.child.y" :width="PP.child.width" :height="PP.child.height" stroke="green" fill="none" v-if="PP.child"></rect> ')],8,Fl)],4)),Pr(" doc-cubes "),Cr("div",Jl,[(fr(!0),yr(cr,null,ri(Kt(t).cubes.postils,([e,t])=>(fr(),vr(Oo,{key:t.id,cube:t},null,8,["cube"]))),128))])],32),Pr(" scope selection "),(fr(!0),yr(cr,null,ri(Kt(t).scope,e=>(fr(),vr(ja,{key:e.id,selection:$t(e)},null,8,["selection"]))),128)),Pr(" map status "),Mr(jl,{cube:e.cube},null,8,["cube"]),Pr(" menus "),Mr(rl,{root:e.cube},null,8,["root"])],8,Hl))}}),Zl=(0,wo.A)(Ql,[["__scopeId","data-v-8855d478"]]);class ec{static draw(e){const{type:t,from:n,to:i}=e;return"line"===t?this.line(n,i):"bezier2"===t?this.bezier2(n,i):"polyline"===t?this.polyline(n,i):"polyline2"===t?this.polyline2(n,i):"polyline3"===t?this.polyline3(n,i):"wave"===t?this.wave(n,i):this.bezier2(n,i)}static get_line(e,t,n){return"line"===n?this.line(e,t):"bezier2"===n?this.bezier2(e,t):"polyline"===n?this.polyline(e,t):"polyline2"===n?this.polyline2(e,t):"polyline3"===n?this.polyline3(e,t):"wave"===n?this.wave(e,t):this.bezier2(e,t)}static line(e,t){return`M${e.x.toFixed(1)} ${e.y.toFixed(1)}L${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static bezier2(e,t){const n=(e.x+t.x)/2,i=n,r=e.y,s=n,o=t.y;return`M${e.x.toFixed(1)} ${e.y.toFixed(1)} C${i} ${r} ${s} ${o} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static polyline(e,t,n=4){const i=(e.x+t.x)/2,r=e,s=t,o=i,a=r.y,l=i,c=s.y,d=Math.sign(e.x-t.x),h=Math.sign(t.y-e.y),u=Math.sign(e.y-t.y),p=Math.sign(t.x-e.x);return`M${r.x} ${r.y} H ${o+d*n} Q ${o} ${a} ${o} ${a+h*n} V ${c+u*n} Q${l} ${c} ${l+p*n} ${c} H ${s.x}`}static polyline2(e,t,n=4){const i=e,r=t,s=(e.x+t.x)/2,o=i.y;return`M${i.x} ${i.y} L${s} ${o} L ${r.x} ${r.y}`}static polyline3(e,t,n=4){const i=(e.x+t.x)/2,r=e,s=t,o=(r.y,i),a=s.y;return`M${r.x} ${r.y} L${o} ${a} L ${s.x} ${s.y}`}static wave(e,t,n=2,i=8){const r=t.x-e.x,s=t.y-e.y,o=Math.sqrt(r*r+s*s),a=Math.atan2(s,r),l=i??o/10;let c=`M ${e.x} ${e.y}`;const d=20*n;for(let t=0;t<=d;t++){const i=t/d,o=e.x+r*i,h=e.y+s*i,u=l*Math.sin(i*n*Math.PI*2),p=o+-Math.sin(a)*u,m=h+Math.cos(a)*u;if(0===t)c+=` M ${p} ${m}`;else{const i=(t-1)/d,o=l*Math.sin(i*n*Math.PI*2),h=-Math.sin(a)*o,u=Math.cos(a)*o,f=e.x+r*i+h,_=e.y+s*i+u;c+=` C ${f+(p-f)/3} ${_+(m-_)/3}, ${p-(p-f)/3} ${m-(m-_)/3}, ${p} ${m}`}}return c}}class tc{static map={right:this.right.bind(this),left:this.left.bind(this),down:this.down.bind(this),up:this.up.bind(this),"time-right":this.time_right.bind(this),"time-down":this.time_down.bind(this)};static find(e,t){const n=e.env.layout_type;return t.env.upstream!==e?this.free_to_any(e,t):n?(0,this.map[n])(e,t):this.free_to_any(e,t)}static get_point(e){const t=e.env.layout_type;if(!t)return;const n=e.bound.rect;return"right"===t?us.MathRect.get_rect_point(n,us._RectPosition.right_mid):"left"===t?us.MathRect.get_rect_point(n,us._RectPosition.left_mid):"down"===t?us.MathRect.get_rect_point(n,us._RectPosition.bottom_mid):"up"===t?us.MathRect.get_rect_point(n,us._RectPosition.top_mid):"time-down"===t?us.MathRect.get_rect_point(n,us._RectPosition.bottom_mid):"time-right"===t?us.MathRect.get_rect_point(n,us._RectPosition.right_mid):void 0}static time_down(e,t){const n=t.env.prev_node||e,i={...n.bound.pos,...n.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:us.MathRect.get_rect_point(i,us._RectPosition.bottom_mid),to:us.MathRect.get_rect_point(r,us._RectPosition.top_mid)}}static time_right(e,t){const n=t.env.prev_node||e,i={...n.bound.pos,...n.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:us.MathRect.get_rect_point(i,us._RectPosition.right_mid),to:us.MathRect.get_rect_point(r,us._RectPosition.left_mid)}}static up(e,t){const n={...e.bound.pos,...e.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:us.MathRect.get_rect_point(n,us._RectPosition.top_mid),to:us.MathRect.get_rect_point(i,us._RectPosition.bottom_mid)}}static right(e,t){const n=e.bound.rect,i=t.bound.rect;return{from:us.MathRect.get_rect_point(n,us._RectPosition.right_mid),to:us.MathRect.get_rect_point(i,us._RectPosition.left_mid)}}static left(e,t){const n={...e.bound.pos,...e.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:us.MathRect.get_rect_point(n,us._RectPosition.left_mid),to:us.MathRect.get_rect_point(i,us._RectPosition.right_mid)}}static down(e,t){const n={...e.bound.pos,...e.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:us.MathRect.get_rect_point(n,us._RectPosition.bottom_mid),to:us.MathRect.get_rect_point(i,us._RectPosition.top_mid)}}static free_to_any(e,t){const n=e.sample,i=t.sample;if(0!==n.length&&0!==i.length)return es.find_closest_points(n,i)}}class nc{static update(e,t){return{id:e,name:k.update,attrs:t}}}class ic extends ts{_interaction;scope_down=null;fig_matrix_origin;pos_down_real;flow=!1;m;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-drag"}reset_status(){this.flow=!1}down(e,t){this.scope_down=t;const{selector:n}=t;"fig"===n.type&&this.map.interaction.check_mouse_key(e,"right")&&(e.stopPropagation(),e.preventDefault(),this.pos_down_real=this.map.view_point_to_real(t.pos),this.flow=!0,this.fig_matrix_origin={...this.map.matrix2d})}move(e){if(!this.flow||!this.scope_down||!this._interaction.check_mouse_key(e,"right"))return;e.stopPropagation(),e.preventDefault();const{map_sum_scale:t}=this.scope_down,n=e.clientX,i=e.clientY,r=(n-this.scope_down.pos.x)/t.sx,s=(i-this.scope_down.pos.y)/t.sy;this.m=Zr.multiply(this.fig_matrix_origin,Zr.get_matrix_translate(r,s)),this.map.reset_matrix(this.m)}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const t=this.courier.get_recorder();this.map.reset_matrix(this.fig_matrix_origin);const n=fs.update_attr(this.map.id,{matrix2d:this.m});t.tell(this.map,n),this.history.record(t),this.flow=!1,this.map.check_show()}cancel(e){this.flow&&(this.flow=!1,this.map.check_show())}leave(e){this.flow&&(this.flow=!1,this.map.check_show())}wheel(e){}dblclick(e){}contextmenu(e){}}class rc extends ts{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-scale"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){if(!e.ctrlKey)return;e.stopPropagation(),e.preventDefault();const{map_scale_step:t}=this.config.data,n=e.deltaY,i=-Math.sign(n),r={x:e.clientX,y:e.clientY},s=i*t;this.map.scale_by_point(r,s,s),this.map.check_show_throttle()}dblclick(e){}contextmenu(e){}}class sc extends ts{_interaction;count=0;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-wheel"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){e.stopPropagation(),e.preventDefault(),this.count++;const t=-Math.sign(e.deltaY)*this.config.data.scroll_distance;if(!e.ctrlKey){if(e.shiftKey){const e=Zr.multiply(this.map.matrix2d,Zr.get_matrix_translate(t,0));this.map.reset_matrix(e)}else{const e=Zr.multiply(this.map.matrix2d,Zr.get_matrix_translate(0,t));this.map.reset_matrix(e)}this.map.check_show_throttle()}}dblclick(e){}contextmenu(e){}}class oc extends ts{_interaction;down_point;view_cubes=[];flow=!1;count=0;rate=5;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:line-delete"}reset(){this.flow=!1,this.map.placeholder.line_delete="",this.view_cubes=[]}down(e,t){const{selector:n,pos:i}=t;this.stats.is_read_mode||"fig"===n.type&&this.map.interaction.check_mouse_key(e,"mid")&&(e.stopPropagation(),e.preventDefault(),this.flow=!0,this.down_point=this.map.view_point_to_real(i),this.view_cubes=this.map.get_view_cube())}move(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault(),this.count++;const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);if(this.map.placeholder.line_delete=ec.line(this.down_point,n),this.count%this.rate!==0)return;this.count=1,this.map.clear_delete_line();const i={from:this.down_point,to:n};for(let e of this.view_cubes)if(e instanceof js){let t=e.sample[0];for(let n of e.sample.slice(1)){const r={from:t,to:n};if(us.MathLine.check_intersection(r,i)){this.map.put_delete_selected(e);break}t=n}}else if(e instanceof Nc){let t=e.sample[0];for(let n of e.sample.slice(1)){const r={from:t,to:n};if(us.MathLine.check_intersection(r,i)){this.map.put_delete_selected(e);break}t=n}}}up(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this.root,i=t.get_recorder(),r=this.map.id,s=[],o=[],a=this.map.get_delete_selected();for(let e of a)e instanceof js?s.push(e.id):e instanceof Nc&&o.push(e.id);const l=fs.node_remove(r,s),c=fs.linker_remove(r,o);i.tell(this.map,l,c),n.record(i),this.reset()}cancel(e){this.reset()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class ac extends ts{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-add"}down(e,t){}move(e){}up(e){this.flow&&(this.flow=!1)}cancel(e){this.flow}wheel(e){}leave(){}dblclick(e,t){const{selector:n,pos:i}=t;if("fig"!==n.type)return;e.stopPropagation(),e.preventDefault();const{courier:r,history:s}=this,o=js.get_default_node_pos(i,this.map),a=[Hc.get_default(o)],l=fs.node_add(this.map.id,a),c=r.get_recorder();c.tell(this.map,l),s.record(c)}contextmenu(e){}}class lc extends ts{_interaction;flow=!1;point_down;count=0;rate=10;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-box-selected"}reset(){this.flow=!1,this.map.placeholder.box_selector=""}down(e,t){const{pos:n,selector:i}=t,{type:r,res:s}=i;"fig"===r&&this._interaction.check_mouse_key(e,"left")&&(e.preventDefault(),this.flow=!0,this.point_down=this.map.view_point_to_real(n))}move(e){if(!this.flow)return;this.count++,e.preventDefault();const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t),i=this.get_rect_area(this.point_down,n);if(this.map.placeholder.box_selector=i,this.count%this.rate!==0)return;this.count=1;const r={x:Math.min(this.point_down.x,n.x),y:Math.min(this.point_down.y,n.y),width:Math.abs(n.x-this.point_down.x),height:Math.abs(n.y-this.point_down.y)},s=this.map.get_nodes_intersection(r);this.map.clear_node_selected();for(let e of s)this.map.register_node_selected(e)}up(e){this.flow&&(e.stopPropagation(),e.preventDefault(),this.reset())}cancel(e){this.flow&&this.reset()}wheel(e){}leave(){}dblclick(e,t){}contextmenu(e){}get_rect_area(e,t,n=4){const i=t.x-e.x,r=t.y-e.y,s=Math.sign(i)*n,o=Math.sign(r)*n,a=e,l=a.x+i,c=a.y,d=t,h=a.x,u=a.y+r;return`M${a.x+s} ${a.y}H${l-s}Q${l} ${c} ${l} ${c+o}V${d.y-o}Q${d.x} ${d.y} ${d.x-s} ${d.y}H ${h+s}Q${h} ${u} ${h} ${u-o}V${a.y+o}Q${a.x} ${a.y} ${a.x+s} ${a.y}Z`}check_intersection(e,t){const n=e.x+e.width/2,i=e.y+e.height/2,r=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-r),a=Math.abs(i-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}}class cc extends ts{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-click-select"}down(e,t){const{selector:n,pos:i}=t,{type:r,res:s}=n;"node"!==r||n.res.editable||(e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.map.clear_node_selected(),s.pcube.toggle_node_selected(s))}move(e){this.flow}up(e){this.flow}leave(e){}cancel(e){}wheel(e){}dblclick(e){}contextmenu(e){}}class dc extends ts{_interaction;down_node;down_pos;matrix=new Map;matrix_translate=Zr.get_matrix_translate(0,0);scope_down;flow=!1;recover_select=!1;has_down=!1;view_cubes=[];near;intention="none";constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-drag"}reset_status(){this.recover_select=!1,this.matrix.clear(),this.flow=!1,this.has_down=!1,this._interaction.info_node_drag.show=!1,this.view_cubes=[]}down(e,t){this.scope_down=t;const{selector:n,pos:i,selected_nodes:r,view_cubes:s}=t;if("node"===n.type&&this.map.interaction.check_mouse_key(e,"left")&&!n.res.editable)if(e.stopPropagation(),e.preventDefault(),this.reset_status(),this.has_down=!0,this.view_cubes=s,this.down_node=n.res,this.down_pos=this.map.view_point_to_real(i),r.has(this.down_node))for(let e of r)e.env.is_captive||this.matrix.set(e,{...e.matrix2d});else this.matrix.set(this.down_node,{...this.down_node.matrix2d})}move(e){if(!this.has_down||!this.map.interaction.check_mouse_key(e,"left")||!this.down_pos)return;this.flow=!0,e.preventDefault();const t=this._interaction.info_node_drag,n={x:e.clientX,y:e.clientY},i=this.map.view_point_to_real(n),r=i.x-this.down_pos.x,s=i.y-this.down_pos.y;if(!this.recover_select){this.map.clear_node_selected();for(let[e]of this.matrix)this.map.register_node_selected(e);this.recover_select=!0}t.show=!1,this.matrix_translate=Zr.get_matrix_translate(r,s);for(let[e,t]of this.matrix){if(!t)continue;const n=Zr.multiply(t,this.matrix_translate);e.reset_matrix(n)}}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this,i=t.get_recorder();if(e.ctrlKey);else{const e=[];for(let[t,n]of this.matrix){if(!n)continue;t.reset_matrix(n),t.is_layout_root&&t.env.layout_type&&e.push(t);const r=Zr.multiply(n,this.matrix_translate),s=ms.layout_change(t.id,{matrix2d:r});i.tell(t,s)}n.record(i);for(let t of e)t.layout_throttle()}this.reset_status()}cancel(e){this.flow&&this.reset_status()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class hc extends ts{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit"}down(e,t){}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){const{selector:n,pos:i}=t;"node"===n.type&&(e.stopPropagation(),e.preventDefault(),n.res.editable=!0)}contextmenu(e){}}class uc extends ts{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit-exit"}down(e,t){const{selector:n}=t,{type:i,res:r}=n;"fig"!==i&&"empty"!==i||(e.stopPropagation(),e.preventDefault(),this.cubes.clear_all_map_selected(),this.map.clear_node_editing())}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){}contextmenu(e){}}class pc extends ts{_interaction;down_node;flow=!1;selected_nodes=new Set;recorver_selected=!1;has_down=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-line"}reset_status(){this.flow=!1,this.has_down=!1,this.selected_nodes.clear(),this.map.placeholder.linker=[],this.recorver_selected=!1}down(e,t){const{selector:n,pos:i,selected_nodes:r}=t;if("node"===n.type&&this._interaction.check_mouse_key(e,"right"))if(this.reset_status(),this.has_down=!0,e.preventDefault(),e.stopPropagation(),this.down_node=n.res,r.has(this.down_node))for(let e of r)this.selected_nodes.add(e);else this.selected_nodes.add(this.down_node)}move(e){if(!this._interaction.check_mouse_key(e,"right")||!this.has_down)return;this.flow=!0,e.stopPropagation(),e.preventDefault();const t=this._interaction.get_map_selector(e),{res:n,type:i}=t;this.map.placeholder.linker=[];const r=this.map.config.data.map_linker_line;if(!this.recorver_selected){this.recorver_selected=!0,this.map.clear_node_selected();for(let e of this.selected_nodes)this.map.register_node_selected(e)}if("node"===i)for(let e of this.selected_nodes){const{from:t,to:i}=es.find_closest_points(e.sample,n.sample);this.map.placeholder.linker.push(ec.get_line(t,i,r))}else{const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);for(let e of this.selected_nodes){const t=es.find_closet_point(e.sample,n);this.map.placeholder.linker.push(ec.get_line(t,n,r))}}}up(e){if(!this.flow)return this.reset_status();e.preventDefault(),e.stopPropagation();const{courier:t,history:n}=this,i=this._interaction.get_map_selector(e),{res:r,type:s}=i;if("node"===s){if(r===this.down_node)return;const e=t.get_recorder();for(let t of this.selected_nodes){const n=this.map.get_linker_id(t.id,r.id);if(this.map.get_linker(n))ns.tips?.tip_warning("已存在连接线");else{const n=es.create_linker_info(this.map,t.id,r.id),i=fs.linker_add(this.map.id,[n]);e.tell(this.map,i)}}n.record(e)}else if("fig"===s){const{courier:t,history:n}=this,i=t.get_recorder(),r=js.get_default_node_pos({x:e.clientX,y:e.clientY},this.map),s=Hc.get_default(r),o=fs.node_add(this.map.id,[s]);i.tell(this.map,o);for(let e of this.selected_nodes){const t=this.map.get_linker_id(e.id,s.id);if(this.map.get_linker(t)){ns.tips?.tip_warning("已存在连接线");continue}const n=es.create_linker_info(this.map,e.id,s.id),r=fs.linker_add(this.map.id,[n]);i.tell(this.map,r)}n.record(i)}this.reset_status()}leave(){}cancel(e){this.reset_status()}wheel(e){}dblclick(e,t){}contextmenu(e){e.preventDefault()}}class mc extends ts{_map;interactions_pointer=[];interaction_keyboard=[];constructor(e){super(e.root),this._map=e,this.interactions_pointer.push(new ic(this)),this.interactions_pointer.push(new rc(this)),this.interactions_pointer.push(new hc(this)),this.interactions_pointer.push(new uc(this)),this.interactions_pointer.push(new ac(this)),this.interactions_pointer.push(new pc(this)),this.interactions_pointer.push(new dc(this)),this.interactions_pointer.push(new lc(this)),this.interactions_pointer.push(new oc(this)),this.interactions_pointer.push(new cc(this)),this.map instanceof Ls&&this.interactions_pointer.push(new sc(this))}info_node_drag=Lt({show:!1,count:0,x:0,y:0});get map(){return this._map}register(e){e.addEventListener("pointerdown",this.pointerdown.bind(this)),e.addEventListener("pointermove",this.pointermove.bind(this)),e.addEventListener("pointerup",this.pointerup.bind(this)),e.addEventListener("pointercancel",this.pointercancel.bind(this)),e.addEventListener("pointerleave",this.pointerleave.bind(this)),e.addEventListener("wheel",this.wheel.bind(this)),e.addEventListener("dblclick",this.dblclick.bind(this)),e.addEventListener("contextmenu",this.contextmenu.bind(this))}check_mouse_key(e,t){return ss.check_mouse_key(e,t)}get_map_selector(e){let t=e.target;for(;t&&t!==document.body;){const e=t.dataset.type,i=t.id;if(i&&e){if(e===n.node){const e=this.map.get_node(i);if(e)return{type:"node",res:e}}else if(e===n.linker){const e=this.map.get_linker(i);if(e)return{type:"linker",res:e}}else if(e===n.map||e===n.submap)return{type:"fig",res:this.map};t=t.parentElement}else t=t.parentElement}return{type:"empty",res:void 0}}pointerdown(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()},{selector:n}=t,{res:i,type:r}=n;if("node"===r&&this.root.isdev){this.map.nodes_test[i.id]=i,console.log("------------------------------------节点信息");const t=i.bound;console.log("id",i.id),console.log("matrix:",{...t.matrix2d}),console.log("pos:",t.pos),console.log("pos_tree:",t.pos_tree),console.log("size_bound:",t.size_bound),console.log("size_tree:",t.size_tree),console.log("fig_pos:",i.pcube.real_point_to_fig(t.pos)),console.log("view_pos:",i.pcube.real_point_to_view(t.pos)),console.log("to_size",i.to.size),console.log("in_size",i.from.size),console.log("节点",i),this.check_mouse_key(e,"mid")&&i.a()}for(let n of this.interactions_pointer)n.down(e,t);"fig"===t.selector.type&&this.event.emit_fig_click(e)}pointermove(e){for(let t of this.interactions_pointer)t.move(e)}pointerup(e){for(let t of this.interactions_pointer)t.up(e)}pointercancel(e){for(let t of this.interactions_pointer)t.cancel(e)}pointerleave(e){for(let t of this.interactions_pointer)t.leave(e)}dblclick(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()};for(let n of this.interactions_pointer)n.dblclick(e,t)}wheel(e){for(let t of this.interactions_pointer)t.wheel(e)}contextmenu(e){for(let t of this.interactions_pointer)t.contextmenu(e)}}const fc={class:"map-status"},_c=Pn({__name:"submap-status",props:{cube:{}},setup(e){function t(t){const n=e.cube.dom_rect,i={x:n.x+n.width/2,y:n.y+n.height/2};e.cube.scale_by_point(i,t,t)}return(n,i)=>(fr(),yr("div",fc,[Cr("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:i[0]||(i[0]=e=>t(-.1))}),Cr("span",null,Se((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),Cr("span",{class:"iconfont icon-add",onClick:i[1]||(i[1]=e=>t(.1))})]))}}),gc=(0,wo.A)(_c,[["__scopeId","data-v-cb09d654"]]),bc=["id","data-type"],yc=["transform"],vc=["data-group"],wc=["data-group"],xc=["data-group"],kc=["data-group"],Sc=["d"],Cc=["d","stroke-width","stroke","marker-start","marker-end"],Mc=["d"],zc=Pn({__name:"cube-submap",props:{cube:{}},setup(e){const{placeholder:t}=e.cube,i=e.cube.config.data,r=Wt(),s=Wt(),o=new ResizeObserver(t=>{e.cube.get_view_rect()}),a=Wt();let l;function c(){e.cube.dom_svg_rect}return Vn(()=>{const t=s.value;t&&o.observe(t);const n=r.value;n&&e.cube.interaction.register(n);const i=a.value;if(!i)return;l=new us.DragDiff(i);let c=e.cube.attrs.width,d=e.cube.attrs.height,h=c,u=d;l.register_down(()=>{c=e.cube.attrs.width,d=e.cube.attrs.height}),l.register_move((e,t)=>{h=Math.round(e+c),u=Math.round(t+d),n.style.width=h+"px",n.style.height=u+"px"}),l.register_up((t,n)=>{if(c===h&&d===u)return;const i=e.cube.courier.get_recorder(),r=Math.round(t+c),s=Math.round(n+d);i.tell(e.cube,ds.resize(e.cube.id,r,s)),e.cube.history.record(i),e.cube.check_show()}),l.register_cancel(()=>{e.cube.attrs.width=c,e.cube.attrs.height=d})}),Xn(()=>{l?.off()}),(e,o)=>(fr(),yr("div",{class:"cube-submap",id:e.cube.id,style:fe(e.cube.css),"data-type":Kt(n).submap,ref_key:"box",ref:r,onClick:c},[(fr(),yr("svg",{ref_key:"svg",ref:s},[Cr("g",{transform:e.cube.matrix2d_dom_string},[Cr("g",{"data-group":Kt(h).markers,class:"group-defs"},[...o[0]||(o[0]=[Tr('<defs data-v-b228a034>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-b228a034><path d="M 0 0 L 6 3 L 0 6 z" data-v-b228a034></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-b228a034><circle cx="3" cy="3" r="3" data-v-b228a034></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-b228a034><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-b228a034></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-b228a034><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-b228a034></rect></marker></defs>',1)])],8,vc),Cr("g",{"data-group":Kt(h).linkers,class:"group-linkers"},[(fr(!0),yr(cr,null,ri(e.cube.get_linkers_view(),e=>(fr(),vr(Oo,{key:e.id,cube:e},null,8,["cube"]))),128))],8,wc),Cr("g",{"data-group":Kt(h).nodes,class:"group-nodes"},[(fr(!0),yr(cr,null,ri(e.cube.get_nodes_view(),e=>(fr(),vr(Oo,{key:e.id,cube:e},null,8,["cube"]))),128))],8,xc),Cr("g",{"data-group":Kt(h).placeholder,class:"group-placeholder"},[Kt(t).box_selector?(fr(),yr("path",{key:0,class:"placeholder-box-selector",d:Kt(t).box_selector},null,8,Sc)):Pr("v-if",!0),(fr(!0),yr(cr,null,ri(Kt(t).linker,e=>(fr(),yr(cr,null,[e?(fr(),yr("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":Kt(i).map_linker_stroke_width,stroke:Kt(i).map_linker_stroke,"marker-start":`url(#${Kt(i).map_linker_anchor_left})`,"marker-end":`url(#${Kt(i).map_linker_anchor_right})`},null,8,Cc)):Pr("v-if",!0)],64))),256)),Kt(t).line_delete?(fr(),yr("path",{key:1,class:"placeholder-line-delete",d:Kt(t).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,Mc)):Pr("v-if",!0),Pr(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),Mr(Ll,{interaction:e.cube.interaction},null,8,["interaction"])],8,kc)],8,yc)],512)),Mr(gc,{cube:e.cube},null,8,["cube"]),Cr("div",{class:"submap-dragger",ref_key:"dragger",ref:a},null,512)],12,bc))}}),Ac=(0,wo.A)(zc,[["__scopeId","data-v-b228a034"]]);function Tc(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Pc extends Es{_interaction;_has_layout=!1;_display_success=!1;data;nodes_test=Et({});matrix2d=Lt(Zr.get_default());nodes=Et({});node_from=Lt({});node_to=Lt({});node_editing=Et(new Set);linkers=Et({});nodes_selected=Et(new Set);line_delete_selected=Et(new Set);view_nodes=Et(new Set);view_linkers=Et(new Set);_view_rect=Lt({x:0,y:0,width:0,height:0});placeholder=Lt({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e,t){return super(e,t),this._interaction=new mc(this),this.setup(e,t)}get perf(){return!1}get css(){return{...super.css,width:this.attrs.width+"px",height:this.attrs.height+"px"}}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout}get view_rect(){return{...this._view_rect}}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get matrix2d_dom_string(){return Zr.get_dom_string(this.matrix2d)}get interaction(){return this._interaction}get domain(){return"doc"}get meta(){return Pc.meta}get component(){return Ac}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_svg_rect,i=Math.max(n.left,0),r=Math.min(n.right,t),s={x:i,y:Math.max(0,n.top)},o={x:r,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y,h={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,h),h}get_view_center(){const e=this.get_view_rect();return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.view_rect,t=[];for(let n of Object.values(this.nodes))us.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))us.MathRect.check_intersection(e,n.rect)&&t.push(n);return t}find_layout_root(e){const t=new Set;for(let n of e){const e=n.env.layout_root;e&&t.add(e)}return t}wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}find_cube(e){const t=this.linkers[e];if(t)return t;for(let t of Object.values(this.nodes)){const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof js?(this.nodes[t.id]=t,this.view_nodes.add(t)):t instanceof Nc&&(this.linkers[t.id]=t,this.view_linkers.add(t))}show_all(){for(let e of Object.values(this.nodes))this.view_nodes.add(e);for(let e of Object.values(this.linkers))this.view_linkers.add(e)}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){let t=[];for(let n of Object.values(this.nodes)){const i=n.bound.rect;us.MathRect.check_intersection(e,i)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof js?this.view_nodes.add(e):e instanceof Nc&&this.view_linkers.add(e):e instanceof js?this.view_nodes.delete(e):e instanceof Nc&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof js?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof Nc&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===P.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===P.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.x+n.width>i.x+i.width)&&(e=t)}return e}if(e===P.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y+n.height>i.y+i.height)&&(e=t)}return e}if(e===P.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y<i.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let i=e,r=1/0;if(t===P.left)for(let t of Object.values(this.nodes)){if(!t.show||e===t)continue;const s=t.bound.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=us.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=us.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=us.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=us.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}return i}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}layout(){for(let e of Object.values(this.nodes))e.is_layout_root&&e.attrs.layout&&e.layout()}env_flow(){const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&e.push(t);for(let t of e)t.env.flow(t.env)}check_in_view(e){const{innerHeight:t,innerWidth:n}=window;return!(e.y>t||e.y+e.height<0||e.x>n||e.x+e.width<0)}check_show(){this.perf&&this.check_show_node()}check_show_node(){if(this.perf)for(let e of Object.values(this.nodes))e.check_show()}layout_throttle=us.Notice.throttle(this.layout.bind(this),70);check_show_throttle=us.Notice.throttle(this.check_show.bind(this),100);check_show_node_throttle=us.Notice.throttle(this.check_show_node.bind(this),100);async build_child(e){const{nodes:t,linkers:n}=e.info,i=ss.build_cubes(t,this);for(let e of i)this.nodes[e.id]=e,this.view_nodes=Et(new Set(i));await this.wait_nodes_render(i),this.env_flow(),await this.layout(),this._has_layout=!0;for(let e of n){const t=this.get_node(e.attrs.from),n=this.get_node(e.attrs.to);if(!t||!n)continue;const i=new Nc(e,this);this.linkers[i.id]=i,this.perf||this.view_linkers.add(i)}}update_data(e,t){return Pc.update_data(e,t)}export(){const e=Pc.get_default();e.id=this.id,e.css=structuredClone(Ft(this.css)),e.attrs=structuredClone(Ft(this.attrs));const t=[],n=[];e.info={nodes:t,linkers:n,node_from:structuredClone(Ft(this.node_from)),node_to:structuredClone(Ft(this.node_to))};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),e.gc()}remove_linker(e){delete this.linkers[e.id],this.view_linkers.delete(e),e.gc()}on_node_add(e){const{data:t}=e,{cursor:n,courier:i,history:r}=this,s=i.get_recorder();s.add_cmd(e);const o=ss.build_cubes(t,this);this.pick(...o);const a=t.map(e=>e.id);return s.add_recover(fs.node_remove(this.id,a)),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=new Set;for(let e of t){const t=this.get_node(e);if(!t)continue;o.push(t.export());const n=t.env.layout_root;n&&n!==t&&a.add(t.env.layout_root);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&s.tell(this,fs.linker_remove(this.id,[t]))}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&s.tell(this,fs.linker_remove(this.id,[n]))}this.remove_node(t)}return s.add_recover(fs.node_add(this.id,o)),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this,s=n.get_recorder();if(0===t.length)return;s.add_cmd(e);let o=Promise.resolve();const a=[],l=new Set,c=[];for(let e of t){const{index_to:t,index_from:n,linker:i}=e,r=new Nc(i,this),s=r.from_node,o=r.to_node;if(!s||!o)continue;this.pick(r);let d=this.node_from[r.to_id],h=this.node_to[r.from_id];if(d?d.indexOf(r.from_id)<0&&d.splice(n,0,r.from_id):this.node_from[r.to_id]=[r.from_id],h?h.indexOf(r.to_id)<0&&h.splice(t,0,r.to_id):this.node_to[r.from_id]=[r.to_id],c.unshift(r.id),!o.env.is_captive){const{has_root:e,line:t}=es.find_line_to_layout_root(o);a.push(o.wait_layout_self()),t[1]&&l.add(t[1])}}const d=new Set;for(let e of l){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&d.add(t)}return s.add_recover(fs.linker_remove(this.id,c)),o.then(async()=>{await Promise.all(a);for(let e of d)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=[];for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=this.get_node(t.from_id);n&&a.push(n);const i=this.node_to[t.from_id],r=this.node_from[t.to_id];if(i&&r){const e=i.indexOf(t.to_id),n=r.indexOf(t.from_id);i.splice(e,1),r.splice(n,1),o.unshift({linker:t.export(),index_to:e,index_from:n})}this.remove_linker(t)}const l=this.find_layout_root(a);for(let e of l)e.layout_throttle();return s.add_recover(fs.linker_add(this.id,o)),s}get_linker_id(e,t){return e+"-"+t}replace_id(e,t={}){return Pc.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e)}translate(e,t){const n=Zr.multiply(this.matrix2d,Zr.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:i,map_scale_min:r}=this.config.data,s=this.matrix2d.a+t;if(s>i||s<r)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=Zr.multiply(this.matrix2d,Zr.get_matrix_translate(o.x-l.x,o.y-l.y));this.reset_matrix(c)}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:i}=this.get_upstream_sum_scale();let{x:r,y:s}=e;return{x:(r-t.x)/n,y:(s-t.y)/i}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+i*l+s,y:n*a+r*l+o}}untransform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-i*l)/t,y:(l-o-n*a)/r}}static get meta(){return{type:n.submap,cubename:"子图",version:1,block:!0,show:!0}}static get_default(e=400,t=200){return{id:ss.get_id(),type:n.submap,info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{width:e,height:t}}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,ss.replace_id(e,e.cube_versions,t.info.nodes,n),ss.replace_id(e,e.cube_versions,t.info.linkers,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}Tc([ys(a.node_add)],Pc.prototype,"on_node_add",null),Tc([ys(a.node_remove)],Pc.prototype,"on_node_remove",null),Tc([ys(a.linker_add)],Pc.prototype,"on_linker_add",null),Tc([ys(a.linker_remove)],Pc.prototype,"on_linker_remove",null);class Nc extends Ds{_point_from={x:0,y:0};_point_to={x:0,y:0};_show=!1;pcube;sample=Et([]);_path=Jr(()=>this.layout_self());constructor(e,t){return super(e,t),this.pcube=t,this.setup(e,t)}_from_node=Jr(()=>this.pcube.get_node(this.from_id));_to_node=Jr(()=>this.pcube.get_node(this.to_id));get show(){return this._show}set show(e){this._show=e,e?this.pcube.set_graph_visible(this,!0):this.pcube.set_graph_visible(this,!1)}get info(){return this.data.info}get anchor_left(){return this.attrs.anchor_left||x.point}get anchor_right(){return this.attrs.anchor_right||x.arrow}get point_from(){return{...this._point_from}}get point_to(){return{...this._point_to}}get rect(){return{x:Math.min(this._point_from.x,this._point_to.x),y:Math.min(this._point_from.y,this._point_to.y),width:Math.abs(this._point_from.x-this._point_to.x),height:Math.abs(this._point_from.y-this._point_to.y)}}get component(){return Ol}get from_id(){return this.attrs.from}get to_id(){return this.attrs.to}get from_node(){return this._from_node.value}get to_node(){return this._to_node.value}export(){const e=this.base_export();return e.attrs.from=this.from_id,e.attrs.to=this.to_id,e}build_child(e){}update_data(e,t){return Nc.update_data(e,t)}get meta(){return Nc.meta}get domain(){return"map"}get id(){return es.get_linker_id(this.from_id,this.to_id)}get path(){return this._path.value}replace_id(e,t={}){return Nc.replace_id(this.root,e,t)}layout_self(){const e=this.from_node,t=this.to_node;if(!e||!t)return"";const n=this.attrs.type,i=tc.find(e,t);if(i){this._point_from=i.from,this._point_to=i.to;const e=ec.draw({type:n,...i});return this.sample=es.svg_path_sample(e,8),e}return""}get_linker_info(){const e=this.from_node,t=this.to_node;if(!e||!t)return;const n=this.pcube.get_node_to(e.id),i=this.pcube.get_node_from(t.id),r=n?.indexOf(t.id)||-1,s=i?.indexOf(e.id)||-1;return{linker:this.export(),index_from:s,index_to:r}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof Pc||t instanceof Zl)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}check_show(){return this.from_node?.show||this.to_node?.show?(this.show=!0,!0):(this.show=!1,!1)}on_linker_update(e){const{courier:t,history:n}=this,{attrs:i}=e,r=t.get_recorder();r.add_cmd(e);const s=structuredClone(Ft(this.data.attrs));Object.assign(this.attrs,i);const o=nc.update(this.id,s);return r.add_recover(o),r}get_link_right(){const e=this.from_node?.bound.get_bound_rect_point(us._RectPosition.right_mid),t=this.to_node?.bound.get_bound_rect_point(us._RectPosition.left_mid),n=this.attrs.type;return e&&t?"line"===n?ec.line(e,t):"bezier2"===n?ec.bezier2(e,t):ec.line(e,t):""}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,t.attrs.from=n[t.attrs.from]||t.attrs.from,t.attrs.to=n[t.attrs.to]||t.attrs.to,t}static get meta(){return{cubename:"连接线",type:n.linker,block:!1,version:1,show:!1}}static get_default(e,t,i){const{map_linker_anchor_left:r,map_linker_anchor_right:s,map_linker_line:o,map_linker_stroke:a,map_linker_stroke_width:l}=Ns.config;return{id:es.get_linker_id(e,t),type:n.linker,info:{},attrs:{from:e,to:t,type:i||o,anchor_left:r,anchor_right:s,stroke:a,stroke_width:l},css:{}}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([ys(k.update)],Nc.prototype,"on_linker_update",null);class Oc{_observer;_nodes={};constructor(){this._observer=new ResizeObserver(this.watch.bind(this))}watch(e,t){for(let t of e){const e=t.target,n=t.target.dataset.id,i=this._nodes[n];i&&e.isConnected&&i.layout_self(t)}}register(e,t){const n=e.dataset.id;n&&(this._nodes[n]=t,this._observer.observe(e))}unregister(e){const t=e.dataset.id;t&&(delete this._nodes[t],e&&this._observer.unobserve(e))}}const Rc=new Oc,Lc=["id","data-type","transform","data-editing"],Ec=["d"],Dc=["x","y","width","height"],Ic=["data-id"],Bc={class:"node-status"},jc=Pn({__name:"cube-node",props:{cube:{}},setup(e){const{bound:t,shape:i}=e.cube,r=Wt(),{map_node_padding:s}=e.cube.config.data;Vn(()=>{const t=r.value;t&&Rc.register(t,e.cube)}),Yn(()=>{const e=r.value;e&&Rc.unregister(e)});const o=Jr(()=>({"node-selected":e.cube.pcube.is_node_selected(e.cube),"node-editable":e.cube.editable,"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}));function a(t,n){e.cube.event.emit_node_status_click(t,{node:e.cube,click:n})}function l(t=!0){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=ms.layout_change(e.cube.id,{fold:t});r.tell(e.cube,s),i.record(r)}return(e,s)=>(fr(),yr("g",{id:e.cube.id,"data-type":Kt(n).node,class:ve(["cube-node",o.value]),transform:e.cube.matrix2d_dom_string,"data-editing":e.cube.editable},[Cr("path",{d:Kt(i).path,ref:"p",style:fe({fill:e.cube.attrs.fill})},null,12,Ec),(fr(),yr("foreignObject",{x:Kt(t).pos_cbox.x,y:Kt(t).pos_cbox.y,width:Kt(t).size.width,height:Kt(t).size.height,style:fe(e.cube.css)},[Cr("div",{class:"cube-node-box",ref_key:"box",ref:r,"data-id":e.cube.id},[(fr(!0),yr(cr,null,ri(e.cube.children,e=>(fr(),vr(Oo,{key:e.id,cube:e},null,8,["cube"]))),128)),Pr(" node statusbar "),Cr("div",Bc,[e.cube.is_layout_root?(fr(),yr("div",{key:0,class:"iconfont icon-system-mind-map-filled",onClick:s[0]||(s[0]=e=>a(e,"root"))})):Pr("v-if",!0),e.cube.attrs.layout?(fr(),yr("div",{key:1,class:ve(e.cube.icons[e.cube.attrs.layout]),onClick:s[1]||(s[1]=e=>a(e,"layout"))},null,2)):Pr("v-if",!0),e.cube.env.upstream&&e.cube.env.downstream.length>0?(fr(),yr(cr,{key:2},[e.cube.attrs.fold?(fr(),yr("div",{key:0,class:"status-fold",onClick:s[2]||(s[2]=e=>l(!1))},Se(e.cube.env.downstream_nodes.length),1)):(fr(),yr("div",{key:1,class:"iconfont icon-minus2",onClick:s[3]||(s[3]=e=>l(!0))}))],64)):Pr("v-if",!0)])],8,Ic)],12,Dc))],10,Lc))}}),qc=(0,wo.A)(jc,[["__scopeId","data-v-138cbca0"]]);class Hc extends js{constructor(e,t){return super(e,t),this.setup(e,t)}get domain(){return"map"}get meta(){return Hc.meta}get component(){return qc}build_child(e){this._children.push(...ss.build_cubes(e.info,this))}update_data(e,t){return Hc.update_data(e,t)}gc(){this.base_gc()}export(){const e=this.base_export();e.info=[],e.attrs=structuredClone(Ft(this.attrs)),e.attrs.matrix2d=this.matrix2d_real;for(let t of this._children)e.info.push(t.export());return e}replace_id(e,t={}){return Hc.replace_id(this.root,e,t)}static get meta(){return{cubename:"图形节点",type:n.node,block:!0,version:1,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,ss.replace_id(e,e.cube_versions,t.info,n),t}static get_default(e,t="rect"){return{id:ss.get_id(),type:n.node,info:[ml.get_default()],attrs:{root:!1,matrix2d:{a:1,b:0,c:0,d:1,e:e.x,f:e.y},shape:t,layout:null},css:{}}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}a(e=!0,t="time-right",n=!1){const{courier:i}=this,r=i.get_recorder(),s=ms.layout_change(this.id,{root:e,layout:t,fold:n});r.tell(this,s),this.history.record(r),this.env.layout_root?.layout()}}class Fc{_node;_size=Lt(js.get_default_node_size());_size_bound=Lt(js.get_default_node_size());_size_tree=Lt(js.get_default_node_size());_pos_cbox=Lt({x:Ns.default_config.map_node_padding,y:Ns.default_config.map_node_padding});_pos;_pos_tree;_layout_pos_tree;constructor(e,t){this._node=e,this._pos=Lt({x:t.e,y:t.f}),this._pos_tree=Lt({x:t.e,y:t.f}),this._layout_pos_tree=Lt({x:t.e,y:t.f})}get config(){return this.node.config}get node(){return this._node}get env(){return this.node.env}get pcube(){return this.node.pcube}get matrix2d(){return{...this._node.attrs.matrix2d}}get rect(){return{...this._pos,...this._size_bound}}get size(){return{...this._size}}get size_tree(){return{...this._size_tree}}get size_bound(){return this._size_bound}get pos(){return{...this._pos}}get pos_raw(){return{x:this.matrix2d.e,y:this.matrix2d.f}}get pos_center(){return this.get_pos_center()}get pos_cbox(){return{...this._pos_cbox}}get pos_tree(){return this.env.upstream?{...this._layout_pos_tree}:{...this._pos_tree}}stat_downstream_nodes_size(e){const{map_node_hgap:t,map_node_vgap:n}=this.node.config.data;let i=0,r=0,s=0,o=0,a={x:0,y:0,width:0,height:0},l={x:0,y:0,width:0,height:0},c=0,d=0,h=this.size_bound.width/2,u=this.size_bound.height/2,p={x:0,y:0,width:0,height:0},m={x:0,y:0,width:0,height:0};for(let t of e){const e=t.bound.size_tree,n=t.bound.rect;s+=e.height,o+=e.width;let f=e.width-n.width/2,_=e.height-n.height/2;f>h&&(h=f),_>u&&(u=_),e.width>=i&&(i=e.width,p=n),e.height>=r&&(r=e.height,m=n),n.width>=c&&(c=n.width,l=n),n.height>=d&&(d=n.height,a=n)}return{max_tree_height:r,max_tree_width:i,sum_tree_height:s+(e.length-1)*n,sum_tree_width:o+(e.length-1)*t,max_height_node:a,max_width_node:l,max_tree_width_node:p,max_tree_height_node:m,tail_tree_width:h,tail_tree_height:u}}update_pos_cbox(){const e=this.node.attrs.shape,{width:t,height:n}=this.size_bound,{map_node_padding:i}=this.node.config.data,r=t/2,s=n/2;"circle"===e?(this._pos_cbox.x=r-this.size.width/2,this._pos_cbox.y=s-this.size.height/2):(this._pos_cbox.x=i,this._pos_cbox.y=i)}update_pos(){const e=this.size_tree,t=this.size_bound,n=this.pos_tree,i=this.node.env.layout_type,r=this._node.attrs.matrix2d.e,s=this._node.attrs.matrix2d.f,o=this._node.env.downstream;if(!this.env.layout_type||this.node.is_layout_root)this._pos.x=r,this._pos.y=s;else if(this.env.folded_self)this._pos.x=n.x,this._pos.y=n.y;else if("right"===i)this._pos.x=n.x,this._pos.y=n.y-t.height/2+e.height/2;else if("left"===i)this._pos.x=n.x+e.width-t.width,this._pos.y=n.y+e.height/2-t.height/2;else if("down"===i)this._pos.x=n.x+e.width/2-t.width/2,this._pos.y=n.y;else if("up"===i)this._pos.x=n.x+e.width/2-t.width/2,this._pos.y=n.y+e.height-t.height;else if("time-right"===i){const{sum_tree_height:e,sum_tree_width:i,max_tree_height:r,max_height_node:s,max_tree_width:a,max_tree_width_node:l,max_tree_height_node:c}=this.stat_downstream_nodes_size(o),d=Math.max(s.height,t.height)/2;this._pos.x=n.x,this._pos.y=n.y+d-t.height/2}else if("time-down"===i){const{sum_tree_height:e,sum_tree_width:i,max_tree_height:r,max_tree_width:s,max_tree_width_node:a,max_tree_height_node:l}=this.stat_downstream_nodes_size(o),c=Math.max(a.width,t.width)/2;this._pos.x=n.x+c-t.width/2,this._pos.y=n.y}}get_pos_center(){const e=this.pos,{width:t,height:n}=this.size_bound;return{x:e.x+t/2,y:e.y+n/2}}update_pos_tree_root(){if(!this.node.is_layout_root)return;const e=this.size_tree,t=this.node.env.layout_type,n=this.size_bound,i=this.matrix2d.e,r=this.matrix2d.f;if(t){if(this.node.attrs.fold)this._layout_pos_tree.x=i,this._layout_pos_tree.y=r;else if("right"===t)this._layout_pos_tree.x=i,this._layout_pos_tree.y=r+n.height/2-e.height/2;else if("left"===t)this._layout_pos_tree.x=i+n.width-e.width,this._layout_pos_tree.y=r+n.height/2-e.height/2;else if("down"===t)this._layout_pos_tree.x=i+n.width/2-e.width/2,this._layout_pos_tree.y=r;else if("up"===t)this._layout_pos_tree.x=i+n.width/2-e.width/2,this._layout_pos_tree.y=r+n.height-e.height;else if("time-right"===t){const e=this.node.env.downstream,t=n.height/2,{sum_tree_height:s,sum_tree_width:o,max_tree_height:a,max_tree_width:l,max_tree_width_node:c,max_tree_height_node:d,max_height_node:h,max_width_node:u}=this.stat_downstream_nodes_size(e);this._layout_pos_tree.x=i,this._layout_pos_tree.y=r-Math.max(t,h.height/2)+t}else if("time-down"===t){const e=this.node.env.downstream,t=n.width/2,{sum_tree_height:s,sum_tree_width:o,max_tree_height:a,max_tree_width:l,max_tree_width_node:c,max_tree_height_node:d,max_height_node:h,max_width_node:u}=this.stat_downstream_nodes_size(e);this._layout_pos_tree.x=i+t-Math.max(u.width/2,t),this._layout_pos_tree.y=r}}else this._layout_pos_tree.x=i,this._layout_pos_tree.y=r}update_pos_tree(e,t){this._layout_pos_tree.x=e,this._layout_pos_tree.y=t,this.update_pos()}update_size(e,t){this._size.width=e,this._size.height=t,this.update_size_bound(),this.update_pos_cbox(),this.pcube.has_layout&&Promise.resolve().then(()=>{if(this.pcube.perf&&this.flow("downstream"),this.flow("upstream"),this.pcube.has_layout&&!this.node.clipboard.pasted_from){const e=this.node.env.layout_root;e&&e.layout_throttle()}})}update_size_bound(){const{map_node_padding:e}=this.node.config.data;this._size_bound.width=this.size.width+2*e,this._size_bound.height=this.size.height+2*e}update_size_tree(e){const t=this._node.env.layout_type,{map_node_hgap:n,map_node_vgap:i}=this.config.data,r=this.size_bound,{tail_tree_height:s,tail_tree_width:o,sum_tree_height:a,sum_tree_width:l,max_tree_height:c,max_tree_width:d,max_tree_width_node:h,max_tree_height_node:u,max_height_node:p,max_width_node:m}=this.stat_downstream_nodes_size(e);if("left"===t)0===e.length?this._size_tree.width=r.width:this._size_tree.width=r.width+n+d,this._size_tree.height=Math.max(r.height,a);else if("right"===t)0===e.length?this._size_tree.width=r.width:this._size_tree.width=r.width+n+d,this._size_tree.height=Math.max(r.height,a);else if("down"===t)this._size_tree.width=Math.max(r.width,l),e.length>0?this._size_tree.height=r.height+i+c:this._size_tree.height=r.height;else if("up"===t)this._size_tree.width=Math.max(r.width,l),e.length>0?this._size_tree.height=r.height+i+c:this._size_tree.height=r.height;else if("time-right"===t){u.height;const t=p.height/2,i=r.height/2;e.length>0?this._size_tree.width=r.width+n+l:this._size_tree.width=r.width,this._size_tree.height=Math.max(i,t)+s}else if("time-down"===t){const t=r.width/2,n=(h.width,m.width/2);this._size_tree.width=Math.max(t,n)+o,e.length>0?this._size_tree.height=r.height+i+a:this._size_tree.height=r.height}else Object.assign(this._size_tree,r)}flow(e="downstream"){const t=this._node.env.folded_self?[]:this._node.env.downstream;if(0===t.length&&Object.assign(this._size_tree,this.size_bound),"downstream"===e){for(let e of t)e.bound.flow();this.update_size_tree(t)}else if("upstream"===e){this.update_size_tree(t);const n=this.env.upstream;n&&!n?.is_layout_root&&this.env.upstream?.bound.flow(e)}}get_bound_rect_point(e){const t={...this.pos,...this.size_bound};return us.MathRect.get_rect_point(t,e)}}class $c{static get_shaple(e){const t=e.attrs.shape;return"rect"===t?this.rect(e):"circle"===t?this.circle(e):this.rect(e)}static rect(e,t=4,n=4){const{width:i,height:r}=e.bound.size,s=i+2*t,o=i+2*t,a=r+2*t,l=r+2*t;return`M${0+n} 0H${s-n}Q${s} 0 ${s} ${0+n}V${a-n}Q${o} ${a} ${o-n} ${a}H ${0+n}Q0 ${l} 0 ${l-n}V${0+n}Q0 0 ${0+n} 0Z`}static circle(e){const{width:t,height:n}=e.bound.size,i=Math.sqrt(t*t+n*n)/2;return`M${i} 0 A ${i} ${i} 0 1 0 ${i} ${2*i}A${i} ${i} 0 1 0 ${i} 0`}}function Gc(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Vc extends Ls{_app;_interaction;_has_layout=Wt(!1);data;nodes_test=Et({});nodes=Et({});node_from=Lt({});node_to=Lt({});node_editing=Et(new Set);linkers=Et({});nodes_selected=Et(new Set);line_delete_selected=Et(new Set);view_nodes=Et(new Set);view_linkers=Et(new Set);_view_rect=Lt({x:0,y:0,width:0,height:0});placeholder=Lt({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e){super();const t=this.update_data(e.versions[this.meta.type],e).data;this.data=Lt(t),this.node_to=this.data.info.node_to||{},this.node_from=this.data.info.node_from||{},this._interaction=new mc(this),this.build_child(t),bs.init_cmd_handler(this),rs.add_map(this),this._app=Ea(Zl,{cube:this}),this.stats.view="map"}get perf(){return this.config.data.map_perf}get matrix2d(){return this.attrs.matrix2d}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout.value}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get interaction(){return this._interaction}get matrix2d_dom_string(){return Zr.get_dom_string(this.matrix2d)}get domain(){return"map"}get app(){return this._app}get component(){return Zl}get meta(){return Vc.meta}get children(){return[...this._children]}get view_rect(){return{...this._view_rect}}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_rect,i=Math.max(n.left,0),r=Math.min(n.right,t),s={x:i,y:Math.max(0,n.top)},o={x:r,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y,h={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,h),h}get_view_center(){const e=this.view_rect;return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.view_rect,t=[];for(let n of Object.values(this.nodes))us.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))us.MathRect.check_intersection(e,n.rect)&&t.push(n);return t}find_layout_root(e){const t=new Set;for(let n of e){const e=n.env.layout_root;e&&t.add(e)}return t}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===P.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===P.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.x+n.width>i.x+i.width)&&(e=t)}return e}if(e===P.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y+n.height>i.y+i.height)&&(e=t)}return e}if(e===P.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y<i.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let i=e,r=1/0;if(t===P.left)for(let t of Object.values(this.nodes)){if(!t.show||e===t)continue;const s=t.bound.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=us.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=us.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=us.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=us.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}return i}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}wait_nodes_render(e){return es.wait_nodes_render(e)}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof js?(this.nodes[t.id]=$t(t),this.view_nodes.add(t)):t instanceof Nc&&(this.linkers[t.id]=$t(t),this.view_linkers.add(t))}show_all(){for(let e of Object.values(this.nodes))this.view_nodes.add(e);for(let e of Object.values(this.linkers))this.view_linkers.add(e)}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){let t=[];for(let n of Object.values(this.nodes)){const i=n.bound.rect;us.MathRect.check_intersection(e,i)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof js?this.view_nodes.add(e):e instanceof Nc&&this.view_linkers.add(e):e instanceof js?this.view_nodes.delete(e):e instanceof Nc&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof js?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof Nc&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),e.gc()}remove_linker(e){const t=this.node_to[e.from_id],n=this.node_from[e.to_id];let i;if(t&&n){const r=t.indexOf(e.to_id),s=n.indexOf(e.from_id);t.splice(r,1),n.splice(s,1),i={linker:e.export(),index_to:r,index_from:s}}return delete this.linkers[e.id],this.view_linkers.delete(e),e.gc(),i}async build_child(e){const{nodes:t,linkers:n}=e.info;console.time("🍋build-nodes");const i=[];for(let e of t){let t=new Hc(e,this);i.push(t),this.nodes[t.id]=$t(t),this.view_nodes.add(t)}console.timeEnd("🍋build-nodes");for(let e of n){const{from:t,to:n}=e.attrs,i=this.get_node(e.attrs.from),r=this.get_node(e.attrs.to);if(!i||!r){const e=this.node_to[t],i=e.indexOf(n);e.splice(i,0);const r=this.node_from[n],s=r.indexOf(t);r.splice(s,1);continue}const s=new Nc(e,this);this.linkers[s.id]=$t(s),this.perf||this.view_linkers.add(s)}this.init_env()}start_node_watcher(){for(let e of Object.values(this.nodes))e.checker.start_watcher()}init_env(){const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&e.push(t);for(let t of e)t.env.flow(t.env)}init_boundbox(){console.time("🍋wait-size-tree");const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&e.push(t);for(let t of e)t.bound.flow();console.timeEnd("🍋wait-size-tree")}async layout(){console.time("🍋layout-nodes");const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&e.push(t);for(let t of e)t.layout();console.timeEnd("🍋layout-nodes")}check_show(){this.perf&&(console.time("🍋动态显示检查"),this.check_show_node(),console.timeEnd("🍋动态显示检查"))}check_show_node(){if(this.perf)for(let e of Object.values(this.nodes))e.check_show()}layout_throttle=us.Notice.throttle(this.layout.bind(this),50);check_show_throttle=us.Notice.throttle(this.check_show.bind(this),50);check_show_node_throttle=us.Notice.throttle(this.check_show_node.bind(this),50);gc(){}export(){const e=Vc.get_default();e.id=this.id,e.versions=rs.export_versions(),e.css=structuredClone(Ft(this.css)),e.attrs=structuredClone(Ft(this.attrs)),e.attrs.matrix2d={...this.matrix2d};const t=[],n=[];e.info={nodes:t,linkers:n,node_from:Ft(this.node_from),node_to:Ft(this.node_to)};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}update_data(e,t){return Vc.update_data(e,t)}async render(e){this._dom=e,this.app.mount(e),console.time("🍋wait-svg & nodes"),await Promise.all([ql.ps,es.wait_nodes_render([...this.view_nodes])]),console.timeEnd("🍋wait-svg & nodes"),await ss.sleep(100),this.init_boundbox(),this.start_node_watcher(),this._has_layout.value=!0;const t=this.dom?.querySelector(".note");this.event.emit_status_update(),t&&(this.hotkeys.listen(t),this.interaction.register(t))}on_node_add(e){const{data:t}=e,{cursor:n,courier:i,history:r}=this,s=i.get_recorder();s.add_cmd(e);const o=ss.build_cubes(t,this);this.pick(...o);const a=t.map(e=>e.id);return s.add_recover(fs.node_remove(this.id,a)),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=[],l=new Set,c=[];for(let e of t){const t=this.get_node(e);if(t){a.push(t);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&c.push(t)}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&c.push(n)}}}for(let e of a){o.push(e.export());const t=e.env.layout_root;t&&t!==e&&l.add(e.env.layout_root),this.remove_node(e)}return s.tell(this,fs.linker_remove(this.id,c)),s.add_recover(fs.node_add(this.id,o)),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this,s=n.get_recorder();if(0===t.length)return;let o=Promise.resolve();s.add_cmd(e);const a=[],l=[],c=new Set;for(let e of t){const{index_to:t,index_from:n,linker:i}=e,r=new Nc(i,this),s=r.from_node,o=r.to_node;if(!s||!o)continue;this.pick(r);let d=this.node_from[r.to_id],h=this.node_to[r.from_id];if(d?d.indexOf(r.from_id)<0&&d.splice(n,0,r.from_id):this.node_from[r.to_id]=[r.from_id],h?h.indexOf(r.to_id)<0&&h.splice(t,0,r.to_id):this.node_to[r.from_id]=[r.to_id],a.unshift(r.id),!o.env.is_captive){const{has_root:e,line:t}=es.find_line_to_layout_root(o);l.push(o.wait_layout_self()),t[1]&&c.add(t[1])}}const d=new Set;for(let e of c){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&d.add(t)}return s.add_recover(fs.linker_remove(this.id,a)),o.then(async()=>{await Promise.all(l);for(let e of d)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=new Set,l=new Set;for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=t.from_node,i=t.to_node;n&&a.add(n),i&&l.add(i);const r=this.remove_linker(t);r&&o.unshift(r)}if(0===o.length)return;for(let e of a)e.env.flow(),e.bound.flow("upstream");const c=new Set;for(let e of l){if(e.is_layout_root)continue;const{has_root:t,line:n}=es.find_line_to_layout_root(e),i=n[1];t&&i?l.has(i)||c.add(i):e.env.clear()}for(let e of c)e.env.flow(),e.bound.flow("downstream"),e.bound.flow("upstream");const d=new Set;for(let e of[...a,...c]){const t=e.env?.layout_root;t&&d.add(t)}for(let e of d)e.layout_throttle();return s.add_recover(fs.linker_add(this.id,o)),s}on_update_attrs(e){const{courier:t,history:n}=this,{data:i}=e,r=t.get_recorder();return r.add_cmd(e),"matrix2d"in i&&i.matrix2d&&(r.add_recover(fs.update_attr(this.id,{matrix2d:{...this.matrix2d}})),this.reset_matrix(i.matrix2d)),r}get_linker_id(e,t){return es.get_linker_id(e,t)}replace_id(e,t={}){return Vc.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e),this.get_view_rect(),this.event.emit_status_update()}translate(e,t){const n=Zr.multiply(this.matrix2d,Zr.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:i,map_scale_min:r}=this.config.data,s=this.matrix2d.a+t;if(s>i||s<r)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=o.x-l.x,d=o.y-l.y,h=Zr.multiply(this.matrix2d,Zr.get_matrix_translate(c,d));this.reset_matrix(h)}get_upstream_sum_scale(){return{sx:1,sy:1}}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:i}=this.get_upstream_sum_scale();let{x:r,y:s}=e;return{x:(r-t.x)/n,y:(s-t.y)/i}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+i*l+s,y:n*a+r*l+o}}untransform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-i*l)/t,y:(l-o-n*a)/r}}static get meta(){return{type:n.map,cubename:"图形笔记",version:1,block:!0,show:!1}}static get_default(){return{id:ss.get_id(),type:n.map,versions:rs.export_versions(),info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{matrix2d:Zr.get_default()}}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,ss.replace_id(e,e.cube_versions,t.info.nodes,n),ss.replace_id(e,e.cube_versions,t.info.linkers,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Gc([ys(a.node_add)],Vc.prototype,"on_node_add",null),Gc([ys(a.node_remove)],Vc.prototype,"on_node_remove",null),Gc([ys(a.linker_add)],Vc.prototype,"on_linker_add",null),Gc([ys(a.linker_remove)],Vc.prototype,"on_linker_remove",null),Gc([ys(a.update_attrs)],Vc.prototype,"on_update_attrs",null);const Uc=["id","data-type"],Wc={class:"cube-api-functions"},Yc={key:0,class:"cube-api-arguments"},Xc={key:1,class:"cube-api-exceptions"},Kc=Pn({__name:"cube-api",props:{cube:{}},setup:e=>(e,t)=>(fr(),yr("div",{class:"cube-api",id:e.cube.id,"data-type":Kt(n).api,style:fe(e.cube.css),ref:"root",onContextmenu:t[0]||(t[0]=t=>Kt(uo)(t,e.cube))},[Cr("div",Wc,[t[1]||(t[1]=Cr("div",{class:"legend"},"api",-1)),Mr(Oo,{cube:e.cube.functions},null,8,["cube"])]),e.cube.arguments?(fr(),yr("div",Yc,[t[2]||(t[2]=Cr("div",{class:"legend"},"arguments",-1)),Mr(Oo,{cube:e.cube.arguments},null,8,["cube"])])):Pr("v-if",!0),e.cube.exceptions?(fr(),yr("div",Xc,[t[3]||(t[3]=Cr("div",{class:"legend"},"exceptions",-1)),Mr(Oo,{cube:e.cube.exceptions},null,8,["cube"])])):Pr("v-if",!0)],44,Uc))}),Jc=(0,wo.A)(Kc,[["__scopeId","data-v-25e3bd90"]]);class Qc extends Es{_functions;_arguments=Wt(void 0);_exceptions=Wt(void 0);_temp_funcnames=[];constructor(e,t){return super(e,t),this.setup(e,t)}static get type_funciton(){return{padding:"0px 4px",background:"var(--api-functions-type-bg)",color:"var(--api-functions-type-color)"}}static get type_argument(){return{padding:"0px 4px",background:"var(--api-arguments-type-bg)",color:"var(--api-arguments-type-color)"}}get functions(){return this._functions}get arguments(){return this._arguments.value}get exceptions(){return this._exceptions.value}get component(){return Jc}get children(){const e=[this._functions];return this.arguments&&e.push(this.arguments),this.exceptions&&e.push(this.exceptions),e}get meta(){return Qc.meta}add_arguments(){if(this.arguments)return;const e=bd.get_default();this._arguments.value=$t(new bd(e,this))}add_exceptions(){if(this.exceptions)return;const e=bd.get_default();this._exceptions.value=$t(new bd(e,this))}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof Es&&r.push(e.export());return{children:i,data:r}}replace_id(e,t={}){return Qc.replace_id(this.root,e,t)}build_child(e){this._functions=new bd(e.info.functions,this),e.info.arguments&&(this._arguments.value=$t(new bd(e.info.arguments,this))),e.info.exceptions&&(this._exceptions.value=$t(new bd(e.info.exceptions,this)))}event_bubble(e){const{recorder:t,tcube:n,path:i,cmds:r}=e,s=[c.text_reset,f.remove,f.reset];i.includes(this.functions)&&r.find(e=>s.includes(e.name))&&this.parse(t);const o=r.find(e=>e.name===f.add);if(n===this.functions&&o)for(let e of o.data){const i=e.data.id,r=n.find_cube(i),s=r?.child_first_line;if(!s)continue;const o=Zo.get_default("type",Qc.type_funciton),a=ds.insert_child(s.id,[o],1);t.tell(s,a)}return{stop:!1}}parse(e){const t=[];for(let e of this.functions.items){const{indent:n,data:i}=e,r=i.child_first_line?.children.find(e=>e instanceof Zo);r&&t.push(r)}if(t.length===this._temp_funcnames.length){let e=!0;for(let n=0;n<t.length;n++)if(this._temp_funcnames[n]!==t[n].info){e=!1;break}if(e)return}this._temp_funcnames=t.map(e=>e.info);const n=new Map;if(this.arguments)for(let e of this.arguments.items){const{indent:t,data:i}=e,r=i.child_first_line?.children.find(e=>e instanceof Zo);r&&n.set(r.info,{item:e,text:r})}const i=new Set;for(let e of t){let t=e.data.info,n=t.indexOf("("),r=t.lastIndexOf(")");if(n>=r)continue;let s=t.slice(n+1,r).split(",").map(e=>e.trim()).filter(e=>e);for(let e of s)i.add(e)}i.size>0&&this.add_arguments();const r=[...n.values()];if(i.size===r.length){for(let[t,n]of us.Iteration.zip([...i],r))if(t!==n.text.info.trim()){const i=Jo.reset(n.text.id,t);e.tell(n.text,i)}}else{const t=[];for(let e of i){const n=r.find(t=>t.text.info===e);if(n)t.push({indent:n.item.indent,data:n.item.data.export()});else{const n=bl.get_default([Zo.get_default(e),Zo.get_default(" "),Zo.get_default("type",Qc.type_argument)]);t.push(bd.get_list_item([n]))}}if(this.arguments){const n=oo.reset(this.arguments.id,t);e.tell(this.arguments,n)}}}gc(){super.base_gc()}export(){const e=this.base_export();return e.info.functions=this.functions.export(),this.arguments&&(e.info.arguments=this.arguments.export()),this.exceptions&&(e.info.exceptions=this.exceptions.export()),e}reset_api(e){const{courier:t,history:n}=this,{args:i,funcs:r}=e,s=t.get_recorder();return s.add_cmd(e),s}update_data(e,t){return Qc.update_data(e,t)}static update_data(e,t){if(e>this.meta.version)return{data:t,usable:!1};if(e<2){const e=t,i=Qc.get_default(e.css,e.attrs),r=[],s=[],o=i.info.functions,a=bd.get_default();for(let t of e.info.names.info)if(t.type===n.line){const e=t.info.find(e=>e.type===n.text);r.push({name:e,type:void 0,desc:[]})}for(let t=0;t<e.info.funcs.length;t++){const i=e.info.funcs[t],s=i.desc.info[0],o=r[t];if(o){if(s.type===n.line){const e=s,t=e.info[0];if(t&&t.type===n.text&&(o.type=t),s.info.length>1){const t=bl.get_default(e.info.slice(1));o.desc.push(t)}}o.desc.push(...i.desc.info.slice(1))}}for(let t=0;t<e.info.args.length;t++){const i=e.info.args[t],{name:r,desc:o}=i,a=i.desc.info[0],l={name:Zo.get_default(r),type:void 0,desc:[]};if(a.type===n.line){const e=a,t=e.info[0];if(t&&t.type===n.text&&(l.type=t),a.info.length>1){const t=bl.get_default(e.info.slice(1));l.desc.push(t)}}l.desc.push(...i.desc.info.slice(1)),s.push(l)}if(r.length>0){o.info.length=0;for(let e=0;e<r.length;e++){const t=r[e],n=bl.get_default([t.name,Zo.get_default(" ")]),i=t.type||Zo.get_default();Object.assign(i.css,this.type_funciton);const s=i.info.trim();s&&""!==s||(i.info="type"),n.info.push(i);const a=bd.get_list_item([n,...t.desc]);o.info.push(a)}}if(s.length>0){a.info.length=0;for(let e=0;e<s.length;e++){const t=s[e],n=bl.get_default([t.name,Zo.get_default(" ")]),i=t.type||Zo.get_default();Object.assign(i.css,this.type_argument);const r=i.info.trim();r&&""!==r||(i.info="type"),n.info.push(i);const o=bd.get_list_item([n,...t.desc]);a.info.push(o)}i.info.arguments=a}return{data:i,usable:!0}}return{data:t,usable:!0}}static get_default(e={},t={}){return{id:ss.get_id(),type:n.api,info:{functions:bd.get_default()},css:e,attrs:t}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,t.info.functions=bd.replace_id(e,t.info.functions,n),t.info.arguments&&(t.info.arguments=bd.replace_id(e,t.info.arguments,n)),t.info.exceptions&&(t.info.exceptions=bd.replace_id(e,t.info.exceptions,n)),t}static get meta(){return{type:n.api,version:2,cubename:"Api",block:!0,show:!0}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([ys(p.reset)],Qc.prototype,"reset_api",null);class Zc{static reset(e,t,n){return{id:e,name:p.reset,args:t,funcs:n}}}function ed(e,t="tail"){const{courier:n,history:i}=e,r=new cs(n),s=[kl.get_default(),kl.get_default()],o=td.insert_row(e.id,t,[s]);r.tell(e,o),i.record(r)}class td{static insert_row(e,t,n){return{id:e,name:m.insert_row,pos:t,rows:n}}static remove_row(e,t,n=!1){return{id:e,name:m.remove_row,range:t,reserve:n}}static change_width_col1(e,t){return{id:e,width:t,name:m.change_width_col1}}}const nd=["id","data-type"],id=Pn({__name:"cube-detail-list",props:{cube:{}},setup(e){const t=e.cube.root,i=On("root"),r=Wt();Vn(()=>{const n=r.value,s=i.value;if(!n)return;const o=new us.DragDiff(n);let a=e.cube.attrs.width_col1,l=a;o.register_down(()=>{a=e.cube.attrs.width_col1}),o.register_move((e,n)=>{t.stats.is_read_mode||(l=Math.round(e+a),s?.style.setProperty("--width-col1",l+"px"))}),o.register_up((n,i)=>{if(t.stats.is_read_mode)return;if(a===l)return;const r=e.cube.courier.get_recorder(),s=Math.round(n+a);r.tell(e.cube,td.change_width_col1(e.cube.id,s)),e.cube.history.record(r)}),o.register_cancel(()=>{e.cube.attrs.width=a,n.style.left=a-2+"px"})});const s=Jr(()=>({...e.cube.css,"--width-col1":e.cube.attrs.width_col1+"px"}));return(t,o)=>(fr(),yr("div",{class:"cube-detail-list",id:t.cube.id,"data-type":Kt(n).detail_list,ref_key:"root",ref:i,style:fe(s.value),onContextmenu:o[1]||(o[1]=e=>Kt(uo)(e,t.cube))},[(fr(!0),yr(cr,null,ri(t.cube.children,t=>(fr(),vr(Oo,{key:t.id,cube:t,onKeydown:n=>function(t,n){t.ctrlKey&&!t.shiftKey&&"Enter"===t.key?(t.stopPropagation(),ed(e.cube,Math.floor(n.index/2)+1)):t.ctrlKey&&t.shiftKey&&"Enter"===t.key&&(t.stopPropagation(),ed(e.cube,Math.floor(n.index/2)))}(n,t)},null,8,["cube","onKeydown"]))),128)),Cr("div",{class:"adder-wrap",onClick:o[0]||(o[0]=()=>Kt(ed)(t.cube))},[...o[2]||(o[2]=[Cr("div",{class:"adder"},null,-1)])]),Cr("div",{class:"adjuster",ref_key:"adjuster",ref:r},null,512)],44,nd))}}),rd=(0,wo.A)(id,[["__scopeId","data-v-6b68d605"]]);function sd(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class od extends Es{rows;constructor(e,t){return super(e,t),this.rows=Et([]),this.setup(e,t)}get component(){return rd}get children(){const e=[];for(let t of this.rows)e.push(...t);return e}get attrs(){return this.data.attrs}get css_col1(){return this.attrs.width_col1||(this.attrs.width_col1=150),{width:this.attrs.width_col1+"px"}}get is_empty(){return!1}get row_count(){return this.rows.length}get col1(){return this.rows.map(e=>e[0])}get col2(){return this.rows.map(e=>e[1])}get meta(){return od.meta}update_data(e,t){return od.update_data(e,t)}build_child(e){for(let t of e.info){const e=new kl(t[0],this),n=new kl(t[1],this);this.rows.push([e,n])}}copy(e,t){if(e===t)return[this.children[e].export()];const n=Math.floor(e/2),i=Math.floor((t-1)/2),r=od.get_default();r.info=[];for(let e=n;e<=i;e++){const t=this.rows[e];if(!t)continue;const n=[t[0].export(),t[1].export()];r.info.push(n)}return 0===r.info.length?[]:[r]}gc(){super.base_gc()}export(){const e=this.base_export();e.css=structuredClone(Ft(this.css)),e.attrs=structuredClone(Ft(this.attrs)),e.info=[];for(let[t,n]of this.rows){const i=t.export(),r=n.export();e.info.push([i,r])}return e}replace_id(e,t={}){return od.replace_id(this.root,e,t)}splice_rows(e,t,...n){const i=this.rows.splice(e,t,...n);for(let[e,t]of i)e.gc(),t.gc();return i}check_delete_edge(e){return 0==e.index%2&&!!e.is_empty}insert_row(e){const{courier:t}=this,{pos:n,rows:i}=e,r=t.get_recorder();r.add_cmd(e);const s=[];for(let[e,t]of i)s.push([new kl(e,this),new kl(t,this)]);let o=[0,0];return"tail"===n?(o=[this.row_count,this.row_count+s.length],this.rows.push(...s)):"head"===n?(o=[0,0+s.length],this.rows.unshift(...s)):(o=[n,n+s.length],this.splice_rows(n,0,...s)),r.add_recover(td.remove_row(this.id,o)),r}remove_row(e){const{courier:t,cursor:n}=this,{range:i,reserve:r}=e,s=new cs(t);let[o,a]=i;if(o<0&&(o=0),a>this.row_count&&(a=this.row_count),0===o&&a>=this.row_count)if(r){if(this.is_empty)return;s.tell(this,td.remove_row(this.id,[1,this.child_count]));const e=this.child_first,t=e.next_cube;t&&s.tell(t,ds.delete_child(t.id,"backward",[0,t.child_count],!0)),e&&s.tell(e,ds.delete_child(e.id,"backward",[0,e.child_count],!0))}else s.merge(this.remove_self());else{const e=this.rows[o-1]?.[1],t=this.rows[a+1]?.[1],n=this.splice_rows(o,a-o),i=[];for(let[e,t]of n)i.push([e.export(),t.export()]);s.add_recover(td.insert_row(this.id,o,i)),e?s.tell(e,hs.in_tail(e.id)):t&&s.tell(t,hs.in_head(t.id))}return s}change_width_col1(e){const{width:t}=e,{courier:n,id:i}=this,r=n.get_recorder();r.add_cmd(e);const s=this.attrs.width_col1;return this.attrs.width_col1=t,this.dom?.style.setProperty("--width-col1",t+"px"),r.add_recover(td.change_width_col1(i,s)),r}delete_cube(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,[l,c]=o,d=Math.floor(l/2),h=Math.floor((c-1)/2),u=(this.children[l],td.remove_row(this.id,[d,h+1],a));return this.remove_row(u)}static get meta(){return{type:n.detail_list,version:2,cubename:"清单",block:!0,show:!0}}static get_default(e=[],t={},i={}){const r=0===e.length?[[kl.get_default(),kl.get_default()]]:e;return{id:is(),type:n.detail_list,info:r,css:t,attrs:{width_col1:150}}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info)s.push([kl.replace_id(e,i[0],n),kl.replace_id(e,i[1],n)]);return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:(e<2&&(t.attrs.width_col1||(t.attrs.width_col1=150)),{data:t,usable:!0})}}sd([ys(m.insert_row)],od.prototype,"insert_row",null),sd([ys(m.remove_row)],od.prototype,"remove_row",null),sd([ys(m.change_width_col1)],od.prototype,"change_width_col1",null),sd([ys(i.cube_delete_child)],od.prototype,"delete_cube",null);class ad{static reset(e,t){return{id:e,data:t,name:b.reset}}static add(e,t,n){return{id:e,name:b.add,data:t,pos:n}}static remove(e,t){return{id:e,name:b.remove,range:t}}static indent(e,t){return{id:e,name:b.indent,items:t}}static status(e,t,n){return{id:e,name:b.status,index:t,done:n}}}const ld=["id","data-type"],cd=["onClick"],dd=Pn({__name:"cube-todo",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:i}=t;return(t,r)=>(fr(),yr("div",{class:"cube-todo",id:t.cube.id,style:fe(t.cube.css),"data-type":Kt(n).todo,onContextmenu:r[0]||(r[0]=e=>Kt(uo)(e,t.cube))},[(fr(!0),yr(cr,null,ri(t.cube.items,(n,r)=>(fr(),yr("div",{key:n.data.id,class:"todoitem",style:fe({"margin-left":n.indent*Kt(i).data.line_indent+"px"})},[Cr("div",{class:ve(["todoitem-status",{active:n.done}]),onClick:()=>function(t,n){const i=ad.status(e.cube.id,n,!t.done),r=e.cube.courier.get_recorder();r.tell(e.cube,i),e.cube.history.record(r)}(n,r)},null,10,cd),Mr(Oo,{class:"todoitem-box",cube:n.data,onKeydown:e=>function(e,t,n,i){const{courier:r,history:s,cursor:o}=t,{indent:a}=n,l=n.data;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(a);n.tell(t,ad.add(t.id,[o],i+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(a);n.tell(t,ad.add(t.id,[o],i)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,ad.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!1}];a.tell(t,ad.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,ad.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!0}];a.tell(t,ad.indent(t.id,e)),s.record(a)}}}(e,t.cube,n,r)},null,8,["cube","onKeydown"])],4))),128))],44,ld))}}),hd=(0,wo.A)(dd,[["__scopeId","data-v-33222767"]]);function ud(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class pd extends Es{_items=Lt([]);constructor(e,t){return super(e,t),this.setup(e,t)}get items(){return[...this._items]}get component(){return hd}get children(){return[...this._items.map(e=>e.data)]}get meta(){return pd.meta}get info(){return this.data.info}update_data(e,t){return pd.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new kl(n.data,this),i={done:n.done,indent:n.indent,data:$t(e)};t.push(i)}return t}export(){const e=this.base_export();return e.info=[...this.export_items()],e}export_items(){const e=[];for(let t of this._items)e.push({done:t.done,indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({done:e.done,indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({done:e.done,indent:e.indent,data:e.data.export()});return{children:i,data:r}}replace_id(e,t={}){return pd.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new kl(n.data,this);t.push({done:n.done,indent:n.indent,data:e})}return t}create_item_data(e=0){return{done:!1,indent:e,data:kl.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=ad.reset(this.id,this.export_items());return this._items.length=0,this._items.push(...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.get_valid_index(n),a=[];for(let e of t){const t=new kl(e.data,this);let n={done:e.done,indent:e.indent,data:$t(t)};a.push(n)}this.splice(o,0,...a);const l=a[a.length-1]?.data;return l&&s.tell(l,hs.in_tail(l.id)),s.add_recover(ad.remove(this.id,[o,o+a.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[s,o]=t;if(s<=0&&o>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[s-1]?.data,c=this._items[o+1]?.data,d=this.splice(s,a);return r.add_recover(ad.add(this.id,d.data,s)),l?r.tell(l,hs.in_tail(l.id)):c&&r.tell(c,hs.in_head(c.id)),r}indent_todoitem(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}))}return i.add_recover(ad.indent(this.id,r)),i}update_status(e){const{courier:t}=this,{index:n,done:i}=e,r=t.get_recorder();r.add_cmd(e);const s=this._items[n];if(s)return s.done=i,r.add_recover(ad.status(this.id,n,!i)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o}=e,a=ad.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=kl.get_default();return{id:is(),type:n.todo,info:[{done:!1,indent:0,data:e}],attrs:{},css:{}}}static get_todo_item(e,t=!1){const n=ss.pick(e).sort;return{done:t,indent:0,data:kl.get_default(n)}}static get meta(){return{cubename:"待办列表",type:n.todo,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=kl.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}ud([ys(b.reset)],pd.prototype,"on_reset",null),ud([ys(b.add)],pd.prototype,"add_item",null),ud([ys(b.remove)],pd.prototype,"remove_item",null),ud([ys(b.indent)],pd.prototype,"indent_todoitem",null),ud([ys(b.status)],pd.prototype,"update_status",null),ud([ys(i.cube_delete_child)],pd.prototype,"on_delete_child",null);const md=["id","data-type"],fd=Pn({__name:"cube-list",props:{cube:{}},setup(e){const{config:t}=e.cube;return(e,i)=>(fr(),yr("div",{class:"cube-list",id:e.cube.id,style:fe(e.cube.css),"data-type":Kt(n).list,onContextmenu:i[0]||(i[0]=t=>Kt(uo)(t,e.cube))},[(fr(!0),yr(cr,null,ri(e.cube.items,(n,r)=>(fr(),yr("div",{key:n.data.id,class:"listitem",style:fe({"margin-left":n.indent*Kt(t).data.line_indent+"px"})},[i[1]||(i[1]=Cr("div",{class:"listitem-symbol"},null,-1)),Mr(Oo,{class:"listitem-box",cube:n.data,onKeydown:t=>function(e,t,n,i){const{courier:r,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,oo.add(t.id,[o],i+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,oo.add(t.id,[o],i)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,oo.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,oo.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,oo.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,oo.indent(t.id,e)),s.record(a)}}}(t,e.cube,n,r)},null,8,["cube","onKeydown"])],4))),128))],44,md))}}),_d=(0,wo.A)(fd,[["__scopeId","data-v-40a8fb6f"]]);function gd(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class bd extends Es{_component=_d;_items=Lt([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return this._component}get items(){return[...this._items]}get children(){return[...this._items.map(e=>e.data)]}get meta(){return bd.meta}get info(){return this.data.info}update_data(e,t){return bd.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new kl(n.data,this),i={indent:n.indent,data:$t(e)};t.push(i)}return t}export(){const e=this.base_export();return e.info.length=0,e.info.push(...this.export_items()),e}export_items(){const e=[];for(let t of this._items)e.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({indent:e.indent,data:e.data.export()});return{children:i,data:r}}replace_id(e,t={}){return bd.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new kl(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:kl.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=oo.reset(this.id,this.export_items());return this._items.length=0,this._items.push(...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.get_valid_index(n),a=[];for(let e of t){const t=new kl(e.data,this);let n={indent:e.indent,data:$t(t)};a.push(n)}this.splice(o,0,...a);const l=a[a.length-1]?.data;return l&&s.tell(l,hs.in_tail(l.id)),s.add_recover(oo.remove(this.id,[o,o+a.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[s,o]=t;if(0===s&&o>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[s-1]?.data,c=this._items[o+1]?.data,d=this.splice(s,a);return r.add_recover(oo.add(this.id,d.data,s)),l?r.tell(l,hs.in_tail(l.id)):c&&r.tell(c,hs.in_head(c.id)),r}indent_item(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}))}return i.add_recover(oo.indent(this.id,r)),i}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o}=e,a=oo.remove(this.id,o);return this.remove_item(a)}static get_default(e=[]){let t=kl.get_default(e);return{id:is(),type:n.list,info:[{indent:0,data:t}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:kl.get_default(ss.pick(e).sort)}}static get meta(){return{cubename:"列表",type:n.list,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=kl.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}gd([ys(f.reset)],bd.prototype,"on_reset",null),gd([ys(f.add)],bd.prototype,"add_item",null),gd([ys(f.remove)],bd.prototype,"remove_item",null),gd([ys(f.indent)],bd.prototype,"indent_item",null),gd([ys(i.cube_delete_child)],bd.prototype,"on_delete_child",null);class yd{static reset(e,t){return{id:e,data:t,name:_.reset}}static add(e,t,n){return{id:e,name:_.add,data:t,pos:n}}static remove(e,t){return{id:e,name:_.remove,range:t}}static indent(e,t){return{id:e,name:_.indent,items:t}}}const vd=["id","data-type"],wd={class:"listitem-symbol"},xd=Pn({__name:"cube-list-ordered",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:i}=t;return(e,t)=>(fr(),yr("div",{class:"cube-list-ordered",id:e.cube.id,style:fe(e.cube.css),"data-type":Kt(n).list_ordered,onContextmenu:t[0]||(t[0]=t=>Kt(uo)(t,e.cube))},[(fr(!0),yr(cr,null,ri(e.cube.items,(t,n)=>(fr(),yr("div",{key:t.data.id,class:"listitem",style:fe({"margin-left":t.indent*Kt(i).data.line_indent+"px"})},[Cr("div",wd,Se(n+1),1),Mr(Oo,{class:"listitem-box",cube:t.data,onKeydown:i=>function(e,t,n,i){const{courier:r,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,yd.add(t.id,[o],i+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,yd.add(t.id,[o],i)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,yd.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,yd.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,yd.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,yd.indent(t.id,e)),s.record(a)}}}(i,e.cube,t,n)},null,8,["cube","onKeydown"])],4))),128))],44,vd))}}),kd=(0,wo.A)(xd,[["__scopeId","data-v-9f3381f0"]]);function Sd(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Cd extends Es{_items=Lt([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return kd}get children(){return[...this._items.map(e=>e.data)]}get items(){return[...this._items]}get meta(){return Cd.meta}get info(){return this.data.info}update_data(e,t){return Cd.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new kl(n.data,this),i={indent:n.indent,data:$t(e)};t.push(i)}return t}export(){const e=super.base_export();e.info=[];for(let t of this._items)e.info.push({indent:t.indent,data:t.data.export()});return e}export_items(){const e=[];for(let t of this._items)e.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({indent:e.indent,data:e.data.export()});return{children:i,data:r}}replace_id(e,t={}){return Cd.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new kl(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:kl.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=yd.reset(this.id,this.export_items());return this._items.length=0,this._items.push(...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.get_valid_index(n),a=[];for(let e of t){const t=new kl(e.data,this);let n={indent:e.indent,data:$t(t)};a.push(n)}this.splice(o,0,...a);const l=a[a.length-1]?.data;return l&&s.tell(l,hs.in_tail(l.id)),s.add_recover(yd.remove(this.id,[o,o+a.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[s,o]=t;if(0===s&&o>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[s-1]?.data,c=this._items[o+1]?.data,d=this.splice(s,a);return r.add_recover(yd.add(this.id,d.data,s)),l?r.tell(l,hs.in_tail(l.id)):c&&r.tell(c,hs.in_head(c.id)),r}indent_item(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}))}return i.add_recover(yd.indent(this.id,r)),i}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o}=e,a=yd.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=kl.get_default();return{id:ss.get_id(),type:n.list_ordered,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:kl.get_default(ss.pick(e).sort)}}static get meta(){return{cubename:"有序列表",type:n.list_ordered,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=kl.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Sd([ys(_.reset)],Cd.prototype,"on_reset",null),Sd([ys(_.add)],Cd.prototype,"add_item",null),Sd([ys(_.remove)],Cd.prototype,"remove_item",null),Sd([ys(_.indent)],Cd.prototype,"indent_item",null),Sd([ys(i.cube_delete_child)],Cd.prototype,"on_delete_child",null);class Md{static update(e,t,n){return{id:e,name:g.code_update,code:n,tabid:t}}static add(e,t,n=!0){return{id:e,name:g.code_add,item:Ft(t),focus:n}}static remove(e,t){return{id:e,name:g.code_remove,tabid:t}}static rename(e,t,n){return{id:e,name:g.code_rename,tabid:t,filename:n}}static change_lang(e,t,n){return{id:e,name:g.change_lang,tabid:t,lang:n}}static change_active(e,t){return{id:e,name:g.change_active,tabid:t}}static change_theme(e,t,n){return{id:e,tabid:t,theme:n,name:g.change_theme}}}const zd=[{id:"abap",name:"ABAP",import:()=>r.e(8617).then(r.bind(r,8617))},{id:"actionscript-3",name:"ActionScript",import:()=>r.e(3516).then(r.bind(r,3516))},{id:"ada",name:"Ada",import:()=>r.e(7561).then(r.bind(r,7561))},{id:"angular-html",name:"Angular HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(535)]).then(r.bind(r,535))},{id:"angular-ts",name:"Angular TypeScript",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7611),r.e(535),r.e(4886)]).then(r.bind(r,4886))},{id:"apache",name:"Apache Conf",import:()=>r.e(7625).then(r.bind(r,7625))},{id:"apex",name:"Apex",import:()=>r.e(9819).then(r.bind(r,9819))},{id:"apl",name:"APL",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(7504)]).then(r.bind(r,7504))},{id:"applescript",name:"AppleScript",import:()=>r.e(2108).then(r.bind(r,2108))},{id:"ara",name:"Ara",import:()=>r.e(5611).then(r.bind(r,5611))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>r.e(4354).then(r.bind(r,4354))},{id:"asm",name:"Assembly",import:()=>r.e(6324).then(r.bind(r,6324))},{id:"astro",name:"Astro",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4714),r.e(6940),r.e(4408)]).then(r.bind(r,4408))},{id:"awk",name:"AWK",import:()=>r.e(4862).then(r.bind(r,4862))},{id:"ballerina",name:"Ballerina",import:()=>r.e(5141).then(r.bind(r,5141))},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>r.e(2068).then(r.bind(r,2068))},{id:"beancount",name:"Beancount",import:()=>r.e(5026).then(r.bind(r,5026))},{id:"berry",name:"Berry",aliases:["be"],import:()=>r.e(8753).then(r.bind(r,8753))},{id:"bibtex",name:"BibTeX",import:()=>r.e(4009).then(r.bind(r,4009))},{id:"bicep",name:"Bicep",import:()=>r.e(7688).then(r.bind(r,7688))},{id:"blade",name:"Blade",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(5283)]).then(r.bind(r,5283))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>r.e(5314).then(r.bind(r,5314))},{id:"c",name:"C",import:()=>r.e(5814).then(r.bind(r,5814))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>r.e(5728).then(r.bind(r,5728))},{id:"cairo",name:"Cairo",import:()=>Promise.all([r.e(2473),r.e(8237)]).then(r.bind(r,8237))},{id:"clarity",name:"Clarity",import:()=>r.e(6677).then(r.bind(r,6677))},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>r.e(7681).then(r.bind(r,7681))},{id:"cmake",name:"CMake",import:()=>r.e(5936).then(r.bind(r,5936))},{id:"cobol",name:"COBOL",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(780)]).then(r.bind(r,780))},{id:"codeowners",name:"CODEOWNERS",import:()=>r.e(9096).then(r.bind(r,9096))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>r.e(6283).then(r.bind(r,6283))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>Promise.all([r.e(7258),r.e(6563)]).then(r.bind(r,6563))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>r.e(489).then(r.bind(r,489))},{id:"coq",name:"Coq",import:()=>r.e(8418).then(r.bind(r,8418))},{id:"cpp",name:"C++",aliases:["c++"],import:()=>Promise.all([r.e(1230),r.e(5814),r.e(4914)]).then(r.bind(r,4914))},{id:"crystal",name:"Crystal",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1230),r.e(5814),r.e(3894),r.e(3403)]).then(r.bind(r,3403))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>r.e(2354).then(r.bind(r,2354))},{id:"css",name:"CSS",import:()=>r.e(1708).then(r.bind(r,1708))},{id:"csv",name:"CSV",import:()=>r.e(8849).then(r.bind(r,1230))},{id:"cue",name:"CUE",import:()=>r.e(172).then(r.bind(r,172))},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>r.e(9806).then(r.bind(r,9806))},{id:"d",name:"D",import:()=>r.e(5177).then(r.bind(r,5177))},{id:"dart",name:"Dart",import:()=>r.e(9728).then(r.bind(r,9728))},{id:"dax",name:"DAX",import:()=>r.e(874).then(r.bind(r,874))},{id:"desktop",name:"Desktop",import:()=>r.e(6173).then(r.bind(r,6173))},{id:"diff",name:"Diff",import:()=>r.e(7670).then(r.bind(r,7670))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>r.e(415).then(r.bind(r,415))},{id:"dotenv",name:"dotEnv",import:()=>r.e(2173).then(r.bind(r,2173))},{id:"dream-maker",name:"Dream Maker",import:()=>r.e(3227).then(r.bind(r,3227))},{id:"edge",name:"Edge",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(3052)]).then(r.bind(r,3052))},{id:"elixir",name:"Elixir",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(3330)]).then(r.bind(r,3330))},{id:"elm",name:"Elm",import:()=>Promise.all([r.e(5814),r.e(9641)]).then(r.bind(r,9641))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>r.e(2505).then(r.bind(r,2505))},{id:"erb",name:"ERB",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(4007),r.e(9524)]).then(r.bind(r,9524))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>Promise.all([r.e(7900),r.e(2266)]).then(r.bind(r,2266))},{id:"fennel",name:"Fennel",import:()=>r.e(1631).then(r.bind(r,1631))},{id:"fish",name:"Fish",import:()=>r.e(9661).then(r.bind(r,9661))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>r.e(9077).then(r.bind(r,9077))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>Promise.all([r.e(8553),r.e(7549)]).then(r.bind(r,7549))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>r.e(8553).then(r.bind(r,8553))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>Promise.all([r.e(7900),r.e(9689)]).then(r.bind(r,9689))},{id:"gdresource",name:"GDResource",import:()=>r.e(7434).then(r.bind(r,7434))},{id:"gdscript",name:"GDScript",import:()=>r.e(4311).then(r.bind(r,4311))},{id:"gdshader",name:"GDShader",import:()=>r.e(6405).then(r.bind(r,6405))},{id:"genie",name:"Genie",import:()=>r.e(9017).then(r.bind(r,9017))},{id:"gherkin",name:"Gherkin",import:()=>r.e(4451).then(r.bind(r,4451))},{id:"git-commit",name:"Git Commit Message",import:()=>r.e(2861).then(r.bind(r,2861))},{id:"git-rebase",name:"Git Rebase Message",import:()=>Promise.all([r.e(3894),r.e(638)]).then(r.bind(r,638))},{id:"gleam",name:"Gleam",import:()=>r.e(8201).then(r.bind(r,8201))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(8700)]).then(r.bind(r,8700))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(5050)]).then(r.bind(r,5050))},{id:"glsl",name:"GLSL",import:()=>Promise.all([r.e(5814),r.e(2723)]).then(r.bind(r,2723))},{id:"gnuplot",name:"Gnuplot",import:()=>r.e(396).then(r.bind(r,396))},{id:"go",name:"Go",import:()=>r.e(3941).then(r.bind(r,3941))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>Promise.all([r.e(7258),r.e(4714),r.e(6940),r.e(6262),r.e(3170)]).then(r.bind(r,3170))},{id:"groovy",name:"Groovy",import:()=>r.e(1037).then(r.bind(r,1037))},{id:"hack",name:"Hack",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1230),r.e(6356)]).then(r.bind(r,6356))},{id:"haml",name:"Ruby Haml",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(3949)]).then(r.bind(r,3949))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1655)]).then(r.bind(r,1655))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>r.e(9045).then(r.bind(r,9045))},{id:"haxe",name:"Haxe",import:()=>r.e(8107).then(r.bind(r,8107))},{id:"hcl",name:"HashiCorp HCL",import:()=>r.e(6124).then(r.bind(r,6124))},{id:"hjson",name:"Hjson",import:()=>r.e(5203).then(r.bind(r,5203))},{id:"hlsl",name:"HLSL",import:()=>r.e(4598).then(r.bind(r,4598))},{id:"html",name:"HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940)]).then(r.bind(r,4940))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(914)]).then(r.bind(r,914))},{id:"http",name:"HTTP",import:()=>Promise.all([r.e(7258),r.e(4714),r.e(6967),r.e(3894),r.e(6940),r.e(6262),r.e(3170),r.e(5119)]).then(r.bind(r,5119))},{id:"hxml",name:"HXML",import:()=>r.e(8320).then(r.bind(r,8320))},{id:"hy",name:"Hy",import:()=>r.e(7470).then(r.bind(r,7470))},{id:"imba",name:"Imba",import:()=>r.e(3702).then(r.bind(r,3702))},{id:"ini",name:"INI",aliases:["properties"],import:()=>r.e(6343).then(r.bind(r,6343))},{id:"java",name:"Java",import:()=>r.e(6967).then(r.bind(r,6967))},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>r.e(7258).then(r.bind(r,7258))},{id:"jinja",name:"Jinja",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(3837)]).then(r.bind(r,3837))},{id:"jison",name:"Jison",import:()=>Promise.all([r.e(7258),r.e(5536)]).then(r.bind(r,5536))},{id:"json",name:"JSON",import:()=>r.e(5709).then(r.bind(r,5709))},{id:"json5",name:"JSON5",import:()=>r.e(6010).then(r.bind(r,6010))},{id:"jsonc",name:"JSON with Comments",import:()=>r.e(212).then(r.bind(r,212))},{id:"jsonl",name:"JSON Lines",import:()=>r.e(4843).then(r.bind(r,4843))},{id:"jsonnet",name:"Jsonnet",import:()=>r.e(4962).then(r.bind(r,4962))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>r.e(7922).then(r.bind(r,7922))},{id:"jsx",name:"JSX",import:()=>r.e(6262).then(r.bind(r,6262))},{id:"julia",name:"Julia",aliases:["jl"],import:()=>Promise.all([r.e(7258),r.e(1230),r.e(5814),r.e(4914),r.e(2473),r.e(9983),r.e(9910)]).then(r.bind(r,9910))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>r.e(2660).then(r.bind(r,2660))},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>r.e(6297).then(r.bind(r,6297))},{id:"latex",name:"LaTeX",import:()=>Promise.all([r.e(9983),r.e(7817)]).then(r.bind(r,7817))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>r.e(8003).then(r.bind(r,8003))},{id:"less",name:"Less",import:()=>r.e(6964).then(r.bind(r,6964))},{id:"liquid",name:"Liquid",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(327)]).then(r.bind(r,327))},{id:"llvm",name:"LLVM IR",import:()=>r.e(3972).then(r.bind(r,3972))},{id:"log",name:"Log file",import:()=>r.e(3247).then(r.bind(r,3247))},{id:"logo",name:"Logo",import:()=>r.e(9730).then(r.bind(r,9730))},{id:"lua",name:"Lua",import:()=>Promise.all([r.e(5814),r.e(4199)]).then(r.bind(r,4199))},{id:"luau",name:"Luau",import:()=>r.e(5744).then(r.bind(r,5744))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>r.e(1757).then(r.bind(r,1757))},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>r.e(7900).then(r.bind(r,7900))},{id:"marko",name:"Marko",import:()=>Promise.all([r.e(1708),r.e(4714),r.e(7611),r.e(6964),r.e(9175)]).then(r.bind(r,9175))},{id:"matlab",name:"MATLAB",import:()=>r.e(2492).then(r.bind(r,2492))},{id:"mdc",name:"MDC",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7900),r.e(2215)]).then(r.bind(r,2215))},{id:"mdx",name:"MDX",import:()=>r.e(4452).then(r.bind(r,4452))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>r.e(2860).then(r.bind(r,2860))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>r.e(8499).then(r.bind(r,8499))},{id:"mojo",name:"Mojo",import:()=>r.e(9526).then(r.bind(r,9526))},{id:"move",name:"Move",import:()=>r.e(9104).then(r.bind(r,9104))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>r.e(6239).then(r.bind(r,6239))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>r.e(9876).then(r.bind(r,9876))},{id:"nginx",name:"Nginx",import:()=>Promise.all([r.e(5814),r.e(697)]).then(r.bind(r,697))},{id:"nim",name:"Nim",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(5814),r.e(7900),r.e(4697)]).then(r.bind(r,4697))},{id:"nix",name:"Nix",import:()=>r.e(8212).then(r.bind(r,8212))},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>r.e(7374).then(r.bind(r,7374))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>r.e(7148).then(r.bind(r,7148))},{id:"objective-cpp",name:"Objective-C++",import:()=>r.e(9788).then(r.bind(r,9788))},{id:"ocaml",name:"OCaml",import:()=>r.e(9057).then(r.bind(r,9057))},{id:"pascal",name:"Pascal",import:()=>r.e(9079).then(r.bind(r,9079))},{id:"perl",name:"Perl",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(9984)]).then(r.bind(r,9984))},{id:"php",name:"PHP",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(7765),r.e(7966)]).then(r.bind(r,7765))},{id:"plsql",name:"PL/SQL",import:()=>r.e(8389).then(r.bind(r,8389))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>r.e(4520).then(r.bind(r,4520))},{id:"polar",name:"Polar",import:()=>r.e(9845).then(r.bind(r,9845))},{id:"postcss",name:"PostCSS",import:()=>r.e(9270).then(r.bind(r,9270))},{id:"powerquery",name:"PowerQuery",import:()=>r.e(454).then(r.bind(r,454))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>r.e(1476).then(r.bind(r,1476))},{id:"prisma",name:"Prisma",import:()=>r.e(5731).then(r.bind(r,5731))},{id:"prolog",name:"Prolog",import:()=>r.e(9206).then(r.bind(r,9206))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>r.e(5891).then(r.bind(r,5891))},{id:"pug",name:"Pug",aliases:["jade"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6757)]).then(r.bind(r,6757))},{id:"puppet",name:"Puppet",import:()=>r.e(3593).then(r.bind(r,3593))},{id:"purescript",name:"PureScript",import:()=>r.e(9904).then(r.bind(r,9904))},{id:"python",name:"Python",aliases:["py"],import:()=>r.e(2473).then(r.bind(r,2473))},{id:"qml",name:"QML",import:()=>Promise.all([r.e(7258),r.e(1803)]).then(r.bind(r,1803))},{id:"qmldir",name:"QML Directory",import:()=>r.e(4292).then(r.bind(r,4292))},{id:"qss",name:"Qt Style Sheets",import:()=>r.e(402).then(r.bind(r,402))},{id:"r",name:"R",import:()=>r.e(9983).then(r.bind(r,9983))},{id:"racket",name:"Racket",import:()=>r.e(9281).then(r.bind(r,9281))},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>r.e(9780).then(r.bind(r,9780))},{id:"razor",name:"ASP.NET Razor",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(2354),r.e(245)]).then(r.bind(r,245))},{id:"reg",name:"Windows Registry Script",import:()=>r.e(5827).then(r.bind(r,5827))},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>r.e(3124).then(r.bind(r,3124))},{id:"rel",name:"Rel",import:()=>r.e(3043).then(r.bind(r,5424))},{id:"riscv",name:"RISC-V",import:()=>r.e(8684).then(r.bind(r,8684))},{id:"rst",name:"reStructuredText",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(2473),r.e(4007),r.e(8234)]).then(r.bind(r,8234))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(4007)]).then(r.bind(r,4007))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>r.e(7145).then(r.bind(r,7145))},{id:"sas",name:"SAS",import:()=>Promise.all([r.e(1230),r.e(9478)]).then(r.bind(r,9478))},{id:"sass",name:"Sass",import:()=>r.e(8709).then(r.bind(r,8709))},{id:"scala",name:"Scala",import:()=>r.e(3947).then(r.bind(r,3947))},{id:"scheme",name:"Scheme",import:()=>r.e(9982).then(r.bind(r,9982))},{id:"scss",name:"SCSS",import:()=>Promise.all([r.e(1708),r.e(7611)]).then(r.bind(r,7611))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>r.e(1624).then(r.bind(r,1624))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>r.e(8249).then(r.bind(r,8249))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>r.e(3894).then(r.bind(r,3894))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>Promise.all([r.e(3894),r.e(9965)]).then(r.bind(r,9965))},{id:"smalltalk",name:"Smalltalk",import:()=>r.e(1066).then(r.bind(r,1066))},{id:"solidity",name:"Solidity",import:()=>r.e(4780).then(r.bind(r,4780))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7642)]).then(r.bind(r,7642))},{id:"sparql",name:"SPARQL",import:()=>r.e(4108).then(r.bind(r,4108))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>r.e(6514).then(r.bind(r,6514))},{id:"sql",name:"SQL",import:()=>r.e(1230).then(r.bind(r,8849))},{id:"ssh-config",name:"SSH Config",import:()=>r.e(3874).then(r.bind(r,3874))},{id:"stata",name:"Stata",import:()=>Promise.all([r.e(1230),r.e(542)]).then(r.bind(r,542))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>r.e(41).then(r.bind(r,41))},{id:"svelte",name:"Svelte",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4714),r.e(3454)]).then(r.bind(r,3454))},{id:"swift",name:"Swift",import:()=>r.e(8436).then(r.bind(r,8436))},{id:"system-verilog",name:"SystemVerilog",import:()=>r.e(6577).then(r.bind(r,6577))},{id:"systemd",name:"Systemd Units",import:()=>r.e(16).then(r.bind(r,16))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>r.e(4660).then(r.bind(r,4660))},{id:"tasl",name:"Tasl",import:()=>r.e(1839).then(r.bind(r,1839))},{id:"tcl",name:"Tcl",import:()=>r.e(7328).then(r.bind(r,7328))},{id:"templ",name:"Templ",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(3941),r.e(7095)]).then(r.bind(r,7095))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>r.e(4385).then(r.bind(r,4385))},{id:"tex",name:"TeX",import:()=>Promise.all([r.e(9983),r.e(9198)]).then(r.bind(r,9198))},{id:"toml",name:"TOML",import:()=>r.e(5363).then(r.bind(r,5363))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(9556)]).then(r.bind(r,9556))},{id:"tsv",name:"TSV",import:()=>r.e(6045).then(r.bind(r,8426))},{id:"tsx",name:"TSX",import:()=>r.e(6940).then(r.bind(r,6940))},{id:"turtle",name:"Turtle",import:()=>r.e(4877).then(r.bind(r,4877))},{id:"twig",name:"Twig",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(2473),r.e(7611),r.e(4007),r.e(7765),r.e(4236)]).then(r.bind(r,4236))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>r.e(4714).then(r.bind(r,4714))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>r.e(794).then(r.bind(r,794))},{id:"typst",name:"Typst",aliases:["typ"],import:()=>r.e(8711).then(r.bind(r,8711))},{id:"v",name:"V",import:()=>r.e(5443).then(r.bind(r,5443))},{id:"vala",name:"Vala",import:()=>r.e(7141).then(r.bind(r,7141))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>r.e(8235).then(r.bind(r,8235))},{id:"verilog",name:"Verilog",import:()=>r.e(4283).then(r.bind(r,4283))},{id:"vhdl",name:"VHDL",import:()=>r.e(5521).then(r.bind(r,5521))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>r.e(7567).then(r.bind(r,7567))},{id:"vue",name:"Vue",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(1432)]).then(r.bind(r,1432))},{id:"vue-html",name:"Vue HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(1432),r.e(7789)]).then(r.bind(r,7789))},{id:"vue-vine",name:"Vue Vine",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(7611),r.e(6964),r.e(1432),r.e(41),r.e(5954)]).then(r.bind(r,5954))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>r.e(845).then(r.bind(r,845))},{id:"wasm",name:"WebAssembly",import:()=>r.e(7615).then(r.bind(r,7615))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>r.e(8393).then(r.bind(r,8393))},{id:"wgsl",name:"WGSL",import:()=>r.e(5884).then(r.bind(r,5884))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>r.e(2062).then(r.bind(r,2062))},{id:"wit",name:"WebAssembly Interface Types",import:()=>r.e(6957).then(r.bind(r,6957))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>r.e(5589).then(r.bind(r,5589))},{id:"xml",name:"XML",import:()=>Promise.all([r.e(6967),r.e(5585)]).then(r.bind(r,7966))},{id:"xsl",name:"XSL",import:()=>Promise.all([r.e(6967),r.e(5628)]).then(r.bind(r,5628))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>r.e(4546).then(r.bind(r,4546))},{id:"zenscript",name:"ZenScript",import:()=>r.e(5099).then(r.bind(r,5099))},{id:"zig",name:"Zig",import:()=>r.e(3279).then(r.bind(r,3279))}],Ad=Object.fromEntries(zd.map(e=>[e.id,e.import])),Td=Object.fromEntries(zd.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Pd={...Ad,...Td},Nd=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>r.e(2691).then(r.bind(r,2691))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>r.e(7768).then(r.bind(r,7768))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>r.e(7927).then(r.bind(r,7927))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>r.e(1216).then(r.bind(r,1216))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>r.e(7788).then(r.bind(r,7788))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>r.e(2071).then(r.bind(r,2071))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>r.e(9692).then(r.bind(r,9692))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>r.e(3032).then(r.bind(r,3032))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>r.e(8485).then(r.bind(r,8485))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>r.e(284).then(r.bind(r,284))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>r.e(1545).then(r.bind(r,1545))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>r.e(6083).then(r.bind(r,6083))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>r.e(5647).then(r.bind(r,5647))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>r.e(9179).then(r.bind(r,9179))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>r.e(9976).then(r.bind(r,9976))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>r.e(9831).then(r.bind(r,9831))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>r.e(9809).then(r.bind(r,9809))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>r.e(9681).then(r.bind(r,9681))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>r.e(1425).then(r.bind(r,1425))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>r.e(6865).then(r.bind(r,6865))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>r.e(7824).then(r.bind(r,7824))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>r.e(3646).then(r.bind(r,3646))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>r.e(2419).then(r.bind(r,2419))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>r.e(9225).then(r.bind(r,9225))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>r.e(4112).then(r.bind(r,4112))},{id:"houston",displayName:"Houston",type:"dark",import:()=>r.e(8931).then(r.bind(r,8931))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>r.e(2184).then(r.bind(r,2184))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>r.e(2142).then(r.bind(r,2142))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>r.e(5638).then(r.bind(r,5638))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>r.e(7831).then(r.bind(r,7831))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>r.e(8426).then(r.bind(r,6045))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>r.e(3492).then(r.bind(r,3492))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>r.e(3720).then(r.bind(r,3720))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>r.e(9294).then(r.bind(r,9294))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>r.e(4081).then(r.bind(r,4081))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>r.e(1729).then(r.bind(r,1729))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>r.e(4614).then(r.bind(r,4614))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>r.e(2934).then(r.bind(r,2934))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>r.e(2535).then(r.bind(r,2535))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>r.e(4214).then(r.bind(r,4214))},{id:"nord",displayName:"Nord",type:"dark",import:()=>r.e(4552).then(r.bind(r,4552))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>r.e(6736).then(r.bind(r,6736))},{id:"one-light",displayName:"One Light",type:"light",import:()=>r.e(3906).then(r.bind(r,3906))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>r.e(4445).then(r.bind(r,4445))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>r.e(4465).then(r.bind(r,4465))},{id:"red",displayName:"Red",type:"dark",import:()=>r.e(6980).then(r.bind(r,6980))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>r.e(753).then(r.bind(r,753))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>r.e(5424).then(r.bind(r,3043))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>r.e(8093).then(r.bind(r,8093))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>r.e(4838).then(r.bind(r,4838))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>r.e(5601).then(r.bind(r,5601))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>r.e(1857).then(r.bind(r,1857))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>r.e(7217).then(r.bind(r,7217))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>r.e(1931).then(r.bind(r,1931))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>r.e(321).then(r.bind(r,321))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>r.e(5034).then(r.bind(r,5034))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>r.e(224).then(r.bind(r,224))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>r.e(5542).then(r.bind(r,5542))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>r.e(6517).then(r.bind(r,6517))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>r.e(5143).then(r.bind(r,5143))}],Od=Object.fromEntries(Nd.map(e=>[e.id,e.import]));class Rd extends Error{constructor(e){super(e),this.name="ShikiError"}}function Ld(e){return Array.isArray(e)?function(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=Ld(e[n]);return t}(e):e instanceof RegExp?e:"object"==typeof e?function(e){let t={};for(let n in e)t[n]=Ld(e[n]);return t}(e):e}function Ed(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Dd(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t===e.length-1?Dd(e.substring(0,e.length-1)):e.substr(1+~t)}var Id=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Bd=class{static hasCaptures(e){return null!==e&&(Id.lastIndex=0,Id.test(e))}static replaceCaptures(e,t,n){return e.replace(Id,(e,i,r,s)=>{let o=n[parseInt(i||r,10)];if(!o)return e;{let e=t.substring(o.start,o.end);for(;"."===e[0];)e=e.substring(1);switch(s){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function jd(e,t){return e<t?-1:e>t?1:0}function qd(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let i=0;i<n;i++){let n=jd(e[i],t[i]);if(0!==n)return n}return 0}return n-i}function Hd(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Fd(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var $d=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Gd=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let e=0,r=t.length;e<r;e++){let r,s=t[e];if(!s.settings)continue;if("string"==typeof s.scope){let e=s.scope;e=e.replace(/^[,]+/,""),e=e.replace(/[,]+$/,""),r=e.split(",")}else r=Array.isArray(s.scope)?s.scope:[""];let o=-1;if("string"==typeof s.settings.fontStyle){o=0;let e=s.settings.fontStyle.split(" ");for(let t=0,n=e.length;t<n;t++)switch(e[t]){case"italic":o|=1;break;case"bold":o|=2;break;case"underline":o|=4;break;case"strikethrough":o|=8}}let a=null;"string"==typeof s.settings.foreground&&Hd(s.settings.foreground)&&(a=s.settings.foreground);let l=null;"string"==typeof s.settings.background&&Hd(s.settings.background)&&(l=s.settings.background);for(let t=0,s=r.length;t<s;t++){let s=r[t].trim().split(" "),c=s[s.length-1],d=null;s.length>1&&(d=s.slice(0,s.length-1),d.reverse()),n[i++]=new Yd(c,d,e,o,a,l)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{let n=jd(e.scope,t.scope);return 0!==n?n:(n=qd(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)});let n=0,i="#000000",r="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(i=t.foreground),null!==t.background&&(r=t.background)}let s=new Kd(t),o=new Wd(n,s.getId(i),s.getId(r)),a=new Zd(new Qd(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];a.insert(0,n.scope,n.parentScopes,n.fontStyle,s.getId(n.foreground),s.getId(n.background))}return new Gd(s,o,a)}(e,t)}_cachedMatchRoot=new $d(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>function(e,t){if(0===t.length)return!0;for(let n=0;n<t.length;n++){let i=t[n],r=!1;if(">"===i){if(n===t.length-1)return!1;i=t[++n],r=!0}for(;e&&!Ud(e.scopeName,i);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}(e.parent,t.parentScopes));return n?new Wd(n.fontStyle,n.foreground,n.background):null}},Vd=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(const i of n)t=new e(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new e(n,t[i]);return n}push(t){return new e(this,t)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Ud(e,t){return t===e||e.startsWith(t)&&"."===e[t.length]}var Wd=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}},Yd=class{constructor(e,t,n,i,r,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=r,this.background=s}},Xd=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Xd||{}),Kd=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Jd=Object.freeze([]),Qd=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,i,r){this.scopeDepth=e,this.parentScopes=t||Jd,this.fontStyle=n,this.foreground=i,this.background=r}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==i&&(this.background=i)}},Zd=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,i=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[i]&&i++,!(n>=e.parentScopes.length||i>=t.parentScopes.length);){const r=t.parentScopes[i].length-e.parentScopes[n].length;if(0!==r)return r;n++,i++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,i=t.indexOf(".");if(-1===i?(e=t,n=""):(e=t.substring(0,i),n=t.substring(i+1)),this._children.hasOwnProperty(e))return this._children[e].match(n)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,i,r,s,o){if(""===n)return void this._doInsertHere(t,i,r,s,o);let a,l,c,d=n.indexOf(".");-1===d?(a=n,l=""):(a=n.substring(0,d),l=n.substring(d+1)),this._children.hasOwnProperty(a)?c=this._children[a]:(c=new e(this._mainRule.clone(),Qd.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,l,i,r,s,o)}_doInsertHere(e,t,n,i,r){if(null!==t){for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let o=this._rulesWithParentScopes[s];if(0===qd(o.parentScopes,t))return void o.acceptOverwrite(e,n,i,r)}-1===n&&(n=this._mainRule.fontStyle),0===i&&(i=this._mainRule.foreground),0===r&&(r=this._mainRule.background),this._rulesWithParentScopes.push(new Qd(e,t,n,i,r))}else this._mainRule.acceptOverwrite(e,n,i,r)}},eh=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){const n=e.getLanguageId(t),i=e.getTokenType(t),r=e.getFontStyle(t),s=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:r,foreground:s,background:o})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static set(t,n,i,r,s,o,a){let l=e.getLanguageId(t),c=e.getTokenType(t),d=e.containsBalancedBrackets(t)?1:0,h=e.getFontStyle(t),u=e.getForeground(t),p=e.getBackground(t);return 0!==n&&(l=n),8!==i&&(c=i),null!==r&&(d=r?1:0),-1!==s&&(h=s),0!==o&&(u=o),0!==a&&(p=a),(l|c<<8|d<<10|h<<11|u<<15|p<<24)>>>0}};function th(e){return e}function nh(e,t){const n=[],i=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}(e);let r=i.next();for(;null!==r;){let e=0;if(2===r.length&&":"===r.charAt(1)){switch(r.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=i.next()}let t=o();if(n.push({matcher:t,priority:e}),","!==r)break;r=i.next()}return n;function s(){if("-"===r){r=i.next();const e=s();return t=>!!e&&!e(t)}if("("===r){r=i.next();const e=function(){const e=[];let t=o();for(;t&&(e.push(t),"|"===r||","===r);){do{r=i.next()}while("|"===r||","===r);t=o()}return t=>e.some(e=>e(t))}();return")"===r&&(r=i.next()),e}if(ih(r)){const e=[];do{e.push(r),r=i.next()}while(ih(r));return n=>t(e,n)}return null}function o(){const e=[];let t=s();for(;t;)e.push(t),t=s();return t=>e.every(e=>e(t))}}function ih(e){return!!e&&!!e.match(/[\w\.:]+/)}function rh(e){"function"==typeof e.dispose&&e.dispose()}var sh=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},oh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ah=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},lh=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new sh(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new ah;for(const n of e)ch(n,this.initialScopeName,this.repo,t);for(const e of t.references)if(e instanceof sh){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName))continue;if(this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function ch(e,t,n,i){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof sh?hh({baseGrammar:s,selfGrammar:r},i):dh(e.ruleName,{baseGrammar:s,selfGrammar:r,repository:r.repository},i);const o=n.injections(e.scopeName);if(o)for(const e of o)i.add(new sh(e))}function dh(e,t,n){t.repository&&t.repository[e]&&uh([t.repository[e]],t,n)}function hh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&uh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&uh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function uh(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const e=i.repository?Ed({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&uh(i.patterns,{...t,repository:e},n);const r=i.include;if(!r)continue;const s=bh(r);switch(s.kind){case 0:hh({...t,selfGrammar:t.baseGrammar},n);break;case 1:hh(t,n);break;case 2:dh(s.ruleName,{...t,repository:e},n);break;case 3:case 4:const i=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){const r={baseGrammar:t.baseGrammar,selfGrammar:i,repository:e};4===s.kind?dh(s.ruleName,r,n):hh(r,n)}else 4===s.kind?n.add(new oh(s.scopeName,s.ruleName)):n.add(new sh(s.scopeName))}}}var ph=class{kind=0},mh=class{kind=1},fh=class{constructor(e){this.ruleName=e}kind=2},_h=class{constructor(e){this.scopeName=e}kind=3},gh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function bh(e){if("$base"===e)return new ph;if("$self"===e)return new mh;const t=e.indexOf("#");if(-1===t)return new _h(e);if(0===t)return new fh(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new gh(n,i)}}var yh=/\\(\d+)/,vh=/\\(\d+)/g;Symbol("RuleId");var wh=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Bd.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Bd.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Dd(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?Bd.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?Bd.replaceCaptures(this._contentName,e,t):this._contentName}},xh=class extends wh{retokenizeCapturedWithRuleId;constructor(e,t,n,i,r){super(e,t,n,i),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},kh=class extends wh{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,null),this._match=new Ah(i,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Th,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Sh=class extends wh{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,i),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Th,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ch=class extends wh{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r,s,o,a,l,c){super(e,t,n,i),this._begin=new Ah(r,this.id),this.beginCaptures=s,this._end=new Ah(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Th;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Mh=class extends wh{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,r,s,o,a,l){super(e,t,n,i),this._begin=new Ah(r,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Ah(o,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Th;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Th,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},zh=class e{static createCaptureRule(e,t,n,i,r){return e.registerRule(e=>new xh(t,e,n,i,r))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new kh(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,i));if(void 0===t.begin){t.repository&&(i=Ed({},i,t.repository));let r=t.patterns;return void 0===r&&t.include&&(r=[{include:t.include}]),new Sh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(r,n,i))}return t.while?new Mh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,i),e._compilePatterns(t.patterns,n,i)):new Ch(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,e._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let r=[];if(t){let s=0;for(const e in t){if("$vscodeTextmateLocation"===e)continue;const t=parseInt(e,10);t>s&&(s=t)}for(let e=0;e<=s;e++)r[e]=null;for(const s in t){if("$vscodeTextmateLocation"===s)continue;const o=parseInt(s,10);let a=0;t[s].patterns&&(a=e.getCompiledRuleId(t[s],n,i)),r[o]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,a)}}return r}static _compilePatterns(t,n,i){let r=[];if(t)for(let s=0,o=t.length;s<o;s++){const o=t[s];let a=-1;if(o.include){const t=bh(o.include);switch(t.kind){case 0:case 1:a=e.getCompiledRuleId(i[o.include],n,i);break;case 2:let r=i[t.ruleName];r&&(a=e.getCompiledRuleId(r,n,i));break;case 3:case 4:const s=t.scopeName,l=4===t.kind?t.ruleName:null,c=n.getExternalGrammar(s,i);if(c)if(l){let t=c.repository[l];t&&(a=e.getCompiledRuleId(t,n,c.repository))}else a=e.getCompiledRuleId(c.repository.$self,n,c.repository)}}else a=e.getCompiledRuleId(o,n,i);if(-1!==a){const e=n.getRule(a);let t=!1;if((e instanceof Sh||e instanceof Ch||e instanceof Mh)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},Ah=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,i=[],r=!1;for(let s=0;s<t;s++)if("\\"===e.charAt(s)&&s+1<t){const t=e.charAt(s+1);"z"===t?(i.push(e.substring(n,s)),i.push("$(?!\\n)(?<!\\n)"),n=s+2):"A"!==t&&"G"!==t||(r=!0),s++}this.hasAnchor=r,0===n?this.source=e:(i.push(e.substring(n,t)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=yh.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let n=t.map(t=>e.substring(t.start,t.end));return vh.lastIndex=0,this.source.replace(vh,(e,t)=>Fd(n[parseInt(t,10)]||""))}_buildAnchorCache(){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let e,t,n,i,r=[],s=[],o=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),r[e]=n,s[e]=n,o[e]=n,a[e]=n,"\\"===n&&e+1<t&&(i=this.source.charAt(e+1),"A"===i?(r[e+1]="",s[e+1]="",o[e+1]="A",a[e+1]="A"):"G"===i?(r[e+1]="",s[e+1]="G",o[e+1]="",a[e+1]="G"):(r[e+1]=i,s[e+1]=i,o[e+1]=i,a[e+1]=i),e++);return{A0_G0:r.join(""),A0_G1:s.join(""),A1_G0:o.join(""),A1_G1:a.join("")}}resolveAnchors(e,t){return this.hasAnchor&&this._anchorCache&&"string"==typeof this.source?e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source}},Th=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Ph(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let i=this._items.map(e=>e.resolveAnchors(t,n));return new Ph(e,i,this._items.map(e=>e.ruleId))}},Ph=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},Nh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Oh=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Nh(e,8),this._embeddedLanguagesMatcher=new Rh(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Nh(0,0);_getBasicScopeAttributes=new $d(e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new Nh(t,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){const n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Rh=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>Fd(e));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}},Lh=("undefined"!=typeof process&&process.env.VSCODE_TEXTMATE_DEBUG,class{constructor(e,t){this.stack=e,this.stoppedEarly=t}});function Eh(e,t,n,i,r,s,o,a){const l=t.content.length;let c=!1,d=-1;if(o){const o=function(e,t,n,i,r,s){let o=r.beginRuleCapturedEOL?0:-1;const a=[];for(let t=r;t;t=t.pop()){const n=t.getRule(e);n instanceof Mh&&a.push({rule:n,stack:t})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:a,findOptions:c}=Ih(l.rule,e,l.stack.endRule,n,i===o),d=a.findNextMatchSync(t,i,c);if(!d){r=l.stack.pop();break}if(-2!==d.ruleId){r=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),Bh(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>i&&(i=d.captureIndices[0].end,n=!1))}return{stack:r,linePos:i,anchorPosition:o,isFirstLine:n}}(e,t,n,i,r,s);r=o.stack,i=o.linePos,n=o.isFirstLine,d=o.anchorPosition}const h=Date.now();for(;!c;){if(0!==a&&Date.now()-h>a)return new Lh(r,!0);u()}return new Lh(r,!1);function u(){const o=function(e,t,n,i,r,s){const o=function(e,t,n,i,r,s){const o=r.getRule(e),{ruleScanner:a,findOptions:l}=Dh(o,e,r.endRule,n,i===s),c=a.findNextMatchSync(t,i,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}(e,t,n,i,r,s),a=e.getInjections();if(0===a.length)return o;const l=function(e,t,n,i,r,s,o){let a,l=Number.MAX_VALUE,c=null,d=0;const h=s.contentNameScopesList.getScopeNames();for(let s=0,u=e.length;s<u;s++){const u=e[s];if(!u.matcher(h))continue;const p=t.getRule(u.ruleId),{ruleScanner:m,findOptions:f}=Dh(p,t,null,i,r===o),_=m.findNextMatchSync(n,r,f);if(!_)continue;const g=_.captureIndices[0].start;if(!(g>=l)&&(l=g,c=_.captureIndices,a=_.ruleId,d=u.priority,l===r))break}return c?{priorityMatch:-1===d,captureIndices:c,matchedRuleId:a}:null}(a,e,t,n,i,r,s);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,d=l.captureIndices[0].start;return d<c||l.priorityMatch&&d===c?l:o}(e,t,n,i,r,d);if(!o)return s.produce(r,l),void(c=!0);const a=o.captureIndices,h=o.matchedRuleId,u=!!(a&&a.length>0)&&a[0].end>i;if(-1===h){const o=r.getRule(e);s.produce(r,a[0].start),r=r.withContentNameScopesList(r.nameScopesList),Bh(e,t,n,r,s,o.endCaptures,a),s.produce(r,a[0].end);const h=r;if(r=r.parent,d=h.getAnchorPos(),!u&&h.getEnterPos()===i)return r=h,s.produce(r,l),void(c=!0)}else{const o=e.getRule(h);s.produce(r,a[0].start);const p=r,m=o.getName(t.content,a),f=r.contentNameScopesList.pushAttributed(m,e);if(r=r.push(h,i,d,a[0].end===l,null,f,f),o instanceof Ch){const i=o;Bh(e,t,n,r,s,i.beginCaptures,a),s.produce(r,a[0].end),d=a[0].end;const h=i.getContentName(t.content,a),m=f.pushAttributed(h,e);if(r=r.withContentNameScopesList(m),i.endHasBackReferences&&(r=r.withEndRule(i.getEndWithResolvedBackReferences(t.content,a))),!u&&p.hasSameRuleAs(r))return r=r.pop(),s.produce(r,l),void(c=!0)}else if(o instanceof Mh){const i=o;Bh(e,t,n,r,s,i.beginCaptures,a),s.produce(r,a[0].end),d=a[0].end;const h=i.getContentName(t.content,a),m=f.pushAttributed(h,e);if(r=r.withContentNameScopesList(m),i.whileHasBackReferences&&(r=r.withEndRule(i.getWhileWithResolvedBackReferences(t.content,a))),!u&&p.hasSameRuleAs(r))return r=r.pop(),s.produce(r,l),void(c=!0)}else if(Bh(e,t,n,r,s,o.captures,a),s.produce(r,a[0].end),r=r.pop(),!u)return r=r.safePop(),s.produce(r,l),void(c=!0)}a[0].end>i&&(i=a[0].end,n=!1)}}function Dh(e,t,n,i,r){return{ruleScanner:e.compileAG(t,n,i,r),findOptions:0}}function Ih(e,t,n,i,r){return{ruleScanner:e.compileWhileAG(t,n,i,r),findOptions:0}}function Bh(e,t,n,i,r,s,o){if(0===s.length)return;const a=t.content,l=Math.min(s.length,o.length),c=[],d=o[0].end;for(let t=0;t<l;t++){const l=s[t];if(null===l)continue;const h=o[t];if(0===h.length)continue;if(h.start>d)break;for(;c.length>0&&c[c.length-1].endPos<=h.start;)r.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?r.produceFromScopes(c[c.length-1].scopes,h.start):r.produce(i,h.start),l.retokenizeCapturedWithRuleId){const t=l.getName(a,o),s=i.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(a,o),d=s.pushAttributed(c,e),u=i.push(l.retokenizeCapturedWithRuleId,h.start,-1,!1,null,s,d),p=e.createOnigString(a.substring(0,h.end));Eh(e,p,n&&0===h.start,h.start,u,r,!1,0),rh(p);continue}const u=l.getName(a,o);if(null!==u){const t=(c.length>0?c[c.length-1].scopes:i.contentNameScopesList).pushAttributed(u,e);c.push(new jh(t,h.end))}}for(;c.length>0;)r.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var jh=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function qh(e,t,n,i,r){const s=nh(t,Hh),o=zh.getCompiledRuleId(n,i,r.repository);for(const n of s)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:r,priority:n.priority})}function Hh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let i=n;i<t.length;i++)if(Fh(t[i],e))return n=i+1,!0;return!1})}function Fh(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}var $h=class{constructor(e,t,n,i,r,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new Oh(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Gh(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const e of Object.keys(r)){const t=nh(e,Hh);for(const n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:r[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=[],t=this._rootScopeName,n=(e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e))(t);if(n){const i=n.injections;if(i)for(let t in i)qh(e,t,i[t],this,n);const r=this._grammarRepository.injections(t);r&&r.forEach(t=>{const n=this.getExternalGrammar(t);if(n){const t=n.injectionSelector;t&&qh(e,t,n,this,n)}})}return e.sort((e,t)=>e.priority-t.priority),e}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Gh(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){let r;if(-1===this._rootId&&(this._rootId=zh.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==Uh.NULL)r=!1,t.reset();else{r=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),i=eh.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),s=this.getRule(this._rootId).getName(null,null);let o;o=s?Vh.createRootAndLookUpScopeName(s,i,this):Vh.createRoot("unknown",i),t=new Uh(null,this._rootId,-1,-1,!1,null,o,o)}e+="\n";const s=this.createOnigString(e),o=s.content.length,a=new Yh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Eh(this,s,r,0,t,a,!0,i);return rh(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Gh(e,t){return(e=Ld(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Vh=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let i=t,r=t?.scopePath??null;for(const t of n)r=Vd.push(r,t.scopeNames),i=new e(i,r,t.encodedTokenAttributes);return i}static createRoot(t,n){return new e(null,new Vd(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const r=i.getMetadataForScope(t),s=new Vd(null,t),o=i.themeProvider.themeMatch(s),a=e.mergeAttributes(n,r,o);return new e(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let i=-1,r=0,s=0;return null!==n&&(i=n.fontStyle,r=n.foregroundId,s=n.backgroundId),eh.set(e,t.languageId,t.tokenType,null,i,r,s)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);const i=t.split(/ /g);let r=this;for(const t of i)r=e._pushAttributed(r,t,n);return r}static _pushAttributed(t,n,i){const r=i.getMetadataForScope(n),s=t.scopePath.push(n),o=i.themeProvider.themeMatch(s),a=e.mergeAttributes(t.tokenAttributes,r,o);return new e(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Uh=class e{constructor(e,t,n,i,r,s,o,a){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=r,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&Vh.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,r,s,o,a){return new e(this,t,n,i,r,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const i=Vh.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,Vh.fromExtension(i,n.contentNameScopesList))}},Wh=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):nh(e,Hh).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>nh(e,Hh).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Yh=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e?.getScopeNames()??[];for(const e of this._tokenTypeOverrides)e.matcher(t)&&(n=eh.set(n,0,th(e.type),null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(t))}return i&&(n=eh.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n||(this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n)),void(this._lastTokenEndIndex=t)}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Xh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,r){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,function(e,t,n,i,r,s,o,a){return new $h(e,t,n,i,r,s,o,a)}(e,s,t,n,i,r,this,this._onigLib))}return this._grammars.get(e)}},Kh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Xh(Gd.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Gd.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Wh(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,i,r){const s=new lh(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(e=>this._loadSingleGrammar(e.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,i,r)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,i=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,t=0,n=null,i=null,r=null){return this._syncRegistry.grammarForScopeName(e,t,n,i,r)}},Jh=Uh.NULL;const Qh=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Zh{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function eu(e,t){const n={},i={};for(const t of e)Object.assign(n,t.property),Object.assign(i,t.normal);return new Zh(n,i,t)}function tu(e){return e.toLowerCase()}Zh.prototype.normal={},Zh.prototype.property={},Zh.prototype.space=void 0;class nu{constructor(e,t){this.attribute=t,this.property=e}}nu.prototype.attribute="",nu.prototype.booleanish=!1,nu.prototype.boolean=!1,nu.prototype.commaOrSpaceSeparated=!1,nu.prototype.commaSeparated=!1,nu.prototype.defined=!1,nu.prototype.mustUseProperty=!1,nu.prototype.number=!1,nu.prototype.overloadedBoolean=!1,nu.prototype.property="",nu.prototype.spaceSeparated=!1,nu.prototype.space=void 0;let iu=0;const ru=hu(),su=hu(),ou=hu(),au=hu(),lu=hu(),cu=hu(),du=hu();function hu(){return 2**++iu}const uu=Object.keys(e);class pu extends nu{constructor(t,n,i,r){let s=-1;if(super(t,n),mu(this,"space",r),"number"==typeof i)for(;++s<uu.length;){const t=uu[s];mu(this,uu[s],(i&e[t])===e[t])}}}function mu(e,t,n){n&&(e[t]=n)}function fu(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const s=new pu(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[tu(i)]=i,n[tu(s.attribute)]=i}return new Zh(t,n,e.space)}pu.prototype.defined=!0;const _u=fu({properties:{ariaActiveDescendant:null,ariaAtomic:su,ariaAutoComplete:null,ariaBusy:su,ariaChecked:su,ariaColCount:au,ariaColIndex:au,ariaColSpan:au,ariaControls:lu,ariaCurrent:null,ariaDescribedBy:lu,ariaDetails:null,ariaDisabled:su,ariaDropEffect:lu,ariaErrorMessage:null,ariaExpanded:su,ariaFlowTo:lu,ariaGrabbed:su,ariaHasPopup:null,ariaHidden:su,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lu,ariaLevel:au,ariaLive:null,ariaModal:su,ariaMultiLine:su,ariaMultiSelectable:su,ariaOrientation:null,ariaOwns:lu,ariaPlaceholder:null,ariaPosInSet:au,ariaPressed:su,ariaReadOnly:su,ariaRelevant:null,ariaRequired:su,ariaRoleDescription:lu,ariaRowCount:au,ariaRowIndex:au,ariaRowSpan:au,ariaSelected:su,ariaSetSize:au,ariaSort:null,ariaValueMax:au,ariaValueMin:au,ariaValueNow:au,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function gu(e,t){return t in e?e[t]:t}function bu(e,t){return gu(e,t.toLowerCase())}const yu=fu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:cu,acceptCharset:lu,accessKey:lu,action:null,allow:null,allowFullScreen:ru,allowPaymentRequest:ru,allowUserMedia:ru,alt:null,as:null,async:ru,autoCapitalize:null,autoComplete:lu,autoFocus:ru,autoPlay:ru,blocking:lu,capture:null,charSet:null,checked:ru,cite:null,className:lu,cols:au,colSpan:null,content:null,contentEditable:su,controls:ru,controlsList:lu,coords:au|cu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ru,defer:ru,dir:null,dirName:null,disabled:ru,download:ou,draggable:su,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ru,formTarget:null,headers:lu,height:au,hidden:ou,high:au,href:null,hrefLang:null,htmlFor:lu,httpEquiv:lu,id:null,imageSizes:null,imageSrcSet:null,inert:ru,inputMode:null,integrity:null,is:null,isMap:ru,itemId:null,itemProp:lu,itemRef:lu,itemScope:ru,itemType:lu,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ru,low:au,manifest:null,max:null,maxLength:au,media:null,method:null,min:null,minLength:au,multiple:ru,muted:ru,name:null,nonce:null,noModule:ru,noValidate:ru,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ru,optimum:au,pattern:null,ping:lu,placeholder:null,playsInline:ru,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ru,referrerPolicy:null,rel:lu,required:ru,reversed:ru,rows:au,rowSpan:au,sandbox:lu,scope:null,scoped:ru,seamless:ru,selected:ru,shadowRootClonable:ru,shadowRootDelegatesFocus:ru,shadowRootMode:null,shape:null,size:au,sizes:null,slot:null,span:au,spellCheck:su,src:null,srcDoc:null,srcLang:null,srcSet:null,start:au,step:null,style:null,tabIndex:au,target:null,title:null,translate:null,type:null,typeMustMatch:ru,useMap:null,value:su,width:au,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lu,axis:null,background:null,bgColor:null,border:au,borderColor:null,bottomMargin:au,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ru,declare:ru,event:null,face:null,frame:null,frameBorder:null,hSpace:au,leftMargin:au,link:null,longDesc:null,lowSrc:null,marginHeight:au,marginWidth:au,noResize:ru,noHref:ru,noShade:ru,noWrap:ru,object:null,profile:null,prompt:null,rev:null,rightMargin:au,rules:null,scheme:null,scrolling:su,standby:null,summary:null,text:null,topMargin:au,valueType:null,version:null,vAlign:null,vLink:null,vSpace:au,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ru,disableRemotePlayback:ru,prefix:null,property:null,results:au,security:null,unselectable:null},space:"html",transform:bu}),vu=fu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:du,accentHeight:au,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:au,amplitude:au,arabicForm:null,ascent:au,attributeName:null,attributeType:null,azimuth:au,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:au,by:null,calcMode:null,capHeight:au,className:lu,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:au,diffuseConstant:au,direction:null,display:null,dur:null,divisor:au,dominantBaseline:null,download:ru,dx:null,dy:null,edgeMode:null,editable:null,elevation:au,enableBackground:null,end:null,event:null,exponent:au,externalResourcesRequired:null,fill:null,fillOpacity:au,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:cu,g2:cu,glyphName:cu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:au,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:au,horizOriginX:au,horizOriginY:au,id:null,ideographic:au,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:au,k:au,k1:au,k2:au,k3:au,k4:au,kernelMatrix:du,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:au,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:au,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:au,overlineThickness:au,paintOrder:null,panose1:null,path:null,pathLength:au,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lu,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:au,pointsAtY:au,pointsAtZ:au,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:du,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:du,rev:du,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:du,requiredFeatures:du,requiredFonts:du,requiredFormats:du,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:au,specularExponent:au,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:au,strikethroughThickness:au,string:null,stroke:null,strokeDashArray:du,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:au,strokeOpacity:au,strokeWidth:null,style:null,surfaceScale:au,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:du,tabIndex:au,tableValues:null,target:null,targetX:au,targetY:au,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:du,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:au,underlineThickness:au,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:au,values:null,vAlphabetic:au,vMathematical:au,vectorEffect:null,vHanging:au,vIdeographic:au,version:null,vertAdvY:au,vertOriginX:au,vertOriginY:au,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:au,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:gu}),wu=fu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),xu=fu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bu}),ku=fu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),Su=eu([_u,yu,wu,xu,ku],"html"),Cu=eu([_u,vu,wu,xu,ku],"svg"),Mu={}.hasOwnProperty,zu=/["&'<>`]/g,Au=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Tu=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Pu=/[|\\{}()[\]^$+*?.]/g,Nu=new WeakMap;const Ou=/[\dA-Fa-f]/,Ru=/\d/,Lu=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Eu={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Du=["cent","copy","divide","gt","lt","not","para","times"],Iu={}.hasOwnProperty,Bu={};let ju;for(ju in Eu)Iu.call(Eu,ju)&&(Bu[Eu[ju]]=ju);const qu=/[^\dA-Za-z]/;function Hu(e,t,n){let i,r=function(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!Ou.test(String.fromCharCode(t))?i:i+";"}(e,t,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(i=function(e,t,n,i){const r=String.fromCharCode(e);if(Iu.call(Bu,r)){const e=Bu[r],s="&"+e;return n&&Lu.includes(e)&&!Du.includes(e)&&(!i||t&&61!==t&&qu.test(String.fromCharCode(t)))?s:s+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const i=function(e,t,n){const i="&#"+String(e);return n&&t&&!Ru.test(String.fromCharCode(t))?i:i+";"}(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Fu(e,t){return function(e,t){return e=e.replace(t.subset?function(e){let t=Nu.get(e);return t||(t=function(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Pu,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),Nu.set(e,t)),t}(t.subset):zu,n),t.subset||t.escapeOnly?e:e.replace(Au,function(e,n,i){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,i.charCodeAt(n+2),t)}).replace(Tu,n);function n(e,n,i){return t.format(e.charCodeAt(0),i.charCodeAt(n+1),t)}}(e,Object.assign({format:Hu},t))}const $u=/^>|^->|<!--|-->|--!>|<!-$/g,Gu=[">"],Vu=["<",">"];function Uu(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;-1!==r;)i++,r=n.indexOf(t,r+t.length);return i}function Wu(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const Yu=/[A-Z]/g,Xu=/-[a-z]/g,Ku=/^data[-\w.:]+$/i;function Ju(e){return"-"+e.toLowerCase()}function Qu(e){return e.charAt(1).toUpperCase()}function Zu(e){return e.join(" ").trim()}const ep=/[ \t\n\f\r]/g;function tp(e){return"object"==typeof e?"text"===e.type&&np(e.value):np(e)}function np(e){return""===e.replace(ep,"")}const ip=op(1),rp=op(-1),sp=[];function op(e){return function(t,n,i){const r=t?t.children:sp;let s=(n||0)+e,o=r[s];if(!i)for(;o&&tp(o);)s+=e,o=r[s];return o}}const ap={}.hasOwnProperty;function lp(e){return function(t,n,i){return ap.call(e,t.tagName)&&e[t.tagName](t,n,i)}}const cp=lp({body:function(e,t,n){const i=ip(n,t);return!i||"comment"!==i.type},caption:dp,colgroup:dp,dd:function(e,t,n){const i=ip(n,t);return!i||"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName)},dt:function(e,t,n){const i=ip(n,t);return Boolean(i&&"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName))},head:dp,html:function(e,t,n){const i=ip(n,t);return!i||"comment"!==i.type},li:function(e,t,n){const i=ip(n,t);return!i||"element"===i.type&&"li"===i.tagName},optgroup:function(e,t,n){const i=ip(n,t);return!i||"element"===i.type&&"optgroup"===i.tagName},option:function(e,t,n){const i=ip(n,t);return!i||"element"===i.type&&("option"===i.tagName||"optgroup"===i.tagName)},p:function(e,t,n){const i=ip(n,t);return i?"element"===i.type&&("address"===i.tagName||"article"===i.tagName||"aside"===i.tagName||"blockquote"===i.tagName||"details"===i.tagName||"div"===i.tagName||"dl"===i.tagName||"fieldset"===i.tagName||"figcaption"===i.tagName||"figure"===i.tagName||"footer"===i.tagName||"form"===i.tagName||"h1"===i.tagName||"h2"===i.tagName||"h3"===i.tagName||"h4"===i.tagName||"h5"===i.tagName||"h6"===i.tagName||"header"===i.tagName||"hgroup"===i.tagName||"hr"===i.tagName||"main"===i.tagName||"menu"===i.tagName||"nav"===i.tagName||"ol"===i.tagName||"p"===i.tagName||"pre"===i.tagName||"section"===i.tagName||"table"===i.tagName||"ul"===i.tagName):!n||!("element"===n.type&&("a"===n.tagName||"audio"===n.tagName||"del"===n.tagName||"ins"===n.tagName||"map"===n.tagName||"noscript"===n.tagName||"video"===n.tagName))},rp:hp,rt:hp,tbody:function(e,t,n){const i=ip(n,t);return!i||"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName)},td:up,tfoot:function(e,t,n){return!ip(n,t)},th:up,thead:function(e,t,n){const i=ip(n,t);return Boolean(i&&"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName))},tr:function(e,t,n){const i=ip(n,t);return!i||"element"===i.type&&"tr"===i.tagName}});function dp(e,t,n){const i=ip(n,t,!0);return!i||"comment"!==i.type&&!("text"===i.type&&tp(i.value.charAt(0)))}function hp(e,t,n){const i=ip(n,t);return!i||"element"===i.type&&("rp"===i.tagName||"rt"===i.tagName)}function up(e,t,n){const i=ip(n,t);return!i||"element"===i.type&&("td"===i.tagName||"th"===i.tagName)}const pp=lp({body:function(e){const t=ip(e,-1,!0);return!(t&&("comment"===t.type||"text"===t.type&&tp(t.value.charAt(0))||"element"===t.type&&("meta"===t.tagName||"link"===t.tagName||"script"===t.tagName||"style"===t.tagName||"template"===t.tagName)))},colgroup:function(e,t,n){const i=rp(n,t),r=ip(e,-1,!0);return!(n&&i&&"element"===i.type&&"colgroup"===i.tagName&&cp(i,n.children.indexOf(i),n))&&Boolean(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const n=e.children[0];return!n||"element"===n.type},html:function(e){const t=ip(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){const i=rp(n,t),r=ip(e,-1);return(!n||!i||"element"!==i.type||"thead"!==i.tagName&&"tbody"!==i.tagName||!cp(i,n.children.indexOf(i),n))&&Boolean(r&&"element"===r.type&&"tr"===r.tagName)}}),mp={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function fp(e,t,n){const i=function(e,t){const n=tu(t);let i=t,r=nu;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Ku.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Xu,Qu);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Xu.test(e)){let n=e.replace(Yu,Ju);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}r=pu}return new r(i,t)}(e.schema,t),r=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,s=e.settings.allowDangerousCharacters?0:1;let o,a=e.quote;if(!i.overloadedBoolean||n!==i.attribute&&""!==n?!i.boolean&&!i.overloadedBoolean||"string"==typeof n&&n!==i.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=Fu(i.attribute,Object.assign({},e.settings.characterReferences,{subset:mp.name[r][s]}));return!0===n?l:(n=Array.isArray(n)?(i.commaSeparated?Wu:Zu)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n?l:(e.settings.preferUnquoted&&(o=Fu(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:mp.unquoted[r][s]}))),o!==n&&(e.settings.quoteSmart&&Uu(n,a)>Uu(n,e.alternative)&&(a=e.alternative),o=a+Fu(n,Object.assign({},e.settings.characterReferences,{subset:("'"===a?mp.single:mp.double)[r][s],attribute:!0}))+a),l+(o?"="+o:o)))}const _p=["<","&"];function gp(e,t,n,i){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?Fu(e.value,Object.assign({},i.settings.characterReferences,{subset:_p})):e.value}const bp=function(e,t){const n=t||{};function i(t,...n){let r=i.invalid;const s=i.handlers;if(t&&Mu.call(t,e)){const n=String(t[e]);r=Mu.call(s,n)?s[n]:i.unknown}if(r)return r.call(this,t,...n)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,n,i){return i.settings.bogusComments?"<?"+Fu(e.value,Object.assign({},i.settings.characterReferences,{subset:Gu}))+">":"\x3c!--"+e.value.replace($u,function(e){return Fu(e,Object.assign({},i.settings.characterReferences,{subset:Vu}))})+"--\x3e"},doctype:function(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,i){const r=i.schema,s="svg"!==r.space&&i.settings.omitOptionalTags;let o="svg"===r.space?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;"html"===r.space&&"svg"===e.tagName&&(i.schema=Cu);const c=function(e,t){const n=[];let i,r=-1;if(t)for(i in t)if(null!==t[i]&&void 0!==t[i]){const r=fp(e,i,t[i]);r&&n.push(r)}for(;++r<n.length;){const t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&'"'!==t&&"'"!==t&&(n[r]+=" ")}return n.join("")}(i,e.properties),d=i.all("html"===r.space&&"template"===e.tagName?e.content:e);return i.schema=r,d&&(o=!1),!c&&s&&pp(e,t,n)||(a.push("<",e.tagName,c?" "+c:""),o&&("svg"===r.space||i.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!i.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&a.push(" "),a.push("/")),a.push(">")),a.push(d),o||s&&cp(e,t,n)||a.push("</"+e.tagName+">"),a.join("")},raw:function(e,t,n,i){return i.settings.allowDangerousHtml?e.value:gp(e,0,n,i)},root:function(e,t,n,i){return i.all(e)},text:gp}}),yp={},vp={},wp=[];function xp(e,t,n){return bp(e,t,n,this)}function kp(e){const t=[],n=e&&e.children||wp;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}function Sp(e,t){const n="string"==typeof e?{}:{...e.colorReplacements},i="string"==typeof e?e:e.name;for(const[e,r]of Object.entries(t?.colorReplacements||{}))"string"==typeof r?n[e]=r:e===i&&Object.assign(n,r);return n}function Cp(e,t){return e&&t?.[e?.toLowerCase()]||e}async function Mp(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function zp(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ap(e){return"ansi"===e||zp(e)}function Tp(e){return"none"===e}function Pp(e){return Tp(e)}function Np(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Op(e,t=!1){const n=e.split(/(\r?\n)/g);let i=0;const r=[];for(let e=0;e<n.length;e+=2){const s=t?n[e]+(n[e+1]||""):n[e];r.push([s,i]),i+=n[e].length,i+=n[e+1]?.length||0}return r}const Rp="light-dark()",Lp=["color","background-color"];function Ep(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Xd.Italic&&(t["font-style"]="italic"),e.fontStyle&Xd.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Xd.Underline&&n.push("underline"),e.fontStyle&Xd.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Dp(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}const Ip=new WeakMap;function Bp(e,t){Ip.set(e,t)}function jp(e){return Ip.get(e)}class qp{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new qp(Object.fromEntries((n=t,Array.isArray(n)?n:[n]).map(e=>[e,Jh])),e);var n}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,i]=e;this.lang=n,this._stacks={[i]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return function(e){const t=[],n=new Set;return function e(i){if(n.has(i))return;n.add(i);const r=i?.nameScopesList?.scopeName;r&&t.push(r),i.parent&&e(i.parent)}(e),t}(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Hp(){const e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new Rd(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...i.indexToPos(e),offset:e}}{const t=i.lines[e.line];if(void 0===t)throw new Rd(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${i.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Rd(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:i.posToIndex(e.line,n)}}};const i=function(e){const t=Op(e,!0).map(([e])=>e);return{lines:t,indexToPos:function(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=n,r=0;for(const e of t){if(i<e.length)break;i-=e.length,r++}return{line:r,character:i}},posToIndex:function(e,n){let i=0;for(let n=0;n<e;n++)i+=t[n].length;return i+=n,i}}}(t.source),r=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));!function(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Rd(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const t=e[i],r=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,s=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,a=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(r||s||o||a){if(r&&s)continue;if(o&&a)continue;if(o&&n.start.offset===n.end.offset)continue;if(s&&t.start.offset===t.end.offset)continue;throw new Rd(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}(r),e.set(t.meta,{decorations:r,converter:i,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){if(!this.options.decorations?.length)return;const n=function(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{const t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?function(e,t){let n=0;const i=[];for(const r of t)r>n&&i.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}(e,t):e})):e}(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]));return n},code(e){if(!this.options.decorations?.length)return;const n=t(this),i=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(i.length!==n.converter.lines.length)throw new Rd(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function r(e,t,n,r){const s=i[e];let a="",l=-1,c=-1;if(0===t&&(l=0),0===n&&(c=0),n===Number.POSITIVE_INFINITY&&(c=s.children.length),-1===l||-1===c)for(let e=0;e<s.children.length;e++)a+=Fp(s.children[e]),-1===l&&a.length===t&&(l=e+1),-1===c&&a.length===n&&(c=e+1);if(-1===l)throw new Rd(`Failed to find start index for decoration ${JSON.stringify(r.start)}`);if(-1===c)throw new Rd(`Failed to find end index for decoration ${JSON.stringify(r.end)}`);const d=s.children.slice(l,c);if(r.alwaysWrap||d.length!==s.children.length)if(r.alwaysWrap||1!==d.length||"element"!==d[0].type){const e={type:"element",tagName:"span",properties:{},children:d};o(e,r,"wrapper"),s.children.splice(l,d.length,e)}else o(d[0],r,"token");else o(s,r,"line")}function s(e,t){i[e]=o(i[e],t,"line")}function o(e,t,n){const i=t.properties||{},r=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...i,class:e.properties.class},t.properties?.class&&Np(e,t.properties.class),r(e,n)||e}const a=[],l=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(const e of l){const{start:t,end:n}=e;if(t.line===n.line)r(t.line,t.character,n.character,e);else if(t.line<n.line){r(t.line,t.character,Number.POSITIVE_INFINITY,e);for(let i=t.line+1;i<n.line;i++)a.unshift(()=>s(i,e));r(n.line,0,n.character,e)}}a.forEach(e=>e())}}}function Fp(e){return"text"===e.type?e.value:"element"===e.type?e.children.map(Fp).join(""):""}const $p=[Hp()];function Gp(e){const t=function(e){const t=[],n=[],i=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...$p]}var Vp=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Up={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Wp(e,t){const n=e.indexOf("",t);if(-1!==n&&"["===e[n+1]){const t=e.indexOf("m",n);if(-1!==t)return{sequence:e.substring(n+2,t).split(";"),startPosition:n,position:t+1}}return{position:e.length}}function Yp(e){const t=e.shift();if("2"===t){const t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){const t=e.shift();if(t)return{type:"table",index:Number(t)}}}function Xp(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(0===i)t.push({type:"resetAll"});else if(i<=9)Up[i]&&t.push({type:"setDecoration",value:Up[i]});else if(i<=29){const e=Up[i-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Vp[i-30]}});else if(38===i){const n=Yp(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===i)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Vp[i-40]}});else if(48===i){const n=Yp(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===i?t.push({type:"resetBackgroundColor"}):53===i?t.push({type:"setDecoration",value:"overline"}):55===i?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Vp[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Vp[i-100+8]}})}return t}var Kp={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Jp(e=Kp){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}let i;return{value:function(e){switch(e.type){case"named":return t(e.name);case"rgb":return n(e.rgb);case"table":return r=e.index,function(){if(i)return i;i=[];for(let e=0;e<Vp.length;e++)i.push(t(Vp[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let r=0;r<6;r++)for(let s=0;s<6;s++)i.push(n([e[t],e[r],e[s]]));let r=8;for(let e=0;e<24;e++,r+=10)i.push(n([r,r,r]));return i}()[r]}var r}}}function Qp(e,t,n={}){const{lang:i="text",theme:r=e.getLoadedThemes()[0]}=n;if(zp(i)||Tp(r))return Op(t).map(e=>[{content:e[0],offset:e[1]}]);const{theme:s,colorMap:o}=e.setTheme(r);if("ansi"===i)return function(e,t,n){const i=Sp(e,n),r=Op(t),s=Jp(Object.fromEntries(Vp.map(t=>[t,e.colors?.[`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`]]))),o=function(){let e=null,t=null,n=new Set;return{parse(i){const r=[];let s=0;do{const o=Wp(i,s),a=o.sequence?i.substring(s,o.startPosition):i.substring(s);if(a.length>0&&r.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const i=Xp(o.sequence);for(const r of i)"resetAll"===r.type?(e=null,t=null,n.clear()):"resetForegroundColor"===r.type?e=null:"resetBackgroundColor"===r.type?t=null:"resetDecoration"===r.type&&n.delete(r.value);for(const r of i)"setForegroundColor"===r.type?e=r.value:"setBackgroundColor"===r.type?t=r.value:"setDecoration"===r.type&&n.add(r.value)}s=o.position}while(s<i.length);return r}}}();return r.map(t=>o.parse(t[0]).map(n=>{let r,o;n.decorations.has("reverse")?(r=n.background?s.value(n.background):e.bg,o=n.foreground?s.value(n.foreground):e.fg):(r=n.foreground?s.value(n.foreground):e.fg,o=n.background?s.value(n.background):void 0),r=Cp(r,i),o=Cp(o,i),n.decorations.has("dim")&&(r=function(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t){if(t[3]){const e=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${e}`}return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(e=>`${e}${e}`).join("")}80`}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}(r));let a=Xd.None;return n.decorations.has("bold")&&(a|=Xd.Bold),n.decorations.has("italic")&&(a|=Xd.Italic),n.decorations.has("underline")&&(a|=Xd.Underline),n.decorations.has("strikethrough")&&(a|=Xd.Strikethrough),{content:n.value,offset:t[1],color:r,bgColor:o,fontStyle:a}}))}(s,t,n);const a=e.getLanguage(i);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Rd(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Rd(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return function(e,t,n,i,r){const s=Zp(e,t,n,i,r),o=new qp(Zp(e,t,n,i,r).stateStack,t.name,n.name);return Bp(s.tokens,o),s.tokens}(t,a,s,o,n)}function Zp(e,t,n,i,r){const s=Sp(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=r,l=Op(e);let c=r.grammarState?function(e,t){if(!(e instanceof qp))throw new Rd("Invalid grammar state");return e.getInternalStack(t)}(r.grammarState,n.name)??Jh:null!=r.grammarContextCode?Zp(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Jh,d=[];const h=[];for(let e=0,u=l.length;e<u;e++){const[u,p]=l[e];if(""===u){d=[],h.push([]);continue}if(o>0&&u.length>=o){d=[],h.push([{content:u,offset:p,color:"",fontStyle:0}]);continue}let m,f,_;r.includeExplanation&&(m=t.tokenizeLine(u,c,a),f=m.tokens,_=0);const g=t.tokenizeLine2(u,c,a),b=g.tokens.length/2;for(let e=0;e<b;e++){const t=g.tokens[2*e],o=e+1<b?g.tokens[2*e+2]:u.length;if(t===o)continue;const a=g.tokens[2*e+1],l=Cp(i[eh.getForeground(a)],s),c=eh.getFontStyle(a),h={content:u.substring(t,o),offset:p+t,color:l,fontStyle:c};if(r.includeExplanation){const e=[];if("scopeName"!==r.includeExplanation)for(const t of n.settings){let n;switch(typeof t.scope){case"string":n=t.scope.split(/,/).map(e=>e.trim());break;case"object":n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}h.explanation=[];let i=0;for(;t+i<o;){const t=f[_],n=u.substring(t.startIndex,t.endIndex);i+=n.length,h.explanation.push({content:n,scopes:"scopeName"===r.includeExplanation?em(t.scopes):tm(e,t.scopes)}),_+=1}}d.push(h)}h.push(d),d=[],c=g.ruleStack}return{tokens:h,stateStack:c}}function em(e){return e.map(e=>({scopeName:e}))}function tm(e,t){const n=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];n[i]={scopeName:r,themeMatches:rm(e,r,t.slice(0,i))}}return n}function nm(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function im(e,t,n){if(!nm(e[e.length-1],t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)nm(e[i],n[r])&&(i-=1),r-=1;return-1===i}function rm(e,t,n){const i=[];for(const{selectors:r,settings:s}of e)for(const e of r)if(im(e,t,n)){i.push(s);break}return i}function sm(e,t,n){const i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),r=i.map(i=>{const r=Qp(e,t,{...n,theme:i.theme});return{tokens:r,state:jp(r),theme:"string"==typeof i.theme?i.theme:i.theme.name}}),s=function(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const r=e.map(e=>e[i]),s=t.map(()=>[]);t.forEach((e,t)=>e.push(s[t]));const o=r.map(()=>0),a=r.map(e=>e[0]);for(;a.every(e=>e);){const e=Math.min(...a.map(e=>e.content.length));for(let t=0;t<n;t++){const n=a[t];n.content.length===e?(s[t].push(n),o[t]+=1,a[t]=r[t][o[t]]):(s[t].push({...n,content:n.content.slice(0,e)}),a[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}(...r.map(e=>e.tokens)),o=s[0].map((e,t)=>e.map((e,r)=>{const o={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in n&&n.includeExplanation&&(o.explanation=e.explanation),s.forEach((e,n)=>{const{content:s,explanation:a,offset:l,...c}=e[t][r];o.variants[i[n].color]=c}),o})),a=r[0].state?new qp(Object.fromEntries(r.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),r[0].state.lang):void 0;return a&&Bp(o,a),o}function om(e,t,n){let i,r,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:h="css-vars"}=n,u=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===c?-1:t.color===c?1:0);if(0===u.length)throw new Rd("`themes` option must not be empty");const p=sm(e,t,n);if(l=jp(p),c&&Rp!==c&&!u.find(e=>e.color===c))throw new Rd(`\`themes\` option must contain the defaultColor key \`${c}\``);const m=u.map(t=>e.getTheme(t.theme)),f=u.map(e=>e.color);s=p.map(e=>e.map(e=>function(e,t,n,i,r="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Ep(e.variants[t])),a=new Set(o.flatMap(e=>Object.keys(e))),l={},c=(e,i)=>{const r="color"===i?"":"background-color"===i?"-bg":`-${i}`;return n+t[e]+("color"===i?"":r)};return o.forEach((e,n)=>{for(const s of a){const a=e[s]||"inherit";if(0===n&&i&&Lp.includes(s))if(i===Rp&&o.length>1){const e=t.findIndex(e=>"light"===e),i=t.findIndex(e=>"dark"===e);if(-1===e||-1===i)throw new Rd('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=o[e][s]||"inherit",h=o[i][s]||"inherit";l[s]=`light-dark(${d}, ${h})`,"css-vars"===r&&(l[c(n,s)]=a)}else l[s]=a;else"css-vars"===r&&(l[c(n,s)]=a)}}),s.htmlStyle=l,s}(e,f,d,c,h))),l&&Bp(s,l);const _=u.map(e=>Sp(e.theme,n));r=am(u,m,_,d,c,"fg",h),i=am(u,m,_,d,c,"bg",h),o=`shiki-themes ${m.map(e=>e.name).join(" ")}`,a=c?void 0:[r,i].join(";")}else{if(!("theme"in n))throw new Rd("Invalid options, either `theme` or `themes` must be provided");{const a=Sp(n.theme,n);s=Qp(e,t,n);const c=e.getTheme(n.theme);i=Cp(c.bg,a),r=Cp(c.fg,a),o=c.name,l=jp(s)}}return{tokens:s,fg:r,bg:i,themeName:o,rootStyle:a,grammarState:l}}function am(e,t,n,i,r,s,o){return e.map((a,l)=>{const c=Cp(t[l][s],n[l])||"inherit",d=`${i+a.color}${"bg"===s?"-bg":""}:${c}`;if(0===l&&r){if(r===Rp&&e.length>1){const i=e.findIndex(e=>"light"===e.color),r=e.findIndex(e=>"dark"===e.color);if(-1===i||-1===r)throw new Rd('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Cp(t[i][s],n[i])||"inherit"}, ${Cp(t[r][s],n[r])||"inherit"});${d}`}return c}return"css-vars"===o?d:null}).filter(e=>!!e).join(";")}function lm(e,t,n,i={meta:{},options:n,codeToHast:(t,n)=>lm(e,t,n),codeToTokens:(t,n)=>om(e,t,n)}){let r=t;for(const e of Gp(n))r=e.preprocess?.call(i,r,n)||r;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:d}=om(e,r,n);const{mergeWhitespaces:h=!0,mergeSameStyleTokens:u=!1}=n;!0===h?s=function(e){return e.map(e=>{const t=[];let n="",i=0;return e.forEach((r,s)=>{const o=!(r.fontStyle&&(r.fontStyle&Xd.Underline||r.fontStyle&Xd.Strikethrough));o&&r.content.match(/^\s+$/)&&e[s+1]?(i||(i=r.offset),n+=r.content):n?(o?t.push({...r,offset:i,content:n+r.content}):t.push({content:n,offset:i},r),i=0,n=""):t.push(r)}),t})}(s):"never"===h&&(s=function(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;const t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;const[,n,i,r]=t;if(!n&&!r)return e;const s=[{...e,offset:e.offset+n.length,content:i}];return n&&s.unshift({content:n,offset:e.offset}),r&&s.push({content:r,offset:e.offset+n.length+i.length}),s}))}(s)),u&&(s=function(e){return e.map(e=>{const t=[];for(const n of e){if(0===t.length){t.push({...n});continue}const e=t[t.length-1],i=Dp(e.htmlStyle||Ep(e)),r=Dp(n.htmlStyle||Ep(n)),s=e.fontStyle&&(e.fontStyle&Xd.Underline||e.fontStyle&Xd.Strikethrough),o=n.fontStyle&&(n.fontStyle&Xd.Underline||n.fontStyle&Xd.Strikethrough);s||o||i!==r?t.push({...n}):e.content+=n.content}return t})}(s));const p={...i,get source(){return r}};for(const e of Gp(n))s=e.tokens?.call(p,s)||s;return function(e,t,n,i=jp(e)){const r=Gp(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t;let c={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...!1!==l&&null!=l?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([e])=>!e.startsWith("_")))},children:[]},d={type:"element",tagName:"code",properties:{},children:s};const h=[],u={...n,structure:a,addClassToHast:Np,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return c},get code(){return d},get lines(){return h}};if(e.forEach((e,t)=>{t&&("inline"===a?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===a&&s.push({type:"text",value:"\n"}));let n={type:"element",tagName:"span",properties:{class:"line"},children:[]},i=0;for(const s of e){let e={type:"element",tagName:"span",properties:{...s.htmlAttrs},children:[{type:"text",value:s.content}]};const l=Dp(s.htmlStyle||Ep(s));l&&(e.properties.style=l);for(const o of r)e=o?.span?.call(u,e,t+1,i,n,s)||e;"inline"===a?o.children.push(e):"classic"===a&&n.children.push(e),i+=s.content.length}if("classic"===a){for(const e of r)n=e?.line?.call(u,n,t+1)||n;h.push(n),s.push(n)}}),"classic"===a){for(const e of r)d=e?.code?.call(u,d)||d;c.children.push(d);for(const e of r)c=e?.pre?.call(u,c)||c;o.children.push(c)}let p=o;for(const e of r)p=e?.root?.call(u,p)||p;return i&&Bp(p,i),p}(s,{...n,fg:o,bg:a,themeName:l,rootStyle:c},p,d)}function cm(e,t,n){const i={meta:{},options:n,codeToHast:(t,n)=>lm(e,t,n),codeToTokens:(t,n)=>om(e,t,n)};let r=function(e,t){const n=t||yp,i=n.quote||'"',r='"'===i?"'":'"';if('"'!==i&&"'"!==i)throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:xp,all:kp,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Qh,characterReferences:n.characterReferences||vp,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?Cu:Su,quote:i,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}(lm(e,t,n,i));for(const e of Gp(n))r=e.postprocess?.call(i,r,n)||r;return r}const dm="__shiki_resolved";function hm(e){if(e?.[dm])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(i=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i="light"===t.type?"#333333":"#bbbbbb"),n||(n="light"===t.type?"#fffffe":"#1e1e1e"),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const s=new Map;function o(e){if(s.has(e))return s.get(e);r+=1;const n=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(s.set(e,n),n)}t.settings=t.settings.map(e=>{const n=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),i=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!i)return e;const r={...e,settings:{...e.settings}};if(n){const n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,r.settings.foreground=n}if(i){const n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,r.settings.background=n}return r});for(const e of Object.keys(t.colors||{}))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){const n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,dm,{enumerable:!1,writable:!1,value:!0}),t}async function um(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Ap(e)).map(async e=>await Mp(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function pm(e){return(await Promise.all(e.map(async e=>Pp(e)?null:hm(await Mp(e))))).filter(e=>!!e)}class mm extends Error{constructor(e){super(e),this.name="ShikiError"}}class fm extends Kh{constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=hm(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Gd.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){if(this._alias[e]){const t=new Set([e]);for(;this._alias[e];){if(e=this._alias[e],t.has(e))throw new mm(`Circular alias \`${Array.from(t).join(" -> ")} -> ${e}\``);t.add(e)}}return this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(const e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const t of e)this.resolveEmbeddedLanguages(t);const t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){const e=t.filter(([e,t])=>t&&t.embeddedLangs?.some(e=>n.map(([e])=>e).includes(e))).filter(e=>!n.includes(e));throw new mm(`Missing languages ${n.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(const[e,n]of t)this._resolver.addLanguage(n);for(const[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){if(this._langMap.set(e.name,e),this._langGraph.set(e.name,e),e.embeddedLangs)for(const t of e.embeddedLangs)this._langGraph.set(t,this._langMap.get(t))}}class _m{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let e=1;e<=t.length;e++){const i=t.slice(0,e).join(".");n=[...n,...this._injections.get(i)||[]]}return n}}let gm=0;async function bm(e){e.engine||function(e,t=3){t>3||console.trace(`[SHIKI DEPRECATE]: ${e}`)}("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([pm(e.themes||[]),um(e.langs||[]),e.engine]);return function(e){gm+=1,!1!==e.warnings&&gm>=10&&gm%10==0&&console.warn(`[Shiki] ${gm} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new mm("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(hm),r=new _m(e.engine,n),s=new fm(r,i,n,e.langAlias);let o;function a(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};d();const t=s.getTheme(e);if(!t)throw new mm(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(...e){d(),s.loadLanguages(e.flat(1))}function c(...e){d();for(const t of e.flat(1))s.loadTheme(t)}function d(){if(t)throw new mm("Shiki instance has been disposed")}function h(){t||(t=!0,s.dispose(),gm-=1)}return{setTheme:function(e){d();const t=a(e);return o!==e&&(s.setTheme(t),o=e),{theme:t,colorMap:s.getColorMap()}},getTheme:a,getLanguage:function(e){d();const t=s.getGrammar("string"==typeof e?e:e.name);if(!t)throw new mm(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return d(),s.getLoadedThemes()},getLoadedLanguages:function(){return d(),s.getLoadedLanguages()},loadLanguage:async function(...e){return l(await um(e))},loadLanguageSync:l,loadTheme:async function(...e){return d(),c(await pm(e))},loadThemeSync:c,dispose:h,[Symbol.dispose]:h}}({...e,themes:t,langs:n,engine:i})}async function ym(e){const t=await bm(e);return{getLastGrammarState:(...e)=>function(...e){if(2===e.length)return jp(e[1]);const[t,n,i={}]=e,{lang:r="text",theme:s=t.getLoadedThemes()[0]}=i;if(zp(r)||Tp(s))throw new Rd("Plain language does not have grammar state");if("ansi"===r)throw new Rd("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(r);return new qp(Zp(n,l,o,a,i).stateStack,l.name,o.name)}(t,...e),codeToTokensBase:(e,n)=>Qp(t,e,n),codeToTokensWithThemes:(e,n)=>sm(t,e,n),codeToTokens:(e,n)=>om(t,e,n),codeToHast:(e,n)=>lm(t,e,n),codeToHtml:(e,n)=>cm(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function vm(e){const t=e.langs,n=e.themes,i=e.engine;return async function(e){function r(n){if("string"==typeof n){if(Ap(n))return[];n=e.langAlias?.[n]||n;const i=t[n];if(!i)throw new Rd(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return i}return n}function s(e){if(Pp(e))return"none";if("string"==typeof e){const t=n[e];if(!t)throw new Rd(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}const o=(e.themes??[]).map(e=>s(e)),a=(e.langs??[]).map(e=>r(e)),l=await ym({engine:e.engine??i(),...e,themes:o,langs:a});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(r)),loadTheme:(...e)=>l.loadTheme(...e.map(s)),getBundledLanguages:()=>t,getBundledThemes:()=>n}}}function wm(e,t){const n=function(e){let t;return async function(n={}){if(t){const e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}return t=e({...n,themes:n.themes||[],langs:n.langs||[]}),t}}(e);async function i(e,i){const r=await n({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),s=await(t?.guessEmbeddedLanguages?.(e,i.lang,r));return s&&await r.loadLanguage(...s),r}return{getSingletonHighlighter:e=>n(e),codeToHtml:async(e,t)=>(await i(e,t)).codeToHtml(e,t),codeToHast:async(e,t)=>(await i(e,t)).codeToHast(e,t),codeToTokens:async(e,t)=>(await i(e,t)).codeToTokens(e,t),codeToTokensBase:async(e,t)=>(await i(e,t)).codeToTokensBase(e,t),codeToTokensWithThemes:async(e,t)=>(await i(e,t)).codeToTokensWithThemes(e,t),getLastGrammarState:async(e,t)=>(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}class xm extends Error{constructor(e){super(e),this.name="ShikiError"}}function km(){return"undefined"!=typeof performance?performance.now():Date.now()}const Sm=(e,t)=>e+(t-e%t)%t;var Cm=Object.defineProperty,Mm=(e,t,n)=>((e,t,n)=>t in e?Cm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let zm=null;class Am{constructor(e){Mm(this,"utf16Length"),Mm(this,"utf8Length"),Mm(this,"utf16Value"),Mm(this,"utf8Value"),Mm(this,"utf16OffsetToUtf8"),Mm(this,"utf8OffsetToUtf16");const t=e.length,n=Am._utf8ByteLength(e),i=n!==t,r=i?new Uint32Array(t+1):null;i&&(r[t]=n);const s=i?new Uint32Array(n+1):null;i&&(s[n]=t);const o=new Uint8Array(n);let a=0;for(let n=0;n<t;n++){const l=e.charCodeAt(n);let c=l,d=!1;if(l>=55296&&l<=56319&&n+1<t){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(c=65536+(l-55296<<10)|t-56320,d=!0)}i&&(r[n]=a,d&&(r[n+1]=a),c<=127?s[a+0]=n:c<=2047?(s[a+0]=n,s[a+1]=n):c<=65535?(s[a+0]=n,s[a+1]=n,s[a+2]=n):(s[a+0]=n,s[a+1]=n,s[a+2]=n,s[a+3]=n)),c<=127?o[a++]=c:c<=2047?(o[a++]=192|(1984&c)>>>6,o[a++]=128|(63&c)>>>0):c<=65535?(o[a++]=224|(61440&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0):(o[a++]=240|(1835008&c)>>>18,o[a++]=128|(258048&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0),d&&n++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=o,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let t=0;for(let n=0,i=e.length;n<i;n++){const r=e.charCodeAt(n);let s=r,o=!1;if(r>=55296&&r<=56319&&n+1<i){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(s=65536+(r-55296<<10)|t-56320,o=!0)}t+=s<=127?1:s<=2047?2:s<=65535?3:4,o&&n++}return t}createString(e){const t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}const Tm=class e{constructor(t){if(Mm(this,"id",++e.LAST_ID),Mm(this,"_onigBinding"),Mm(this,"content"),Mm(this,"utf16Length"),Mm(this,"utf8Length"),Mm(this,"utf16OffsetToUtf8"),Mm(this,"utf8OffsetToUtf16"),Mm(this,"ptr"),!zm)throw new xm("Must invoke loadWasm first.");this._onigBinding=zm,this.content=t;const n=new Am(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=zm.omalloc(1e4)),e._sharedPtrInUse=!0,zm.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(zm)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Mm(Tm,"LAST_ID",0),Mm(Tm,"_sharedPtr",0),Mm(Tm,"_sharedPtrInUse",!1);let Pm,Nm=Tm;class Om{constructor(e){if(Mm(this,"_onigBinding"),Mm(this,"_ptr"),!zm)throw new xm("Must invoke loadWasm first.");const t=[],n=[];for(let i=0,r=e.length;i<r;i++){const r=new Am(e[i]);t[i]=r.createString(zm),n[i]=r.utf8Length}const i=zm.omalloc(4*e.length);zm.HEAPU32.set(t,i/4);const r=zm.omalloc(4*e.length);zm.HEAPU32.set(n,r/4);const s=zm.createOnigScanner(i,r,e.length);for(let n=0,i=e.length;n<i;n++)zm.ofree(t[n]);zm.ofree(r),zm.ofree(i),0===s&&function(e){throw new xm(e.UTF8ToString(e.getLastOnigError()))}(zm),this._onigBinding=zm,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let i=0;if("number"==typeof n&&(i=n),"string"==typeof e){e=new Nm(e);const n=this._findNextMatchSync(e,t,!1,i);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,i)}_findNextMatchSync(e,t,n,i){const r=this._onigBinding,s=r.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),i);if(0===s)return null;const o=r.HEAPU32;let a=s/4;const l=o[a++],c=o[a++],d=[];for(let t=0;t<c;t++){const n=e.convertUtf8OffsetToUtf16(o[a++]),i=e.convertUtf8OffsetToUtf16(o[a++]);d[t]={start:n,end:i,length:i-n}}return{index:l,captureIndices:d}}}function Rm(e){return Pm||(Pm=async function(){zm=await async function(e){let t,n;const i={};function r(e){n=e,i.HEAPU8=new Uint8Array(e),i.HEAPU32=new Uint32Array(e)}function s(e){try{return t.grow(e-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}const o="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(e,t){return e?function(e,t,n=1024){const i=t+n;let r=t;for(;e[r]&&!(r>=i);)++r;if(r-t>16&&e.buffer&&o)return o.decode(e.subarray(t,r));let s="";for(;t<r;){let n=e[t++];if(!(128&n)){s+=String.fromCharCode(n);continue}const i=63&e[t++];if(192==(224&n)){s+=String.fromCharCode((31&n)<<6|i);continue}const r=63&e[t++];if(n=224==(240&n)?(15&n)<<12|i<<6|r:(7&n)<<18|i<<12|r<<6|63&e[t++],n<65536)s+=String.fromCharCode(n);else{const e=n-65536;s+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return s}(i.HEAPU8,e,t):""}const l={emscripten_get_now:km,emscripten_memcpy_big:function(e,t,n){i.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){const t=i.HEAPU8.length,n=2147483648;if((e>>>=0)>n)return!1;for(let i=1;i<=4;i*=2){let r=t*(1+.2/i);if(r=Math.min(r,e+100663296),s(Math.min(n,Sm(Math.max(e,r),65536))))return!0}return!1},fd_write:()=>0};return await async function(){const n={env:l,wasi_snapshot_preview1:l},s=await e(n);t=s.memory,r(t.buffer),Object.assign(i,s),i.UTF8ToString=a}(),i}(async t=>{let n=e;var i;return n=await n,"function"==typeof n&&(n=await n(t)),"function"==typeof n&&(n=await n(t)),"function"==typeof n.instantiator?n=await n.instantiator(t):"function"!=typeof n.default?(function(e){return void 0!==e.data}(n)&&(n=n.data),function(e){return"undefined"!=typeof Response&&e instanceof Response}(n)?n="function"==typeof WebAssembly.instantiateStreaming?await(i=n,e=>WebAssembly.instantiateStreaming(i,e))(t):await function(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}(n)(t):function(e){return"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||"undefined"!=typeof Buffer&&Buffer.isBuffer?.(e)||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer||"undefined"!=typeof Uint32Array&&e instanceof Uint32Array}(n)||n instanceof WebAssembly.Module?n=await Lm(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await Lm(n.default)(t))):n=await n.default(t),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}(),Pm)}function Lm(e){return t=>WebAssembly.instantiate(e,t)}const Em=vm({langs:Pd,themes:Od,engine:()=>async function(e){return e&&await Rm(e),{createScanner:e=>new Om(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new Nm(e)}}(r.e(4709).then(r.bind(r,4709)))}),{codeToHtml:Dm,codeToHast:Im,codeToTokens:Bm,codeToTokensBase:jm,codeToTokensWithThemes:qm,getSingletonHighlighter:Hm,getLastGrammarState:Fm}=wm(Em,{guessEmbeddedLanguages:function(e,t,n){const i=new Set;for(const t of e.matchAll(/lang=["']([\w-]+)["']/g))i.add(t[1]);for(const t of e.matchAll(/(?:```|~~~)([\w-]+)/g))i.add(t[1]);for(const t of e.matchAll(/\\begin\{([\w-]+)\}/g))i.add(t[1]);if(!n)return Array.from(i);const r=n.getBundledLanguages();return Array.from(i).filter(e=>e&&r[e])}}),$m=["id","data-type"],Gm=["data-id","onClick"],Vm=["innerHTML"],Um=["disabled"],Wm=Pn({__name:"cube-code",props:{cube:{}},setup(e){const{root:t}=e.cube,{stats:i}=t,r=Wt(),s=Wt(),o=Wt(),a=Wt();function l(e){if(!e._draglist)return;const t=e._draglist.init();return e.items.length>0&&t<=0?requestAnimationFrame(()=>l(e)):void 0}function c(){const t=e.cube._draglist;if(!t)return;const n=e.cube.get_upstream_sum_scale();t.scale_h=n.sx,t.scale_v=n.sy}function d(){const t=r.value,n=o.value;t&&n&&(e.cube._draglist=new us.DragList(t,"horizental","data-id","insert"),c(),e.cube._draglist.register_start(c),l(e.cube))}let h;Xi(()=>[e.cube.active_tab_id,e.cube.active_tab?.code],()=>{const t=e.cube.active_tab,n=a.value;t&&n&&(n.value=t.code)},{immediate:!0}),Xi(()=>[e.cube.code_html],()=>{const t=e.cube.active_tab,n=a.value,i=n?.previousElementSibling;if(!t||!n||!i)return;const r=n.parentElement;fn(()=>{const t=i.nextElementSibling,n=i.firstElementChild;if(t&&n){if(r){const t=n.style.backgroundColor;if(t.startsWith("rgb")){const n=t.replace("rgb","rgba").replace(")",", 0.85)");e.cube.attrs.codebg=n}else e.cube.attrs.codebg=t;e.cube.attrs.caret=n.style.color}n.style.border="none",n.style.outline="none"}})}),Vn(()=>{d(),function(){const t=o.value,n=a.value;if(!t)return;n&&(n.value=e.cube.active_tab?.code||"");const i=s.value;if(!i)return;h=new us.DragDiff(i);let r=e.cube.attrs.width,l=e.cube.attrs.height,c=r,d=l;h.register_down(()=>{r=e.cube.attrs.width,l=e.cube.attrs.height}),h.register_move((e,n)=>{c=Math.round(e+r),d=Math.round(n+l),t.style.width=c+"px",t.style.height=d+"px"}),h.register_up((t,n)=>{if(r===c&&l===d)return;const i=e.cube.courier.get_recorder(),s=Math.round(t+r),o=Math.round(n+l);i.tell(e.cube,ds.resize(e.cube.id,s,o)),e.cube.history.record(i)}),h.register_cancel(()=>{e.cube.attrs.width=r,e.cube.attrs.height=l})}()}),Xn(()=>{h?.off()});const u=Jr(()=>({"caret-color":e.cube.attrs.caret}));function p(e){e.stopPropagation()}function m(t){const n=t.previousElementSibling;if(t.parentElement,!n)return;const i=t.value,{id:r,courier:s,history:o}=e.cube,a=e.cube.tabbar_height,l=e.cube.max_height_auto,c=s.get_recorder(),d=Md.update(r,e.cube.active_tab_id,i);c.tell(e.cube,d),fn(()=>{const n=t.scrollHeight+a;console.log("🟡",e.cube.attrs.height,t.scrollHeight,a);const i=Math.min(l,n),s=ds.set_attr(r,{height:i});c.tell(e.cube,s),o.record(c)})}function f(e){const t=e.currentTarget;t.value,m(t)}function _(e){const{hotkeys:n,clipboard:i,history:r}=t,s=e.key.toLowerCase();if([n.data[A["scope-add"]]].some(t=>n.validate(e,t)))return e.preventDefault();if(t.scope_count_normal>0&&["backspace","delete"].includes(s)){e.preventDefault(),e.stopPropagation();const t=i.delete_scope();return void(t&&r.record(t))}const o=e.currentTarget;if("tab"===s){e.preventDefault(),e.stopPropagation();let t=o.value;const n=o.selectionStart,i=o.selectionEnd;t=t.slice(0,n)+"\t"+t.slice(i),o.value=t,o.selectionStart=n+1,o.selectionEnd=n+1,m(o)}}function g(e){e.preventDefault();const t=e.currentTarget;t.scrollTop=0,t.scrollLeft=0}function b(e,t=50){e.stopPropagation();const n=e.currentTarget;e.deltaY>0?us.DomAnimation.scroll_element(n,t,"horizental"):us.DomAnimation.scroll_element(n,-t,"horizental")}function y(e){const t=e.currentTarget,n=t.firstElementChild,i=t.lastElementChild;if(!n||!i)return;const r=e.shiftKey,{scrollLeft:s,scrollTop:o,scrollWidth:a,scrollHeight:l}=t,c=t.getBoundingClientRect();e.deltaY>0?r?s+c.width<a&&(e.preventDefault(),e.stopPropagation(),us.DomAnimation.scroll_element(t,20,"horizental")):o+c.height<l&&(e.preventDefault(),e.stopPropagation(),us.DomAnimation.scroll_element(t,20,"vertical")):r?s>0&&(e.preventDefault(),e.stopPropagation(),us.DomAnimation.scroll_element(t,-20,"horizental")):o>0&&(e.preventDefault(),e.stopPropagation(),us.DomAnimation.scroll_element(t,-20,"vertical"))}function v(t){uo(t,e.cube)}return(t,l)=>(fr(),yr("div",{class:"cube-code",id:t.cube.id,"data-type":Kt(n).code,ref_key:"code",ref:o,style:fe(t.cube.css),onPointerdown:p,onBeforeinput:p,onCompositionstart:p,onContextmenu:v},[Cr("div",{class:"code-tabbar",onWheel:b},[Cr("div",{class:"code-tabs-box",ref_key:"tabsbox",ref:r},[(fr(!0),yr(cr,null,ri(t.cube.items,n=>(fr(),yr("div",{class:"code-tab","data-id":n.id,key:n.id,onClick:()=>function(t){const{courier:n,history:i}=e.cube,r=n.get_recorder();r.tell(e.cube,Md.change_active(e.cube.id,t.id)),i.record(r)}(n)},[Cr("div",{class:ve(["code-tab-name",{"code-active-tab":n.id===t.cube.active_tab_id}])},Se(n.name),3)],8,Gm))),128))],512)],32),Cr("div",{class:"code-box",onWheel:y},[Cr("div",{class:"code-box-inner",style:fe({background:t.cube.attrs.codebg})},[Cr("span",{class:"code-highlight",onWheel:l[0]||(l[0]=e=>e.preventDefault()),innerHTML:t.cube.code_html},null,40,Vm),Cr("textarea",{disabled:Kt(i).is_read_mode,ref_key:"textarea",ref:a,style:fe(u.value),onKeyup:g,onKeydown:_,autocapitalize:"false",autocomplete:"false",autocorrect:"false",spellcheck:"false",onInput:f},null,44,Um)],4)],32),Cr("div",{class:"code-dragger",ref_key:"code_dragger",ref:s},null,512)],44,$m))}}),Ym=(0,wo.A)(Wm,[["__scopeId","data-v-046389ca"]]),Xm={".py":"python",".java":"java",".c":"c",".cpp":"c++",".js":"javascript",".html":"html",".css":"css",".php":"php",".rb":"ruby",".go":"go",".swift":"swift",".kt":"kotlin",".rs":"rust",".ts":"typescript",".sh":"shell",".pl":"perl",".cs":"c#",".sql":"sql",".r":"r",".m":"matlab",".adb":"ada",".ads":"ada",".lua":"lua",".scala":"scala",".dart":"dart",".hs":"haskell",".erl":"erlang",".ex":"elixir",".jl":"julia",".groovy":"groovy",".fs":"f#",".clj":"clojure",".scm":"scheme",".ml":"ocaml",".pas":"pascal",".d":"d",".nim":"nim",".zig":"zig",".v":"v",".coffee":"coffeescript",".litcoffee":"coffeescript",".vue":"vue",".svelte":"svelte",".elm":"elm",".purs":"purescript",".exs":"elixir",".eex":"elixir",".heex":"elixir",".tcl":"tcl",".tk":"tcl",".awk":"awk",".ps1":"powershell",".psm1":"powershell",".psd1":"powershell",".bat":"batch",".cmd":"batch",".json":"json",".xml":"xml",".yaml":"yaml",".yml":"yaml",".toml":"toml",".ini":"ini",".md":"markdown",".markdown":"markdown",".tex":"latex",".sty":"latex",".cls":"latex",".bib":"bibtex",".csv":"csv",".tsv":"tsv",".log":"log"};function Km(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const Jm="dracula";class Qm extends Es{_code_html=Wt("");static _langs=[...Object.keys(Pd)];static _themes=[...Object.keys(Od)];static get langs(){return[...this._langs]}static get themes(){return[...this._themes]}constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get tabbar_height(){return 36}get max_height_auto(){return 600}get langs(){return[...Qm._langs]}get themes(){return[...Qm._themes]}_draglist;get component(){return Ym}get items(){return this.info.tabs}get active_tab_id(){return this.info.active_tab_id}set active_tab_id(e){const t=this.items.find(t=>t.id===e);t&&(this.info.active_tab_id=t.id)}get active_tab(){return this.items.find(e=>e.id===this.active_tab_id)}get code_html(){return this._code_html.value}get info(){return this.data.info}get css(){const e=this.config.data.line_indent,t=this.attrs.indent,n=this.attrs.width,i=this.attrs.height;return{...this.data.css,"margin-left":t>0?t*e+"px":"0px",width:n+"px",height:i+"px"}}get attrs(){return this.data.attrs}init(){this.update_active_code_html()}export(){return this.base_export()}gc(){super.base_gc()}build_child(e){}update_data(e,t){return Qm.update_data(e,t)}update_active_code_html(){if(0===this.items.length)this._code_html.value="";else{const e=this.active_tab;if(!e)return;this.code_to_html(e).then(e=>{this._code_html.value=e})}}code_to_html(e){return Dm(e.code,{lang:e.lang,theme:e.theme,cssVariablePrefix:"--shiki-"})}get meta(){return Qm.meta}create_tab(e,t,n=Jm){return{id:ss.get_id(),name:t,lang:e,code:"",theme:n||Jm}}replace_id(e,t={}){return Qm.replace_id(this.root,e,t)}copy_code(){const e=this.active_tab;if(!e)return ns.tips?.tip_error("当前没有激活的代码块tab");const t=e.code,n=new Blob([t],{type:"text/plain"}),i=new ClipboardItem({[n.type]:n});this.clipboard.set_clipboard_data(i).then(e=>{ns.tips?.tip_info("复制代码成功👏")})}change_lang(e){const{tabid:t,lang:n}=e,{courier:i,id:r}=this,s=i.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.lang;return o.lang=n,s.add_recover(Md.change_lang(r,t,a)),this.update_active_code_html(),s}change_theme(e){const{tabid:t,theme:n}=e,{courier:i,id:r}=this,s=i.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.theme;return o.theme=n,s.add_recover(Md.change_theme(r,t,a)),this.update_active_code_html(),s}code_update(e){const{tabid:t,code:n}=e,{courier:i,id:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.items.find(e=>e.id===t);if(!o)return;const a=o.code;return o.code=n,s.add_recover(Md.update(r,t,a)),this.update_active_code_html(),s}code_add(e){const{item:t,focus:n}=e,{courier:i,id:r}=this,s=i.get_recorder();return s.add_cmd(e),this.info.tabs.push(t),s.add_recover(Md.remove(r,t.id)),this.update_active_code_html(),n&&s.tell(this,Md.change_active(r,t.id)),fn(()=>{this._draglist?.init()}),s}code_remove(e){const{tabid:t}=e,{courier:n,id:i}=this,r=n.get_recorder();r.add_cmd(e);const s=this.items.find(e=>e.id===t);if(!s)return;const o=this.items.indexOf(s),a=this.items[o-1]||this.items[o+1];return o>=0&&this.items.splice(o,1),r.add_recover(Md.add(i,s)),a&&(this.active_tab_id=a.id),this.update_active_code_html(),fn(()=>{this._draglist?.init()}),r}code_rename(e){const{tabid:t,filename:n}=e,{courier:i,id:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.items.find(e=>e.id===t);if(!o)return;const a=o.name;return o.name=n,s.add_recover(Md.rename(r,t,a)),s}change_active(e){const{tabid:t}=e,{courier:n,id:i}=this,r=n.get_recorder(),s=this.items.find(e=>e.id===t);if(!s)return s;const o=this.active_tab_id;return this.active_tab_id=t,r.add_recover(Md.change_active(i,o)),this.update_active_code_html(),r}on_cursor_in_tail(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new cs(t),o=(this.meta,this.dom?.querySelector("textarea"));return o?.focus(),s}on_cursor_in_head(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new cs(t),o=(this.meta,this.dom?.querySelector("textarea"));return o?.focus(),s}static get meta(){return{cubename:"代码块",type:n.code,block:!0,version:1,show:!0}}static get_default(){return{id:ss.get_id(),type:n.code,info:{tabs:[],active_tab_id:""},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static get_default_by_string(e="typescript",t=""){const i={name:`code${this.get_format_from_lang(e)}`,id:ss.get_id(),code:t,lang:e,theme:"andromeeda"};return{id:ss.get_id(),type:n.code,info:{tabs:[i],active_tab_id:i.id},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,t}static get_format_from_lang(e){for(let t in Xm)if(Xm[t]===e)return t;return""}static get_lang_from_format(e){return Xm[e]}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Km([ys(g.change_lang)],Qm.prototype,"change_lang",null),Km([ys(g.change_theme)],Qm.prototype,"change_theme",null),Km([ys(g.code_update)],Qm.prototype,"code_update",null),Km([ys(g.code_add)],Qm.prototype,"code_add",null),Km([ys(g.code_remove)],Qm.prototype,"code_remove",null),Km([ys(g.code_rename)],Qm.prototype,"code_rename",null),Km([ys(g.change_active)],Qm.prototype,"change_active",null),Km([ys(o.cursor_in_tail)],Qm.prototype,"on_cursor_in_tail",null),Km([ys(o.cursor_in_head)],Qm.prototype,"on_cursor_in_head",null);const Zm=["id","data-type","innerHTML"],ef=Pn({__name:"cube-fomula",props:{cube:{}},setup(e){const{stats:t,event:i}=e.cube.root;function r(){i.emit_show_cube_editor(e.cube)}const s=Jr(()=>{let t={...e.cube.css};return e.cube.attrs.block&&(t.display="block",t["text-align"]="center"),t});return(e,t)=>(fr(),yr("span",{class:"cube-fomula",onClick:r,id:e.cube.id,"data-type":Kt(n).fomula,style:fe(s.value),innerHTML:e.cube.mathml},null,12,Zm))}}),tf=(0,wo.A)(ef,[["__scopeId","data-v-b85f3e3c"]]);class nf{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new nf(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class rf{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new rf(t,nf.range(this,e))}}class sf{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,i,r="KaTeX parse error: "+e,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;n=s.start,i=s.end,n===o.length?r+=" at end of input: ":r+=" at position "+(n+1)+": ";var a=o.slice(n,i).replace(/[^]/g,"$&̲");r+=(n>15?"…"+o.slice(n-15,n):o.slice(0,n))+a+(i+15<o.length?o.slice(i,i+15)+"…":o.slice(i))}var l=new Error(r);return l.name="ParseError",l.__proto__=sf.prototype,l.position=n,null!=n&&null!=i&&(l.length=i-n),l.rawMessage=e,l}}sf.prototype.__proto__=Error.prototype;var of=/([A-Z])/g,af={"&":"&",">":">","<":"<",'"':""","'":"'"},lf=/[&><"']/g,cf=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},df=function(e,t){return-1!==e.indexOf(t)},hf=function(e,t){return void 0===e?t:e},uf=function(e){return String(e).replace(lf,e=>af[e])},pf=function(e){return e.replace(of,"-$1").toLowerCase()},mf=cf,ff=function(e){var t=cf(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},_f=function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"},gf={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function bf(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class yf{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},gf)if(gf.hasOwnProperty(t)){var n=gf[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:bf(n)}}reportNonstrict(e,t,n){var i=this.strict;if("function"==typeof i&&(i=i(e,t,n)),i&&"ignore"!==i){if(!0===i||"error"===i)throw new sf("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===i?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var i=this.strict;if("function"==typeof i)try{i=i(e,t,n)}catch(e){i="error"}return!(!i||"ignore"===i||!0!==i&&"error"!==i&&("warn"===i?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]"),1)))}isTrusted(e){if(e.url&&!e.protocol){var t=_f(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class vf{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return wf[xf[this.id]]}sub(){return wf[kf[this.id]]}fracNum(){return wf[Sf[this.id]]}fracDen(){return wf[Cf[this.id]]}cramp(){return wf[Mf[this.id]]}text(){return wf[zf[this.id]]}isTight(){return this.size>=2}}var wf=[new vf(0,0,!1),new vf(1,0,!0),new vf(2,1,!1),new vf(3,1,!0),new vf(4,2,!1),new vf(5,2,!0),new vf(6,3,!1),new vf(7,3,!0)],xf=[4,5,4,5,6,7,6,7],kf=[5,5,5,5,7,7,7,7],Sf=[2,3,4,5,6,7,6,7],Cf=[3,3,5,5,7,7,7,7],Mf=[1,1,3,3,5,5,7,7],zf=[0,1,2,3,2,3,2,3],Af={DISPLAY:wf[0],TEXT:wf[2],SCRIPT:wf[4],SCRIPTSCRIPT:wf[6]},Tf=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],Pf=[];function Nf(e){for(var t=0;t<Pf.length;t+=2)if(e>=Pf[t]&&e<=Pf[t+1])return!0;return!1}Tf.forEach(e=>e.blocks.forEach(e=>Pf.push(...e)));var Of={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class Rf{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return df(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>e.toText()).join("")}}var Lf={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ef={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Df={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function If(e,t,n){if(!Lf[t])throw new Error("Font metrics not found for font: "+t+".");var i=e.charCodeAt(0),r=Lf[t][i];if(!r&&e[0]in Df&&(i=Df[e[0]].charCodeAt(0),r=Lf[t][i]),r||"text"!==n||Nf(i)&&(r=Lf[t][77]),r)return{depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]}}var Bf={},jf=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],qf=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Hf=function(e,t){return t.size<2?e:jf[e-1][t.size-1]};class Ff{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Ff.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=qf[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new Ff(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Hf(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:qf[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Hf(Ff.BASESIZE,e);return this.size===t&&this.textSize===Ff.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ff.BASESIZE?["sizing","reset-size"+this.size,"size"+Ff.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!Bf[t=e>=5?0:e>=3?1:2]){var n=Bf[t]={cssEmPerMu:Ef.quad[t]/18};for(var i in Ef)Ef.hasOwnProperty(i)&&(n[i]=Ef[i][t])}return Bf[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ff.BASESIZE=6;var $f={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},Gf={ex:!0,em:!0,mu:!0},Vf=function(e){return"string"!=typeof e&&(e=e.unit),e in $f||e in Gf||"ex"===e},Uf=function(e,t){var n;if(e.unit in $f)n=$f[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var i;if(i=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=i.fontMetrics().xHeight;else{if("em"!==e.unit)throw new sf("Invalid unit: '"+e.unit+"'");n=i.fontMetrics().quad}i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Wf=function(e){return+e.toFixed(4)+"em"},Yf=function(e){return e.filter(e=>e).join(" ")},Xf=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},Kf=function(e){var t=document.createElement(e);for(var n in t.className=Yf(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},Jf=/[\s"'>/=\x00-\x1f]/,Qf=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+uf(Yf(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=pf(i)+":"+this.style[i]+";");for(var r in n&&(t+=' style="'+uf(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(r)){if(Jf.test(r))throw new sf("Invalid attribute name '"+r+"'");t+=" "+r+'="'+uf(this.attributes[r])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+"</"+e+">"};class Zf{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Xf.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return df(this.classes,e)}toNode(){return Kf.call(this,"span")}toMarkup(){return Qf.call(this,"span")}}class e_{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Xf.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return df(this.classes,e)}toNode(){return Kf.call(this,"a")}toMarkup(){return Qf.call(this,"a")}}class t_{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return df(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+uf(this.src)+'" alt="'+uf(this.alt)+'"',t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=pf(n)+":"+this.style[n]+";");return t&&(e+=' style="'+uf(t)+'"'),e+"'/>"}}var n_={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class i_{constructor(e,t,n,i,r,s,o,a){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=r||0,this.width=s||0,this.classes=o||[],this.style=a||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Tf.length;t++)for(var n=Tf[t],i=0;i<n.blocks.length;i++){var r=n.blocks[i];if(e>=r[0]&&e<=r[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=n_[this.text])}hasClass(e){return df(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=Wf(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Yf(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=uf(Yf(this.classes)),t+='"');var n="";for(var i in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(i)&&(n+=pf(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+uf(n)+'"');var r=uf(this.text);return e?(t+=">",t+=r,t+="</span>"):r}}class r_{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+uf(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class s_{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",Of[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+uf(this.alternate)+'"/>':'<path d="'+uf(Of[this.pathName])+'"/>'}}class o_{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+uf(this.attributes[t])+'"');return e+"/>"}}function a_(e){if(e instanceof i_)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var l_={bin:1,close:1,inner:1,open:1,punct:1,rel:1},c_={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},d_={math:{},text:{}};function h_(e,t,n,i,r,s){d_[e][r]={font:t,group:n,replace:i},s&&i&&(d_[e][i]=d_[e][r])}var u_="math",p_="text",m_="main",f_="ams",__="accent-token",g_="bin",b_="close",y_="inner",v_="mathord",w_="op-token",x_="open",k_="punct",S_="rel",C_="spacing",M_="textord";h_(u_,m_,S_,"≡","\\equiv",!0),h_(u_,m_,S_,"≺","\\prec",!0),h_(u_,m_,S_,"≻","\\succ",!0),h_(u_,m_,S_,"∼","\\sim",!0),h_(u_,m_,S_,"⊥","\\perp"),h_(u_,m_,S_,"⪯","\\preceq",!0),h_(u_,m_,S_,"⪰","\\succeq",!0),h_(u_,m_,S_,"≃","\\simeq",!0),h_(u_,m_,S_,"∣","\\mid",!0),h_(u_,m_,S_,"≪","\\ll",!0),h_(u_,m_,S_,"≫","\\gg",!0),h_(u_,m_,S_,"≍","\\asymp",!0),h_(u_,m_,S_,"∥","\\parallel"),h_(u_,m_,S_,"⋈","\\bowtie",!0),h_(u_,m_,S_,"⌣","\\smile",!0),h_(u_,m_,S_,"⊑","\\sqsubseteq",!0),h_(u_,m_,S_,"⊒","\\sqsupseteq",!0),h_(u_,m_,S_,"≐","\\doteq",!0),h_(u_,m_,S_,"⌢","\\frown",!0),h_(u_,m_,S_,"∋","\\ni",!0),h_(u_,m_,S_,"∝","\\propto",!0),h_(u_,m_,S_,"⊢","\\vdash",!0),h_(u_,m_,S_,"⊣","\\dashv",!0),h_(u_,m_,S_,"∋","\\owns"),h_(u_,m_,k_,".","\\ldotp"),h_(u_,m_,k_,"⋅","\\cdotp"),h_(u_,m_,M_,"#","\\#"),h_(p_,m_,M_,"#","\\#"),h_(u_,m_,M_,"&","\\&"),h_(p_,m_,M_,"&","\\&"),h_(u_,m_,M_,"ℵ","\\aleph",!0),h_(u_,m_,M_,"∀","\\forall",!0),h_(u_,m_,M_,"ℏ","\\hbar",!0),h_(u_,m_,M_,"∃","\\exists",!0),h_(u_,m_,M_,"∇","\\nabla",!0),h_(u_,m_,M_,"♭","\\flat",!0),h_(u_,m_,M_,"ℓ","\\ell",!0),h_(u_,m_,M_,"♮","\\natural",!0),h_(u_,m_,M_,"♣","\\clubsuit",!0),h_(u_,m_,M_,"℘","\\wp",!0),h_(u_,m_,M_,"♯","\\sharp",!0),h_(u_,m_,M_,"♢","\\diamondsuit",!0),h_(u_,m_,M_,"ℜ","\\Re",!0),h_(u_,m_,M_,"♡","\\heartsuit",!0),h_(u_,m_,M_,"ℑ","\\Im",!0),h_(u_,m_,M_,"♠","\\spadesuit",!0),h_(u_,m_,M_,"§","\\S",!0),h_(p_,m_,M_,"§","\\S"),h_(u_,m_,M_,"¶","\\P",!0),h_(p_,m_,M_,"¶","\\P"),h_(u_,m_,M_,"†","\\dag"),h_(p_,m_,M_,"†","\\dag"),h_(p_,m_,M_,"†","\\textdagger"),h_(u_,m_,M_,"‡","\\ddag"),h_(p_,m_,M_,"‡","\\ddag"),h_(p_,m_,M_,"‡","\\textdaggerdbl"),h_(u_,m_,b_,"⎱","\\rmoustache",!0),h_(u_,m_,x_,"⎰","\\lmoustache",!0),h_(u_,m_,b_,"⟯","\\rgroup",!0),h_(u_,m_,x_,"⟮","\\lgroup",!0),h_(u_,m_,g_,"∓","\\mp",!0),h_(u_,m_,g_,"⊖","\\ominus",!0),h_(u_,m_,g_,"⊎","\\uplus",!0),h_(u_,m_,g_,"⊓","\\sqcap",!0),h_(u_,m_,g_,"∗","\\ast"),h_(u_,m_,g_,"⊔","\\sqcup",!0),h_(u_,m_,g_,"◯","\\bigcirc",!0),h_(u_,m_,g_,"∙","\\bullet",!0),h_(u_,m_,g_,"‡","\\ddagger"),h_(u_,m_,g_,"≀","\\wr",!0),h_(u_,m_,g_,"⨿","\\amalg"),h_(u_,m_,g_,"&","\\And"),h_(u_,m_,S_,"⟵","\\longleftarrow",!0),h_(u_,m_,S_,"⇐","\\Leftarrow",!0),h_(u_,m_,S_,"⟸","\\Longleftarrow",!0),h_(u_,m_,S_,"⟶","\\longrightarrow",!0),h_(u_,m_,S_,"⇒","\\Rightarrow",!0),h_(u_,m_,S_,"⟹","\\Longrightarrow",!0),h_(u_,m_,S_,"↔","\\leftrightarrow",!0),h_(u_,m_,S_,"⟷","\\longleftrightarrow",!0),h_(u_,m_,S_,"⇔","\\Leftrightarrow",!0),h_(u_,m_,S_,"⟺","\\Longleftrightarrow",!0),h_(u_,m_,S_,"↦","\\mapsto",!0),h_(u_,m_,S_,"⟼","\\longmapsto",!0),h_(u_,m_,S_,"↗","\\nearrow",!0),h_(u_,m_,S_,"↩","\\hookleftarrow",!0),h_(u_,m_,S_,"↪","\\hookrightarrow",!0),h_(u_,m_,S_,"↘","\\searrow",!0),h_(u_,m_,S_,"↼","\\leftharpoonup",!0),h_(u_,m_,S_,"⇀","\\rightharpoonup",!0),h_(u_,m_,S_,"↙","\\swarrow",!0),h_(u_,m_,S_,"↽","\\leftharpoondown",!0),h_(u_,m_,S_,"⇁","\\rightharpoondown",!0),h_(u_,m_,S_,"↖","\\nwarrow",!0),h_(u_,m_,S_,"⇌","\\rightleftharpoons",!0),h_(u_,f_,S_,"≮","\\nless",!0),h_(u_,f_,S_,"","\\@nleqslant"),h_(u_,f_,S_,"","\\@nleqq"),h_(u_,f_,S_,"⪇","\\lneq",!0),h_(u_,f_,S_,"≨","\\lneqq",!0),h_(u_,f_,S_,"","\\@lvertneqq"),h_(u_,f_,S_,"⋦","\\lnsim",!0),h_(u_,f_,S_,"⪉","\\lnapprox",!0),h_(u_,f_,S_,"⊀","\\nprec",!0),h_(u_,f_,S_,"⋠","\\npreceq",!0),h_(u_,f_,S_,"⋨","\\precnsim",!0),h_(u_,f_,S_,"⪹","\\precnapprox",!0),h_(u_,f_,S_,"≁","\\nsim",!0),h_(u_,f_,S_,"","\\@nshortmid"),h_(u_,f_,S_,"∤","\\nmid",!0),h_(u_,f_,S_,"⊬","\\nvdash",!0),h_(u_,f_,S_,"⊭","\\nvDash",!0),h_(u_,f_,S_,"⋪","\\ntriangleleft"),h_(u_,f_,S_,"⋬","\\ntrianglelefteq",!0),h_(u_,f_,S_,"⊊","\\subsetneq",!0),h_(u_,f_,S_,"","\\@varsubsetneq"),h_(u_,f_,S_,"⫋","\\subsetneqq",!0),h_(u_,f_,S_,"","\\@varsubsetneqq"),h_(u_,f_,S_,"≯","\\ngtr",!0),h_(u_,f_,S_,"","\\@ngeqslant"),h_(u_,f_,S_,"","\\@ngeqq"),h_(u_,f_,S_,"⪈","\\gneq",!0),h_(u_,f_,S_,"≩","\\gneqq",!0),h_(u_,f_,S_,"","\\@gvertneqq"),h_(u_,f_,S_,"⋧","\\gnsim",!0),h_(u_,f_,S_,"⪊","\\gnapprox",!0),h_(u_,f_,S_,"⊁","\\nsucc",!0),h_(u_,f_,S_,"⋡","\\nsucceq",!0),h_(u_,f_,S_,"⋩","\\succnsim",!0),h_(u_,f_,S_,"⪺","\\succnapprox",!0),h_(u_,f_,S_,"≆","\\ncong",!0),h_(u_,f_,S_,"","\\@nshortparallel"),h_(u_,f_,S_,"∦","\\nparallel",!0),h_(u_,f_,S_,"⊯","\\nVDash",!0),h_(u_,f_,S_,"⋫","\\ntriangleright"),h_(u_,f_,S_,"⋭","\\ntrianglerighteq",!0),h_(u_,f_,S_,"","\\@nsupseteqq"),h_(u_,f_,S_,"⊋","\\supsetneq",!0),h_(u_,f_,S_,"","\\@varsupsetneq"),h_(u_,f_,S_,"⫌","\\supsetneqq",!0),h_(u_,f_,S_,"","\\@varsupsetneqq"),h_(u_,f_,S_,"⊮","\\nVdash",!0),h_(u_,f_,S_,"⪵","\\precneqq",!0),h_(u_,f_,S_,"⪶","\\succneqq",!0),h_(u_,f_,S_,"","\\@nsubseteqq"),h_(u_,f_,g_,"⊴","\\unlhd"),h_(u_,f_,g_,"⊵","\\unrhd"),h_(u_,f_,S_,"↚","\\nleftarrow",!0),h_(u_,f_,S_,"↛","\\nrightarrow",!0),h_(u_,f_,S_,"⇍","\\nLeftarrow",!0),h_(u_,f_,S_,"⇏","\\nRightarrow",!0),h_(u_,f_,S_,"↮","\\nleftrightarrow",!0),h_(u_,f_,S_,"⇎","\\nLeftrightarrow",!0),h_(u_,f_,S_,"△","\\vartriangle"),h_(u_,f_,M_,"ℏ","\\hslash"),h_(u_,f_,M_,"▽","\\triangledown"),h_(u_,f_,M_,"◊","\\lozenge"),h_(u_,f_,M_,"Ⓢ","\\circledS"),h_(u_,f_,M_,"®","\\circledR"),h_(p_,f_,M_,"®","\\circledR"),h_(u_,f_,M_,"∡","\\measuredangle",!0),h_(u_,f_,M_,"∄","\\nexists"),h_(u_,f_,M_,"℧","\\mho"),h_(u_,f_,M_,"Ⅎ","\\Finv",!0),h_(u_,f_,M_,"⅁","\\Game",!0),h_(u_,f_,M_,"‵","\\backprime"),h_(u_,f_,M_,"▲","\\blacktriangle"),h_(u_,f_,M_,"▼","\\blacktriangledown"),h_(u_,f_,M_,"■","\\blacksquare"),h_(u_,f_,M_,"⧫","\\blacklozenge"),h_(u_,f_,M_,"★","\\bigstar"),h_(u_,f_,M_,"∢","\\sphericalangle",!0),h_(u_,f_,M_,"∁","\\complement",!0),h_(u_,f_,M_,"ð","\\eth",!0),h_(p_,m_,M_,"ð","ð"),h_(u_,f_,M_,"╱","\\diagup"),h_(u_,f_,M_,"╲","\\diagdown"),h_(u_,f_,M_,"□","\\square"),h_(u_,f_,M_,"□","\\Box"),h_(u_,f_,M_,"◊","\\Diamond"),h_(u_,f_,M_,"¥","\\yen",!0),h_(p_,f_,M_,"¥","\\yen",!0),h_(u_,f_,M_,"✓","\\checkmark",!0),h_(p_,f_,M_,"✓","\\checkmark"),h_(u_,f_,M_,"ℶ","\\beth",!0),h_(u_,f_,M_,"ℸ","\\daleth",!0),h_(u_,f_,M_,"ℷ","\\gimel",!0),h_(u_,f_,M_,"ϝ","\\digamma",!0),h_(u_,f_,M_,"ϰ","\\varkappa"),h_(u_,f_,x_,"┌","\\@ulcorner",!0),h_(u_,f_,b_,"┐","\\@urcorner",!0),h_(u_,f_,x_,"└","\\@llcorner",!0),h_(u_,f_,b_,"┘","\\@lrcorner",!0),h_(u_,f_,S_,"≦","\\leqq",!0),h_(u_,f_,S_,"⩽","\\leqslant",!0),h_(u_,f_,S_,"⪕","\\eqslantless",!0),h_(u_,f_,S_,"≲","\\lesssim",!0),h_(u_,f_,S_,"⪅","\\lessapprox",!0),h_(u_,f_,S_,"≊","\\approxeq",!0),h_(u_,f_,g_,"⋖","\\lessdot"),h_(u_,f_,S_,"⋘","\\lll",!0),h_(u_,f_,S_,"≶","\\lessgtr",!0),h_(u_,f_,S_,"⋚","\\lesseqgtr",!0),h_(u_,f_,S_,"⪋","\\lesseqqgtr",!0),h_(u_,f_,S_,"≑","\\doteqdot"),h_(u_,f_,S_,"≓","\\risingdotseq",!0),h_(u_,f_,S_,"≒","\\fallingdotseq",!0),h_(u_,f_,S_,"∽","\\backsim",!0),h_(u_,f_,S_,"⋍","\\backsimeq",!0),h_(u_,f_,S_,"⫅","\\subseteqq",!0),h_(u_,f_,S_,"⋐","\\Subset",!0),h_(u_,f_,S_,"⊏","\\sqsubset",!0),h_(u_,f_,S_,"≼","\\preccurlyeq",!0),h_(u_,f_,S_,"⋞","\\curlyeqprec",!0),h_(u_,f_,S_,"≾","\\precsim",!0),h_(u_,f_,S_,"⪷","\\precapprox",!0),h_(u_,f_,S_,"⊲","\\vartriangleleft"),h_(u_,f_,S_,"⊴","\\trianglelefteq"),h_(u_,f_,S_,"⊨","\\vDash",!0),h_(u_,f_,S_,"⊪","\\Vvdash",!0),h_(u_,f_,S_,"⌣","\\smallsmile"),h_(u_,f_,S_,"⌢","\\smallfrown"),h_(u_,f_,S_,"≏","\\bumpeq",!0),h_(u_,f_,S_,"≎","\\Bumpeq",!0),h_(u_,f_,S_,"≧","\\geqq",!0),h_(u_,f_,S_,"⩾","\\geqslant",!0),h_(u_,f_,S_,"⪖","\\eqslantgtr",!0),h_(u_,f_,S_,"≳","\\gtrsim",!0),h_(u_,f_,S_,"⪆","\\gtrapprox",!0),h_(u_,f_,g_,"⋗","\\gtrdot"),h_(u_,f_,S_,"⋙","\\ggg",!0),h_(u_,f_,S_,"≷","\\gtrless",!0),h_(u_,f_,S_,"⋛","\\gtreqless",!0),h_(u_,f_,S_,"⪌","\\gtreqqless",!0),h_(u_,f_,S_,"≖","\\eqcirc",!0),h_(u_,f_,S_,"≗","\\circeq",!0),h_(u_,f_,S_,"≜","\\triangleq",!0),h_(u_,f_,S_,"∼","\\thicksim"),h_(u_,f_,S_,"≈","\\thickapprox"),h_(u_,f_,S_,"⫆","\\supseteqq",!0),h_(u_,f_,S_,"⋑","\\Supset",!0),h_(u_,f_,S_,"⊐","\\sqsupset",!0),h_(u_,f_,S_,"≽","\\succcurlyeq",!0),h_(u_,f_,S_,"⋟","\\curlyeqsucc",!0),h_(u_,f_,S_,"≿","\\succsim",!0),h_(u_,f_,S_,"⪸","\\succapprox",!0),h_(u_,f_,S_,"⊳","\\vartriangleright"),h_(u_,f_,S_,"⊵","\\trianglerighteq"),h_(u_,f_,S_,"⊩","\\Vdash",!0),h_(u_,f_,S_,"∣","\\shortmid"),h_(u_,f_,S_,"∥","\\shortparallel"),h_(u_,f_,S_,"≬","\\between",!0),h_(u_,f_,S_,"⋔","\\pitchfork",!0),h_(u_,f_,S_,"∝","\\varpropto"),h_(u_,f_,S_,"◀","\\blacktriangleleft"),h_(u_,f_,S_,"∴","\\therefore",!0),h_(u_,f_,S_,"∍","\\backepsilon"),h_(u_,f_,S_,"▶","\\blacktriangleright"),h_(u_,f_,S_,"∵","\\because",!0),h_(u_,f_,S_,"⋘","\\llless"),h_(u_,f_,S_,"⋙","\\gggtr"),h_(u_,f_,g_,"⊲","\\lhd"),h_(u_,f_,g_,"⊳","\\rhd"),h_(u_,f_,S_,"≂","\\eqsim",!0),h_(u_,m_,S_,"⋈","\\Join"),h_(u_,f_,S_,"≑","\\Doteq",!0),h_(u_,f_,g_,"∔","\\dotplus",!0),h_(u_,f_,g_,"∖","\\smallsetminus"),h_(u_,f_,g_,"⋒","\\Cap",!0),h_(u_,f_,g_,"⋓","\\Cup",!0),h_(u_,f_,g_,"⩞","\\doublebarwedge",!0),h_(u_,f_,g_,"⊟","\\boxminus",!0),h_(u_,f_,g_,"⊞","\\boxplus",!0),h_(u_,f_,g_,"⋇","\\divideontimes",!0),h_(u_,f_,g_,"⋉","\\ltimes",!0),h_(u_,f_,g_,"⋊","\\rtimes",!0),h_(u_,f_,g_,"⋋","\\leftthreetimes",!0),h_(u_,f_,g_,"⋌","\\rightthreetimes",!0),h_(u_,f_,g_,"⋏","\\curlywedge",!0),h_(u_,f_,g_,"⋎","\\curlyvee",!0),h_(u_,f_,g_,"⊝","\\circleddash",!0),h_(u_,f_,g_,"⊛","\\circledast",!0),h_(u_,f_,g_,"⋅","\\centerdot"),h_(u_,f_,g_,"⊺","\\intercal",!0),h_(u_,f_,g_,"⋒","\\doublecap"),h_(u_,f_,g_,"⋓","\\doublecup"),h_(u_,f_,g_,"⊠","\\boxtimes",!0),h_(u_,f_,S_,"⇢","\\dashrightarrow",!0),h_(u_,f_,S_,"⇠","\\dashleftarrow",!0),h_(u_,f_,S_,"⇇","\\leftleftarrows",!0),h_(u_,f_,S_,"⇆","\\leftrightarrows",!0),h_(u_,f_,S_,"⇚","\\Lleftarrow",!0),h_(u_,f_,S_,"↞","\\twoheadleftarrow",!0),h_(u_,f_,S_,"↢","\\leftarrowtail",!0),h_(u_,f_,S_,"↫","\\looparrowleft",!0),h_(u_,f_,S_,"⇋","\\leftrightharpoons",!0),h_(u_,f_,S_,"↶","\\curvearrowleft",!0),h_(u_,f_,S_,"↺","\\circlearrowleft",!0),h_(u_,f_,S_,"↰","\\Lsh",!0),h_(u_,f_,S_,"⇈","\\upuparrows",!0),h_(u_,f_,S_,"↿","\\upharpoonleft",!0),h_(u_,f_,S_,"⇃","\\downharpoonleft",!0),h_(u_,m_,S_,"⊶","\\origof",!0),h_(u_,m_,S_,"⊷","\\imageof",!0),h_(u_,f_,S_,"⊸","\\multimap",!0),h_(u_,f_,S_,"↭","\\leftrightsquigarrow",!0),h_(u_,f_,S_,"⇉","\\rightrightarrows",!0),h_(u_,f_,S_,"⇄","\\rightleftarrows",!0),h_(u_,f_,S_,"↠","\\twoheadrightarrow",!0),h_(u_,f_,S_,"↣","\\rightarrowtail",!0),h_(u_,f_,S_,"↬","\\looparrowright",!0),h_(u_,f_,S_,"↷","\\curvearrowright",!0),h_(u_,f_,S_,"↻","\\circlearrowright",!0),h_(u_,f_,S_,"↱","\\Rsh",!0),h_(u_,f_,S_,"⇊","\\downdownarrows",!0),h_(u_,f_,S_,"↾","\\upharpoonright",!0),h_(u_,f_,S_,"⇂","\\downharpoonright",!0),h_(u_,f_,S_,"⇝","\\rightsquigarrow",!0),h_(u_,f_,S_,"⇝","\\leadsto"),h_(u_,f_,S_,"⇛","\\Rrightarrow",!0),h_(u_,f_,S_,"↾","\\restriction"),h_(u_,m_,M_,"‘","`"),h_(u_,m_,M_,"$","\\$"),h_(p_,m_,M_,"$","\\$"),h_(p_,m_,M_,"$","\\textdollar"),h_(u_,m_,M_,"%","\\%"),h_(p_,m_,M_,"%","\\%"),h_(u_,m_,M_,"_","\\_"),h_(p_,m_,M_,"_","\\_"),h_(p_,m_,M_,"_","\\textunderscore"),h_(u_,m_,M_,"∠","\\angle",!0),h_(u_,m_,M_,"∞","\\infty",!0),h_(u_,m_,M_,"′","\\prime"),h_(u_,m_,M_,"△","\\triangle"),h_(u_,m_,M_,"Γ","\\Gamma",!0),h_(u_,m_,M_,"Δ","\\Delta",!0),h_(u_,m_,M_,"Θ","\\Theta",!0),h_(u_,m_,M_,"Λ","\\Lambda",!0),h_(u_,m_,M_,"Ξ","\\Xi",!0),h_(u_,m_,M_,"Π","\\Pi",!0),h_(u_,m_,M_,"Σ","\\Sigma",!0),h_(u_,m_,M_,"Υ","\\Upsilon",!0),h_(u_,m_,M_,"Φ","\\Phi",!0),h_(u_,m_,M_,"Ψ","\\Psi",!0),h_(u_,m_,M_,"Ω","\\Omega",!0),h_(u_,m_,M_,"A","Α"),h_(u_,m_,M_,"B","Β"),h_(u_,m_,M_,"E","Ε"),h_(u_,m_,M_,"Z","Ζ"),h_(u_,m_,M_,"H","Η"),h_(u_,m_,M_,"I","Ι"),h_(u_,m_,M_,"K","Κ"),h_(u_,m_,M_,"M","Μ"),h_(u_,m_,M_,"N","Ν"),h_(u_,m_,M_,"O","Ο"),h_(u_,m_,M_,"P","Ρ"),h_(u_,m_,M_,"T","Τ"),h_(u_,m_,M_,"X","Χ"),h_(u_,m_,M_,"¬","\\neg",!0),h_(u_,m_,M_,"¬","\\lnot"),h_(u_,m_,M_,"⊤","\\top"),h_(u_,m_,M_,"⊥","\\bot"),h_(u_,m_,M_,"∅","\\emptyset"),h_(u_,f_,M_,"∅","\\varnothing"),h_(u_,m_,v_,"α","\\alpha",!0),h_(u_,m_,v_,"β","\\beta",!0),h_(u_,m_,v_,"γ","\\gamma",!0),h_(u_,m_,v_,"δ","\\delta",!0),h_(u_,m_,v_,"ϵ","\\epsilon",!0),h_(u_,m_,v_,"ζ","\\zeta",!0),h_(u_,m_,v_,"η","\\eta",!0),h_(u_,m_,v_,"θ","\\theta",!0),h_(u_,m_,v_,"ι","\\iota",!0),h_(u_,m_,v_,"κ","\\kappa",!0),h_(u_,m_,v_,"λ","\\lambda",!0),h_(u_,m_,v_,"μ","\\mu",!0),h_(u_,m_,v_,"ν","\\nu",!0),h_(u_,m_,v_,"ξ","\\xi",!0),h_(u_,m_,v_,"ο","\\omicron",!0),h_(u_,m_,v_,"π","\\pi",!0),h_(u_,m_,v_,"ρ","\\rho",!0),h_(u_,m_,v_,"σ","\\sigma",!0),h_(u_,m_,v_,"τ","\\tau",!0),h_(u_,m_,v_,"υ","\\upsilon",!0),h_(u_,m_,v_,"ϕ","\\phi",!0),h_(u_,m_,v_,"χ","\\chi",!0),h_(u_,m_,v_,"ψ","\\psi",!0),h_(u_,m_,v_,"ω","\\omega",!0),h_(u_,m_,v_,"ε","\\varepsilon",!0),h_(u_,m_,v_,"ϑ","\\vartheta",!0),h_(u_,m_,v_,"ϖ","\\varpi",!0),h_(u_,m_,v_,"ϱ","\\varrho",!0),h_(u_,m_,v_,"ς","\\varsigma",!0),h_(u_,m_,v_,"φ","\\varphi",!0),h_(u_,m_,g_,"∗","*",!0),h_(u_,m_,g_,"+","+"),h_(u_,m_,g_,"−","-",!0),h_(u_,m_,g_,"⋅","\\cdot",!0),h_(u_,m_,g_,"∘","\\circ",!0),h_(u_,m_,g_,"÷","\\div",!0),h_(u_,m_,g_,"±","\\pm",!0),h_(u_,m_,g_,"×","\\times",!0),h_(u_,m_,g_,"∩","\\cap",!0),h_(u_,m_,g_,"∪","\\cup",!0),h_(u_,m_,g_,"∖","\\setminus",!0),h_(u_,m_,g_,"∧","\\land"),h_(u_,m_,g_,"∨","\\lor"),h_(u_,m_,g_,"∧","\\wedge",!0),h_(u_,m_,g_,"∨","\\vee",!0),h_(u_,m_,M_,"√","\\surd"),h_(u_,m_,x_,"⟨","\\langle",!0),h_(u_,m_,x_,"∣","\\lvert"),h_(u_,m_,x_,"∥","\\lVert"),h_(u_,m_,b_,"?","?"),h_(u_,m_,b_,"!","!"),h_(u_,m_,b_,"⟩","\\rangle",!0),h_(u_,m_,b_,"∣","\\rvert"),h_(u_,m_,b_,"∥","\\rVert"),h_(u_,m_,S_,"=","="),h_(u_,m_,S_,":",":"),h_(u_,m_,S_,"≈","\\approx",!0),h_(u_,m_,S_,"≅","\\cong",!0),h_(u_,m_,S_,"≥","\\ge"),h_(u_,m_,S_,"≥","\\geq",!0),h_(u_,m_,S_,"←","\\gets"),h_(u_,m_,S_,">","\\gt",!0),h_(u_,m_,S_,"∈","\\in",!0),h_(u_,m_,S_,"","\\@not"),h_(u_,m_,S_,"⊂","\\subset",!0),h_(u_,m_,S_,"⊃","\\supset",!0),h_(u_,m_,S_,"⊆","\\subseteq",!0),h_(u_,m_,S_,"⊇","\\supseteq",!0),h_(u_,f_,S_,"⊈","\\nsubseteq",!0),h_(u_,f_,S_,"⊉","\\nsupseteq",!0),h_(u_,m_,S_,"⊨","\\models"),h_(u_,m_,S_,"←","\\leftarrow",!0),h_(u_,m_,S_,"≤","\\le"),h_(u_,m_,S_,"≤","\\leq",!0),h_(u_,m_,S_,"<","\\lt",!0),h_(u_,m_,S_,"→","\\rightarrow",!0),h_(u_,m_,S_,"→","\\to"),h_(u_,f_,S_,"≱","\\ngeq",!0),h_(u_,f_,S_,"≰","\\nleq",!0),h_(u_,m_,C_," ","\\ "),h_(u_,m_,C_," ","\\space"),h_(u_,m_,C_," ","\\nobreakspace"),h_(p_,m_,C_," ","\\ "),h_(p_,m_,C_," "," "),h_(p_,m_,C_," ","\\space"),h_(p_,m_,C_," ","\\nobreakspace"),h_(u_,m_,C_,null,"\\nobreak"),h_(u_,m_,C_,null,"\\allowbreak"),h_(u_,m_,k_,",",","),h_(u_,m_,k_,";",";"),h_(u_,f_,g_,"⊼","\\barwedge",!0),h_(u_,f_,g_,"⊻","\\veebar",!0),h_(u_,m_,g_,"⊙","\\odot",!0),h_(u_,m_,g_,"⊕","\\oplus",!0),h_(u_,m_,g_,"⊗","\\otimes",!0),h_(u_,m_,M_,"∂","\\partial",!0),h_(u_,m_,g_,"⊘","\\oslash",!0),h_(u_,f_,g_,"⊚","\\circledcirc",!0),h_(u_,f_,g_,"⊡","\\boxdot",!0),h_(u_,m_,g_,"△","\\bigtriangleup"),h_(u_,m_,g_,"▽","\\bigtriangledown"),h_(u_,m_,g_,"†","\\dagger"),h_(u_,m_,g_,"⋄","\\diamond"),h_(u_,m_,g_,"⋆","\\star"),h_(u_,m_,g_,"◃","\\triangleleft"),h_(u_,m_,g_,"▹","\\triangleright"),h_(u_,m_,x_,"{","\\{"),h_(p_,m_,M_,"{","\\{"),h_(p_,m_,M_,"{","\\textbraceleft"),h_(u_,m_,b_,"}","\\}"),h_(p_,m_,M_,"}","\\}"),h_(p_,m_,M_,"}","\\textbraceright"),h_(u_,m_,x_,"{","\\lbrace"),h_(u_,m_,b_,"}","\\rbrace"),h_(u_,m_,x_,"[","\\lbrack",!0),h_(p_,m_,M_,"[","\\lbrack",!0),h_(u_,m_,b_,"]","\\rbrack",!0),h_(p_,m_,M_,"]","\\rbrack",!0),h_(u_,m_,x_,"(","\\lparen",!0),h_(u_,m_,b_,")","\\rparen",!0),h_(p_,m_,M_,"<","\\textless",!0),h_(p_,m_,M_,">","\\textgreater",!0),h_(u_,m_,x_,"⌊","\\lfloor",!0),h_(u_,m_,b_,"⌋","\\rfloor",!0),h_(u_,m_,x_,"⌈","\\lceil",!0),h_(u_,m_,b_,"⌉","\\rceil",!0),h_(u_,m_,M_,"\\","\\backslash"),h_(u_,m_,M_,"∣","|"),h_(u_,m_,M_,"∣","\\vert"),h_(p_,m_,M_,"|","\\textbar",!0),h_(u_,m_,M_,"∥","\\|"),h_(u_,m_,M_,"∥","\\Vert"),h_(p_,m_,M_,"∥","\\textbardbl"),h_(p_,m_,M_,"~","\\textasciitilde"),h_(p_,m_,M_,"\\","\\textbackslash"),h_(p_,m_,M_,"^","\\textasciicircum"),h_(u_,m_,S_,"↑","\\uparrow",!0),h_(u_,m_,S_,"⇑","\\Uparrow",!0),h_(u_,m_,S_,"↓","\\downarrow",!0),h_(u_,m_,S_,"⇓","\\Downarrow",!0),h_(u_,m_,S_,"↕","\\updownarrow",!0),h_(u_,m_,S_,"⇕","\\Updownarrow",!0),h_(u_,m_,w_,"∐","\\coprod"),h_(u_,m_,w_,"⋁","\\bigvee"),h_(u_,m_,w_,"⋀","\\bigwedge"),h_(u_,m_,w_,"⨄","\\biguplus"),h_(u_,m_,w_,"⋂","\\bigcap"),h_(u_,m_,w_,"⋃","\\bigcup"),h_(u_,m_,w_,"∫","\\int"),h_(u_,m_,w_,"∫","\\intop"),h_(u_,m_,w_,"∬","\\iint"),h_(u_,m_,w_,"∭","\\iiint"),h_(u_,m_,w_,"∏","\\prod"),h_(u_,m_,w_,"∑","\\sum"),h_(u_,m_,w_,"⨂","\\bigotimes"),h_(u_,m_,w_,"⨁","\\bigoplus"),h_(u_,m_,w_,"⨀","\\bigodot"),h_(u_,m_,w_,"∮","\\oint"),h_(u_,m_,w_,"∯","\\oiint"),h_(u_,m_,w_,"∰","\\oiiint"),h_(u_,m_,w_,"⨆","\\bigsqcup"),h_(u_,m_,w_,"∫","\\smallint"),h_(p_,m_,y_,"…","\\textellipsis"),h_(u_,m_,y_,"…","\\mathellipsis"),h_(p_,m_,y_,"…","\\ldots",!0),h_(u_,m_,y_,"…","\\ldots",!0),h_(u_,m_,y_,"⋯","\\@cdots",!0),h_(u_,m_,y_,"⋱","\\ddots",!0),h_(u_,m_,M_,"⋮","\\varvdots"),h_(p_,m_,M_,"⋮","\\varvdots"),h_(u_,m_,__,"ˊ","\\acute"),h_(u_,m_,__,"ˋ","\\grave"),h_(u_,m_,__,"¨","\\ddot"),h_(u_,m_,__,"~","\\tilde"),h_(u_,m_,__,"ˉ","\\bar"),h_(u_,m_,__,"˘","\\breve"),h_(u_,m_,__,"ˇ","\\check"),h_(u_,m_,__,"^","\\hat"),h_(u_,m_,__,"⃗","\\vec"),h_(u_,m_,__,"˙","\\dot"),h_(u_,m_,__,"˚","\\mathring"),h_(u_,m_,v_,"","\\@imath"),h_(u_,m_,v_,"","\\@jmath"),h_(u_,m_,M_,"ı","ı"),h_(u_,m_,M_,"ȷ","ȷ"),h_(p_,m_,M_,"ı","\\i",!0),h_(p_,m_,M_,"ȷ","\\j",!0),h_(p_,m_,M_,"ß","\\ss",!0),h_(p_,m_,M_,"æ","\\ae",!0),h_(p_,m_,M_,"œ","\\oe",!0),h_(p_,m_,M_,"ø","\\o",!0),h_(p_,m_,M_,"Æ","\\AE",!0),h_(p_,m_,M_,"Œ","\\OE",!0),h_(p_,m_,M_,"Ø","\\O",!0),h_(p_,m_,__,"ˊ","\\'"),h_(p_,m_,__,"ˋ","\\`"),h_(p_,m_,__,"ˆ","\\^"),h_(p_,m_,__,"˜","\\~"),h_(p_,m_,__,"ˉ","\\="),h_(p_,m_,__,"˘","\\u"),h_(p_,m_,__,"˙","\\."),h_(p_,m_,__,"¸","\\c"),h_(p_,m_,__,"˚","\\r"),h_(p_,m_,__,"ˇ","\\v"),h_(p_,m_,__,"¨",'\\"'),h_(p_,m_,__,"˝","\\H"),h_(p_,m_,__,"◯","\\textcircled");var z_={"--":!0,"---":!0,"``":!0,"''":!0};h_(p_,m_,M_,"–","--",!0),h_(p_,m_,M_,"–","\\textendash"),h_(p_,m_,M_,"—","---",!0),h_(p_,m_,M_,"—","\\textemdash"),h_(p_,m_,M_,"‘","`",!0),h_(p_,m_,M_,"‘","\\textquoteleft"),h_(p_,m_,M_,"’","'",!0),h_(p_,m_,M_,"’","\\textquoteright"),h_(p_,m_,M_,"“","``",!0),h_(p_,m_,M_,"“","\\textquotedblleft"),h_(p_,m_,M_,"”","''",!0),h_(p_,m_,M_,"”","\\textquotedblright"),h_(u_,m_,M_,"°","\\degree",!0),h_(p_,m_,M_,"°","\\degree"),h_(p_,m_,M_,"°","\\textdegree",!0),h_(u_,m_,M_,"£","\\pounds"),h_(u_,m_,M_,"£","\\mathsterling",!0),h_(p_,m_,M_,"£","\\pounds"),h_(p_,m_,M_,"£","\\textsterling",!0),h_(u_,f_,M_,"✠","\\maltese"),h_(p_,f_,M_,"✠","\\maltese");for(var A_=0;A_<14;A_++){var T_='0123456789/@."'.charAt(A_);h_(u_,m_,M_,T_,T_)}for(var P_=0;P_<25;P_++){var N_='0123456789!@*()-=+";:?/.,'.charAt(P_);h_(p_,m_,M_,N_,N_)}for(var O_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",R_=0;R_<52;R_++){var L_=O_.charAt(R_);h_(u_,m_,v_,L_,L_),h_(p_,m_,M_,L_,L_)}h_(u_,f_,M_,"C","ℂ"),h_(p_,f_,M_,"C","ℂ"),h_(u_,f_,M_,"H","ℍ"),h_(p_,f_,M_,"H","ℍ"),h_(u_,f_,M_,"N","ℕ"),h_(p_,f_,M_,"N","ℕ"),h_(u_,f_,M_,"P","ℙ"),h_(p_,f_,M_,"P","ℙ"),h_(u_,f_,M_,"Q","ℚ"),h_(p_,f_,M_,"Q","ℚ"),h_(u_,f_,M_,"R","ℝ"),h_(p_,f_,M_,"R","ℝ"),h_(u_,f_,M_,"Z","ℤ"),h_(p_,f_,M_,"Z","ℤ"),h_(u_,m_,v_,"h","ℎ"),h_(p_,m_,v_,"h","ℎ");for(var E_="",D_=0;D_<52;D_++){var I_=O_.charAt(D_);h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56320+D_)),h_(p_,m_,M_,I_,E_),h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56372+D_)),h_(p_,m_,M_,I_,E_),h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56424+D_)),h_(p_,m_,M_,I_,E_),h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56580+D_)),h_(p_,m_,M_,I_,E_),h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56684+D_)),h_(p_,m_,M_,I_,E_),h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56736+D_)),h_(p_,m_,M_,I_,E_),h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56788+D_)),h_(p_,m_,M_,I_,E_),h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56840+D_)),h_(p_,m_,M_,I_,E_),h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56944+D_)),h_(p_,m_,M_,I_,E_),D_<26&&(h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56632+D_)),h_(p_,m_,M_,I_,E_),h_(u_,m_,v_,I_,E_=String.fromCharCode(55349,56476+D_)),h_(p_,m_,M_,I_,E_))}h_(u_,m_,v_,"k",E_=String.fromCharCode(55349,56668)),h_(p_,m_,M_,"k",E_);for(var B_=0;B_<10;B_++){var j_=B_.toString();h_(u_,m_,v_,j_,E_=String.fromCharCode(55349,57294+B_)),h_(p_,m_,M_,j_,E_),h_(u_,m_,v_,j_,E_=String.fromCharCode(55349,57314+B_)),h_(p_,m_,M_,j_,E_),h_(u_,m_,v_,j_,E_=String.fromCharCode(55349,57324+B_)),h_(p_,m_,M_,j_,E_),h_(u_,m_,v_,j_,E_=String.fromCharCode(55349,57334+B_)),h_(p_,m_,M_,j_,E_)}for(var q_=0;q_<3;q_++){var H_="ÐÞþ".charAt(q_);h_(u_,m_,v_,H_,H_),h_(p_,m_,M_,H_,H_)}var F_=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],$_=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],G_=function(e,t,n){return d_[n][e]&&d_[n][e].replace&&(e=d_[n][e].replace),{value:e,metrics:If(e,t,n)}},V_=function(e,t,n,i,r){var s,o=G_(e,t,n),a=o.metrics;if(e=o.value,a){var l=a.italic;("text"===n||i&&"mathit"===i.font)&&(l=0),s=new i_(e,a.height,a.depth,l,a.skew,a.width,r)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),s=new i_(e,0,0,0,0,0,r);if(i){s.maxFontSize=i.sizeMultiplier,i.style.isTight()&&s.classes.push("mtight");var c=i.getColor();c&&(s.style.color=c)}return s},U_=(e,t)=>{if(Yf(e.classes)!==Yf(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var i in e.style)if(e.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;for(var r in t.style)if(t.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;return!0},W_=function(e){for(var t=0,n=0,i=0,r=0;r<e.children.length;r++){var s=e.children[r];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},Y_=function(e,t,n,i){var r=new Zf(e,t,n,i);return W_(r),r},X_=(e,t,n,i)=>new Zf(e,t,n,i),K_=function(e){var t=new Rf(e);return W_(t),t},J_=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}return i+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},Q_={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Z_={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},eg={fontMap:Q_,makeSymbol:V_,mathsym:function(e,t,n,i){return void 0===i&&(i=[]),"boldsymbol"===n.font&&G_(e,"Main-Bold",t).metrics?V_(e,"Main-Bold",t,n,i.concat(["mathbf"])):"\\"===e||"main"===d_[t][e].font?V_(e,"Main-Regular",t,n,i):V_(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},makeSpan:Y_,makeSvgSpan:X_,makeLineSpan:function(e,t,n){var i=Y_([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=Wf(i.height),i.maxFontSize=1,i},makeAnchor:function(e,t,n,i){var r=new e_(e,t,n,i);return W_(r),r},makeFragment:K_,wrapFragment:function(e,t){return e instanceof Rf?Y_([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:i}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,r=i,s=1;s<t.length;s++){var o=-t[s].shift-r-t[s].elem.depth,a=o-(t[s-1].elem.height+t[s-1].elem.depth);r+=o,n.push({type:"kern",size:a}),n.push(t[s])}return{children:n,depth:i}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var h=e.children[d];c-="kern"===h.type?h.size:h.elem.height+h.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var u=e.children[0];if("elem"!==u.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-u.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-u.elem.depth}}return{children:e.children,depth:l}}(e),r=0,s=0;s<n.length;s++){var o=n[s];if("elem"===o.type){var a=o.elem;r=Math.max(r,a.maxFontSize,a.height)}}r+=2;var l=Y_(["pstrut"],[]);l.style.height=Wf(r);for(var c=[],d=i,h=i,u=i,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)u+=m.size;else{var f=m.elem,_=m.wrapperClasses||[],g=m.wrapperStyle||{},b=Y_(_,[l,f],void 0,g);b.style.top=Wf(-r-u-f.depth),m.marginLeft&&(b.style.marginLeft=m.marginLeft),m.marginRight&&(b.style.marginRight=m.marginRight),c.push(b),u+=f.height+f.depth}d=Math.min(d,u),h=Math.max(h,u)}var y,v=Y_(["vlist"],c);if(v.style.height=Wf(h),d<0){var w=Y_([],[]),x=Y_(["vlist"],[w]);x.style.height=Wf(-d);var k=Y_(["vlist-s"],[new i_("")]);y=[Y_(["vlist-r"],[v,k]),Y_(["vlist-r"],[x])]}else y=[Y_(["vlist-r"],[v])];var S=Y_(["vlist-t"],y);return 2===y.length&&S.classes.push("vlist-t2"),S.height=h,S.depth=-d,S},makeOrd:function(e,t,n){var i=e.mode,r=e.text,s=["mord"],o="math"===i||"text"===i&&t.font,a=o?t.font:t.fontFamily,l="",c="";if(55349===r.charCodeAt(0)&&([l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,i="math"===t?0:1;if(119808<=n&&n<120484){var r=Math.floor((n-119808)/26);return[F_[r][2],F_[r][i]]}if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return[$_[s][2],$_[s][i]]}if(120485===n||120486===n)return[F_[0][2],F_[0][i]];if(120486<n&&n<120782)return["",""];throw new sf("Unsupported character: "+e)}(r,i)),l.length>0)return V_(r,l,i,t,s.concat(c));if(a){var d,h;if("boldsymbol"===a){var u=function(e,t,n,i,r){return"textord"!==r&&G_(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(r,i,0,0,n);d=u.fontName,h=[u.fontClass]}else o?(d=Q_[a].fontName,h=[a]):(d=J_(a,t.fontWeight,t.fontShape),h=[a,t.fontWeight,t.fontShape]);if(G_(r,d,i).metrics)return V_(r,d,i,t,s.concat(h));if(z_.hasOwnProperty(r)&&"Typewriter"===d.slice(0,10)){for(var p=[],m=0;m<r.length;m++)p.push(V_(r[m],d,i,t,s.concat(h)));return K_(p)}}if("mathord"===n)return V_(r,"Math-Italic",i,t,s.concat(["mathnormal"]));if("textord"===n){var f=d_[i][r]&&d_[i][r].font;if("ams"===f){var _=J_("amsrm",t.fontWeight,t.fontShape);return V_(r,_,i,t,s.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var g=J_(f,t.fontWeight,t.fontShape);return V_(r,g,i,t,s.concat(g,t.fontWeight,t.fontShape))}var b=J_("textrm",t.fontWeight,t.fontShape);return V_(r,b,i,t,s.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=Y_(["mspace"],[],t),i=Uf(e,t);return n.style.marginRight=Wf(i),n},staticSvg:function(e,t){var[n,i,r]=Z_[e],s=new s_(n),o=new r_([s],{width:Wf(i),height:Wf(r),style:"width:"+Wf(i),viewBox:"0 0 "+1e3*i+" "+1e3*r,preserveAspectRatio:"xMinYMin"}),a=X_(["overlay"],[o],t);return a.height=r,a.style.height=Wf(r),a.style.width=Wf(i),a},svgData:Z_,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],i=e[t+1];n instanceof i_&&i instanceof i_&&U_(n,i)&&(n.text+=i.text,n.height=Math.max(n.height,i.height),n.depth=Math.max(n.depth,i.depth),n.italic=i.italic,e.splice(t+1,1),t--)}return e}},tg={number:3,unit:"mu"},ng={number:4,unit:"mu"},ig={number:5,unit:"mu"},rg={mord:{mop:tg,mbin:ng,mrel:ig,minner:tg},mop:{mord:tg,mop:tg,mrel:ig,minner:tg},mbin:{mord:ng,mop:ng,mopen:ng,minner:ng},mrel:{mord:ig,mop:ig,mopen:ig,minner:ig},mopen:{},mclose:{mop:tg,mbin:ng,mrel:ig,minner:tg},mpunct:{mord:tg,mop:tg,mrel:ig,mopen:tg,mclose:tg,mpunct:tg,minner:tg},minner:{mord:tg,mop:tg,mbin:ng,mrel:ig,mopen:tg,mpunct:tg,minner:tg}},sg={mord:{mop:tg},mop:{mord:tg,mop:tg},mbin:{},mrel:{},mopen:{},mclose:{mop:tg},mpunct:{},minner:{mop:tg}},og={},ag={},lg={};function cg(e){for(var{type:t,names:n,props:i,handler:r,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:i.numArgs,argTypes:i.argTypes,allowedInArgument:!!i.allowedInArgument,allowedInText:!!i.allowedInText,allowedInMath:void 0===i.allowedInMath||i.allowedInMath,numOptionalArgs:i.numOptionalArgs||0,infix:!!i.infix,primitive:!!i.primitive,handler:r},l=0;l<n.length;++l)og[n[l]]=a;t&&(s&&(ag[t]=s),o&&(lg[t]=o))}function dg(e){var{type:t,htmlBuilder:n,mathmlBuilder:i}=e;cg({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:i})}var hg=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},ug=function(e){return"ordgroup"===e.type?e.body:[e]},pg=eg.makeSpan,mg=["leftmost","mbin","mopen","mrel","mop","mpunct"],fg=["rightmost","mrel","mclose","mpunct"],_g={display:Af.DISPLAY,text:Af.TEXT,script:Af.SCRIPT,scriptscript:Af.SCRIPTSCRIPT},gg={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},bg=function(e,t,n,i){void 0===i&&(i=[null,null]);for(var r=[],s=0;s<e.length;s++){var o=Sg(e[s],t);if(o instanceof Rf){var a=o.children;r.push(...a)}else r.push(o)}if(eg.tryCombineChars(r),!n)return r;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(_g[c.style]))}var d=pg([i[0]||"leftmost"],[],t),h=pg([i[1]||"rightmost"],[],t),u="root"===n;return yg(r,(e,t)=>{var n=t.classes[0],i=e.classes[0];"mbin"===n&&df(fg,i)?t.classes[0]="mord":"mbin"===i&&df(mg,n)&&(e.classes[0]="mord")},{node:d},h,u),yg(r,(e,t)=>{var n=xg(t),i=xg(e),r=n&&i?e.hasClass("mtight")?sg[n][i]:rg[n][i]:null;if(r)return eg.makeGlue(r,l)},{node:d},h,u),r},yg=function e(t,n,i,r,s){r&&t.push(r);for(var o=0;o<t.length;o++){var a=t[o],l=vg(a);if(l)e(l.children,n,i,null,s);else{var c=!a.hasClass("mspace");if(c){var d=n(a,i.node);d&&(i.insertAfter?i.insertAfter(d):(t.unshift(d),o++))}c?i.node=a:s&&a.hasClass("newline")&&(i.node=pg(["leftmost"])),i.insertAfter=(e=>n=>{t.splice(e+1,0,n),o++})(o)}}r&&t.pop()},vg=function(e){return e instanceof Rf||e instanceof e_||e instanceof Zf&&e.hasClass("enclosing")?e:null},wg=function e(t,n){var i=vg(t);if(i){var r=i.children;if(r.length){if("right"===n)return e(r[r.length-1],"right");if("left"===n)return e(r[0],"left")}}return t},xg=function(e,t){return e?(t&&(e=wg(e,t)),gg[e.classes[0]]||null):null},kg=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return pg(t.concat(n))},Sg=function(e,t,n){if(!e)return pg();if(ag[e.type]){var i=ag[e.type](e,t);if(n&&t.size!==n.size){i=pg(t.sizingClasses(n),[i],t);var r=t.sizeMultiplier/n.sizeMultiplier;i.height*=r,i.depth*=r}return i}throw new sf("Got group of unknown type: '"+e.type+"'")};function Cg(e,t){var n=pg(["base"],e,t),i=pg(["strut"]);return i.style.height=Wf(n.height+n.depth),n.depth&&(i.style.verticalAlign=Wf(-n.depth)),n.children.unshift(i),n}function Mg(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var i,r=bg(e,t,"root");2===r.length&&r[1].hasClass("tag")&&(i=r.pop());for(var s,o=[],a=[],l=0;l<r.length;l++)if(a.push(r[l]),r[l].hasClass("mbin")||r[l].hasClass("mrel")||r[l].hasClass("allowbreak")){for(var c=!1;l<r.length-1&&r[l+1].hasClass("mspace")&&!r[l+1].hasClass("newline");)l++,a.push(r[l]),r[l].hasClass("nobreak")&&(c=!0);c||(o.push(Cg(a,t)),a=[])}else r[l].hasClass("newline")&&(a.pop(),a.length>0&&(o.push(Cg(a,t)),a=[]),o.push(r[l]));a.length>0&&o.push(Cg(a,t)),n?((s=Cg(bg(n,t,!0))).classes=["tag"],o.push(s)):i&&o.push(i);var d=pg(["katex-html"],o);if(d.setAttribute("aria-hidden","true"),s){var h=s.children[0];h.style.height=Wf(d.height+d.depth),d.depth&&(h.style.verticalAlign=Wf(-d.depth))}return d}function zg(e){return new Rf(e)}class Ag{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Yf(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Tg&&this.children[n+1]instanceof Tg){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Tg;)i+=this.children[++n].toText();e.appendChild(new Tg(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=uf(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+uf(Yf(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class Tg{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return uf(this.toText())}toText(){return this.text}}var Pg={MathNode:Ag,TextNode:Tg,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Wf(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Wf(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:zg},Ng=function(e,t,n){return!d_[t][e]||!d_[t][e].replace||55349===e.charCodeAt(0)||z_.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=d_[t][e].replace),new Pg.TextNode(e)},Og=function(e){return 1===e.length?e[0]:new Pg.MathNode("mrow",e)},Rg=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var i=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var r=e.text;return df(["\\imath","\\jmath"],r)?null:(d_[i][r]&&d_[i][r].replace&&(r=d_[i][r].replace),If(r,eg.fontMap[n].fontName,i)?eg.fontMap[n].variant:null)};function Lg(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof Tg&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof Tg&&","===n.text}return!1}var Eg=function(e,t,n){if(1===e.length){var i=Ig(e[0],t);return n&&i instanceof Ag&&"mo"===i.type&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var r,s=[],o=0;o<e.length;o++){var a=Ig(e[o],t);if(a instanceof Ag&&r instanceof Ag){if("mtext"===a.type&&"mtext"===r.type&&a.getAttribute("mathvariant")===r.getAttribute("mathvariant")){r.children.push(...a.children);continue}if("mn"===a.type&&"mn"===r.type){r.children.push(...a.children);continue}if(Lg(a)&&"mn"===r.type){r.children.push(...a.children);continue}if("mn"===a.type&&Lg(r))a.children=[...r.children,...a.children],s.pop();else if(("msup"===a.type||"msub"===a.type)&&a.children.length>=1&&("mn"===r.type||Lg(r))){var l=a.children[0];l instanceof Ag&&"mn"===l.type&&(l.children=[...r.children,...l.children],s.pop())}else if("mi"===r.type&&1===r.children.length){var c=r.children[0];if(c instanceof Tg&&"̸"===c.text&&("mo"===a.type||"mi"===a.type||"mn"===a.type)){var d=a.children[0];d instanceof Tg&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(a),r=a}return s},Dg=function(e,t,n){return Og(Eg(e,t,n))},Ig=function(e,t){if(!e)return new Pg.MathNode("mrow");if(lg[e.type])return lg[e.type](e,t);throw new sf("Got group of unknown type: '"+e.type+"'")};function Bg(e,t,n,i,r){var s,o=Eg(e,n);s=1===o.length&&o[0]instanceof Ag&&df(["mrow","mtable"],o[0].type)?o[0]:new Pg.MathNode("mrow",o);var a=new Pg.MathNode("annotation",[new Pg.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new Pg.MathNode("semantics",[s,a]),c=new Pg.MathNode("math",[l]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),i&&c.setAttribute("display","block"),eg.makeSpan([r?"katex":"katex-mathml"],[c])}var jg={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},qg={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Hg=function(e){var t=new Pg.MathNode("mo",[new Pg.TextNode(jg[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Fg=function(e,t){var{span:n,minWidth:i,height:r}=function(){var n=4e5,i=e.label.slice(1);if(df(["widehat","widecheck","widetilde","utilde"],i)){var r,s,o,a="ordgroup"===(p=e.base).type?p.body.length:1;if(a>5)"widehat"===i||"widecheck"===i?(r=420,n=2364,o=.42,s=i+"4"):(r=312,n=2340,o=.34,s="tilde4");else{var l=[1,1,2,2,3,3][a];"widehat"===i||"widecheck"===i?(n=[0,1062,2364,2364,2364][l],r=[0,239,300,360,420][l],o=[0,.24,.3,.3,.36,.42][l],s=i+l):(n=[0,600,1033,2339,2340][l],r=[0,260,286,306,312][l],o=[0,.26,.286,.3,.306,.34][l],s="tilde"+l)}var c=new s_(s),d=new r_([c],{width:"100%",height:Wf(o),viewBox:"0 0 "+n+" "+r,preserveAspectRatio:"none"});return{span:eg.makeSvgSpan([],[d],t),minWidth:0,height:o}}var h,u,p,m=[],f=qg[i],[_,g,b]=f,y=b/1e3,v=_.length;if(1===v)h=["hide-tail"],u=[f[3]];else if(2===v)h=["halfarrow-left","halfarrow-right"],u=["xMinYMin","xMaxYMin"];else{if(3!==v)throw new Error("Correct katexImagesData or update code here to support\n "+v+" children.");h=["brace-left","brace-center","brace-right"],u=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<v;w++){var x=new s_(_[w]),k=new r_([x],{width:"400em",height:Wf(y),viewBox:"0 0 "+n+" "+b,preserveAspectRatio:u[w]+" slice"}),S=eg.makeSvgSpan([h[w]],[k],t);if(1===v)return{span:S,minWidth:g,height:y};S.style.height=Wf(y),m.push(S)}return{span:eg.makeSpan(["stretchy"],m,t),minWidth:g,height:y}}();return n.height=r,n.style.height=Wf(r),i>0&&(n.style.minWidth=Wf(i)),n};function $g(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Gg(e){var t=Vg(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Vg(e){return e&&("atom"===e.type||c_.hasOwnProperty(e.type))?e:null}var Ug=(e,t)=>{var n,i,r;e&&"supsub"===e.type?(n=(i=$g(e.base,"accent")).base,e.base=n,r=function(e){if(e instanceof Zf)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Sg(e,t)),e.base=i):n=(i=$g(e,"accent")).base;var s=Sg(n,t.havingCrampedStyle()),o=0;if(i.isShifty&&ff(n)){var a=mf(n);o=a_(Sg(a,t.havingCrampedStyle())).skew}var l,c="\\c"===i.label,d=c?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(i.isStretchy)l=Fg(i,t),l=eg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Wf(2*o)+")",marginLeft:Wf(2*o)}:void 0}]},t);else{var h,u;"\\vec"===i.label?(h=eg.staticSvg("vec",t),u=eg.svgData.vec[1]):((h=a_(h=eg.makeOrd({mode:i.mode,text:i.label},t,"textord"))).italic=0,u=h.width,c&&(d+=h.depth)),l=eg.makeSpan(["accent-body"],[h]);var p="\\textcircled"===i.label;p&&(l.classes.push("accent-full"),d=s.height);var m=o;p||(m-=u/2),l.style.left=Wf(m),"\\textcircled"===i.label&&(l.style.top=".2em"),l=eg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:l}]},t)}var f=eg.makeSpan(["mord","accent"],[l],t);return r?(r.children[0]=f,r.height=Math.max(f.height,r.height),r.classes[0]="mord",r):f},Wg=(e,t)=>{var n=e.isStretchy?Hg(e.label):new Pg.MathNode("mo",[Ng(e.label,e.mode)]),i=new Pg.MathNode("mover",[Ig(e.base,t),n]);return i.setAttribute("accent","true"),i},Yg=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));cg({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=hg(t[0]),i=!Yg.test(e.funcName),r=!i||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:i,isShifty:r,base:n}},htmlBuilder:Ug,mathmlBuilder:Wg}),cg({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],i=e.parser.mode;return"math"===i&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),i="text"),{type:"accent",mode:i,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Ug,mathmlBuilder:Wg}),cg({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"accentUnder",mode:n.mode,label:i,base:r}},htmlBuilder:(e,t)=>{var n=Sg(e.base,t),i=Fg(e,t),r="\\utilde"===e.label?.12:0,s=eg.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:i,wrapperClasses:["svg-align"]},{type:"kern",size:r},{type:"elem",elem:n}]},t);return eg.makeSpan(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{var n=Hg(e.label),i=new Pg.MathNode("munder",[Ig(e.base,t),n]);return i.setAttribute("accentunder","true"),i}});var Xg=e=>{var t=new Pg.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};cg({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:i,funcName:r}=e;return{type:"xArrow",mode:i.mode,label:r,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,i=t.style,r=t.havingStyle(i.sup()),s=eg.wrapFragment(Sg(e.body,r,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";s.classes.push(o+"-arrow-pad"),e.below&&(r=t.havingStyle(i.sub()),(n=eg.wrapFragment(Sg(e.below,r,t),t)).classes.push(o+"-arrow-pad"));var a,l=Fg(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;if((s.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=s.depth),n){var h=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;a=eg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:h}]},t)}else a=eg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},t);return a.children[0].children[0].children[1].classes.push("svg-align"),eg.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var n,i=Hg(e.label);if(i.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var r=Xg(Ig(e.body,t));if(e.below){var s=Xg(Ig(e.below,t));n=new Pg.MathNode("munderover",[i,s,r])}else n=new Pg.MathNode("mover",[i,r])}else if(e.below){var o=Xg(Ig(e.below,t));n=new Pg.MathNode("munder",[i,o])}else n=Xg(),n=new Pg.MathNode("mover",[i,n]);return n}});var Kg=eg.makeSpan;function Jg(e,t){var n=bg(e.body,t,!0);return Kg([e.mclass],n,t)}function Qg(e,t){var n,i=Eg(e.body,t);return"minner"===e.mclass?n=new Pg.MathNode("mpadded",i):"mord"===e.mclass?e.isCharacterBox?(n=i[0]).type="mi":n=new Pg.MathNode("mi",i):(e.isCharacterBox?(n=i[0]).type="mo":n=new Pg.MathNode("mo",i),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}cg({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+i.slice(5),body:ug(r),isCharacterBox:ff(r)}},htmlBuilder:Jg,mathmlBuilder:Qg});var Zg=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};cg({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Zg(t[0]),body:ug(t[1]),isCharacterBox:ff(t[1])}}}),cg({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:i,funcName:r}=e,s=t[1],o=t[0];n="\\stackrel"!==r?Zg(s):"mrel";var a={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==r,body:ug(s)},l={type:"supsub",mode:o.mode,base:a,sup:"\\underset"===r?null:o,sub:"\\underset"===r?o:null};return{type:"mclass",mode:i.mode,mclass:n,body:[l],isCharacterBox:ff(l)}},htmlBuilder:Jg,mathmlBuilder:Qg}),cg({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Zg(t[0]),body:ug(t[0])}},htmlBuilder(e,t){var n=bg(e.body,t,!0),i=eg.makeSpan([e.mclass],n,t);return i.style.textShadow="0.02em 0.01em 0.04px",i},mathmlBuilder(e,t){var n=Eg(e.body,t),i=new Pg.MathNode("mstyle",n);return i.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),i}});var eb={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},tb=()=>({type:"styling",body:[],mode:"math",style:"display"}),nb=e=>"textord"===e.type&&"@"===e.text,ib=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function rb(e,t,n){var i=eb[e];switch(i){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(i,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var r={type:"atom",text:i,mode:"math",family:"rel"},s={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[r],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[s],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}cg({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e;return{type:"cdlabel",mode:n.mode,side:i.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),i=eg.wrapFragment(Sg(e.label,n,t),t);return i.classes.push("cd-label-"+e.side),i.style.bottom=Wf(.8-i.depth),i.height=0,i.depth=0,i},mathmlBuilder(e,t){var n=new Pg.MathNode("mrow",[Ig(e.label,t)]);return(n=new Pg.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new Pg.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),cg({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=eg.wrapFragment(Sg(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new Pg.MathNode("mrow",[Ig(e.fragment,t)])}),cg({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,i=$g(t[0],"ordgroup").body,r="",s=0;s<i.length;s++)r+=$g(i[s],"textord").text;var o,a=parseInt(r);if(isNaN(a))throw new sf("\\@char has non-numeric argument "+r);if(a<0||a>=1114111)throw new sf("\\@char with invalid code point "+r);return a<=65535?o=String.fromCharCode(a):(a-=65536,o=String.fromCharCode(55296+(a>>10),56320+(1023&a))),{type:"textord",mode:n.mode,text:o}}});var sb=(e,t)=>{var n=bg(e.body,t.withColor(e.color),!1);return eg.makeFragment(n)},ob=(e,t)=>{var n=Eg(e.body,t.withColor(e.color)),i=new Pg.MathNode("mstyle",n);return i.setAttribute("mathcolor",e.color),i};cg({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,i=$g(t[0],"color-token").color,r=t[1];return{type:"color",mode:n.mode,color:i,body:ug(r)}},htmlBuilder:sb,mathmlBuilder:ob}),cg({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:i}=e,r=$g(t[0],"color-token").color;n.gullet.macros.set("\\current@color",r);var s=n.parseExpression(!0,i);return{type:"color",mode:n.mode,color:r,body:s}},htmlBuilder:sb,mathmlBuilder:ob}),cg({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:i}=e,r="["===i.gullet.future().text?i.parseSizeGroup(!0):null,s=!i.settings.displayMode||!i.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:i.mode,newLine:s,size:r&&$g(r,"size").value}},htmlBuilder(e,t){var n=eg.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Wf(Uf(e.size,t)))),n},mathmlBuilder(e,t){var n=new Pg.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Wf(Uf(e.size,t)))),n}});var ab={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},lb=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new sf("Expected a control sequence",e);return t},cb=(e,t,n,i)=>{var r=e.gullet.macros.get(n.text);null==r&&(n.noexpand=!0,r={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,r,i)};cg({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var i=t.fetch();if(ab[i.text])return"\\global"!==n&&"\\\\globallong"!==n||(i.text=ab[i.text]),$g(t.parseFunction(),"internal");throw new sf("Invalid token after macro prefix",i)}}),cg({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=t.gullet.popToken(),r=i.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(r))throw new sf("Expected a control sequence",i);for(var s,o=0,a=[[]];"{"!==t.gullet.future().text;)if("#"===(i=t.gullet.popToken()).text){if("{"===t.gullet.future().text){s=t.gullet.future(),a[o].push("{");break}if(i=t.gullet.popToken(),!/^[1-9]$/.test(i.text))throw new sf('Invalid argument number "'+i.text+'"');if(parseInt(i.text)!==o+1)throw new sf('Argument number "'+i.text+'" out of order');o++,a.push([])}else{if("EOF"===i.text)throw new sf("Expected a macro definition");a[o].push(i.text)}var{tokens:l}=t.gullet.consumeArg();return s&&l.unshift(s),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(r,{tokens:l,numArgs:o,delimiters:a},n===ab[n]),{type:"internal",mode:t.mode}}}),cg({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=lb(t.gullet.popToken());t.gullet.consumeSpaces();var r=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return cb(t,i,r,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),cg({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=lb(t.gullet.popToken()),r=t.gullet.popToken(),s=t.gullet.popToken();return cb(t,i,s,"\\\\globalfuture"===n),t.gullet.pushToken(s),t.gullet.pushToken(r),{type:"internal",mode:t.mode}}});var db=function(e,t,n){var i=If(d_.math[e]&&d_.math[e].replace||e,t,n);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return i},hb=function(e,t,n,i){var r=n.havingBaseStyle(t),s=eg.makeSpan(i.concat(r.sizingClasses(n)),[e],n),o=r.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=r.sizeMultiplier,s},ub=function(e,t,n){var i=t.havingBaseStyle(n),r=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Wf(r),e.height-=r,e.depth+=r},pb=function(e,t,n,i,r,s){var o=function(e,t,n,i){return eg.makeSymbol(e,"Size"+t+"-Regular",n,i)}(e,t,r,i),a=hb(eg.makeSpan(["delimsizing","size"+t],[o],i),Af.TEXT,i,s);return n&&ub(a,i,Af.TEXT),a},mb=function(e,t,n){return{type:"elem",elem:eg.makeSpan(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[eg.makeSpan([],[eg.makeSymbol(e,t,n)])])}},fb=function(e,t,n){var i=Lf["Size4-Regular"][e.charCodeAt(0)]?Lf["Size4-Regular"][e.charCodeAt(0)][4]:Lf["Size1-Regular"][e.charCodeAt(0)][4],r=new s_("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),s=new r_([r],{width:Wf(i),height:Wf(t),style:"width:"+Wf(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=eg.makeSvgSpan([],[s],n);return o.height=t,o.style.height=Wf(t),o.style.width=Wf(i),{type:"elem",elem:o}},_b={type:"kern",size:-.008},gb=["|","\\lvert","\\rvert","\\vert"],bb=["\\|","\\lVert","\\rVert","\\Vert"],yb=function(e,t,n,i,r,s){var o,a,l,c,d="",h=0;o=l=c=e,a=null;var u="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?o=l="⏐":"\\Downarrow"===e?o=l="‖":"\\updownarrow"===e?(o="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",l="‖",c="\\Downarrow"):df(gb,e)?(l="∣",d="vert",h=333):df(bb,e)?(l="∥",d="doublevert",h=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",c="⎣",u="Size4-Regular",d="lbrack",h=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",c="⎦",u="Size4-Regular",d="rbrack",h=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",c="⎣",u="Size4-Regular",d="lfloor",h=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=c="⎢",u="Size4-Regular",d="lceil",h=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",c="⎦",u="Size4-Regular",d="rfloor",h=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=c="⎥",u="Size4-Regular",d="rceil",h=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",c="⎝",u="Size4-Regular",d="lparen",h=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",c="⎠",u="Size4-Regular",d="rparen",h=875):"\\{"===e||"\\lbrace"===e?(o="⎧",a="⎨",c="⎩",l="⎪",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",a="⎬",c="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",c="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",c="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",c="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",c="⎩",l="⎪",u="Size4-Regular");var p=db(o,u,r),m=p.height+p.depth,f=db(l,u,r),_=f.height+f.depth,g=db(c,u,r),b=g.height+g.depth,y=0,v=1;if(null!==a){var w=db(a,u,r);y=w.height+w.depth,v=2}var x=m+b+y,k=x+Math.max(0,Math.ceil((t-x)/(v*_)))*v*_,S=i.fontMetrics().axisHeight;n&&(S*=i.sizeMultiplier);var C=k/2-S,M=[];if(d.length>0){var z=k-m-b,A=Math.round(1e3*k),T=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*z)),P=new s_(d,T),N=(h/1e3).toFixed(3)+"em",O=(A/1e3).toFixed(3)+"em",R=new r_([P],{width:N,height:O,viewBox:"0 0 "+h+" "+A}),L=eg.makeSvgSpan([],[R],i);L.height=A/1e3,L.style.width=N,L.style.height=O,M.push({type:"elem",elem:L})}else{if(M.push(mb(c,u,r)),M.push(_b),null===a){var E=k-m-b+.016;M.push(fb(l,E,i))}else{var D=(k-m-b-y)/2+.016;M.push(fb(l,D,i)),M.push(_b),M.push(mb(a,u,r)),M.push(_b),M.push(fb(l,D,i))}M.push(_b),M.push(mb(o,u,r))}var I=i.havingBaseStyle(Af.TEXT),B=eg.makeVList({positionType:"bottom",positionData:C,children:M},I);return hb(eg.makeSpan(["delimsizing","mult"],[B],I),Af.TEXT,i,s)},vb=.08,wb=function(e,t,n,i,r){var s=function(e,t,n){t*=1e3;var i="";switch(e){case"sqrtMain":i=function(e){return"M95,"+(622+e+80)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize1":i=function(e){return"M263,"+(601+e+80)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize2":i=function(e){return"M983 "+(10+e+80)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize3":i=function(e){return"M424,"+(2398+e+80)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" 80\nh400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize4":i=function(e){return"M473,"+(2713+e+80)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" 80h400000v"+(40+e)+"H1017.7z"}(t);break;case"sqrtTall":i=function(e,t,n){return"M702 "+(e+80)+"H400000"+(40+e)+"\nH742v"+(n-54-80-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v"+(40+e)+"H742z"}(t,0,n)}return i}(e,i,n),o=new s_(e,s),a=new r_([o],{width:"400em",height:Wf(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return eg.makeSvgSpan(["hide-tail"],[a],r)},xb=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],kb=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Sb=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Cb=[0,1.2,1.8,2.4,3],Mb=[{type:"small",style:Af.SCRIPTSCRIPT},{type:"small",style:Af.SCRIPT},{type:"small",style:Af.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],zb=[{type:"small",style:Af.SCRIPTSCRIPT},{type:"small",style:Af.SCRIPT},{type:"small",style:Af.TEXT},{type:"stack"}],Ab=[{type:"small",style:Af.SCRIPTSCRIPT},{type:"small",style:Af.SCRIPT},{type:"small",style:Af.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Tb=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Pb=function(e,t,n,i){for(var r=Math.min(2,3-i.style.size);r<n.length&&"stack"!==n[r].type;r++){var s=db(e,Tb(n[r]),"math"),o=s.height+s.depth;if("small"===n[r].type&&(o*=i.havingBaseStyle(n[r].style).sizeMultiplier),o>t)return n[r]}return n[n.length-1]},Nb=function(e,t,n,i,r,s){var o;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),o=df(Sb,e)?Mb:df(xb,e)?Ab:zb;var a=Pb(e,t,o,i);return"small"===a.type?function(e,t,n,i,r,s){var o=eg.makeSymbol(e,"Main-Regular",r,i),a=hb(o,t,i,s);return n&&ub(a,i,t),a}(e,a.style,n,i,r,s):"large"===a.type?pb(e,a.size,n,i,r,s):yb(e,t,n,i,r,s)},Ob={sqrtImage:function(e,t){var n,i,r=t.havingBaseSizing(),s=Pb("\\surd",e*r.sizeMultiplier,Ab,r),o=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,d=0;return"small"===s.type?(e<1?o=1:e<1.4&&(o=.7),c=(1+a)/o,(n=wb("sqrtMain",l=(1+a+vb)/o,d=1e3+1e3*a+80,a,t)).style.minWidth="0.853em",i=.833/o):"large"===s.type?(d=1080*Cb[s.size],c=(Cb[s.size]+a)/o,l=(Cb[s.size]+a+vb)/o,(n=wb("sqrtSize"+s.size,l,d,a,t)).style.minWidth="1.02em",i=1/o):(l=e+a+vb,c=e+a,d=Math.floor(1e3*e+a)+80,(n=wb("sqrtTall",l,d,a,t)).style.minWidth="0.742em",i=1.056),n.height=c,n.style.height=Wf(l),{span:n,advanceWidth:i,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*o}},sizedDelim:function(e,t,n,i,r){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),df(xb,e)||df(Sb,e))return pb(e,t,!1,n,i,r);if(df(kb,e))return yb(e,Cb[t],!1,n,i,r);throw new sf("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Cb,customSizedDelim:Nb,leftRightDelim:function(e,t,n,i,r,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,a=5/i.fontMetrics().ptPerEm,l=Math.max(t-o,n+o),c=Math.max(l/500*901,2*l-a);return Nb(e,c,!0,i,r,s)}},Rb={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Lb=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Eb(e,t){var n=Vg(e);if(n&&df(Lb,n.text))return n;throw new sf(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Db(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}cg({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Eb(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Rb[e.funcName].size,mclass:Rb[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?eg.makeSpan([e.mclass]):Ob.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(Ng(e.delim,e.mode));var n=new Pg.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var i=Wf(Ob.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",i),n.setAttribute("maxsize",i),n}}),cg({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new sf("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Eb(t[0],e).text,color:n}}}),cg({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Eb(t[0],e),i=e.parser;++i.leftrightDepth;var r=i.parseExpression(!1);--i.leftrightDepth,i.expect("\\right",!1);var s=$g(i.parseFunction(),"leftright-right");return{type:"leftright",mode:i.mode,body:r,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{Db(e);for(var n,i,r=bg(e.body,t,!0,["mopen","mclose"]),s=0,o=0,a=!1,l=0;l<r.length;l++)r[l].isMiddle?a=!0:(s=Math.max(r[l].height,s),o=Math.max(r[l].depth,o));if(s*=t.sizeMultiplier,o*=t.sizeMultiplier,n="."===e.left?kg(t,["mopen"]):Ob.leftRightDelim(e.left,s,o,t,e.mode,["mopen"]),r.unshift(n),a)for(var c=1;c<r.length;c++){var d=r[c].isMiddle;d&&(r[c]=Ob.leftRightDelim(d.delim,s,o,d.options,e.mode,[]))}if("."===e.right)i=kg(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;i=Ob.leftRightDelim(e.right,s,o,h,e.mode,["mclose"])}return r.push(i),eg.makeSpan(["minner"],r,t)},mathmlBuilder:(e,t)=>{Db(e);var n=Eg(e.body,t);if("."!==e.left){var i=new Pg.MathNode("mo",[Ng(e.left,e.mode)]);i.setAttribute("fence","true"),n.unshift(i)}if("."!==e.right){var r=new Pg.MathNode("mo",[Ng(e.right,e.mode)]);r.setAttribute("fence","true"),e.rightColor&&r.setAttribute("mathcolor",e.rightColor),n.push(r)}return Og(n)}}),cg({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Eb(t[0],e);if(!e.parser.leftrightDepth)throw new sf("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=kg(t,[]);else{n=Ob.sizedDelim(e.delim,1,t,e.mode,[]);var i={delim:e.delim,options:t};n.isMiddle=i}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?Ng("|","text"):Ng(e.delim,e.mode),i=new Pg.MathNode("mo",[n]);return i.setAttribute("fence","true"),i.setAttribute("lspace","0.05em"),i.setAttribute("rspace","0.05em"),i}});var Ib=(e,t)=>{var n,i,r,s=eg.wrapFragment(Sg(e.body,t),t),o=e.label.slice(1),a=t.sizeMultiplier,l=0,c=ff(e.body);if("sout"===o)(n=eg.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,l=-.5*t.fontMetrics().xHeight;else if("phase"===o){var d=Uf({number:.6,unit:"pt"},t),h=Uf({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var u=s.height+s.depth+d+h;s.style.paddingLeft=Wf(u/2+d);var p=Math.floor(1e3*u*a),m="M400000 "+(i=p)+" H0 L"+i/2+" 0 l65 45 L145 "+(i-80)+" H400000z",f=new r_([new s_("phase",m)],{width:"400em",height:Wf(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});(n=eg.makeSvgSpan(["hide-tail"],[f],t)).style.height=Wf(u),l=s.depth+d+h}else{/cancel/.test(o)?c||s.classes.push("cancel-pad"):"angl"===o?s.classes.push("anglpad"):s.classes.push("boxpad");var _=0,g=0,b=0;/box/.test(o)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=_=t.fontMetrics().fboxsep+("colorbox"===o?0:b)):"angl"===o?(_=4*(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-s.depth)):g=_=c?.2:0,n=function(e,t,n,i,r){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(s=eg.makeSpan(["stretchy",t],[],r),"fbox"===t){var a=r.color&&r.getColor();a&&(s.style.borderColor=a)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new o_({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new o_({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new r_(l,{width:"100%",height:Wf(o)});s=eg.makeSvgSpan([],[c],r)}return s.height=o,s.style.height=Wf(o),s}(s,o,_,g,t),/fbox|boxed|fcolorbox/.test(o)?(n.style.borderStyle="solid",n.style.borderWidth=Wf(b)):"angl"===o&&.049!==b&&(n.style.borderTopWidth=Wf(b),n.style.borderRightWidth=Wf(b)),l=s.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=eg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:l},{type:"elem",elem:s,shift:0}]},t);else{var y=/cancel|phase/.test(o)?["svg-align"]:[];r=eg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:n,shift:l,wrapperClasses:y}]},t)}return/cancel/.test(o)&&(r.height=s.height,r.depth=s.depth),/cancel/.test(o)&&!c?eg.makeSpan(["mord","cancel-lap"],[r],t):eg.makeSpan(["mord"],[r],t)},Bb=(e,t)=>{var n=0,i=new Pg.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Ig(e.body,t)]);switch(e.label){case"\\cancel":i.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":i.setAttribute("notation","downdiagonalstrike");break;case"\\phase":i.setAttribute("notation","phasorangle");break;case"\\sout":i.setAttribute("notation","horizontalstrike");break;case"\\fbox":i.setAttribute("notation","box");break;case"\\angl":i.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,i.setAttribute("width","+"+2*n+"pt"),i.setAttribute("height","+"+2*n+"pt"),i.setAttribute("lspace",n+"pt"),i.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var r=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);i.setAttribute("style","border: "+r+"em solid "+String(e.borderColor))}break;case"\\xcancel":i.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&i.setAttribute("mathbackground",e.backgroundColor),i};cg({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:i,funcName:r}=e,s=$g(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:i.mode,label:r,backgroundColor:s,body:o}},htmlBuilder:Ib,mathmlBuilder:Bb}),cg({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:i,funcName:r}=e,s=$g(t[0],"color-token").color,o=$g(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:i.mode,label:r,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:Ib,mathmlBuilder:Bb}),cg({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),cg({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"enclose",mode:n.mode,label:i,body:r}},htmlBuilder:Ib,mathmlBuilder:Bb}),cg({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var jb={};function qb(e){for(var{type:t,names:n,props:i,handler:r,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:i.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:r},l=0;l<n.length;++l)jb[n[l]]=a;s&&(ag[t]=s),o&&(lg[t]=o)}var Hb={};function Fb(e,t){Hb[e]=t}function $b(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var Gb=e=>{if(!e.parser.settings.displayMode)throw new sf("{"+e.envName+"} can be used only in display mode.")};function Vb(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Ub(e,t,n){var{hskipBeforeAndAfter:i,addJot:r,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:h,leqno:u}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)o=1;else if(!(o=parseFloat(p))||o<0)throw new sf("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],_=[],g=[],b=null!=l?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function v(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new rf("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(y(),g.push($b(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),m.push(w);var x=e.fetch().text;if("&"===x){if(h&&m.length===h){if(c||a)throw new sf("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){v(),1===m.length&&"styling"===w.type&&0===w.body[0].body.length&&(f.length>1||!d)&&f.pop(),g.length<f.length+1&&g.push([]);break}if("\\\\"!==x)throw new sf("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),_.push(k?k.value:null),v(),g.push($b(e)),m=[],f.push(m),y()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:r,arraystretch:o,body:f,cols:s,rowGaps:_,hskipBeforeAndAfter:i,hLinesBeforeRow:g,colSeparationType:a,tags:b,leqno:u}}function Wb(e){return"d"===e.slice(0,1)?"display":"text"}var Yb=function(e,t){var n,i,r=e.body.length,s=e.hLinesBeforeRow,o=0,a=new Array(r),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,h=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(h=t.havingStyle(Af.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var u="CD"===e.colSeparationType?Uf({number:3,unit:"ex"},t):12*d,p=3*d,m=e.arraystretch*u,f=.7*m,_=.3*m,g=0;function b(e){for(var t=0;t<e.length;++t)t>0&&(g+=.25),l.push({pos:g,isDashed:e[t]})}for(b(s[0]),n=0;n<e.body.length;++n){var y=e.body[n],v=f,w=_;o<y.length&&(o=y.length);var x=new Array(y.length);for(i=0;i<y.length;++i){var k=Sg(y[i],t);w<k.depth&&(w=k.depth),v<k.height&&(v=k.height),x[i]=k}var S=e.rowGaps[n],C=0;S&&(C=Uf(S,t))>0&&(w<(C+=_)&&(w=C),C=0),e.addJot&&(w+=p),x.height=v,x.depth=w,g+=v,x.pos=g,g+=w+C,a[n]=x,b(s[n+1])}var M,z,A=g/2+t.fontMetrics().axisHeight,T=e.cols||[],P=[],N=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<r;++n){var O=a[n],R=O.pos-A,L=e.tags[n],E=void 0;(E=!0===L?eg.makeSpan(["eqn-num"],[],t):eg.makeSpan([],!1===L?[]:bg(L,t,!0),t)).depth=O.depth,E.height=O.height,N.push({type:"elem",elem:E,shift:R})}for(i=0,z=0;i<o||z<T.length;++i,++z){for(var D=T[z]||{},I=!0;"separator"===D.type;){if(I||((M=eg.makeSpan(["arraycolsep"],[])).style.width=Wf(t.fontMetrics().doubleRuleSep),P.push(M)),"|"!==D.separator&&":"!==D.separator)throw new sf("Invalid separator type: "+D.separator);var B="|"===D.separator?"solid":"dashed",j=eg.makeSpan(["vertical-separator"],[],t);j.style.height=Wf(g),j.style.borderRightWidth=Wf(c),j.style.borderRightStyle=B,j.style.margin="0 "+Wf(-c/2);var q=g-A;q&&(j.style.verticalAlign=Wf(-q)),P.push(j),D=T[++z]||{},I=!1}if(!(i>=o)){var H=void 0;(i>0||e.hskipBeforeAndAfter)&&0!==(H=hf(D.pregap,h))&&((M=eg.makeSpan(["arraycolsep"],[])).style.width=Wf(H),P.push(M));var F=[];for(n=0;n<r;++n){var $=a[n],G=$[i];if(G){var V=$.pos-A;G.depth=$.depth,G.height=$.height,F.push({type:"elem",elem:G,shift:V})}}F=eg.makeVList({positionType:"individualShift",children:F},t),F=eg.makeSpan(["col-align-"+(D.align||"c")],[F]),P.push(F),(i<o-1||e.hskipBeforeAndAfter)&&0!==(H=hf(D.postgap,h))&&((M=eg.makeSpan(["arraycolsep"],[])).style.width=Wf(H),P.push(M))}}if(a=eg.makeSpan(["mtable"],P),l.length>0){for(var U=eg.makeLineSpan("hline",t,c),W=eg.makeLineSpan("hdashline",t,c),Y=[{type:"elem",elem:a,shift:0}];l.length>0;){var X=l.pop(),K=X.pos-A;X.isDashed?Y.push({type:"elem",elem:W,shift:K}):Y.push({type:"elem",elem:U,shift:K})}a=eg.makeVList({positionType:"individualShift",children:Y},t)}if(0===N.length)return eg.makeSpan(["mord"],[a],t);var J=eg.makeVList({positionType:"individualShift",children:N},t);return J=eg.makeSpan(["tag"],[J],t),eg.makeFragment([a,J])},Xb={c:"center ",l:"left ",r:"right "},Kb=function(e,t){for(var n=[],i=new Pg.MathNode("mtd",[],["mtr-glue"]),r=new Pg.MathNode("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var o=e.body[s],a=[],l=0;l<o.length;l++)a.push(new Pg.MathNode("mtd",[Ig(o[l],t)]));e.tags&&e.tags[s]&&(a.unshift(i),a.push(i),e.leqno?a.unshift(r):a.push(r)),n.push(new Pg.MathNode("mtr",a))}var c=new Pg.MathNode("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",Wf(d));var h="",u="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,_=0,g=p.length;"separator"===p[0].type&&(h+="top ",_=1),"separator"===p[p.length-1].type&&(h+="bottom ",g-=1);for(var b=_;b<g;b++)"align"===p[b].type?(u+=Xb[p[b].align],f&&(m+="none "),f=!0):"separator"===p[b].type&&f&&(m+="|"===p[b].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",u.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){for(var y=e.cols||[],v="",w=1;w<y.length;w++)v+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",v.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;h+=k[0].length>0?"left ":"",h+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==h&&(c=new Pg.MathNode("menclose",[c])).setAttribute("notation",h.trim()),e.arraystretch&&e.arraystretch<1&&(c=new Pg.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},Jb=function(e,t){-1===e.envName.indexOf("ed")&&Gb(e);var n,i=[],r=e.envName.indexOf("at")>-1?"alignat":"align",s="split"===e.envName,o=Ub(e.parser,{cols:i,addJot:!0,autoTag:s?void 0:Vb(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",d=0;d<t[0].body.length;d++)c+=$g(t[0].body[d],"textord").text;n=Number(c),a=2*n}var h=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var i=$g(e[t],"styling");$g(i.body[0],"ordgroup").body.unshift(l)}if(h)a<e.length&&(a=e.length);else{var r=e.length/2;if(n<r)throw new sf("Too many math in a row: expected "+n+", but got "+r,e[0])}});for(var u=0;u<a;++u){var p="r",m=0;u%2==1?p="l":u>0&&h&&(m=1),i[u]={type:"align",align:p,pregap:m,postgap:0}}return o.colSeparationType=h?"align":"alignat",o};qb({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Vg(t[0])?[t[0]]:$g(t[0],"ordgroup").body).map(function(e){var t=Gg(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new sf("Unknown column alignment: "+t,e)}),i={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Ub(e.parser,i,Wb(e.envName))},htmlBuilder:Yb,mathmlBuilder:Kb}),qb({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",i={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var r=e.parser;if(r.consumeSpaces(),"["===r.fetch().text){if(r.consume(),r.consumeSpaces(),n=r.fetch().text,-1==="lcr".indexOf(n))throw new sf("Expected l or c or r",r.nextToken);r.consume(),r.consumeSpaces(),r.expect("]"),r.consume(),i.cols=[{type:"align",align:n}]}}var s=Ub(e.parser,i,Wb(e.envName)),o=Math.max(0,...s.body.map(e=>e.length));return s.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:Yb,mathmlBuilder:Kb}),qb({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=Ub(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Yb,mathmlBuilder:Kb}),qb({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Vg(t[0])?[t[0]]:$g(t[0],"ordgroup").body).map(function(e){var t=Gg(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new sf("Unknown column alignment: "+t,e)});if(n.length>1)throw new sf("{subarray} can contain only one column");var i={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((i=Ub(e.parser,i,"script")).body.length>0&&i.body[0].length>1)throw new sf("{subarray} can contain only one column");return i},htmlBuilder:Yb,mathmlBuilder:Kb}),qb({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=Ub(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Wb(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Yb,mathmlBuilder:Kb}),qb({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Jb,htmlBuilder:Yb,mathmlBuilder:Kb}),qb({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){df(["gather","gather*"],e.envName)&&Gb(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Vb(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Ub(e.parser,t,"display")},htmlBuilder:Yb,mathmlBuilder:Kb}),qb({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Jb,htmlBuilder:Yb,mathmlBuilder:Kb}),qb({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Gb(e);var t={autoTag:Vb(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Ub(e.parser,t,"display")},htmlBuilder:Yb,mathmlBuilder:Kb}),qb({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Gb(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new sf("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var i=[],r=[i],s=0;s<t.length;s++){for(var o=t[s],a=tb(),l=0;l<o.length;l++)if(nb(o[l])){i.push(a);var c=Gg(o[l+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(c)>-1);else{if(!("<>AV".indexOf(c)>-1))throw new sf('Expected one of "<>AV=|." after @',o[l]);for(var h=0;h<2;h++){for(var u=!0,p=l+1;p<o.length;p++){if(ib(o[p],c)){u=!1,l=p;break}if(nb(o[p]))throw new sf("Missing a "+c+" character to complete a CD arrow.",o[p]);d[h].body.push(o[p])}if(u)throw new sf("Missing a "+c+" character to complete a CD arrow.",o[l])}}var m={type:"styling",body:[rb(c,d,e)],mode:"math",style:"display"};i.push(m),a=tb()}else a.body.push(o[l]);s%2==0?i.push(a):i.shift(),i=[],r.push(i)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:r,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(r[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(r.length+1).fill([])}}(e.parser)),htmlBuilder:Yb,mathmlBuilder:Kb}),Fb("\\nonumber","\\gdef\\@eqnsw{0}"),Fb("\\notag","\\nonumber"),cg({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new sf(e.funcName+" valid only within array environment")}});var Qb=jb;cg({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];if("ordgroup"!==r.type)throw new sf("Invalid environment name",r);for(var s="",o=0;o<r.body.length;++o)s+=$g(r.body[o],"textord").text;if("\\begin"===i){if(!Qb.hasOwnProperty(s))throw new sf("No such environment: "+s,r);var a=Qb[s],{args:l,optArgs:c}=n.parseArguments("\\begin{"+s+"}",a),d={mode:n.mode,envName:s,parser:n},h=a.handler(d,l,c);n.expect("\\end",!1);var u=n.nextToken,p=$g(n.parseFunction(),"environment");if(p.name!==s)throw new sf("Mismatch: \\begin{"+s+"} matched by \\end{"+p.name+"}",u);return h}return{type:"environment",mode:n.mode,name:s,nameGroup:r}}});var Zb=(e,t)=>{var n=e.font,i=t.withFont(n);return Sg(e.body,i)},ey=(e,t)=>{var n=e.font,i=t.withFont(n);return Ig(e.body,i)},ty={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};cg({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=hg(t[0]),s=i;return s in ty&&(s=ty[s]),{type:"font",mode:n.mode,font:s.slice(1),body:r}},htmlBuilder:Zb,mathmlBuilder:ey}),cg({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,i=t[0],r=ff(i);return{type:"mclass",mode:n.mode,mclass:Zg(i),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:i}],isCharacterBox:r}}}),cg({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:i,breakOnTokenText:r}=e,{mode:s}=n,o=n.parseExpression(!0,r);return{type:"font",mode:s,font:"math"+i.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:Zb,mathmlBuilder:ey});var ny=(e,t)=>{var n=t;return"display"===e?n=n.id>=Af.SCRIPT.id?n.text():Af.DISPLAY:"text"===e&&n.size===Af.DISPLAY.size?n=Af.TEXT:"script"===e?n=Af.SCRIPT:"scriptscript"===e&&(n=Af.SCRIPTSCRIPT),n},iy=(e,t)=>{var n,i=ny(e.size,t.style),r=i.fracNum(),s=i.fracDen();n=t.havingStyle(r);var o=Sg(e.numer,n,t);if(e.continued){var a=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}n=t.havingStyle(s);var c,d,h,u,p,m,f,_,g,b,y=Sg(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=Uf(e.barSize,t),c=eg.makeLineSpan("frac-line",t,d)):c=eg.makeLineSpan("frac-line",t),d=c.height,h=c.height):(c=null,d=0,h=t.fontMetrics().defaultRuleThickness),i.size===Af.DISPLAY.size||"display"===e.size?(u=t.fontMetrics().num1,p=d>0?3*h:7*h,m=t.fontMetrics().denom1):(d>0?(u=t.fontMetrics().num2,p=h):(u=t.fontMetrics().num3,p=3*h),m=t.fontMetrics().denom2),c){var v=t.fontMetrics().axisHeight;u-o.depth-(v+.5*d)<p&&(u+=p-(u-o.depth-(v+.5*d))),v-.5*d-(y.height-m)<p&&(m+=p-(v-.5*d-(y.height-m))),f=eg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:m},{type:"elem",elem:c,shift:-(v-.5*d)},{type:"elem",elem:o,shift:-u}]},t)}else{var w=u-o.depth-(y.height-m);w<p&&(u+=.5*(p-w),m+=.5*(p-w)),f=eg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:m},{type:"elem",elem:o,shift:-u}]},t)}return n=t.havingStyle(i),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,_=i.size===Af.DISPLAY.size?t.fontMetrics().delim1:i.size===Af.SCRIPTSCRIPT.size?t.havingStyle(Af.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,g=null==e.leftDelim?kg(t,["mopen"]):Ob.customSizedDelim(e.leftDelim,_,!0,t.havingStyle(i),e.mode,["mopen"]),b=e.continued?eg.makeSpan([]):null==e.rightDelim?kg(t,["mclose"]):Ob.customSizedDelim(e.rightDelim,_,!0,t.havingStyle(i),e.mode,["mclose"]),eg.makeSpan(["mord"].concat(n.sizingClasses(t)),[g,eg.makeSpan(["mfrac"],[f]),b],t)},ry=(e,t)=>{var n=new Pg.MathNode("mfrac",[Ig(e.numer,t),Ig(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var i=Uf(e.barSize,t);n.setAttribute("linethickness",Wf(i))}}else n.setAttribute("linethickness","0px");var r=ny(e.size,t.style);if(r.size!==t.style.size){n=new Pg.MathNode("mstyle",[n]);var s=r.size===Af.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",s),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var a=new Pg.MathNode("mo",[new Pg.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(n),null!=e.rightDelim){var l=new Pg.MathNode("mo",[new Pg.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Og(o)}return n};cg({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:i,funcName:r}=e,s=t[0],o=t[1],a=null,l=null,c="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,a="(",l=")";break;case"\\\\bracefrac":n=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:i.mode,continued:!1,numer:s,denom:o,hasBarLine:n,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:iy,mathmlBuilder:ry}),cg({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0],s=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:r,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),cg({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:i,token:r}=e;switch(i){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:r}}});var sy=["display","text","script","scriptscript"],oy=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};cg({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:i}=e,r=t[4],s=t[5],o=hg(t[0]),a="atom"===o.type&&"open"===o.family?oy(o.text):null,l=hg(t[1]),c="atom"===l.type&&"close"===l.family?oy(l.text):null,d=$g(t[2],"size"),h=null;n=!!d.isBlank||(h=d.value).number>0;var u="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=$g(p.body[0],"textord");u=sy[Number(m.text)]}}else p=$g(p,"textord"),u=sy[Number(p.text)];return{type:"genfrac",mode:i.mode,numer:r,denom:s,continued:!1,hasBarLine:n,barSize:h,leftDelim:a,rightDelim:c,size:u}},htmlBuilder:iy,mathmlBuilder:ry}),cg({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:i,token:r}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:$g(t[0],"size").value,token:r}}}),cg({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0],s=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}($g(t[1],"infix").size),o=t[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:r,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:iy,mathmlBuilder:ry});var ay=(e,t)=>{var n,i,r=t.style;"supsub"===e.type?(n=e.sup?Sg(e.sup,t.havingStyle(r.sup()),t):Sg(e.sub,t.havingStyle(r.sub()),t),i=$g(e.base,"horizBrace")):i=$g(e,"horizBrace");var s,o=Sg(i.base,t.havingBaseStyle(Af.DISPLAY)),a=Fg(i,t);if(i.isOver?(s=eg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(s=eg.makeVList({positionType:"bottom",positionData:o.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=eg.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t);s=i.isOver?eg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):eg.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return eg.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t)};cg({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e;return{type:"horizBrace",mode:n.mode,label:i,isOver:/^\\over/.test(i),base:t[0]}},htmlBuilder:ay,mathmlBuilder:(e,t)=>{var n=Hg(e.label);return new Pg.MathNode(e.isOver?"mover":"munder",[Ig(e.base,t),n])}}),cg({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[1],r=$g(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:r})?{type:"href",mode:n.mode,href:r,body:ug(i)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=bg(e.body,t,!1);return eg.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Dg(e.body,t);return n instanceof Ag||(n=new Ag("mrow",[n])),n.setAttribute("href",e.href),n}}),cg({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=$g(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:i}))return n.formatUnsupportedCmd("\\url");for(var r=[],s=0;s<i.length;s++){var o=i[s];"~"===o&&(o="\\textasciitilde"),r.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:n.mode,font:"\\texttt",body:r};return{type:"href",mode:n.mode,href:i,body:ug(a)}}}),cg({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:ug(t[0])}},htmlBuilder(e,t){var n=bg(e.body,t,!1);return eg.makeFragment(n)},mathmlBuilder:(e,t)=>new Pg.MathNode("mrow",Eg(e.body,t))}),cg({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:i,funcName:r,token:s}=e,o=$g(t[0],"raw").string,a=t[1];i.settings.strict&&i.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(r){case"\\htmlClass":l.class=o,n={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o,n={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o,n={command:"\\htmlStyle",style:o};break;case"\\htmlData":for(var c=o.split(","),d=0;d<c.length;d++){var h=c[d].split("=");if(2!==h.length)throw new sf("Error parsing key-value for \\htmlData");l["data-"+h[0].trim()]=h[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return i.settings.isTrusted(n)?{type:"html",mode:i.mode,attributes:l,body:ug(a)}:i.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=bg(e.body,t,!1),i=["enclosing"];e.attributes.class&&i.push(...e.attributes.class.trim().split(/\s+/));var r=eg.makeSpan(i,n,t);for(var s in e.attributes)"class"!==s&&e.attributes.hasOwnProperty(s)&&r.setAttribute(s,e.attributes[s]);return r},mathmlBuilder:(e,t)=>Dg(e.body,t)}),cg({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:ug(t[0]),mathml:ug(t[1])}},htmlBuilder:(e,t)=>{var n=bg(e.html,t,!1);return eg.makeFragment(n)},mathmlBuilder:(e,t)=>Dg(e.mathml,t)});var ly=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new sf("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Vf(n))throw new sf("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};cg({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:i}=e,r={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(n[0])for(var l=$g(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var h=d[1].trim();switch(d[0].trim()){case"alt":a=h;break;case"width":r=ly(h);break;case"height":s=ly(h);break;case"totalheight":o=ly(h);break;default:throw new sf("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var u=$g(t[0],"url").url;return""===a&&(a=(a=(a=u).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),i.settings.isTrusted({command:"\\includegraphics",url:u})?{type:"includegraphics",mode:i.mode,alt:a,width:r,height:s,totalheight:o,src:u}:i.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=Uf(e.height,t),i=0;e.totalheight.number>0&&(i=Uf(e.totalheight,t)-n);var r=0;e.width.number>0&&(r=Uf(e.width,t));var s={height:Wf(n+i)};r>0&&(s.width=Wf(r)),i>0&&(s.verticalAlign=Wf(-i));var o=new t_(e.src,e.alt,s);return o.height=n,o.depth=i,o},mathmlBuilder:(e,t)=>{var n=new Pg.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var i=Uf(e.height,t),r=0;if(e.totalheight.number>0&&(r=Uf(e.totalheight,t)-i,n.setAttribute("valign",Wf(-r))),n.setAttribute("height",Wf(i+r)),e.width.number>0){var s=Uf(e.width,t);n.setAttribute("width",Wf(s))}return n.setAttribute("src",e.src),n}}),cg({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:i}=e,r=$g(t[0],"size");if(n.settings.strict){var s="m"===i[1],o="mu"===r.value.unit;s?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" supports only mu units, not "+r.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:r.value}},htmlBuilder:(e,t)=>eg.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=Uf(e.dimension,t);return new Pg.SpaceNode(n)}}),cg({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"lap",mode:n.mode,alignment:i.slice(5),body:r}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=eg.makeSpan([],[Sg(e.body,t)]),n=eg.makeSpan(["inner"],[n],t)):n=eg.makeSpan(["inner"],[Sg(e.body,t)]);var i=eg.makeSpan(["fix"],[]),r=eg.makeSpan([e.alignment],[n,i],t),s=eg.makeSpan(["strut"]);return s.style.height=Wf(r.height+r.depth),r.depth&&(s.style.verticalAlign=Wf(-r.depth)),r.children.unshift(s),r=eg.makeSpan(["thinbox"],[r],t),eg.makeSpan(["mord","vbox"],[r],t)},mathmlBuilder:(e,t)=>{var n=new Pg.MathNode("mpadded",[Ig(e.body,t)]);if("rlap"!==e.alignment){var i="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",i+"width")}return n.setAttribute("width","0px"),n}}),cg({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:i}=e,r=i.mode;i.switchMode("math");var s="\\("===n?"\\)":"$",o=i.parseExpression(!1,s);return i.expect(s),i.switchMode(r),{type:"styling",mode:i.mode,style:"text",body:o}}}),cg({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new sf("Mismatched "+e.funcName)}});var cy=(e,t)=>{switch(t.style.size){case Af.DISPLAY.size:return e.display;case Af.TEXT.size:return e.text;case Af.SCRIPT.size:return e.script;case Af.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};cg({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:ug(t[0]),text:ug(t[1]),script:ug(t[2]),scriptscript:ug(t[3])}},htmlBuilder:(e,t)=>{var n=cy(e,t),i=bg(n,t,!1);return eg.makeFragment(i)},mathmlBuilder:(e,t)=>{var n=cy(e,t);return Dg(n,t)}});var dy=(e,t,n,i,r,s,o)=>{e=eg.makeSpan([],[e]);var a,l,c,d=n&&ff(n);if(t){var h=Sg(t,i.havingStyle(r.sup()),i);l={elem:h,kern:Math.max(i.fontMetrics().bigOpSpacing1,i.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var u=Sg(n,i.havingStyle(r.sub()),i);a={elem:u,kern:Math.max(i.fontMetrics().bigOpSpacing2,i.fontMetrics().bigOpSpacing4-u.height)}}if(l&&a){var p=i.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+o;c=eg.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Wf(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Wf(s)},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}else if(a){var m=e.height-o;c=eg.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Wf(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]},i)}else{if(!l)return e;var f=e.depth+o;c=eg.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Wf(s)},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}var _=[c];if(a&&0!==s&&!d){var g=eg.makeSpan(["mspace"],[],i);g.style.marginRight=Wf(s),_.unshift(g)}return eg.makeSpan(["mop","op-limits"],_,i)},hy=["\\smallint"],uy=(e,t)=>{var n,i,r,s=!1;"supsub"===e.type?(n=e.sup,i=e.sub,r=$g(e.base,"op"),s=!0):r=$g(e,"op");var o,a=t.style,l=!1;if(a.size===Af.DISPLAY.size&&r.symbol&&!df(hy,r.name)&&(l=!0),r.symbol){var c=l?"Size2-Regular":"Size1-Regular",d="";if("\\oiint"!==r.name&&"\\oiiint"!==r.name||(d=r.name.slice(1),r.name="oiint"===d?"\\iint":"\\iiint"),o=eg.makeSymbol(r.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d.length>0){var h=o.italic,u=eg.staticSvg(d+"Size"+(l?"2":"1"),t);o=eg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:u,shift:l?.08:0}]},t),r.name="\\"+d,o.classes.unshift("mop"),o.italic=h}}else if(r.body){var p=bg(r.body,t,!0);1===p.length&&p[0]instanceof i_?(o=p[0]).classes[0]="mop":o=eg.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<r.name.length;f++)m.push(eg.mathsym(r.name[f],r.mode,t));o=eg.makeSpan(["mop"],m,t)}var _=0,g=0;return(o instanceof i_||"\\oiint"===r.name||"\\oiiint"===r.name)&&!r.suppressBaseShift&&(_=(o.height-o.depth)/2-t.fontMetrics().axisHeight,g=o.italic),s?dy(o,n,i,t,a,g,_):(_&&(o.style.position="relative",o.style.top=Wf(_)),o)},py=(e,t)=>{var n;if(e.symbol)n=new Ag("mo",[Ng(e.name,e.mode)]),df(hy,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Ag("mo",Eg(e.body,t));else{n=new Ag("mi",[new Tg(e.name.slice(1))]);var i=new Ag("mo",[Ng("","text")]);n=e.parentIsSupSub?new Ag("mrow",[n,i]):zg([n,i])}return n},my={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};cg({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=i;return 1===r.length&&(r=my[r]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:uy,mathmlBuilder:py}),cg({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ug(i)}},htmlBuilder:uy,mathmlBuilder:py});var fy={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};cg({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:uy,mathmlBuilder:py}),cg({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:uy,mathmlBuilder:py}),cg({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,i=n;return 1===i.length&&(i=fy[i]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:uy,mathmlBuilder:py});var _y=(e,t)=>{var n,i,r,s,o=!1;if("supsub"===e.type?(n=e.sup,i=e.sub,r=$g(e.base,"operatorname"),o=!0):r=$g(e,"operatorname"),r.body.length>0){for(var a=r.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=bg(a,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof i_&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=eg.makeSpan(["mop"],l,t)}else s=eg.makeSpan(["mop"],[],t);return o?dy(s,n,i,t,t.style,0,0):s};function gy(e,t,n){for(var i=bg(e,t,!1),r=t.sizeMultiplier/n.sizeMultiplier,s=0;s<i.length;s++){var o=i[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(i[s].classes,t.sizingClasses(n)):i[s].classes[o+1]==="reset-size"+t.size&&(i[s].classes[o+1]="reset-size"+n.size),i[s].height*=r,i[s].depth*=r}return eg.makeFragment(i)}cg({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"operatorname",mode:n.mode,body:ug(r),alwaysHandleSupSub:"\\operatornamewithlimits"===i,limits:!1,parentIsSupSub:!1}},htmlBuilder:_y,mathmlBuilder:(e,t)=>{for(var n=Eg(e.body,t.withFont("mathrm")),i=!0,r=0;r<n.length;r++){var s=n[r];if(s instanceof Pg.SpaceNode);else if(s instanceof Pg.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var o=s.children[0];1===s.children.length&&o instanceof Pg.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):i=!1;break;default:i=!1}else i=!1}if(i){var a=n.map(e=>e.toText()).join("");n=[new Pg.TextNode(a)]}var l=new Pg.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new Pg.MathNode("mo",[Ng("","text")]);return e.parentIsSupSub?new Pg.MathNode("mrow",[l,c]):Pg.newDocumentFragment([l,c])}}),Fb("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),dg({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?eg.makeFragment(bg(e.body,t,!1)):eg.makeSpan(["mord"],bg(e.body,t,!0),t),mathmlBuilder:(e,t)=>Dg(e.body,t,!0)}),cg({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,i=t[0];return{type:"overline",mode:n.mode,body:i}},htmlBuilder(e,t){var n=Sg(e.body,t.havingCrampedStyle()),i=eg.makeLineSpan("overline-line",t),r=t.fontMetrics().defaultRuleThickness,s=eg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*r},{type:"elem",elem:i},{type:"kern",size:r}]},t);return eg.makeSpan(["mord","overline"],[s],t)},mathmlBuilder(e,t){var n=new Pg.MathNode("mo",[new Pg.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new Pg.MathNode("mover",[Ig(e.body,t),n]);return i.setAttribute("accent","true"),i}}),cg({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"phantom",mode:n.mode,body:ug(i)}},htmlBuilder:(e,t)=>{var n=bg(e.body,t.withPhantom(),!1);return eg.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Eg(e.body,t);return new Pg.MathNode("mphantom",n)}}),cg({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"hphantom",mode:n.mode,body:i}},htmlBuilder:(e,t)=>{var n=eg.makeSpan([],[Sg(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var i=0;i<n.children.length;i++)n.children[i].height=0,n.children[i].depth=0;return n=eg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),eg.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Eg(ug(e.body),t),i=new Pg.MathNode("mphantom",n),r=new Pg.MathNode("mpadded",[i]);return r.setAttribute("height","0px"),r.setAttribute("depth","0px"),r}}),cg({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"vphantom",mode:n.mode,body:i}},htmlBuilder:(e,t)=>{var n=eg.makeSpan(["inner"],[Sg(e.body,t.withPhantom())]),i=eg.makeSpan(["fix"],[]);return eg.makeSpan(["mord","rlap"],[n,i],t)},mathmlBuilder:(e,t)=>{var n=Eg(ug(e.body),t),i=new Pg.MathNode("mphantom",n),r=new Pg.MathNode("mpadded",[i]);return r.setAttribute("width","0px"),r}}),cg({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,i=$g(t[0],"size").value,r=t[1];return{type:"raisebox",mode:n.mode,dy:i,body:r}},htmlBuilder(e,t){var n=Sg(e.body,t),i=Uf(e.dy,t);return eg.makeVList({positionType:"shift",positionData:-i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Pg.MathNode("mpadded",[Ig(e.body,t)]),i=e.dy.number+e.dy.unit;return n.setAttribute("voffset",i),n}}),cg({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),cg({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:i}=e,r=n[0],s=$g(t[0],"size"),o=$g(t[1],"size");return{type:"rule",mode:i.mode,shift:r&&$g(r,"size").value,width:s.value,height:o.value}},htmlBuilder(e,t){var n=eg.makeSpan(["mord","rule"],[],t),i=Uf(e.width,t),r=Uf(e.height,t),s=e.shift?Uf(e.shift,t):0;return n.style.borderRightWidth=Wf(i),n.style.borderTopWidth=Wf(r),n.style.bottom=Wf(s),n.width=i,n.height=r+s,n.depth=-s,n.maxFontSize=1.125*r*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Uf(e.width,t),i=Uf(e.height,t),r=e.shift?Uf(e.shift,t):0,s=t.color&&t.getColor()||"black",o=new Pg.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",Wf(n)),o.setAttribute("height",Wf(i));var a=new Pg.MathNode("mpadded",[o]);return r>=0?a.setAttribute("height",Wf(r)):(a.setAttribute("height",Wf(r)),a.setAttribute("depth",Wf(-r))),a.setAttribute("voffset",Wf(r)),a}});var by=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];cg({type:"sizing",names:by,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:i,parser:r}=e,s=r.parseExpression(!1,n);return{type:"sizing",mode:r.mode,size:by.indexOf(i)+1,body:s}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return gy(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),i=Eg(e.body,n),r=new Pg.MathNode("mstyle",i);return r.setAttribute("mathsize",Wf(n.sizeMultiplier)),r}}),cg({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:i}=e,r=!1,s=!1,o=n[0]&&$g(n[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l)if("t"===(a=o.body[l].text))r=!0;else{if("b"!==a){r=!1,s=!1;break}s=!0}else r=!0,s=!0;var c=t[0];return{type:"smash",mode:i.mode,body:c,smashHeight:r,smashDepth:s}},htmlBuilder:(e,t)=>{var n=eg.makeSpan([],[Sg(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].depth=0;var s=eg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return eg.makeSpan(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Pg.MathNode("mpadded",[Ig(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),cg({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:i}=e,r=n[0],s=t[0];return{type:"sqrt",mode:i.mode,body:s,index:r}},htmlBuilder(e,t){var n=Sg(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=eg.wrapFragment(n,t);var i=t.fontMetrics().defaultRuleThickness,r=i;t.style.id<Af.TEXT.id&&(r=t.fontMetrics().xHeight);var s=i+r/4,o=n.height+n.depth+s+i,{span:a,ruleWidth:l,advanceWidth:c}=Ob.sqrtImage(o,t),d=a.height-l;d>n.height+n.depth+s&&(s=(s+d-n.height-n.depth)/2);var h=a.height-n.height-s-l;n.style.paddingLeft=Wf(c);var u=eg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(Af.SCRIPTSCRIPT),m=Sg(e.index,p,t),f=.6*(u.height-u.depth),_=eg.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),g=eg.makeSpan(["root"],[_]);return eg.makeSpan(["mord","sqrt"],[g,u],t)}return eg.makeSpan(["mord","sqrt"],[u],t)},mathmlBuilder(e,t){var{body:n,index:i}=e;return i?new Pg.MathNode("mroot",[Ig(n,t),Ig(i,t)]):new Pg.MathNode("msqrt",[Ig(n,t)])}});var yy={display:Af.DISPLAY,text:Af.TEXT,script:Af.SCRIPT,scriptscript:Af.SCRIPTSCRIPT};cg({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:i,parser:r}=e,s=r.parseExpression(!0,n),o=i.slice(1,i.length-5);return{type:"styling",mode:r.mode,style:o,body:s}},htmlBuilder(e,t){var n=yy[e.style],i=t.havingStyle(n).withFont("");return gy(e.body,i,t)},mathmlBuilder(e,t){var n=yy[e.style],i=t.havingStyle(n),r=Eg(e.body,i),s=new Pg.MathNode("mstyle",r),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}}),dg({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Af.DISPLAY.size||n.alwaysHandleSupSub)?uy:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Af.DISPLAY.size||n.limits)?_y:null:"accent"===n.type?ff(n.base)?Ug:null:"horizBrace"===n.type&&!e.sub===n.isOver?ay:null:null}(e,t);if(n)return n(e,t);var i,r,s,{base:o,sup:a,sub:l}=e,c=Sg(o,t),d=t.fontMetrics(),h=0,u=0,p=o&&ff(o);if(a){var m=t.havingStyle(t.style.sup());i=Sg(a,m,t),p||(h=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());r=Sg(l,f,t),p||(u=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}s=t.style===Af.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var _,g=t.sizeMultiplier,b=Wf(.5/d.ptPerEm/g),y=null;if(r){var v=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof i_||v)&&(y=Wf(-c.italic))}if(i&&r){h=Math.max(h,s,i.depth+.25*d.xHeight),u=Math.max(u,d.sub2);var w=4*d.defaultRuleThickness;if(h-i.depth-(r.height-u)<w){u=w-(h-i.depth)+r.height;var x=.8*d.xHeight-(h-i.depth);x>0&&(h+=x,u-=x)}_=eg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:u,marginRight:b,marginLeft:y},{type:"elem",elem:i,shift:-h,marginRight:b}]},t)}else if(r){u=Math.max(u,d.sub1,r.height-.8*d.xHeight),_=eg.makeVList({positionType:"shift",positionData:u,children:[{type:"elem",elem:r,marginLeft:y,marginRight:b}]},t)}else{if(!i)throw new Error("supsub must have either sup or sub.");h=Math.max(h,s,i.depth+.25*d.xHeight),_=eg.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:i,marginRight:b}]},t)}var k=xg(c,"right")||"mord";return eg.makeSpan([k],[c,eg.makeSpan(["msupsub"],[_])],t)},mathmlBuilder(e,t){var n,i=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(i=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var r,s=[Ig(e.base,t)];if(e.sub&&s.push(Ig(e.sub,t)),e.sup&&s.push(Ig(e.sup,t)),i)r=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;r=o&&"op"===o.type&&o.limits&&t.style===Af.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===Af.DISPLAY||o.limits)?"munderover":"msubsup"}else{var a=e.base;r=a&&"op"===a.type&&a.limits&&(t.style===Af.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===Af.DISPLAY)?"munder":"msub"}else{var l=e.base;r=l&&"op"===l.type&&l.limits&&(t.style===Af.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Af.DISPLAY)?"mover":"msup"}return new Pg.MathNode(r,s)}}),dg({type:"atom",htmlBuilder:(e,t)=>eg.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new Pg.MathNode("mo",[Ng(e.text,e.mode)]);if("bin"===e.family){var i=Rg(e,t);"bold-italic"===i&&n.setAttribute("mathvariant",i)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var vy={mi:"italic",mn:"normal",mtext:"normal"};dg({type:"mathord",htmlBuilder:(e,t)=>eg.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new Pg.MathNode("mi",[Ng(e.text,e.mode,t)]),i=Rg(e,t)||"italic";return i!==vy[n.type]&&n.setAttribute("mathvariant",i),n}}),dg({type:"textord",htmlBuilder:(e,t)=>eg.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,i=Ng(e.text,e.mode,t),r=Rg(e,t)||"normal";return n="text"===e.mode?new Pg.MathNode("mtext",[i]):/[0-9]/.test(e.text)?new Pg.MathNode("mn",[i]):"\\prime"===e.text?new Pg.MathNode("mo",[i]):new Pg.MathNode("mi",[i]),r!==vy[n.type]&&n.setAttribute("mathvariant",r),n}});var wy={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},xy={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};dg({type:"spacing",htmlBuilder(e,t){if(xy.hasOwnProperty(e.text)){var n=xy[e.text].className||"";if("text"===e.mode){var i=eg.makeOrd(e,t,"textord");return i.classes.push(n),i}return eg.makeSpan(["mspace",n],[eg.mathsym(e.text,e.mode,t)],t)}if(wy.hasOwnProperty(e.text))return eg.makeSpan(["mspace",wy[e.text]],[],t);throw new sf('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!xy.hasOwnProperty(e.text)){if(wy.hasOwnProperty(e.text))return new Pg.MathNode("mspace");throw new sf('Unknown type of space "'+e.text+'"')}return new Pg.MathNode("mtext",[new Pg.TextNode(" ")])}});var ky=()=>{var e=new Pg.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};dg({type:"tag",mathmlBuilder(e,t){var n=new Pg.MathNode("mtable",[new Pg.MathNode("mtr",[ky(),new Pg.MathNode("mtd",[Dg(e.body,t)]),ky(),new Pg.MathNode("mtd",[Dg(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Sy={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Cy={"\\textbf":"textbf","\\textmd":"textmd"},My={"\\textit":"textit","\\textup":"textup"},zy=(e,t)=>{var n=e.font;return n?Sy[n]?t.withTextFontFamily(Sy[n]):Cy[n]?t.withTextFontWeight(Cy[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(My[n]):t};cg({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"text",mode:n.mode,body:ug(r),font:i}},htmlBuilder(e,t){var n=zy(e,t),i=bg(e.body,n,!0);return eg.makeSpan(["mord","text"],i,n)},mathmlBuilder(e,t){var n=zy(e,t);return Dg(e.body,n)}}),cg({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Sg(e.body,t),i=eg.makeLineSpan("underline-line",t),r=t.fontMetrics().defaultRuleThickness,s=eg.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:r},{type:"elem",elem:i},{type:"kern",size:3*r},{type:"elem",elem:n}]},t);return eg.makeSpan(["mord","underline"],[s],t)},mathmlBuilder(e,t){var n=new Pg.MathNode("mo",[new Pg.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new Pg.MathNode("munder",[Ig(e.body,t),n]);return i.setAttribute("accentunder","true"),i}}),cg({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Sg(e.body,t),i=t.fontMetrics().axisHeight,r=.5*(n.height-i-(n.depth+i));return eg.makeVList({positionType:"shift",positionData:r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new Pg.MathNode("mpadded",[Ig(e.body,t)],["vcenter"])}),cg({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new sf("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Ay(e),i=[],r=t.havingStyle(t.style.text()),s=0;s<n.length;s++){var o=n[s];"~"===o&&(o="\\textasciitilde"),i.push(eg.makeSymbol(o,"Typewriter-Regular",e.mode,r,["mord","texttt"]))}return eg.makeSpan(["mord","text"].concat(r.sizingClasses(t)),eg.tryCombineChars(i),r)},mathmlBuilder(e,t){var n=new Pg.TextNode(Ay(e)),i=new Pg.MathNode("mtext",[n]);return i.setAttribute("mathvariant","monospace"),i}});var Ay=e=>e.body.replace(/ /g,e.star?"␣":" "),Ty=og,Py="[ \r\n\t]",Ny="(\\\\[a-zA-Z@]+)"+Py+"*",Oy="[̀-ͯ]",Ry=new RegExp(Oy+"+$"),Ly="("+Py+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+Oy+"*|[\ud800-\udbff][\udc00-\udfff]"+Oy+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+Ny+"|\\\\[^\ud800-\udfff])";class Ey{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Ly,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new rf("EOF",new nf(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new sf("Unexpected character: '"+e[t]+"'",new rf(e[t],new nf(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[i]){var r=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===r?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=r+1,this.lex()}return new rf(i,new nf(this,t,this.tokenRegex.lastIndex))}}class Dy{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new sf("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var r=this.undefStack[this.undefStack.length-1];r&&!r.hasOwnProperty(e)&&(r[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var Iy=Hb;Fb("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Fb("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Fb("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Fb("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Fb("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Fb("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Fb("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var By={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Fb("\\char",function(e){var t,n=e.popToken(),i="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])i=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new sf("\\char` missing argument");i=n.text.charCodeAt(0)}else t=10;if(t){if(null==(i=By[n.text])||i>=t)throw new sf("Invalid base-"+t+" digit "+n.text);for(var r;null!=(r=By[e.future().text])&&r<t;)i*=t,i+=r,e.popToken()}return"\\@char{"+i+"}"});var jy=(e,t,n,i)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new sf("\\newcommand's first argument must be a macro name");var s=r[0].text,o=e.isDefined(s);if(o&&!t)throw new sf("\\newcommand{"+s+"} attempting to redefine "+s+"; use \\renewcommand");if(!o&&!n)throw new sf("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(1===(r=e.consumeArg().tokens).length&&"["===r[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new sf("Invalid number of arguments: "+l);a=parseInt(l),r=e.consumeArg().tokens}return o&&i||e.macros.set(s,{tokens:r,numArgs:a}),""};Fb("\\newcommand",e=>jy(e,!1,!0,!1)),Fb("\\renewcommand",e=>jy(e,!0,!1,!1)),Fb("\\providecommand",e=>jy(e,!0,!0,!0)),Fb("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Fb("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Fb("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Ty[n],d_.math[n],d_.text[n]),""}),Fb("\\bgroup","{"),Fb("\\egroup","}"),Fb("~","\\nobreakspace"),Fb("\\lq","`"),Fb("\\rq","'"),Fb("\\aa","\\r a"),Fb("\\AA","\\r A"),Fb("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Fb("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Fb("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Fb("ℬ","\\mathscr{B}"),Fb("ℰ","\\mathscr{E}"),Fb("ℱ","\\mathscr{F}"),Fb("ℋ","\\mathscr{H}"),Fb("ℐ","\\mathscr{I}"),Fb("ℒ","\\mathscr{L}"),Fb("ℳ","\\mathscr{M}"),Fb("ℛ","\\mathscr{R}"),Fb("ℭ","\\mathfrak{C}"),Fb("ℌ","\\mathfrak{H}"),Fb("ℨ","\\mathfrak{Z}"),Fb("\\Bbbk","\\Bbb{k}"),Fb("·","\\cdotp"),Fb("\\llap","\\mathllap{\\textrm{#1}}"),Fb("\\rlap","\\mathrlap{\\textrm{#1}}"),Fb("\\clap","\\mathclap{\\textrm{#1}}"),Fb("\\mathstrut","\\vphantom{(}"),Fb("\\underbar","\\underline{\\text{#1}}"),Fb("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Fb("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Fb("\\ne","\\neq"),Fb("≠","\\neq"),Fb("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Fb("∉","\\notin"),Fb("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Fb("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Fb("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Fb("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Fb("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Fb("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Fb("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Fb("⟂","\\perp"),Fb("‼","\\mathclose{!\\mkern-0.8mu!}"),Fb("∌","\\notni"),Fb("⌜","\\ulcorner"),Fb("⌝","\\urcorner"),Fb("⌞","\\llcorner"),Fb("⌟","\\lrcorner"),Fb("©","\\copyright"),Fb("®","\\textregistered"),Fb("️","\\textregistered"),Fb("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Fb("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Fb("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Fb("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Fb("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Fb("⋮","\\vdots"),Fb("\\varGamma","\\mathit{\\Gamma}"),Fb("\\varDelta","\\mathit{\\Delta}"),Fb("\\varTheta","\\mathit{\\Theta}"),Fb("\\varLambda","\\mathit{\\Lambda}"),Fb("\\varXi","\\mathit{\\Xi}"),Fb("\\varPi","\\mathit{\\Pi}"),Fb("\\varSigma","\\mathit{\\Sigma}"),Fb("\\varUpsilon","\\mathit{\\Upsilon}"),Fb("\\varPhi","\\mathit{\\Phi}"),Fb("\\varPsi","\\mathit{\\Psi}"),Fb("\\varOmega","\\mathit{\\Omega}"),Fb("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Fb("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Fb("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Fb("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Fb("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Fb("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Fb("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Fb("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var qy={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Fb("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in qy?t=qy[n]:("\\not"===n.slice(0,4)||n in d_.math&&df(["bin","rel"],d_.math[n].group))&&(t="\\dotsb"),t});var Hy={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Fb("\\dotso",function(e){return e.future().text in Hy?"\\ldots\\,":"\\ldots"}),Fb("\\dotsc",function(e){var t=e.future().text;return t in Hy&&","!==t?"\\ldots\\,":"\\ldots"}),Fb("\\cdots",function(e){return e.future().text in Hy?"\\@cdots\\,":"\\@cdots"}),Fb("\\dotsb","\\cdots"),Fb("\\dotsm","\\cdots"),Fb("\\dotsi","\\!\\cdots"),Fb("\\dotsx","\\ldots\\,"),Fb("\\DOTSI","\\relax"),Fb("\\DOTSB","\\relax"),Fb("\\DOTSX","\\relax"),Fb("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Fb("\\,","\\tmspace+{3mu}{.1667em}"),Fb("\\thinspace","\\,"),Fb("\\>","\\mskip{4mu}"),Fb("\\:","\\tmspace+{4mu}{.2222em}"),Fb("\\medspace","\\:"),Fb("\\;","\\tmspace+{5mu}{.2777em}"),Fb("\\thickspace","\\;"),Fb("\\!","\\tmspace-{3mu}{.1667em}"),Fb("\\negthinspace","\\!"),Fb("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Fb("\\negthickspace","\\tmspace-{5mu}{.277em}"),Fb("\\enspace","\\kern.5em "),Fb("\\enskip","\\hskip.5em\\relax"),Fb("\\quad","\\hskip1em\\relax"),Fb("\\qquad","\\hskip2em\\relax"),Fb("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Fb("\\tag@paren","\\tag@literal{({#1})}"),Fb("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new sf("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Fb("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Fb("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Fb("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Fb("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Fb("\\newline","\\\\\\relax"),Fb("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Fy=Wf(Lf["Main-Regular"]["T".charCodeAt(0)][1]-.7*Lf["Main-Regular"]["A".charCodeAt(0)][1]);Fb("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Fy+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Fb("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Fy+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Fb("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Fb("\\@hspace","\\hskip #1\\relax"),Fb("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Fb("\\ordinarycolon",":"),Fb("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Fb("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Fb("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Fb("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Fb("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Fb("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Fb("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Fb("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Fb("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Fb("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Fb("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Fb("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Fb("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Fb("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Fb("∷","\\dblcolon"),Fb("∹","\\eqcolon"),Fb("≔","\\coloneqq"),Fb("≕","\\eqqcolon"),Fb("⩴","\\Coloneqq"),Fb("\\ratio","\\vcentcolon"),Fb("\\coloncolon","\\dblcolon"),Fb("\\colonequals","\\coloneqq"),Fb("\\coloncolonequals","\\Coloneqq"),Fb("\\equalscolon","\\eqqcolon"),Fb("\\equalscoloncolon","\\Eqqcolon"),Fb("\\colonminus","\\coloneq"),Fb("\\coloncolonminus","\\Coloneq"),Fb("\\minuscolon","\\eqcolon"),Fb("\\minuscoloncolon","\\Eqcolon"),Fb("\\coloncolonapprox","\\Colonapprox"),Fb("\\coloncolonsim","\\Colonsim"),Fb("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Fb("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Fb("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Fb("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Fb("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Fb("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Fb("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Fb("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Fb("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Fb("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Fb("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Fb("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Fb("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Fb("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Fb("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Fb("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Fb("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Fb("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Fb("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Fb("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Fb("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Fb("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Fb("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Fb("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Fb("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Fb("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Fb("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Fb("\\imath","\\html@mathml{\\@imath}{ı}"),Fb("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Fb("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Fb("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Fb("⟦","\\llbracket"),Fb("⟧","\\rrbracket"),Fb("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Fb("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Fb("⦃","\\lBrace"),Fb("⦄","\\rBrace"),Fb("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Fb("⦵","\\minuso"),Fb("\\darr","\\downarrow"),Fb("\\dArr","\\Downarrow"),Fb("\\Darr","\\Downarrow"),Fb("\\lang","\\langle"),Fb("\\rang","\\rangle"),Fb("\\uarr","\\uparrow"),Fb("\\uArr","\\Uparrow"),Fb("\\Uarr","\\Uparrow"),Fb("\\N","\\mathbb{N}"),Fb("\\R","\\mathbb{R}"),Fb("\\Z","\\mathbb{Z}"),Fb("\\alef","\\aleph"),Fb("\\alefsym","\\aleph"),Fb("\\Alpha","\\mathrm{A}"),Fb("\\Beta","\\mathrm{B}"),Fb("\\bull","\\bullet"),Fb("\\Chi","\\mathrm{X}"),Fb("\\clubs","\\clubsuit"),Fb("\\cnums","\\mathbb{C}"),Fb("\\Complex","\\mathbb{C}"),Fb("\\Dagger","\\ddagger"),Fb("\\diamonds","\\diamondsuit"),Fb("\\empty","\\emptyset"),Fb("\\Epsilon","\\mathrm{E}"),Fb("\\Eta","\\mathrm{H}"),Fb("\\exist","\\exists"),Fb("\\harr","\\leftrightarrow"),Fb("\\hArr","\\Leftrightarrow"),Fb("\\Harr","\\Leftrightarrow"),Fb("\\hearts","\\heartsuit"),Fb("\\image","\\Im"),Fb("\\infin","\\infty"),Fb("\\Iota","\\mathrm{I}"),Fb("\\isin","\\in"),Fb("\\Kappa","\\mathrm{K}"),Fb("\\larr","\\leftarrow"),Fb("\\lArr","\\Leftarrow"),Fb("\\Larr","\\Leftarrow"),Fb("\\lrarr","\\leftrightarrow"),Fb("\\lrArr","\\Leftrightarrow"),Fb("\\Lrarr","\\Leftrightarrow"),Fb("\\Mu","\\mathrm{M}"),Fb("\\natnums","\\mathbb{N}"),Fb("\\Nu","\\mathrm{N}"),Fb("\\Omicron","\\mathrm{O}"),Fb("\\plusmn","\\pm"),Fb("\\rarr","\\rightarrow"),Fb("\\rArr","\\Rightarrow"),Fb("\\Rarr","\\Rightarrow"),Fb("\\real","\\Re"),Fb("\\reals","\\mathbb{R}"),Fb("\\Reals","\\mathbb{R}"),Fb("\\Rho","\\mathrm{P}"),Fb("\\sdot","\\cdot"),Fb("\\sect","\\S"),Fb("\\spades","\\spadesuit"),Fb("\\sub","\\subset"),Fb("\\sube","\\subseteq"),Fb("\\supe","\\supseteq"),Fb("\\Tau","\\mathrm{T}"),Fb("\\thetasym","\\vartheta"),Fb("\\weierp","\\wp"),Fb("\\Zeta","\\mathrm{Z}"),Fb("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Fb("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Fb("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Fb("\\bra","\\mathinner{\\langle{#1}|}"),Fb("\\ket","\\mathinner{|{#1}\\rangle}"),Fb("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Fb("\\Bra","\\left\\langle#1\\right|"),Fb("\\Ket","\\left|#1\\right\\rangle");var $y=e=>t=>{var n=t.consumeArg().tokens,i=t.consumeArg().tokens,r=t.consumeArg().tokens,s=t.consumeArg().tokens,o=t.macros.get("|"),a=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",o),r.length&&n.macros.set("\\|",a));var s=t;return!t&&r.length&&"|"===n.future().text&&(n.popToken(),s=!0),{tokens:s?r:i,numArgs:0}};t.macros.set("|",l(!1)),r.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...s,...c,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};Fb("\\bra@ket",$y(!1)),Fb("\\bra@set",$y(!0)),Fb("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Fb("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Fb("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Fb("\\angln","{\\angl n}"),Fb("\\blue","\\textcolor{##6495ed}{#1}"),Fb("\\orange","\\textcolor{##ffa500}{#1}"),Fb("\\pink","\\textcolor{##ff00af}{#1}"),Fb("\\red","\\textcolor{##df0030}{#1}"),Fb("\\green","\\textcolor{##28ae7b}{#1}"),Fb("\\gray","\\textcolor{gray}{#1}"),Fb("\\purple","\\textcolor{##9d38bd}{#1}"),Fb("\\blueA","\\textcolor{##ccfaff}{#1}"),Fb("\\blueB","\\textcolor{##80f6ff}{#1}"),Fb("\\blueC","\\textcolor{##63d9ea}{#1}"),Fb("\\blueD","\\textcolor{##11accd}{#1}"),Fb("\\blueE","\\textcolor{##0c7f99}{#1}"),Fb("\\tealA","\\textcolor{##94fff5}{#1}"),Fb("\\tealB","\\textcolor{##26edd5}{#1}"),Fb("\\tealC","\\textcolor{##01d1c1}{#1}"),Fb("\\tealD","\\textcolor{##01a995}{#1}"),Fb("\\tealE","\\textcolor{##208170}{#1}"),Fb("\\greenA","\\textcolor{##b6ffb0}{#1}"),Fb("\\greenB","\\textcolor{##8af281}{#1}"),Fb("\\greenC","\\textcolor{##74cf70}{#1}"),Fb("\\greenD","\\textcolor{##1fab54}{#1}"),Fb("\\greenE","\\textcolor{##0d923f}{#1}"),Fb("\\goldA","\\textcolor{##ffd0a9}{#1}"),Fb("\\goldB","\\textcolor{##ffbb71}{#1}"),Fb("\\goldC","\\textcolor{##ff9c39}{#1}"),Fb("\\goldD","\\textcolor{##e07d10}{#1}"),Fb("\\goldE","\\textcolor{##a75a05}{#1}"),Fb("\\redA","\\textcolor{##fca9a9}{#1}"),Fb("\\redB","\\textcolor{##ff8482}{#1}"),Fb("\\redC","\\textcolor{##f9685d}{#1}"),Fb("\\redD","\\textcolor{##e84d39}{#1}"),Fb("\\redE","\\textcolor{##bc2612}{#1}"),Fb("\\maroonA","\\textcolor{##ffbde0}{#1}"),Fb("\\maroonB","\\textcolor{##ff92c6}{#1}"),Fb("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Fb("\\maroonD","\\textcolor{##ca337c}{#1}"),Fb("\\maroonE","\\textcolor{##9e034e}{#1}"),Fb("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Fb("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Fb("\\purpleC","\\textcolor{##aa87ff}{#1}"),Fb("\\purpleD","\\textcolor{##7854ab}{#1}"),Fb("\\purpleE","\\textcolor{##543b78}{#1}"),Fb("\\mintA","\\textcolor{##f5f9e8}{#1}"),Fb("\\mintB","\\textcolor{##edf2df}{#1}"),Fb("\\mintC","\\textcolor{##e0e5cc}{#1}"),Fb("\\grayA","\\textcolor{##f6f7f7}{#1}"),Fb("\\grayB","\\textcolor{##f0f1f2}{#1}"),Fb("\\grayC","\\textcolor{##e3e5e6}{#1}"),Fb("\\grayD","\\textcolor{##d6d8da}{#1}"),Fb("\\grayE","\\textcolor{##babec2}{#1}"),Fb("\\grayF","\\textcolor{##888d93}{#1}"),Fb("\\grayG","\\textcolor{##626569}{#1}"),Fb("\\grayH","\\textcolor{##3b3e40}{#1}"),Fb("\\grayI","\\textcolor{##21242c}{#1}"),Fb("\\kaBlue","\\textcolor{##314453}{#1}"),Fb("\\kaGreen","\\textcolor{##71B307}{#1}");var Gy={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Vy{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Dy(Iy,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Ey(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:i,end:n}=this.consumeArg(["]"]))}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new rf("EOF",n.loc)),this.pushTokens(i),t.range(n,"")}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i,r=this.future(),s=0,o=0;do{if(i=this.popToken(),t.push(i),"{"===i.text)++s;else if("}"===i.text){if(-1===--s)throw new sf("Extra }",i)}else if("EOF"===i.text)throw new sf("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",i);if(e&&n)if((0===s||1===s&&"{"===e[o])&&i.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==s||n);return"{"===r.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new sf("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var r=this.popToken();if(n[i]!==r.text)throw new sf("Use of the macro doesn't match its definition",r)}}for(var s=[],o=0;o<e;o++)s.push(this.consumeArg(t&&t[o+1]).tokens);return s}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new sf("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(null==i||e&&i.unexpandable){if(e&&null==i&&"\\"===n[0]&&!this.isDefined(n))throw new sf("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var r=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs)for(var o=(r=r.slice()).length-1;o>=0;--o){var a=r[o];if("#"===a.text){if(0===o)throw new sf("Incomplete placeholder at end of macro body",a);if("#"===(a=r[--o]).text)r.splice(o+1,1);else{if(!/^[1-9]$/.test(a.text))throw new sf("Not a valid argument number",a);r.splice(o,2,...s[+a.text-1])}}}return this.pushTokens(r),r.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new rf(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var i="function"==typeof t?t(this):t;if("string"==typeof i){var r=0;if(-1!==i.indexOf("#"))for(var s=i.replace(/##/g,"");-1!==s.indexOf("#"+(r+1));)++r;for(var o=new Ey(i,this.settings),a=[],l=o.lex();"EOF"!==l.text;)a.push(l),l=o.lex();return a.reverse(),{tokens:a,numArgs:r}}return i}isDefined(e){return this.macros.has(e)||Ty.hasOwnProperty(e)||d_.math.hasOwnProperty(e)||d_.text.hasOwnProperty(e)||Gy.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Ty.hasOwnProperty(e)&&!Ty[e].primitive}}var Uy=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Wy=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9",ₐ:"a",ₑ:"e",ₕ:"h",ᵢ:"i",ⱼ:"j",ₖ:"k",ₗ:"l",ₘ:"m",ₙ:"n",ₒ:"o",ₚ:"p",ᵣ:"r",ₛ:"s",ₜ:"t",ᵤ:"u",ᵥ:"v",ₓ:"x",ᵦ:"β",ᵧ:"γ",ᵨ:"ρ",ᵩ:"ϕ",ᵪ:"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9",ᴬ:"A",ᴮ:"B",ᴰ:"D",ᴱ:"E",ᴳ:"G",ᴴ:"H",ᴵ:"I",ᴶ:"J",ᴷ:"K",ᴸ:"L",ᴹ:"M",ᴺ:"N",ᴼ:"O",ᴾ:"P",ᴿ:"R",ᵀ:"T",ᵁ:"U",ⱽ:"V",ᵂ:"W",ᵃ:"a",ᵇ:"b",ᶜ:"c",ᵈ:"d",ᵉ:"e",ᶠ:"f",ᵍ:"g",ʰ:"h",ⁱ:"i",ʲ:"j",ᵏ:"k",ˡ:"l",ᵐ:"m",ⁿ:"n",ᵒ:"o",ᵖ:"p",ʳ:"r",ˢ:"s",ᵗ:"t",ᵘ:"u",ᵛ:"v",ʷ:"w",ˣ:"x",ʸ:"y",ᶻ:"z",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),Yy={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Xy={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Ky{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Vy(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new sf("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new rf("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==Ky.endOfExpression.indexOf(i.text))break;if(t&&i.text===t)break;if(e&&Ty[i.text]&&Ty[i.text].infix)break;var r=this.parseAtom(t);if(!r)break;"internal"!==r.type&&n.push(r)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,i=0;i<e.length;i++)if("infix"===e[i].type){if(-1!==n)throw new sf("only one infix operator per group",e[i].token);n=i,t=e[i].replaceWith}if(-1!==n&&t){var r,s,o=e.slice(0,n),a=e.slice(n+1);return r=1===o.length&&"ordgroup"===o[0].type?o[0]:{type:"ordgroup",mode:this.mode,body:o},s=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},["\\\\abovefrac"===t?this.callFunction(t,[r,e[n],s],[]):this.callFunction(t,[r,s],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),i=n.text;this.consume(),this.consumeSpaces();do{var r;t=this.parseGroup(e)}while("internal"===(null==(r=t)?void 0:r.type));if(!t)throw new sf("Expected group after '"+i+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]}}parseAtom(e){var t,n,i=this.parseGroup("atom",e);if("internal"===(null==i?void 0:i.type))return i;if("text"===this.mode)return i;for(;;){this.consumeSpaces();var r=this.fetch();if("\\limits"===r.text||"\\nolimits"===r.text){if(i&&"op"===i.type){var s="\\limits"===r.text;i.limits=s,i.alwaysHandleSupSub=!0}else{if(!i||"operatorname"!==i.type)throw new sf("Limit controls must follow a math operator",r);i.alwaysHandleSupSub&&(i.limits="\\limits"===r.text)}this.consume()}else if("^"===r.text){if(t)throw new sf("Double superscript",r);t=this.handleSupSubscript("superscript")}else if("_"===r.text){if(n)throw new sf("Double subscript",r);n=this.handleSupSubscript("subscript")}else if("'"===r.text){if(t)throw new sf("Double superscript",r);var o={type:"textord",mode:this.mode,text:"\\prime"},a=[o];for(this.consume();"'"===this.fetch().text;)a.push(o),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!Wy[r.text])break;var l=Uy.test(r.text),c=[];for(c.push(new rf(Wy[r.text])),this.consume();;){var d=this.fetch().text;if(!Wy[d])break;if(Uy.test(d)!==l)break;c.unshift(new rf(Wy[d])),this.consume()}var h=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:h}:t={type:"ordgroup",mode:"math",body:h}}}return t||n?{type:"supsub",mode:this.mode,base:i,sup:t,sub:n}:i}parseFunction(e,t){var n=this.fetch(),i=n.text,r=Ty[i];if(!r)return null;if(this.consume(),t&&"atom"!==t&&!r.allowedInArgument)throw new sf("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!r.allowedInText)throw new sf("Can't use function '"+i+"' in text mode",n);if("math"===this.mode&&!1===r.allowedInMath)throw new sf("Can't use function '"+i+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(i,r);return this.callFunction(i,s,o,n,e)}callFunction(e,t,n,i,r){var s={funcName:e,parser:this,token:i,breakOnTokenText:r},o=Ty[e];if(o&&o.handler)return o.handler(s,t,n);throw new sf("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var i=[],r=[],s=0;s<n;s++){var o=t.argTypes&&t.argTypes[s],a=s<t.numOptionalArgs;(t.primitive&&null==o||"sqrt"===t.type&&1===s&&null==r[0])&&(o="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",o,a);if(a)r.push(l);else{if(null==l)throw new sf("Null argument, please report this as a bug");i.push(l)}}return{args:i,optArgs:r}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var i=this.parseArgumentGroup(n,"text");return null!=i?{type:"styling",mode:i.mode,body:[i],style:"text"}:null;case"raw":var r=this.parseStringGroup("raw",n);return null!=r?{type:"raw",mode:"text",string:r.text}:null;case"primitive":if(n)throw new sf("A primitive argument cannot be optional");var s=this.parseGroup(e);if(null==s)throw new sf("Expected group as "+e,this.fetch());return s;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new sf("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var i,r="";"EOF"!==(i=this.fetch()).text;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n,i=this.fetch(),r=i,s="";"EOF"!==(n=this.fetch()).text&&e.test(s+n.text);)s+=(r=n).text,this.consume();if(""===s)throw new sf("Invalid "+t+": '"+i.text+"'",i);return i.range(r,s)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new sf("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new sf("Invalid size: '"+t.text+"'",t);var r={number:+(i[1]+i[2]),unit:i[3]};if(!Vf(r))throw new sf("Invalid unit: '"+r.unit+"'",t);return{type:"size",mode:this.mode,value:r,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var r=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:r};return t&&this.switchMode(i),s}parseGroup(e,t){var n,i=this.fetch(),r=i.text;if("{"===r||"\\begingroup"===r){this.consume();var s="{"===r?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),a=this.fetch();this.expect(s),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:nf.range(i,a),body:o,semisimple:"\\begingroup"===r||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===r[0]&&!Gy.hasOwnProperty(r)){if(this.settings.throwOnError)throw new sf("Undefined control sequence: "+r,i);n=this.formatUnsupportedCmd(r),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n],r=i.text;"-"===r&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:nf.range(i,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:nf.range(i,e[n+1]),text:"--"}),t-=1)),"'"!==r&&"`"!==r||e[n+1].text!==r||(e.splice(n,2,{type:"textord",mode:"text",loc:nf.range(i,e[n+1]),text:r+r}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i="*"===n.charAt(0);if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new sf("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:i}}Xy.hasOwnProperty(t[0])&&!d_[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Xy[t[0]]+t.slice(1));var r,s=Ry.exec(t);if(s&&("i"===(t=t.substring(0,s.index))?t="ı":"j"===t&&(t="ȷ")),d_[this.mode][t]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o,a=d_[this.mode][t].group,l=nf.range(e);if(l_.hasOwnProperty(a)){var c=a;o={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else o={type:a,mode:this.mode,loc:l,text:t};r=o}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Nf(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),r={type:"textord",mode:"text",loc:nf.range(e),text:t}}if(this.consume(),s)for(var d=0;d<s[0].length;d++){var h=s[0][d];if(!Yy[h])throw new sf("Unknown accent ' "+h+"'",e);var u=Yy[h][this.mode]||Yy[h].text;if(!u)throw new sf("Accent "+h+" unsupported in "+this.mode+" mode",e);r={type:"accent",mode:this.mode,loc:nf.range(e),label:u,isStretchy:!1,isShifty:!0,base:r}}return r}}Ky.endOfExpression=["}","\\endgroup","\\end","\\right","&"];"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&"undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.");var Jy=function(e,t){var n=new yf(t);try{return function(e,t,n){var i,r=function(e){return new Ff({style:e.displayMode?Af.DISPLAY:Af.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})}(n);if("mathml"===n.output)return Bg(e,t,r,n.displayMode,!0);if("html"===n.output){var s=Mg(e,r);i=eg.makeSpan(["katex"],[s])}else{var o=Bg(e,t,r,n.displayMode,!1),a=Mg(e,r);i=eg.makeSpan(["katex"],[o,a])}return function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=eg.makeSpan(n,[e])}return e}(i,n)}(function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Ky(e,t);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new sf("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new rf("\\df@tag")])}]}return i}(e,n),e,n)}catch(t){return function(e,t,n){if(n.throwOnError||!(e instanceof sf))throw e;var i=eg.makeSpan(["katex-error"],[new i_(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i}(t,e,n)}};class Qy{static update(e,t,n,i=!1){return{id:e,name:v.update,size:n,latex:t,block:i}}}class Zy extends Es{_mathml=Wt("");constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return tf}get mathml(){const e=this.attrs.size+this.info;return Zy.render(e,{displayMode:this.attrs.block})}get attrs(){return this.data.attrs}get meta(){return Zy.meta}build_child(e){}export(){return this.base_export()}gc(){super.base_gc()}update_data(e,t){return Zy.update_data(e,t)}replace_id(e,t={}){return Zy.replace_id(this.root,e,t)}update(e){const{latex:t,block:n,size:i}=e,{courier:r,id:s}=this,o=r.get_recorder();o.add_cmd(e);const a=this.info,l=this.attrs.block,c=this.attrs.size;return this.data.info=t,this.data.attrs.block=n,this.data.attrs.size=i,o.add_recover(Qy.update(s,a,c,l)),o}static render(e,t={}){const n={...t,throwOnError:!1,output:"html"};try{return function(e,t){return Jy(e,t).toMarkup()}(e,{...n})}catch(e){return""}}static get meta(){return{cubename:"公式",type:n.fomula,block:!1,version:1,show:!0}}static get_default(e="",t={},i={}){return{id:ss.get_id(),type:n.fomula,info:e,attrs:{block:!1,size:y.h4,...i},css:t}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([ys(v.update)],Zy.prototype,"update",null);class ev{static add_title(e,t){return{id:e,name:w.add_title,data:t}}static remove_title(e){return{id:e,name:w.remove_title}}static add_cell(e,t){return{id:e,name:w.add_cell,data:t}}static remove_cell(e,t){return{id:e,name:w.remove_cell,cid:t}}static add_row(e,t,n){return{id:e,name:w.add_row,index:t,rows:n}}static remove_row(e,t){return{id:e,name:w.remove_row,index:t}}static add_col(e,t,n){return{id:e,name:w.add_col,index:t,cols:n}}static remove_col(e,t){return{id:e,name:w.remove_col,index:t}}static moveto(e,t,n){return{id:e,name:w.moveto,tid:t,cells:n}}static merge(e,t){return{id:e,name:w.merge,area:t}}static update_cell_area(e,t,n){return{id:e,name:w.update_area,tid:t,area:n}}static add_grid_col(e,t,n){return{id:e,name:w.add_grid_col,index:t,width:n}}static remove_grid_col(e,t){return{id:e,name:w.remove_grid_col,index:t}}static col_resize(e,t,n){return{id:e,name:w.col_resize,cols:t,step:n}}}function tv(e,t){const{hotkeys:n,courier:i,id:r,history:s}=t,o=ns.tips;if(n.validate_hotkeys(e))return;if(!e.ctrlKey)return;e.stopPropagation();const a=e.key.toLowerCase(),l=e.shiftKey,c=t.get_active_cell();if(!c)return o?.tip_info("未发现激活单元格");if(a===P.up)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_row_top(e.top))return o?.tip_info("上方不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[1];e++)r.push(kl.get_default());n.tell(t,ev.add_row(t.id,c.row,r)),s.record(n)}else{if(t.get_cell(c.row-1,c.col))return o?.tip_info("上方已存在单元格");if(c.row-1<0)return o?.tip_info("上方已达边界");{const e=i.get_recorder(),n={row:c.row-1,col:c.col,rowspan:1,colspan:1,data:kl.get_default()};e.tell(t,ev.add_cell(t.id,n)),s.record(e)}}else if(a===P.down)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_row_bottom(e.bottom))return o?.tip_info("下方不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[1];e++)r.push(kl.get_default());n.tell(t,ev.add_row(t.id,c.row+c.rowspan,r)),s.record(n)}else{if(t.get_cell(c.row+1,c.col))return o?.tip_info("下方已存在单元格");if(c.row+1>=t.size[0])return o?.tip_info("下方已达边界");{const e=i.get_recorder(),n={row:c.row+1,col:c.col,rowspan:1,colspan:1,data:kl.get_default()};e.tell(t,ev.add_cell(t.id,n)),s.record(e)}}else if(a===P.left)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_col_left(e.left))return o?.tip_info("左侧不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[0];e++)r.push(kl.get_default());n.tell(t,ev.add_col(t.id,c.col,r)),s.record(n)}else{if(t.get_cell(c.row,c.col-1))return o?.tip_info("左侧已存在单元格");if(c.col-1<0)return o?.tip_info("左侧已达边界");{const e=i.get_recorder(),n={row:c.row,col:c.col-1,rowspan:1,colspan:1,data:kl.get_default()};e.tell(t,ev.add_cell(t.id,n)),s.record(e)}}else if(a===P.right)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_col_right(e.right))return o?.tip_info("右侧不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[0];e++)r.push(kl.get_default());n.tell(t,ev.add_col(t.id,c.col+c.colspan,r)),s.record(n)}else{if(t.get_cell(c.row,c.col+1))return o?.tip_info("右侧已存在单元格");if(c.col+1>=t.size[1])return o?.tip_info("右侧已达边界");{const e=i.get_recorder(),n={row:c.row,col:c.col+1,rowspan:1,colspan:1,data:kl.get_default()};e.tell(t,ev.add_cell(t.id,n)),s.record(e)}}}const nv={drag_cell:void 0,hover:void 0};function iv(e,t){const n=e.currentTarget;n.parentElement?.style.setProperty("--drag-pointer-events","none"),e.stopPropagation(),nv.drag_cell=t}function rv(e,t){if(nv.drag_cell===t)return;const n=e.currentTarget;n.classList.add("cube-cell-selection"),nv.hover=n}function sv(e,t){e.currentTarget.classList.remove("cube-cell-selection")}function ov(e,t){const{drag_cell:n,hover:i}=nv,{pcube:r,courier:s,history:o}=t.box;if(!n)return;const a=e.currentTarget;a.parentElement?.style.setProperty("--drag-pointer-events","auto"),i&&i.classList.remove("cube-cell-selection");const l=s.get_recorder();l.tell(r,ev.moveto(r.id,t.box.id,[n.box.id])),o.record(l)}const av={anchor:void 0,hover:void 0,down_point:void 0,has_down:!1,has_move:!1};function lv(e,t){const{root:n,cursor:i}=t;if(e.ctrlKey)e.stopPropagation();else{ss.check_mouse_key(e,"left")&&t.clear_selection();const n=e.target;if(!(n instanceof Node))return;const i=t.find_dom_cube(n),r=i?.find_upstream_untill(t);if(!r)return;const s=t.cells.find(e=>e.box===r);if(!s)return;av.down_point={x:e.clientX,y:e.clientY},av.has_down=!0,av.anchor=s}}function cv(e,t){const{cursor:n}=t,{down_point:i,has_down:r,anchor:s,has_move:o}=av;if(!i)return;if(av.has_move=Math.sqrt((e.clientX-i.x)**2+(e.clientY-i.y)**2)>5,!r||!s||!o||e.buttons<=0)return;const a=e.target;if(!(a instanceof Node))return;const l=t.find_dom_cube(a),c=l?.find_upstream_untill(t),d=t.cells.find(e=>e.box===c);if(!d||d===s)return void t.clear_selection();const h={left:Math.min(s.col,d.col),right:Math.max(s.col+s.colspan-1,d.col+d.colspan-1),top:Math.min(s.row,d.row),bottom:Math.max(s.row+s.rowspan-1,d.row+d.rowspan-1)},u=t.get_rectarea_cell(h);t.clear_selection();for(let e of u.cells)e.selection=!0;u.cells.length>1&&e.stopPropagation()}function dv(e,t){const{cursor:n}=t;av.has_down=!1,av.anchor=void 0}const hv=["id","data-type"],uv=Pn({__name:"cube-table",props:{cube:{}},setup(e){const t=On("dragger"),i=On("box");function r(e){return{"grid-row":`${e.row+1}/span ${e.rowspan}`,"grid-column":`${e.col+1}/span ${e.colspan}`}}function s(e){return{"cube-cell-selection":e.selection}}const o=Jr(()=>({"grid-template-columns":e.cube.cols.map(e=>e>0?e+"fr":"1fr").join(" ")}));return Vn(()=>{const n=t.value,r=i.value;if(!n||!r)return;let s=e.cube.data.attrs.width,o=s;const a=new us.DragDiff(n);a.register_down(()=>{s=e.cube.data.attrs.width}),a.register_move((t,n)=>{s+t<e.cube.min_width||(o=s+t,r.style.width=o+"px")}),a.register_up((t,n)=>{if(o===s)return;const{courier:i,history:r}=e.cube,a=i.get_recorder();a.tell(e.cube,ds.resize(e.cube.id,o)),r.record(a)}),a.register_cancel(()=>{r.style.width=s+"px"})}),(e,a)=>(fr(),yr("div",{ref_key:"box",ref:i,class:"cube-table",style:fe(e.cube.css),id:e.cube.id,"data-type":Kt(n).table,onPointerdown:a[0]||(a[0]=t=>Kt(lv)(t,e.cube)),onPointermove:a[1]||(a[1]=t=>Kt(cv)(t,e.cube)),onPointerup:a[2]||(a[2]=t=>Kt(dv)(t,e.cube)),onPointercancel:a[3]||(a[3]=t=>Kt(dv)(t,e.cube)),onKeyup:a[4]||(a[4]=t=>Kt(tv)(t,e.cube)),onContextmenu:a[5]||(a[5]=t=>Kt(uo)(t,e.cube))},[e.cube.title?(fr(),vr(Oo,{key:0,class:"cube-table-title",cube:$t(e.cube.title)},null,8,["cube"])):Pr("v-if",!0),Cr("div",{class:"cube-table-container",style:fe(o.value)},[(fr(!0),yr(cr,null,ri(e.cube.cells,(e,t)=>(fr(),vr(Oo,{key:e.box.id,cube:$t(e.box),style:fe(r(e)),class:ve(s(e)),draggable:"true",onDragstart:t=>Kt(iv)(t,e),onDragenter:t=>Kt(rv)(t,e),onDragleave:t=>Kt(sv)(t,e),onDrop:t=>Kt(ov)(t,e)},null,8,["cube","style","class","onDragstart","onDragenter","onDragleave","onDrop"]))),128))],4),Cr("div",{class:"cube-table-dragger",ref_key:"dragger",ref:t},null,512)],44,hv))}}),pv=(0,wo.A)(uv,[["__scopeId","data-v-47068d72"]]);function mv(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class fv extends Es{cells=Lt([]);_title=Wt(void 0);get title(){return this._title.value}set title(e){this._title.value=e}get component(){return pv}get meta(){return fv.meta}get children(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),this.title&&e.unshift(this.title),e.push(...t.map(e=>e.box)),e}get cells_sorted(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),e.push(...t),e}get css(){const e=this.attrs;return{...super.css,width:e.width+"px"}}get attrs(){return this.data.attrs}get cols(){return this.data.info.cols}get size(){return this.data.info.size}get selection_cells(){const e=[];for(let t of this.cells_sorted)t.selection&&e.push(t);return e}get min_width(){return 500}constructor(e,t){return super(e,t),this.setup(e,t)}build_child(e){e.info.title&&(this.title=$t(new kl(e.info.title,this)));for(let t of e.info.cells){const e=new kl(t.data,this),n={row:t.row,col:t.col,rowspan:t.rowspan,colspan:t.colspan,box:$t(e),selection:!1};this.cells.push(n)}}export(){const e=this.base_export();this.title&&(e.info.title=this.title.export()),e.info.cells=[];for(let t of this.cells)e.info.cells.push(this.get_cell_data(t));return e}update_data(e,t){return fv.update_data(e,t)}gc(){this.base_gc()}get_cell_data(e){return{row:e.row,col:e.col,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()}}replace_id(e,t={}){return fv.replace_id(this.root,e,t)}get_rows(e){const t=[];for(let n of this.cells_sorted)e>=n.row&&e<n.row+n.rowspan&&t.push(n);return t}get_cols(e){const t=[];for(let n of this.cells_sorted)e>=n.col&&e<n.col+n.colspan&&t.push(n);return t}check_orderly_col(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const i=1===new Set(n.map(e=>e.right)).size,r=1===new Set(n.map(e=>e.left)).size;return i&&r}check_orderly_col_left(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.left)).size}check_orderly_col_right(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.right)).size}check_orderly_row(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const i=1===new Set(n.map(e=>e.bottom)).size,r=1===new Set(n.map(e=>e.top)).size;return i&&r}check_orderly_row_top(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return new Set(n.map(e=>e.bottom)).size,1===new Set(n.map(e=>e.top)).size}check_orderly_row_bottom(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.bottom)).size}get_cell_area(e){return{left:e.col,right:e.col+e.colspan-1,top:e.row,bottom:e.row+e.rowspan-1}}get_cell(e,t){for(let n of this.cells){const i=e>=n.row&&e<n.row+n.rowspan,r=t>=n.col&&t<n.col+n.colspan;if(i&&r)return n}}get_rectarea_cell(e){let t=!1;for(;!t;){const{left:n,right:i,top:r,bottom:s}=e;for(let o of this.cells){let{row:a,rowspan:l,col:c,colspan:d}=o,h=a,u=a+l-1,p=c,m=c+d-1;if(n>=p&&n<=m||n<=p&&m<=i||i>=p&&i<=m){if(h<r&&u>=r){e.top=a;break}if(h<=s&&u>s){e.bottom=a+l-1;break}}if(r>=h&&r<=u||r<h&&s>=u||s>=h&&s<=u){if(p<n&&m>=n){e.left=c;break}if(p<=i&&m>i){e.right=c+d-1;break}}o===this.cells[this.cells.length-1]&&(t=!0)}}const n=[];for(let t of this.cells_sorted){let{row:i,col:r,rowspan:s,colspan:o}=t;r>=e.left&&r+o-1<=e.right&&i>=e.top&&i+s-1<=e.bottom&&n.push(t)}return{...e,cells:n}}clear_selection(){for(let e of this.cells)e.selection=!1}get_active_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t?.find_upstream_untill(this);return this.cells.find(e=>e.box===n)}set_selection_area(e){this.get_rectarea_cell(e);for(let e of this.cells)e.selection=!1;for(let e of this.cells)e.selection=!0}get_focus_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t.find_upstream_untill(this);return n?this.cells.find(e=>e.box.id===n.id):void 0}get_selection_area(){let e,t;const n=this.selection_cells;if(0!==n.length){for(let i of n){const n=this.get_cell_area(i);e||(e=[n.top,n.bottom]),t||(t=[n.left,n.right]),n.top<e[0]&&(e[0]=n.top),n.left<t[0]&&(t[0]=n.left),n.bottom>e[1]&&(e[1]=n.bottom),n.right>t[1]&&(t[1]=n.right)}if(e&&t)return{left:t[0],right:t[1],top:e[0],bottom:e[1]}}}get_selection_size(){const e=this.get_selection_area();if(e)return[e.bottom-e.top+1,e.right-e.left+1]}get_selection_text(){const e=this.selection_cells;let t="";if(0===e.length)return t;for(let n of e)t+=n.box.text;return t}copy_selection_table(){const e=this.get_selection_size(),t=this.selection_cells,n=this.get_selection_area();if(!e||!t||!n)return;const i=[];for(let e of t)i.push({row:e.row-n.top,col:e.col-n.left,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()});const r=fv.get_default_by_data(e,i);return r.attrs=structuredClone(Ft(this.attrs)),r}add_title(e){const{data:t}=e,{courier:n,cursor:i,id:r}=this,s=n.get_recorder();s.add_cmd(e);const o=new kl(t,this);return this.title=$t(o),s.add_recover(ev.remove_title(r)),s}remove_title(e){const{id:t,courier:n,cursor:i}=this;if(!this.title)return;const r=this.title.export(),s=n.get_recorder();return s.add_cmd(e),this.title=void 0,s.add_recover(ev.add_title(t,r)),s}add_cell(e){const{id:t,courier:n,cursor:i}=this,{data:r}=e;this.clear_selection();const s=n.get_recorder();s.add_cmd(e);const o={row:r.row,col:r.col,rowspan:r.rowspan,colspan:r.colspan,box:$t(new kl(r.data,this)),selection:!1};return this.cells.push(o),s.add_recover(ev.remove_cell(t,o.box.id)),s}remove_cell(e){const{id:t,courier:n,cursor:i}=this,{cid:r}=e,s=n.get_recorder();s.add_cmd(e);const o=this.cells.findIndex(e=>e.box.id===r),a=this.cells[o];if(!a)return;const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan,data:a.box.export()};return o>=0&&this.cells.splice(o,1),s.add_recover(ev.add_cell(t,l)),s}add_row(e){const{courier:t,cursor:n,id:i}=this,{index:r,rows:s}=e,o=t.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:r,col:e,rowspan:1,colspan:1,data:t})}this.size[0]++;for(let e of this.cells)e.row<r||o.tell(this,ev.update_cell_area(i,e.box.id,{row:e.row+1,col:e.col,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,ev.add_cell(i,e));return o}remove_row(e){const{id:t,courier:n,cursor:i}=this,{index:r}=e,s=this.get_rows(r),o=n.get_recorder();for(let e of s)o.tell(this,ev.remove_cell(t,e.box.id));return this.size[0]--,o}add_col(e){const{id:t,cursor:n,courier:i}=this,{index:r,cols:s}=e,o=i.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:e,col:r,rowspan:1,colspan:1,data:t})}o.tell(this,ev.add_grid_col(t,r,2));for(let e of this.cells)e.col<r||o.tell(this,ev.update_cell_area(t,e.box.id,{row:e.row,col:e.col+1,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,ev.add_cell(t,e));return o}remove_col(e){const{id:t,cursor:n,courier:i}=this,{index:r}=e;if(!this.check_orderly_col(r))return ns.tips?.tip_info("目标列不整齐");let s;for(let e=0;e<=this.size[0]&&(s||(s=this.get_cell(e,r),!s));e++);if(!s)return;const o=i.get_recorder();for(let e=s.col;e<s.col+s.colspan;e++)o.tell(this,ev.remove_grid_col(t,e));const a=this.get_cols(r);for(let e of a)o.tell(this,ev.remove_cell(t,e.box.id));for(let e of this.cells){if(e.col<r)continue;const n={row:e.row,col:e.col-1,rowspan:e.rowspan,colspan:e.colspan};o.tell(this,ev.update_cell_area(t,e.box.id,n))}return o}moveto(e){const{id:t,courier:n,cursor:i}=this,{tid:r,cells:s}=e,o=n.get_recorder(),a=this.cells.find(e=>e.box.id===r);if(!a)return;const l=a.box,c=this.cells_sorted.filter(e=>e.box.id!==r&&s.includes(e.box.id));for(let e of c){const n=e.box.export();o.tell(this,ev.remove_cell(t,e.box.id)),o.tell(l,ds.insert_child(l.id,n.info,l.child_count))}return o}update_area(e){const{id:t,courier:n,cursor:i}=this,{tid:r,area:s}=e,o=n.get_recorder(),a=this.cells.find(e=>e.box.id===r);if(!a)return;o.add_cmd(e);const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return a.row=s.row,a.col=s.col,a.rowspan=s.rowspan,a.colspan=s.colspan,o.add_recover(ev.update_cell_area(t,r,l)),o}merge_cell(e){const{id:t,cursor:n,courier:i}=this,{area:r}=e,s=i.get_recorder(),o=this.get_rectarea_cell(r);let a=o.cells[0];if(!a)return;const l={row:r.top,col:r.left,rowspan:r.bottom-r.top+1,colspan:r.right-r.left+1},c=a.box.id;return s.tell(this,ev.update_cell_area(t,c,l)),s.tell(this,ev.moveto(t,c,o.cells.map(e=>e.box.id))),s}add_grid_col(e){const{id:t,courier:n,cursor:i}=this,{index:r,width:s}=e,o=n.get_recorder();return o.add_cmd(e),this.cols.splice(r,0,s),this.size[1]++,o.add_recover(ev.remove_grid_col(t,r)),o}remove_grid_col(e){const{id:t,courier:n,cursor:i}=this,{index:r}=e,s=n.get_recorder(),o=this.cols.splice(r,1);if(0!==o.length)return this.size[1]--,s.add_recover(ev.add_grid_col(t,r,o[0])),s}col_resize(e){const{id:t,courier:n,cursor:i}=this,{cols:r,step:s}=e,o=n.get_recorder();o.add_cmd(e);let a=!1;for(let e=r[0];e<=r[1];e++){let t=this.cols[e]+s;t<=0||(a=!0,this.cols[e]=t)}if(a)return o.add_recover(ev.col_resize(t,r,-s)),o}delete_child(e){const{dir:t,range:n,reserve:i}=e,{courier:r,cursor:s,history:o}=this,a=r.get_recorder();let[l,c]=this.get_valid_range(n);if(0===l&&c>=this.child_count)if(i){if(this.is_empty)return;const e=this.child_first;a.tell(this,ds.delete_child(this.id,"backward",[1,this.child_count],i)),a.tell(e,ds.delete_child(e.id,"backward",[0,e.child_count],i))}else a.merge(this.remove_self());else{let e=[];for(let t=l;t<c;t++){let n=this.children[t];e.push(n.id)}for(let t of e)a.tell(this,ev.remove_cell(this.id,t))}return a}static get meta(){return{cubename:"表格",type:n.table,block:!0,version:1,show:!0}}static get_default(e=3,t=3){const i=[],r=[];r.length=t,r.fill(2);for(let n=0;n<e;n++)for(let e=0;e<t;e++){const t={row:n,col:e,rowspan:1,colspan:1,data:kl.get_default()};i.push(t)}return{id:ss.get_id(),type:n.table,info:{size:[e,t],cols:r,cells:i},attrs:{width:500},css:{}}}static get_default_by_data(e,t){const[i,r]=e,s=[];return s.length=r,s.fill(2),{id:ss.get_id(),type:n.table,info:{size:[i,r],cols:s,cells:t},attrs:{width:500},css:{}}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();n[i]=r,t.id=r,t.info.title&&(t.info.title=kl.replace_id(e,t.info.title,n));for(let i of t.info.cells)i.data=kl.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}mv([ys(w.add_title)],fv.prototype,"add_title",null),mv([ys(w.remove_title)],fv.prototype,"remove_title",null),mv([ys(w.add_cell)],fv.prototype,"add_cell",null),mv([ys(w.remove_cell)],fv.prototype,"remove_cell",null),mv([ys(w.add_row)],fv.prototype,"add_row",null),mv([ys(w.remove_row)],fv.prototype,"remove_row",null),mv([ys(w.add_col)],fv.prototype,"add_col",null),mv([ys(w.remove_col)],fv.prototype,"remove_col",null),mv([ys(w.moveto)],fv.prototype,"moveto",null),mv([ys(w.update_area)],fv.prototype,"update_area",null),mv([ys(w.merge)],fv.prototype,"merge_cell",null),mv([ys(w.add_grid_col)],fv.prototype,"add_grid_col",null),mv([ys(w.remove_grid_col)],fv.prototype,"remove_grid_col",null),mv([ys(w.col_resize)],fv.prototype,"col_resize",null),mv([ys(i.cube_delete_child)],fv.prototype,"delete_child",null);const _v=["id","data-type"],gv=Pn({__name:"cube-tip",props:{cube:{}},setup:e=>(e,t)=>(fr(),yr("div",{class:"cube-tip",style:fe(e.cube.css),id:e.cube.id,"data-type":Kt(n).tip},[Mr(Oo,{cube:e.cube.box},null,8,["cube"])],12,_v))}),bv=(0,wo.A)(gv,[["__scopeId","data-v-433bbb71"]]);function yv(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class vv extends Es{get component(){return bv}get children(){return[this.box]}box;constructor(e,t){return super(e,t),this.setup(e,t)}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof Es&&r.push(e.export());return{children:i,data:r}}replace_id(e,t={}){return vv.replace_id(this.root,e,t)}build_child(e){this.box=new kl(e.info,this)}update_data(e,t){return vv.update_data(e,t)}export(){const e=this.base_export();return e.info=this.box.export(),e}gc(){super.base_gc()}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(ds.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,hs.in_head(a.id)):r.tell(this.child_last,hs.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,s=t.get_recorder();s.add_cmd(e);const{dir:o,range:a}=e,[l,c]=a;let d=l<0?0:l,h=c>this.child_count?this.child_count:c;if(d>=h)return;if(d<=0&&h>=this.child_count)return this.is_empty?s.tell(r,ds.delete_child(n,o,[i,i+1])):s.tell(this,ds.reset(this.id,[])),s;const u=this.children[d-1],p=this.children[h],m=h-d;let f=this.splice(l,m);return s.add_recover(ds.insert_child(this.id,f.data,l)),"backward"===o?u?s.tell(u,hs.in_tail(u.id)):p&&s.tell(p,hs.in_head(p.id)):"forward"===o&&(p?s.tell(p,hs.in_head(p.id)):u&&s.tell(u,hs.in_tail(u.id))),s}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new cs(t),s=[];for(let e of this.children)s.push(e.export());const o=ss.build_cubes(i,this);return this.splice(0,this.child_count,...o),r.add_recover(ds.reset(this.id,s)),r}get meta(){return vv.meta}static get meta(){return{cubename:"提示",type:n.tip,block:!0,version:1,show:!0}}static get_default(e,t={},i={}){return{id:ss.get_id(),type:n.tip,info:kl.get_default(e),attrs:i,css:t}}static get_default_by_string(e,t={},i={}){const r=bl.get_default_by_string(e),s=kl.get_default([r]);return{id:ss.get_id(),type:n.tip,info:s,attrs:i,css:t}}static replace_id(e,t,n={}){const i=t.id,r=ss.get_id();return n[i]=r,t.id=r,t.info=kl.replace_id(e,t.info,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}yv([ys(i.cube_insert_child)],vv.prototype,"on_insert_child",null),yv([ys(i.cube_delete_child)],vv.prototype,"on_delete_child",null),yv([ys(i.cube_reset)],vv.prototype,"on_reset",null);const wv=["id","data-type"],xv=Pn({__name:"cube-box-columns",props:{cube:{}},setup(e){const t=Wt(),i=Wt();let r;return Lt({open:!1}),Vn(()=>{const n=t.value;if(!n)return;const s=i.value;if(!s)return;r=new us.DragDiff(s);let o=e.cube.attrs.width,a=e.cube.attrs.height,l=o,c=a;r.register_down(()=>{o=e.cube.attrs.width,a=e.cube.attrs.height}),r.register_move((t,i)=>{l=Math.round(t+o),l<e.cube.min_width&&(l=e.cube.min_width),n.style.width=l+"px",n.style.height=c+"px"}),r.register_up((t,n)=>{if(o===l&&a===c)return;const i=e.cube.courier.get_recorder(),r=Math.round(t+o);i.tell(e.cube,ds.resize(e.cube.id,r)),e.cube.history.record(i)}),r.register_cancel(()=>{e.cube.attrs.width=o,e.cube.attrs.height=a})}),Xn(()=>{r?.off()}),(r,s)=>(fr(),yr("div",{class:"cube-box-columns",ref_key:"box",ref:t,style:fe(r.cube.css),id:r.cube.id,"data-type":Kt(n).box_columns,onContextmenu:s[0]||(s[0]=e=>Kt(uo)(e,r.cube))},[Cr("div",{class:"box-columns-content",style:fe(e.cube.attrs.column_count?{"column-count":e.cube.attrs.column_count}:e.cube.attrs.column_width?{"column-width":e.cube.attrs.column_width+"px"}:{})},[(fr(!0),yr(cr,null,ri(r.cube.children,e=>(fr(),vr(Oo,{key:e.id,cube:e},null,8,["cube"]))),128))],4),Cr("div",{class:"box-columns-dragger",ref_key:"dragger",ref:i},null,512)],44,wv))}}),kv=(0,wo.A)(xv,[["__scopeId","data-v-84430922"]]);function Sv(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Cv extends Es{constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return kv}get css(){const{width:e}=this.data.attrs;return{...super.css,width:e+"px"}}get attrs(){return this.data.attrs}get meta(){return Cv.meta}get min_width(){return 200}build_child(e){const t=ss.build_cubes(e.info,this);this._children.push(...t)}update_data(e,t){return Cv.update_data(e,t)}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}gc(){this.base_gc()}replace_id(e,t){return Cv.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t,history:n}=this,{data:i}=e,r=t.get_recorder();r.add_cmd(e);const s=ss.build_cubes(e.data,this),o=this.child_count;return this._children.push(...s),r.add_recover(ds.delete_child(this.id,"backward",[o,this.child_count])),r}on_delete_child(e){const{courier:t,history:n}=this,{dir:i,range:r,reserve:s}=e,o=t.get_recorder(),a=this.get_valid_index(r[0]),l=this.get_valid_index(r[1]),c=[],d=this._children.splice(a,l-a);for(let e of d)c.push(e.export());return o.add_recover(ds.insert_child(this.id,c,a)),o}static replace_id(e,t,n){const i=t.id,r=n[i]||ss.get_id();return n[i]=r,t.id=r,ss.replace_id(e,e.cube_versions,t.info,n),t}static get_default(){const e=kl.get_default(),t=kl.get_default(),i=kl.get_default();return{id:ss.get_id(),type:n.box_columns,info:[e,t,i],attrs:{width:400,column_count:3},css:{}}}static get meta(){return{cubename:"多列容器",type:n.box_columns,block:!0,version:1,show:!0}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Sv([ys(i.cube_insert_child)],Cv.prototype,"on_insert_child",null),Sv([ys(i.cube_delete_child)],Cv.prototype,"on_delete_child",null);class Mv{static reset(e,t){return{id:e,name:S.reset_explanation,explanation:t}}}const zv=["id","data-type"],Av=Pn({__name:"cube-rt",props:{cube:{}},setup(e){const{event:t}=e.cube;function i(){t.emit_show_cube_editor(e.cube)}return(t,r)=>(fr(),yr("ruby",{class:"cube-rt",id:t.cube.id,style:fe(t.cube.css),"data-type":Kt(n).rt,onClick:i},[Ar(Se(t.cube.info.text)+" ",1),Cr("rt",{style:fe({"font-size":`max(calc(0.6 * ${e.cube.css["font-size"]||"16px"}),${Pv.min_size}px)`})},Se(t.cube.info.explanation),5),r[0]||(r[0]=Ar(" ",-1))],12,zv))}}),Tv=Av;class Pv extends Es{data;static get min_size(){return 12}static get scale(){return.6}constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return Tv}get meta(){return Pv.meta}build_child(e){}update_data(e,t){return Pv.update_data(e,t)}export(){return this.base_export()}gc(){this.base_gc()}replace_id(e,t){return Pv.replace_id(this.root,e,t)}reset_explanation(e){const{explanation:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=this.info.explanation;this.info.explanation=t;const s=Mv.reset(this.id,r);return i.add_recover(s),i}static get meta(){return{cubename:"标注文本",type:n.rt,block:!1,version:1,show:!1}}static get_default(e="",t="",i={}){return{id:ss.get_id(),type:n.rt,info:{text:e,explanation:t},attrs:{},css:i}}static replace_id(e,t,n){const i=t.id;return t.id=n[i]||ss.get_id(),n[i]=t.id,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([ys(S.reset_explanation)],Pv.prototype,"reset_explanation",null)})(),s})());
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deepsky=t():e.deepsky=t()}(self,()=>(()=>{var e,t,n={1858:e=>{var t;self,t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ArrayTools:()=>h,DateTime:()=>c,DomAnimation:()=>d,DragDiff:()=>m,DragList:()=>p,Iteration:()=>a,MathBase:()=>_,MathLine:()=>v,MathPoint:()=>b,MathPolygon:()=>y,MathRect:()=>g,Notice:()=>o,_RectPosition:()=>s});var n,i,r,s=function(e){return e.left_mid="left-mid",e.left_top="left-top",e.left_bottom="left-bottom",e.top_mid="top-mid",e.bottom_mid="bottom-mid",e.right_top="right-top",e.right_mid="right-mid",e.right_bottom="right_bottom",e.center="center",e}({});class o{static rope(e,t){return(...n)=>{let i=Symbol();return this.scope[e]=i,t(()=>i===this.scope[e],...n)}}static throttle(e,t=100){let n;return function(...i){n||(n=setTimeout(()=>{e(...i),n=void 0},t))}}static debounce(e,t=100){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}}r={},(i="scope")in(n=o)?Object.defineProperty(n,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[i]=r;class a{static*zip(...e){const t=Math.min(...e.map(e=>e.length));for(let n=0;n<t;n++)yield e.map(e=>e[n])}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c{static get_month_name(e){let t;return t=e||new Date,this.month_names[t.getMonth()]}static get_week_name(e){let t;return t=e||new Date,this.weeks_names[t.getDay()]}static get_date_string(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}static get_week_string(e){let t;t=e||new Date;const n=t.getDate(),i=t.getDay(),r=new Date(t.getFullYear(),t.getMonth(),n-i),s=new Date(t.getFullYear(),t.getMonth(),n+(6-i));return`${this.get_date_string(r)}:${this.get_date_string(s)}`}static get_week_days(e){const t=[];let n;n=e||new Date;const i=n.getFullYear(),r=n.getMonth(),s=n.getDate(),o=n.getDay(),a=new Date(i,r,s-o),l=a.getFullYear(),c=a.getMonth(),d=a.getDate();t.push(a);for(let e=1;e<=6;e++)t.push(new Date(l,c,d+e));return t}}l(c,"month_names",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),l(c,"weeks_names",["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);class d{static scroll_element(e,t,n="vertical"){let i=t;const r=()=>{if(Math.abs(i)>2){let t=i/10;i-=t,"vertical"===n?e.scrollTop+=t:e.scrollLeft+=t,requestAnimationFrame(r)}"vertical"===n?e.scrollTop+=i:e.scrollLeft+=i};r()}}class h{static swap(e,t,n){const i=e[t],r=e[n];e[t]=r,e[n]=i}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class p{init(){const e=this.order,t=new Set;this.order=[];for(let e=0;e<this.container.children.length;e++){const n=this.container.children[e],i=n.getAttribute(this.attr);i&&n instanceof HTMLElement&&(n.setAttribute("draggable","true"),n.style.position="absolute","horizental"===this.dir?n.style.left="0px":n.style.top="0px",this.order_origin.push(i),t.add(i),this.map.has(i)||this.register(n),this.map.set(i,n))}const n=this.init_container();this.container.addEventListener("dragenter",e=>{e.preventDefault()}),this.container.addEventListener("dragover",e=>{e.preventDefault()});for(let n of e)t.has(n)?(this.order.push(n),t.delete(n)):this.map.delete(n);for(let e of t)this.order.push(e);return this.sort(),n}sort(){for(let e=0;e<this.order.length;e++){const t=this.order[e],n=this.map.get(t);if(!n)continue;const i=this.sum_translate(this.order.slice(0,e));"horizental"===this.dir?n.style.transform=`translateX(${i}px)`:n.style.transform=`translateY(${i}px)`}for(let e of this.callback)e([...this.order])}init_container(){let e=0;for(const[t,n]of this.map)"horizental"===this.dir?e+=n.getBoundingClientRect().width/this.scale_h:e+=n.getBoundingClientRect().height/this.scale_v;return"horizental"===this.dir?this.container.style.width=e+"px":this.container.style.height=e+"px",e}sum_translate(e){let t=0;for(let n of e){const e=this.map.get(n);e&&("horizental"===this.dir?t+=e.getBoundingClientRect().width/this.scale_h:t+=e.getBoundingClientRect().height/this.scale_v)}return t}register(e){this._func_start=this.on_dragstart.bind(this),this._func_over=this.on_dragover.bind(this),this._func_enter=this.on_dragenter.bind(this),this._func_end=this.on_dragend.bind(this),e.addEventListener("dragstart",this._func_start,{capture:!0}),e.addEventListener("dragover",this._func_over,{capture:!0}),e.addEventListener("dragenter",this._func_enter,{capture:!0}),e.addEventListener("dragend",this._func_end,{capture:!0}),this.realtime||e.addEventListener("drop",this.on_drop.bind(this),{capture:!0})}on_dragstart(e){e.stopPropagation();const t=e.currentTarget;if(t instanceof HTMLElement&&(this.drag_id=t.getAttribute(this.attr),this.drag_id))for(let t of this.callback_start)t(e,this.drag_id);this.container.style.setProperty(this.css_var_point_events,"none")}on_dragenter(e){if(e.stopPropagation(),e.preventDefault(),!this.realtime)return;const t=e.currentTarget;if(e.target!==t)return;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),i=this.drag_id;if(!n||!i||n===i)return;const r=this.order.indexOf(n),s=this.order.indexOf(i);r<0||s<0||("swap"===this.effect?h.swap(this.order,r,s):(this.order.splice(s,1),this.order.splice(r,0,i)),this.init_container(),this.sort())}on_dragover(e){e.preventDefault(),e.stopPropagation()}on_drop(e){e.stopPropagation();const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),i=this.drag_id;if(!n||!i||n===i)return;const r=this.order.indexOf(n),s=this.order.indexOf(i);r<0||s<0||("swap"===this.effect?h.swap(this.order,r,s):(this.order.splice(s,1),this.order.splice(r,0,i)),this.sort())}on_dragend(e){this.container.style.setProperty(this.css_var_point_events,"auto");for(let t of this.callback_end)t(e)}register_start(e){this.callback_start.add(e)}register_dropend(e){this.callback_end.add(e)}register_callback(e){this.callback.add(e)}off_callback(e){this.callback.delete(e)}off_callback_start(e){this.callback_start.delete(e)}off_callback_drop(e){this.callback_end.delete(e)}constructor(e,t,n,i,r=!0){u(this,"container",void 0),u(this,"drag_id",void 0),u(this,"dir","vertical"),u(this,"effect",void 0),u(this,"attr",void 0),u(this,"realtime",!0),u(this,"order_origin",[]),u(this,"order",[]),u(this,"css_var_point_events","--drag-item-point-event"),u(this,"map",new Map),u(this,"callback",new Set),u(this,"callback_start",new Set),u(this,"callback_end",new Set),u(this,"scale_h",1),u(this,"scale_v",1),u(this,"_func_start",void 0),u(this,"_func_over",void 0),u(this,"_func_enter",void 0),u(this,"_func_end",void 0),u(this,"_callback_start",void 0),this.container=e,this.dir=t,this.attr=n,this.realtime=r,this.effect=i,e.style.position="relative"}}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class m{get el(){return this._el}init(){this._handler_down=e=>this._pointdown(e),this._handler_move=e=>this._pointmove(e),this._handler_up=e=>this._pointup(e),this._handler_cancel=e=>this._pointercancel(e),this.el.addEventListener("pointerdown",this._handler_down),document.documentElement.addEventListener("pointermove",this._handler_move),document.documentElement.addEventListener("pointerup",this._handler_up),document.documentElement.addEventListener("pointercancel",this._handler_cancel)}_pointdown(e){e.stopPropagation(),e.preventDefault();const t=e.target;this.el.contains(t)&&(this._is_down=!0,this._down_point={x:e.clientX,y:e.clientY},this._func_down&&this._func_down())}_pointmove(e){if(!this._is_down||!this._down_point||e.buttons<=0)return;e.stopPropagation(),e.preventDefault(),this._is_move=!0;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._func_move&&this._func_move(t,n)}_pointup(e){if(e.preventDefault(),e.stopPropagation(),!this._is_down||!this._is_move)return;if(this._is_down=!1,this._is_move=!1,!this._down_point)return;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._down_point=void 0,this._func_up&&this._func_up(t,n)}_pointercancel(e){this._is_down&&this._is_move&&(this._is_down=!1,this._is_move=!1,this._down_point=void 0,this._func_cancel&&this._func_cancel())}off(){this.el.removeEventListener("pointerdown",this._handler_down),document.documentElement.removeEventListener("pointermove",this._handler_move),document.documentElement.removeEventListener("pointerup",this._handler_up),document.documentElement.removeEventListener("pointercancel",this._handler_cancel)}register_down(e){this._func_down=e}register_move(e){this._func_move=e}register_up(e){this._func_up=e}register_cancel(e){this._func_cancel=e}constructor(e){f(this,"_el",void 0),f(this,"_handler_down",void 0),f(this,"_handler_move",void 0),f(this,"_handler_up",void 0),f(this,"_handler_cancel",void 0),f(this,"_func_down",void 0),f(this,"_func_move",void 0),f(this,"_func_up",void 0),f(this,"_func_cancel",void 0),f(this,"_is_down",!1),f(this,"_is_move",!1),f(this,"_down_point",void 0),this._el=e,this.init()}}class _{static sum(e){let t=0;for(let n of e)t+=n;return t}}class g{static get_rect_point(e,t){const{x:n,y:i,width:r,height:o}=e,a=i+o,l=n+r,c=n+r/2,d=i+o/2;if(t===s.left_bottom)return{x:n,y:a};if(t===s.left_top)return{x:n,y:i};if(t===s.left_mid)return{x:n,y:d};if(t===s.right_top)return{x:l,y:i};if(t===s.right_mid)return{x:l,y:d};if(t===s.right_bottom)return{x:l,y:a};if(t===s.bottom_mid)return{x:c,y:a};if(t===s.top_mid)return{x:c,y:i};if(t===s.center)return{x:c,y:d};throw Error("MathRect: the position keyword is invalid")}static is_point_in_rect(e,t,n=!0){const i=e.x===t.x||e.x===t.x+t.width,r=e.y===t.y||e.y===t.y+t.height,s=e.x>t.x&&e.x<t.x+t.width,o=e.y>t.y&&e.y<t.y+t.height;return n?(s||i)&&(o||r):s&&o}static get_point_in_rects(e,t,n=!0){const i=[];for(let r of t)this.is_point_in_rect(e,r,n)&&i.push(r);return i}static get_point_center(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}static move_rect_to_other(e,t,n,i=5){const r={width:e.width,height:Math.abs(e.y-n.y)},s={width:e.width,height:Math.abs(e.height-(n.y+n.height))},o={width:Math.abs(n.x-e.x),height:e.height},a={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(g.can_include_size(s,t)){const r=t.width+n.x-e.width,s=n.y+n.height+i;return{x:r<0?n.x:n.x-r,y:s}}if(g.can_include_size(r,t)){const r=t.width+n.x-e.width,s=n.y-t.height-i;return{x:r<0?n.x:n.x-r,y:s}}if(g.can_include_size(o,t)){const r=n.y+t.height-e.height;return{x:n.x-t.width-i,y:r<0?n.y:n.y-r}}if(g.can_include_size(a,t)){const r=n.y+t.height-e.height;return{x:n.x+n.width+i,y:r<0?n.y:n.y-r}}if(g.can_include_size(e,t)){const i=e.y+e.height-t.height;let r=n.x;return a.width>=t.width?r=n.x+n.width:o.width>=t.width&&(r=n.x-t.width),{x:r,y:i}}return{x:n.x,y:0}}static move_rect_in_other(e,t){if(g.is_include(t,e))return{dx:0,dy:0};let n=0,i=0;return e.x<t.x?n=t.x-e.x:e.x+e.width>t.x+t.width&&(n=t.x+t.width-(e.x+e.width)),e.y<t.y?i=t.y-e.y:e.y+e.height>t.y+t.height&&(i=t.y+t.height-(e.y+e.height)),{dx:n,dy:i}}static can_include_size(e,t){return t.width<=e.width&&t.height<=e.height}static is_include(e,t){return!(!this.can_include_size(e,t)||t.x<e.x||t.x>e.x+e.width-t.width||t.y<e.y||t.y>e.y+e.height-t.height)}static check_intersection(e,t){const n=this.get_point_center(e),i=this.get_point_center(t),r=Math.abs(n.x-i.x),s=Math.abs(n.y-i.y);return r<=(e.width+t.width)/2&&s<=(e.height+t.height)/2}static limit_point_in_rect(e,t){const n=t.x,i=t.y,r=t.x+t.width,s=t.y+t.height;let o=e.x,a=e.y;return o<n&&(o=n),o>r&&(o=r),a<i&&(a=i),a>s&&(a=s),{x:o,y:a}}static point_distance_with_rect(e,t){if(this.is_point_in_rect(e,t,!0))return 0;const n=t.x+t.width/2,i=t.y+t.height/2,r=t.width/2,s=t.height/2,o=Math.abs(n-e.x),a=Math.abs(i-e.y);return o<=r&&a>s?a-s:a<=s&&o>r?o-r:Math.sqrt(Math.pow(o-r,2)+Math.pow(a-s,2))}static distance_with(e,t){const n=this.get_point_center(e),i=this.get_point_center(t),r=Math.abs(n.x-i.x),s=Math.abs(n.y-i.y),o=(e.width+t.width)/2,a=(e.height+t.height)/2;if(r<=o&&s<=a)return 0;if(r>o&&s<=a)return r-o;if(r<=o&&s>a)return s-a;{let e=Math.pow(r-o,2),t=Math.pow(s-a,2);return Math.sqrt(e+t)}}static get_nearest_rect(e,t){if(0===t.length)return;let n,i=Number.POSITIVE_INFINITY;for(let r of t){let t=this.point_distance_with_rect(e,r);t<i&&(i=t,n=r)}return n}static get_shadow_point_horizental(e,t){let n=t.x,i=t.y+t.height/2;return n=e.x<=t.x?t.x:e.x>=t.x+t.width?t.x+t.width:e.x,{x:n,y:i}}static merge(...e){const t=e[0];let n=t.x,i=t.x+t.width,r=t.y,s=t.y+t.height;for(let t of e.slice(1)){const{x:e,y:o,width:a,height:l}=t;e<n&&(n=e),e+a>i&&(i=e+a),o<r&&(r=o),o+l>s&&(s=o+l)}return{x:n,y:r,width:i-n,height:s-r}}}class b{static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],i=this.path.getTotalLength()/t;for(let e=0;e<t;e++){const t=e*i,r=this.path.getPointAtLength(t);n.push({x:r.x,y:r.y})}return n}static get_line_k(e,t,n=100){const i=t.y-e.y,r=t.x-e.x;return 0===r?Number.POSITIVE_INFINITY:i/r}static distance(e,t){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}static find_closet_point(e,t){let n=1/0,i=e[0];const{x:r,y:s}=t;for(let t of e){let e=Math.pow(r-t.x,2)+Math.pow(s-t.y,2);e<n&&(n=e,i=t)}return i}static offset_points(e,t){const n=[],{x:i,y:r}=t;for(let t of e)n.push({x:t.x+i,y:t.y+r});return n}static find_closest_points(e,t){let n=1/0,i=e[0],r=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,i=o,r=s)}}return{from:i,to:r}}}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(b,"path",document.createElementNS("http://www.w3.org/2000/svg","path"));class y{static polygon_center(e){let t=0,n=0,i=0;const r=e.length;for(let s=0;s<r;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%r],d=o*c-l*a;i+=d,t+=(o+l)*d,n+=(a+c)*d}return i*=.5,t/=6*i,n/=6*i,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let i=0;i<n;i++){const{x:r,y:s}=e[i],{x:o,y:a}=e[(i+1)%n];t+=r*a-o*s}return t/2}}class v{static check_intersection(e,t){const{from:n,to:i}=e,{from:r,to:s}=t;let o,a;if(o=n.x===i.x?Number.POSITIVE_INFINITY:(i.y-n.y)/(i.x-n.x),a=r.x===s.x?Number.POSITIVE_INFINITY:(s.y-r.y)/(s.x-r.x),o===a)return!1;const l=Math.min(n.x,i.x),c=Math.max(n.x,i.x),d=Math.min(n.y,i.y),h=Math.max(n.y,i.y),u=Math.min(r.x,s.x),p=Math.max(r.x,s.x),f=Math.min(r.y,s.y),m=Math.max(r.y,s.y);if(o===Number.POSITIVE_INFINITY){const e=n.x,t=a*(e-r.x)+r.y;return e>=l&&e<=c&&e>=u&&e<=p&&t>=d&&t<=h&&t>=f&&t<=m}if(a===Number.POSITIVE_INFINITY){const e=r.x,t=(i.y-n.y)/(i.x-n.x)*(e-n.x)+n.y;return e>=l&&e<=c&&e>=u&&e<=p&&t>=d&&t<=h&&t>=f&&t<=m}{const e=(r.y-n.y+o*n.x-a*r.x)/(o-a),t=o*(e-n.x)+n.y;return e>=l&&e<=c&&e>=u&&e<=p&&t>=d&&t<=h&&t>=f&&t<=m}}}return t})(),e.exports=t()},6960:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n}}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var s=i[e]={exports:{}};return n[e](s,s.exports,r),s.exports}r.m=n,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"chunk/"+e+"-"+r.h()+".js",r.miniCssF=e=>{},r.h=()=>"18c422270456d7d0252a",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="deepsky:",r.l=(n,i,s,o)=>{if(e[n])e[n].push(i);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var h=c[d];if(h.getAttribute("src")==n||h.getAttribute("data-webpack")==t+s){a=h;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",t+s),a.src=n),e[n]=[i];var u=(t,i)=>{a.onerror=a.onload=null,clearTimeout(p);var r=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(e=>e(i)),t)return t(i)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),l&&document.head.appendChild(a)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={3057:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var s=new Promise((n,r)=>i=e[t]=[n,r]);n.push(i[2]=s);var o=r.p+r.u(t),a=new Error;r.l(o,n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var s=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,i[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,s,[o,a,l]=n,c=0;if(o.some(t=>0!==e[t])){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(l)l(r)}for(t&&t(n);c<o.length;c++)s=o[c],r.o(e,s)&&e[s]&&e[s][0](),e[s]=0},n=self.webpackChunkdeepsky=self.webpackChunkdeepsky||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s={};return(()=>{"use strict";r.r(s),r.d(s,{BoundBox:()=>bd,CodeLanguageMap:()=>Bm,CommandApi:()=>Ad,CommandBoxFolder:()=>rc,CommandBoxRoot:()=>Gl,CommandCode:()=>nh,CommandCube:()=>Rs,CommandCursor:()=>Ls,CommandDetailList:()=>Nd,CommandFomula:()=>Gv,CommandLinker:()=>Pc,CommandListOrdered:()=>Xd,CommandMap:()=>Bs,CommandNode:()=>Is,CommandRt:()=>bw,CommandTable:()=>Uv,CommandText:()=>xa,CommandTextLink:()=>ma,CommandTodo:()=>Id,CubeAnnotation:()=>da,CubeApi:()=>Td,CubeBase:()=>js,CubeBox:()=>Ql,CubeBoxColumns:()=>gw,CubeBoxFolder:()=>ic,CubeBoxRoot:()=>$l,CubeChild:()=>ro,CubeCode:()=>Hm,CubeDetailList:()=>Dd,CubeDoc:()=>Vl,CubeFomula:()=>Vv,CubeHandler:()=>Hs,CubeImg:()=>Yo,CubeLine:()=>Wl,CubeLinker:()=>ad,CubeList:()=>Yd,CubeListOrdered:()=>th,CubeLost:()=>Zo,CubeMap:()=>wd,CubeNode:()=>gd,CubePostil:()=>wa,CubeRoot:()=>io,CubeRt:()=>xw,CubeSubMap:()=>od,CubeTable:()=>aw,CubeText:()=>Sa,CubeTextLink:()=>_a,CubeTip:()=>uw,CubeTodo:()=>$d,LinkerLine:()=>Tc,LinkerPoint:()=>Ac,MapBase:()=>so,MapInteraction:()=>Fc,MapNodeBase:()=>ao,MapTools:()=>ks,Matrix2D:()=>xs,NodeObserver:()=>ld,NodeShape:()=>yd,NoteApi:()=>Cs,NoteBase:()=>Ss,NoteClipBoard:()=>Zs,NoteConfig:()=>eo,NoteCourier:()=>no,NoteCubes:()=>Vs,NoteCursor:()=>to,NoteEvent:()=>Js,NoteHistory:()=>Ns,NoteHotkeys:()=>Xs,NoteIcons:()=>ra,NoteListener:()=>Gs,NoteManager:()=>zs,NotePainter:()=>Qs,NotePlayer:()=>Ps,NoteScope:()=>$s,NoteStats:()=>Ks,NoteTools:()=>Ts,Recorder:()=>Os,Waiter:()=>As,_ApiCommandNames:()=>p,_CodeCommandNames:()=>g,_CubeCommandName:()=>i,_CursorCommandName:()=>o,_DetaiListCommandName:()=>f,_DocCommandName:()=>d,_FomulaCommandNames:()=>v,_FomulaSize:()=>y,_HotKeys:()=>T,_HotKeysGroup:()=>A,_Keys:()=>N,_LinkerAnchor:()=>x,_LinkerCommandNames:()=>k,_ListCommandNames:()=>m,_ListOrderedCommandNames:()=>_,_MapCommandName:()=>a,_MapGroup:()=>h,_NavigationKey:()=>P,_NodeCommandName:()=>l,_NoteCores:()=>t,_NoteCubeTypes:()=>n,_NoteEvents:()=>M,_NoteMode:()=>z,_PlayStatus:()=>C,_RtCommandNames:()=>S,_TableCommandNames:()=>w,_TextCommandName:()=>c,_TextLinkCommandNames:()=>u,_TodoCommandNames:()=>b,cmd:()=>Fs,key:()=>Ys,keymap:()=>Ws,node_observer:()=>cd});var e={};r.r(e),r.d(e,{boolean:()=>Lu,booleanish:()=>Eu,commaOrSpaceSeparated:()=>qu,commaSeparated:()=>ju,number:()=>Iu,overloadedBoolean:()=>Du,spaceSeparated:()=>Bu});var t=function(e){return e.courier="courier",e.cursor="cursor",e.config="config",e.cubes="cubes",e.clipboard="clipboard",e.event="event",e.fomula="fomula",e.painter="painter",e.player="player",e.hotkeys="hotkeys",e.history="history",e.scope="scope",e.stats="stats",e}({}),n=function(e){return e.api="api",e.annotation="annotation",e.box="box",e.box_root="box-root",e.box_folder="box-folder",e.box_columns="box-columns",e.code="code",e.doc="doc",e.detail_list="detail-list",e.fomula="fomula",e.img="img",e.lost="lost",e.line="line",e.list="list",e.list_ordered="list-ordered",e.linker="linker",e.link="link",e.map="map",e.submap="submap",e.node="node",e.postil="postil",e.rt="rt",e.text="text",e.tip="tip",e.todo="todo",e.table="table",e}({}),i=function(e){return e.cube_insert_child="cube-insert-child",e.cube_delete_child="cube-delete-child",e.cube_reset="cube-reset",e.cube_delete_adjacent="cube-delete-adjacent",e.cube_set_selection_css="cube-set-selection-css",e.cube_insert="cube-insert",e.cube_delete="cube-delete",e.cube_partition="cube-partition",e.cube_reorder="cube-reorder",e.cube_set_css="cube-set-css",e.cube_set_attr="cube-set-attr",e.cube_move="cube-move",e.cube_merge="cube-merge",e.cube_postil_add="cube-postil-add",e.cube_postil_remove="cube-postil-remove",e}({}),o=function(e){return e.cursor_in_head="cursor:in-head",e.cursor_in_tail="cursor:in-tail",e.loc="cursor:loc",e}({}),a=function(e){return e.node_add="node-add",e.node_remove="node-remove",e.linker_add="linker-add",e.linker_remove="linker-remove",e.update_attrs="update-attrs",e}({}),l=function(e){return e.layout_update="node:layout-update",e.append_child="node:append-child",e}({}),c=function(e){return e.text_reset="cube-text:text-reset",e.text_merge="cube-text:text-merge",e.text_break="cube-text:text-break",e}({}),d=function(){return{}}(),h=function(e){return e.markers="markers",e.nodes="nodes",e.linkers="linkers",e.placeholder="placeholder",e}({}),u=function(e){return e.update="text-link:update",e}({}),p=function(e){return e.reset="cube-api:reset",e}({}),f=function(e){return e.insert_row="cube-detail-list:insert-row",e.remove_row="cube-detail-list:remove-row",e.change_width_col1="cube-detail-list:change-width-col1",e}({}),m=function(e){return e.add="cube-list:add",e.remove="cube-list:remove",e.indent="cube-list:indent",e.reset="cube-list:reset",e.transform="cube-list:transform",e}({}),_=function(e){return e.add="cube-list-ordered:add",e.remove="cube-list-ordered:remove",e.indent="cube-list-ordered:indent",e.reset="cube-list-ordered:reset",e}({}),g=function(e){return e.change_lang="cube-code:change-lang",e.change_active="cube-code:change-active",e.change_theme="cube-code:change-theme",e.code_update="cube-code:update-code",e.code_add="cube-code:code-add",e.code_remove="cube-code:code-remove",e.code_rename="cube-code:code-rename",e}({}),b=function(e){return e.add="cube-todo:add",e.remove="cube-todo:remove",e.indent="cube-todo:indent",e.status="cube-todo:status",e.reset="cube-todo:reset",e}({}),y=function(e){return e.h1="\\Huge ",e.h2="\\huge ",e.h3="\\Large ",e.h4="\\normalsize ",e.h5="\\small ",e.h6="\\tiny ",e}({}),v=function(e){return e.update="cube-fomula:update",e}({}),w=function(e){return e.add_title="cube-table:add-title",e.remove_title="cube-table:remove-title",e.add_cell="cube-table:add-cell",e.remove_cell="cube-table:remove-cell",e.add_row="cube-table:add-row",e.remove_row="cube-table:remove-row",e.add_col="cube-table:add-col",e.remove_col="cube-table:remove-col",e.add_grid_col="cube-table:add-grid-col",e.remove_grid_col="cube-table:remove-grid-col",e.merge="cube-table:merge",e.moveto="cube-table:moveto",e.update_area="cube-table:update-area",e.reorder="cube-table:reorder",e.col_resize="cube-table:col-resize",e}({}),x=function(e){return e.arrow="marker-arrow",e.point="marker-point",e.square="marker-square",e.rhomb="marker-rhomb",e}({}),k=function(e){return e.update="linker:update",e}({}),S=function(e){return e.reset_explanation="cube-rt:reset-explanation",e}({}),C=function(e){return e.pending="pending",e.playing="playing",e.pause="pause",e.stop="stop",e}({}),M=function(e){return e["asset-save"]="note-event:asset-save",e["asset-download"]="note-event:asset-download",e["asset-copy"]="note-event:asset-copy",e.export="note-event:export",e["replace-id"]="note-event:replace-id",e["edit-before"]="note-event:edit-before",e["edit-after"]="note-event:edit-after",e["text-merge"]="note-event:text-merge",e.esc="note-event:esc",e["selection-change"]="note-event:selection-change",e["cursor-nav-before"]="note-event:cursor-nav-before",e["cursor-nav-after"]="note-event:cursor-nav-after",e["enter-before"]="note-event:enter-before",e["enter-after"]="note-event:enter-after",e["show-cube-editor"]="note-event:show-cube-editor",e["text-link-edit"]="note-event:text-link-edit",e["note-input-before"]="note-event:note-input-before",e["note-input-compositionend"]="note-event:note-input-compositionend",e["note-input-compositionend-before"]="note-event:note-input-compositionend-before",e["note-input-compositionupdate"]="note-event:note-input-compositionupdate",e["status-update"]="note-event:status-update",e["node-status-clicked"]="note-event:node-status-clicked",e["fig-click"]="note-event:fig-click",e}({}),z=function(e){return e.read="read",e.edit="edit",e.export="export",e}({}),T=function(e){return e["break-line"]="换行",e["cursor-nav"]="光标导航",e["cursor-nav-extend"]="光标复选",e["format-brush-apply"]="应用格式刷",e["format-brush-copy"]="复制格式刷",e.undo="撤销",e.redo="重做",e["indent-line"]="缩进",e["unindent-line"]="反向缩进",e["clear-css"]="重置样式",e["scope-clear"]="清空块选区",e["scope-add"]="添加块选区",e["root-add-next"]="向后添加根级块",e["root-add-prev"]="向前添加根级块",e["break-root"]="分裂根级块",e["break-text"]="文本块换行",e["fold-block"]="折叠所在块",e["text-add-annotation"]="添加批注",e["text-italic"]="斜体",e["text-bold"]="加粗",e["text-underline"]="下划线",e["text-align-left"]="左对齐",e["text-align-center"]="居中对齐",e["text-align-right"]="右对齐",e["text-partition"]="分裂文本块",e}({}),A=function(e){return e.core="核心",e.common="通用",e.text="文本块",e.block="块",e.scope="块选区",e.dict="字典",e.bookmark="书签",e.search="搜索",e.css="样式",e.float="面板",e.other="其他",e}({}),P=function(e){return e.left="arrowleft",e.right="arrowright",e.up="arrowup",e.down="arrowdown",e.end="end",e.home="home",e}({}),N=function(e){return e.enter="Enter",e}({});function O(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const R={},L=[],E=()=>{},D=()=>!1,I=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),B=e=>e.startsWith("onUpdate:"),j=Object.assign,q=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},H=Object.prototype.hasOwnProperty,F=(e,t)=>H.call(e,t),$=Array.isArray,G=e=>"[object Map]"===Q(e),V=e=>"[object Set]"===Q(e),U=e=>"function"==typeof e,W=e=>"string"==typeof e,Y=e=>"symbol"==typeof e,X=e=>null!==e&&"object"==typeof e,K=e=>(X(e)||U(e))&&U(e.then)&&U(e.catch),J=Object.prototype.toString,Q=e=>J.call(e),Z=e=>"[object Object]"===Q(e),ee=e=>W(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,te=O(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ne=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ie=/-\w/g,re=ne(e=>e.replace(ie,e=>e.slice(1).toUpperCase())),se=/\B([A-Z])/g,oe=ne(e=>e.replace(se,"-$1").toLowerCase()),ae=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),le=ne(e=>e?`on${ae(e)}`:""),ce=(e,t)=>!Object.is(e,t),de=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},he=(e,t,n,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},ue=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let pe;const fe=()=>pe||(pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:{});function me(e){if($(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],r=W(i)?ye(i):me(i);if(r)for(const e in r)t[e]=r[e]}return t}if(W(e)||X(e))return e}const _e=/;(?![^(]*\))/g,ge=/:([^]+)/,be=/\/\*[^]*?\*\//g;function ye(e){const t={};return e.replace(be,"").split(_e).forEach(e=>{if(e){const n=e.split(ge);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ve(e){let t="";if(W(e))t=e;else if($(e))for(let n=0;n<e.length;n++){const i=ve(e[n]);i&&(t+=i+" ")}else if(X(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const we="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",xe=O(we);function ke(e){return!!e||""===e}const Se=e=>!(!e||!0!==e.__v_isRef),Ce=e=>W(e)?e:null==e?"":$(e)||X(e)&&(e.toString===J||!U(e.toString))?Se(e)?Ce(e.value):JSON.stringify(e,Me,2):String(e),Me=(e,t)=>Se(t)?Me(e,t.value):G(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],i)=>(e[ze(t,i)+" =>"]=n,e),{})}:V(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ze(e))}:Y(t)?ze(t):!X(t)||$(t)||Z(t)?t:String(t),ze=(e,t="")=>{var n;return Y(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let Te,Ae;class Pe{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Te,!e&&Te&&(this.index=(Te.scopes||(Te.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Te;try{return Te=this,e()}finally{Te=t}}else 0}on(){1===++this._on&&(this.prevScope=Te,Te=this)}off(){this._on>0&&0===--this._on&&(Te=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const Ne=new WeakSet;class Oe{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Te&&Te.active&&Te.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,Ne.has(this)&&(Ne.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||De(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,Xe(this),je(this);const e=Ae,t=Ve;Ae=this,Ve=!0;try{return this.fn()}finally{0,qe(this),Ae=e,Ve=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)$e(e);this.deps=this.depsTail=void 0,Xe(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?Ne.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){He(this)&&this.run()}get dirty(){return He(this)}}let Re,Le,Ee=0;function De(e,t=!1){if(e.flags|=8,t)return e.next=Le,void(Le=e);e.next=Re,Re=e}function Ie(){Ee++}function Be(){if(--Ee>0)return;if(Le){let e=Le;for(Le=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Re;){let t=Re;for(Re=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function je(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function qe(e){let t,n=e.depsTail,i=n;for(;i;){const e=i.prevDep;-1===i.version?(i===n&&(n=e),$e(i),Ge(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=e}e.deps=t,e.depsTail=n}function He(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Fe(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Fe(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===Ke)return;if(e.globalVersion=Ke,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!He(e)))return;e.flags|=2;const t=e.dep,n=Ae,i=Ve;Ae=e,Ve=!0;try{je(e);const n=e.fn(e._value);(0===t.version||ce(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Ae=n,Ve=i,qe(e),e.flags&=-3}}function $e(e,t=!1){const{dep:n,prevSub:i,nextSub:r}=e;if(i&&(i.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)$e(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function Ge(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ve=!0;const Ue=[];function We(){Ue.push(Ve),Ve=!1}function Ye(){const e=Ue.pop();Ve=void 0===e||e}function Xe(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=Ae;Ae=void 0;try{t()}finally{Ae=e}}}let Ke=0;class Je{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Qe{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Ae||!Ve||Ae===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==Ae)t=this.activeLink=new Je(Ae,this),Ae.deps?(t.prevDep=Ae.depsTail,Ae.depsTail.nextDep=t,Ae.depsTail=t):Ae.deps=Ae.depsTail=t,Ze(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Ae.depsTail,t.nextDep=void 0,Ae.depsTail.nextDep=t,Ae.depsTail=t,Ae.deps===t&&(Ae.deps=e)}return t}trigger(e){this.version++,Ke++,this.notify(e)}notify(e){Ie();try{0;for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Be()}}}function Ze(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ze(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const et=new WeakMap,tt=Symbol(""),nt=Symbol(""),it=Symbol("");function rt(e,t,n){if(Ve&&Ae){let t=et.get(e);t||et.set(e,t=new Map);let i=t.get(n);i||(t.set(n,i=new Qe),i.map=t,i.key=n),i.track()}}function st(e,t,n,i,r,s){const o=et.get(e);if(!o)return void Ke++;const a=e=>{e&&e.trigger()};if(Ie(),"clear"===t)o.forEach(a);else{const r=$(e),s=r&&ee(n);if(r&&"length"===n){const e=Number(i);o.forEach((t,n)=>{("length"===n||n===it||!Y(n)&&n>=e)&&a(t)})}else switch((void 0!==n||o.has(void 0))&&a(o.get(n)),s&&a(o.get(it)),t){case"add":r?s&&a(o.get("length")):(a(o.get(tt)),G(e)&&a(o.get(nt)));break;case"delete":r||(a(o.get(tt)),G(e)&&a(o.get(nt)));break;case"set":G(e)&&a(o.get(tt))}}Be()}function ot(e){const t=Vt(e);return t===e?t:(rt(t,0,it),$t(e)?t:t.map(Wt))}function at(e){return rt(e=Vt(e),0,it),e}const lt={__proto__:null,[Symbol.iterator](){return ct(this,Symbol.iterator,Wt)},concat(...e){return ot(this).concat(...e.map(e=>$(e)?ot(e):e))},entries(){return ct(this,"entries",e=>(e[1]=Wt(e[1]),e))},every(e,t){return ht(this,"every",e,t,void 0,arguments)},filter(e,t){return ht(this,"filter",e,t,e=>e.map(Wt),arguments)},find(e,t){return ht(this,"find",e,t,Wt,arguments)},findIndex(e,t){return ht(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ht(this,"findLast",e,t,Wt,arguments)},findLastIndex(e,t){return ht(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ht(this,"forEach",e,t,void 0,arguments)},includes(...e){return pt(this,"includes",e)},indexOf(...e){return pt(this,"indexOf",e)},join(e){return ot(this).join(e)},lastIndexOf(...e){return pt(this,"lastIndexOf",e)},map(e,t){return ht(this,"map",e,t,void 0,arguments)},pop(){return ft(this,"pop")},push(...e){return ft(this,"push",e)},reduce(e,...t){return ut(this,"reduce",e,t)},reduceRight(e,...t){return ut(this,"reduceRight",e,t)},shift(){return ft(this,"shift")},some(e,t){return ht(this,"some",e,t,void 0,arguments)},splice(...e){return ft(this,"splice",e)},toReversed(){return ot(this).toReversed()},toSorted(e){return ot(this).toSorted(e)},toSpliced(...e){return ot(this).toSpliced(...e)},unshift(...e){return ft(this,"unshift",e)},values(){return ct(this,"values",Wt)}};function ct(e,t,n){const i=at(e),r=i[t]();return i===e||$t(e)||(r._next=r.next,r.next=()=>{const e=r._next();return e.value&&(e.value=n(e.value)),e}),r}const dt=Array.prototype;function ht(e,t,n,i,r,s){const o=at(e),a=o!==e&&!$t(e),l=o[t];if(l!==dt[t]){const t=l.apply(e,s);return a?Wt(t):t}let c=n;o!==e&&(a?c=function(t,i){return n.call(this,Wt(t),i,e)}:n.length>2&&(c=function(t,i){return n.call(this,t,i,e)}));const d=l.call(o,c,i);return a&&r?r(d):d}function ut(e,t,n,i){const r=at(e);let s=n;return r!==e&&($t(e)?n.length>3&&(s=function(t,i,r){return n.call(this,t,i,r,e)}):s=function(t,i,r){return n.call(this,t,Wt(i),r,e)}),r[t](s,...i)}function pt(e,t,n){const i=Vt(e);rt(i,0,it);const r=i[t](...n);return-1!==r&&!1!==r||!Gt(n[0])?r:(n[0]=Vt(n[0]),i[t](...n))}function ft(e,t,n=[]){We(),Ie();const i=Vt(e)[t].apply(e,n);return Be(),Ye(),i}const mt=O("__proto__,__v_isRef,__isVue"),_t=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(Y));function gt(e){Y(e)||(e=String(e));const t=Vt(this);return rt(t,0,e),t.hasOwnProperty(e)}class bt{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(i?r?Et:Lt:r?Rt:Ot).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=$(e);if(!i){let e;if(s&&(e=lt[t]))return e;if("hasOwnProperty"===t)return gt}const o=Reflect.get(e,t,Xt(e)?e:n);return(Y(t)?_t.has(t):mt(t))?o:(i||rt(e,0,t),r?o:Xt(o)?s&&ee(t)?o:o.value:X(o)?i?jt(o):It(o):o)}}class yt extends bt{constructor(e=!1){super(!1,e)}set(e,t,n,i){let r=e[t];if(!this._isShallow){const t=Ft(r);if($t(n)||Ft(n)||(r=Vt(r),n=Vt(n)),!$(e)&&Xt(r)&&!Xt(n))return t||(r.value=n),!0}const s=$(e)&&ee(t)?Number(t)<e.length:F(e,t),o=Reflect.set(e,t,n,Xt(e)?e:i);return e===Vt(i)&&(s?ce(n,r)&&st(e,"set",t,n):st(e,"add",t,n)),o}deleteProperty(e,t){const n=F(e,t),i=(e[t],Reflect.deleteProperty(e,t));return i&&n&&st(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return Y(t)&&_t.has(t)||rt(e,0,t),n}ownKeys(e){return rt(e,0,$(e)?"length":tt),Reflect.ownKeys(e)}}class vt extends bt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const wt=new yt,xt=new vt,kt=new yt(!0),St=e=>e,Ct=e=>Reflect.getPrototypeOf(e);function Mt(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function zt(e,t){const n={get(n){const i=this.__v_raw,r=Vt(i),s=Vt(n);e||(ce(n,s)&&rt(r,0,n),rt(r,0,s));const{has:o}=Ct(r),a=t?St:e?Yt:Wt;return o.call(r,n)?a(i.get(n)):o.call(r,s)?a(i.get(s)):void(i!==r&&i.get(n))},get size(){const t=this.__v_raw;return!e&&rt(Vt(t),0,tt),t.size},has(t){const n=this.__v_raw,i=Vt(n),r=Vt(t);return e||(ce(t,r)&&rt(i,0,t),rt(i,0,r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,i){const r=this,s=r.__v_raw,o=Vt(s),a=t?St:e?Yt:Wt;return!e&&rt(o,0,tt),s.forEach((e,t)=>n.call(i,a(e),a(t),r))}};j(n,e?{add:Mt("add"),set:Mt("set"),delete:Mt("delete"),clear:Mt("clear")}:{add(e){t||$t(e)||Ft(e)||(e=Vt(e));const n=Vt(this);return Ct(n).has.call(n,e)||(n.add(e),st(n,"add",e,e)),this},set(e,n){t||$t(n)||Ft(n)||(n=Vt(n));const i=Vt(this),{has:r,get:s}=Ct(i);let o=r.call(i,e);o||(e=Vt(e),o=r.call(i,e));const a=s.call(i,e);return i.set(e,n),o?ce(n,a)&&st(i,"set",e,n):st(i,"add",e,n),this},delete(e){const t=Vt(this),{has:n,get:i}=Ct(t);let r=n.call(t,e);r||(e=Vt(e),r=n.call(t,e));i&&i.call(t,e);const s=t.delete(e);return r&&st(t,"delete",e,void 0),s},clear(){const e=Vt(this),t=0!==e.size,n=e.clear();return t&&st(e,"clear",void 0,void 0),n}});return["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const r=this.__v_raw,s=Vt(r),o=G(s),a="entries"===e||e===Symbol.iterator&&o,l="keys"===e&&o,c=r[e](...i),d=n?St:t?Yt:Wt;return!t&&rt(s,0,l?nt:tt),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[d(e[0]),d(e[1])]:d(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}function Tt(e,t){const n=zt(e,t);return(t,i,r)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(F(n,i)&&i in t?n:t,i,r)}const At={get:Tt(!1,!1)},Pt={get:Tt(!1,!0)},Nt={get:Tt(!0,!1)};const Ot=new WeakMap,Rt=new WeakMap,Lt=new WeakMap,Et=new WeakMap;function Dt(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>Q(e).slice(8,-1))(e))}function It(e){return Ft(e)?e:qt(e,!1,wt,At,Ot)}function Bt(e){return qt(e,!1,kt,Pt,Rt)}function jt(e){return qt(e,!0,xt,Nt,Lt)}function qt(e,t,n,i,r){if(!X(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=Dt(e);if(0===s)return e;const o=r.get(e);if(o)return o;const a=new Proxy(e,2===s?i:n);return r.set(e,a),a}function Ht(e){return Ft(e)?Ht(e.__v_raw):!(!e||!e.__v_isReactive)}function Ft(e){return!(!e||!e.__v_isReadonly)}function $t(e){return!(!e||!e.__v_isShallow)}function Gt(e){return!!e&&!!e.__v_raw}function Vt(e){const t=e&&e.__v_raw;return t?Vt(t):e}function Ut(e){return!F(e,"__v_skip")&&Object.isExtensible(e)&&he(e,"__v_skip",!0),e}const Wt=e=>X(e)?It(e):e,Yt=e=>X(e)?jt(e):e;function Xt(e){return!!e&&!0===e.__v_isRef}function Kt(e){return Jt(e,!1)}function Jt(e,t){return Xt(e)?e:new Qt(e,t)}class Qt{constructor(e,t){this.dep=new Qe,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Vt(e),this._value=t?e:Wt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||$t(e)||Ft(e);e=n?e:Vt(e),ce(e,t)&&(this._rawValue=e,this._value=n?e:Wt(e),this.dep.trigger())}}function Zt(e){return Xt(e)?e.value:e}const en={get:(e,t,n)=>"__v_raw"===t?e:Zt(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const r=e[t];return Xt(r)&&!Xt(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};function tn(e){return Ht(e)?e:new Proxy(e,en)}class nn{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Qe(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ke-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||Ae===this))return De(this,!0),!0}get value(){const e=this.dep.track();return Fe(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const rn={},sn=new WeakMap;let on;function an(e,t,n=R){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,c=e=>r?e:$t(e)||!1===r||0===r?ln(e,1):ln(e);let d,h,u,p,f=!1,m=!1;if(Xt(e)?(h=()=>e.value,f=$t(e)):Ht(e)?(h=()=>c(e),f=!0):$(e)?(m=!0,f=e.some(e=>Ht(e)||$t(e)),h=()=>e.map(e=>Xt(e)?e.value:Ht(e)?c(e):U(e)?l?l(e,2):e():void 0)):h=U(e)?t?l?()=>l(e,2):e:()=>{if(u){We();try{u()}finally{Ye()}}const t=on;on=d;try{return l?l(e,3,[p]):e(p)}finally{on=t}}:E,t&&r){const e=h,t=!0===r?1/0:r;h=()=>ln(e(),t)}const _=Te,g=()=>{d.stop(),_&&_.active&&q(_.effects,d)};if(s&&t){const e=t;t=(...t)=>{e(...t),g()}}let b=m?new Array(e.length).fill(rn):rn;const y=e=>{if(1&d.flags&&(d.dirty||e))if(t){const e=d.run();if(r||f||(m?e.some((e,t)=>ce(e,b[t])):ce(e,b))){u&&u();const n=on;on=d;try{const n=[e,b===rn?void 0:m&&b[0]===rn?[]:b,p];b=e,l?l(t,3,n):t(...n)}finally{on=n}}}else d.run()};return a&&a(y),d=new Oe(h),d.scheduler=o?()=>o(y,!1):y,p=e=>function(e,t=!1,n=on){if(n){let t=sn.get(n);t||sn.set(n,t=[]),t.push(e)}}(e,!1,d),u=d.onStop=()=>{const e=sn.get(d);if(e){if(l)l(e,4);else for(const t of e)t();sn.delete(d)}},t?i?y(!0):b=d.run():o?o(y.bind(null,!0),!0):d.run(),g.pause=d.pause.bind(d),g.resume=d.resume.bind(d),g.stop=g,g}function ln(e,t=1/0,n){if(t<=0||!X(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,Xt(e))ln(e.value,t,n);else if($(e))for(let i=0;i<e.length;i++)ln(e[i],t,n);else if(V(e)||G(e))e.forEach(e=>{ln(e,t,n)});else if(Z(e)){for(const i in e)ln(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&ln(e[i],t,n)}return e}function cn(e,t,n,i){try{return i?e(...i):e()}catch(e){hn(e,t,n)}}function dn(e,t,n,i){if(U(e)){const r=cn(e,t,n,i);return r&&K(r)&&r.catch(e=>{hn(e,t,n)}),r}if($(e)){const r=[];for(let s=0;s<e.length;s++)r.push(dn(e[s],t,n,i));return r}}function hn(e,t,n,i=!0){t&&t.vnode;const{errorHandler:r,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||R;if(t){let i=t.parent;const s=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,s,o))return;i=i.parent}if(r)return We(),cn(r,null,10,[e,s,o]),void Ye()}!function(e,t,n,i=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,i,s)}const un=[];let pn=-1;const fn=[];let mn=null,_n=0;const gn=Promise.resolve();let bn=null;function yn(e){const t=bn||gn;return e?t.then(this?e.bind(this):e):t}function vn(e){if(!(1&e.flags)){const t=Cn(e),n=un[un.length-1];!n||!(2&e.flags)&&t>=Cn(n)?un.push(e):un.splice(function(e){let t=pn+1,n=un.length;for(;t<n;){const i=t+n>>>1,r=un[i],s=Cn(r);s<e||s===e&&2&r.flags?t=i+1:n=i}return t}(t),0,e),e.flags|=1,wn()}}function wn(){bn||(bn=gn.then(Mn))}function xn(e){$(e)?fn.push(...e):mn&&-1===e.id?mn.splice(_n+1,0,e):1&e.flags||(fn.push(e),e.flags|=1),wn()}function kn(e,t,n=pn+1){for(0;n<un.length;n++){const t=un[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;0,un.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function Sn(e){if(fn.length){const e=[...new Set(fn)].sort((e,t)=>Cn(e)-Cn(t));if(fn.length=0,mn)return void mn.push(...e);for(mn=e,_n=0;_n<mn.length;_n++){const e=mn[_n];0,4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}mn=null,_n=0}}const Cn=e=>null==e.id?2&e.flags?-1:1/0:e.id;function Mn(e){try{for(pn=0;pn<un.length;pn++){const e=un[pn];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),cn(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;pn<un.length;pn++){const e=un[pn];e&&(e.flags&=-2)}pn=-1,un.length=0,Sn(),bn=null,(un.length||fn.length)&&Mn(e)}}let zn=null,Tn=null;function An(e){const t=zn;return zn=e,Tn=e&&e.type.__scopeId||null,t}function Pn(e,t=zn,n){if(!t)return e;if(e._n)return e;const i=(...n)=>{i._d&&Lr(-1);const r=An(t);let s;try{s=e(...n)}finally{An(r),i._d&&Lr(1)}return s};return i._n=!0,i._c=!0,i._d=!0,i}function Nn(e,t){if(null===zn)return e;const n=gs(zn),i=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[r,s,o,a=R]=t[e];r&&(U(r)&&(r={mounted:r,updated:r}),r.deep&&ln(s),i.push({dir:r,instance:n,value:s,oldValue:void 0,arg:o,modifiers:a}))}return e}function On(e,t,n,i){const r=e.dirs,s=t&&t.dirs;for(let o=0;o<r.length;o++){const a=r[o];s&&(a.oldValue=s[o].value);let l=a.dir[i];l&&(We(),dn(l,n,8,[e.el,a,e,t]),Ye())}}const Rn=Symbol("_vte"),Ln=e=>e.__isTeleport;const En=Symbol("_leaveCb");Symbol("_enterCb");const Dn=[Function,Array];Boolean,Boolean;function In(e,t){6&e.shapeFlag&&e.component?(e.transition=t,In(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Bn(e,t){return U(e)?(()=>j({name:e.name},t,{setup:e}))():e}function jn(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function qn(e){const t=is(),n=Jt(null,!0);if(t){const i=t.refs===R?t.refs={}:t.refs;Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}else 0;return n}const Hn=new WeakMap;function Fn(e,t,n,i,r=!1){if($(e))return void e.forEach((e,s)=>Fn(e,t&&($(t)?t[s]:t),n,i,r));if(Gn(i)&&!r)return void(512&i.shapeFlag&&i.type.__asyncResolved&&i.component.subTree.component&&Fn(e,t,n,i.component.subTree));const s=4&i.shapeFlag?gs(i.component):i.el,o=r?null:s,{i:a,r:l}=e;const c=t&&t.r,d=a.refs===R?a.refs={}:a.refs,h=a.setupState,u=Vt(h),p=h===R?D:e=>F(u,e);if(null!=c&&c!==l)if($n(t),W(c))d[c]=null,p(c)&&(h[c]=null);else if(Xt(c)){c.value=null;const e=t;e.k&&(d[e.k]=null)}if(U(l))cn(l,a,12,[o,d]);else{const t=W(l),i=Xt(l);if(t||i){const a=()=>{if(e.f){const n=t?p(l)?h[l]:d[l]:l.value;if(r)$(n)&&q(n,s);else if($(n))n.includes(s)||n.push(s);else if(t)d[l]=[s],p(l)&&(h[l]=d[l]);else{const t=[s];l.value=t,e.k&&(d[e.k]=t)}}else t?(d[l]=o,p(l)&&(h[l]=o)):i&&(l.value=o,e.k&&(d[e.k]=o))};if(o){const t=()=>{a(),Hn.delete(e)};t.id=-1,Hn.set(e,t),Zi(t,n)}else $n(e),a()}else 0}}function $n(e){const t=Hn.get(e);t&&(t.flags|=8,Hn.delete(e))}fe().requestIdleCallback,fe().cancelIdleCallback;const Gn=e=>!!e.type.__asyncLoader;const Vn=e=>e.type.__isKeepAlive;RegExp,RegExp;function Un(e,t){return $(e)?e.some(e=>Un(e,t)):W(e)?e.split(",").includes(t):"[object RegExp]"===Q(e)&&(e.lastIndex=0,e.test(t))}function Wn(e,t){Xn(e,"a",t)}function Yn(e,t){Xn(e,"da",t)}function Xn(e,t,n=ns){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Zn(t,i,n),n){let e=n.parent;for(;e&&e.parent;)Vn(e.parent.vnode)&&Kn(i,t,n,e),e=e.parent}}function Kn(e,t,n,i){const r=Zn(t,e,i,!0);oi(()=>{q(i[t],r)},n)}function Jn(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Qn(e){return 128&e.shapeFlag?e.ssContent:e}function Zn(e,t,n=ns,i=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{We();const r=os(n),s=dn(t,n,e,i);return r(),Ye(),s});return i?r.unshift(s):r.push(s),s}}const ei=e=>(t,n=ns)=>{hs&&"sp"!==e||Zn(e,(...e)=>t(...e),n)},ti=ei("bm"),ni=ei("m"),ii=ei("bu"),ri=ei("u"),si=ei("bum"),oi=ei("um"),ai=ei("sp"),li=ei("rtg"),ci=ei("rtc");function di(e,t=ns){Zn("ec",e,t)}const hi="components";const ui=Symbol.for("v-ndc");function pi(e){return W(e)?fi(hi,e,!1)||e:e||ui}function fi(e,t,n=!0,i=!1){const r=zn||ns;if(r){const n=r.type;if(e===hi){const e=bs(n,!1);if(e&&(e===t||e===re(t)||e===ae(re(t))))return n}const s=mi(r[e]||n[e],t)||mi(r.appContext[e],t);return!s&&i?n:s}}function mi(e,t){return e&&(e[t]||e[re(t)]||e[ae(re(t))])}function _i(e,t,n,i){let r;const s=n&&n[i],o=$(e);if(o||W(e)){let n=!1,i=!1;o&&Ht(e)&&(n=!$t(e),i=Ft(e),e=at(e)),r=new Array(e.length);for(let o=0,a=e.length;o<a;o++)r[o]=t(n?i?Yt(Wt(e[o])):Wt(e[o]):e[o],o,void 0,s&&s[o])}else if("number"==typeof e){0,r=new Array(e);for(let n=0;n<e;n++)r[n]=t(n+1,n,void 0,s&&s[n])}else if(X(e))if(e[Symbol.iterator])r=Array.from(e,(e,n)=>t(e,n,void 0,s&&s[n]));else{const n=Object.keys(e);r=new Array(n.length);for(let i=0,o=n.length;i<o;i++){const o=n[i];r[i]=t(e[o],o,i,s&&s[i])}}else r=[];return n&&(n[i]=r),r}const gi=e=>e?ls(e)?gs(e):gi(e.parent):null,bi=j(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>gi(e.parent),$root:e=>gi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Mi(e),$forceUpdate:e=>e.f||(e.f=()=>{vn(e.update)}),$nextTick:e=>e.n||(e.n=yn.bind(e.proxy)),$watch:e=>hr.bind(e)}),yi=(e,t)=>e!==R&&!e.__isScriptSetup&&F(e,t),vi={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;let c;if("$"!==t[0]){const a=o[t];if(void 0!==a)switch(a){case 1:return i[t];case 2:return r[t];case 4:return n[t];case 3:return s[t]}else{if(yi(i,t))return o[t]=1,i[t];if(r!==R&&F(r,t))return o[t]=2,r[t];if((c=e.propsOptions[0])&&F(c,t))return o[t]=3,s[t];if(n!==R&&F(n,t))return o[t]=4,n[t];xi&&(o[t]=0)}}const d=bi[t];let h,u;return d?("$attrs"===t&&rt(e.attrs,0,""),d(e)):(h=a.__cssModules)&&(h=h[t])?h:n!==R&&F(n,t)?(o[t]=4,n[t]):(u=l.config.globalProperties,F(u,t)?u[t]:void 0)},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;return yi(r,t)?(r[t]=n,!0):i!==R&&F(i,t)?(i[t]=n,!0):!F(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:r,propsOptions:s,type:o}},a){let l,c;return!!(n[a]||e!==R&&"$"!==a[0]&&F(e,a)||yi(t,a)||(l=s[0])&&F(l,a)||F(i,a)||F(bi,a)||F(r.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:F(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function wi(e){return $(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let xi=!0;function ki(e){const t=Mi(e),n=e.proxy,i=e.ctx;xi=!1,t.beforeCreate&&Si(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:d,beforeMount:h,mounted:u,beforeUpdate:p,updated:f,activated:m,deactivated:_,beforeDestroy:g,beforeUnmount:b,destroyed:y,unmounted:v,render:w,renderTracked:x,renderTriggered:k,errorCaptured:S,serverPrefetch:C,expose:M,inheritAttrs:z,components:T,directives:A,filters:P}=t;if(c&&function(e,t){$(e)&&(e=Pi(e));for(const n in e){const i=e[n];let r;r=X(i)?"default"in i?Bi(i.from||n,i.default,!0):Bi(i.from||n):Bi(i),Xt(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(c,i,null),o)for(const e in o){const t=o[e];U(t)&&(i[e]=t.bind(n))}if(r){0;const t=r.call(n,n);0,X(t)&&(e.data=It(t))}if(xi=!0,s)for(const e in s){const t=s[e],r=U(t)?t.bind(n,n):U(t.get)?t.get.bind(n,n):E;0;const o=!U(t)&&U(t.set)?t.set.bind(n):E,a=vs({get:r,set:o});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(a)for(const e in a)Ci(a[e],i,n,e);if(l){const e=U(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if(ns){let n=ns.provides;const i=ns.parent&&ns.parent.provides;i===n&&(n=ns.provides=Object.create(i)),n[e]=t}else 0}(t,e[t])})}function N(e,t){$(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(d&&Si(d,e,"c"),N(ti,h),N(ni,u),N(ii,p),N(ri,f),N(Wn,m),N(Yn,_),N(di,S),N(ci,x),N(li,k),N(si,b),N(oi,v),N(ai,C),$(M))if(M.length){const t=e.exposed||(e.exposed={});M.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});w&&e.render===E&&(e.render=w),null!=z&&(e.inheritAttrs=z),T&&(e.components=T),A&&(e.directives=A),C&&jn(e)}function Si(e,t,n){dn($(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ci(e,t,n,i){let r=i.includes(".")?ur(n,i):()=>n[i];if(W(e)){const n=t[e];U(n)&&cr(r,n)}else if(U(e))cr(r,e.bind(n));else if(X(e))if($(e))e.forEach(e=>Ci(e,t,n,i));else{const i=U(e.handler)?e.handler.bind(n):t[e.handler];U(i)&&cr(r,i,e)}else 0}function Mi(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:r.length||n||i?(l={},r.length&&r.forEach(e=>zi(l,e,o,!0)),zi(l,t,o)):l=t,X(t)&&s.set(t,l),l}function zi(e,t,n,i=!1){const{mixins:r,extends:s}=t;s&&zi(e,s,n,!0),r&&r.forEach(t=>zi(e,t,n,!0));for(const r in t)if(i&&"expose"===r);else{const i=Ti[r]||n&&n[r];e[r]=i?i(e[r],t[r]):t[r]}return e}const Ti={data:Ai,props:Ri,emits:Ri,methods:Oi,computed:Oi,beforeCreate:Ni,created:Ni,beforeMount:Ni,mounted:Ni,beforeUpdate:Ni,updated:Ni,beforeDestroy:Ni,beforeUnmount:Ni,destroyed:Ni,unmounted:Ni,activated:Ni,deactivated:Ni,errorCaptured:Ni,serverPrefetch:Ni,components:Oi,directives:Oi,watch:function(e,t){if(!e)return t;if(!t)return e;const n=j(Object.create(null),e);for(const i in t)n[i]=Ni(e[i],t[i]);return n},provide:Ai,inject:function(e,t){return Oi(Pi(e),Pi(t))}};function Ai(e,t){return t?e?function(){return j(U(e)?e.call(this,this):e,U(t)?t.call(this,this):t)}:t:e}function Pi(e){if($(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ni(e,t){return e?[...new Set([].concat(e,t))]:t}function Oi(e,t){return e?j(Object.create(null),e,t):t}function Ri(e,t){return e?$(e)&&$(t)?[...new Set([...e,...t])]:j(Object.create(null),wi(e),wi(null!=t?t:{})):t}function Li(){return{app:null,config:{isNativeTag:D,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Ei=0;function Di(e,t){return function(n,i=null){U(n)||(n=j({},n)),null==i||X(i)||(i=null);const r=Li(),s=new WeakSet,o=[];let a=!1;const l=r.app={_uid:Ei++,_component:n,_props:i,_container:null,_context:r,_instance:null,version:ws,get config(){return r.config},set config(e){0},use:(e,...t)=>(s.has(e)||(e&&U(e.install)?(s.add(e),e.install(l,...t)):U(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,o,c){if(!a){0;const d=l._ceVNode||$r(n,i);return d.appContext=r,!0===c?c="svg":!1===c&&(c=void 0),o&&t?t(d,s):e(d,s,c),a=!0,l._container=s,s.__vue_app__=l,gs(d.component)}},onUnmount(e){o.push(e)},unmount(){a&&(dn(o,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){const t=Ii;Ii=l;try{return e()}finally{Ii=t}}};return l}}let Ii=null;function Bi(e,t,n=!1){const i=is();if(i||Ii){let r=Ii?Ii._context.provides:i?null==i.parent||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&U(t)?t.call(i&&i.proxy):t}else 0}const ji={},qi=()=>Object.create(ji),Hi=e=>Object.getPrototypeOf(e)===ji;function Fi(e,t,n,i){const[r,s]=e.propsOptions;let o,a=!1;if(t)for(let l in t){if(te(l))continue;const c=t[l];let d;r&&F(r,d=re(l))?s&&s.includes(d)?(o||(o={}))[d]=c:n[d]=c:gr(e.emitsOptions,l)||l in i&&c===i[l]||(i[l]=c,a=!0)}if(s){const t=Vt(n),i=o||R;for(let o=0;o<s.length;o++){const a=s[o];n[a]=$i(r,t,a,i[a],e,!F(i,a))}}return a}function $i(e,t,n,i,r,s){const o=e[n];if(null!=o){const e=F(o,"default");if(e&&void 0===i){const e=o.default;if(o.type!==Function&&!o.skipFactory&&U(e)){const{propsDefaults:s}=r;if(n in s)i=s[n];else{const o=os(r);i=s[n]=e.call(null,t),o()}}else i=e;r.ce&&r.ce._setProp(n,i)}o[0]&&(s&&!e?i=!1:!o[1]||""!==i&&i!==oe(n)||(i=!0))}return i}const Gi=new WeakMap;function Vi(e,t,n=!1){const i=n?Gi:t.propsCache,r=i.get(e);if(r)return r;const s=e.props,o={},a=[];let l=!1;if(!U(e)){const i=e=>{l=!0;const[n,i]=Vi(e,t,!0);j(o,n),i&&a.push(...i)};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}if(!s&&!l)return X(e)&&i.set(e,L),L;if($(s))for(let e=0;e<s.length;e++){0;const t=re(s[e]);Ui(t)&&(o[t]=R)}else if(s){0;for(const e in s){const t=re(e);if(Ui(t)){const n=s[e],i=o[t]=$(n)||U(n)?{type:n}:j({},n),r=i.type;let l=!1,c=!0;if($(r))for(let e=0;e<r.length;++e){const t=r[e],n=U(t)&&t.name;if("Boolean"===n){l=!0;break}"String"===n&&(c=!1)}else l=U(r)&&"Boolean"===r.name;i[0]=l,i[1]=c,(l||F(i,"default"))&&a.push(t)}}}const c=[o,a];return X(e)&&i.set(e,c),c}function Ui(e){return"$"!==e[0]&&!te(e)}const Wi=e=>"_"===e||"_ctx"===e||"$stable"===e,Yi=e=>$(e)?e.map(Xr):[Xr(e)],Xi=(e,t,n)=>{if(t._n)return t;const i=Pn((...e)=>Yi(t(...e)),n);return i._c=!1,i},Ki=(e,t,n)=>{const i=e._ctx;for(const n in e){if(Wi(n))continue;const r=e[n];if(U(r))t[n]=Xi(0,r,i);else if(null!=r){0;const e=Yi(r);t[n]=()=>e}}},Ji=(e,t)=>{const n=Yi(t);e.slots.default=()=>n},Qi=(e,t,n)=>{for(const i in t)!n&&Wi(i)||(e[i]=t[i])};const Zi=Sr;function er(e,t){fe().__VUE__=!0;const{insert:n,remove:i,patchProp:r,createElement:s,createText:o,createComment:a,setText:l,setElementText:c,parentNode:d,nextSibling:h,setScopeId:u=E,insertStaticContent:p}=e,f=(e,t,n,i=null,r=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!jr(e,t)&&(i=V(e),j(e,r,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:h}=t;switch(c){case Mr:m(e,t,n,i);break;case zr:_(e,t,n,i);break;case Tr:null==e&&g(t,n,i,o);break;case Cr:M(e,t,n,i,r,s,o,a,l);break;default:1&h?y(e,t,n,i,r,s,o,a,l):6&h?z(e,t,n,i,r,s,o,a,l):(64&h||128&h)&&c.process(e,t,n,i,r,s,o,a,l,Y)}null!=d&&r?Fn(d,e&&e.ref,s,t||e,!t):null==d&&e&&null!=e.ref&&Fn(e.ref,null,s,e,!0)},m=(e,t,i,r)=>{if(null==e)n(t.el=o(t.children),i,r);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,i,r)=>{null==e?n(t.el=a(t.children||""),i,r):t.el=e.el},g=(e,t,n,i)=>{[e.el,e.anchor]=p(e.children,t,n,i,e.el,e.anchor)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},y=(e,t,n,i,r,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?v(t,n,i,r,s,o,a,l):k(e,t,r,s,o,a,l)},v=(e,t,i,o,a,l,d,h)=>{let u,p;const{props:f,shapeFlag:m,transition:_,dirs:g}=e;if(u=e.el=s(e.type,l,f&&f.is,f),8&m?c(u,e.children):16&m&&x(e.children,u,null,o,a,tr(e,l),d,h),g&&On(e,null,o,"created"),w(u,e,e.scopeId,d,o),f){for(const e in f)"value"===e||te(e)||r(u,e,null,f[e],l,o);"value"in f&&r(u,"value",null,f.value,l),(p=f.onVnodeBeforeMount)&&Qr(p,o,e)}g&&On(e,null,o,"beforeMount");const b=ir(a,_);b&&_.beforeEnter(u),n(u,t,i),((p=f&&f.onVnodeMounted)||b||g)&&Zi(()=>{p&&Qr(p,o,e),b&&_.enter(u),g&&On(e,null,o,"mounted")},a)},w=(e,t,n,i,r)=>{if(n&&u(e,n),i)for(let t=0;t<i.length;t++)u(e,i[t]);if(r){let n=r.subTree;if(t===n||kr(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=r.vnode;w(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},x=(e,t,n,i,r,s,o,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Kr(e[c]):Xr(e[c]);f(null,l,t,n,i,r,s,o,a)}},k=(e,t,n,i,s,o,a)=>{const l=t.el=e.el;let{patchFlag:d,dynamicChildren:h,dirs:u}=t;d|=16&e.patchFlag;const p=e.props||R,f=t.props||R;let m;if(n&&nr(n,!1),(m=f.onVnodeBeforeUpdate)&&Qr(m,n,t,e),u&&On(t,e,n,"beforeUpdate"),n&&nr(n,!0),(p.innerHTML&&null==f.innerHTML||p.textContent&&null==f.textContent)&&c(l,""),h?S(e.dynamicChildren,h,l,n,i,tr(t,s),o):a||O(e,t,l,null,n,i,tr(t,s),o,!1),d>0){if(16&d)C(l,p,f,n,s);else if(2&d&&p.class!==f.class&&r(l,"class",null,f.class,s),4&d&&r(l,"style",p.style,f.style,s),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const i=e[t],o=p[i],a=f[i];a===o&&"value"!==i||r(l,i,o,a,s,n)}}1&d&&e.children!==t.children&&c(l,t.children)}else a||null!=h||C(l,p,f,n,s);((m=f.onVnodeUpdated)||u)&&Zi(()=>{m&&Qr(m,n,t,e),u&&On(t,e,n,"updated")},i)},S=(e,t,n,i,r,s,o)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],h=l.el&&(l.type===Cr||!jr(l,c)||198&l.shapeFlag)?d(l.el):n;f(l,c,h,null,i,r,s,o,!0)}},C=(e,t,n,i,s)=>{if(t!==n){if(t!==R)for(const o in t)te(o)||o in n||r(e,o,t[o],null,s,i);for(const o in n){if(te(o))continue;const a=n[o],l=t[o];a!==l&&"value"!==o&&r(e,o,l,a,s,i)}"value"in n&&r(e,"value",t.value,n.value,s)}},M=(e,t,i,r,s,a,l,c,d)=>{const h=t.el=e?e.el:o(""),u=t.anchor=e?e.anchor:o("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=t;m&&(c=c?c.concat(m):m),null==e?(n(h,i,r),n(u,i,r),x(t.children||[],i,u,s,a,l,c,d)):p>0&&64&p&&f&&e.dynamicChildren?(S(e.dynamicChildren,f,i,s,a,l,c),(null!=t.key||s&&t===s.subTree)&&rr(e,t,!0)):O(e,t,i,u,s,a,l,c,d)},z=(e,t,n,i,r,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,i,o,l):T(t,n,i,r,s,o,l):A(e,t,l)},T=(e,t,n,i,r,s,o)=>{const a=e.component=ts(e,i,r);if(Vn(e)&&(a.ctx.renderer=Y),us(a,!1,o),a.asyncDep){if(r&&r.registerDep(a,P,o),!e.el){const i=a.subTree=$r(zr);_(null,i,t,n),e.placeholder=i.el}}else P(a,e,t,n,r,s,o)},A=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:r,component:s}=e,{props:o,children:a,patchFlag:l}=t,c=s.emitsOptions;0;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||i!==o&&(i?!o||wr(i,o,c):!!o);if(1024&l)return!0;if(16&l)return i?wr(i,o,c):!!o;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(o[n]!==i[n]&&!gr(c,n))return!0}}return!1}(e,t,n)){if(i.asyncDep&&!i.asyncResolved)return void N(i,t,n);i.next=t,i.update()}else t.el=e.el,i.vnode=t},P=(e,t,n,i,r,s,o)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:i,parent:l,vnode:c}=e;{const n=sr(e);if(n)return t&&(t.el=c.el,N(e,t,o)),void n.asyncDep.then(()=>{e.isUnmounted||a()})}let h,u=t;0,nr(e,!1),t?(t.el=c.el,N(e,t,o)):t=c,n&&de(n),(h=t.props&&t.props.onVnodeBeforeUpdate)&&Qr(h,l,t,c),nr(e,!0);const p=br(e);0;const m=e.subTree;e.subTree=p,f(m,p,d(m.el),V(m),e,r,s),t.el=p.el,null===u&&xr(e,p.el),i&&Zi(i,r),(h=t.props&&t.props.onVnodeUpdated)&&Zi(()=>Qr(h,l,t,c),r)}else{let o;const{el:a,props:l}=t,{bm:c,m:d,parent:h,root:u,type:p}=e,m=Gn(t);if(nr(e,!1),c&&de(c),!m&&(o=l&&l.onVnodeBeforeMount)&&Qr(o,h,t),nr(e,!0),a&&K){const t=()=>{e.subTree=br(e),K(a,e.subTree,e,r,null)};m&&p.__asyncHydrate?p.__asyncHydrate(a,e,t):t()}else{u.ce&&!1!==u.ce._def.shadowRoot&&u.ce._injectChildStyle(p);const o=e.subTree=br(e);0,f(null,o,n,i,e,r,s),t.el=o.el}if(d&&Zi(d,r),!m&&(o=l&&l.onVnodeMounted)){const e=t;Zi(()=>Qr(o,h,e),r)}(256&t.shapeFlag||h&&Gn(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&Zi(e.a,r),e.isMounted=!0,t=n=i=null}};e.scope.on();const l=e.effect=new Oe(a);e.scope.off();const c=e.update=l.run.bind(l),h=e.job=l.runIfDirty.bind(l);h.i=e,h.id=e.uid,l.scheduler=()=>vn(h),nr(e,!0),c()},N=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=Vt(r),[l]=e.propsOptions;let c=!1;if(!(i||o>0)||16&o){let i;Fi(e,t,r,s)&&(c=!0);for(const s in a)t&&(F(t,s)||(i=oe(s))!==s&&F(t,i))||(l?!n||void 0===n[s]&&void 0===n[i]||(r[s]=$i(l,a,s,void 0,e,!0)):delete r[s]);if(s!==a)for(const e in s)t&&F(t,e)||(delete s[e],c=!0)}else if(8&o){const n=e.vnode.dynamicProps;for(let i=0;i<n.length;i++){let o=n[i];if(gr(e.emitsOptions,o))continue;const d=t[o];if(l)if(F(s,o))d!==s[o]&&(s[o]=d,c=!0);else{const t=re(o);r[t]=$i(l,a,t,d,e,!1)}else d!==s[o]&&(s[o]=d,c=!0)}}c&&st(e.attrs,"set","")}(e,t.props,i,n),((e,t,n)=>{const{vnode:i,slots:r}=e;let s=!0,o=R;if(32&i.shapeFlag){const e=t._;e?n&&1===e?s=!1:Qi(r,t,n):(s=!t.$stable,Ki(t,r)),o=t}else t&&(Ji(e,t),o={default:1});if(s)for(const e in r)Wi(e)||null!=o[e]||delete r[e]})(e,t.children,n),We(),kn(e),Ye()},O=(e,t,n,i,r,s,o,a,l=!1)=>{const d=e&&e.children,h=e?e.shapeFlag:0,u=t.children,{patchFlag:p,shapeFlag:f}=t;if(p>0){if(128&p)return void I(d,u,n,i,r,s,o,a,l);if(256&p)return void D(d,u,n,i,r,s,o,a,l)}8&f?(16&h&&G(d,r,s),u!==d&&c(n,u)):16&h?16&f?I(d,u,n,i,r,s,o,a,l):G(d,r,s,!0):(8&h&&c(n,""),16&f&&x(u,n,i,r,s,o,a,l))},D=(e,t,n,i,r,s,o,a,l)=>{t=t||L;const c=(e=e||L).length,d=t.length,h=Math.min(c,d);let u;for(u=0;u<h;u++){const i=t[u]=l?Kr(t[u]):Xr(t[u]);f(e[u],i,n,null,r,s,o,a,l)}c>d?G(e,r,s,!0,!1,h):x(t,n,i,r,s,o,a,l,h)},I=(e,t,n,i,r,s,o,a,l)=>{let c=0;const d=t.length;let h=e.length-1,u=d-1;for(;c<=h&&c<=u;){const i=e[c],d=t[c]=l?Kr(t[c]):Xr(t[c]);if(!jr(i,d))break;f(i,d,n,null,r,s,o,a,l),c++}for(;c<=h&&c<=u;){const i=e[h],c=t[u]=l?Kr(t[u]):Xr(t[u]);if(!jr(i,c))break;f(i,c,n,null,r,s,o,a,l),h--,u--}if(c>h){if(c<=u){const e=u+1,h=e<d?t[e].el:i;for(;c<=u;)f(null,t[c]=l?Kr(t[c]):Xr(t[c]),n,h,r,s,o,a,l),c++}}else if(c>u)for(;c<=h;)j(e[c],r,s,!0),c++;else{const p=c,m=c,_=new Map;for(c=m;c<=u;c++){const e=t[c]=l?Kr(t[c]):Xr(t[c]);null!=e.key&&_.set(e.key,c)}let g,b=0;const y=u-m+1;let v=!1,w=0;const x=new Array(y);for(c=0;c<y;c++)x[c]=0;for(c=p;c<=h;c++){const i=e[c];if(b>=y){j(i,r,s,!0);continue}let d;if(null!=i.key)d=_.get(i.key);else for(g=m;g<=u;g++)if(0===x[g-m]&&jr(i,t[g])){d=g;break}void 0===d?j(i,r,s,!0):(x[d-m]=c+1,d>=w?w=d:v=!0,f(i,t[d],n,null,r,s,o,a,l),b++)}const k=v?function(e){const t=e.slice(),n=[0];let i,r,s,o,a;const l=e.length;for(i=0;i<l;i++){const l=e[i];if(0!==l){if(r=n[n.length-1],e[r]<l){t[i]=r,n.push(i);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<l?s=a+1:o=a;l<e[n[s]]&&(s>0&&(t[i]=n[s-1]),n[s]=i)}}s=n.length,o=n[s-1];for(;s-- >0;)n[s]=o,o=t[o];return n}(x):L;for(g=k.length-1,c=y-1;c>=0;c--){const e=m+c,h=t[e],u=t[e+1],p=e+1<d?u.el||u.placeholder:i;0===x[c]?f(null,h,n,p,r,s,o,a,l):v&&(g<0||c!==k[g]?B(h,n,p,2):g--)}}},B=(e,t,r,s,o=null)=>{const{el:a,type:l,transition:c,children:d,shapeFlag:u}=e;if(6&u)return void B(e.component.subTree,t,r,s);if(128&u)return void e.suspense.move(t,r,s);if(64&u)return void l.move(e,t,r,Y);if(l===Cr){n(a,t,r);for(let e=0;e<d.length;e++)B(d[e],t,r,s);return void n(e.anchor,t,r)}if(l===Tr)return void(({el:e,anchor:t},i,r)=>{let s;for(;e&&e!==t;)s=h(e),n(e,i,r),e=s;n(t,i,r)})(e,t,r);if(2!==s&&1&u&&c)if(0===s)c.beforeEnter(a),n(a,t,r),Zi(()=>c.enter(a),o);else{const{leave:s,delayLeave:o,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?i(a):n(a,t,r)},h=()=>{a._isLeaving&&a[En](!0),s(a,()=>{d(),l&&l()})};o?o(a,d,h):h()}else n(a,t,r)},j=(e,t,n,i=!1,r=!1)=>{const{type:s,props:o,ref:a,children:l,dynamicChildren:c,shapeFlag:d,patchFlag:h,dirs:u,cacheIndex:p}=e;if(-2===h&&(r=!1),null!=a&&(We(),Fn(a,null,n,e,!0),Ye()),null!=p&&(t.renderCache[p]=void 0),256&d)return void t.ctx.deactivate(e);const f=1&d&&u,m=!Gn(e);let _;if(m&&(_=o&&o.onVnodeBeforeUnmount)&&Qr(_,t,e),6&d)$(e.component,n,i);else{if(128&d)return void e.suspense.unmount(n,i);f&&On(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,Y,i):c&&!c.hasOnce&&(s!==Cr||h>0&&64&h)?G(c,t,n,!1,!0):(s===Cr&&384&h||!r&&16&d)&&G(l,t,n),i&&q(e)}(m&&(_=o&&o.onVnodeUnmounted)||f)&&Zi(()=>{_&&Qr(_,t,e),f&&On(e,null,t,"unmounted")},n)},q=e=>{const{type:t,el:n,anchor:r,transition:s}=e;if(t===Cr)return void H(n,r);if(t===Tr)return void b(e);const o=()=>{i(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:i}=s,r=()=>t(n,o);i?i(e.el,o,r):r()}else o()},H=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},$=(e,t,n)=>{const{bum:i,scope:r,job:s,subTree:o,um:a,m:l,a:c}=e;or(l),or(c),i&&de(i),r.stop(),s&&(s.flags|=8,j(o,e,t,n)),a&&Zi(a,t),Zi(()=>{e.isUnmounted=!0},t)},G=(e,t,n,i=!1,r=!1,s=0)=>{for(let o=s;o<e.length;o++)j(e[o],t,n,i,r)},V=e=>{if(6&e.shapeFlag)return V(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=h(e.anchor||e.el),n=t&&t[Rn];return n?h(n):t};let U=!1;const W=(e,t,n)=>{null==e?t._vnode&&j(t._vnode,null,null,!0):f(t._vnode||null,e,t,null,null,null,n),t._vnode=e,U||(U=!0,kn(),Sn(),U=!1)},Y={p:f,um:j,m:B,r:q,mt:T,mc:x,pc:O,pbc:S,n:V,o:e};let X,K;return t&&([X,K]=t(Y)),{render:W,hydrate:X,createApp:Di(W,X)}}function tr({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function nr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ir(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function rr(e,t,n=!1){const i=e.children,r=t.children;if($(i)&&$(r))for(let e=0;e<i.length;e++){const t=i[e];let s=r[e];1&s.shapeFlag&&!s.dynamicChildren&&((s.patchFlag<=0||32===s.patchFlag)&&(s=r[e]=Kr(r[e]),s.el=t.el),n||-2===s.patchFlag||rr(t,s)),s.type===Mr&&-1!==s.patchFlag&&(s.el=t.el),s.type!==zr||s.el||(s.el=t.el)}}function sr(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:sr(t)}function or(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const ar=Symbol.for("v-scx"),lr=()=>{{const e=Bi(ar);return e}};function cr(e,t,n){return dr(e,t,n)}function dr(e,t,n=R){const{immediate:i,deep:r,flush:s,once:o}=n;const a=j({},n);const l=t&&i||!t&&"post"!==s;let c;if(hs)if("sync"===s){const e=lr();c=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=E,e.resume=E,e.pause=E,e}const d=ns;a.call=(e,t,n)=>dn(e,d,t,n);let h=!1;"post"===s?a.scheduler=e=>{Zi(e,d&&d.suspense)}:"sync"!==s&&(h=!0,a.scheduler=(e,t)=>{t?e():vn(e)}),a.augmentJob=e=>{t&&(e.flags|=4),h&&(e.flags|=2,d&&(e.id=d.uid,e.i=d))};const u=an(e,t,a);return hs&&(c?c.push(u):l&&u()),u}function hr(e,t,n){const i=this.proxy,r=W(e)?e.includes(".")?ur(i,e):()=>i[e]:e.bind(i,i);let s;U(t)?s=t:(s=t.handler,n=t);const o=os(this),a=dr(r,s.bind(i),n);return o(),a}function ur(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const pr=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${re(t)}Modifiers`]||e[`${oe(t)}Modifiers`];function fr(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||R;let r=n;const s=t.startsWith("update:"),o=s&&pr(i,t.slice(7));let a;o&&(o.trim&&(r=n.map(e=>W(e)?e.trim():e)),o.number&&(r=n.map(ue)));let l=i[a=le(t)]||i[a=le(re(t))];!l&&s&&(l=i[a=le(oe(t))]),l&&dn(l,e,6,r);const c=i[a+"Once"];if(c){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,dn(c,e,6,r)}}const mr=new WeakMap;function _r(e,t,n=!1){const i=n?mr:t.emitsCache,r=i.get(e);if(void 0!==r)return r;const s=e.emits;let o={},a=!1;if(!U(e)){const i=e=>{const n=_r(e,t,!0);n&&(a=!0,j(o,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return s||a?($(s)?s.forEach(e=>o[e]=null):j(o,s),X(e)&&i.set(e,o),o):(X(e)&&i.set(e,null),null)}function gr(e,t){return!(!e||!I(t))&&(t=t.slice(2).replace(/Once$/,""),F(e,t[0].toLowerCase()+t.slice(1))||F(e,oe(t))||F(e,t))}function br(e){const{type:t,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:d,props:h,data:u,setupState:p,ctx:f,inheritAttrs:m}=e,_=An(e);let g,b;try{if(4&n.shapeFlag){const e=r||i,t=e;g=Xr(c.call(t,e,d,h,p,u,f)),b=a}else{const e=t;0,g=Xr(e.length>1?e(h,{attrs:a,slots:o,emit:l}):e(h,null)),b=t.props?a:yr(a)}}catch(t){Ar.length=0,hn(t,e,1),g=$r(zr)}let y=g;if(b&&!1!==m){const e=Object.keys(b),{shapeFlag:t}=y;e.length&&7&t&&(s&&e.some(B)&&(b=vr(b,s)),y=Vr(y,b,!1,!0))}return n.dirs&&(y=Vr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&In(y,n.transition),g=y,An(_),g}const yr=e=>{let t;for(const n in e)("class"===n||"style"===n||I(n))&&((t||(t={}))[n]=e[n]);return t},vr=(e,t)=>{const n={};for(const i in e)B(i)&&i.slice(9)in t||(n[i]=e[i]);return n};function wr(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let r=0;r<i.length;r++){const s=i[r];if(t[s]!==e[s]&&!gr(n,s))return!0}return!1}function xr({vnode:e,parent:t},n){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.el=e.el),i!==e)break;(e=t.vnode).el=n,t=t.parent}}const kr=e=>e.__isSuspense;function Sr(e,t){t&&t.pendingBranch?$(e)?t.effects.push(...e):t.effects.push(e):xn(e)}const Cr=Symbol.for("v-fgt"),Mr=Symbol.for("v-txt"),zr=Symbol.for("v-cmt"),Tr=Symbol.for("v-stc"),Ar=[];let Pr=null;function Nr(e=!1){Ar.push(Pr=e?null:[])}function Or(){Ar.pop(),Pr=Ar[Ar.length-1]||null}let Rr=1;function Lr(e,t=!1){Rr+=e,e<0&&Pr&&t&&(Pr.hasOnce=!0)}function Er(e){return e.dynamicChildren=Rr>0?Pr||L:null,Or(),Rr>0&&Pr&&Pr.push(e),e}function Dr(e,t,n,i,r,s){return Er(Fr(e,t,n,i,r,s,!0))}function Ir(e,t,n,i,r){return Er($r(e,t,n,i,r,!0))}function Br(e){return!!e&&!0===e.__v_isVNode}function jr(e,t){return e.type===t.type&&e.key===t.key}const qr=({key:e})=>null!=e?e:null,Hr=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?W(e)||Xt(e)||U(e)?{i:zn,r:e,k:t,f:!!n}:e:null);function Fr(e,t=null,n=null,i=0,r=null,s=(e===Cr?0:1),o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&qr(t),ref:t&&Hr(t),scopeId:Tn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:zn};return a?(Jr(l,n),128&s&&e.normalize(l)):n&&(l.shapeFlag|=W(n)?8:16),Rr>0&&!o&&Pr&&(l.patchFlag>0||6&s)&&32!==l.patchFlag&&Pr.push(l),l}const $r=Gr;function Gr(e,t=null,n=null,i=0,r=null,s=!1){if(e&&e!==ui||(e=zr),Br(e)){const i=Vr(e,t,!0);return n&&Jr(i,n),Rr>0&&!s&&Pr&&(6&i.shapeFlag?Pr[Pr.indexOf(e)]=i:Pr.push(i)),i.patchFlag=-2,i}if(ys(e)&&(e=e.__vccOpts),t){t=function(e){return e?Gt(e)||Hi(e)?j({},e):e:null}(t);let{class:e,style:n}=t;e&&!W(e)&&(t.class=ve(e)),X(n)&&(Gt(n)&&!$(n)&&(n=j({},n)),t.style=me(n))}return Fr(e,t,n,i,r,W(e)?1:kr(e)?128:Ln(e)?64:X(e)?4:U(e)?2:0,s,!0)}function Vr(e,t,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=e,c=t?function(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const e in i)if("class"===e)t.class!==i.class&&(t.class=ve([t.class,i.class]));else if("style"===e)t.style=me([t.style,i.style]);else if(I(e)){const n=t[e],r=i[e];!r||n===r||$(n)&&n.includes(r)||(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=i[e])}return t}(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&qr(c),ref:t&&t.ref?n&&s?$(s)?s.concat(Hr(t)):[s,Hr(t)]:Hr(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Cr?-1===o?16:16|o:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vr(e.ssContent),ssFallback:e.ssFallback&&Vr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&In(d,l.clone(d)),d}function Ur(e=" ",t=0){return $r(Mr,null,e,t)}function Wr(e,t){const n=$r(Tr,null,e);return n.staticCount=t,n}function Yr(e="",t=!1){return t?(Nr(),Ir(zr,null,e)):$r(zr,null,e)}function Xr(e){return null==e||"boolean"==typeof e?$r(zr):$(e)?$r(Cr,null,e.slice()):Br(e)?Kr(e):$r(Mr,null,String(e))}function Kr(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Vr(e)}function Jr(e,t){let n=0;const{shapeFlag:i}=e;if(null==t)t=null;else if($(t))n=16;else if("object"==typeof t){if(65&i){const n=t.default;return void(n&&(n._c&&(n._d=!1),Jr(e,n()),n._c&&(n._d=!0)))}{n=32;const i=t._;i||Hi(t)?3===i&&zn&&(1===zn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=zn}}else U(t)?(t={default:t,_ctx:zn},n=32):(t=String(t),64&i?(n=16,t=[Ur(t)]):n=8);e.children=t,e.shapeFlag|=n}function Qr(e,t,n,i=null){dn(e,t,7,[n,i])}const Zr=Li();let es=0;function ts(e,t,n){const i=e.type,r=(t?t.appContext:e.appContext)||Zr,s={uid:es++,vnode:e,type:i,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Pe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Vi(i,r),emitsOptions:_r(i,r),emit:null,emitted:null,propsDefaults:R,inheritAttrs:i.inheritAttrs,ctx:R,data:R,props:R,attrs:R,slots:R,refs:R,setupState:R,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=fr.bind(null,s),e.ce&&e.ce(s),s}let ns=null;const is=()=>ns||zn;let rs,ss;{const e=fe(),t=(t,n)=>{let i;return(i=e[t])||(i=e[t]=[]),i.push(n),e=>{i.length>1?i.forEach(t=>t(e)):i[0](e)}};rs=t("__VUE_INSTANCE_SETTERS__",e=>ns=e),ss=t("__VUE_SSR_SETTERS__",e=>hs=e)}const os=e=>{const t=ns;return rs(e),e.scope.on(),()=>{e.scope.off(),rs(t)}},as=()=>{ns&&ns.scope.off(),rs(null)};function ls(e){return 4&e.vnode.shapeFlag}let cs,ds,hs=!1;function us(e,t=!1,n=!1){t&&ss(t);const{props:i,children:r}=e.vnode,s=ls(e);!function(e,t,n,i=!1){const r={},s=qi();e.propsDefaults=Object.create(null),Fi(e,t,r,s);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=i?r:Bt(r):e.type.props?e.props=r:e.props=s,e.attrs=s}(e,i,s,t),((e,t,n)=>{const i=e.slots=qi();if(32&e.vnode.shapeFlag){const e=t._;e?(Qi(i,t,n),n&&he(i,"_",e,!0)):Ki(t,i)}else t&&Ji(e,t)})(e,r,n||t);const o=s?function(e,t){const n=e.type;0;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vi),!1;const{setup:i}=n;if(i){We();const n=e.setupContext=i.length>1?_s(e):null,r=os(e),s=cn(i,e,0,[e.props,n]),o=K(s);if(Ye(),r(),!o&&!e.sp||Gn(e)||jn(e),o){if(s.then(as,as),t)return s.then(n=>{ps(e,n,t)}).catch(t=>{hn(t,e,0)});e.asyncDep=s}else ps(e,s,t)}else fs(e,t)}(e,t):void 0;return t&&ss(!1),o}function ps(e,t,n){U(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:X(t)&&(e.setupState=tn(t)),fs(e,n)}function fs(e,t,n){const i=e.type;if(!e.render){if(!t&&cs&&!i.render){const t=i.template||Mi(e).template;if(t){0;const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:s,compilerOptions:o}=i,a=j(j({isCustomElement:n,delimiters:s},r),o);i.render=cs(t,a)}}e.render=i.render||E,ds&&ds(e)}{const t=os(e);We();try{ki(e)}finally{Ye(),t()}}}const ms={get:(e,t)=>(rt(e,0,""),e[t])};function _s(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,ms),slots:e.slots,emit:e.emit,expose:t}}function gs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tn(Ut(e.exposed)),{get:(t,n)=>n in t?t[n]:n in bi?bi[n](e):void 0,has:(e,t)=>t in e||t in bi})):e.proxy}function bs(e,t=!0){return U(e)?e.displayName||e.name:e.name||t&&e.__name}function ys(e){return U(e)&&"__vccOpts"in e}const vs=(e,t)=>{const n=function(e,t,n=!1){let i,r;return U(e)?i=e:(i=e.get,r=e.set),new nn(i,r,n)}(e,0,hs);return n};const ws="3.5.21";class xs{static get_default(){return{a:1,b:0,c:0,d:1,e:0,f:0}}static to_array(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static is_default(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f}static get_matrix(e,t,n,i,r,s){return{a:e,b:t,c:n,d:i,e:r,f:s}}static get_matrix_translate(e,t){return{a:1,b:0,c:0,d:1,e,f:t}}static get_matrix_scale(e,t){return{a:e,b:0,c:0,d:t,e:0,f:0}}static get_matrix_reflection_horizental(){return{a:1,b:0,c:0,d:-1,e:0,f:0}}static get_matrix_reflection_vertical(){return{a:-1,b:0,c:0,d:1,e:0,f:0}}static multiply(e,t){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}static translate(e,t,n){const i=this.get_matrix_translate(t,n);return this.multiply(e,i)}static get_dom_string(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=e;return`matrix(${t.toFixed(1)},${n},${i},${r.toFixed(1)},${s.toFixed(1)},${o.toFixed(1)})`}static map_point_to_view(e,t){return{x:e.x+t.x,y:e.y+t.y}}static view_point_to_map(e,t){return{x:e.x-t.x,y:e.y-t.y}}}class ks{static path=document.createElementNS("http://www.w3.org/2000/svg","path");static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],i=this.path.getTotalLength()/t;for(let e=0;e<=t;e++){const t=e*i,r=this.path.getPointAtLength(t);n.push({x:r.x,y:r.y})}return n}static get_line_k(e,t){const n=t.y-e.y,i=t.x-e.x;if(0===i)return Number.POSITIVE_INFINITY;return n/i}static find_closet_point(e,t){let n=1/0,i=e[0];const{x:r,y:s}=t;for(let t of e){let e=(r-t.x)**2+(s-t.y)**2;e<n&&(n=e,i=t)}return i}static offset_points(e,t){const n=[],{x:i,y:r}=t;for(let t of e)n.push({x:t.x+i,y:t.y+r});return n}static find_closest_points(e,t){let n=1/0,i=e[0],r=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,i=o,r=s)}}return{from:i,to:r}}static polygonCentroid(e){let t=0,n=0,i=0;const r=e.length;for(let s=0;s<r;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%r],d=o*c-l*a;i+=d,t+=(o+l)*d,n+=(a+c)*d}return i*=.5,t/=6*i,n/=6*i,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let i=0;i<n;i++){const{x:r,y:s}=e[i],{x:o,y:a}=e[(i+1)%n];t+=r*a-o*s}return t/2}static find_line_to_layout_root(e,t=new Set){if(e.is_layout_root)return{has_root:!0,line:[e]};t.add(e.id);for(let n of e.from){if(t.has(n))continue;const i=e.pcube.get_node(n);if(i){if(i.is_layout_root)return{has_root:!0,line:[e,i]};{const n=this.find_line_to_layout_root(i,t);if(n.has_root)return n.line.unshift(e),n}}}return{has_root:!1,line:[]}}static get_linker_id(e,t){return e+"-"+t}static wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}static create_linker_info(e,t,n){const i=e.get_node(t),r=e.get_node(n),s=i?.to.size||0,o=r?.from.size||0;return{linker:ad.get_default(t,n),index_from:o,index_to:s}}}class Ss{_root;get root(){return this._root}get doc(){const e=this.root;if(e instanceof Vl)return e}get courier(){return this.root.courier}get history(){return this.root.history}get cursor(){return this.root.cursor}get event(){return this.root.event}get listener(){return this.root.listener}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get config(){return this.root.config}get stats(){return this.root.stats}get hotkeys(){return this.root.hotkeys}constructor(e){this._root=e}}class Cs{static _funcs=new Map;static get url(){return this._funcs.get("asset-url")}static get tips(){return this._funcs.get("tip")}static register_asset_url(e){this._funcs.set("asset-url",e)}static register_tip(e){this._funcs.set("tip",e)}}let Ms=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};class zs{static docs=new Map;static maps=new Map;static _cubes=new Map;static _metas_cube=new Map;static get metas_cube(){const e=new Map;for(let[t,n]of this._cubes)e.set(t,n.meta);return e}static init(){this.register_cube_core()}static add_doc(e){this.docs.set(e.id,e)}static add_map(e){this.maps.set(e.id,e)}static register_cube(e){const t=e.meta;t||console.error(`NoteManager: can't find static member meta in ${e}`),this._cubes.set(t.type,e)}static find_cube(e){return this._cubes.get(e)}static export_versions(){const e={[Vl.meta.type]:Vl.meta.version};for(const[t,n]of this._cubes)e[t]=n.meta.version;return e}static get_sdk_meta(){return{version:"1.89.2",time_publish:1767971671815}}static register_cube_core(){zs.register_cube(Sa),zs.register_cube(Wl),zs.register_cube(Yo),zs.register_cube(wa),zs.register_cube(_a),zs.register_cube(da),zs.register_cube($l),zs.register_cube(Yd),zs.register_cube(th),zs.register_cube($d),zs.register_cube(uw),zs.register_cube(Dd),zs.register_cube(aw),zs.register_cube(Vv),zs.register_cube(Hm),zs.register_cube(Td),zs.register_cube(Ql),zs.register_cube(ic),zs.register_cube(gd),zs.register_cube(ad),zs.register_cube(gw),zs.register_cube(od),zs.register_cube(xw)}}class Ts{static get_id(){return Ms()}static async sleep(e=100){return new Promise(t=>{setTimeout(t,e)})}static is_same_style(e,t){let n=new Set(Object.keys(e)),i=new Set(Object.keys(t)),r=new Set([...n,...i]);if(n.size!==r.size||n.size!==i.size)return!1;for(let i of n){if(e[i]!==t[i])return!1}return!0}static is_same_attrs(e,t){let n=new Set(Object.keys(e)),i=new Set(Object.keys(t)),r=new Set([...n,...i]);if(n.size!==r.size||n.size!==i.size)return!1;for(let i of n){if(e[i]!==t[i])return!1}return!0}async locate(e,t,n=!0){const{courier:i,history:r}=e,s=e.find_cube(t),o=Cs.tips;if(s instanceof ro&&s.top){const e=s.top;if(s.find_upstream_untill(e)!==e.child_first){const t=i.get_recorder();t.tell(e,Rs.fold(e.id,!1)),r.record(t)}}const a=document.getElementById(t);if(!a)return o?.tip_error("未发现书签锚点");let l=a.style.backgroundColor;a.style.backgroundColor="var(--locate-anchor-bg)",setTimeout(()=>{"var(--locate-anchor-bg)"===a.style.backgroundColor&&(a.style.backgroundColor=l)},3e3),n&&a.scrollIntoView({block:"center",behavior:"instant"})}static exports(e){const t=[];for(let n of e)t.push(n.export());return t}static build_cubes(e,t){const n=[];for(let i of e){if(!i)continue;let e=zs.find_cube(i.type);if(e)n.push(new e(i,t));else{const e=new Zo(i,t,"未注册cube");n.push(e)}}return n}static get_client_rects(e){const t=document.getElementById(e);if(t)return t.getClientRects()}static pick(e,t=!1){const i=zs.metas_cube;let r=[],s=[],o=[],a=[],l=null,c=-1,d=-1,h=e,u=[];for(let t=0;t<e.length;t++){const i=e[t];if(i.type===n.box_root){h=e.slice(0,t),u=e.slice(t+1),l=i,a.push(l);break}}for(let e=0;e<h.length;e++){const t=h[e];i.get(t.type)?.block&&(c<0?c=e:d=e)}if(c>=0&&d>=0){const e=h.slice(0,c),t=h.slice(d+1),n=[];let a=Wl.get_default();a.info=[];for(let e of h.slice(c,d+1))i.get(e.type)?.block?(n.push(e),a.info.length>0&&(n.push(a),a=Wl.get_default(),a.info=[])):a.info.push(e);r=e,s=n,o=t}else c>=0&&d<0?(r=h.slice(0,c),s=h.slice(c,c+1),o=h.slice(c+1)):(r=h,s=[],o=[]);if(l){let e=Wl.get_default();e.info=[];for(let t of u)t.type===n.box_root?(l=t,a.push(t)):i.get(t.type)?.block?(t.type===n.box?l.info.push(...t.info):l.info.push(t),e.info.length>0&&l&&(l.info.push(e),e=Wl.get_default())):e.info.push(t);e.info.length>0&&l&&l.info.push(e)}const p=[];if(r.length>0&&p.push(Wl.get_default(r)),s.length>0&&p.push(...s),o.length>0&&p.push(Wl.get_default(o)),a.length>0)if(t)for(let e of a)p.push(...e.info);else p.push(...a);return{head:r,body:s,tail:o,root:a,sort:p}}static find_line(e,t="first"){if(e instanceof Wl)return e;const n=zs.metas_cube.get(e.type);if(!n||!n.block)return;const i="first"===t?e.children:e.children.reverse();for(let e of i){let n=this.find_line(e,t);if(n)return n}}static filter_out_empty(e){return e.filter(e=>!Sa.is_empty_text(e))}static get_flat_cube(e,t=!0){const n=e.children,i=[];if(t)for(let e of n)i.push(e),i.push(...this.get_flat_cube(e));else{i.push(...n);for(let e of i)i.push(...e.children)}return i}static replace_id(e,t,n,i={}){const r=[];for(let s of n){const n=zs.find_cube(s.type);if(!n||!n.replace_id)continue;const o=t[n.meta.type]||1,a=n.update_data(o,s);r.push(n.replace_id(e,a.data,i))}return r}static insert_cubes(e,t){const{courier:n,history:i,cursor:r}=e,{cube_selection:s,cube_start:o,cube_end:a,offset_end:l,offset_start:c}=r;if(!s||!o||!a)return;const d=new Os(n);return r.has_selection&&d.tell(s,Rs.delete(s.id,"backward",o.id,a.id,c,l)),d.tell(o,Rs.insert(o.id,t,o.id,o.id,c,c)),d}static check_mouse_key(e,t){let n={left:{pointermove:{button:-1,buttons:1},pointerdown:{button:0,buttons:1},pointerup:{button:0,buttons:0}},right:{pointermove:{button:-1,buttons:2},pointerdown:{button:2,buttons:2},pointerup:{button:2,buttons:0}},mid:{pointermove:{button:-1,buttons:4},pointerdown:{button:1,buttons:4},pointerup:{button:1,buttons:0}}}[t][e.type];return e.button==n.button&&e.buttons==n.buttons}}class As{ps;resolve;reject;constructor(){this.ps=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class Ps extends Ss{_record;_resolve;_status=C.pending;_p=Promise.resolve();_prev_tip_remove;get meta(){return Ps.meta}get status(){return this._status}constructor(e,t){const n=Cs.tips;super(e),this._record=t,this._prev_tip_remove=n?.tip_info("播放器已就绪,点我播放",1/0,this.play.bind(this))}waiting(){return new Promise(e=>{this._resolve=e;[C.pending,C.playing].includes(this.status)&&e()})}clear_message(){this._prev_tip_remove&&this._prev_tip_remove()}async play(){const e=Cs.tips;this.clear_message(),this.status!==C.stop&&(this._status=C.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)));for(let e of this._record.stack){const t=this.courier.get_recorder();for(let n of e.do){await Ts.sleep(this.config.data.player_speed),await yn(),this.stats.showing=!0;let e=this.root.find_cube(n.id);e?(e.dom?.scrollIntoView({inline:"nearest",block:"nearest",behavior:"smooth"}),t.tell(e,n)):console.warn(`未发现演示cube:${n}`)}await yn(),this.history.record(t),await this.waiting()}this._status=C.stop,this.clear_message(),this.stats.showing=!1,e?.tip_success("演示完毕",9e3)}pause(){const e=Cs.tips;this.clear_message(),this._status!==C.stop&&(this._status=C.pause,this.stats.showing=!1,this._prev_tip_remove=e?.tip_info("暂停演示,点此恢复",1/0,this.continue.bind(this)))}continue(){const e=Cs.tips;this.clear_message(),this._status!==C.stop&&(this._resolve&&this._resolve(),this._status=C.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)))}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.player,version:1}}}class Ns extends Ss{stack_undo=Bt([]);stack_redo=Bt([]);get meta(){return Ns.meta}get len_undo(){return this.stack_undo.length}get len_redo(){return this.stack_redo.length}constructor(e){super(e)}execute_command_group(e){let t=Promise.resolve();for(let n of e)t.then(()=>yn(()=>this.courier.pass(n)))}undo(){const e=Cs.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_undo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_redo.push(t);const n=t.stack_undo;this.execute_command_group(n),this.event.emit_status_update()}redo(){const e=Cs.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_redo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_undo.push(t);const n=t.stack_do;this.execute_command_group(n),this.event.emit_status_update()}record(e){if(!this.stats.is_read_mode&&0!==e.stack_undo.length){if(this.config.data.history_length>0&&this.config.data.history_length<Number.POSITIVE_INFINITY){const e=this.stack_undo.length-this.config.data.history_length;e>0&&this.stack_undo.splice(0,e)}this.stack_undo.push(e),this.event.emit_status_update()}}play(e){return new Ps(this.root,e)}export(e=0){const t=this.stack_undo.slice(e),n={version:this.meta.version,stack:[],docid:this.root.id};for(let e of t)n.stack.push({do:e.stack_do,undo:e.stack_undo});return n}download(e="record.json"){const t=this.export(),n=document.createElement("a");n.download="filename";const i=new Blob([JSON.stringify(t)],{type:"text/plain"});n.href=URL.createObjectURL(i),n.click()}update_data(...e){return{}}clear_stack(){this.stack_undo.length=0,this.stack_redo.length=0,this.event.emit_status_update()}static get meta(){return{type:t.history,version:1}}}class Os{do=[];undo=[];courier;get stack_do(){const e=[];return e.push(...this.do),e}get stack_undo(){const e=[];return e.push(...this.undo),e}constructor(e){this.courier=e}add_cmd(e){this.do.push(structuredClone(Vt(e)))}add_recover(e){e&&this.undo.unshift(e)}pass(e){let t=this.courier.pass(e);t instanceof Os&&this.merge(t)}tick(e,t){yn(()=>{t?this.tell(t,e):this.courier.pass(e)})}get_cube_upstream(e,t=!0){let n=[],i=t?e:e.pcube;for(;i;)n.push(i),i=i.pcube;return n}tell(e,...t){const n=Cs.tips;if(!e)return this;if(this.courier.stats.mode===z.read)return n?.tip_info("只读模式不可操作"),this;const i=this.get_cube_upstream(e,!1).reverse();if(e instanceof ro)for(let n of i){const r={recorder:this,path:[...i],tcube:e,cmds:structuredClone(t)};if(n.event_capture(r).stop)return this}for(let n of t){if(!e||e.id!==n.id)continue;this.courier.event.emit_edit_before(e,n);let t=e.on(n);this.merge(t),t&&t.stack_undo.length>0&&console.log("🟩",e,e.type,n),this.courier.event.emit_edit_after(e,n)}if(e instanceof ro)for(let n of i){const r={recorder:this,path:[...i],tcube:e,cmds:structuredClone(t)};if(n.event_bubble(r).stop)return this}return this}merge(e){return e instanceof Os?(this.do.push(...structuredClone(Vt(e.stack_do))),this.undo.unshift(...structuredClone(Vt(e.stack_undo))),this):this}}class Rs{static insert_child(e,t,n){return{id:e,name:i.cube_insert_child,data:t,pos:n}}static delete_child(e,t,n,r=!1){return{id:e,name:i.cube_delete_child,dir:t,range:n,reserve:r}}static insert(e,t,n,r,s,o){return{id:e,name:i.cube_insert,data:t,start_id:n,end_id:r,offset_end:o,offset_start:s}}static delete(e,t,n,r,s,o,a=!1){return{id:e,name:i.cube_delete,dir:t,start_id:n,end_id:r,offset_start:s,offset_end:o,reserve:a}}static delete_adjacent(e,t,n,r){return{id:e,name:i.cube_delete_adjacent,from:t,offset:r,from_id:n}}static set_selection_css(e,t,n,r,s,o,a=!1,l=!1){return{id:e,name:i.cube_set_selection_css,css:t,start_id:n,end_id:r,offset_start:s,offset_end:o,toggle:a,replace:l}}static set_css(e,t,n=!1,r=!1){return{id:e,name:i.cube_set_css,css:t,toggle:n,replace:r}}static partition(e,t,n,r,s){return{name:i.cube_partition,id:e,start_id:t,end_id:n,offset_start:r,offset_end:s}}static reorder(e,t,n){return{id:e,name:i.cube_reorder,cubeid:t,index:n}}static reset(e,t){return{id:e,name:i.cube_reset,data:t}}static merge(e,t,n,r){return{id:e,name:i.cube_merge,method:t,cubeid:n,offset:r}}static postil_add(e,t=[]){return{name:i.cube_postil_add,id:e,data:t}}static postil_remove(e,t){return{name:i.cube_postil_remove,id:e,range:t}}static set_attr(e,t){return{id:e,name:i.cube_set_attr,attr:t}}static resize(e,t,n=-1){return n>0?this.set_attr(e,{width:t,height:n}):this.set_attr(e,{width:t})}static fold(e,t){return this.set_attr(e,{fold:t})}}class Ls{static loc(e,t,n,i){return{name:o.loc,id:e,from:n,from_offset:i,offset:t}}static in_head(e){return{id:e,name:o.cursor_in_head}}static in_tail(e){return{id:e,name:o.cursor_in_tail}}}var Es=r(1858);class Ds{static layout_tree(e,t){if(0==e.count_to)return;const n=e.env.layout_type;return"right"===n?this.right(e,t):"left"===n?this.left(e,t):"down"===n?this.down(e,t):"up"===n?this.up(e,t):"time-down"===n?this.time_down(e,t):"time-right"===n?this.time_right(e,t):void 0}static right(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos_tree:s,size_bound:o}=r;let a=s.x+n+o.width,l=s.y,c=0;for(let e=0;e<t.length;e++){const n=t[e].bound;n.update_pos_tree(a,l+c+e*i),c+=n.size_tree.height}}static left(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos_tree:s,size_bound:o,size_tree:a}=r;let l=s.x+a.width-o.width-n,c=s.y,d=0;for(let e=0;e<t.length;e++){const n=t[e].bound;n.update_pos_tree(l-n.size_tree.width,c+d+e*i),d+=n.size_tree.height}}static down(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos_tree:s,size_bound:o}=r;let a=s.x,l=s.y+i+o.height,c=0;for(let e=0;e<t.length;e++){const i=t[e].bound;i.update_pos_tree(a+c+e*n,l),c+=i.size_tree.width}}static up(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos_tree:s,size_bound:o,size_tree:a}=r;let l=s.x,c=s.y+a.height-o.height-i,d=0;for(let e=0;e<t.length;e++){const i=t[e].bound;i.update_pos_tree(l+d+e*n,c-i.size_tree.height),d+=i.size_tree.width}}static time_right(e,t){const{map_node_hgap:n,map_node_vgap:i}=e.config.data,r=e.bound,{pos:s,size_bound:o}=r;let a=s.x+o.width+n,l=s.y+o.height/2,c=0;for(let e=0;e<t.length;e++){const i=t[e],r=i.bound,{size_bound:s,size_tree:o}=r,d=i.attrs.layout;"right"===d||"left"===d?r.update_pos_tree(a+c+e*n,l-o.height/2):"up"===d?r.update_pos_tree(a+c+e*n,l-(o.height-s.height/2)):r.update_pos_tree(a+c+e*n,l-s.height/2),c+=r.size_tree.width}}static time_down(e,t){const{map_node_vgap:n}=e.config.data,i=e.bound,{pos:r,size_bound:s}=i,{sum_tree_height:o,sum_tree_width:a,max_tree_height:l,max_tree_width:c,max_tree_width_node:d,max_tree_height_node:h}=e.bound.stat_downstream_nodes_size(t);Math.max(d.width,s.width);let u=r.x+s.width/2,p=r.y+s.height+n,f=0;for(let e=0;e<t.length;e++){const i=t[e],r=i.bound,s=i.attrs.layout,{size_bound:o,size_tree:a}=r;"left"===s?r.update_pos_tree(u-(a.width-o.width/2),p+f+e*n):"down"===s||"up"===s?r.update_pos_tree(u-a.width/2,p+f+e*n):r.update_pos_tree(u-o.width/2,p+f+e*n),f+=r.size_tree.height}}}class Is{static layout_change(e,t){return{id:e,name:l.layout_update,attrs:t}}static append_child(e,t){return{id:e,name:l.append_child,previd:t}}}class Bs{static node_add(e,t){return{id:e,name:a.node_add,data:t}}static node_remove(e,t){return{id:e,name:a.node_remove,data:t}}static linker_add(e,t){return{id:e,name:a.linker_add,data:t}}static linker_remove(e,t){return{id:e,name:a.linker_remove,data:t}}static update_attr(e,t){return{id:e,name:a.update_attrs,data:t}}}class js{handler=new Map;vip_handler=new Map;constructor(){}on(e){const t=this.get_vip_cmd_handler(e.name)||this.get_cmd_handler(e.name);if(t)return t(e)}get_cmd_handler(e){return this.handler.get(e)}get_vip_cmd_handler(e){return this.vip_handler.get(e)}set_cmd_handler(e,t){this.handler.set(e,t)}set_vip_cmd_handler(e,t){this.vip_handler.set(e,t)}event_capture(e){return{stop:!1}}event_bubble(e){return{stop:!1}}static get_default(...e){throw Error("sub-cube have't implement get_default method")}static get meta(){throw Error("sub-cube have't implement attribution meta")}}const qs=new Map;class Hs{static get_cmd_handler(e,t){const n=qs.get(e);return n?.get(t)}static set_cmd_handler(e,t,n){let i=qs.get(e);i?i.set(t,n):(i=new Map,i.set(t,n),qs.set(e,i))}static init_cmd_handler(e){const t=e.meta,n=qs.get(t.type);if(n)for(let[t,i]of n)e.set_vip_cmd_handler(t,i.bind(e))}}function Fs(e){return(t,n)=>{const i=t[n];if(!i)return;const r=t.meta;Hs.set_cmd_handler(r.type,e,i)}}class $s extends Ss{_id=Ms();scroll_offset=100;_freeze=Kt(!1);get meta(){return $s.meta}get id(){return this._id}pos=It({x:0,y:0,width:0,height:0});css=It({});get freeze(){return this._freeze.value}set freeze(e){this._freeze.value=e}_direction=null;get focus_cube(){return this.selection_line[this.selection_line.length-1]}get second_cube(){return this.selection_line.length<=1?void 0:this.selection_line[this.selection_line.length-2]}get len(){return this.selection_line.length}selection_line=[];constructor(e,t){super(e),this.selection_line.push(t),this.listener.check_float()}expand(e){if(!(this.focus_cube instanceof wa&&this._direction===e))if("up"===e){if("down"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.prev_cube||this.focus_cube.pcube;if(!e||e instanceof io)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="up"),this.selection_line.push(e),this.update_area())}else{if("up"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.next_cube||this.focus_cube.pcube;if(!e||e instanceof io)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="down"),this.selection_line.push(e),this.update_area())}}shrink(){1!==this.selection_line.length&&(this.selection_line.pop(),this.update_area())}update_area(e=!0){if(e){const e=[];for(let t of this.selection_line){const n=t.clientRect;n&&e.push(n)}if(0===e.length)return this.remove();const t=Es.MathRect.merge(...e);this.css.width=`${t.width}px`,this.css.height=`${t.height}px`,this.css.left=t.x+"px",this.css.top=t.y+"px",this.pos.x=t.x+document.documentElement.scrollLeft,this.pos.y=t.y+document.documentElement.scrollTop,this.pos.width=t.width,this.pos.height=t.height}else{const e=this.pos.x-document.documentElement.scrollLeft,t=this.pos.y-document.documentElement.scrollTop;this.css.left=e+"px",this.css.top=t+"px"}}find_line_next(e){if(this.selection_line.indexOf(e)<this.selection_line.length)return this.selection_line[this.selection_line.length-1]}find_line_prev(e){const t=this.selection_line.indexOf(e);if(t>0)return this.selection_line[t-1]}get_scope_info(){let e=this.focus_cube.level;const t=this.focus_cube.pcube,n=[],i=[];for(let t of this.selection_line){const r=t.level,s=t.index;r===e&&(n.push(t),i.push(s))}return{cube:t,range:[Math.min(...i),Math.max(...i)+1],from:this.id}}remove(){this.root.remove_scope(this.id),this.event.emit_status_update()}find_scope_lines(){const e=this.root.get_scope_cubes(),t=[],n=[];for(let n of e)t.push(...Ts.get_flat_cube(n.cube));for(let e of t)e instanceof Wl&&n.push(e);return n}find_inline_data(){const e=[],t=this.find_scope_lines();for(let n of t)e.push(...n.children);return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.scope,version:1}}}class Gs extends Ss{timer_float_check=!1;constructor(e){super(e),this.init()}init(){}check_float(){const{stats:e,cubes:t}=this.root;this.timer_float_check||requestAnimationFrame(()=>{let e=!0;for(let t of this.root.scope)e=!1,t.update_area();for(let[n,i]of t.postils)i.show&&(e=!1,i.update_pos());e||this.check_float()})}}class Vs extends Ss{_map=Bt({});_types=Bt(new Map);_count=Bt({});constructor(e){super(e)}get postils(){return this._types.get(n.postil)||new Map}get meta(){return Vs.meta}get_types_cube(e){return this._types.get(e)||new Map}add_cube(e){const t=e.id,n=e.meta.type;void 0===this._count[t]?this._count[t]=1:this._count[t]++,this._map[t]=e;const i=this._types.get(n);i?i.set(t,e):this._types.set(n,Bt(new Map([[t,e]])))}remove_cube(e){const t=e.id,n=e.meta.type;0===--this._count[t]&&(delete this._map[t],this._types.get(n)?.delete(t))}find_cube(e){return this._map[e]}find_postil(e){for(let t of Object.values(this.postils)){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}clear_all_map_selected(){const e=this.get_types_cube(n.submap);if(e)for(let[t,n]of e)n.clear_node_selected();this.root instanceof wd&&this.root.clear_node_selected()}static get meta(){return{type:t.cubes,version:1}}}function Us(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const Ws=new Map;function Ys(e){return(t,n)=>{let i=t[n];Ws.set(e,i)}}class Xs extends Ss{handlers=It(new Map);data;get meta(){return Xs.meta}constructor(e){super(e),this.data=It(Xs.default_hotkeys)}listen(e){this.listen_cursor_hotkey(e),this.listen_uncursor_hotkey(e),this.listen_cvx(e)}listen_cursor_hotkey(e){const t=this;e.addEventListener("keydown",e=>{const n=t.stats.mode,i=e.key.toLowerCase(),r=document.activeElement;let s=!1;if(n===z.edit&&r!==document.body){for(let[n,i]of Ws){let r=t.data[n];r.cursor&&(t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),s=!0,i.bind(t)(e)))}for(let[n,i]of t.handlers){let r=t.data[n];r.cursor&&(t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),s=!0,i(e)))}if(!s&&"tab"===i){s=!0;const{cursor:t,courier:n,history:i}=this,{cube_end:r,cube_start:o,offset_start:a,offset_end:l,has_selection:c,cube_selection:d}=t,h=n.get_recorder();if(!d||!r||!o)return;e.preventDefault(),c&&h.tell(d,Rs.delete(d.id,"backward",o.id,r.id,a,l,!0));const u=o.text,p=u.slice(0,a)+"\t"+u.slice(a),f=xa.reset(o.id,p),m=Ls.loc(o.id,a+1,o.id,l);h.tell(o,f,m),i.record(h)}}})}listen_uncursor_hotkey(e){const t=this;document.documentElement.addEventListener("keydown",e=>{const n=t.stats.mode,i=document.activeElement,r=[P.down,P.left,P.right,P.up],s=e.key.toLowerCase();this.root;let o=!1;if(this.cursor.cube_end||i===document.body){for(let[n,i]of Ws){let r=t.data[n];r.cursor||t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),o=!0,i.bind(t)(e))}for(let[n,i]of t.handlers){let r=t.data[n];r.cursor||t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),o=!0,i(e))}}o||i!==document.body||n!==z.edit||(" "===s?this.listen_map_space(e):"backspace"===s||"delete"===s?this.listen_map_delete(e):"enter"===s?this.listen_map_enter(e):"tab"===s?this.listen_map_tab(e):r.includes(s)&&this.listen_map_nav(e))})}listen_map_nav(e){const t=this.root,i=e.key.toLowerCase(),r=this.cubes.get_types_cube(n.submap),s=[P.down,P.left,P.right,P.up];if(t instanceof wd&&t.get_nodes_selected().size>0)s.includes(i)&&t.move_select(i);else for(let[e,t]of r)t.move_select(i)}listen_map_delete(e){const{courier:t,history:i}=this,r=t.get_recorder();if(this.root instanceof wd){const e=[...this.root.get_nodes_selected()].map(e=>e.id);r.tell(this.root,Bs.node_remove(this.root.id,e))}const s=this.cubes.get_types_cube(n.submap);for(let[e,t]of s){const e=[...t.get_nodes_selected()].map(e=>e.id);r.tell(t,Bs.node_remove(t.id,e))}i.record(r)}listen_map_enter(e){const{courier:t,history:i}=this,r=t.get_recorder();let s=!1;if(this.root instanceof wd){const t=this.root.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){s=!0;continue}let i=n.id;e.shiftKey&&(i=n.env.prev_node?.id||null);const o=Is.append_child(t.id,i);r.tell(t,o)}}const o=this.cubes.get_types_cube(n.submap);for(let[t,n]of o){const t=n.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){s=!0;continue}let i=n.id;e.shiftKey&&(i=n.env.prev_node?.id||null);const o=Is.append_child(t.id,i);r.tell(t,o)}}s&&Cs.tips?.tip_warning("无法在没有布局上游的节点添加同级"),i.record(r)}listen_map_tab(e){e.preventDefault();const{courier:t,history:i}=this,r=t.get_recorder();if(this.root instanceof wd){const e=this.root.get_nodes_selected();for(let t of e){const e=Is.append_child(t.id);r.tell(t,e)}}const s=this.cubes.get_types_cube(n.submap);for(let[e,t]of s){const e=t.get_nodes_selected();for(let t of e){const e=Is.append_child(t.id);r.tell(t,e)}}i.record(r)}listen_map_space(e){const t=this.root;if(e.preventDefault(),t instanceof wd){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}const i=t.cubes.get_types_cube(n.submap);for(let[e,t]of i){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}}listen_cvx(e){let t=e;this.root instanceof wd&&(t=document.documentElement),t.addEventListener("paste",async e=>{const t=e.clipboardData,{cursor:n}=this,{cube_end:i}=n;if(i instanceof Sa&&t){e.preventDefault();const n=await this.clipboard.paste(t);this.history.record(n)}}),t.addEventListener("copy",e=>{const t=e.clipboardData,{doc:n,hotkeys:i,cursor:r}=this;t&&(this.root.scope_count_normal>0||r.has_selection||r.cube_end instanceof Sa)&&(e.preventDefault(),this.clipboard.copy(t))}),t.addEventListener("cut",e=>{const t=e.clipboardData,{root:n,cursor:i}=this;t&&(n.scope_count_normal>0||i.cube_end instanceof Sa)&&(e.preventDefault(),this.clipboard.cut(t))})}register(e,t){this.data[t.name]=t,this.handlers.set(t.name,e)}reset(e){Object.assign(this.data,e)}reset_handler(e,t){this.handlers.set(e,t)}export(){return structuredClone(Vt(this.data))}update_data(...e){return{}}validate(e,t){return t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&t.ctrl===e.ctrlKey&&(0===t.key.length||t.key.includes(e.key.toLocaleLowerCase()))}which(e){for(let t of Object.values(this.data))if(this.validate(e,t))return t}validate_hotkeys(e){for(let t of Object.values(this.data))if(this.validate(e,t))return!0;return!1}get_hotkey_str(e){const t=this.data[e];if(!t)return"";let n="";return t.meta&&(n+="meta + "),t.ctrl&&(n+="ctrl + "),t.alt&&(n+="alt + "),t.shift&&(n+="shift + "),n+=t.key,n}clear_scope(e){e.preventDefault(),this.root.clear_scope(!1)}clear_css(e){e.preventDefault();const{cursor:t}=this;this.root.painter.clear()}bold(e){e.preventDefault(),this.root.painter.paint({"font-weight":"700"},!0)}unindent_line(e){e.preventDefault(),this.root.painter.unindent()}indent_line(e){e.preventDefault(),this.root.painter.indent()}undo(e){e.preventDefault(),this.root.history.undo()}redo(e){e.preventDefault(),this.root.history.redo()}cursor_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;if(!t)return;if(!n.range)return;e.preventDefault();const i=[P.down,P.end,P.home,P.left,P.right,P.up],r=e.key.toLocaleLowerCase();if(i.includes(r)){if(this.event.emit_cursor_nav_before(e).some(e=>!1===e))return}r===P.left?n.move_left():r===P.right?n.move_right():r===P.up?n.move_up():r===P.down?n.move_down():r===P.home?n.move_home():r===P.end&&n.move_end(),this.event.emit_cursor_nav_after(e)}cursor_extend_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;t&&n.cube_end instanceof Sa&&(e.preventDefault(),e.key.toLocaleLowerCase()===P.left?n.extend_left():e.key.toLocaleLowerCase()===P.right?n.extend_right():e.key.toLocaleLowerCase()===P.up?n.extend_up():e.key.toLocaleLowerCase()===P.down?n.extend_down():e.key.toLocaleLowerCase()===P.home?n.extend_home():e.key.toLocaleLowerCase()===P.end&&n.extend_end())}text_break(e){const{courier:t,cursor:n,history:i,doc:r}=this;if(n.has_selection)return;e.preventDefault();const s=new Os(t),{cube_end:o,cube_start:a,cube_selection:l,offset_end:c,offset_start:d}=n;if(o){if(o instanceof Sa){const e=o.text.slice(0,c)+"\n"+o.text.slice(c),t=o.id,n=xa.reset(t,e),i=Ls.loc(t,c+2,t,c);s.tell(o,n,i)}i.record(s)}}break(e){if(this.event.emit_enter_before(e).some(e=>"stop"===e))return;if(!this.cursor.get_focus_line())return;e.preventDefault();const{courier:t,history:n,cursor:i,doc:r}=this,{cube_end:s,cube_start:o,cube_selection:a,offset_end:l,offset_start:c}=i;if(!a||!s||!o)return;const d=new Os(t),h=o.id,u=s.id;i.has_selection&&d.tell(a,Rs.delete(a.id,"backward",h,u,c,l,!0)),d.tell(o,xa.break(o.id,c)),n.record(d),this.event.emit_enter_after(e)}async break_root(e){const{cursor:t,courier:n,history:i}=this,{cube_end:r,offset_end:s}=t;if(!r)return;const o=r.find_upstream_target(e=>e instanceof $l);if(!o)return;const a=r.find_upstream_untill(o);if(!a)return;const l=[],c=a.index,d=o.children.slice(c);for(let e of d)l.push(e.export());const h=$l.get_default(l),u=n.get_recorder(),p=o.pcube;u.tell(p,Rs.insert_child(p.id,[h],o.index+1)),u.tell(o,Rs.delete_child(o.id,"backward",[c,o.child_count])),r instanceof Sa&&(await yn(),r.set_cursor_in_head(s)),i.record(u)}text_partition(e){const{cursor:t,history:n,courier:i}=this,r=Cs.tips,{cube_selection:s,offset_end:o,offset_start:a}=t;if(!(s instanceof Sa))return r?.tip_warning("选区必须在一个文本块内");const l=i.get_recorder(),c=s.id;l.tell(s,Rs.partition(c,c,c,a,o)),n.record(l)}add_scope(e){this.root.add_scope()}underline(e){const{cursor:t,courier:n,history:i}=this,{cube_selection:r,cube_end:s,cube_start:o,offset_start:a,offset_end:l}=t,c=new Os(n);if(!r||!o||!s)return;c.tell(r,Rs.set_selection_css(r.id,{"text-decoration-line":"underline"},o.id,s.id,a,l,!0)),i.record(c)}copy_format(e){const{root:t}=this;e.preventDefault(),t.painter.copy_format()}apply_format(e){const{root:t}=this;e.preventDefault(),t.painter.apply_format_brush()}italic(e){e.preventDefault(),this.painter.paint({"font-style":"italic"},!0)}align_left(e){e.preventDefault(),this.painter.paint({"text-align":"left"},!0)}align_center(e){e.preventDefault(),this.painter.paint({"text-align":"center"},!0)}align_right(e){e.preventDefault(),this.painter.paint({"text-align":"right"},!0)}next_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:i}=t;if(!i)return;const r=i.find_upstream_target(e=>e instanceof $l);if(!r)return;const s=r.pcube,o=new Os(this.courier),a=$l.get_default();o.tell(s,Rs.insert_child(s.id,[a],r.index+1)),n.record(o)}prev_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:i}=t;if(!i)return;const r=i.find_upstream_target(e=>e instanceof $l);if(!r)return;const s=r.pcube,o=new Os(this.courier),a=$l.get_default();o.tell(s,Rs.insert_child(s.id,[a],r.index)),n.record(o)}add_annotation(e){e.preventDefault();const t=Cs.tips,{cursor:n,courier:i,history:r}=this,{cube_selection:s,cube_start:o,cube_end:a,offset_end:l,offset_start:c}=n,d=new Os(i);if(!s||!o||!a)return t?.tip_warning("未发现光标或选区");const h=o.id,u=a.id,p=da.get_default();if(n.has_selection)if(s instanceof Sa)if(d.tell(s,Rs.partition(s.id,h,u,c,l)),0===c){if(s.postil?.has_annotation)return t?.tip_warning("已添加批注"),d;d.tell(s,Rs.postil_add(s.id,[p])),d.tell(s,Ls.loc(s.id,l,s.id,l))}else{const e=s.next_cube;if(e instanceof Sa){if(e.postil?.has_annotation)return t?.tip_warning("已添加批注"),d;d.tell(e,Rs.postil_add(e.id,[p])),d.tell(e,Ls.loc(e.id,e.len,e.id,e.len))}}else t?.tip_warning("选区跨越多个文本块");else a instanceof Sa&&(d.merge(a.add_annotation()),d.tell(a,Ls.loc(a.id,l,a.id,l)));r.record(d)}fold_block(e){e.preventDefault();const{cursor:t}=this,{cube_end:n,offset_end:i}=t;if(!n)return;let r,s=n;for(;!r;){let e=s.pcube;if(e instanceof ic||e instanceof $l)r=e;else if(e instanceof io)return;s=e}if(r){const e=r.child_first,t=n.find_upstream_untill(r)===e,s=this.courier.get_recorder(),o=!r.attrs.fold,a=Rs.set_attr(r.id,{fold:o});s.tell(r,a),t?s.tell(n,Ls.loc(n.id,i,n.id,i)):o&&e&&s.tell(e,Ls.in_tail(e.id)),this.history.record(s)}}static get meta(){return{type:t.hotkeys,version:1}}static get default_hotkeys(){return{[T["fold-block"]]:{name:T["fold-block"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["z"],cursor:!0,group:A.block},[T["text-partition"]]:{name:T["text-partition"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["x"],cursor:!0,group:A.text},[T["text-add-annotation"]]:{name:T["text-add-annotation"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["a"],cursor:!0,group:A.text},[T["scope-clear"]]:{name:T["scope-clear"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["c"],group:A.scope},[T["clear-css"]]:{name:T["clear-css"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:A.css},[T["root-add-prev"]]:{name:T["root-add-prev"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:A.block},[T["root-add-next"]]:{name:T["root-add-next"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:A.block},[T["text-align-left"]]:{name:T["text-align-left"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["l"],cursor:!0,group:A.common},[T["text-align-center"]]:{name:T["text-align-center"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["e"],cursor:!0,group:A.common},[T["text-align-right"]]:{name:T["text-align-right"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:A.common},[T["break-text"]]:{name:T["break-text"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:A.text},[T["break-line"]]:{name:T["break-line"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:A.core},[T["break-root"]]:{name:T["break-root"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["enter"],cursor:!0,group:A.block},[T["cursor-nav"]]:{name:T["cursor-nav"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,cursor:!0,key:[P.down,P.left,P.right,P.up,P.home,P.end],group:A.core},[T["cursor-nav-extend"]]:{name:T["cursor-nav-extend"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,cursor:!0,key:[P.down,P.left,P.right,P.up,P.home,P.end],group:A.core},[T.undo]:{name:T.undo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["z"],cursor:!1,group:A.common},[T.redo]:{name:T.redo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["y"],cursor:!1,group:A.common},[T["indent-line"]]:{name:T["indent-line"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:A.common},[T["unindent-line"]]:{name:T["unindent-line"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:A.common},[T["text-bold"]]:{name:T["text-bold"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["b"],cursor:!0,group:A.text},[T["scope-add"]]:{name:T["scope-add"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["s"],cursor:!1,group:A.scope},[T["text-underline"]]:{name:T["text-underline"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["u"],cursor:!0,group:A.text},[T["text-italic"]]:{name:T["text-italic"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["i"],cursor:!0,group:A.text},[T["format-brush-copy"]]:{name:T["format-brush-copy"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["c"],cursor:!0,group:A.common},[T["format-brush-apply"]]:{name:T["format-brush-apply"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["v"],cursor:!0,group:A.common}}}}Us([Ys(T["scope-clear"])],Xs.prototype,"clear_scope",null),Us([Ys(T["clear-css"])],Xs.prototype,"clear_css",null),Us([Ys(T["text-bold"])],Xs.prototype,"bold",null),Us([Ys(T["unindent-line"])],Xs.prototype,"unindent_line",null),Us([Ys(T["indent-line"])],Xs.prototype,"indent_line",null),Us([Ys(T.undo)],Xs.prototype,"undo",null),Us([Ys(T.redo)],Xs.prototype,"redo",null),Us([Ys(T["cursor-nav"])],Xs.prototype,"cursor_navigation",null),Us([Ys(T["cursor-nav-extend"])],Xs.prototype,"cursor_extend_navigation",null),Us([Ys(T["break-text"])],Xs.prototype,"text_break",null),Us([Ys(T["break-line"])],Xs.prototype,"break",null),Us([Ys(T["break-root"])],Xs.prototype,"break_root",null),Us([Ys(T["text-partition"])],Xs.prototype,"text_partition",null),Us([Ys(T["scope-add"])],Xs.prototype,"add_scope",null),Us([Ys(T["text-underline"])],Xs.prototype,"underline",null),Us([Ys(T["format-brush-copy"])],Xs.prototype,"copy_format",null),Us([Ys(T["format-brush-apply"])],Xs.prototype,"apply_format",null),Us([Ys(T["text-italic"])],Xs.prototype,"italic",null),Us([Ys(T["text-align-left"])],Xs.prototype,"align_left",null),Us([Ys(T["text-align-center"])],Xs.prototype,"align_center",null),Us([Ys(T["text-align-right"])],Xs.prototype,"align_right",null),Us([Ys(T["root-add-next"])],Xs.prototype,"next_root",null),Us([Ys(T["root-add-prev"])],Xs.prototype,"prev_root",null),Us([Ys(T["text-add-annotation"])],Xs.prototype,"add_annotation",null),Us([Ys(T["fold-block"])],Xs.prototype,"fold_block",null);class Ks extends Ss{_count_word=Kt(0);_active_root_index=Kt(0);_anchor_root_id=Kt("");_mode=Kt(z.read);_view=Kt("doc");_in_composition_mode=Kt(!1);_in_recording=Kt(!1);_showing=Kt(!1);view_point=It({x:0,y:0});get view(){return this._view.value}set view(e){this._view.value=e}get is_doc_view(){return"doc"===this.view}get is_map_view(){return"map"===this.view}get mode_name(){return{[z.edit]:"编辑模式",[z.read]:"阅读模式",[z.export]:"导出模式"}[this.mode]}get showing(){return this._showing.value}set showing(e){this._showing.value=e,this.event.emit_status_update()}get is_recording(){return this._in_recording.value}set is_recording(e){this._in_recording.value=e,this.event.emit_status_update()}get len_undo(){return this.history.len_undo}get len_redo(){return this.history.len_redo}get is_read_mode(){return this._mode.value===z.read}get is_edit_mode(){return this._mode.value===z.edit}get in_composition_mode(){return this._in_composition_mode.value}set in_composition_mode(e){this._in_composition_mode.value=e,this.event.emit_status_update()}get mode(){return this._mode.value}set mode(e){const t=this.mode;this._mode.value=e,t!==e&&this.event.emit_status_update()}get anchor_root_id(){return this._anchor_root_id.value}set anchor_root_id(e){this._anchor_root_id.value=e,this.event.emit_status_update()}get anchor_root(){return this.root instanceof Vl?this.root.children.find(e=>e.id===this.anchor_root_id):this.root.find_cube(this.anchor_root_id)}get count_root(){return this.root.child_count}get count_word(){return this._count_word.value}get active_root(){return this.root.children[this.active_root_index-1]}get active_root_index(){return this._active_root_index.value}set active_root_index(e){this._active_root_index.value=e,this.event.emit_status_update()}get count_scope(){return this.root.scope.size}get count_scope_freeze(){return this.root.scope_count_freeze}get count_scope_normal(){return this.root.scope_count_normal}get meta(){return Ks.meta}constructor(e){super(e)}update_count_word(e){this._count_word.value+=e,this.event.emit_status_update()}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.stats,version:1}}}class Js extends Ss{_listener=new Map;_updating_status=!1;get meta(){return Js.meta}constructor(e){super(e),this._listen()}_listen(){document.documentElement.addEventListener("keyup",e=>{"Escape"===e.key&&this.emit_esc()}),document.addEventListener("selectionchange",e=>{this.emit_selection_change(e)})}on(e,t){const n=this._listener.get(e);n?n.add(t):this._listener.set(e,new Set([t]))}emit(e,...t){const n=this._listener.get(e);if(!n)return[];const i=[];for(let e of n)i.push(e(...t));return i}off(e){for(let[t,n]of this._listener)for(let t of n)e===t&&n.delete(t)}on_asset_save(e){const t=Cs.tips,n=this._listener.get(M["asset-save"]);n?(n.clear(),t?.tip_info("唯一事件-资源保存:回调已覆盖"),n.add(e)):this._listener.set(M["asset-save"],new Set([e]))}async emit_asset_save(e,t,n){const i=Cs.tips,r=this._listener.get(M["asset-save"]);if(!r)return i?.tip_warning("未注册保存函数"),!1;const s=[...r][0];return!!s&&await s(e,t,n)}on_asset_download(e){const t=Cs.tips,n=this._listener.get(M["asset-download"]);n?(n.clear(),t?.tip_info("唯一事件-资源下载:回调已覆盖"),n.add(e)):this._listener.set(M["asset-download"],new Set([e]))}async emit_asset_download(e,t){const n=Cs.tips,i=this._listener.get(M["asset-download"]);if(!i)return n?.tip_warning("未注册保存函数"),!1;const r=[...i][0];return!!r&&await r(e,t)}on_asset_copy(e){const t=Cs.tips,n=this._listener.get(M["asset-copy"]);n?(n.clear(),t?.tip_info("唯一事件-资源复制:回调已覆盖"),n.add(e)):this._listener.set(M["asset-copy"],new Set([e]))}async emit_asset_copy(e,t,n){const i=Cs.tips,r=this._listener.get(M["asset-copy"]);if(!r)return i?.tip_warning("未注册保存函数"),!1;const s=[...r][0];return!!s&&await s(e,t,n)}emit_replace_id(e,t){const n=this._listener.get(M["replace-id"]);if(!n)return!1;for(let i of n)i(e,t)}on_replace_id(e){const t=this._listener.get(M["replace-id"]);t?t.add(e):this._listener.set(M["replace-id"],new Set([e]))}emit_edit_before(e,t){const n=this._listener.get(M["edit-before"]);if(!n)return!1;for(let i of n)i(e,t)}on_edit_before(e){const t=this._listener.get(M["edit-before"]);t?t.add(e):this._listener.set(M["edit-before"],new Set([e]))}emit_edit_after(e,t){const n=this._listener.get(M["edit-after"]);if(!n)return!1;for(let i of n)i(e,t)}on_edit_after(e){const t=this._listener.get(M["edit-after"]);t?t.add(e):this._listener.set(M["edit-after"],new Set([e]))}emit_text_merge(e,t){const n=this._listener.get(M["text-merge"]);if(!n)return!1;for(let i of n)i(e,t)}on_text_merge(e){const t=this._listener.get(M["text-merge"]);t?t.add(e):this._listener.set(M["text-merge"],new Set([e]))}on_esc(e){const t=this._listener.get(M.esc);t?t.add(e):this._listener.set(M.esc,new Set([e]))}emit_esc(){const e=this._listener.get(M.esc);if(!e)return!1;for(let t of e)t()}on_selection_change(e){this.on(M["selection-change"],e)}emit_selection_change(e){this.emit(M["selection-change"],e)}emit_cursor_nav_before(e){return this.emit(M["cursor-nav-before"],e)}on_cursor_nav_before(e){this.on(M["cursor-nav-before"],e)}emit_cursor_nav_after(e){return this.emit(M["cursor-nav-after"],e)}on_cursor_nav_after(e){this.on(M["cursor-nav-after"],e)}on_enter_before(e){this.on(M["enter-before"],e)}emit_enter_before(e){return this.emit(M["enter-before"],e)}on_enter_after(e){this.on(M["enter-after"],e)}emit_enter_after(e){return this.emit(M["enter-after"],e)}on_show_cube_editor(e){this.on(M["show-cube-editor"],e)}emit_show_cube_editor(e){return this.emit(M["show-cube-editor"],e)}on_text_link_edit(e){this.on(M["text-link-edit"],e)}emit_text_link_edit(e){return this.emit(M["text-link-edit"],e)}on_note_input_before(e){return this.on(M["note-input-before"],e)}emit_note_input_before(e){return this.emit(M["note-input-before"],e)}on_note_compositionend_before(e){return this.on(M["note-input-compositionend-before"],e)}emit_note_compositionend_before(e){return this.emit(M["note-input-compositionend-before"],e)}on_note_compositionend(e){return this.on(M["note-input-compositionend"],e)}emit_note_compositionend(e){return this.emit(M["note-input-compositionend"],e)}on_note_compositionupdate(e){return this.on(M["note-input-compositionupdate"],e)}emit_note_compositionupdate(e){return this.emit(M["note-input-compositionupdate"],e)}on_status_update(e){return this.on(M["status-update"],e)}emit_status_update(){this._updating_status||(this._updating_status=!0,Promise.resolve().then(()=>{const{root:e}=this,t=e,n={mode:this.stats.mode,count_word:this.stats.count_word,count_scope_normal:this.stats.count_scope_normal,count_scope_all:this.root.scope.size,count_stack_redo:this.history.len_redo,count_stack_undo:this.history.len_undo,count_root:this.stats.count_root,active_root_index:this.stats.active_root_index,anchor_root_id:this.stats.anchor_root_id,note_recording:this.stats.is_recording,note_composition_input:this.stats.in_composition_mode,note_showing:this.stats.showing,map_matrix:{...t.matrix2d}};this.emit(M["status-update"],n),this._updating_status=!1}))}on_node_status_click(e){return this.on(M["node-status-clicked"],e)}emit_node_status_click(e,t){return this.emit(M["node-status-clicked"],e,t)}on_fig_click(e){return this.on(M["fig-click"],e)}emit_fig_click(e){return this.emit(M["fig-click"],e)}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.event,version:1}}}class Qs extends Ss{_format_brush=null;get meta(){return Qs.meta}get format_brush(){const e={};return this._format_brush&&Object.assign(e,this._format_brush),e}constructor(e){super(e)}paint(e,t=!1){const{root:n,cursor:i,history:r,courier:s}=this,o=new Os(s);if(!e)return;const a=structuredClone(Vt(e));if(a["text-align"]){const t=e["text-align"];o.merge(this.text_align(t)),delete a["text-align"]}if(n.scope_count_normal>0){const e=n.get_scope_cubes();for(let n of e){const e=n.cube;for(let i of e.children.slice(...n.range))o.tell(i,Rs.set_css(i.id,structuredClone(a),t))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:l}=i;if(!e||!n||!r)return;const c=Rs.set_selection_css(e.id,a,n.id,r.id,s,l,t);o.tell(e,c)}r.record(o)}clear(){const{root:e,cursor:t,history:n,courier:i}=this,r=new Os(i),s={};if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range))r.tell(n,Rs.set_css(n.id,structuredClone(s),!1,!0))}}else{const{cube_selection:e,cube_start:n,cube_end:i,offset_start:o,offset_end:a}=t;if(!e||!n||!i)return;const l=Rs.set_selection_css(e.id,s,n.id,i.id,o,a,!1,!0);r.tell(e,l)}n.record(r)}text_align(e){const{root:t,cursor:n,history:i,courier:r}=this,s=new Os(r),o={"text-align":e};if(t.scope_count_normal>0){const e=t.get_scope_cubes();for(let t of e){const e=t.cube;for(let n of e.children.slice(...t.range))s.tell(n,Rs.set_css(n.id,structuredClone(o)))}}else{const e=t.cursor.find_selection_lines();for(let t of e){const e=Rs.set_css(t.id,structuredClone(o));s.tell(t,e)}}return s}indent(){const{root:e,cursor:t,history:n,courier:i,config:r}=this,s=new Os(i);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range)){const e=n.attrs.indent>0?n.attrs.indent+1:1;s.tell(n,Rs.set_attr(n.id,{indent:e}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0,n=e>0?e+1:1;s.tell(t,Rs.set_attr(t.id,{indent:n}))}}n.record(s)}unindent(){const{root:e,cursor:t,history:n,courier:i}=this,r=new Os(i);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube.children.slice(...e.range);for(let e of t){let t=e.attrs.indent;t>0&&r.tell(e,Rs.set_attr(e.id,{indent:t-1}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0;e>0&&r.tell(t,Rs.set_attr(t.id,{indent:e-1}))}}n.record(r)}copy_format(){const{root:e,cursor:t}=this;if(e.scope_count_normal>0){const t=[...e.scope_normal][0].focus_cube;this._format_brush=structuredClone(Vt(t.css))}else{const{cube_focus:e}=t;if(!e)return;this._format_brush=structuredClone(Vt(e.css))}}apply_format_brush(){const e=this._format_brush;if(!e)return;const{root:t,courier:n,history:i}=this,r=new Os(n);if(t.scope_count_normal>0){const n=t.get_scope_cubes();for(let t of n)for(let n of t.cube.children.slice(...t.range)){const t=Rs.set_css(n.id,e,!1,!0);r.tell(n,t)}}else{const{cube_selection:e,cube_end:t,cube_start:n,offset_start:i,offset_end:s}=this.cursor;if(!e||!t||!n)return;const o=Rs.set_selection_css(e.id,this.format_brush,n.id,t.id,i,s,!1,!0);r.tell(e,o)}i.record(r)}static get meta(){return{type:t.painter,version:1}}}class Zs extends Ss{_copy_data=[];_img_mime=["image/png","image/jpeg","image/gif"];_paste_stack=[];get pasted_from(){return this._paste_stack[this._paste_stack.length-1]}get copy_data(){return[...this._copy_data]}get pasting(){return this._paste_stack.length>0}get meta(){return Zs.meta}constructor(e){super(e)}async copy(e){const{root:t,cursor:n}=this;return t.scope_count_normal>0?this.copy_scope(e):this.copy_selection(e)}async copy_selection(e){const{root:t,cursor:i}=this;if(i.has_selection){this._copy_data=i.find_inline_data();let n=i.get_selection_text();const r={noteid:t.id,versions:zs.export_versions(),cubedata:this._copy_data},s=JSON.stringify(r);return e.setData("application/json",s),e.setData("text/plain",n),!0}{const{cube_end:r}=i;if(!r)return!1;const s=[r.export()];this._copy_data=s;let o="";for(let e of this._copy_data)e.type===n.text&&(o+=e.info);const a={noteid:t.id,versions:zs.export_versions(),cubedata:s},l=JSON.stringify(a);return e.setData("application/json",l),e.setData("text/plain",o),!0}}async copy_scope(e){const t=Cs.tips;if(0===this.root.scope.size)return t?.tip_info("无块选区,未复制内容"),!1;if(0===this.root.scope_count_normal)return t?.tip_info("无正常块选区,未复制内容"),!1;const n=this.root.get_scope_cubes();this.root.clear_scope();const i=[];let r="";for(let e of n){for(let t of e.cube.children.slice(...e.range))r+=t.text;i.push(...e.cube.copy(...e.range))}this._copy_data=i;const s={noteid:this.root.id,versions:zs.export_versions(),cubedata:this._copy_data},o=JSON.stringify(s);return e.setData("application/json",o),e.setData("text/plain",r),!0}set_clipboard_cubedata(e,t){const n={noteid:this.root.id,versions:zs.export_versions(),cubedata:t},i=JSON.stringify(n),r=(new TextEncoder).encode(i),s=JSON.stringify([...r]),o=new Blob([e],{type:"text/plain"}),a=new Blob([s],{type:"text/html"}),l=new ClipboardItem({[o.type]:o,[a.type]:a});return this.set_clipboard_data(l)}async paste(e){const{cursor:t,courier:n}=this,i=e.items,r=n.get_recorder();let s=[];r.merge(this.delete()),await yn();for(let e=0;e<i.length;e++){const t=i[e];if(t.type.startsWith("image")){const e=t.getAsFile();e&&s.push(e)}}if(s.length>0){for(let e of s){const t=await this.paste_img(e);r.merge(t)}return r}const o=e.getData("application/json");if(o){let e=!1;try{const t=JSON.parse(o);if(t&&t.cubedata&&t.noteid)return this._paste_stack.push(t),e=!0,r.merge(this.paste_cubes(t.versions||{},t.cubedata)),r}catch(e){}finally{e&&this._paste_stack.pop()}}const a=e.getData("text/html");if(a)try{const e=new DOMParser,t=e.parseFromString(a,"text/html").body.textContent.trim(),n=JSON.parse(t),i=new Uint8Array(n),s=(new TextDecoder).decode(i),o=JSON.parse(s);let l=!1;try{if(o&&o.cubedata&&o.noteid)return this._paste_stack.push(o),l=!0,r.merge(this.paste_cubes(o.versions,o.cubedata)),r}catch(e){}finally{l&&this._paste_stack.pop()}}catch(e){console.error("🟥paste",e)}const l=e.getData("text/plain");if(l){const e=this.get_cubedata_from_text(l);return r.merge(this.paste_cubes(this.root.cube_versions,e)),r}return r}get_cubedata_from_text(e){const t=e.replace("\r","").split("\n"),n=[];if(1===t.length){const e=Sa.get_default(t[0]);n.push(e)}else for(let e of t){if(!e.trim())continue;const t=Wl.get_default_by_string(e);n.push(t)}return n}paste_cubes(e,t){if(0===t.length)return;const{courier:n,history:i,cursor:r}=this,s=new Os(n),{cube_selection:o,cube_end:a,cube_start:l,offset_start:c,offset_end:d}=r;if(!o||!a||!l)return;r.has_selection&&s.tell(o,Rs.delete(o.id,"backward",l.id,a.id,c,d,!0));const h=Ts.replace_id(this.root,e,t);return s.tell(l,Rs.insert(l.id,h,l.id,l.id,c,c)),s}async paste_img(e){const{courier:t,history:n,cursor:i}=this,r=new Os(t),{cube_selection:s,cube_end:o,cube_start:a,offset_start:l,offset_end:c}=i;if(!s||!o||!a)return;const d=Yo.get_default();if(this.root.isdev)d.info=URL.createObjectURL(e),r.tell(o,Rs.insert(o.id,[d],a.id,o.id,l,c));else{const t=d.id+".png",n=t;await this.event.emit_asset_save("image",t,e);d.info=n,r.tell(o,Rs.insert(o.id,[d],a.id,o.id,l,c))}return r}delete(){const{root:e,courier:t,cursor:n}=this;return e.scope_count_normal>0?this.delete_scope():n.has_selection?this.delete_selection():void 0}delete_selection(){const{courier:e,cursor:t,history:n}=this,i=new Os(e),{cube_end:r,cube_start:s,cube_selection:o,offset_start:a,offset_end:l}=t;if(!o||!r||!s)return;const c=s.id,d=r.id,h=o.id,u=Rs.delete(h,"backward",c,d,a,l);return i.tell(o,u),i}delete_scope(){const e=Cs.tips,{root:t,courier:n,history:i,cursor:r}=this;if(0===t.scope.size)return void e?.tip_info("无块选区");if(0===t.scope_count_normal)return void e?.tip_info("无常规块选区");const s=new Os(n),o=this._root.get_scope_cubes(),a=new Map;for(let e of o){let t=a.get(e.cube);t?t.push(e.range):a.set(e.cube,[e.range])}const l=new Set;for(let[e,t]of a){const n=e.children;for(let e of t){const t=n.slice(e[0],e[1]);for(let e of t)l.add(e)}for(let e of l)s.merge(e.remove_self())}return this.root.clear_scope(),s}cut(e){const{root:t,courier:n,cursor:i}=this;t.scope_count_normal>0?this.cut_scope(e):this.cut_selection(e)}cut_scope(e){const{root:t,courier:i,history:r,cursor:s}=this,o=Cs.tips;if(0===t.scope.size)return o?.tip_info("无块选区"),!1;if(0===t.scope_count_normal)return o?.tip_info("无常规块选区"),!1;const a=new Os(i),l=this._root.get_scope_cubes(),c=new Map;for(let e of l){let t=c.get(e.cube);t?t.push(e.range):c.set(e.cube,[e.range])}const d=[];for(let[e,t]of c){const n=new Set;e.children;for(let i of t){const t=e.children.slice(i[0],i[1]);for(let e of t)n.add(e);d.push(...e.copy(...i))}for(let e of n)a.merge(e.remove_self())}this._copy_data=d;let h="";for(let e of this._copy_data)e.type===n.text&&(h+=e.info);const u={noteid:this.root.id,versions:zs.export_versions(),cubedata:d},p=JSON.stringify(u);e.setData("text/plain",h),e.setData("application/json",p),this.root.clear_scope(),r.record(a)}cut_selection(e){const{courier:t,cursor:i,history:r}=this,s=new Os(t),{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=i;if(l&&o&&a)if(i.has_selection){this._copy_data=i.find_inline_data();let t="";for(let e of this._copy_data)e.type===n.text&&(t+=e.info);const h={noteid:this.root.id,versions:zs.export_versions(),cubedata:this._copy_data},u=JSON.stringify(h);e.setData("text/plain",t),e.setData("application/json",u);const p=a.id,f=o.id,m=l.id,_=Rs.delete(m,"backward",p,f,c,d);s.tell(l,_),r.record(s)}else{const t=o.export();this._copy_data=[t];let i="";for(let e of this._copy_data)e.type===n.text&&(i+=e.info);const a={noteid:this.root.id,versions:zs.export_versions(),cubedata:this._copy_data},l=JSON.stringify(a);e.setData("text/plain",i),e.setData("application/json",l);const c=o.pcube,d=o.index,h=Rs.delete_child(c.id,"backward",[d,d+1]);s.tell(c,h),r.record(s)}}set_clipboard_data(e){return new Promise((t,n)=>{navigator.clipboard?navigator.clipboard.write([e]).then(e=>t(!0)).catch(e=>{t(!1),console.error("写入粘贴板数据失败",e)}):t(!1)})}read_clipboard(){return new Promise(e=>{navigator.clipboard?navigator.clipboard.read().then(async t=>{const n=new Map;for(let e of t)if(e instanceof ClipboardItem){const t=e.types;for(let i of t)await e.getType(i).then(async e=>n.set(e.type,e))}e(n)}):e(new Map)})}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.clipboard,version:1}}}class eo extends Ss{static config;cp=eo.default_config;data;get meta(){return eo.meta}get css_vars(){const e=this.data;return{"--text-transition":""+(e.text_transition?"0.5s":"none"),"--text-family":`${e.text_family}`,"--text-fontsize":`${e.text_fontsize||16}px`}}constructor(e){super(e),this.data=It(eo.default_config),eo.config=this.data,this.watch()}init(e){Object.assign(this.data,e),this.cp=structuredClone(Vt(this.data))}watch(){cr(()=>this.data.map_perf,(e,t)=>{if(e){this.root instanceof wd&&this.root.check_show();const e=this.root.cubes.get_types_cube(n.submap);for(let[t,n]of e)n.check_show()}else{this.root instanceof wd&&this.root.show_all();const e=this.root.cubes.get_types_cube(n.submap);for(let[t,n]of e)n.show_all()}})}export(){return structuredClone(Vt(this.data))}static get meta(){return{type:t.config,version:4}}static get default_config(){return{text_transition:!0,text_family:'"Comic Sans MS"',text_fontsize:16,code_theme:"dracula",line_indent:40,history_length:1/0,player_speed:150,revert_scope:!1,map_node_hgap:40,map_node_vgap:40,map_node_padding:8,map_node_exit_by_esc:!0,map_node_default_width:140,map_lod_scale:.5,map_scale_max:5,map_scale_min:.1,map_scale_step:.1,scroll_distance:20,map_linker_anchor_left:x.point,map_linker_anchor_right:x.arrow,map_linker_line:"bezier2",map_linker_stroke:"black",map_linker_stroke_width:2,map_perf:!0}}}class to extends Ss{selection;cursor_step=20;scroll_distance=50;safa_distance=20;get meta(){return to.meta}get has_selection(){return!this.selection.isCollapsed}get client_rect(){return this.range?.getBoundingClientRect()}get client_rects(){return this.range?.getClientRects()}get range(){if(0!==this.selection?.rangeCount)return this.selection?.getRangeAt(0)}get ranges(){const e=[];for(let t=0;t<this.selection.rangeCount;t++)e.push(this.selection.getRangeAt(0));return e}get offset_start(){return this.range?this.range?.startOffset:-1}get offset_end(){return this.range?this.range?.endOffset:-1}get node_start(){return this.range?.startContainer}get node_end(){return this.range?.endContainer}get node_focus(){return this.selection.focusNode}get node_anchor(){return this.selection.anchorNode}get top_edge(){return this.safa_distance}get bottom_edge(){return document.documentElement.clientHeight-this.safa_distance}get cube_selection(){if(!this.range)return;const e=this.range.commonAncestorContainer,t=this.stats.active_root;if(t){return this.get_node_cube(e,t)||this.get_node_cube(e,this.root)}return this.get_node_cube(e,this.root)}get cube_start(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.startContainer,i=this.get_node_cube(n,t);return i instanceof ro?i:void 0}get cube_end(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.endContainer,i=this.get_node_cube(n,t);return i instanceof ro?i:void 0}get cube_focus(){const e=this.cube_selection,t=this.node_focus;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof ro?n:void 0}get cube_anchor(){const e=this.cube_selection,t=this.node_anchor;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof ro?n:void 0}constructor(e){super(e);let t=window.getSelection();if(!t)throw Error("NoteCursor : can't find Selection API");this.selection=t}move_up_by_coor(){}locate_next_line(e,t,n){let i="up"===e?t.prev_line:t.next_line;const r=t.clientRect;let s=i?.clientRect;for(;i&&s&&r&&(s.left>=r.right||s.right<=r.left);){let t="up"===e?i.prev_line:i.next_line;if(!t)break;i=t,s=t.clientRect}if(!i)return;const o=[],a=new Map;for(let e of i.children)if(e instanceof Sa){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++)o.push(t[n]),a.set(t[n],e)}const l="up"===e?Es.MathRect.get_rect_point(n.left,Es._RectPosition.left_mid):Es.MathRect.get_rect_point(n.left,Es._RectPosition.right_mid),c=Es.MathRect.get_nearest_rect(l,o);if(!c)return;const d=Es.MathRect.get_shadow_point_horizental(l,c),h=document.caretPositionFromPoint(d.x,d.y);if(h&&h.offsetNode instanceof Text)this.set_cursor(h.offsetNode,h.offset);else if(h&&!(h.offsetNode instanceof Text)){const e=a.get(c);if(!e)return;e.set_cursor_in_tail()}}locate_current_line(e,t,n){const i=[],r=[],s=new Map;for(let e of t.children)if(e instanceof Sa){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++){const r=t[n];i.push(r),s.set(r,e)}}if(1===i.length)return!1;if("up"===e){const e=n.left.top;for(let t of i)t.bottom<=e&&r.push(t)}else if("down"===e){const e=n.right.bottom;for(let t of i)t.y>=e&&r.push(t)}if(r.length>0){const t="down"===e?{x:n.right.x,y:n.right.y}:{x:n.left.x,y:n.left.y},i=Es.MathRect.get_nearest_rect(t,r);if(!i)return!1;const o=Es.MathRect.get_shadow_point_horizental(t,i),a=document.caretPositionFromPoint(o.x,o.y);if(a&&a.offsetNode instanceof Text)return this.set_cursor(a.offsetNode,a.offset),!0;{const e=s.get(i);if(!e)return!1;e.set_cursor_in_tail()}}return!1}move_vertical(e){const{cube_start:t,cube_end:n}=this;if(!(t instanceof Sa&&n instanceof Sa))return;const i="up"===e?t.line:n.line,r=this.get_selection_edge_position();if(!i||!r)return;this.locate_current_line(e,i,r)||this.locate_next_line(e,i,r)}move_left(){if(!this.range)return;const{cube_start:e,offset_start:t,offset_end:n,node_end:i}=this,{doc:r,courier:s}=this,o=new Os(s);if(!(e instanceof Sa))return;if(this.has_selection)return this.set_cursor(this.range.startContainer,this.range.startOffset);if(e.drop_zero_width_space(t).pos>0)if(e.is_empty){let t=e.prev_cube_deep;t&&o.tell(t,Ls.in_tail(t.id))}else{const n=e.find_text_nav_pos(t,"left");i&&this.set_cursor(i,n)}else{const t=e.prev_cube_deep;t&&o.tell(t,Ls.in_tail(t.id))}}move_right(){if(!this.range)return;const{cube_end:e,offset_start:t,offset_end:n,node_end:i}=this,{doc:r,courier:s}=this,o=new Os(s);if(e instanceof Sa){if(this.has_selection)return this.set_cursor(this.range.endContainer,this.range.endOffset);if(n<e.drop_zero_width_space(n).len)if(e.is_empty){let t=e.next_cube_deep;t&&o.tell(t,Ls.in_head(t.id))}else{const t=e.find_text_nav_pos(n,"right");i&&this.set_cursor(i,t)}else{const t=e.next_cube_deep;t&&o.tell(t,Ls.in_head(t.id))}}}move_up(){this.move_vertical("up")}move_down(){return this.move_vertical("down")}move_end(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=this.range;if(!e)return;this.set_cursor(this.range.endContainer,this.range.endOffset);const s=this.range.getClientRects();if(0===s.length)return;const o=Es.MathRect.get_rect_point(s[s.length-1],Es._RectPosition.center);let a=Ts.get_client_rects(e.id);if(!a)return;let l=a.length,c=a[0],d=a[a.length-1],h=d;if(l>1){for(let e=0;e<l;e++){const t=a[e];if(Es.MathRect.is_point_in_rect(o,t)){h=t;break}}if(h!==d)return this.locate_cursor_on_rect(h,Es._RectPosition.right_mid)}let u=e.next_cube;if(!u)return this.locate_cursor_on_rect(h,Es._RectPosition.right_mid);for(a=Ts.get_client_rects(u.id);a;){if(l=a.length,c=a[0],c.x<h.right)return this.locate_cursor_on_rect(h,Es._RectPosition.right_mid);if(l>1)return this.locate_cursor_on_rect(c,Es._RectPosition.right_mid);if(u=u?.next_cube,!u)return this.locate_cursor_on_rect(c,Es._RectPosition.right_mid);a=Ts.get_client_rects(u.id)}}move_home(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=this.range;if(this.set_cursor(this.range.startContainer,this.range.startOffset),!e)return;const s=this.range.getClientRects();if(0===s.length)return;const o=Es.MathRect.get_rect_point(s[s.length-1],Es._RectPosition.center);let a=Ts.get_client_rects(e.id);if(!a)return;let l=a.length,c=a[0],d=a[a.length-1],h=c;if(l>1){for(let e=0;e<l;e++){const t=a[e];if(Es.MathRect.is_point_in_rect(o,t)){h=t;break}}if(h!==c)return this.locate_cursor_on_rect(h,Es._RectPosition.left_mid)}let u=e.prev_cube;if(!u)return this.locate_cursor_on_rect(h,Es._RectPosition.left_mid);for(a=Ts.get_client_rects(u.id);a;){if(l=a.length,d=a[a.length-1],d.right>h.left)return this.locate_cursor_on_rect(h,Es._RectPosition.left_mid);if(l>1)return this.locate_cursor_on_rect(d,Es._RectPosition.left_mid);if(u=u?.prev_cube,!u)return this.locate_cursor_on_rect(d,Es._RectPosition.left_mid);a=Ts.get_client_rects(u.id)}}extend_left(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_left(),yn(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_right(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_right(),yn(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_up(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_up();const u=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,u,p)}extend_down(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_down();const u=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,u,p)}extend_home(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_home();const u=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,u,p)}extend_end(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,h="number"==typeof a?a:i;this.set_cursor(d,h),this.move_end();const u=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,u,p)}is_contains_selection(e){const t=[];for(let e of this.ranges)t.push(e.commonAncestorContainer);for(let n of t){if(!this.get_node_cube(n,e))return!1}return!0}get_node_cube(e,t){let n=e instanceof Element?e:e.parentElement;const i=[];for(;n;){if(n.id){let e;if(i.push(n.id),e=(this.root,t.find_cube(n.id)),e)return e}n=n.parentElement}}get_focus_line(){const{cube_end:e}=this;if(e)return e instanceof Sa?e.line:void 0}set_cursor(e,t){if(!(e instanceof Text))throw Error("NoteCursor : curosr only be set in TextNode");let n=Math.min(e.length,t);this.selection?.setPosition(e,n),e.parentElement&&e.parentElement.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}locate_cursor_on_rect(e,t){let n=Es.MathRect.get_rect_point(e,t);const i=document.caretPositionFromPoint(n.x,n.y),r=window.getSelection();if(i&&r&&i.offsetNode instanceof Text)return r.setPosition(i.offsetNode,i.offset)}locate_cursor_by_coor(e,t){const{courier:n,history:i,root:r}=this,s=document.caretPositionFromPoint(e,t),o=s?.offsetNode,a=new Os(n);if(o){if(o instanceof Text)s.offsetNode instanceof Text&&(o.parentElement?.parentElement?.focus(),this.set_cursor(s.offsetNode,s.offset));else{const e=r.cursor.get_node_cube(o,r);if(e?.in_postil)return;const t=e?.pcube;if(!e||!t)return;const n=e.meta;e.next_cube;n.block||a.tell(e,Ls.in_head(e.id))}i.record(a)}}set_cursor_by_coor(e,t){if(t<=this.top_edge){let e=document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;Es.DomAnimation.scroll_element(document.documentElement,-this.scroll_distance,"vertical"),t+=n}else if(t>=this.bottom_edge){let e=document.documentElement.scrollHeight-document.documentElement.clientHeight-document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;Es.DomAnimation.scroll_element(document.documentElement,this.scroll_distance,"vertical"),t-=n}const n=document.caretPositionFromPoint(e,t);if(n&&n.offsetNode instanceof Text){this.set_cursor(n.offsetNode,n.offset);let e=this.get_selection_edge_position()?.right;if(!e)return;return e.y<=this.top_edge?window.scrollBy({top:-this.scroll_distance,behavior:"smooth"}):e.y>=this.bottom_edge&&window.scrollBy({top:this.scroll_distance,behavior:"smooth"}),n}}get_selection_edge_position(){if(!this.range)return;const e=this.range.getClientRects();if(0===e.length)return;const t=e[0],n=e[e.length-1];return{left:new DOMRect(t.x,t.y,0,t.height),right:new DOMRect(n.x,n.y,0,n.height)}}set_selection_between(e,t,n,i){this.selection.setBaseAndExtent(e,t,n,i)}get_selection_text(e=!0){const{cube_end:t,cube_start:n,offset_start:i,offset_end:r}=this;let s="";if(e&&!this.has_selection&&n instanceof Sa)return n.text;if(this.cube_selection instanceof Sa)return this.cube_selection.text.slice(i,r);{let e=!1,o=!1;const a=this.find_inline_cube();for(let l of a){for(let a of l){if(o)break;e||a!==n||(e=!0,a instanceof Sa&&(s+=a.text.slice(i))),o||a!==t||(o=!0,a instanceof Sa&&(s+=a.text.slice(0,r))),e&&!o&&a instanceof Sa&&a!==n&&a!==t&&(s+=a.text)}s+="\n"}}return s}find_cube_by_coor(e){const{x:t,y:n}=e,i=document.elementFromPoint(t,n);if(i)return this.get_node_cube(i,this.root)}find_selection_lines(){const e=[],{cube_selection:t,cube_start:n,cube_end:i}=this;if(t instanceof Sa){let e=t.line;if(e)return[e]}else{if(t instanceof Wl)return[t];if(n instanceof Sa&&i instanceof Sa){const t=n.line,r=i.line;if(t&&r){let n=t;for(;n&&(e.push(n),n!==r);)n=n.next_line}}}return e}find_inline_cube(){const e=[],{cube_start:t,cube_end:n,offset_start:i,offset_end:r}=this;if(!t||!n)return e;if(!(t instanceof Sa&&n instanceof Sa))return e;const s=this.find_selection_lines();if(0===s.length)return[];const o=s[0],a=s[s.length-1],l=t.index,c=n.index;if(1===s.length){const t=[];for(let e of o.children.slice(l,c+1))t.push(e);e.push(t)}else{let t=[];for(let e of o.children.slice(l))t.push(e);e.push(t),t=[];for(let n of s.slice(1,-1)){for(let e of n.children)t.push(e);e.push(t),t=[]}for(let e of a.children.slice(0,c+1))t.push(e);e.push(t)}return e}find_inline_data(){const e=[],t=this.find_inline_cube();if(0===t.length)return e;const n=t[0],i=t[t.length-1],r=n[0],s=i[i.length-1],{cube_start:o,cube_end:a,offset_start:l,offset_end:c}=this;if(!o||!a)return e;if(o===a){const t=o.export();t.info=t.info.slice(l,c),e.push(t)}else if(n===i){if(o instanceof Sa&&o===r){const t=o.export();t.info=t.info.slice(l),e.push(t)}for(let t of n.slice(1,-1))e.push(t.export());if(a instanceof Sa&&a===s){const t=a.export();t.info=t.info.slice(0,c),e.push(t)}}else{if(o instanceof Sa&&o===r){const t=o.export();t.info=t.info.slice(l),e.push(t)}e.push(...n.slice(1).map(e=>e.export()));for(let n of t.slice(1,-1)){const t=Wl.get_default(n.map(e=>e.export()));e.push(t)}const d=Wl.get_default(i.slice(0,-1).map(e=>e.export()));if(a instanceof Sa&&a===s){const e=a.export();e.info=e.info.slice(0,c),d.info.push(e)}e.push(d)}return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.cursor,version:1}}}class no extends Ss{command_group_do=[];command_group_undo=[];get meta(){return no.meta}execute_command_group(e){if(this.stats.mode===z.read)return;const t=(e,n,i)=>{n<i.length&&yn(()=>{this.pass(e),t(i[n+1],n+1,i)})};t(e[0],0,e)}constructor(e){super(e)}get_recorder(){return new Os(this)}pass(e){if(this.stats.mode===z.read)return;const t=e,n=e.id,i=this.root.find_cube(n);if(!i)return console.error("未发现cube:",n);console.log("🟡",i,e);const r=new Os(this);let s=i.on(t);return s instanceof Os&&r.merge(s),r}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.courier,version:1}}}class io extends js{_scopes=Bt(new Set);_dom;_children=Bt([]);_courier;_history;_cursor;_config;_clipboard;_painter;_event;_stats;_hotkeys;_cubes;_listener;_isdev=!1;constructor(){super(),this._cubes=new Vs(this),this._hotkeys=new Xs(this),this._config=new eo(this),this._cursor=new to(this),this._courier=new no(this),this._history=new Ns(this),this._clipboard=new Zs(this),this._painter=new Qs(this),this._event=new Js(this),this._stats=new Ks(this),this._listener=new Gs(this),Promise.resolve().then(()=>this._cubes.add_cube(this)),this.set_cmd_handler(i.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(i.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(i.cube_insert_child,this.on_insert_cube.bind(this)),this.set_cmd_handler(i.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(i.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(i.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(o.cursor_in_tail,this.on_cursor_in_tail.bind(this)),Hs.init_cmd_handler(this)}get editable(){return!0}get config(){return this._config}get hotkeys(){return this._hotkeys}get stats(){return this._stats}get cubes(){return this._cubes}get cursor(){return this._cursor}get listener(){return this._listener}get courier(){return this._courier}get history(){return this._history}get clipboard(){return this._clipboard}get painter(){return this._painter}get event(){return this._event}get root(){return this}get isdev(){return this._isdev}get dom(){return document.getElementById(this.id)}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get pid(){}get index(){return 0}get css(){return Object.assign({},this.data.css)}get attrs(){return Object.assign({},this.data.attrs)}get info(){return this.data.info}get child_count(){return this._children.length}get child_first(){return this._children[0]}get child_last(){return this._children[this._children.length-1]}get id(){return this.data.id}get pcube(){}get type(){return this.data.type}get versions(){return Object.assign({},this.data.versions)}get level(){return 0}get in_postil(){return!1}get host_postil(){return null}get next_cube_deep(){}get prev_cube_deep(){}get root_dom(){return this._dom}get is_empty(){const e=1===this.child_count,t=this.child_first.is_empty;return e&&t}get prev_cube(){}get next_cube(){}get host_node(){}get cube_versions(){return zs.export_versions()}get scope(){return new Set([...this._scopes])}get scope_normal(){const e=new Set;for(let t of this.scope)t.freeze||e.add(t);return e}get scope_freeze(){const e=new Set;for(let t of this.scope)t.freeze&&e.add(t);return e}get scope_count_normal(){return this._scopes.size-this.scope_count_freeze}get scope_count_freeze(){let e=0;for(let t of this.scope)t.freeze&&e++;return e}set_dev(e=!0){this._isdev=e,window.root=this}find_child_cube(e){return this._children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}is_contains_cube(e){return!!e&&e.root===this}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}copy(e,t){const n=this._children.slice(e,t),i=[];for(let e of n){let t=e.export();i.push(t)}return i}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_upstream_untill(){}add_scope_by_cube(e){const t=new $s(this,e);this._scopes.add(t),this.event.emit_status_update()}add_scope(e=!1){if(e){const e=this.cursor.cube_end;if(!e||e instanceof io)return Cs.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(e)}else{const e=this.stats.view_point,t=this.cursor.find_cube_by_coor(e);if(!t||t instanceof io)return Cs.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(t)}}remove_scope(e){for(let t of this._scopes)if(t.id===e){this._scopes.delete(t);break}}clear_scope(e=!0){for(let t of this._scopes)e&&t.freeze||this._scopes.delete(t)}freeze_scopes(){for(let e of this._scopes)e.freeze=!0}sort_scope(){const e=[...this._scopes];return e.sort((e,t)=>e.pos.y-t.pos.y),e}get_scope_cubes(e=!1,t=!0){if(0===this._scopes.size)return[];const n=[],i=e?this.sort_scope():this.scope;for(let e of i)t&&e.freeze||n.push(e.get_scope_info());return n}get_scope_cubes_data(){const e=this.get_scope_cubes(),t=[];for(let n of e)t.push(...n.cube.copy(n.range[0],n.range[1]));return t}delete_edge(e,t){const{courier:n}=this,i=new Os(n);if("backward"===t){const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.prev_cube_deep;if(n&&n.is_empty)return n.remove_self();const r=n?.next_cube;if(r&&n.type===r.type)return r.merge("left");if(n)return i.tell(n,Ls.in_tail(n.id))}else{const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.next_cube_deep;if(n&&n.is_empty)return n.remove_self();const r=n?.prev_cube;if(r&&n.type===r.type)return n.merge("left");if(n)return i.tell(n,Ls.in_tail(n.id))}}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return{children:i,data:r}}get_sdk_version(){return zs.get_sdk_meta()}on_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=this.export().info,s=Ts.build_cubes(n,this);return this.splice(0,this.child_count,...s),i.add_recover(Rs.reset(this.id,r)),i}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new Os(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Rs.reorder(this.id,o.id,c)),a}on_insert_cube(e){const{courier:t}=this,i=t.get_recorder();i.add_cmd(e);const{pos:r,data:s}=e;if(0===s.length)return i;const o=[];for(let e of s)e.type===n.box_root&&o.push(new $l(e,this));let a=this.get_valid_index(r);this.splice(a,0,...o);const l=o[o.length-1];return l&&i.tell(l,Ls.in_tail(l.id)),i.add_recover(Rs.delete_child(this.id,"backward",[a,a+o.length])),i}on_delete_cube(e){const{courier:t,pcube:n,pid:i}=this,{dir:r,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],h=a-o;if(o!==a){if(o<=0&&a>=this.child_count){const e=this.child_first;return this.child_count>1&&l.tell(this,Rs.delete_child(this.id,r,[1,this.child_count])),e.is_empty||l.tell(e,Rs.reset(e.id,[])),l}{let e=this.splice(o,h);c&&"backward"===r||!d?l.tell(c,Ls.in_tail(c.id)):(d&&"forward"===r||!c)&&l.tell(d,Ls.in_head(d.id));const t=e.data;l.add_recover(Rs.insert_child(this.id,t,o))}return l}}on_cube_set_selection_css(e){const{cursor:t,courier:n,pcube:i,pid:r}=this,{css:s,start_id:o,end_id:a,offset_end:l,offset_start:c}=e,d=new Os(n);if(o!==a||l!==c){if(a&&!o){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)d.tell(e,Rs.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d.tell(t,Rs.set_selection_css(t.id,s,null,a,"head",l)),d}if(o&&!a){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)d.tell(e,Rs.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d.tell(t,Rs.set_selection_css(t.id,s,o,null,c,"tail")),d}if("tail"===l&&"head"===c){for(let e of this.children)d.tell(e,Rs.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d}if(a&&o){const e=this.find_cube(o),t=this.find_cube(a),n=e?.find_upstream_untill(this),i=t?.find_upstream_untill(this);if(!n||!i)return;const r=this.children.slice(n.index+1,i.index);for(let e of r)d.tell(e,Rs.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d.tell(n,Rs.set_selection_css(n.id,s,o,null,c,"tail")),d.tell(i,Rs.set_selection_css(i.id,s,null,a,"head",l)),d}}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i,pcube:r}=this,s=new Os(t),{data:o,end_id:a,start_id:l,offset_end:c,offset_start:d}=e,h=this.find_cube(l),u=this.find_cube(a),p=h?.find_upstream_untill(this),f=u?.find_upstream_untill(this);if(!p||!f)return s;if(u!==h||d!==c)if(p&&p===f)s.tell(p,Rs.delete(p.id,"backward",l,a,d,c)),s.tell(p,Rs.insert(p.id,o,l,a,d,c));else{s.tell(f,Rs.delete(f.id,"backward",null,a,"head",c)),s.tell(this,Rs.delete_child(this.id,"backward",[p.index+1,f.index])),s.tell(this,Rs.insert_child(this.id,e.data,p.index+1)),s.tell(p,Rs.delete(p.id,"backward",l,null,d,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,Ls.in_tail(t.id))}}else s.tell(u,Rs.insert(a,o,l,a,d,c));return s}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:i,start_id:r,end_id:s,offset_end:o,offset_start:a,reserve:l}=e,c=new Os(t);if(!r&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Rs.delete_child(this.id,i,[0,t.index])),c.tell(t,Rs.delete(t.id,i,r,s,"head",o)),c}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Rs.delete_child(this.id,i,[t.index+1,this.child_count])),c.tell(t,Rs.delete(t.id,i,r,s,a,o)),c}if("head"===a&&"tail"===o)return c.tell(this,Rs.reset(this.id,[])),c;if(r&&s){const e=this.find_cube(r),t=this.find_cube(s);if(!(e instanceof Sa&&t instanceof Sa))return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return c;const d=n.index,h=l.index;if(r!==s||a!==o)if(n===l)c.tell(n,Rs.delete(n.id,i,r,s,a,o,!0));else{c.tell(l,Rs.delete(l.id,i,null,s,"head",o)),c.tell(this,Rs.delete_child(this.id,"backward",[d+1,h])),c.tell(n,Rs.delete(n.id,i,r,null,a,"tail",!0));let t=0;if("number"==typeof a&&(t=a),c.tell(n,Rs.merge(n.id,"right",r,t)),n.is_empty)c.tell(this,Rs.delete_child(this.id,"backward",[n.index,n.index+1]));else if(e instanceof Sa){const n=e.pcube;c.tell(n,Rs.merge(n.id,"right",r,t))}}return c}}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===Object.keys(i).length)return;const s={};for(let e in i){const t=i[e];s[e]=structuredClone(Vt(this.attrs[e]))||null,null===t?delete this.attrs[e]:this.attrs[e]=t}return r.add_recover(Rs.set_attr(this.id,s)),r}on_cursor_in_tail(e){const{courier:t}=this,n=this.child_last,i=new Os(t);if(n)return i.tell(n,Ls.in_tail(n.id)),i}}class ro extends js{_children=Bt([]);_has_postil=Kt(!1);postil=null;pcube;data;constructor(e,t){super(),this.pcube=t}get domain(){return"doc"}get text(){let e="";for(let t of this.children)e+=t.text,t instanceof Wl&&(e+="\n");return this instanceof Wl&&(e+="\n"),e}get top(){let e=this;for(;e;){if(e.pcube instanceof io)return e;e=e.pcube}return e}get is_empty(){const e=this.children;return 0===e.length||1===e.length&&this.child_first.is_empty}get children(){return[...this._children]}get has_postil(){return this._has_postil.value}set has_postil(e){this._has_postil.value=e}get dom(){return document.getElementById(this.id)}get level(){return this.pcube.level+1}get host_postil(){return this instanceof wa?this:this.pcube.host_postil}get host_node(){let e=this.pcube;for(;e&&e instanceof ro;){if("map"===e.domain&&e instanceof ao)return e;e=e.pcube}}get in_postil(){return this instanceof wa||this.pcube.in_postil}get child_count(){return this.children.length}get child_first(){return this.children[0]}get child_first_line(){for(let e of this._children)if(e instanceof Wl)return e}get child_last(){return this.children[this.children.length-1]}get pid(){return this.pcube.id}get id(){return this.data.id}get css(){return this.data.css||(this.data.css={}),{...this.data.css,"margin-left":this.attrs.indent>0?this.attrs.indent*this.root.config.data.line_indent+"px":"0px"}}get attrs(){return this.data.attrs||(this.data.attrs={}),this.data.attrs}get info(){return this.data.info}get type(){return this.data.type}get root(){return this.pcube.root}get courier(){return this.root.courier}get config(){return this.root.config}get history(){return this.root.history}get hotkeys(){return this.root.hotkeys}get cursor(){return this.root.cursor}get event(){return this.root.event}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get stats(){return this.root.stats}get versions(){return this.root.versions}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get prev_cube(){return this.pcube.find_prev_cube(this.id)}get next_cube(){return this.pcube.find_next_cube(this.id)}get prev_cube_deep(){let e=this;for(;e;){let t=e.prev_cube;if(t instanceof ro)return t;e=e.pcube}}get next_cube_deep(){let e=this;for(;e;){let t=e.next_cube;if(t instanceof ro)return t;e=e.pcube}}get index(){return this.pcube?this.pcube.find_child_index(this.id):0}_setup(){this.set_cmd_handler(i.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.cube_insert,this.on_insert.bind(this)),this.set_cmd_handler(i.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.cube_set_css,this.on_cube_set_css.bind(this)),this.set_cmd_handler(i.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(i.cube_delete_adjacent,this.on_cube_delete_adjacent.bind(this)),this.set_cmd_handler(i.cube_postil_add,this.on_postil_add.bind(this)),this.set_cmd_handler(i.cube_postil_remove,this.on_postil_remove.bind(this)),this.set_cmd_handler(o.cursor_in_head,this.on_cursor_in_head.bind(this)),this.set_cmd_handler(o.cursor_in_tail,this.on_cursor_in_tail.bind(this)),Hs.init_cmd_handler(this)}setup(e,t){let n;try{n=structuredClone(Vt(e))}catch(n){return new Zo(e,t,"克隆数据失败")}if(!n)return new Zo(e,t,"克隆数据为空");try{const i=this.clipboard.pasted_from?.versions,r=i||this.root.versions,s=this.update_data(r[this.meta.type],n);if(!s.data)return new Zo(e,t,"升级后数据为空");if(!s.usable)return new Zo(e,t,"高版本数据,请升级软件");this.data=It(s.data),this._setup(),this.build_child(s.data),this.cubes.add_cube(this)}catch(n){return console.error(n),new Zo(e,t,"数据升级失败")}return this}create_child_block(e){const t=Ts.pick(e);return Ts.build_cubes(t.sort,this)}gc(){this.base_gc()}base_gc(){this.cubes.remove_cube(this);for(let e of this.children)e.gc()}base_export(){const e=structuredClone(Vt(this.data));return this.postil&&(e.attrs.postil=this.postil.export()),e}copy(e,t){const n=this.children.slice(e,t),i=[];for(let e of n){let t=e.export();i.push(t)}return i}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof od||t instanceof wd)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}delete_edge(e,t){const{courier:n}=this,i=new Os(n);if("backward"===t){const t=e.prev_cube_deep,n=t?.next_cube;let r=e.pcube;if(r.is_empty&&r instanceof ro){const e=r.prev_cube_deep;return i.merge(r.remove_self()),e&&i.tell(e,Ls.in_tail(e.id)),i}if(t&&t.is_empty)return i.merge(t.remove_self()),n&&i.tell(n,Ls.in_head(n.id)),i;if(n&&t.type===n.type)return i.merge(n.merge("left"));if(t)return i.tell(t,Ls.in_tail(t.id))}else{const t=e.next_cube_deep,n=t?.prev_cube;let r=e.pcube;for(;r&&r!==this;){const e=r.next_cube_deep;if(r.is_empty&&r instanceof ro)return i.merge(r.remove_self()),e&&i.tell(e,Ls.in_head(e.id)),i;r=r.pcube}if(t&&t.is_empty)return i.merge(t.remove_self()),n&&i.tell(n,Ls.in_tail(n.id)),i;if(n&&t.type===n.type)return i.merge(t.merge("left"));if(t)return i.tell(t,Ls.in_tail(t.id))}}remove_self(e="backward"){const{pcube:t,courier:n,index:i}=this,r=new Os(n);return r.tell(t,Rs.delete_child(t.id,e,[i,i+1])),r}merge(e){const{pcube:t,cursor:n,courier:i}=this,{cube_end:r,offset_end:s}=n;if(!r)return;const o=i.get_recorder();return o.tell(this,Rs.merge(this.id,e,r.id,s)),o}find_cube(e){if(e===this.id)return this;for(let t of this.children){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];e(this)&&t.push(this);for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}is_contains_cube(e){if(e===this)return!0;let t=e;for(;t;){if(t.pcube===this)return!0;t=t.pcube}return!1}find_upstream_untill(e){if(!e.is_contains_cube(this))return;let t=this;for(;t;){if(t instanceof ro&&t.pcube===e)return t;t=t.pcube}}find_upstream_target(e){let t=this;for(;t instanceof ro;)if(t=t.pcube,e(t))return t}find_child_cube(e){return this.children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}on_cube_set_selection_css(e){const{cursor:t,courier:n}=this,{css:i,start_id:r,end_id:s,offset_end:o,offset_start:a,toggle:l,replace:c}=e,d=new Os(n);if(r!==s||o!==a){if(s&&!r){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)d.tell(e,Rs.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,Rs.set_selection_css(t.id,i,null,s,"head",o,l,c)),d}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)d.tell(e,Rs.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,Rs.set_selection_css(t.id,i,r,null,a,"tail",l,c)),d}if("tail"===o&&"head"===a){for(let e of this.children)d.tell(e,Rs.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d}if(s&&r){const e=this.find_cube(r),t=this.find_cube(s),n=e?.find_upstream_untill(this),h=t?.find_upstream_untill(this);if(!n||!h)return;const u=this.children.slice(n.index+1,h.index);for(let e of u)d.tell(e,Rs.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(n,Rs.set_selection_css(n.id,i,r,null,a,"tail",l,c)),n!==h&&d.tell(h,Rs.set_selection_css(h.id,i,null,s,"head",o,l,c)),d}}}on_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i}=this,r=new Os(t),{data:s,end_id:o,start_id:a,offset_end:l,offset_start:c}=e,d=this.find_cube(a),h=this.find_cube(o),u=d?.find_upstream_untill(this),p=h?.find_upstream_untill(this);if(!u||!p)return r;if(h!==d||c!==l)if(u&&u===p)r.tell(u,Rs.delete(u.id,"backward",a,o,c,l)),r.tell(u,Rs.insert(u.id,s,a,o,c,l));else{r.tell(p,Rs.delete(p.id,"backward",null,o,"head",l)),r.tell(this,Rs.delete_child(this.id,"backward",[u.index+1,p.index])),r.tell(this,Rs.insert_child(this.id,s,u.index+1)),r.tell(u,Rs.delete(u.id,"backward",a,null,c,"tail"));let e=s[s.length-1];const t=this.top.find_cube(e.id);t&&r.tell(t,Ls.in_tail(e.id))}else r.tell(h,Rs.insert(o,s,a,o,c,l));return r}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:i,start_id:r,end_id:s,offset_end:o,offset_start:a,reserve:l}=e,c=new Os(t);if(!r&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Rs.delete_child(this.id,i,[0,t.index],l)),c.tell(t,Rs.delete(t.id,i,r,s,"head",o,l)),c}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Rs.delete_child(this.id,i,[t.index+1,this.child_count],l)),c.tell(t,Rs.delete(t.id,i,r,s,a,o,l)),c}if("head"===a&&"tail"===o){if(l){if(this.is_empty)return;c.tell(this,Rs.delete_child(this.id,i,[1,this.child_count]));const e=this.child_first;e.meta.block?c.tell(e,Rs.delete_child(e.id,i,[0,e.child_count],l)):e instanceof Sa?(c.tell(e,xa.reset(e.id,"")),c.tell(e,Ls.loc(e.id,1,e.id,1))):c.tell(e,Rs.reset(e.id,[]))}else c.tell(this.pcube,Rs.delete_child(this.pid,"backward",[this.index,this.index+1]));return c}if(r&&s){const e=this.find_cube(r),t=this.find_cube(s);if(!e||!t)return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return c;const d=n.index,h=l.index;if(r!==s||a!==o)if(n===l)c.tell(n,Rs.delete(n.id,i,r,s,a,o,!0));else if(c.tell(l,Rs.delete(l.id,i,null,s,"head",o)),c.tell(this,Rs.delete_child(this.id,"backward",[d+1,h])),c.tell(n,Rs.delete(n.id,i,r,null,a,"tail",!0)),e instanceof Sa){const t=e.get_valid_index(a);e.set_cursor_in_head(t)}return c}}on_cube_set_css(e){const{courier:t,cursor:n}=this,{css:i,toggle:r,replace:s}=e,o=t.get_recorder();if(o.add_cmd(e),s){const e=structuredClone(Vt(this.css));return this.data.css=i,o.add_recover(Rs.set_css(this.id,e,!1,!0)),o}if(0===Object.keys(i).length)return;let a=!0;const l=structuredClone(Vt(this.css)),c=structuredClone(Vt(this.css));for(let e in i){const t=i[e],n=this.css[e]||null;l[e]=n,null===t||r&&t===n?(a=!1,delete c[e]):t!==n&&(a=!1,c[e]=t)}return this.data.css=c,a?void 0:(o.add_recover(Rs.set_css(this.id,l)),o)}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===Object.keys(i).length)return;const s={};for(let e in i){const t=i[e];s[e]=structuredClone(Vt(this.attrs[e]))||null,null===t?delete this.data.attrs[e]:this.data.attrs[e]=t}return r.add_recover(Rs.set_attr(this.id,s)),r}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:i,index:r}=this,{from:s,from_id:o,offset:a}=e,l=new Os(t);if(this.meta.block){const e=this.child_first,t=this.child_last;this.is_empty&&l.tell(n,Rs.delete_child(i,"backward",[this.index,this.index+1])),"left"===s?l.tell(e,Ls.in_head(e.id)):l.tell(t,Ls.in_tail(t.id))}else l.tell(n,Rs.delete_child(i,"backward",[this.index,this.index+1]));return l}on_postil_add(e){const{courier:t}=this,{data:n}=e;if(this.postil){const e=new Os(t),i=this.postil;return e.tell(i,Rs.insert_child(i.id,n,i.child_count)),this.has_postil=!0,this.postil.show=!0,e}{const i=t.get_recorder();i.add_cmd(e);const r=wa.get_default(n),s=new wa(r,this);return this.postil=s,i.add_recover(Rs.postil_remove(this.id,[0,s.child_count])),this.postil.show=!0,this.has_postil=!0,i}}on_postil_remove(e){const{courier:t}=this,{range:n}=e,[i,r]=n,s=this.postil;if(!s)return;let o=i<0?0:i,a=r>s.child_count?s.child_count:r;if(o<=0&&a>=s.child_count){const n=t.get_recorder();n.add_cmd(e);const i=s.export();return n.add_recover(Rs.postil_add(this.id,i.info)),this.postil=null,this.has_postil=!1,s.gc(),n}{const e=new Os(t);return e.tell(s,Rs.delete_child(s.id,"backward",[o,a])),e}}on_cursor_in_head(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new Os(t);if(this.meta.block){const e=this.child_first;if(!e)return s;s.tell(e,Ls.in_head(e.id))}else if(this instanceof Sa)this.prev_cube instanceof Sa&&this.len>=1?this.set_cursor_in_head(1):this.set_cursor_in_head(0);else if(r&&r instanceof Sa)r.set_cursor_in_head();else{const e=Sa.get_default();s.tell(i,Rs.insert_child(i.id,[e],this.index+1))}return s}on_cursor_in_tail(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new Os(t);if(this.meta.block){const e=this.child_last;if(!e)return s;s.tell(e,Ls.in_tail(e.id))}else if(this instanceof Sa)this.next_cube instanceof Sa&&this.len>=1?this.set_cursor_in_tail(1):this.set_cursor_in_tail(0);else if(n&&n instanceof Sa)n.set_cursor_in_tail();else{const e=Sa.get_default();s.tell(i,Rs.insert_child(i.id,[e],this.index))}return s}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}get_valid_range(e){let[t,n]=e;return t<0&&(t=0),n>this.child_count&&(n=this.child_count),[t,n]}}class so extends ro{}class oo{_node;_map;_bound;_env=It({upstream:void 0,downstream:[],layout:null});_all_downstream_nodes=vs(()=>this.get_layout_downstream_nodes());_siblings_info=vs(()=>this.get_siblings_info());_folded_upstream=vs(()=>{let e=this.upstream;for(;e;){if(e.attrs.fold||e.is_layout_root)return e.attrs.fold;e=e.env.upstream}return!1});get siblings(){return this._siblings_info.value}get bound(){return this._bound}get map(){return this._map}get to(){return this.node.to}get from(){return this.node.from}get nodes_to(){return this.node.nodes_to}get nodes_from(){return this.node.nodes_from}get node(){return this._node}get index(){return this.upstream?this.upstream.env.downstream.indexOf(this.node):0}get prev_node(){if(!this.upstream)return;const e=this.index;return this.upstream.env.downstream[e-1]}get next_node(){if(!this.upstream)return;const e=this.index;return this.upstream.env.downstream[e+1]}get level(){return this.node.is_layout_root||!this.upstream?0:this.layout_line.length-1}get upstream(){return this._env.upstream}get downstream(){return[...this._env.downstream]}get downstream_nodes(){return[...this._all_downstream_nodes.value]}get is_captive(){return!this.node.is_layout_root&&(!(!this.layout_root||!this.layout_root.attrs.layout)&&!!this.upstream)}get layout_line(){const e=[];if(!this.upstream)return e;let t=this.node;for(;t;){if(e.unshift(t),t.is_layout_root)return e;t=t.env.upstream}return[]}get layout_root(){return this.layout_line[0]}get folded_upstream(){return!this.node.is_layout_root&&this._folded_upstream.value}get folded_self(){return this._node.attrs.fold}get folded(){return this.folded_self||this.folded_upstream}get layout_from(){if(this.node.attrs.layout)return this.node;const e=this.layout_line;for(let t of e.reverse())if(t.is_layout_root||t.attrs.layout)return t;return this.node}get layout_type(){return this._node.attrs.layout||this._env.layout}constructor(e){this._node=e,this._map=e.pcube,this._bound=e.bound}clear(){this._env.upstream=void 0,this._env.downstream.length=0}update(e){const{upstream:t,downstream:n}=e;t&&(this._env.upstream=t),n&&(this._env.downstream=[...n])}flow(e){e?(this._env.upstream=e.node,this._env.layout=this._node.attrs.layout||e.get_downstream_layout_type(this.node)):this._node.is_layout_root&&(this._env.upstream=this._node),this._env.downstream.length=0;for(let e of this.nodes_to){const{has_root:t,line:n}=ks.find_line_to_layout_root(e);t&&(n[1]===this.node&&this._env.downstream.push(e))}for(let e of this._env.downstream)e.env.flow(this)}get_layout_downstream_nodes(){const e=[...this.downstream];for(let t of e)e.push(...t.env.downstream);return e}get_downstream_layout_type(e){const t=this.layout_type||this.node.attrs.layout;if(!t)return null;if(e===this.node)return t;if(["down","up","left","right"].includes(t))return t;const n=e.env.level-this.level;return"time-right"===t?1===n?"time-down":"right":"time-down"===t?"right":t}get_siblings_info(){const e=this.upstream;if(!e)return;const t=e.env.downstream,n=t.indexOf(this.node);return n<0?void 0:{prev:t[n-1],next:t[n+1],index:n}}}class ao extends so{_editable=Kt(!1);_waiter=new Set;_layouted_self=Kt(!1);_show=Kt(!0);_mis=2;_env;bound;data;pcube;icons={right:"icon-right iconfont",left:"icon-left iconfont",up:"icon-up iconfont",down:"icon-down iconfont","time-down":"icon-time-down iconfont","time-right":"icon-time-right iconfont"};shape=It({type:"rect",path:"",sample:[]});constructor(e,t){super(e,t),this.pcube=t,this._init_handler(),this._env=new oo(this),this.bound=new bd(this,e.attrs.matrix2d||xs.get_default()),this.shape.type=e.attrs.shape||"rect"}get layouted_self(){return this._layouted_self.value}get is_selected(){return this.pcube.is_node_selected(this)}get env(){return this._env}get mis(){return this._mis}get map(){return this.pcube}get matrix2d(){return this.attrs.matrix2d}get rect(){return this.bound.rect}get show(){return this.pcube.check_node_visible(this)}_sample=vs(()=>{if(this.is_layout_root||!this.env.upstream){const e={x:this.matrix2d.e,y:this.matrix2d.f};return ks.offset_points(this.shape.sample,e)}return ks.offset_points(this.shape.sample,this.bound.pos)});get attrs(){return this.data.attrs}get path(){return this.shape.path}get sample_count(){return 8}get sample(){return this._sample.value}get editable(){return this._editable.value}set editable(e){e?this.pcube.register_node_editing(this):this.pcube.remove_node_editing(this),this._editable.value=e;const t=this.courier.get_recorder(),n=this.child_last,i=Ls.in_tail(n.id);t.tell(n,i),this.history.record(t)}get is_layout_root(){return this.attrs.root||!1}get domain(){return"map"}get from(){const e=this.pcube.get_node_from(this.id);return new Set(e||[])}get to(){const e=this.pcube.get_node_to(this.id);return new Set(e||[])}get node_last(){const e=this.pcube.get_node_to(this.id),t=e?e[e.length-1]:this.id;return this.pcube.get_node(t)||this}get count_from(){return this.from.size}get count_to(){return this.to.size}get nodes_to(){const e=[];for(let t of this.to){const n=this.pcube.get_node(t);n&&e.push(n)}return e}get nodes_from(){const e=[];for(let t of this.from){const n=this.pcube.get_node(t);n&&e.push(n)}return e}get matrix2d_dom_string(){const{a:e,b:t,c:n,d:i,e:r,f:s}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return xs.get_dom_string(this.matrix2d);{const r=this.bound.pos;return`matrix(${e.toFixed(1)},${t},${n},${i.toFixed(1)},${r.x.toFixed(1)},${r.y.toFixed(1)})`}}get matrix2d_real(){const{a:e,b:t,c:n,d:i,e:r,f:s}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return{...this.matrix2d};{const r=this.bound.pos;return{a:e,b:t,c:n,d:i,e:r.x,f:r.y}}}_init_handler(){this.set_cmd_handler(i.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(i.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(i.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(i.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(i.cube_insert_child,this.on_insert_child.bind(this)),this.set_cmd_handler(l.append_child,this.on_append_child.bind(this)),this.set_cmd_handler(l.layout_update,this.on_layout_update.bind(this))}check_show(){}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof od||t instanceof wd)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}move_to_center(){const e=this.pcube.get_view_center(),t=this.pcube.transform_point(e),n=this.bound.pos_center,i=this.pcube.real_point_to_fig(n),r=t.x-i.x,s=t.y-i.y,o=xs.multiply(this.pcube.matrix2d,xs.get_matrix_translate(r,s));this.pcube.reset_matrix(o)}move_in_fig_view(){if(this.check_in_fig_view(!0))return;const e=this.pcube,t=e.view_rect,{dx:n,dy:i}=Es.MathRect.move_rect_in_other(this.bound.rect,t),r=xs.multiply(e.matrix2d,xs.get_matrix_translate(n,i));e.reset_matrix(r),e.check_show()}check_in_fig_view(e=!1){const t=this.pcube.view_rect;return e?Es.MathRect.is_include(t,this.rect):Es.MathRect.check_intersection(t,this.rect)}check_show_downstream(){return this.env.folded||this.pcube.perf}layout(){let e=Date.now();if(this.is_layout_root&&this.bound.update_pos_tree_root(),this.env.layout_type||this.is_layout_root){const t=this.env.downstream;if(Ds.layout_tree(this,t),!this.env.folded_self)for(let e of this.env.downstream)e.layout();this.is_layout_root&&console.log("⚫布局根布局",this.id,Date.now()-e)}if(this.is_layout_root){const e=this.env.downstream_nodes;this.map.grider.update_nodes(e),this.pcube.check_show_throttle()}}layout_throttle=Es.Notice.throttle(this.layout.bind(this),50);layout_self(e){const t=e.borderBoxSize[0];if(!t)return;const{blockSize:n,inlineSize:i}=t,r=this.bound.size;if(this.layouted_self&&Math.abs(r.width-i)<this.mis&&Math.abs(r.height-n)<this.mis)return;this._layouted_self.value=!0;const s={width:Math.ceil(i),height:Math.ceil(n)};this.bound.update_size(s.width,s.height),this.shape.path=yd.get_shaple(this,this.config.data.map_node_padding),this.shape.sample=this.get_sample(),!this.env.upstream&&this.pcube.perf&&this.check_show();for(let e of this._waiter)e()}wait_layout_self(){return new Promise(e=>{this.layouted_self?e(!0):this._waiter.add(e)})}check_show_line(){const e=this.id;for(let t of this.to){const n=ks.get_linker_id(e,t),i=this.pcube.get_linker(n);i&&(this.attrs.fold?i.show=!1:i.to_node?.show||this.show?i.show=!0:i.show=!1)}for(let t of this.from){const n=ks.get_linker_id(t,e),i=this.pcube.get_linker(n);if(!i)continue;let r=i.from_node;const s=!r?.attrs.fold,o=this.show||r?.show;i.show=!(!s||!o)}}get_sample(){if("rect"===this.shape.type){const e={x:0,y:0,...this.bound.size_bound},t=Es.MathRect.get_rect_point;return[t(e,Es._RectPosition.left_top),t(e,Es._RectPosition.top_mid),t(e,Es._RectPosition.right_top),t(e,Es._RectPosition.right_mid),t(e,Es._RectPosition.right_bottom),t(e,Es._RectPosition.bottom_mid),t(e,Es._RectPosition.left_bottom),t(e,Es._RectPosition.left_mid),t(e,Es._RectPosition.left_top)]}return ks.svg_path_sample(this.shape.path,this.sample_count)}gc(){this.base_gc(),this.pcube.grider.remove_node(this)}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return{children:i,data:r}}reset_matrix(e){Object.assign(this.matrix2d,e),this.bound.update_pos()}get_node(e){if(e)return this.pcube.get_node(e)}get_layout_index(e){return e.indexOf(this)}translate(e,t){const n=xs.translate(this.matrix2d,e,t);this.reset_matrix(n)}break_link_node(e){this.from.delete(e),this.to.delete(e)}remove_self(){for(let e of this.from){const t=this.pcube.find_child_cube(e);t&&t instanceof ao&&t.break_link_node(this.id)}for(let e of this.to){const t=this.pcube.find_child_cube(e);t&&t instanceof ao&&t.break_link_node(this.id)}return super.remove_self()}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}on_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=this.export().info,s=Ts.build_cubes(n,this);return this.splice(0,this.child_count,...s),i.add_recover(Rs.reset(this.id,r)),i}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new Os(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Rs.reorder(this.id,o.id,c)),a}on_insert_child(e){const{courier:t}=this,i=t.get_recorder();i.add_cmd(e);const{pos:r,data:s}=e;if(0===s.length)return i;const o=[];for(let e of s)e.type===n.box_root&&o.push(new $l(e,this));let a=this.get_valid_index(r);this.splice(a,0,...o);const l=o[o.length-1];return l&&i.tell(l,Ls.in_tail(l.id)),i.add_recover(Rs.delete_child(this.id,"backward",[a,a+o.length])),i}on_delete_cube(e){const{courier:t,pcube:n,pid:i}=this,{dir:r,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],h=a-o;if(o!==a){if(o<=0&&a>=this.child_count){this.child_first;l.tell(this,Rs.reset(this.id,[]));const e=Rs.insert_child(this.id,[$l.get_default()],0);return l.tell(this,e),l}{let e=this.splice(o,h);c&&"backward"===r||!d?l.tell(c,Ls.in_tail(c.id)):(d&&"forward"===r||!c)&&l.tell(d,Ls.in_head(d.id));const t=e.data;l.add_recover(Rs.insert_child(this.id,t,o))}return l}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i,pcube:r}=this,s=new Os(t),{data:o,end_id:a,start_id:l,offset_end:c,offset_start:d}=e,h=this.find_cube(l),u=this.find_cube(a),p=h?.find_upstream_untill(this),f=u?.find_upstream_untill(this);if(!p||!f)return s;if(u!==h||d!==c)if(p&&p===f)s.tell(p,Rs.delete(p.id,"backward",l,a,d,c)),s.tell(p,Rs.insert(p.id,o,l,a,d,c));else{s.tell(f,Rs.delete(f.id,"backward",null,a,"head",c)),s.tell(this,Rs.delete_child(this.id,"backward",[p.index+1,f.index])),s.tell(this,Rs.insert_child(this.id,e.data,p.index+1)),s.tell(p,Rs.delete(p.id,"backward",l,null,d,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,Ls.in_tail(t.id))}}else s.tell(u,Rs.insert(a,o,l,a,d,c));return s}on_layout_update(e){const{courier:t,history:n}=this,{attrs:i}=e,r=t.get_recorder(),s=structuredClone(Vt(this.data.attrs));let o=!1;r.add_cmd(e);const a=this.attrs.fold;for(let e in i){const t=i[e];t!==this.attrs[e]&&(this.attrs[e]=t,o=!0)}if("matrix2d"in i&&i.matrix2d){const e=i.matrix2d;this.reset_matrix(e)}"fold"in i&&a!==i.fold&&(this.bound.flow("downstream"),this.bound.flow("upstream")),o&&(this.is_layout_root?(this.env.flow(),this.layout_throttle()):this.env.layout_root?.layout_throttle());const l=Is.layout_change(this.id,s);return r.add_recover(l),r}on_append_child(e){const{courier:t,history:n,pcube:i}=this,{previd:r}=e,{map_node_hgap:s,map_node_vgap:o}=this.config.data,a=t.get_recorder(),l=this.node_last.bound,c={x:l.pos.x,y:l.pos.y+l.size_bound.height+o},d=gd.get_default(c),h=Bs.node_add(i.id,[d]);a.tell(i,h);const u=ks.create_linker_info(this.pcube,this.id,d.id),p=Bs.linker_add(i.id,[u]);a.tell(i,p);const f=i.get_node_to(this.id),m=f?.indexOf(d.id);if(f&&void 0!==m&&m>=0)if(null===r)f.splice(m,1),f.unshift(d.id);else if(r){const e=f.indexOf(r);e>=0&&(f.splice(m,1),f.splice(e+1,0,d.id))}return this.env.flow(),a}static get_default_node_size(e=0){return{width:eo.default_config.map_node_default_width+2*e,height:52+2*e}}static get_default_node_pos(e,t){const{map_node_padding:n}=t.config.data,i=t.view_point_to_real(e),r=ao.get_default_node_size(n);return{x:i.x-r.width/2,y:i.y-r.height/2}}}function lo(e,t){return t.css.width?Number.parseInt(t.css.width.trim().slice(0,-2)):e.getBoundingClientRect().width}function co(e,t,n,i){e.stopPropagation(),e.preventDefault(),i.isdown=!0,i.dir=n,i.dom=t.dom;const r=e.currentTarget,s=r.parentElement?.parentElement;if(!s)return;i.x=e.clientX,i.width_origin=t.css.width;const o=lo(s,t);i.width=o,i.width_result=o}const ho=It({point:{x:0,y:0},css:{},cube:void 0,menu:void 0,stack_pos:[],stack_menus:[],stack_rect:[]}),uo=It({open:!1,data:{},submit(){}});function po(e,t){uo.open=!0,uo.submit=t,uo.data=e}function fo(e){const t=[...qo(e,!0),{usable:!0,title:"语言",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){const t={title:"选择语言",active:[e.active_tab?.lang||""],menus:e.langs.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:i,history:r,id:s,active_tab:o}=e;if(!o)return;const a=i.get_recorder();a.tell(e,nh.change_lang(s,o.id,t)),r.record(a)}}))};return t}(e),click(e){}},{usable:!0,title:"主题",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){const t={title:"选择主题",active:[e.active_tab?.theme||""],menus:e.themes.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:i,history:r,id:s,active_tab:o}=e;if(!o)return;const a=i.get_recorder();a.tell(e,nh.change_theme(s,o.id,t)),r.record(a)}}))};return t}(e),click(e){}},{usable:!0,title:"添加代码块",icon:["iconfont","icon-add"],click(t){po({文件名:""},t=>{const n=t["文件名"],i=n.lastIndexOf(".");let r="typescript";if(i>=0){const e=n.slice(i);r=Bm[e]||r}const{code_theme:s}=e.config.data,o=e.create_tab(r,n,s),a=e.courier.get_recorder();a.tell(e,nh.add(e.id,o)),e.history.record(a)})},mouseenter(e){}},{usable:!0,title:"重命名",icon:["iconfont","icon-rename"],click(t){po({文件名:e.active_tab?.name||""},t=>{const n=e.active_tab;if(!n)return;const i=t["文件名"],r=e.courier.get_recorder();r.tell(e,nh.rename(e.id,n.id,i)),e.history.record(r)})},mouseenter(e){}},{usable:!0,title:"复制代码",icon:["iconfont","icon-copy"],click(t){e.copy_code()},mouseenter(e){}},{usable:!0,title:"清空代码",icon:["iconfont","icon-eraser"],click(t){const n=e.active_tab;if(!n)return;const i=e.courier.get_recorder();i.tell(e,nh.update(e.id,n.id,"")),e.history.record(i)},mouseenter(e){}},{usable:!0,title:"删除代码",icon:["iconfont","icon-close"],click(t){const n=e.active_tab;if(!n)return;const i=e.courier.get_recorder();i.tell(e,nh.remove(e.id,n.id)),e.history.record(i)},mouseenter(e){}}];return{title:e.meta.cubename,active:[],menus:t}}function mo(e){const t=e.get_active_cell(),n=[...qo(e),{usable:!0,title:e.title?"移除标题":"添加标题",icon:["iconfont","icon-a-Addheader2x"],has_submenu:!1,mouseenter(e){},click(t){const{history:n,courier:i,id:r}=e,s=i.get_recorder();if(e.title){const t=Uv.remove_title(r);s.tell(e,t)}else{const t=Ql.get_default(),n=Uv.add_title(r,t);s.tell(e,n)}n.record(s)}},{usable:e.selection_cells.length>0,title:"复制子表",icon:["iconfont","icon-grid"],has_submenu:!1,mouseenter(e){},click(t){const{clipboard:n}=e,i=Cs.tips,r=e.copy_selection_table();if(!r)return Cs.tips?.tip_error("复制子表失败");const s=e.get_selection_text();n.set_clipboard_cubedata(s,[r]),i?.tip_success("复制子表成功")}},{usable:e.selection_cells.length>0,title:"合并单元格",icon:["iconfont","icon-hebingdanyuange"],has_submenu:!1,mouseenter(e){},click(t){!function(e){const{courier:t,id:n,history:i}=e,r=Cs.tips,s=t.get_recorder(),o=e.get_selection_area();if(!o)return r?.tip_info("无选中单元格");s.tell(e,Uv.merge(n,o)),i.record(s)}(e)}},{usable:!!t,title:"扩大当前列宽",icon:["iconfont","icon-expand-horizontal-1--expand-resize-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){vo(e,1)}},{usable:!!t,title:"缩小当前列宽",icon:["iconfont","icon-shrink-horizontal-1--resize-shrink-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){vo(e,-1)}},{usable:!!t,title:"向左插入列",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇠",mouseenter(e){},click(t){_o(e)}},{usable:!!t,title:"向右插入列",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇢",mouseenter(e){},click(t){go(e)}},{usable:!!t,title:"向上插入行",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + shift + ↑",mouseenter(e){},click(t){bo(e)}},{usable:!!t,title:"向下插入行",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇣",mouseenter(e){},click(t){yo(e)}},{usable:!!t,title:"向左插入单元格",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + ⇠",mouseenter(e){},click(t){_o(e,!0)}},{usable:!!t,title:"向右插入单元格",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + ⇢",mouseenter(e){},click(t){go(e,!0)}},{usable:!!t,title:"向上插入单元格",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + ↑",mouseenter(e){},click(t){bo(e,!0)}},{usable:!!t,title:"向下插入单元格",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + ⇣",mouseenter(e){},click(t){yo(e,!0)}},{usable:!!t,title:"删除当前行",icon:["iconfont","icon-shanchuhang"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:s}=e,o=Cs.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");const c=e.check_orderly_row(l.row);if(!c)return o?.tip_info("当前行不整齐");{const t=n.get_recorder();t.tell(e,Uv.remove_row(s,l.row)),r.record(t)}}(e)}},{usable:!!t,title:"删除当前列",icon:["iconfont","icon-shanchulie"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:s}=e,o=Cs.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");const c=e.check_orderly_col(l.col);if(!c)return o?.tip_info("当前列不整齐");{const t=n.get_recorder();t.tell(e,Uv.remove_col(s,l.col)),r.record(t)}}(e)}},{usable:!!t,title:"删除当前单元格",icon:["iconfont","icon-list-delete-cell"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:s}=e,o=Cs.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");const c=n.get_recorder();c.tell(e,Uv.remove_cell(s,l.box.id)),r.record(c)}(e)}}];return{title:e.meta.cubename,active:[],menus:n}}function _o(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=Cs.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row,l.col-1))return o?.tip_info("左侧已存在单元格");if(l.col-1<0)return o?.tip_info("左侧已达边界");{const t=i.get_recorder(),n={row:l.row,col:l.col-1,rowspan:1,colspan:1,data:Ql.get_default()};t.tell(e,Uv.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_col_left(t.left))return o?.tip_info("左侧不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[0];t++)r.push(Ql.get_default());n.tell(e,Uv.add_col(e.id,l.col,r)),s.record(n)}}function go(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=Cs.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row,l.col+1))return o?.tip_info("右侧已存在单元格");if(l.col+1>=e.size[1])return o?.tip_info("右侧已达边界");{const t=i.get_recorder(),n={row:l.row,col:l.col+1,rowspan:1,colspan:1,data:Ql.get_default()};t.tell(e,Uv.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_col_right(t.right))return o?.tip_info("右侧不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[0];t++)r.push(Ql.get_default());n.tell(e,Uv.add_col(e.id,l.col+l.colspan,r)),s.record(n)}}function bo(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=Cs.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row-1,l.col))return o?.tip_info("上方已存在单元格");if(l.row-1<0)return o?.tip_info("上方已达边界");{const t=i.get_recorder(),n={row:l.row-1,col:l.col,rowspan:1,colspan:1,data:Ql.get_default()};t.tell(e,Uv.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_row_top(t.top))return o?.tip_info("上方不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[1];t++)r.push(Ql.get_default());n.tell(e,Uv.add_row(e.id,l.row,r)),s.record(n)}}function yo(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=Cs.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row+1,l.col))return o?.tip_info("下方已存在单元格");if(l.row+1>=e.size[0])return o?.tip_info("下方已达边界");{const t=i.get_recorder(),n={row:l.row+1,col:l.col,rowspan:1,colspan:1,data:Ql.get_default()};t.tell(e,Uv.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_row_bottom(t.bottom))return o?.tip_info("下方不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[1];t++)r.push(Ql.get_default());n.tell(e,Uv.add_row(e.id,l.row+l.rowspan,r)),s.record(n)}}function vo(e,t){const{cursor:n,courier:i,stats:r,history:s,id:o}=e,a=Cs.tips,{cube_end:l}=n,c=e.get_active_cell();if(!c)return a?.tip_info("未发现激活单元格");const d=i.get_recorder(),h=e.get_cell_area(c);d.tell(e,Uv.col_resize(o,[h.left,h.right],t)),s.record(d)}let wo,xo,ko=!1,So=null,Co=null;function Mo(e){const{courier:t,history:n,id:i,cubes:r}=e,s=t.get_recorder();s.tell(e,Rs.fold(i,!e.attrs.fold)),n.record(s);for(let t of Object.values(r.postils))t.pcube?.top===e&&t.visible(!1);const o=e.child_first.id;if(!o)return;const a=document.getElementById(o);a?.scrollIntoView({block:"nearest",behavior:"smooth"})}function zo(e,t){Mo(t)}function To(e,t){e.preventDefault();const{root:n,stats:i}=t;i.anchor_root_id===t.id?i.anchor_root_id="":n.stats.anchor_root_id=t.id}function Ao(e){const t=[...qo(e),{usable:!0,title:"添加块",shortcut:"",has_submenu:!1,icon:["iconfont","icon-add"],mouseenter(){},click(){!function(e){const{courier:t,history:n}=e,i=t.get_recorder(),r=[Ql.get_default()];i.tell(e,Rs.insert_child(e.id,r,e.child_count)),n.record(i)}(e)}},{usable:!0,title:"布局•限定列宽",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:120,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){No(e,120)}},{usable:!0,title:140,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){No(e,140)}},{usable:!0,title:160,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){No(e,160)}},{usable:!0,title:180,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){No(e,180)}},{usable:!0,title:200,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){No(e,200)}}],n={title:"限定列宽",active:[e.attrs.column_width],menus:t};return n}(e),click(){}},{usable:!0,title:"布局•限定列数",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:2,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Po(e,2)}},{usable:!0,title:3,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Po(e,3)}},{usable:!0,title:4,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Po(e,4)}},{usable:!0,title:5,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Po(e,5)}},{usable:!0,title:6,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Po(e,6)}}],n={title:"限定列数",active:[e.attrs.column_count],menus:t};return n}(e),click(){}}];return{title:e.meta.cubename,active:[],menus:t}}function Po(e,t){const{courier:n,history:i}=e,r=n.get_recorder();r.tell(e,Rs.set_attr(e.id,{column_count:t,column_width:null})),i.record(r)}function No(e,t){const{courier:n,history:i}=e,r=n.get_recorder();r.tell(e,Rs.set_attr(e.id,{column_width:t,column_count:null})),i.record(r)}class Oo{static reset(e,t){return{id:e,name:m.reset,data:t}}static add(e,t,n){return{id:e,name:m.add,data:t,pos:n}}static remove(e,t){return{id:e,name:m.remove,range:t}}static indent(e,t){return{id:e,name:m.indent,items:t}}}function Ro(e,t=!1){const n=e,{cursor:i,courier:r,history:s}=e,{cube_start:o,cube_end:a}=i;if(!o||!a)return;const l=r.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,Oo.indent(n.id,r)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,Oo.indent(n.id,r)),s.record(l)}}function Lo(e,t=!1){const n=e,{cursor:i,courier:r,history:s}=e,{cube_start:o,cube_end:a}=i;if(!o||!a)return;const l=r.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,Xd.indent(n.id,r)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,Xd.indent(n.id,r)),s.record(l)}}function Eo(e,t=!1){const n=e,{cursor:i,courier:r,history:s}=e,{cube_start:o,cube_end:a}=i;if(!o||!a)return;const l=r.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,Id.indent(n.id,r)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,Id.indent(n.id,r)),s.record(l)}}function Do(e,t="tail"){const{courier:n,history:i}=e,r=new Os(n),s=[Ql.get_default(),Ql.get_default()],o=Nd.insert_row(e.id,t,[s]);r.tell(e,o),i.record(r)}async function Io(e,t){e.preventDefault(),e.stopPropagation(),ho.cube=t,ho.point={x:e.clientX,y:e.clientY},ho.stack_pos.length=0,ho.stack_rect.length=0,ho.stack_menus.length=0,t instanceof Hm?ho.menu=fo(t):t instanceof aw?ho.menu=mo(t):t instanceof $l?ho.menu=function(e){const t=[...qo(e),{usable:!e.attrs.fold,title:"折叠",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){Mo(e)}},{usable:!!e.attrs.fold,title:"展开",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){Mo(e)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof gw?ho.menu=Ao(t):t instanceof Yd?ho.menu=function(e){const t=[{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){Ro(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){Ro(e,!0)}},{get usable(){return!(e.pcube instanceof Td)},title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=Ts.get_id(),s.type=n.list_ordered;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Rs.delete_child(o.id,"backward",[a,a+1],!0),d=Rs.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}},{get usable(){return!(e.pcube instanceof Td)},title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=Ts.get_id(),s.type=n.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Rs.delete_child(o.id,"backward",[a,a+1],!0),d=Rs.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}}];return e.pcube instanceof Td||t.unshift(...qo(e)),{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof th?ho.menu=function(e){const t=[...qo(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){Lo(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){Lo(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=Ts.get_id(),s.type=n.list;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Rs.delete_child(o.id,"backward",[a,a+1],!0),d=Rs.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=Ts.get_id(),s.type=n.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Rs.delete_child(o.id,"backward",[a,a+1],!0),d=Rs.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof $d?ho.menu=function(e){const t=[...qo(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){Eo(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){Eo(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=Ts.get_id(),s.type=n.list;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Rs.delete_child(o.id,"backward",[a,a+1],!0),d=Rs.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=Ts.get_id(),s.type=n.list_ordered;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Rs.delete_child(o.id,"backward",[a,a+1],!0),d=Rs.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof Yo?ho.menu=function(e){const t=[{usable:!0,title:"下载",icon:["iconfont","icon-download"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){e.event.emit_asset_download("image",e.info)}},{usable:!0,title:"复制到粘贴板",icon:["iconfont","icon-copy"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.dom?.querySelector("img");if(!n)return Cs.tips?.tip_error("复制失败");fetch(n.src).then(e=>e.blob()).then(async t=>{const n=new ClipboardItem({"image/png":t});await e.clipboard.set_clipboard_data(n)&&Cs.tips?.tip_success("复制成功🍊")})}},{usable:!0,title:"文字环绕",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!0,mouseenter:()=>function(e){return{title:"文字环绕",active:[],menus:[{usable:!0,title:"无环绕",icon:["iconfont","icon-close"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.clear_float())}},{usable:!0,title:"左环绕",icon:["iconfont","icon-floatleft"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float("L"))}},{usable:!0,title:"右环绕",icon:["iconfont","icon-floatright"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float("R"))}}]}}(e),click(e){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof Dd?ho.menu=function(e){const t=[...qo(e,!1),{usable:!0,title:"向下插入行",shortcut:"ctrl + enter",icon:["iconfont","icon-cc-arrow-down-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const i=n.find_upstream_untill(e);i instanceof Ql&&Do(e,Math.floor(i.index/2)+1)}},{usable:!0,title:"向上插入行",shortcut:"ctrl + shift + enter",icon:["iconfont","icon-cc-arrow-up-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const i=n.find_upstream_untill(e);i instanceof Ql&&Do(e,Math.floor(i.index/2))}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof Td&&(ho.menu=function(e){const t=[...qo(e),{usable:!e.exceptions,title:"添加异常块",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){e.add_exceptions()}}];return{title:e.meta.cubename,active:[],menus:t}}(t))}function Bo(e,t,n,i=5){e.width,Math.abs(e.y-n.y),e.width,Math.abs(e.height-(n.y+n.height)),Math.abs(n.x-e.x),e.height;const r={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(Es.MathRect.can_include_size(r,t)){const r=n.y+t.height-e.height;return{x:n.x+n.width+i,y:r<0?n.y:n.y-r}}{const r=n.y+t.height-e.height;return{x:n.x-t.width-i,y:r<0?n.y:n.y-r}}}function jo(e,t){const{courier:n,history:i}=e,r=n.get_recorder(),s=e.pcube;if("A"===t)if(e instanceof $l){const t=$l.get_default();r.tell(s,Rs.insert_child(s.id,[t],e.index+1))}else{const t=Wl.get_default(),n=Rs.insert_child(s.id,[t],e.index+1);r.tell(s,n)}else if("B"===t&&e)if(e instanceof $l){const t=$l.get_default();r.tell(s,Rs.insert_child(s.id,[t],e.index))}else{const t=Wl.get_default(),n=Rs.insert_child(s.id,[t],e.index);r.tell(s,n)}i.record(r)}function qo(e,t=!1){const n=[{usable:!0,title:"向前插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){jo(e,"B")}},{usable:!0,title:"向后插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){jo(e,"A")}}],i={usable:!0,title:"全屏",icon:["iconfont","icon-square"],has_submenu:!1,mouseenter(e){},click(t){e.dom?.requestFullscreen()}};return t&&n.push(i),n}const Ho=["id","data-type"],Fo={class:"tools-left"},$o={class:"tools-right"},Go=["src","loading"],Vo=Bn({__name:"cube-img",props:{cube:{}},setup(e){const{root:t,stats:i}=e.cube,r={isdown:!1,ismove:!1,x:0,width:-1,dir:"left",width_origin:500},s=It({resize_origin_width:-1,resize_result:-1,resize_scroll:!1}),o=t.id,a=Cs.url,l=t=>co(t,e.cube,"left",r),c=t=>co(t,e.cube,"right",r),d=t=>function(e,t,n){if(!n.isdown||!n.dom)return;n.ismove=!0,e.preventDefault();const i="left"===n.dir?1:-1,r=e.clientX-n.x,s=Math.abs(n.width-r*i);t.data.css.width=s+"px",n.width_result=s}(t,e.cube,r),h=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:r}=t.root,s=new Os(i);s.tell(t,Rs.set_css(t.id,{width:n.width_result+"px"})),r.record(s)}(0,e.cube,r),u=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:r}=t.root,s=new Os(i);s.tell(t,Rs.set_css(t.id,{width:n.width_result+"px"})),r.record(s)}(0,e.cube,r);function p(t){const n=t.currentTarget.parentElement;Object.assign(n.style,e.cube.css),n.classList.add("cube-img-load-failed")}function f(t){if(!s.resize_scroll)return;const{deltaY:n}=t,i=t.currentTarget;if(!i)return;t.preventDefault(),t.stopPropagation();let r=lo(i,e.cube)+10*Math.sign(n);e.cube.data.css.width=r+"px",s.resize_result=r}return ni(()=>{document.documentElement.addEventListener("pointermove",d),document.documentElement.addEventListener("pointerup",h),document.documentElement.addEventListener("pointercancel",u)}),oi(()=>{document.documentElement.removeEventListener("pointermove",d),document.documentElement.removeEventListener("pointerup",h),document.documentElement.removeEventListener("pointercancel",u)}),(r,d)=>(Nr(),Dr("div",{class:ve(["cube-img",{"resize-scroll":s.resize_scroll}]),style:me(r.cube.css),id:r.cube.id,"data-type":Zt(n).img,onContextmenu:d[1]||(d[1]=e=>Zt(Io)(e,r.cube)),onWheel:f},[Fr("div",Fo,[Fr("div",{class:"dragger",onPointerdown:l},null,32)]),Fr("div",$o,[Fr("div",{class:"dragger",onPointerdown:c},null,32)]),Fr("img",{style:me(r.cube.css),src:t.isdev?e.cube.info:a?a(o,"image",e.cube.info):void 0,alt:"",onErrorOnce:p,onClick:d[0]||(d[0]=t=>function(t){const n=t.currentTarget;if(s.resize_scroll=!s.resize_scroll)s.resize_origin_width=lo(n,e.cube);else{if(s.resize_origin_width<0||s.resize_result<0)return;const{courier:t,history:n}=e.cube.root;e.cube.data.css.width=s.resize_origin_width+"px";const i=t.get_recorder();i.tell(e.cube,Rs.set_css(e.cube.id,{width:s.resize_result+"px"})),n.record(i)}}(t)),loading:Zt(i).mode===Zt(z).export?"eager":"lazy"},null,44,Go),Yr(' <div class="tools-img">\r\n <div class="iconfont icon-floatleft" @click="() => float(\'L\')"></div>\r\n <div class="iconfont icon-floatright" @click="() => float(\'R\')"></div>\r\n <div class="iconfont icon-close" @click="clear"></div>\r\n </div> ')],46,Ho))}});var Uo=r(6960);const Wo=(0,Uo.A)(Vo,[["__scopeId","data-v-14032bda"]]);class Yo extends ro{_component=Wo;_children=[];get is_empty(){return 0===this.data.info.trim().length}get children(){return this._children}get meta(){return Yo.meta}get component(){return this._component}constructor(e,t){super(e,t);const n=this.setup(e,t),i=this.clipboard.pasted_from;return i&&this.event.emit_asset_copy(i.noteid,"image",e.info),n}build_child(){}update_data(e,t){return Yo.update_data(e,t)}float(e){const{courier:t}=this.root,n={float:"L"===e?"inline-start":"inline-end"},i=t.get_recorder(),r=Rs.set_css(this.id,n,!0);return i.tell(this,r),i}clear_float(){const{courier:e}=this.root,t=e.get_recorder(),n=Rs.set_css(this.id,{float:null},!0);return t.tell(this,n),t}gc(){super.base_gc()}export(){return this.base_export()}replace_id(e,t={}){return Yo.replace_id(this.root,e,t)}static get meta(){return{type:n.img,cubename:"图片",block:!1,version:2,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,t}static get_default(e="",t={},i={}){return{id:Ts.get_id(),type:n.img,info:e,css:t,attrs:i}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:(1===e&&t.info.startsWith("image://")&&(t.info=t.info.slice(8)),{data:t,usable:!0})}}const Xo=["id","data-type"],Ko={class:"lost-info"},Jo=Bn({__name:"cube-lost",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Dr("div",{class:"cube-lost",id:e.cube.id,"data-type":Zt(n).lost,style:me(e.cube.css)},[t[2]||(t[2]=Fr("div",{class:"lost-title"},"异常方块",-1)),Fr("div",Ko,[t[0]||(t[0]=Fr("div",null,"方块类型:",-1)),Fr("div",null,Ce(e.cube.cube_name),1),t[1]||(t[1]=Fr("div",null,"异常原因:",-1)),Fr("div",null,Ce(e.cube.msg),1)])],12,Xo))}),Qo=(0,Uo.A)(Jo,[["__scopeId","data-v-0b0feb78"]]);class Zo extends ro{_msg=Kt("");get msg(){return this._msg.value}set msg(e){this._msg.value=e}_component=Qo;get component(){return this._component}get meta(){return Zo.meta}get cube_name(){return this.data.type}get is_empty(){return!1}get children(){return[]}constructor(e,t,n){super(e,t),e&&this.setup(e,t),this.msg=n}build_child(){}update_data(e,t){return Zo.update_data(e,t)}gc(){}replace_id(e,t={}){return Zo.replace_id(this.root,e,t)}export(){const e=this.base_export();return e.attrs.postil&&(e.info.attrs.postil=e.attrs.postil),e}on_cursor_in_head(e){const{courier:t,next_cube:n}=this,i=new Os(t);return n&&i.tell(n,Ls.in_head(n.id)),i}on_cursor_in_tail(e){const{courier:t,prev_cube:n}=this,i=new Os(t);return n&&i.tell(n,Ls.in_head(n.id)),i}static get_default(e){return{id:Ms(),type:n.lost,info:e,css:{},attrs:{}}}static get meta(){return{cubename:"异常方块",type:n.lost,block:!1,version:1,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}const ea=["id","data-type"],ta=Bn({__name:"cube-text",props:{cube:{}},setup(e){function t(){const t=e.cube.postil;t&&t.visible(!t.show)}return(e,i)=>(Nr(),Dr("span",{class:ve(["cube-text",{"text-mark":e.cube.has_postil}]),style:me(e.cube.css),onClick:t,id:e.cube.id,"data-type":Zt(n).text},Ce(e.cube.text),15,ea))}}),na=(0,Uo.A)(ta,[["__scopeId","data-v-494c8a06"]]),ia=Bn({__name:"cube-view",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Ir(pi(e.cube.component),{cube:Ut(e.cube)},null,8,["cube"]))});class ra{static get icons(){return{annotation:"icon-Annotation",down:"icon-cc-arrow-down-square",left:"icon-cc-arrow-left-square",right:"icon-cc-arrow-right-square",up:"icon-cc-arrow-up-square",eraser:"icon-eraser",table_merge:"icon-hebingdanyuange",table_unmerge:"icon-quxiaohebingdanyuange",img:"icon-img",table:"icon-grid",table_delete_row:"icon-shanchuhang",table_delete_col:"icon-shanchulie",table_delete_cell:"icon-list-delete-cell",table_title:"icon-a-Addheader2x",table_expand_col:"icon-expand-horizontal-1--expand-resize-bigger-horizont",table_shrink_col:"icon-shrink-horizontal-1--resize-shrink-bigger-horizont",info:"icon-info",info2:"icon-error",rename:"icon-rename",copy:"icon-copy",delete:"icon-Delete",close:"icon-close",add:"icon-add",fold:"icon-fold"}}}const sa=["id","data-type"],oa={class:"iconbox"},aa=Bn({__name:"cube-annotation",props:{cube:{}},setup(e){const t=It({fold:!1});function i(){const{courier:t,history:n}=e.cube.root,i=e.cube.pcube,r=e.cube.index,s=new Os(t);s.tell(i,Rs.delete_child(i.id,"backward",[r,r+1])),n.record(s)}function r(){t.fold=!t.fold}return(e,s)=>(Nr(),Dr("div",{class:"cube-annotation",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).annotation},[Fr("div",oa,[Fr("div",{class:ve(["iconfont",Zt(ra).icons.fold,t.fold?"annotation-icon-active":""]),onClick:r,title:"折叠批注块"},null,2),Fr("div",{class:"iconfont icon-Delete",onClick:i,title:"删除批注块"})]),t.fold?Yr("v-if",!0):(Nr(),Dr("div",{key:0,class:ve(["annotation-contents",{"annotation-fold":t.fold}])},[(Nr(!0),Dr(Cr,null,_i(e.cube.children,e=>(Nr(),Ir(ia,{key:e.id,cube:e,class:"annotation-box"},null,8,["cube"]))),128))],2))],12,sa))}}),la=(0,Uo.A)(aa,[["__scopeId","data-v-b157e116"]]);function ca(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class da extends ro{constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get component(){return la}get meta(){return da.meta}init(){}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}build_child(e){const t=Ts.build_cubes(e.info,this);this._children.push(...t)}update_data(e,t){return da.update_data(e,t)}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof ro&&r.push(e.export());return{children:i,data:r}}replace_id(e,t={}){return da.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Rs.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,Ls.in_head(a.id)):r.tell(this.child_last,Ls.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,s=t.get_recorder();s.add_cmd(e);const{dir:o,range:a}=e,[l,c]=a;let d=l<0?0:l,h=c>this.child_count?this.child_count:c;if(d>=h)return;if(d<=0&&h>=this.child_count)return this.is_empty?s.tell(r,Rs.delete_child(n,o,[i,i+1])):s.tell(this,Rs.reset(this.id,[])),s;const u=this.children[d-1],p=this.children[h],f=h-d;let m=this.splice(l,f);return s.add_recover(Rs.insert_child(this.id,m.data,l)),"backward"===o?u?s.tell(u,Ls.in_tail(u.id)):p&&s.tell(p,Ls.in_head(p.id)):"forward"===o&&(p?s.tell(p,Ls.in_head(p.id)):u&&s.tell(u,Ls.in_tail(u.id))),s}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new Os(t),s=[];for(let e of this.children)s.push(e.export());const o=Ts.build_cubes(i,this);this.splice(0,this.child_count,...o);return r.add_recover(Rs.reset(this.id,s)),r}static get meta(){return{cubename:"批注",type:n.annotation,block:!0,version:1,show:!1}}static get_default(e={},t={}){const i={id:Ms(),type:n.text,info:"",attrs:{},css:{}},r={id:Ms(),type:n.line,info:[i],attrs:{},css:{}},s={id:Ms(),type:n.box,info:[r],attrs:{},css:{}};return{id:Ms(),type:n.annotation,info:[s],css:e,attrs:t}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;let s=[];for(let i of t.info){const t=zs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}ca([Fs(i.cube_insert_child)],da.prototype,"on_insert_child",null),ca([Fs(i.cube_delete_child)],da.prototype,"on_delete_child",null),ca([Fs(i.cube_reset)],da.prototype,"on_reset",null);const ha=["id","data-type"],ua={class:"title"},pa=Bn({__name:"cube-text-link",props:{cube:{}},setup(e){function t(){const t=document.createElement("a");t.href=e.cube.data.info.url,t.target="_blank",t.click()}function i(){e.cube.event.emit_text_link_edit(e.cube)}function r(){const{courier:t,history:n}=e.cube.root,{pcube:i,index:r}=e.cube,s=new Os(t);s.tell(i,Rs.delete_child(i.id,"backward",[r,r+1])),n.record(s)}return(e,s)=>(Nr(),Dr("div",{class:"cube-link",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).link},[Fr("div",ua,Ce(e.cube.data.info.title),1),Fr("div",{class:"link",onClick:t},Ce(e.cube.data.info.url),1),Fr("div",{class:"iconbox"},[Fr("div",{class:"iconfont icon-rename",onClick:i}),Fr("div",{class:"iconfont icon-Delete",onClick:r})])],12,ha))}}),fa=(0,Uo.A)(pa,[["__scopeId","data-v-2946c9fa"]]);class ma{static update(e,t,n){return{id:e,name:u.update,title:t,url:n}}}class _a extends ro{constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return fa}get meta(){return _a.meta}get url(){return this.data.info.url}get title(){return this.data.info.title}build_child(e){}gc(){}export(){return this.base_export()}replace_id(e,t={}){return _a.replace_id(this.root,e,t)}update_data(e,t){return _a.update_data(e,t)}on_update_info(e){const{courier:t,cursor:n}=this,{url:i,title:r}=e,s=t.get_recorder();s.add_cmd(e);const o=this.info.title,a=this.info.url;return this.info.url=i,this.info.title=r,s.add_recover(ma.update(this.id,o,a)),s}static get meta(){return{cubename:"文本链接",type:n.link,block:!0,show:!1,version:1}}static get_default(e,t,i={},r={}){return{id:Ms(),type:n.link,info:{url:e,title:t},css:i,attrs:r}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([Fs(u.update)],_a.prototype,"on_update_info",null);const ga=["id","data-type"],ba=Bn({__name:"cube-postil",props:{cube:{}},setup(e){const t=vs(()=>e.cube.children.filter(e=>e instanceof _a)),i=vs(()=>e.cube.children.filter(e=>!(e instanceof _a))),r=vs(()=>({...e.cube.css}));function s(){e.cube.visible(!1)}function o(){const{courier:t,history:n}=e.cube.root,i=e.cube.pcube,r=new Os(t);r.tell(i,Rs.postil_remove(i.id,[0,e.cube.child_count])),n.record(r)}function a(e){e.preventDefault(),e.stopPropagation();const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const{deltaY:n}=e;n>0?Es.DomAnimation.scroll_element(t,20,"vertical"):Es.DomAnimation.scroll_element(t,-20,"vertical")}return(e,l)=>e.cube.show?(Nr(),Dr("div",{key:0,class:"cube-postil",style:me(r.value),id:e.cube.id,"data-type":Zt(n).postil},[Fr("div",{class:"iconbox"},[Fr("div",{class:"iconfont icon-Delete delete",title:"清空",onClick:o}),Fr("div",{class:"iconfont icon-close close",title:"关闭",onClick:s})]),Fr("div",{class:"mark-contents",onWheel:a},[(Nr(!0),Dr(Cr,null,_i(t.value,e=>(Nr(),Ir(ia,{key:e.id,cube:e},null,8,["cube"]))),128)),(Nr(!0),Dr(Cr,null,_i(i.value,e=>(Nr(),Ir(ia,{key:e.id,cube:e},null,8,["cube"]))),128))],32)],12,ga)):Yr("v-if",!0)}}),ya=(0,Uo.A)(ba,[["__scopeId","data-v-7ca0a800"]]);function va(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class wa extends ro{_handler_update_pos;_handler_corrent;_timer_corrent;_show=Kt(!1);constructor(e,t){super(e,t);const n=this.setup(e,t);return t.has_postil=!0,n}get default_size(){return{x:0,y:0,width:180,height:130}}get show(){return this._show.value}set show(e){this._show.value=e,e&&this.root.listener.check_float()}get has_annotation(){for(let e of this.children)if(e instanceof da)return!0;return!1}get meta(){return wa.meta}get component(){return ya}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}build_child(e){const t=Ts.build_cubes(e.info,this);this._children.push(...t)}update_data(e,t){return wa.update_data(e,t)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}gc(){super.base_gc(),this.root.cubes.remove_cube(this),this._handler_update_pos&&(this.root.event.off(this._handler_update_pos),this._handler_update_pos=null)}replace_id(e,t={}){return wa.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Rs.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,Ls.in_head(a.id)):r.tell(this.child_last,Ls.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,s=t.get_recorder();s.add_cmd(e);const{dir:o,range:a}=e,[l,c]=a;let d=l<0?0:l,h=c>this.child_count?this.child_count:c;if(d>=h)return;if(d<=0&&h>=this.child_count)return s.tell(this,Rs.reset(this.id,[])),s;const u=this.children[d-1],p=this.children[h],f=h-d;let m=this.splice(l,f);return s.add_recover(Rs.insert_child(this.id,m.data,l)),"backward"===o?u?s.tell(u,Ls.in_tail(u.id)):p&&s.tell(p,Ls.in_head(p.id)):"forward"===o&&(p?s.tell(p,Ls.in_head(p.id)):u&&s.tell(u,Ls.in_tail(u.id))),s}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new Os(t),s=[];for(let e of this.children)s.push(e.export());const o=Ts.build_cubes(i,this);this.splice(0,this.child_count,...o);return r.add_recover(Rs.reset(this.id,s)),r}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof ro&&r.push(e.export());return{children:i,data:r}}visible(e){if(e){const{courier:e,child_last:t}=this;this.update_pos(),this.show=!0,yn(()=>{const n=e.get_recorder();n.tell(t,Ls.in_tail(t.id)),this.history.record(n)})}else this.show=!1}update_pos(e=!0){yn(()=>{const e=this.pcube.clientRect,t=this.clientRect||this.default_size;if(!e)return void(this.show=!1);const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},i=Es.MathRect.move_rect_to_other(n,t,e,5);this.data.css.left=`${i.x}px`,this.data.css.top=`${i.y}px`})}static get_default(e=[],t={}){return{id:Ms(),type:n.postil,info:e,attrs:{},css:t}}static get meta(){return{cubename:"标注内容",type:n.postil,show:!1,version:1,block:!0}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=zs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}va([Fs(i.cube_insert_child)],wa.prototype,"on_insert_child",null),va([Fs(i.cube_delete_child)],wa.prototype,"on_delete_child",null),va([Fs(i.cube_reset)],wa.prototype,"on_reset",null);class xa{static reset(e,t){return{id:e,name:c.text_reset,info:t}}static break(e,t){return{id:e,name:c.text_break,offset:t}}}function ka(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Sa extends ro{_component=na;get attrs(){return this.data.attrs}get component(){return this._component}get meta(){return Sa.meta}get is_empty(){return Sa.is_empty_text(this.data)}get len(){return this.text.length}get text(){return this.data.info}get text_node(){const e=this.dom?.firstChild;if(e instanceof Text)return e}get children(){return[]}get line(){let e=this.pcube;for(;e;){if(e instanceof Wl)return e;e=e.pcube}}constructor(e,t){super(e,t);const n=this.setup(e,t);this.data.info=this.data.info.replace("\r","");return this.data.info||(this.data.info=""),this.init(),n}init(){this.root.stats.update_count_word(this.len)}build_child(e){const t=e.attrs?.postil;t&&(this.postil=new wa(t,this))}gc(){super.base_gc(),this.root.stats.update_count_word(-this.len)}replace_id(e,t={}){return Sa.replace_id(this.root,e,t)}find_child_cube(e){}export(){return this.base_export()}update_data(e,t){return Sa.update_data(e,t)}merge_text(e){const{courier:t}=this,n=t.get_recorder(),i=this.prev_cube,r=this.next_cube,s=i instanceof Sa,o=r instanceof Sa;if(s&&o){const t=Rs.merge(this.id,"both",this.id,e);n.tell(this,t)}else if(s){const t=Rs.merge(this.id,"left",this.id,e);n.tell(this,t)}else if(o){const t=Rs.merge(this.id,"right",this.id,e);n.tell(this,t)}return n}on_cursor_loc(e){const{from:t,from_offset:n,offset:i}=e,{courier:r}=this,s=r.get_recorder();return s.add_cmd(e),this.set_cursor_in_head(i),s.add_recover(Ls.loc(t,n,this.id,i)),s}on_partition(e){const{courier:t,cursor:n,pcube:i}=this,{start_id:r,end_id:s,offset_end:o,offset_start:a}=e,l=this.get_valid_index(a),c=this.get_valid_index(o),d=new Os(t),h=this.text.slice(0,l),u=this.text.slice(l,c),p=this.text.slice(c);if(u){const e=Sa.get_default(u,structuredClone(Vt(this.css)));if(h){if(h){const t=xa.reset(this.id,h),n=Ls.loc(this.id,h.length,this.id,h.length);if(d.tell(this,t,n),p){const e=Sa.get_default(p,structuredClone(Vt(this.css)));d.tell(i,Rs.insert_child(i.id,[e],this.index+1))}d.tell(i,Rs.insert_child(i.id,[e],this.index+1))}}else{const e=xa.reset(this.id,u),t=Ls.loc(this.id,u.length,this.id,u.length);if(d.tell(this,e,t),p){const e=Sa.get_default(p,structuredClone(Vt(this.css)));d.tell(i,Rs.insert_child(i.id,[e],this.index+1))}}return d}if(0===l){const e=Sa.get_default();d.tell(i,Rs.insert_child(i.id,[e],this.index))}else if(l===this.len){const e=Sa.get_default();d.tell(i,Rs.insert_child(i.id,[e],this.index+1))}else if(l>0&&l<this.len){const e=Sa.get_default(p,structuredClone(Vt(this.css))),t=Rs.insert_child(i.id,[e],this.index+1),n=xa.reset(this.id,h),r=Ls.loc(this.id,h.length,this.id,h.length);return d.tell(i,t),d.tell(this,n,r),d}return d}on_cube_merge(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r,pid:s,index:o}=this,{method:a,offset:l,cubeid:c}=e;let d=this.get_valid_index(l);const h=new Os(t);if("left"===a&&n instanceof Sa&&this.can_merge_with(n)){const e=n.id,t=Rs.delete_child(s,"forward",[o-1,o]),r=xa.reset(this.id,n.text+this.text),a=Ls.loc(this.id,d+n.len,this.id,d);h.tell(i,t),h.tell(this,r,a),this.event.emit_text_merge(e,this.id)}else if("right"===a&&r instanceof Sa&&this.can_merge_with(r)){const e=r.id,t=Rs.delete_child(s,"backward",[o+1,o+2]),n=xa.reset(this.id,this.text+r.text),a=Ls.loc(this.id,d,this.id,d);h.tell(i,t),h.tell(this,n,a),this.event.emit_text_merge(e,this.id)}else if("both"===a)if(n instanceof Sa&&r instanceof Sa&&this.can_merge_with(n)&&this.can_merge_with(r)){const e=n.len+d,t=n.id,s=r.id;h.tell(i,Rs.delete_child(this.pid,"backward",[this.index-1,this.index])),h.tell(i,Rs.delete_child(this.pid,"backward",[this.index+1,this.index+2])),h.tell(this,xa.reset(this.id,n.text+this.text+r.text)),h.tell(this,Ls.loc(this.id,e,this.id,d)),this.event.emit_text_merge(t,this.id),this.event.emit_text_merge(s,this.id)}else if(n instanceof Sa&&this.can_merge_with(n)){const e=n.id;h.tell(i,Rs.delete_child(s,"forward",[o-1,o])),h.tell(this,xa.reset(this.id,n.text+this.text)),h.tell(this,Ls.loc(this.id,d+n.len,this.id,d)),this.event.emit_text_merge(e,this.id)}else if(r instanceof Sa&&this.can_merge_with(r)){const e=r.id;h.tell(i,Rs.delete_child(s,"backward",[o+1,o+2])),h.tell(this,xa.reset(this.id,this.text+r.text)),h.tell(this,Ls.loc(this.id,d,this.id,d)),this.event.emit_text_merge(e,this.id)}return h}on_cube_insert(e){const{data:t,start_id:n,end_id:i,offset_end:r,offset_start:s}=e,{courier:o,pid:a,pcube:l}=this,c=new Os(o);this.cursor.has_selection;let d=s,h=r;if(d<0&&(d=0),h>this.text.length&&(h=this.text.length),r!==s){const e=Rs.delete(this.id,"backward",this.id,this.id,s,r,!0);c.tell(this,e)}const u=Ts.pick(t),p=this.text.slice(0,d),f=this.text.slice(h);if(u.head.length>0)if(p)if(p&&f){const e=xa.reset(this.id,p),t=Ls.loc(this.id,p.length,this.id,p.length);c.tell(this,e,t);const n=Sa.get_default(f,structuredClone(Vt(this.css)),structuredClone(Vt(this.attrs)));c.tell(l,Rs.insert_child(a,[n],this.index+1)),c.tell(l,Rs.insert_child(a,u.head,this.index+1))}else f||c.tell(l,Rs.insert_child(a,u.head,this.index+1));else c.tell(l,Rs.insert_child(a,u.head,this.index));const m=[...u.body];if(u.tail.length>0&&m.push(Wl.get_default(u.tail)),u.root.length>0)for(let e of u.root)m.push(...e.info);if(m.length>0){if(0===u.head.length&&r>0&&r<this.len){const e=xa.reset(this.id,p),t=Ls.loc(this.id,p.length,this.id,p.length);c.tell(this,e,t);const n=Sa.get_default(f,structuredClone(Vt(this.css)),structuredClone(Vt(this.attrs)));c.tell(l,Rs.insert_child(a,[n],this.index+1))}c.tell(l,Rs.insert_child(this.pid,m,this.index+u.head.length+1))}return c}on_cube_delete(e){const{courier:t,index:n,pcube:i,pid:r}=this,{dir:s,start_id:o,end_id:a,offset_start:l,offset_end:c,reserve:d}=e,h=new Os(t),u=this.get_valid_index(l),p=this.get_valid_index(c),f=u!==p||"head"===l||"tail"===c;if(0===u&&p===this.len){if(d){const e=xa.reset(this.id,""),t=Ls.loc(this.id,1,this.id,this.len);h.tell(this,e,t)}else h.tell(i,Rs.delete_child(r,"backward",[n,n+1]));return h}const m=this.text.slice(0,u),_=this.text.slice(p);if(f){const e=xa.reset(this.id,m+_),t=Ls.loc(this.id,u,this.id,p);h.tell(this,e,t)}else{const e=u;if("backward"===s)if(0===e||0===Sa.drop_zero_width_space(this.text,u).pos)if(this.pcube.is_empty&&this.pcube instanceof ro)h.merge(this.pcube.remove_self());else{const e=this.prev_cube_deep;if(!e)return;if(e.meta.block){const t=e.pcube;t&&h.merge(t.delete_edge(this,s))}else h.tell(e,Rs.delete_adjacent(e.id,"right",this.id,0))}else if(this.is_empty)h.tell(i,Rs.delete_child(r,"backward",[n,n+1]));else{const e=this.find_text_deleted(u,"left"),t=xa.reset(this.id,e.text),n=Ls.loc(this.id,e.pos,this.id,m.length);h.tell(this,t,n),e.text&&h.tell(this,Rs.merge(this.id,"both",this.id,m.length-1))}else if("forward"===s)if(e===this.len||e===Sa.drop_zero_width_space(this.text,u).len)if(this.pcube.is_empty&&this.pcube instanceof ro)h.merge(this.pcube.remove_self());else{const e=this.next_cube_deep;if(!e)return;if(e.meta.block){const t=e?.pcube;t&&h.merge(t.delete_edge(this,s))}else h.tell(e,Rs.delete_adjacent(e.id,"left",this.id,this.len))}else if(this.is_empty)h.tell(i,Rs.delete_child(r,"forward",[n,n+1]));else{const t=this.find_text_deleted(e,"right"),n=xa.reset(this.id,t.text),i=Ls.loc(this.id,m.length,this.id,m.length),r=Rs.merge(this.id,"both",this.id,m.length);h.tell(this,n,i),h.tell(this,r)}}return h}on_text_reset(e){const{courier:t,pid:n,index:i,pcube:r,len:s}=this,{info:o}=e,a=t.get_recorder();a.add_cmd(e);let l=this.text;!o&&this.is_empty;const c=Sa.drop_zero_intelligence(o,0);return this.data.info=c.text,this.root.stats.update_count_word(c.len-s),a.add_recover(xa.reset(this.id,l)),a}on_cube_set_selection_css(e){const{courier:t,pid:n,pcube:i}=this,{css:r,start_id:s,end_id:o,offset_start:a,offset_end:l,toggle:c,replace:d}=e;if(0===Object.keys(r).length&&!d)return;const h=new Os(t),u=this.get_valid_index(a),p=this.get_valid_index(l),f=Sa.drop_zero_width_space(this.text.slice(0,u),0).text,m=Sa.drop_zero_width_space(this.text.slice(u,p),0).text,_=Sa.drop_zero_width_space(this.text.slice(p),0).text;if(0===u&&p===this.len||u===p&&s===o)h.tell(this,Rs.set_css(this.id,r,c,d)),h.tell(this,Rs.merge(this.id,"both",this.id,p));else if(0===u&&m){const e=structuredClone(Vt(this.css)),t=xa.reset(this.id,m),s=Ls.loc(this.id,p,this.id,p);if(h.tell(this,t,s),h.tell(this,Rs.set_css(this.id,r,c,d)),_){const t=Sa.get_default(_,e);h.tell(i,Rs.insert_child(n,[t],this.index+1));const r=i.find_cube(t.id);r&&h.tell(r,Rs.merge(t.id,"both",t.id,0))}h.tell(this,Ls.in_tail(this.id)),h.tell(this,Rs.merge(this.id,"left",this.id,this.len))}else if(u>0){if(f){const e=xa.reset(this.id,f),t=Ls.loc(this.id,u,this.id,u),n=Rs.merge(this.id,"left",this.id,p);h.tell(this,e,t,n)}if(_){const e=Sa.get_default(_,structuredClone(Vt(this.css))),t=[e];h.tell(i,Rs.insert_child(n,t,this.index+1));const r=i.find_cube(e.id);r&&h.tell(r,Rs.merge(r.id,"right",r.id,0))}if(m){const e=Sa.get_default(m,structuredClone(Vt(this.css)));h.tell(i,Rs.insert_child(n,[e],this.index+1));const t=i.find_cube(e.id);t&&(h.tell(t,Rs.set_css(e.id,r,c,d)),h.tell(t,Rs.merge(e.id,"both",e.id,f.length+u)))}}return h}on_cube_break(e){const{courier:t,cursor:n,pcube:i,pid:r,index:s}=this,o=i.pcube;if(!o)return;const{offset:a}=e;let l=s+1;const c=new Os(t),d=this.text[a-1],h=this.text[a];let u=a,p=!1;if(d){const e=d.charCodeAt(0);55296<=e&&e<=56319&&(p=!0)}if(h&&!p){const e=h.charCodeAt(0);56320<=e&&e<=57343&&(p=!0)}p&&(u+=1),c.tell(this,Rs.partition(this.id,this.id,this.id,u,u));const f=[];for(let e of i.children.slice(l))f.push(e.export());c.tell(i,Rs.delete_child(i.id,"backward",[l,i.child_count]));const m=Wl.get_default(f),_=this.line;_&&_.inherit_line([m]),c.tell(o,Rs.insert_child(o.id,[m],i.index+1));const g=i.next_cube;return g?.id===m.id&&c.tell(g,Ls.in_head(g.id)),c}on_cube_delete_adjacent(e){const{courier:t,pcube:n}=this,{from:i,from_id:r,offset:s}=e,o=new Os(t);if("left"===i)if(this.is_empty)o.merge(this.remove_self());else{const e=this.prev_cube_deep;e?.meta.block?o.tell(this,Ls.in_head(this.id)):o.tell(this,Rs.delete(this.id,"forward",this.id,this.id,0,0))}else if(this.is_empty)o.merge(this.remove_self());else{const e=this.next_cube_deep;e?.meta.block?o.tell(this,Ls.in_tail(this.id)):o.tell(this,Rs.delete(this.id,"backward",this.id,this.id,this.len,this.len))}return o}add_link(e,t){const{cursor:n,courier:i}=this,r=i.get_recorder(),s=_a.get_default(t,e);return r.tell(this,Rs.postil_add(this.id,[s])),r}add_annotation(e){const t=this.courier.get_recorder(),n=e||da.get_default();return t.tell(this,Rs.postil_add(this.id,[n])),t}get_valid_index(e){return"head"===e?0:"tail"===e?this.text.length:e<0?0:e>this.text.length?this.text.length:e}set_cursor_in_head(e=0){const t=this.get_valid_index(e);yn(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}set_cursor_in_tail(e=0){let t=this.len-this.get_valid_index(e);yn(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}find_text_nav_pos(e,t){const n=this.text;let i=e;if(e<0&&(i=0),e>n.length&&(i=n.length),"left"===t){let e=i-1,t=n[e];for(;""===t&&e>=0;)e-=1,t=n[e];if(t){const n=t.charCodeAt(0);56320<=n&&n<=57343&&(e-=1)}return e<0?0:e}{let e=i+1,t=n[e];for(;""===t&&e<n.length;)e+=1,t=n[e];if(t){const n=t.charCodeAt(0);55296<=n&&n<=56319&&(e+=1)}return e>n.length?n.length:e}}find_text_deleted(e,t){if(e<0)return{text:this.text,pos:0};if(e>this.len)return{text:this.text,pos:this.len};if("left"===t){let n=this.find_text_nav_pos(e,t),i=this.text.slice(0,n),r=this.text.slice(e),s=i[i.length-1];if(s){const t=s.charCodeAt(0);55296<=t&&t<=56319&&(i=i.slice(0,-1),e-=1)}return{text:i+r,pos:n}}{let n=this.find_text_nav_pos(e,t),i=this.text.slice(0,e),r=this.text.slice(n),s=r[0];if(s){const e=s.charCodeAt(0);56320<=e&&e<=57343&&(r=r.slice(1))}return{text:i+r,pos:e}}}is_text_remain(e,t){if(0===this.len)return!1;const[n,i]=t;if(n===i){if("backward"===e){return 0!==this.find_text_nav_pos(n,"left")||this.find_text_nav_pos(i-1,"right")!==this.len}return this.find_text_nav_pos(n,"right")!==this.len||0!==this.find_text_nav_pos(n,"left")}{if(0===n&&i===this.len)return!1;const e=this.find_text_nav_pos(n+1,"left"),t=this.find_text_nav_pos(i-1,"right");return e>0||t<this.len}}drop_zero_width_space(e){return Sa.drop_zero_width_space(this.text,e)}can_merge_with(e){const t=Ts.is_same_style(this.css,e.css)||0===Object.keys(e.css).length,n=Ts.is_same_attrs(this.attrs,e.attrs),i=!this.postil&&!e.postil;return t&&n&&i}static drop_zero_width_space(e,t){let n="",i=t;i<0&&(i=0),i>e.length&&(i=e.length);const r=e.slice(0,i),s=e.slice(i);if(r){for(let e of r)""!==e&&(n+=e);i=n.length}if(s)for(let e of s)""!==e&&(n+=e);return{text:n,pos:i,get len(){return this.text.length}}}static drop_zero_intelligence(e,t){let n="",i=t;i<0&&(i=0),i>e.length&&(i=e.length);const r=e.slice(0,i),s=e.slice(i);if(r){for(let e=0;e<r.length;e++){let t=r[e],i=r[e-1];""===t&&"\n"!==i||(n+=t)}i=n.length}if(s)for(let e=0;e<s.length;e++){let t=s[e],i=s[e-1];""===t&&"\n"!==i||(n+=t)}return n||(n="",i=1),{text:n,pos:i,get len(){return this.text.length}}}static is_empty_text(e){if(e.type!==n.text)return!1;let t="";for(let n of e.info)if(""!==n&&(t+=n),t.length>0)return!1;return 0===t.length}static get meta(){return{version:1,type:n.text,cubename:"文本",block:!1,show:!1}}static get_default(e="",t={},i={}){const r=e||"";return{id:Ms(),type:n.text,info:r,css:structuredClone(Vt(t)),attrs:structuredClone(Vt(i))}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,e.event.emit_replace_id(i,r),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}ka([Fs(o.loc)],Sa.prototype,"on_cursor_loc",null),ka([Fs(i.cube_partition)],Sa.prototype,"on_partition",null),ka([Fs(i.cube_merge)],Sa.prototype,"on_cube_merge",null),ka([Fs(i.cube_insert)],Sa.prototype,"on_cube_insert",null),ka([Fs(i.cube_delete)],Sa.prototype,"on_cube_delete",null),ka([Fs(c.text_reset)],Sa.prototype,"on_text_reset",null),ka([Fs(i.cube_set_selection_css)],Sa.prototype,"on_cube_set_selection_css",null),ka([Fs(c.text_break)],Sa.prototype,"on_cube_break",null),ka([Fs(i.cube_delete_adjacent)],Sa.prototype,"on_cube_delete_adjacent",null);const Ca=["id","data-type","contenteditable"],Ma=Bn({__name:"cube-line",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Dr("div",{class:ve(["cube-line",{"line-first-letter-lower":e.cube.attrs.first_letter_lower}]),id:e.cube.id,"data-type":Zt(n).line,style:me(e.cube.css),contenteditable:e.cube.editable,spellcheck:"false"},[(Nr(!0),Dr(Cr,null,_i(e.cube.children,e=>(Nr(),Ir(ia,{key:e.id,cube:e},null,8,["cube"]))),128))],14,Ca))}),za=(0,Uo.A)(Ma,[["__scopeId","data-v-f72cf81e"]]);let Ta;const Aa="undefined"!=typeof window&&window.trustedTypes;if(Aa)try{Ta=Aa.createPolicy("vue",{createHTML:e=>e})}catch(e){}const Pa=Ta?e=>Ta.createHTML(e):e=>e,Na="undefined"!=typeof document?document:null,Oa=Na&&Na.createElement("template"),Ra={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r="svg"===t?Na.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?Na.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?Na.createElement(e,{is:n}):Na.createElement(e);return"select"===e&&i&&null!=i.multiple&&r.setAttribute("multiple",i.multiple),r},createText:e=>Na.createTextNode(e),createComment:e=>Na.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Na.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,r,s){const o=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==s&&(r=r.nextSibling););else{Oa.innerHTML=Pa("svg"===i?`<svg>${e}</svg>`:"mathml"===i?`<math>${e}</math>`:e);const r=Oa.content;if("svg"===i||"mathml"===i){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},La=Symbol("_vtc");Boolean;const Ea=Symbol("_vod"),Da=Symbol("_vsh");const Ia=Symbol("");const Ba=/(?:^|;)\s*display\s*:/;const ja=/\s*!important$/;function qa(e,t,n){if($(n))n.forEach(n=>qa(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=Fa[t];if(n)return n;let i=re(t);if("filter"!==i&&i in e)return Fa[t]=i;i=ae(i);for(let n=0;n<Ha.length;n++){const r=Ha[n]+i;if(r in e)return Fa[t]=r}return t}(e,t);ja.test(n)?e.setProperty(oe(i),n.replace(ja,""),"important"):e[i]=n}}const Ha=["Webkit","Moz","ms"],Fa={};const $a="http://www.w3.org/1999/xlink";function Ga(e,t,n,i,r,s=xe(t)){i&&t.startsWith("xlink:")?null==n?e.removeAttributeNS($a,t.slice(6,t.length)):e.setAttributeNS($a,t,n):null==n||s&&!ke(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Y(n)?String(n):n)}function Va(e,t,n,i,r){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?Pa(n):n));const s=e.tagName;if("value"===t&&"PROGRESS"!==s&&!s.includes("-")){const i="OPTION"===s?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);return i===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let o=!1;if(""===n||null==n){const i=typeof e[t];"boolean"===i?n=ke(n):null==n&&"string"===i?(n="",o=!0):"number"===i&&(n=0,o=!0)}try{e[t]=n}catch(e){0}o&&e.removeAttribute(r||t)}function Ua(e,t,n,i){e.addEventListener(t,n,i)}const Wa=Symbol("_vei");function Ya(e,t,n,i,r=null){const s=e[Wa]||(e[Wa]={}),o=s[t];if(i&&o)o.value=i;else{const[n,a]=function(e){let t;if(Xa.test(e)){let n;for(t={};n=e.match(Xa);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}const n=":"===e[2]?e.slice(3):oe(e.slice(2));return[n,t]}(t);if(i){const o=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();dn(function(e,t){if($(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Qa(),n}(i,r);Ua(e,n,o,a)}else o&&(!function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,o,a),s[t]=void 0)}}const Xa=/(?:Once|Passive|Capture)$/;let Ka=0;const Ja=Promise.resolve(),Qa=()=>Ka||(Ja.then(()=>Ka=0),Ka=Date.now());const Za=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;"undefined"!=typeof HTMLElement&&HTMLElement;Symbol("_moveCb"),Symbol("_enterCb");const el=e=>{const t=e.props["onUpdate:modelValue"]||!1;return $(t)?e=>de(t,e):t};function tl(e){e.target.composing=!0}function nl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const il=Symbol("_assign"),rl={created(e,{modifiers:{lazy:t,trim:n,number:i}},r){e[il]=el(r);const s=i||r.props&&"number"===r.props.type;Ua(e,t?"change":"input",t=>{if(t.target.composing)return;let i=e.value;n&&(i=i.trim()),s&&(i=ue(i)),e[il](i)}),n&&Ua(e,"change",()=>{e.value=e.value.trim()}),t||(Ua(e,"compositionstart",tl),Ua(e,"compositionend",nl),Ua(e,"change",nl))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(e[il]=el(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:ue(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(i&&t===n)return;if(r&&e.value.trim()===a)return}e.value=a}}};const sl=j({patchProp:(e,t,n,i,r,s)=>{const o="svg"===r;"class"===t?function(e,t,n){const i=e[La];i&&(t=(t?[t,...i]:[...i]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,o):"style"===t?function(e,t,n){const i=e.style,r=W(n);let s=!1;if(n&&!r){if(t)if(W(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&qa(i,t,"")}else for(const e in t)null==n[e]&&qa(i,e,"");for(const e in n)"display"===e&&(s=!0),qa(i,e,n[e])}else if(r){if(t!==n){const e=i[Ia];e&&(n+=";"+e),i.cssText=n,s=Ba.test(n)}}else t&&e.removeAttribute("style");Ea in e&&(e[Ea]=s?i.display:"",e[Da]&&(i.display="none"))}(e,n,i):I(t)?B(t)||Ya(e,t,0,i,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,i){if(i)return"innerHTML"===t||"textContent"===t||!!(t in e&&Za(t)&&U(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(Za(t)&&W(n))return!1;return t in e}(e,t,i,o))?(Va(e,t,i),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||Ga(e,t,i,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&W(i)?("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),Ga(e,t,i,o)):Va(e,re(t),i,0,t)}},Ra);let ol;function al(){return ol||(ol=er(sl))}const ll=(...e)=>{const t=al().createApp(...e);const{mount:n}=t;return t.mount=e=>{const i=dl(e);if(!i)return;const r=t._component;U(r)||r.render||r.template||(r.template=i.innerHTML),1===i.nodeType&&(i.textContent="");const s=n(i,!1,cl(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t};function cl(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function dl(e){if(W(e)){return document.querySelector(e)}return e}function hl(e,t){if(t.freeze)return;e.preventDefault(),e.stopPropagation();const{doc:n,stats:i}=t,{deltaY:r,currentTarget:s}=e,o=t.config.data.revert_scope;r>0&&!o?t.expand("down"):t.expand("up")}const ul={class:"iconbox"},pl=Bn({__name:"note-scope",props:{selection:{}},setup(e){const t=vs(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);if(0===t)return;return{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px"}}),n=vs(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);if(0===t)return;return{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px",display:e.selection.pos.width<30?"none":"unset"}});function i(){e.selection.freeze=!e.selection.freeze}function r(t,n,i){t.stopPropagation();const{root:r}=e.selection,s=new Os(r.courier),o=n.get_scope_info(),a=o.cube.children[o.range[0]],l=o.cube.children[o.range[1]-1];if("A"===i&&l)if(l instanceof $l){const e=$l.get_default();s.tell(o.cube,Rs.insert_child(o.cube.id,[e],l.index+1))}else{const e=Wl.get_default(),t=Rs.insert_child(o.cube.id,[e],l.index+1);s.tell(o.cube,t)}else if("B"===i&&a)if(a instanceof $l){const e=$l.get_default();s.tell(o.cube,Rs.insert_child(o.cube.id,[e],a.index))}else{const e=Wl.get_default(),t=Rs.insert_child(o.cube.id,[e],a.index);s.tell(o.cube,t)}r.history.record(s)}function s(t){t.preventDefault(),t.stopPropagation(),e.selection.remove()}return(e,o)=>(Nr(),Dr("div",{class:ve(["doc-scope",{freeze:e.selection.freeze}]),style:me(e.selection.css),onWheel:o[3]||(o[3]=t=>Zt(hl)(t,e.selection)),onClick:i,onContextmenu:s},[Fr("div",ul,[Fr("div",{class:"iconfont icon-a-copy",style:me(n.value),title:"在上方插入行",onClick:o[0]||(o[0]=t=>r(t,e.selection,"A"))},null,4),Fr("div",{class:"iconfont icon-force_vortex-copy",title:"取消选区",style:me(t.value),onClick:o[1]||(o[1]=()=>e.selection.remove())},null,4),Fr("div",{class:"iconfont icon-B-copy",style:me(n.value),title:"在上方插入行",onClick:o[2]||(o[2]=t=>r(t,e.selection,"B"))},null,4)])],38))}}),fl=(0,Uo.A)(pl,[["__scopeId","data-v-bdec0da6"]]);class ml extends Ss{has_down=!1;down_caret=void 0;constructor(e){super(e)}get root(){return this._root}pointerdown(e){if(this.root.stats.is_read_mode)return e.preventDefault();e.preventDefault(),this.has_down=!0,this.down_caret=document.caretPositionFromPoint(e.clientX,e.clientY),this.click_selection_text(e),this.cursor.locate_cursor_by_coor(e.clientX,e.clientY)}pointermove(e){this.stats.view_point={x:e.clientX,y:e.clientY},this.drag_selection_text(e)}pointercancel(e){this.has_down=!1,this.down_caret=null}pointerup(e){e.preventDefault(),this.has_down=!1,this.down_caret=null}beforeinput(e){if(this.stats.in_composition_mode)return;if(this.event.emit_note_input_before(e).some(e=>"stop"===e))return;e.preventDefault();const{courier:t,cursor:n,history:i}=this,r=e.data,{cube_end:s,cube_start:o,cube_selection:a,offset_start:l,offset_end:c}=n;if(!a||!s||!o)return;const d=o.id,h=s.id,u=a.id;if("insertText"===e.inputType){if(!(a instanceof Sa&&r)){const e=t.get_recorder(),n=Sa.get_default(r||""),s=Rs.insert(u,[n],d,h,l,c);return e.tell(a,s),i.record(e)}{const e=t.get_recorder();this.ins(e,this.root,r,a,l,c),i.record(e)}}else if("deleteContentBackward"===e.inputType||"deleteContentForward"===e.inputType){const n=t.get_recorder();if(!this.root.scope_count_normal){let t="deleteContentBackward"===e.inputType?"backward":"forward";const r=Rs.delete(u,t,d,h,l,c);return n.tell(a,r),i.record(n)}{const e=this.clipboard.delete_scope();e&&this.history.record(e)}}}compositionstart(e){this.stats.in_composition_mode=!0,this.clear_selection_text()}compositionupdate(e){this.event.emit_note_compositionupdate(e).some(e=>"stop"===e)}compositionend(e){if(this.event.emit_note_compositionend_before(e).some(e=>"stop"===e))return;const{courier:t,cursor:n,history:i,stats:r,event:s}=this.root;if(n.has_selection)return;if(!r.in_composition_mode)return;const{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n,h=e.data,u=new Os(t);if(l&&o&&a){if(l instanceof Sa){const e=l.text,t=d-h.length,n=`${e.slice(0,t)}${h}${e.slice(t)}`,i=xa.reset(l.id,n),r=Ls.loc(l.id,d,l.id,t);u.tell(l,i,r)}else console.error("编辑目标无法在内存结构中找到,此问题多由于未将子cube计算到children属性");r.in_composition_mode=!1,i.record(u),s.emit_note_compositionend(e)}}clear_selection_text(){const{cursor:e,courier:t,history:n}=this;if(!e.has_selection)return;const{cube_end:i,cube_start:r,cube_selection:s,offset_start:o,offset_end:a}=e;if(!s||!i||!r)return;const l=new Os(t);l.tell(s,Rs.delete(s.id,"backward",r.id,i.id,o,a)),n.record(l)}ins(e,t,n,i,r,s){const{courier:o,history:a}=t,l=i.text,c=l.slice(0,r)+n+l.slice(s),d=r+n.length,h=xa.reset(i.id,c),u=Ls.loc(i.id,d,i.id,r);e.tell(i,h,u);const p=Rs.merge(i.id,"both",i.id,d);return e.tell(i,p),e}click_selection_text(e){if(!this.down_caret||!e.shiftKey)return;const{offset_end:t,node_end:n}=this.cursor,{offset:i,offsetNode:r}=this.down_caret;n instanceof Text&&r instanceof Text&&Promise.resolve().then(()=>{this.cursor.set_selection_between(n,t,r,i)})}drag_selection_text(e){if(!this.has_down||!this.down_caret||!Ts.check_mouse_key(e,"left"))return;const t=document.caretPositionFromPoint(e.clientX,e.clientY);t&&this.down_caret.offsetNode instanceof Text&&t.offsetNode instanceof Text&&this.cursor.set_selection_between(this.down_caret.offsetNode,this.down_caret.offset,t.offsetNode,t.offset)}}class _l extends ml{dragenter(e){e.preventDefault()}dragover(e){e.preventDefault()}dragleave(e){e.preventDefault()}drop(e){e.preventDefault();const{cursor:t}=this.root,{cube_end:n,offset_end:i}=t,r=e.dataTransfer;if(!r)return;const s=new DOMParser,o=r.getData("text/plain"),a=r.getData("text/html"),l=r.files;if(console.log("🍊",{files:l,html:a,text:o}),console.log("❤",(new DOMParser).parseFromString(a,"text/html")),o){const e=this.courier.get_recorder();console.log("💠text",o);const{offset_end:t,offset_start:n,cube_selection:i}=this.cursor;if(!(i instanceof Sa))return;this.ins(e,this._root,o,i,n,t),this.history.record(e)}if(a){const e=s.parseFromString(a,"text/html");console.log("💠html",e)}}handler_click_foot(e){e.preventDefault();const{courier:t,cursor:n,history:i}=this.root,r=this.root.child_last;if(r&&r.is_empty){let e=r;for(;e;){if(e instanceof Sa){e.line?.dom?.focus(),e.set_cursor_in_tail();break}e=e.child_last}}else{const e=new Os(t),n=$l.get_default();e.tell(this.root,Rs.insert_child(this.root.id,[n],this.root.child_count)),i.record(e)}}}class gl extends ml{}const bl={class:"dialog-form"},yl={class:"form-grid"},vl={class:"label"},wl=["onUpdate:modelValue"],xl=Bn({__name:"menu-dialog",setup(e){const t=Kt();function n(){const e=t.value;e&&(uo.open=!1,e.close())}function i(){n(),uo.submit(uo.data)}return cr(()=>uo.open,()=>{const e=t.value;e&&(uo.open?e.showModal():e.close())}),(e,r)=>(Nr(),Dr("dialog",{class:"menu-dialog",ref_key:"root",ref:t,onClose:n},[Fr("div",bl,[Fr("div",{class:"close-corner",onClick:n}),Fr("div",yl,[(Nr(!0),Dr(Cr,null,_i(Object.keys(Zt(uo).data),e=>(Nr(),Dr(Cr,{key:e},[Fr("div",vl,Ce(e),1),Nn(Fr("input",{type:"text",autofocus:"","onUpdate:modelValue":t=>Zt(uo).data[e]=t},null,8,wl),[[rl,Zt(uo).data[e]]])],64))),128))]),Fr("div",{class:"dialog-submit",onClick:i},"确认")])],544))}}),kl=(0,Uo.A)(xl,[["__scopeId","data-v-13d4fd0e"]]),Sl={class:"menu-title iconfont icon-sp"},Cl=["onPointerdown","onMouseenter"],Ml={class:"item-shortcut"},zl={key:0,class:"iconfont icon-arrow-right"},Tl={class:"menu-title iconfont icon-sp"},Al=["onPointerdown","onMouseenter"],Pl={class:"item-shortcut"},Nl={key:0,class:"iconfont icon-arrow-right"},Ol=Bn({__name:"note-menu",props:{root:{}},setup(e){const t=Kt(),n=Kt([]);function i(e,t=!1){t?(ho.stack_menus.length=e,ho.stack_rect.length=e,ho.menu=void 0):(ho.stack_menus.length=e,ho.stack_rect.length=e)}function r(e,t,n){if(i(t),!n.has_submenu)return;const r=e.currentTarget;ho.stack_rect.push(r.getBoundingClientRect());const s=n.mouseenter(e);ho.stack_menus.push(s)}function s(e,t){i(0,!0),t.click(e)}function o(e){return{cursor:e.usable?"unset":"not-allowed",color:e.usable?"unset":"var(--menu-item-disable-color)"}}function a(e){e.stopPropagation()}return cr(()=>ho.point,async()=>{const e=t.value;if(!e)return;await yn(),ho.stack_pos.length=0;const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},i=e.getBoundingClientRect(),r={x:ho.point.x,y:ho.point.y,width:0,height:0},s=Es.MathRect.move_rect_to_other(n,i,r);ho.css={left:s.x+"px",top:s.y+"px"}}),cr(ho.stack_menus,async()=>{await yn();const e=n.value;if(!e)return;ho.stack_pos.length=0;const t={x:0,y:0,width:window.innerWidth,height:window.innerHeight};for(let n=0;n<ho.stack_menus.length;n++){const i=ho.stack_rect[n],r=Bo(t,e[n].getBoundingClientRect(),i);ho.stack_pos.push({left:r.x+"px",top:r.y+"px"})}}),ni(()=>{document.documentElement.addEventListener("pointerdown",e=>{const n=t.value;if(!n)return;const i=e.target;i&&!n.contains(i)&&(ho.menu=void 0,ho.stack_menus.length=0,ho.stack_pos.length=0,ho.stack_rect.length=0)},{capture:!0})}),(e,i)=>(Nr(),Dr("div",{class:"note-menus",style:me(Zt(ho).css),ref_key:"dom",ref:t,onWheel:a},[Yr(" 弹窗 "),$r(kl),Yr(" 主菜单列表 "),Zt(ho).menu?(Nr(),Dr("div",{key:0,class:"menu-list",ref_key:"ms",ref:n},[Fr("div",Sl,Ce(Zt(ho).menu.title),1),(Nr(!0),Dr(Cr,null,_i(Zt(ho).menu.menus,e=>(Nr(),Dr("div",{class:ve(["menu-item",{"active-item":Zt(ho).menu.active.includes(e.title)}]),style:me(o(e)),key:e.title,onPointerdown:t=>s(t,e),onMouseenter:t=>r(t,0,e)},[Fr("div",{class:ve(["item-title",e.icon])},Ce(e.title),3),Fr("div",Ml,Ce(e.shortcut),1),e.has_submenu?(Nr(),Dr("div",zl)):Yr("v-if",!0)],46,Cl))),128))],512)):Yr("v-if",!0),Yr(" 子菜单列表 "),(Nr(!0),Dr(Cr,null,_i(Zt(ho).stack_menus,(e,t)=>(Nr(),Dr("div",{class:"submenu-list",ref_for:!0,ref_key:"ms",ref:n,style:me(Zt(ho).stack_pos[t])},[Fr("div",Tl,Ce(e.title),1),(Nr(!0),Dr(Cr,null,_i(e.menus,n=>(Nr(),Dr("div",{class:ve(["menu-item",{"active-item":e.active.includes(n.title)}]),style:me(o(n)),key:n.title,onPointerdown:e=>s(e,n),onMouseenter:e=>r(e,t+1,n)},[Fr("div",{class:ve(["item-title",n.icon])},Ce(n.title),3),Fr("div",Pl,Ce(n.shortcut),1),n.has_submenu?(Nr(),Dr("div",Nl)):Yr("v-if",!0)],46,Al))),128))],4))),256))],36))}}),Rl=(0,Uo.A)(Ol,[["__scopeId","data-v-43e0bd72"]]),Ll=["id","data-type"],El={class:"doc-postils"},Dl=Bn({__name:"cube-doc",props:{cube:{}},setup(e){const t=e.cube,{config:i}=e.cube,r=new _l(t),s=e=>r.pointerdown(e),o=e=>r.pointermove(e),a=e=>r.pointerup(e),l=e=>r.pointercancel(e),c=e=>r.handler_click_foot(e),d=e=>r.compositionstart(e),h=e=>r.compositionupdate(e),u=e=>r.compositionend(e),p=e=>r.beforeinput(e),f=e=>r.dragover(e),m=e=>r.dragenter(e),_=e=>r.dragleave(e),g=e=>r.drop(e);return ni(()=>{document.documentElement.addEventListener("pointerup",a),document.documentElement.addEventListener("pointermove",o),document.documentElement.addEventListener("pointercancel",l)}),(e,r)=>(Nr(),Dr("div",{class:"cube-doc",id:Zt(t).id,"data-type":Zt(n).doc,style:me(Zt(i).css_vars),onDragover:f,onDragenter:m,onDragleave:_,onDrop:g},[Fr("div",{class:"note",onPointerdown:s,onCompositionstart:d,onCompositionupdate:h,onCompositionend:u,onBeforeinput:p},[(Nr(!0),Dr(Cr,null,_i(Zt(t).children,e=>(Nr(),Ir(pi(e.component),{key:e.id,cube:e,id:e.id},null,8,["cube","id"]))),128)),Yr(" doc-cubes "),Fr("div",El,[(Nr(!0),Dr(Cr,null,_i(Zt(t).cubes.postils,([e,t])=>(Nr(),Ir(ia,{key:t.id,cube:t},null,8,["cube"]))),128))]),Yr(" footer "),Fr("div",{class:"cube-doc-footer",onPointerdown:c},null,32)],32),Yr(" scope selection "),(Nr(!0),Dr(Cr,null,_i(Zt(t).scope,e=>(Nr(),Ir(fl,{key:e.id,selection:Ut(e)},null,8,["selection"]))),128)),Yr(" menus "),$r(Rl,{root:e.cube},null,8,["root"])],44,Ll))}}),Il=(0,Uo.A)(Dl,[["__scopeId","data-v-728e5342"]]),Bl=["id","data-type"],jl={class:"cube-box-root-content"},ql=Bn({__name:"cube-box-root",props:{cube:{}},setup(e){const t=e.cube,{stats:i}=e.cube,r=vs(()=>({opacity:(e.cube.child_count+10)/60})),s=e=>function(e,t){if(e.stopPropagation(),!ko)return void e.preventDefault();const n=e.currentTarget;n instanceof HTMLElement&&(So=n,wo=t,document.body.style.setProperty("--box-root-pointer-events","none"))}(e,t),o=e=>function(e,t){if(!ko||!wo)return;e.stopPropagation();const n=e.currentTarget;n instanceof HTMLElement&&t!==wo&&(n!==Co&&Co?.classList.remove("drag-enter"),Co=n,xo=t,Co.classList.add("drag-enter"))}(e,t),a=e=>function(e,t){ko&&(e.preventDefault(),e.stopPropagation(),wo&&xo&&So&&Co&&wo!==xo&&(So.style["view-transition-name"]=wo.id,document.startViewTransition(()=>{if(!(wo&&xo&&So&&Co))return;const{courier:e,history:n}=t,i=new Os(e),r=So.getBoundingClientRect(),s=xo.index,o=wo.export(),a=xo.pcube;wo.pcube===a?i.tell(wo.pcube,Rs.reorder(wo.pid,wo.id,xo.index)):(i.merge(wo.remove_self()),i.tell(a,Rs.insert_child(a.id,[o],s))),n.record(i);const l=Co.getBoundingClientRect(),c=l.x-r.x,d=l.y-r.y;document.body.style.setProperty("--x",c+"px"),document.body.style.setProperty("--y",d+"px")}),ko=!1))}(e,t),l=e=>(Co&&Co.classList.remove("drag-enter"),So&&So.classList.remove("drag-enter"),void(ko=!1)),c=e=>function(e){e.preventDefault(),e.stopPropagation(),Co&&Co.classList.add("drag-enter")}(e),d=e=>function(e){e.stopPropagation(),Co&&Co.classList.remove("drag-enter")}(e),h=e=>function(e){const t=e.target;t instanceof HTMLElement&&"cube-box-root-dragger"===t.dataset.tag&&(ko=!0,e.stopPropagation())}(e),u=e=>function(e,t){const{stats:n}=t.root,i=t.index+1;n.active_root_index=i}(0,t);function p(e){const{stats:t}=e;return{"anchor-root":t.anchor_root_id===e.id,"fold-root":e.attrs.fold}}return(e,i)=>(Nr(),Dr("div",{class:"cube-box-root",style:me(Zt(t).css),draggable:"true",id:e.cube.id,"data-type":Zt(n).box_root,onContextmenu:i[2]||(i[2]=t=>Zt(Io)(t,e.cube)),onFocusin:u,onDragstart:s,onDragenter:o,onDrop:a,onDragend:l,onDragover:c,onDragleave:d,onPointerdown:h},[Fr("div",{class:ve(["cube-dragger",p(e.cube)]),style:me(r.value),onClick:i[0]||(i[0]=t=>Zt(zo)(t,e.cube)),onContextmenu:i[1]||(i[1]=t=>Zt(To)(t,e.cube)),"data-tag":"cube-box-root-dragger"},null,38),Fr("div",jl,[e.cube.attrs.fold?(Nr(),Ir(ia,{key:0,cube:e.cube.child_first},null,8,["cube"])):(Nr(!0),Dr(Cr,{key:1},_i(Zt(t).children,e=>(Nr(),Ir(ia,{key:e.id,cube:Ut(e)},null,8,["cube"]))),128))])],44,Bl))}}),Hl=(0,Uo.A)(ql,[["__scopeId","data-v-76631106"]]);function Fl(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class $l extends ro{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return Hl}get meta(){return $l.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof Wl&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof ro&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=Ts.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return $l.update_data(e,t)}replace_id(e,t={}){return $l.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:i,from_id:r}=e,s=new Os(t);if("left"===n){this.prev_cube_deep instanceof $l?s.tell(this,Rs.merge(this.id,"left",r,i)):s.tell(this,Ls.in_head(this.id))}else if("right"===n){this.next_cube_deep instanceof $l?s.merge(this.on(Rs.merge(this.id,"right",r,i))):s.tell(this,Ls.in_tail(this.id))}return s}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s}=this,{method:o,cubeid:a,offset:l}=e,c=new Os(t);if("left"===o&&n instanceof $l){const e=this.export().info;c.tell(n,Rs.insert_child(n.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}else if("right"===o&&i instanceof $l){const e=i.export().info;c.tell(this,Rs.insert_child(this.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}else if("both"===o)if(n instanceof $l&&i instanceof $l){const e=this.export().info,t=i.export().info;c.tell(n,Rs.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,Rs.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=Ls.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof $l&&!(i instanceof $l)){const e=this.export().info;c.tell(n,Rs.insert_child(n.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof $l)&&i instanceof $l){const e=i.export().info;c.tell(this,Rs.insert_child(this.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}return c}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new Os(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Rs.reorder(this.id,o.id,c)),a}on_cube_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=Ts.filter_out_empty(n);if(0===r.length){const e=this.children[0];if(1===this.child_count&&e instanceof Sa&&e.is_empty)return;const t=this.export().info,n=new Wl(Wl.get_default(),this);this.splice(0,this.child_count,n),i.add_recover(Rs.reset(this.id,t)),i.tell(n,Ls.in_tail(n.id))}else{const e=this.export().info,t=Ts.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Rs.reset(this.id,e))}return i}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;let s=this.get_valid_index(n);const o=Ts.pick(i,!0),a=Ts.build_cubes(o.sort,this);this.splice(s,0,...a),r.add_recover(Rs.delete_child(this.id,"backward",[s,s+a.length]));const l=a[a.length-1],c=this.children[s+1];return l?r.tell(l,Ls.in_tail(l.id)):r.tell(c,Ls.in_head(c.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=o;let h=c<0?0:c,u=d>this.child_count?this.child_count:d;if(!(h>=u)){if(h<=0&&u>=this.child_count&&!a){if(a){if(this.is_empty)return;l.tell(this,Rs.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,Rs.delete_child(e.id,s,[0,e.child_count],a))}else this.is_empty?l.tell(r,Rs.delete_child(n,s,[i,i+1])):l.tell(this,Rs.reset(this.id,[]));return l}{const e=this.children[h-1],t=this.children[u],n=u-h;let i=this.splice(c,n);l.add_recover(Rs.insert_child(this.id,i.data,c)),"backward"===s?e?l.tell(e,Ls.in_tail(e.id)):t&&l.tell(t,Ls.in_head(t.id)):"forward"===s&&(t?l.tell(t,Ls.in_head(t.id)):e&&l.tell(e,Ls.in_tail(e.id)))}return l}}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!Sa.is_empty_text(e))}static get meta(){return{type:n.box_root,cubename:"根级块",version:1,block:!0,show:!1}}static get_default(e=[],t={},i={fold:!1}){const r=0===e.length?[Wl.get_default()]:e;return{id:Ts.get_id(),type:n.box_root,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=zs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Fl([Fs(i.cube_delete_adjacent)],$l.prototype,"on_cube_delete_adjacent",null),Fl([Fs(i.cube_merge)],$l.prototype,"on_merge",null),Fl([Fs(i.cube_reorder)],$l.prototype,"on_cube_reorder",null),Fl([Fs(i.cube_reset)],$l.prototype,"on_cube_reset",null),Fl([Fs(i.cube_insert_child)],$l.prototype,"on_insert_child",null),Fl([Fs(i.cube_delete_child)],$l.prototype,"on_delete_child",null);class Gl{}class Vl extends io{_app;data;constructor(e){super();const t=this.update_data(e.versions[this.meta.type],e).data;this.data=It(t),this.build_child(t),Hs.init_cmd_handler(this),zs.add_doc(this),this._app=ll(Il,{cube:this})}get domain(){return"doc"}get app(){return this._app}get component(){return Il}get meta(){return Vl.meta}get doc(){return this}get children(){const e=[];for(let t of this._children)e.push(t);return e}build_child(e){const t=Ts.build_cubes(e.info,this);return this._children.push(...t),t}gc(){}export(){const e=Vt(this.data);e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs)),e.info=[],e.versions=zs.export_versions();for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return Vl.update_data(e,t)}replace_id(e,t={}){return Vl.replace_id(this.root,e,t)}render(e){this._dom=e,this.hotkeys.listen(e),this.app.mount(e),this.event.emit_status_update()}static get meta(){return{type:n.doc,cubename:"文档",version:1,block:!0,show:!1}}static get_default(){$l.get_default();return{id:Ms(),type:n.doc,versions:zs.export_versions(),info:[],css:{},attrs:{}}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=zs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}function Ul(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Wl extends ro{_component=za;get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return this._component}get editable(){if(this.stats.is_read_mode)return!1;const e=this.host_postil,t=this.host_node;return!e&&t?t.editable:!(!e||t)||(!e||!t||(e.level>t.level||t.editable))}get meta(){return Wl.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}get attrs(){return this.data.attrs}get child_first_text(){for(let e of this._children)if(e instanceof Sa)return e}get child_last_text(){for(let e of[...this._children].reverse())if(e instanceof Sa)return e}get next_line(){let e=this.next_cube_deep;for(;e;){if(e instanceof Vl)return;let t=Ts.find_line(e,"first");if(t)return t;e=e.next_cube_deep}}get prev_line(){let e=this.prev_cube_deep;for(;e;){if(e instanceof Vl)return;let t=Ts.find_line(e,"last");if(t)return t;e=e.prev_cube_deep}}constructor(e,t){return super(e,t),this.setup(e,t)}gc(){super.base_gc()}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof ro&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=Ts.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}update_data(e,t){return Wl.update_data(e,t)}replace_id(e,t={}){return Wl.replace_id(this.root,e,t)}inherit_line(e){const t=Math.min(...e.map(e=>e.attrs.indent||0));for(let n of e){const e=this.attrs.indent;if(e){const i=n.attrs.indent||0;n.attrs.indent=e+i-t}this.css["text-indent"]&&n.type===this.type&&(n.css["text-indent"]=this.css["text-indent"])}}on_cube_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s,pcube:o}=this,{method:a,cubeid:l,offset:c}=e,d=new Os(t);if("left"===a&&n instanceof Wl){const e=Ts.exports(this.children),t=Ts.filter_out_empty(e);d.tell(n,Rs.insert_child(n.id,t,"tail")),d.merge(this.remove_self("backward"));const i=n.find_child_cube(l);if(i){const e=Ls.loc(l,c,l,c);d.tell(i,e)}}else if("right"===a&&i instanceof Wl){const e=i.export().info,t=Ts.filter_out_empty(e);d.tell(this,Rs.insert_child(this.id,t,"tail")),d.tell(o,Rs.delete_child(s,"backward",[r+1,r+2]));const n=this.find_child_cube(l);n&&d.tell(n,Ls.loc(l,c,l,c))}else if("both"===a)if(n instanceof Wl&&i instanceof Wl){const e=Ts.filter_out_empty(this.export().info),t=Ts.filter_out_empty(i.export().info);d.tell(n,Rs.insert_child(n.id,e.concat(t),"tail")),d.tell(o,Rs.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_child_cube(l);r&&d.tell(r,Ls.loc(l,c,l,c))}else if(n instanceof Wl&&!(i instanceof Wl)){const e=Ts.filter_out_empty(this.export().info);d.tell(n,Rs.insert_child(n.id,e,"tail")),d.tell(o,Rs.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_child_cube(l);t&&d.tell(t,Ls.loc(l,c,l,c))}else if(!(n instanceof Wl)&&i instanceof Wl){const e=Ts.filter_out_empty(i.export().info);d.tell(this,Rs.insert_child(this.id,e,"tail")),d.tell(o,Rs.delete_child(s,"backward",[r+1,r+2]));const t=this.find_child_cube(l);t&&d.tell(t,Ls.loc(l,c,l,c))}return d}on_cube_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=Ts.filter_out_empty(n);if(0===r.length){if(this.is_empty)return;const e=this.export().info,t=new Sa(Sa.get_default(),this);this.splice(0,this.child_count,t),i.add_recover(Rs.reset(this.id,e)),i.tell(t,Ls.in_tail(t.id))}else{const e=this.export().info,t=Ts.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Rs.reset(this.id,e))}return i}on_insert_child(e){const{courier:t,pid:n,pcube:i}=this,{pos:r,data:s}=e,o=new Os(t);if(0===s.length)return o;let a=this.get_valid_index(r);const l=Ts.pick(s);if(l.head.length>0){o.add_cmd(e);const t=Ts.build_cubes(s,this),n=t[t.length-1];this.splice(a,0,...t),o.add_recover(Rs.delete_child(this.id,"backward",[a,a+t.length])),n&&o.tell(n,Ls.in_tail(n.id))}const c=[...l.body];if(l.tail.length>0&&c.push(Wl.get_default(l.tail)),l.root.length>0)for(let e of l.root)c.push(...e.info);if(c.length>0)if(this.inherit_line(c),this.is_empty)o.tell(i,Rs.insert_child(n,c,this.index)),o.tell(i,Rs.delete_child(n,"backward",[this.index,this.index+1]));else{const e=this.get_valid_index(a+l.head.length);if(e<this.child_count){const t=this._children.slice(e);if(t.length>0){const r=t.map(e=>e.export()),s=Wl.get_default(r);this.inherit_line([s]),o.tell(this,Rs.delete_child(this.id,"backward",[e,this.child_count])),o.tell(i,Rs.insert_child(n,[s],this.index+1))}}o.tell(i,Rs.insert_child(n,c,this.index+1))}return o}on_delete_child(e){const{dir:t,range:n,reserve:i}=e,{courier:r,pid:s,index:o,pcube:a}=this,l=r.get_recorder();l.add_cmd(e);const[c,d]=n;let h=c<0?0:c,u=d>this.child_count?this.child_count:d;if(!(h>=u)){if(h<=0&&u>=this.child_count)if(i){if(this.is_empty)return;const e=this.child_first;e instanceof Sa?(l.tell(this,Rs.delete_child(this.id,t,[1,this.child_count])),l.tell(e,xa.reset(e.id,"")),l.tell(e,Ls.loc(e.id,1,e.id,1))):l.tell(this,Rs.reset(this.id,[]))}else this.is_empty?l.tell(a,Rs.delete_child(s,t,[o,o+1])):l.tell(this,Rs.reset(this.id,[]));else{const e=this.children[h-1],n=this.children[u],i=u-h;if(h>=this.child_count||i<=0)return;let r=this.splice(h,i);l.add_recover(Rs.insert_child(this.id,r.data,c)),"backward"===t?e?l.tell(e,Ls.in_tail(e.id)):n&&l.tell(n,Ls.in_head(n.id)):"forward"===t&&(n?l.tell(n,Ls.in_head(n.id)):e&&l.tell(e,Ls.in_tail(e.id)))}return l}}on_cube_delete_adjacent(e){const{courier:t,pid:n,prev_cube:i,next_cube:r,pcube:s}=this,{from:o,from_id:a,offset:l}=e,c=new Os(t);if("left"===o){this.prev_cube_deep instanceof Wl?c.tell(this,Rs.merge(this.id,"left",a,l)):c.tell(this,Ls.in_head(this.id))}else if("right"===o){this.next_cube_deep instanceof Wl?c.tell(this,Rs.merge(this.id,"right",a,l)):c.tell(this,Ls.in_tail(this.id))}return c}static filter_out_empty(e){return e.filter(e=>!Sa.is_empty_text(e))}static get meta(){return{version:1,type:n.line,cubename:"行",block:!0,show:!1}}static get_default(e=[],t={},i={}){const r=0===e.length?[Sa.get_default()]:e;return{id:Ms(),type:n.line,info:r,css:t,attrs:i}}static get_default_by_string(e="",t={},i={}){const r=[Sa.get_default(e||"")];return{id:Ms(),type:n.line,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=zs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Ul([Fs(i.cube_merge)],Wl.prototype,"on_cube_merge",null),Ul([Fs(i.cube_reset)],Wl.prototype,"on_cube_reset",null),Ul([Fs(i.cube_insert_child)],Wl.prototype,"on_insert_child",null),Ul([Fs(i.cube_delete_child)],Wl.prototype,"on_delete_child",null),Ul([Fs(i.cube_delete_adjacent)],Wl.prototype,"on_cube_delete_adjacent",null);const Yl=["id","data-type"],Xl=Bn({__name:"cube-box",props:{cube:{}},setup(e){function t(t){if(t.target===t.currentTarget){t.stopPropagation();const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Ls.in_tail(e.cube.id);r.tell(e.cube,s),i.record(r)}}return(e,i)=>(Nr(),Dr("div",{class:"cube-box",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).box,onPointerup:t},[(Nr(!0),Dr(Cr,null,_i(e.cube.children,e=>(Nr(),Ir(ia,{key:e.id,cube:e},null,8,["cube"]))),128))],44,Yl))}}),Kl=(0,Uo.A)(Xl,[["__scopeId","data-v-b4213ca8"]]);function Jl(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Ql extends ro{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return Ut(Kl)}get attrs(){return this.data.attrs}get meta(){return Ql.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof ro&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=Ts.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return Ql.update_data(e,t)}gc(){super.base_gc()}replace_id(e,t={}){return Ql.replace_id(this.root,e,t)}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s}=this,{method:o,cubeid:a,offset:l}=e,c=new Os(t);if("left"===o&&n instanceof Ql){const e=this.export().info;c.tell(n,Rs.insert_child(n.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_child_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}else if("right"===o&&i instanceof Ql){const e=i.export().info;c.tell(this,Rs.insert_child(this.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}else if("both"===o)if(n instanceof Ql&&i instanceof Ql){const e=this.export().info,t=i.export().info;c.tell(n,Rs.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,Rs.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=Ls.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof Ql&&!(i instanceof Ql)){const e=this.export().info;c.tell(n,Rs.insert_child(n.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof Ql)&&i instanceof Ql){const e=i.export().info;c.tell(this,Rs.insert_child(this.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}return c}on_box_order(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new Os(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Rs.reorder(this.id,o.id,c)),a}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Rs.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,Ls.in_head(a.id)):r.tell(this.child_last,Ls.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=o;let h=c<0?0:c,u=d>this.child_count?this.child_count:d;if(!(h>=u)){if(h<=0&&u>=this.child_count)if(a){if(this.is_empty)return;l.tell(this,Rs.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,Rs.delete_child(e.id,s,[0,e.child_count],a))}else this.is_empty?l.tell(r,Rs.delete_child(n,s,[i,i+1])):l.tell(this,Rs.reset(this.id,[]));else{const e=this.children[h-1],t=this.children[u],n=u-h;if(h>=this.child_count||n<=0)return;let i=this.splice(h,n);l.add_recover(Rs.insert_child(this.id,i.data,c)),"backward"===s?e?l.tell(e,Ls.in_tail(e.id)):t&&l.tell(t,Ls.in_head(t.id)):"forward"===s&&(t?l.tell(t,Ls.in_head(t.id)):e&&l.tell(e,Ls.in_tail(e.id)))}return l}}on_box_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=Ts.filter_out_empty(n);if(0===r.length){if(this.is_empty)return;const e=this.export().info,t=new Wl(Wl.get_default(),this);this.splice(0,this.child_count,t),i.add_recover(Rs.reset(this.id,e)),i.tell(t,Ls.in_tail(t.id))}else{const e=this.export().info,t=Ts.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Rs.reset(this.id,e))}return i}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:i}=this,{from:r,from_id:s,offset:o}=e,a=new Os(t);if("left"===r){if(this.prev_cube_deep instanceof Ql)a.tell(this,Rs.merge(this.id,"left",s,o));else{const e=this.export().info,t=this.child_first.id;a.tell(n,Rs.insert_child(i,e,this.index)),a.merge(this.remove_self());const l=n.find_cube(t);l&&a.tell(l,Rs.delete_adjacent(t,r,s,o))}}else if("right"===r){if(this.next_cube_deep instanceof Ql)a.merge(this.on(Rs.merge(this.id,"right",s,o)));else{const e=this.export().info,t=this.child_first.id;a.tell(n,Rs.insert_child(i,e,this.index)),a.merge(this.remove_self());const l=n.find_cube(t);l&&a.tell(l,Rs.delete_adjacent(t,r,s,o))}}return a}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static get meta(){return{type:n.box,cubename:"块",version:1,block:!0,show:!0}}static get_default(e=[],t={},i={}){const r=[];return 0===e.length?r.push(Wl.get_default()):r.push(...Ts.pick(e).sort),{id:Ts.get_id(),type:n.box,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=zs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Jl([Fs(i.cube_merge)],Ql.prototype,"on_merge",null),Jl([Fs(i.cube_reorder)],Ql.prototype,"on_box_order",null),Jl([Fs(i.cube_insert_child)],Ql.prototype,"on_insert_child",null),Jl([Fs(i.cube_delete_child)],Ql.prototype,"on_delete_child",null),Jl([Fs(i.cube_reset)],Ql.prototype,"on_box_reset",null),Jl([Fs(i.cube_delete_adjacent)],Ql.prototype,"on_cube_delete_adjacent",null);const Zl=["id","data-type"],ec=Bn({__name:"cube-box-folder",props:{cube:{}},setup(e){const t=e.cube,{stats:i}=e.cube;return(e,i)=>(Nr(),Dr("div",{class:ve(["cube-box-folder",{"cube-box-folder-active":e.cube.attrs.fold}]),id:e.cube.id,style:me(Zt(t).css),"data-type":Zt(n).box_folder},[e.cube.attrs.fold?(Nr(),Ir(ia,{key:0,cube:e.cube.child_first},null,8,["cube"])):(Nr(!0),Dr(Cr,{key:1},_i(Zt(t).children,e=>(Nr(),Ir(ia,{key:e.id,cube:Ut(e)},null,8,["cube"]))),128)),Fr("div",{class:ve(["folder-tag",{"folder-tag-active":e.cube.attrs.fold}]),onClick:i[0]||(i[0]=t=>function(e,t){const{courier:n,history:i,cubes:r,id:s,pcube:o}=t,a=n.get_recorder();a.tell(t,Rs.fold(s,!t.attrs.fold)),i.record(a);for(let e of Object.values(r.postils))e.find_upstream_untill(o)===t&&e.visible(!1);const l=t.child_first.id;if(!l)return;const c=document.getElementById(l);c?.scrollIntoView({block:"nearest",behavior:"smooth"})}(0,e.cube))},null,2)],14,Zl))}}),tc=(0,Uo.A)(ec,[["__scopeId","data-v-e4ce51da"]]);function nc(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class ic extends ro{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return tc}get meta(){return ic.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof Wl&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof ro&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=Ts.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return ic.update_data(e,t)}replace_id(e,t){return ic.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:i,from_id:r}=e,s=new Os(t);if("left"===n){this.prev_cube_deep instanceof ic?s.tell(this,Rs.merge(this.id,"left",r,i)):s.tell(this,Ls.in_head(this.id))}else if("right"===n){this.next_cube_deep instanceof ic?s.merge(this.on(Rs.merge(this.id,"right",r,i))):s.tell(this,Ls.in_tail(this.id))}return s}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s}=this,{method:o,cubeid:a,offset:l}=e,c=new Os(t);if("left"===o&&n instanceof ic){const e=this.export().info;c.tell(n,Rs.insert_child(n.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}else if("right"===o&&i instanceof ic){const e=i.export().info;c.tell(this,Rs.insert_child(this.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}else if("both"===o)if(n instanceof ic&&i instanceof ic){const e=this.export().info,t=i.export().info;c.tell(n,Rs.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,Rs.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=Ls.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof ic&&!(i instanceof ic)){const e=this.export().info;c.tell(n,Rs.insert_child(n.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof ic)&&i instanceof ic){const e=i.export().info;c.tell(this,Rs.insert_child(this.id,e,"tail")),c.tell(this.pcube,Rs.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Ls.loc(a,l,a,l);c.tell(t,e)}}return c}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new Os(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Rs.reorder(this.id,o.id,c)),a}on_cube_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=Ts.filter_out_empty(n);if(0===r.length){const e=this.children[0];if(1===this.child_count&&e instanceof Sa&&e.is_empty)return;const t=this.export().info,n=new Wl(Wl.get_default(),this);this.splice(0,this.child_count,n),i.add_recover(Rs.reset(this.id,t)),i.tell(n,Ls.in_tail(n.id))}else{const e=this.export().info,t=Ts.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Rs.reset(this.id,e))}return i}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Rs.delete_child(this.id,"backward",[s,s+o.length]));const a=o[o.length-1],l=this.children[s+1];return a?r.tell(a,Ls.in_tail(a.id)):r.tell(l,Ls.in_head(l.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=o;let h=c<0?0:c,u=d>this.child_count?this.child_count:d;if(h>=u)return;if(h<=0&&u>=this.child_count){if(a){if(this.is_empty)return;l.tell(this,Rs.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,Rs.delete_child(e.id,s,[0,e.child_count],a))}else this.is_empty?l.tell(r,Rs.delete_child(n,s,[i,i+1])):l.tell(this,Rs.reset(this.id,[]));return l}const p=this.children[h-1],f=this.children[u],m=u-h;let _=this.splice(c,m);return l.add_recover(Rs.insert_child(this.id,_.data,c)),"backward"===s?p?l.tell(p,Ls.in_tail(p.id)):f&&l.tell(f,Ls.in_head(f.id)):"forward"===s&&(f?l.tell(f,Ls.in_head(f.id)):p&&l.tell(p,Ls.in_tail(p.id))),l}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!Sa.is_empty_text(e))}static get meta(){return{type:n.box_folder,cubename:"折叠块",version:1,block:!0,show:!0}}static get_default(e=[],t={},i={fold:!1}){const r=0===e.length?[Wl.get_default()]:e;return{id:Ts.get_id(),type:n.box_folder,info:r,css:t,attrs:i}}static replace_id(e,t,n){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=zs.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}nc([Fs(i.cube_delete_adjacent)],ic.prototype,"on_cube_delete_adjacent",null),nc([Fs(i.cube_merge)],ic.prototype,"on_merge",null),nc([Fs(i.cube_reorder)],ic.prototype,"on_cube_reorder",null),nc([Fs(i.cube_reset)],ic.prototype,"on_cube_reset",null),nc([Fs(i.cube_insert_child)],ic.prototype,"on_insert_child",null),nc([Fs(i.cube_delete_child)],ic.prototype,"on_delete_child",null);class rc{}const sc=["d","id","data-type","stroke-width","stroke","marker-start","marker-end"],oc=Bn({__name:"cube-linker",props:{cube:{}},setup:e=>(t,i)=>(Nr(),Dr("path",{d:t.cube.path,id:t.cube.id,class:ve(["cube-linker",{"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}]),style:me(t.cube.css),"data-type":Zt(n).linker,"stroke-width":t.cube.attrs.stroke_width,stroke:t.cube.attrs.stroke,"marker-start":`url(#${t.cube.anchor_left})`,"marker-end":`url(#${t.cube.anchor_right})`},null,14,sc))}),ac=(0,Uo.A)(oc,[["__scopeId","data-v-6b0e5f48"]]),lc=["cx","cy"],cc=Bn({__name:"op-node-drag",props:{interaction:{}},setup(e){const{info_node_drag:t}=e.interaction;return(e,n)=>(Nr(),Dr(Cr,null,[Zt(t).show?(Nr(),Dr("circle",{key:0,cx:Zt(t).x,cy:Zt(t).y,r:"20",stroke:"black","stroke-width":"2","stroke-dasharray":"4 4",fill:"none"},null,8,lc)):Yr("v-if",!0),Yr(' <g data-flag="drag-nodes" :transform="get_matrix()" style="pointer-events: none; user-select: none; opacity: 0.8" v-if="info_node_drag.show">\r\n <path d="M -54.5 -18 L 54.5 -18 Q 56.5 -18 56.5 -16 L 56.5 16 Q 56.5 18 54.5 18 L -54.5 18 Q -56.5 18 -56.5 16 L -56.5 -16 Q -56.5 -18 -54.5 -18 z" style="fill: rgba(255, 255, 255, 0.05); stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <path d="M -54.5 -18 L -54.5 -20 Q -54.5 -22 -52.5 -22 L 58.5 -22 Q 60.5 -22 60.5 -20 L 60.5 14 Q 60.5 16 58.5 16 L 56.5 16" style="fill: none; stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <text x="0" y="7" text-anchor="middle" font-size="14" style="fill: rgb(113 117 122)">已选择{{info_node_drag.count}}个节点</text>\r\n </g> ')],2112))}}),dc={class:"map-status"},hc={class:"tool-item map-scale"},uc={class:"tool-item map-nodes"},pc=Bn({__name:"map-status",props:{cube:{}},setup(e){const t=e.cube,i=vs(()=>e.cube.cubes.get_types_cube(n.node));function r(e){const n=t.dom_rect,i={x:n.x+n.width/2,y:n.y+n.height/2};t.scale_by_point(i,e,e)}return(t,n)=>(Nr(),Dr("div",dc,[Fr("div",hc,[Fr("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:n[0]||(n[0]=e=>r(-.1))}),Fr("span",null,Ce((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),Fr("span",{class:"iconfont icon-add",onClick:n[1]||(n[1]=e=>r(.1))})]),Fr("div",uc,[Fr("span",null,"节点 : "+Ce(i.value.size),1)])]))}}),fc=(0,Uo.A)(pc,[["__scopeId","data-v-0a87416a"]]),mc=new As,_c=["id","data-type"],gc=["transform"],bc=["data-group"],yc=["data-group"],vc=["data-group"],wc=["data-group"],xc=["d"],kc=["d","stroke-width","stroke","marker-start","marker-end"],Sc=["d"],Cc={class:"doc-postils"},Mc=Bn({__name:"cube-map",props:{cube:{}},setup(e){const t=e.cube,{placeholder:i,config:r}=e.cube,s=r.data,o=new gl(t),a=Kt(),l=new ResizeObserver(e=>{t.get_view_rect(),mc.resolve()});ni(()=>{const t=a.value;t&&l.observe(t),window.addEventListener("resize",t=>{e.cube.check_show_throttle()})});const c=e=>o.pointerdown(e),d=e=>o.pointermove(e),u=e=>o.pointerup(e),p=e=>o.pointercancel(e),f=e=>o.compositionstart(e),m=e=>o.compositionupdate(e),_=e=>o.compositionend(e),g=e=>o.beforeinput(e);return ni(()=>{document.documentElement.addEventListener("pointerup",u),document.documentElement.addEventListener("pointermove",d),document.documentElement.addEventListener("pointercancel",p)}),(e,o)=>(Nr(),Dr("div",{class:"cube-map",id:e.cube.id,"data-type":Zt(n).map},[Fr("div",{class:"note",onPointerdown:c,onCompositionstart:f,onCompositionupdate:m,onCompositionend:_,onBeforeinput:g},[(Nr(),Dr("svg",{ref_key:"svg",ref:a,style:me(Zt(r).css_vars)},[Fr("g",{transform:Zt(t).matrix2d_dom_string},[Fr("g",{"data-group":Zt(h).markers,class:"group-defs"},[...o[0]||(o[0]=[Wr('<defs data-v-01de0504>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-01de0504><path d="M 0 0 L 6 3 L 0 6 z" data-v-01de0504></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-01de0504><circle cx="3" cy="3" r="3" data-v-01de0504></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-01de0504><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-01de0504></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-01de0504><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-01de0504></rect></marker></defs>',1)])],8,bc),Fr("g",{"data-group":Zt(h).linkers,class:"group-linkers"},[(Nr(!0),Dr(Cr,null,_i(Zt(t).get_linkers_view(),e=>(Nr(),Ir(ac,{key:e.id,cube:e},null,8,["cube"]))),128))],8,yc),Fr("g",{"data-group":Zt(h).nodes,class:"group-nodes"},[(Nr(!0),Dr(Cr,null,_i(e.cube.get_nodes_view(),e=>(Nr(),Ir(ia,{key:e.id,cube:e},null,8,["cube"]))),128))],8,vc),Fr("g",{"data-group":Zt(h).placeholder,class:"group-placeholder"},[Zt(i).box_selector?(Nr(),Dr("path",{key:0,class:"placeholder-box-selector",d:Zt(i).box_selector},null,8,xc)):Yr("v-if",!0),(Nr(!0),Dr(Cr,null,_i(Zt(i).linker,e=>(Nr(),Dr(Cr,null,[e?(Nr(),Dr("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":Zt(s).map_linker_stroke_width,stroke:Zt(s).map_linker_stroke,"marker-start":`url(#${Zt(s).map_linker_anchor_left})`,"marker-end":`url(#${Zt(s).map_linker_anchor_right})`},null,8,kc)):Yr("v-if",!0)],64))),256)),Zt(i).line_delete?(Nr(),Dr("path",{key:1,class:"placeholder-line-delete",d:Zt(i).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,Sc)):Yr("v-if",!0),Yr(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),$r(cc,{interaction:e.cube.interaction},null,8,["interaction"])],8,wc),Yr(" --------------------------------------------------------以下是测试信息----------------------------------------------------------- "),Yr(" ------------------节点信息---------------------- "),Yr(' <template v-for="node of cube.nodes_test" v-if="cube.isdev"> '),Yr(" 采样点 "),Yr(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of node.sample"></circle> '),Yr(" 中心点 "),Yr(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),Yr(" 左上角 "),Yr(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),Yr(" 边界框 "),Yr(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),Yr(" 树边界框 "),Yr(' <rect :x="node.bound.pos_tree.x" :y="node.bound.pos_tree.y" :width="node.bound.size_tree.width" :height="node.bound.size_tree.height" stroke="red" fill="none"></rect> '),Yr(" </template> "),Yr(" ------------------连线信息---------------------- "),Yr(' <template v-if="cube.root.isdev" v-for="linker of Object.values(cube.linkers)"> '),Yr(" 采样点 "),Yr(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of linker.sample"></circle> '),Yr(" 中心点 "),Yr(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),Yr(" 左上角 "),Yr(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),Yr(" 边界框 "),Yr(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),Yr(" 树边界框 "),Yr(' <rect :x="node.bound.pos_tree.x" :y="node.bound.pos_tree.y" :width="node.bound.size_tree.width" :height="node.bound.size_tree.height" stroke="red" fill="none"></rect> '),Yr(" </template> "),Yr(" ------------------意图区域---------------------- "),Yr(' <rect :x="PP.prev.x" :y="PP.prev.y" :width="PP.prev.width" :height="PP.prev.height" stroke="red" fill="none"></rect>\r\n <rect :x="PP.next.x" :y="PP.next.y" :width="PP.next.width" :height="PP.next.height" stroke="blue" fill="none"></rect>\r\n <rect :x="PP.child.x" :y="PP.child.y" :width="PP.child.width" :height="PP.child.height" stroke="green" fill="none" v-if="PP.child"></rect> ')],8,gc)],4)),Yr(" doc-cubes "),Fr("div",Cc,[(Nr(!0),Dr(Cr,null,_i(Zt(t).cubes.postils,([e,t])=>(Nr(),Ir(ia,{key:t.id,cube:t},null,8,["cube"]))),128))])],32),Yr(" scope selection "),(Nr(!0),Dr(Cr,null,_i(Zt(t).scope,e=>(Nr(),Ir(fl,{key:e.id,selection:Ut(e)},null,8,["selection"]))),128)),Yr(" map status "),$r(fc,{cube:e.cube},null,8,["cube"]),Yr(" menus "),$r(Rl,{root:e.cube},null,8,["root"])],8,_c))}}),zc=(0,Uo.A)(Mc,[["__scopeId","data-v-01de0504"]]);class Tc{static draw(e){const{type:t,from:n,to:i}=e;return"line"===t?this.line(n,i):"bezier2"===t?this.bezier2(n,i):"polyline"===t?this.polyline(n,i):"polyline2"===t?this.polyline2(n,i):"polyline3"===t?this.polyline3(n,i):"wave"===t?this.wave(n,i):this.bezier2(n,i)}static get_line(e,t,n){return"line"===n?this.line(e,t):"bezier2"===n?this.bezier2(e,t):"polyline"===n?this.polyline(e,t):"polyline2"===n?this.polyline2(e,t):"polyline3"===n?this.polyline3(e,t):"wave"===n?this.wave(e,t):this.bezier2(e,t)}static line(e,t){return`M${e.x.toFixed(1)} ${e.y.toFixed(1)}L${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static bezier2(e,t){const n=(e.x+t.x)/2,i=n,r=e.y,s=n,o=t.y;return`M${e.x.toFixed(1)} ${e.y.toFixed(1)} C${i} ${r} ${s} ${o} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static polyline(e,t,n=4){const i=(e.x+t.x)/2,r=e,s=t,o=i,a=r.y,l=i,c=s.y,d=Math.sign(e.x-t.x),h=Math.sign(t.y-e.y),u=Math.sign(e.y-t.y),p=Math.sign(t.x-e.x);return`M${r.x} ${r.y} H ${o+d*n} Q ${o} ${a} ${o} ${a+h*n} V ${c+u*n} Q${l} ${c} ${l+p*n} ${c} H ${s.x}`}static polyline2(e,t,n=4){const i=e,r=t,s=(e.x+t.x)/2,o=i.y;return`M${i.x} ${i.y} L${s} ${o} L ${r.x} ${r.y}`}static polyline3(e,t,n=4){const i=(e.x+t.x)/2,r=e,s=t,o=(r.y,i),a=s.y;return`M${r.x} ${r.y} L${o} ${a} L ${s.x} ${s.y}`}static wave(e,t,n=2,i=8){const r=t.x-e.x,s=t.y-e.y,o=Math.sqrt(r*r+s*s),a=Math.atan2(s,r),l=i??o/10;let c=`M ${e.x} ${e.y}`;const d=20*n;for(let t=0;t<=d;t++){const i=t/d,o=e.x+r*i,h=e.y+s*i,u=l*Math.sin(i*n*Math.PI*2),p=o+-Math.sin(a)*u,f=h+Math.cos(a)*u;if(0===t)c+=` M ${p} ${f}`;else{const i=(t-1)/d,o=l*Math.sin(i*n*Math.PI*2),h=-Math.sin(a)*o,u=Math.cos(a)*o,m=e.x+r*i+h,_=e.y+s*i+u;c+=` C ${m+(p-m)/3} ${_+(f-_)/3}, ${p-(p-m)/3} ${f-(f-_)/3}, ${p} ${f}`}}return c}}class Ac{static map={right:this.right.bind(this),left:this.left.bind(this),down:this.down.bind(this),up:this.up.bind(this),"time-right":this.time_right.bind(this),"time-down":this.time_down.bind(this)};static find(e,t){const n=e.env.layout_type;if(t.env.upstream!==e)return this.free_to_any(e,t);if(n){return(0,this.map[n])(e,t)}return this.free_to_any(e,t)}static get_point(e){const t=e.env.layout_type;if(!t)return;const n=e.bound.rect;return"right"===t?Es.MathRect.get_rect_point(n,Es._RectPosition.right_mid):"left"===t?Es.MathRect.get_rect_point(n,Es._RectPosition.left_mid):"down"===t?Es.MathRect.get_rect_point(n,Es._RectPosition.bottom_mid):"up"===t?Es.MathRect.get_rect_point(n,Es._RectPosition.top_mid):"time-down"===t?Es.MathRect.get_rect_point(n,Es._RectPosition.bottom_mid):"time-right"===t?Es.MathRect.get_rect_point(n,Es._RectPosition.right_mid):void 0}static time_down(e,t){const n=t.env.prev_node||e,i={...n.bound.pos,...n.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:Es.MathRect.get_rect_point(i,Es._RectPosition.bottom_mid),to:Es.MathRect.get_rect_point(r,Es._RectPosition.top_mid)}}static time_right(e,t){const n=t.env.prev_node||e,i={...n.bound.pos,...n.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:Es.MathRect.get_rect_point(i,Es._RectPosition.right_mid),to:Es.MathRect.get_rect_point(r,Es._RectPosition.left_mid)}}static up(e,t){const n={...e.bound.pos,...e.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:Es.MathRect.get_rect_point(n,Es._RectPosition.top_mid),to:Es.MathRect.get_rect_point(i,Es._RectPosition.bottom_mid)}}static right(e,t){const n=e.bound.rect,i=t.bound.rect;return{from:Es.MathRect.get_rect_point(n,Es._RectPosition.right_mid),to:Es.MathRect.get_rect_point(i,Es._RectPosition.left_mid)}}static left(e,t){const n={...e.bound.pos,...e.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:Es.MathRect.get_rect_point(n,Es._RectPosition.left_mid),to:Es.MathRect.get_rect_point(i,Es._RectPosition.right_mid)}}static down(e,t){const n={...e.bound.pos,...e.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:Es.MathRect.get_rect_point(n,Es._RectPosition.bottom_mid),to:Es.MathRect.get_rect_point(i,Es._RectPosition.top_mid)}}static free_to_any(e,t){const n=e.sample,i=t.sample;if(0!==n.length&&0!==i.length)return ks.find_closest_points(n,i)}}class Pc{static update(e,t){return{id:e,name:k.update,attrs:t}}}class Nc extends Ss{_interaction;scope_down=null;fig_matrix_origin;pos_down_real;flow=!1;m;count=0;rate=3;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-drag"}reset_status(){this.flow=!1}down(e,t){this.scope_down=t;const{selector:n}=t;"fig"===n.type&&this.map.interaction.check_mouse_key(e,"right")&&(e.stopPropagation(),e.preventDefault(),this.pos_down_real=this.map.view_point_to_real(t.pos),this.flow=!0,this.fig_matrix_origin={...this.map.matrix2d})}move(e){if(!this.flow||!this.scope_down||!this._interaction.check_mouse_key(e,"right"))return;if(this.count++,this.count%this.rate===0)return;this.count=1,e.stopPropagation(),e.preventDefault();const{map_sum_scale:t}=this.scope_down,n=e.clientX,i=e.clientY,r=(n-this.scope_down.pos.x)/t.sx,s=(i-this.scope_down.pos.y)/t.sy;this.m=xs.multiply(this.fig_matrix_origin,xs.get_matrix_translate(r,s)),this.map.reset_matrix(this.m)}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const t=this.courier.get_recorder();this.map.reset_matrix(this.fig_matrix_origin);const n=Bs.update_attr(this.map.id,{matrix2d:this.m});t.tell(this.map,n),this.history.record(t),this.flow=!1,this.map.check_show()}cancel(e){this.flow&&(this.flow=!1,this.map.check_show())}leave(e){this.flow&&(this.flow=!1,this.map.check_show())}wheel(e){}dblclick(e){}contextmenu(e){}}class Oc extends Ss{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-scale"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){if(!e.ctrlKey)return;e.stopPropagation(),e.preventDefault();const{map_scale_step:t}=this.config.data,n=e.deltaY,i=-Math.sign(n),r={x:e.clientX,y:e.clientY},s=i*t;this.map.scale_by_point(r,s,s),this.map.check_show_throttle()}dblclick(e){}contextmenu(e){}}class Rc extends Ss{_interaction;count=0;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-wheel"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){e.stopPropagation(),e.preventDefault(),this.count++;const t=-Math.sign(e.deltaY)*this.config.data.scroll_distance;if(!e.ctrlKey){if(e.shiftKey){const e=xs.multiply(this.map.matrix2d,xs.get_matrix_translate(t,0));this.map.reset_matrix(e)}else{const e=xs.multiply(this.map.matrix2d,xs.get_matrix_translate(0,t));this.map.reset_matrix(e)}this.map.check_show_throttle()}}dblclick(e){}contextmenu(e){}}class Lc extends Ss{_interaction;down_point;view_cubes=[];flow=!1;count=0;rate=5;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:line-delete"}reset(){this.flow=!1,this.map.placeholder.line_delete="",this.view_cubes=[]}down(e,t){const{selector:n,pos:i}=t;this.stats.is_read_mode||"fig"===n.type&&this.map.interaction.check_mouse_key(e,"mid")&&(e.stopPropagation(),e.preventDefault(),this.flow=!0,this.down_point=this.map.view_point_to_real(i),this.view_cubes=this.map.get_view_cube())}move(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault(),this.count++;const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);if(this.map.placeholder.line_delete=Tc.line(this.down_point,n),this.count%this.rate!==0)return;this.count=1,this.map.clear_delete_line();const i={from:this.down_point,to:n};for(let e of this.view_cubes)if(e instanceof ao){let t=e.sample[0];for(let n of e.sample.slice(1)){const r={from:t,to:n};if(Es.MathLine.check_intersection(r,i)){this.map.put_delete_selected(e);break}t=n}}else if(e instanceof ad){let t=e.sample[0];for(let n of e.sample.slice(1)){const r={from:t,to:n};if(Es.MathLine.check_intersection(r,i)){this.map.put_delete_selected(e);break}t=n}}}up(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this.root,i=t.get_recorder(),r=this.map.id,s=[],o=[],a=this.map.get_delete_selected();for(let e of a)e instanceof ao?s.push(e.id):e instanceof ad&&o.push(e.id);const l=Bs.node_remove(r,s),c=Bs.linker_remove(r,o);i.tell(this.map,l,c),n.record(i),this.reset()}cancel(e){this.reset()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class Ec extends Ss{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-add"}down(e,t){}move(e){}up(e){this.flow&&(this.flow=!1)}cancel(e){this.flow}wheel(e){}leave(){}dblclick(e,t){const{selector:n,pos:i}=t;if("fig"!==n.type)return;e.stopPropagation(),e.preventDefault();const{courier:r,history:s}=this,o=ao.get_default_node_pos(i,this.map),a=[gd.get_default(o)],l=Bs.node_add(this.map.id,a),c=r.get_recorder();c.tell(this.map,l),s.record(c)}contextmenu(e){}}class Dc extends Ss{_interaction;flow=!1;point_down;count=0;rate=5;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-box-selected"}reset(){this.flow=!1,this.map.placeholder.box_selector=""}down(e,t){const{pos:n,selector:i}=t,{type:r,res:s}=i;"fig"===r&&this._interaction.check_mouse_key(e,"left")&&(e.preventDefault(),this.flow=!0,this.point_down=this.map.view_point_to_real(n))}move(e){if(!this.flow)return;this.count++,e.preventDefault();const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t),i=this.get_rect_area(this.point_down,n);if(this.map.placeholder.box_selector=i,this.count%this.rate!==0)return;this.count=1;const r={x:Math.min(this.point_down.x,n.x),y:Math.min(this.point_down.y,n.y),width:Math.abs(n.x-this.point_down.x),height:Math.abs(n.y-this.point_down.y)},s=this.map.get_nodes_intersection(r);this.map.clear_node_selected();for(let e of s)this.map.register_node_selected(e)}up(e){this.flow&&(e.stopPropagation(),e.preventDefault(),this.reset())}cancel(e){this.flow&&this.reset()}wheel(e){}leave(){}dblclick(e,t){}contextmenu(e){}get_rect_area(e,t,n=4){const i=t.x-e.x,r=t.y-e.y,s=Math.sign(i)*n,o=Math.sign(r)*n,a=e,l=a.x+i,c=a.y,d=t,h=a.x,u=a.y+r;return`M${a.x+s} ${a.y}H${l-s}Q${l} ${c} ${l} ${c+o}V${d.y-o}Q${d.x} ${d.y} ${d.x-s} ${d.y}H ${h+s}Q${h} ${u} ${h} ${u-o}V${a.y+o}Q${a.x} ${a.y} ${a.x+s} ${a.y}Z`}check_intersection(e,t){const n=e.x+e.width/2,i=e.y+e.height/2,r=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-r),a=Math.abs(i-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}}class Ic extends Ss{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-click-select"}down(e,t){const{selector:n,pos:i}=t,{type:r,res:s}=n;"node"!==r||n.res.editable||(e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.map.clear_node_selected(),s.pcube.toggle_node_selected(s))}move(e){this.flow}up(e){this.flow}leave(e){}cancel(e){}wheel(e){}dblclick(e){}contextmenu(e){}}class Bc extends Ss{_interaction;down_node;down_pos;matrix=new Map;matrix_translate=xs.get_matrix_translate(0,0);scope_down;flow=!1;recover_select=!1;has_down=!1;view_cubes=[];near;intention="none";constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-drag"}reset_status(){this.recover_select=!1,this.matrix.clear(),this.flow=!1,this.has_down=!1,this._interaction.info_node_drag.show=!1,this.view_cubes=[]}down(e,t){this.scope_down=t;const{selector:n,pos:i,selected_nodes:r,view_cubes:s}=t;if("node"===n.type&&this.map.interaction.check_mouse_key(e,"left")&&!n.res.editable)if(e.stopPropagation(),e.preventDefault(),this.reset_status(),this.has_down=!0,this.view_cubes=s,this.down_node=n.res,this.down_pos=this.map.view_point_to_real(i),r.has(this.down_node))for(let e of r)e.env.is_captive||this.matrix.set(e,{...e.matrix2d});else this.matrix.set(this.down_node,{...this.down_node.matrix2d})}move(e){if(!this.has_down||!this.map.interaction.check_mouse_key(e,"left")||!this.down_pos)return;this.flow=!0,e.preventDefault();const t=this._interaction.info_node_drag,n={x:e.clientX,y:e.clientY},i=this.map.view_point_to_real(n),r=i.x-this.down_pos.x,s=i.y-this.down_pos.y;if(!this.recover_select){this.map.clear_node_selected();for(let[e]of this.matrix)this.map.register_node_selected(e);this.recover_select=!0}t.show=!1,this.matrix_translate=xs.get_matrix_translate(r,s);for(let[e,t]of this.matrix){if(!t)continue;const n=xs.multiply(t,this.matrix_translate);e.reset_matrix(n)}}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this,i=t.get_recorder();if(e.ctrlKey);else{const e=[];for(let[t,n]of this.matrix){if(!n)continue;t.reset_matrix(n),t.is_layout_root&&t.env.layout_type&&e.push(t);const r=xs.multiply(n,this.matrix_translate),s=Is.layout_change(t.id,{matrix2d:r});i.tell(t,s)}n.record(i),this.map.grider.update_nodes([...this.matrix.keys()]);for(let t of e)t.layout_throttle()}this.reset_status()}cancel(e){this.flow&&this.reset_status()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class jc extends Ss{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit"}down(e,t){}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){const{selector:n,pos:i}=t;"node"===n.type&&(e.stopPropagation(),e.preventDefault(),n.res.editable=!0)}contextmenu(e){}}class qc extends Ss{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit-exit"}down(e,t){const{selector:n}=t,{type:i,res:r}=n;"fig"!==i&&"empty"!==i||(e.stopPropagation(),e.preventDefault(),this.cubes.clear_all_map_selected(),this.map.clear_node_editing())}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){}contextmenu(e){}}class Hc extends Ss{_interaction;down_node;flow=!1;selected_nodes=new Set;recorver_selected=!1;has_down=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-line"}reset_status(){this.flow=!1,this.has_down=!1,this.selected_nodes.clear(),this.map.placeholder.linker=[],this.recorver_selected=!1}down(e,t){const{selector:n,pos:i,selected_nodes:r}=t;if("node"===n.type&&this._interaction.check_mouse_key(e,"right"))if(this.reset_status(),this.has_down=!0,e.preventDefault(),e.stopPropagation(),this.down_node=n.res,r.has(this.down_node))for(let e of r)this.selected_nodes.add(e);else this.selected_nodes.add(this.down_node)}move(e){if(!this._interaction.check_mouse_key(e,"right")||!this.has_down)return;this.flow=!0,e.stopPropagation(),e.preventDefault();const t=this._interaction.get_map_selector(e),{res:n,type:i}=t;this.map.placeholder.linker=[];const r=this.map.config.data.map_linker_line;if(!this.recorver_selected){this.recorver_selected=!0,this.map.clear_node_selected();for(let e of this.selected_nodes)this.map.register_node_selected(e)}if("node"===i)for(let e of this.selected_nodes){const{from:t,to:i}=ks.find_closest_points(e.sample,n.sample);this.map.placeholder.linker.push(Tc.get_line(t,i,r))}else{const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);for(let e of this.selected_nodes){const t=ks.find_closet_point(e.sample,n);this.map.placeholder.linker.push(Tc.get_line(t,n,r))}}}up(e){if(!this.flow)return this.reset_status();e.preventDefault(),e.stopPropagation();const{courier:t,history:n}=this,i=this._interaction.get_map_selector(e),{res:r,type:s}=i;if("node"===s){if(r===this.down_node)return;const e=t.get_recorder();for(let t of this.selected_nodes){const n=this.map.get_linker_id(t.id,r.id);if(this.map.get_linker(n))Cs.tips?.tip_warning("已存在连接线");else{const n=ks.create_linker_info(this.map,t.id,r.id),i=Bs.linker_add(this.map.id,[n]);e.tell(this.map,i)}}n.record(e)}else if("fig"===s){const{courier:t,history:n}=this,i=t.get_recorder(),r=ao.get_default_node_pos({x:e.clientX,y:e.clientY},this.map),s=gd.get_default(r),o=Bs.node_add(this.map.id,[s]);i.tell(this.map,o);for(let e of this.selected_nodes){const t=this.map.get_linker_id(e.id,s.id);if(this.map.get_linker(t)){Cs.tips?.tip_warning("已存在连接线");continue}const n=ks.create_linker_info(this.map,e.id,s.id),r=Bs.linker_add(this.map.id,[n]);i.tell(this.map,r)}n.record(i)}this.reset_status()}leave(){}cancel(e){this.reset_status()}wheel(e){}dblclick(e,t){}contextmenu(e){e.preventDefault()}}class Fc extends Ss{_map;interactions_pointer=[];interaction_keyboard=[];constructor(e){super(e.root),this._map=e,this.interactions_pointer.push(new Nc(this)),this.interactions_pointer.push(new Oc(this)),this.interactions_pointer.push(new jc(this)),this.interactions_pointer.push(new qc(this)),this.interactions_pointer.push(new Ec(this)),this.interactions_pointer.push(new Hc(this)),this.interactions_pointer.push(new Bc(this)),this.interactions_pointer.push(new Dc(this)),this.interactions_pointer.push(new Lc(this)),this.interactions_pointer.push(new Ic(this)),this.map instanceof io&&this.interactions_pointer.push(new Rc(this))}info_node_drag=It({show:!1,count:0,x:0,y:0});get map(){return this._map}register(e){e.addEventListener("pointerdown",this.pointerdown.bind(this)),e.addEventListener("pointermove",this.pointermove.bind(this)),e.addEventListener("pointerup",this.pointerup.bind(this)),e.addEventListener("pointercancel",this.pointercancel.bind(this)),e.addEventListener("pointerleave",this.pointerleave.bind(this)),e.addEventListener("wheel",this.wheel.bind(this)),e.addEventListener("dblclick",this.dblclick.bind(this)),e.addEventListener("contextmenu",this.contextmenu.bind(this))}check_mouse_key(e,t){return Ts.check_mouse_key(e,t)}get_map_selector(e){let t=e.target;for(;t&&t!==document.body;){const e=t.dataset.type,i=t.id;if(i&&e){if(e===n.node){const e=this.map.get_node(i);if(e)return{type:"node",res:e}}else if(e===n.linker){const e=this.map.get_linker(i);if(e)return{type:"linker",res:e}}else if(e===n.map||e===n.submap)return{type:"fig",res:this.map};t=t.parentElement}else t=t.parentElement}return{type:"empty",res:void 0}}pointerdown(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()},{selector:n}=t,{res:i,type:r}=n;if("node"===r&&this.root.isdev){this.map.nodes_test[i.id]=i,console.log("------------------------------------节点信息");const t=i.bound;console.log("id",i.id),console.log("matrix:",{...t.matrix2d}),console.log("pos:",t.pos),console.log("pos_tree:",t.pos_tree),console.log("size_bound:",t.size_bound),console.log("size_tree:",t.size_tree),console.log("fig_pos:",i.pcube.real_point_to_fig(t.pos)),console.log("view_pos:",i.pcube.real_point_to_view(t.pos)),console.log("to_size",i.to.size),console.log("in_size",i.from.size),console.log("节点",i),this.check_mouse_key(e,"mid")&&i.a()}for(let n of this.interactions_pointer)n.down(e,t);"fig"===t.selector.type&&this.event.emit_fig_click(e)}pointermove(e){for(let t of this.interactions_pointer)t.move(e)}pointerup(e){for(let t of this.interactions_pointer)t.up(e)}pointercancel(e){for(let t of this.interactions_pointer)t.cancel(e)}pointerleave(e){for(let t of this.interactions_pointer)t.leave(e)}dblclick(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()};for(let n of this.interactions_pointer)n.dblclick(e,t)}wheel(e){for(let t of this.interactions_pointer)t.wheel(e)}contextmenu(e){for(let t of this.interactions_pointer)t.contextmenu(e)}}const $c={class:"map-status"},Gc=Bn({__name:"submap-status",props:{cube:{}},setup(e){function t(t){const n=e.cube.dom_rect,i={x:n.x+n.width/2,y:n.y+n.height/2};e.cube.scale_by_point(i,t,t)}return(n,i)=>(Nr(),Dr("div",$c,[Fr("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:i[0]||(i[0]=e=>t(-.1))}),Fr("span",null,Ce((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),Fr("span",{class:"iconfont icon-add",onClick:i[1]||(i[1]=e=>t(.1))})]))}}),Vc=(0,Uo.A)(Gc,[["__scopeId","data-v-cb09d654"]]),Uc=["id","data-type"],Wc=["transform"],Yc=["data-group"],Xc=["data-group"],Kc=["data-group"],Jc=["data-group"],Qc=["d"],Zc=["d","stroke-width","stroke","marker-start","marker-end"],ed=["d"],td=Bn({__name:"cube-submap",props:{cube:{}},setup(e){const{placeholder:t}=e.cube,i=e.cube.config.data,r=Kt(),s=Kt(),o=new ResizeObserver(t=>{e.cube.get_view_rect()}),a=Kt();let l;function c(){e.cube.dom_svg_rect}return ni(()=>{const t=s.value;t&&o.observe(t);const n=r.value;n&&e.cube.interaction.register(n);const i=a.value;if(!i)return;l=new Es.DragDiff(i);let c=e.cube.attrs.width,d=e.cube.attrs.height,h=c,u=d;l.register_down(()=>{c=e.cube.attrs.width,d=e.cube.attrs.height}),l.register_move((e,t)=>{h=Math.round(e+c),u=Math.round(t+d),n.style.width=h+"px",n.style.height=u+"px"}),l.register_up((t,n)=>{if(c===h&&d===u)return;const i=e.cube.courier.get_recorder(),r=Math.round(t+c),s=Math.round(n+d);i.tell(e.cube,Rs.resize(e.cube.id,r,s)),e.cube.history.record(i),e.cube.check_show()}),l.register_cancel(()=>{e.cube.attrs.width=c,e.cube.attrs.height=d})}),oi(()=>{l?.off()}),(e,o)=>(Nr(),Dr("div",{class:"cube-submap",id:e.cube.id,style:me(e.cube.css),"data-type":Zt(n).submap,ref_key:"box",ref:r,onClick:c},[(Nr(),Dr("svg",{ref_key:"svg",ref:s},[Fr("g",{transform:e.cube.matrix2d_dom_string},[Fr("g",{"data-group":Zt(h).markers,class:"group-defs"},[...o[0]||(o[0]=[Wr('<defs data-v-27b2dc9e>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-27b2dc9e><path d="M 0 0 L 6 3 L 0 6 z" data-v-27b2dc9e></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-27b2dc9e><circle cx="3" cy="3" r="3" data-v-27b2dc9e></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-27b2dc9e><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-27b2dc9e></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-27b2dc9e><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-27b2dc9e></rect></marker></defs>',1)])],8,Yc),Fr("g",{"data-group":Zt(h).linkers,class:"group-linkers"},[(Nr(!0),Dr(Cr,null,_i(e.cube.get_linkers_view(),e=>(Nr(),Ir(ia,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Xc),Fr("g",{"data-group":Zt(h).nodes,class:"group-nodes"},[(Nr(!0),Dr(Cr,null,_i(e.cube.get_nodes_view(),e=>(Nr(),Ir(ia,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Kc),Fr("g",{"data-group":Zt(h).placeholder,class:"group-placeholder"},[Zt(t).box_selector?(Nr(),Dr("path",{key:0,class:"placeholder-box-selector",d:Zt(t).box_selector},null,8,Qc)):Yr("v-if",!0),(Nr(!0),Dr(Cr,null,_i(Zt(t).linker,e=>(Nr(),Dr(Cr,null,[e?(Nr(),Dr("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":Zt(i).map_linker_stroke_width,stroke:Zt(i).map_linker_stroke,"marker-start":`url(#${Zt(i).map_linker_anchor_left})`,"marker-end":`url(#${Zt(i).map_linker_anchor_right})`},null,8,Zc)):Yr("v-if",!0)],64))),256)),Zt(t).line_delete?(Nr(),Dr("path",{key:1,class:"placeholder-line-delete",d:Zt(t).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,ed)):Yr("v-if",!0),Yr(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),$r(cc,{interaction:e.cube.interaction},null,8,["interaction"])],8,Jc)],8,Wc)],512)),$r(Vc,{cube:e.cube},null,8,["cube"]),Fr("div",{class:"submap-dragger",ref_key:"dragger",ref:a},null,512)],12,Uc))}}),nd=(0,Uo.A)(td,[["__scopeId","data-v-27b2dc9e"]]);class id{_row;_col;_nodes=new Set;constructor(e,t){this._row=e,this._col=t}get pos(){return{row:this._row,col:this._col}}get row(){return this._row}get col(){return this._col}get nodes(){return new Set(this._nodes)}add_node(e){this._nodes.add(e)}remove_node(e){this._nodes.delete(e)}}class rd{_map;_nodes=new Map;_grider=[];_grid_width;_grid_height;constructor(e){this._map=e,this._grid_width=window.innerWidth,this._grid_height=window.innerHeight}get map(){return this._map}get grid_size(){return{width:this._grid_width,height:this._grid_height}}update_nodes(e){for(let t of e)this.update_node(t)}update_node(e){const t=this.get_node_griders(e),n=e.id;if(this._nodes.has(n)){this._nodes.get(n).forEach(t=>t.remove_node(e))}const i=[];t.forEach(e=>{const t=e.row,n=e.col;if(this._grider[t]||(this._grider[t]=[]),!this._grider[t][n]){const e=new id(t,n);this._grider[t][n]=e}i.push(this._grider[t][n])}),this._nodes.set(n,i),i.forEach(t=>t.add_node(e))}remove_node(e){const t=e.id;if(this._nodes.has(t)){this._nodes.get(t).forEach(t=>t.remove_node(e)),this._nodes.delete(t)}}get_node_griders(e){const t=[],n=e.bound.rect,i=Math.floor(n.y/this._grid_height),r=Math.floor((n.y+n.height)/this._grid_height),s=Math.floor(n.x/this._grid_width),o=Math.floor((n.x+n.width)/this._grid_width);for(let e=i;e<=r;e++)for(let n=s;n<=o;n++)t.push({row:e,col:n});return t}get_viewport_griders(){const e=this._map.get_view_rect(),t=[],n=Math.floor(e.y/this._grid_height),i=Math.floor((e.y+e.height)/this._grid_height),r=Math.floor(e.x/this._grid_width),s=Math.floor((e.x+e.width)/this._grid_width);for(let e=n;e<=i;e++)for(let n=r;n<=s;n++)this._grider[e]&&this._grider[e][n]&&t.push(this._grider[e][n]);return t}get_intersection_griders(e){const t=[],n=Math.floor(e.y/this._grid_height),i=Math.floor((e.y+e.height)/this._grid_height),r=Math.floor(e.x/this._grid_width),s=Math.floor((e.x+e.width)/this._grid_width);for(let e=n;e<=i;e++)for(let n=r;n<=s;n++)this._grider[e]&&this._grider[e][n]&&t.push(this._grider[e][n]);return t}get_intersection_nodes(e){const t=new Set,n=this.get_intersection_griders(e),i=this.grid_size;for(let r of n){const n={x:r.col*i.width,y:r.row*i.height,width:i.width,height:i.height};if(Es.MathRect.is_include(e,n))for(let e of r.nodes)t.add(e);else for(let n of r.nodes)Es.MathRect.check_intersection(e,n.bound.rect)&&t.add(n)}return t}}function sd(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class od extends ro{_interaction;_has_layout=!1;_display_success=!1;_grider=new rd(this);data;nodes_test=Bt({});matrix2d=It(xs.get_default());nodes=Bt({});node_from=It({});node_to=It({});node_editing=Bt(new Set);linkers=Bt({});nodes_selected=Bt(new Set);line_delete_selected=Bt(new Set);view_nodes=Bt(new Set);view_linkers=Bt(new Set);_view_rect=It({x:0,y:0,width:0,height:0});placeholder=It({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e,t){return super(e,t),this._interaction=new Fc(this),this.setup(e,t)}get nodes_count(){return Object.keys(this.nodes).length}get linkers_count(){return Object.keys(this.linkers).length}get grider(){return this._grider}get perf(){return!1}get css(){return{...super.css,width:this.attrs.width+"px",height:this.attrs.height+"px"}}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout}get view_rect(){return{...this._view_rect}}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get matrix2d_dom_string(){return xs.get_dom_string(this.matrix2d)}get interaction(){return this._interaction}get domain(){return"doc"}get meta(){return od.meta}get component(){return nd}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_svg_rect,i=Math.max(n.left,0),r=Math.min(n.right,t),s={x:i,y:Math.max(0,n.top)},o={x:r,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y,h={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,h),h}get_view_center(){const e=this.get_view_rect();return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.view_rect,t=[];for(let n of Object.values(this.nodes)){Es.MathRect.check_intersection(e,n.bound.rect)&&t.push(n)}for(let n of Object.values(this.linkers)){Es.MathRect.check_intersection(e,n.rect)&&t.push(n)}return t}check_node_visible(e){return this.view_nodes.has(e)}find_layout_root(e){const t=new Set;for(let n of e){const e=n.env.layout_root;e&&t.add(e)}return t}wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}find_cube(e){const t=this.linkers[e];if(t)return t;for(let t of Object.values(this.nodes)){const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof ao?(this.nodes[t.id]=t,this.view_nodes.add(t)):t instanceof ad&&(this.linkers[t.id]=t,this.view_linkers.add(t))}show_all(){for(let e of Object.values(this.nodes))this.view_nodes.add(e);for(let e of Object.values(this.linkers))this.view_linkers.add(e)}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){let t=[];for(let n of Object.values(this.nodes)){const i=n.bound.rect;Es.MathRect.check_intersection(e,i)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof ao?this.view_nodes.add(e):e instanceof ad&&this.view_linkers.add(e):e instanceof ao?this.view_nodes.delete(e):e instanceof ad&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof ao?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof ad&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===P.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===P.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.x+n.width>i.x+i.width)&&(e=t)}return e}if(e===P.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y+n.height>i.y+i.height)&&(e=t)}return e}if(e===P.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y<i.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let i=e,r=1/0;if(t===P.left)for(let t of Object.values(this.nodes)){if(!t.show||e===t)continue;const s=t.bound.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=Es.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=Es.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=Es.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=Es.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}return i}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}layout(){for(let e of Object.values(this.nodes))e.is_layout_root&&e.attrs.layout&&e.layout()}env_flow(){const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&e.push(t);for(let t of e)t.env.flow(t.env)}check_in_view(e){const{innerHeight:t,innerWidth:n}=window;return!(e.y>t||e.y+e.height<0)&&!(e.x>n||e.x+e.width<0)}check_show(){this.perf&&this.check_show_node()}check_show_node(){if(this.perf)for(let e of Object.values(this.nodes))e.check_show()}layout_throttle=Es.Notice.throttle(this.layout.bind(this),70);check_show_throttle=Es.Notice.throttle(this.check_show.bind(this),100);check_show_node_throttle=Es.Notice.throttle(this.check_show_node.bind(this),100);async build_child(e){const{nodes:t,linkers:n}=e.info,i=Ts.build_cubes(t,this);for(let e of i)this.nodes[e.id]=e,this.view_nodes=Bt(new Set(i));await this.wait_nodes_render(i),this.env_flow(),await this.layout(),this._has_layout=!0;for(let e of n){const t=this.get_node(e.attrs.from),n=this.get_node(e.attrs.to);if(!t||!n)continue;const i=new ad(e,this);this.linkers[i.id]=i,this.perf||this.view_linkers.add(i)}}update_data(e,t){return od.update_data(e,t)}export(){const e=od.get_default();e.id=this.id,e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs));const t=[],n=[];e.info={nodes:t,linkers:n,node_from:structuredClone(Vt(this.node_from)),node_to:structuredClone(Vt(this.node_to))};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),e.gc()}remove_linker(e){delete this.linkers[e.id],this.view_linkers.delete(e),e.gc()}on_node_add(e){const{data:t}=e,{cursor:n,courier:i,history:r}=this,s=i.get_recorder();s.add_cmd(e);const o=Ts.build_cubes(t,this);this.pick(...o);const a=t.map(e=>e.id);return s.add_recover(Bs.node_remove(this.id,a)),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=new Set;for(let e of t){const t=this.get_node(e);if(!t)continue;o.push(t.export());const n=t.env.layout_root;n&&n!==t&&a.add(t.env.layout_root);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&s.tell(this,Bs.linker_remove(this.id,[t]))}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&s.tell(this,Bs.linker_remove(this.id,[n]))}this.remove_node(t)}return s.add_recover(Bs.node_add(this.id,o)),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this,s=n.get_recorder();if(0===t.length)return;s.add_cmd(e);let o=Promise.resolve();const a=[],l=new Set,c=[];for(let e of t){const{index_to:t,index_from:n,linker:i}=e,r=new ad(i,this),s=r.from_node,o=r.to_node;if(!s||!o)continue;this.pick(r);let d=this.node_from[r.to_id],h=this.node_to[r.from_id];if(d?d.indexOf(r.from_id)<0&&d.splice(n,0,r.from_id):this.node_from[r.to_id]=[r.from_id],h?h.indexOf(r.to_id)<0&&h.splice(t,0,r.to_id):this.node_to[r.from_id]=[r.to_id],c.unshift(r.id),!o.env.is_captive){const{has_root:e,line:t}=ks.find_line_to_layout_root(o);a.push(o.wait_layout_self()),t[1]&&l.add(t[1])}}const d=new Set;for(let e of l){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&d.add(t)}return s.add_recover(Bs.linker_remove(this.id,c)),o.then(async()=>{await Promise.all(a);for(let e of d)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=[];for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=this.get_node(t.from_id);n&&a.push(n);const i=this.node_to[t.from_id],r=this.node_from[t.to_id];if(i&&r){const e=i.indexOf(t.to_id),n=r.indexOf(t.from_id);i.splice(e,1),r.splice(n,1),o.unshift({linker:t.export(),index_to:e,index_from:n})}this.remove_linker(t)}const l=this.find_layout_root(a);for(let e of l)e.layout_throttle();return s.add_recover(Bs.linker_add(this.id,o)),s}get_linker_id(e,t){return e+"-"+t}replace_id(e,t={}){return od.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e)}translate(e,t){const n=xs.multiply(this.matrix2d,xs.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:i,map_scale_min:r}=this.config.data,s=this.matrix2d.a+t;if(s>i||s<r)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=xs.multiply(this.matrix2d,xs.get_matrix_translate(o.x-l.x,o.y-l.y));this.reset_matrix(c)}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:i}=this.get_upstream_sum_scale();let{x:r,y:s}=e;return{x:(r-t.x)/n,y:(s-t.y)/i}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+i*l+s,y:n*a+r*l+o}}untransform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-i*l)/t,y:(l-o-n*a)/r}}static get meta(){return{type:n.submap,cubename:"子图",version:1,block:!0,show:!0}}static get_default(e=400,t=200){return{id:Ts.get_id(),type:n.submap,info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{width:e,height:t}}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,Ts.replace_id(e,e.cube_versions,t.info.nodes,n),Ts.replace_id(e,e.cube_versions,t.info.linkers,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}sd([Fs(a.node_add)],od.prototype,"on_node_add",null),sd([Fs(a.node_remove)],od.prototype,"on_node_remove",null),sd([Fs(a.linker_add)],od.prototype,"on_linker_add",null),sd([Fs(a.linker_remove)],od.prototype,"on_linker_remove",null);class ad extends so{_point_from={x:0,y:0};_point_to={x:0,y:0};_show=!1;pcube;sample=Bt([]);_path=vs(()=>this.layout_self());constructor(e,t){return super(e,t),this.pcube=t,this.setup(e,t)}_from_node=vs(()=>this.pcube.get_node(this.from_id));_to_node=vs(()=>this.pcube.get_node(this.to_id));get show(){return this._show}set show(e){this._show=e,e?this.pcube.set_graph_visible(this,!0):this.pcube.set_graph_visible(this,!1)}get info(){return this.data.info}get anchor_left(){return this.attrs.anchor_left||x.point}get anchor_right(){return this.attrs.anchor_right||x.arrow}get point_from(){return{...this._point_from}}get point_to(){return{...this._point_to}}get rect(){return{x:Math.min(this._point_from.x,this._point_to.x),y:Math.min(this._point_from.y,this._point_to.y),width:Math.abs(this._point_from.x-this._point_to.x),height:Math.abs(this._point_from.y-this._point_to.y)}}get component(){return ac}get from_id(){return this.attrs.from}get to_id(){return this.attrs.to}get from_node(){return this._from_node.value}get to_node(){return this._to_node.value}export(){const e=this.base_export();return e.attrs.from=this.from_id,e.attrs.to=this.to_id,e}build_child(e){}update_data(e,t){return ad.update_data(e,t)}get meta(){return ad.meta}get domain(){return"map"}get id(){return ks.get_linker_id(this.from_id,this.to_id)}get path(){return this._path.value}replace_id(e,t={}){return ad.replace_id(this.root,e,t)}layout_self(){const e=this.from_node,t=this.to_node;if(!e||!t)return"";const n=this.attrs.type,i=Ac.find(e,t);if(i){this._point_from=i.from,this._point_to=i.to;const e=Tc.draw({type:n,...i});return this.sample=ks.svg_path_sample(e,8),e}return""}get_linker_info(){const e=this.from_node,t=this.to_node;if(!e||!t)return;const n=this.pcube.get_node_to(e.id),i=this.pcube.get_node_from(t.id),r=n?.indexOf(t.id)||-1,s=i?.indexOf(e.id)||-1;return{linker:this.export(),index_from:s,index_to:r}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof od||t instanceof zc)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}check_show(){return this.from_node?.show||this.to_node?.show?(this.show=!0,!0):(this.show=!1,!1)}on_linker_update(e){const{courier:t,history:n}=this,{attrs:i}=e,r=t.get_recorder();r.add_cmd(e);const s=structuredClone(Vt(this.data.attrs));Object.assign(this.attrs,i);const o=Pc.update(this.id,s);return r.add_recover(o),r}get_link_right(){const e=this.from_node?.bound.get_bound_rect_point(Es._RectPosition.right_mid),t=this.to_node?.bound.get_bound_rect_point(Es._RectPosition.left_mid),n=this.attrs.type;return e&&t?"line"===n?Tc.line(e,t):"bezier2"===n?Tc.bezier2(e,t):Tc.line(e,t):""}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,t.attrs.from=n[t.attrs.from]||t.attrs.from,t.attrs.to=n[t.attrs.to]||t.attrs.to,t}static get meta(){return{cubename:"连接线",type:n.linker,block:!1,version:1,show:!1}}static get_default(e,t,i){const{map_linker_anchor_left:r,map_linker_anchor_right:s,map_linker_line:o,map_linker_stroke:a,map_linker_stroke_width:l}=eo.config;return{id:ks.get_linker_id(e,t),type:n.linker,info:{},attrs:{from:e,to:t,type:i||o,anchor_left:r,anchor_right:s,stroke:a,stroke_width:l},css:{}}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([Fs(k.update)],ad.prototype,"on_linker_update",null);class ld{_observer;_nodes={};constructor(){this._observer=new ResizeObserver(this.watch.bind(this))}watch(e,t){for(let t of e){const e=t.target,n=t.target.dataset.id,i=this._nodes[n];i&&e.isConnected&&i.layout_self(t)}}register(e,t){const n=e.dataset.id;n&&(this._nodes[n]=t,this._observer.observe(e))}unregister(e){const t=e.dataset.id;t&&(delete this._nodes[t],e&&this._observer.unobserve(e))}}const cd=new ld,dd=["id","data-type","transform","data-editing"],hd=["d"],ud=["x","y","width","height"],pd=["data-id"],fd={class:"node-status"},md=Bn({__name:"cube-node",props:{cube:{}},setup(e){const{bound:t,shape:i}=e.cube,r=Kt(),{map_node_padding:s}=e.cube.config.data;ni(()=>{const t=r.value;t&&cd.register(t,e.cube)}),si(()=>{const e=r.value;e&&cd.unregister(e)});const o=vs(()=>({"node-selected":e.cube.pcube.is_node_selected(e.cube),"node-editable":e.cube.editable,"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}));function a(t,n){e.cube.event.emit_node_status_click(t,{node:e.cube,click:n})}function l(t=!0){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Is.layout_change(e.cube.id,{fold:t});r.tell(e.cube,s),i.record(r)}return(e,s)=>(Nr(),Dr("g",{id:e.cube.id,"data-type":Zt(n).node,class:ve(["cube-node",o.value]),transform:e.cube.matrix2d_dom_string,"data-editing":e.cube.editable},[Fr("path",{d:Zt(i).path,ref:"p",style:me({fill:e.cube.attrs.fill})},null,12,hd),(Nr(),Dr("foreignObject",{x:Zt(t).pos_cbox.x,y:Zt(t).pos_cbox.y,width:Zt(t).size.width,height:Zt(t).size.height,style:me(e.cube.css)},[Fr("div",{class:"cube-node-box",ref_key:"box",ref:r,"data-id":e.cube.id},[(Nr(!0),Dr(Cr,null,_i(e.cube.children,e=>(Nr(),Ir(ia,{key:e.id,cube:e},null,8,["cube"]))),128)),Yr(" node statusbar "),Fr("div",fd,[e.cube.is_layout_root?(Nr(),Dr("div",{key:0,class:"iconfont icon-system-mind-map-filled",onClick:s[0]||(s[0]=e=>a(e,"root"))})):Yr("v-if",!0),e.cube.attrs.layout?(Nr(),Dr("div",{key:1,class:ve(e.cube.icons[e.cube.attrs.layout]),onClick:s[1]||(s[1]=e=>a(e,"layout"))},null,2)):Yr("v-if",!0),e.cube.env.upstream&&e.cube.env.downstream.length>0?(Nr(),Dr(Cr,{key:2},[e.cube.attrs.fold?(Nr(),Dr("div",{key:0,class:"status-fold",onClick:s[2]||(s[2]=e=>l(!1))},Ce(e.cube.env.downstream_nodes.length),1)):(Nr(),Dr("div",{key:1,class:"iconfont icon-minus2",onClick:s[3]||(s[3]=e=>l(!0))}))],64)):Yr("v-if",!0)])],8,pd)],12,ud))],10,dd))}}),_d=(0,Uo.A)(md,[["__scopeId","data-v-13677cfa"]]);class gd extends ao{constructor(e,t){super(e,t);return this.setup(e,t)}get domain(){return"map"}get meta(){return gd.meta}get component(){return _d}build_child(e){this._children.push(...Ts.build_cubes(e.info,this))}update_data(e,t){return gd.update_data(e,t)}gc(){this.base_gc()}export(){const e=this.base_export();e.info=[],e.attrs=structuredClone(Vt(this.attrs)),e.attrs.matrix2d=this.matrix2d_real;for(let t of this._children)e.info.push(t.export());return e}replace_id(e,t={}){return gd.replace_id(this.root,e,t)}static get meta(){return{cubename:"图形节点",type:n.node,block:!0,version:1,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,Ts.replace_id(e,e.cube_versions,t.info,n),t}static get_default(e,t="rect"){return{id:Ts.get_id(),type:n.node,info:[$l.get_default()],attrs:{root:!1,matrix2d:{a:1,b:0,c:0,d:1,e:e.x,f:e.y},shape:t,layout:null},css:{}}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}a(e=!0,t="right",n=!1){const{courier:i}=this,r=i.get_recorder(),s=Is.layout_change(this.id,{root:e,layout:t,fold:n});r.tell(this,s),this.history.record(r),this.env.layout_root?.layout()}}class bd{_node;_size=It(ao.get_default_node_size());_size_bound=It(ao.get_default_node_size());_size_tree=It(ao.get_default_node_size());_pos_cbox=It({x:eo.default_config.map_node_padding,y:eo.default_config.map_node_padding});_pos;_pos_tree;_layout_pos_tree;constructor(e,t){this._node=e,this._pos=It({x:t.e,y:t.f}),this._pos_tree=It({x:t.e,y:t.f}),this._layout_pos_tree=It({x:t.e,y:t.f})}get config(){return this.node.config}get node(){return this._node}get env(){return this.node.env}get pcube(){return this.node.pcube}get matrix2d(){return{...this._node.attrs.matrix2d}}get rect(){return{...this._pos,...this._size_bound}}get size(){return{...this._size}}get size_tree(){return{...this._size_tree}}get size_bound(){return this._size_bound}get pos(){return{...this._pos}}get pos_raw(){return{x:this.matrix2d.e,y:this.matrix2d.f}}get pos_center(){return this.get_pos_center()}get pos_cbox(){return{...this._pos_cbox}}get pos_tree(){return this.env.upstream?{...this._layout_pos_tree}:{...this._pos_tree}}stat_downstream_nodes_size(e){const{map_node_hgap:t,map_node_vgap:n}=this.node.config.data;let i=0,r=0,s=0,o=0,a={x:0,y:0,width:0,height:0},l={x:0,y:0,width:0,height:0},c=0,d=0,h=this.size_bound.width/2,u=this.size_bound.height/2,p={x:0,y:0,width:0,height:0},f={x:0,y:0,width:0,height:0};for(let t of e){const e=t.bound.size_tree,n=t.bound.rect;s+=e.height,o+=e.width;let m=e.width-n.width/2,_=e.height-n.height/2;m>h&&(h=m),_>u&&(u=_),e.width>=i&&(i=e.width,p=n),e.height>=r&&(r=e.height,f=n),n.width>=c&&(c=n.width,l=n),n.height>=d&&(d=n.height,a=n)}return{max_tree_height:r,max_tree_width:i,sum_tree_height:s+(e.length-1)*n,sum_tree_width:o+(e.length-1)*t,max_height_node:a,max_width_node:l,max_tree_width_node:p,max_tree_height_node:f,tail_tree_width:h,tail_tree_height:u}}update_pos_cbox(){const e=this.node.attrs.shape,{width:t,height:n}=this.size_bound,{map_node_padding:i}=this.node.config.data,r=t/2,s=n/2;"circle"===e?(this._pos_cbox.x=r-this.size.width/2,this._pos_cbox.y=s-this.size.height/2):(this._pos_cbox.x=i,this._pos_cbox.y=i)}update_pos(){const e=this.size_tree,t=this.size_bound,n=this.pos_tree,i=this.node.env.layout_type,r=this._node.attrs.matrix2d.e,s=this._node.attrs.matrix2d.f,o=this._node.env.downstream;if(!this.env.layout_type||this.node.is_layout_root)this._pos.x=r,this._pos.y=s;else if(this.env.folded_self)this._pos.x=n.x,this._pos.y=n.y;else if("right"===i)this._pos.x=n.x,this._pos.y=n.y-t.height/2+e.height/2;else if("left"===i)this._pos.x=n.x+e.width-t.width,this._pos.y=n.y+e.height/2-t.height/2;else if("down"===i)this._pos.x=n.x+e.width/2-t.width/2,this._pos.y=n.y;else if("up"===i)this._pos.x=n.x+e.width/2-t.width/2,this._pos.y=n.y+e.height-t.height;else if("time-right"===i){const{sum_tree_height:e,sum_tree_width:i,max_tree_height:r,max_height_node:s,max_tree_width:a,max_tree_width_node:l,max_tree_height_node:c}=this.stat_downstream_nodes_size(o),d=Math.max(s.height,t.height)/2;this._pos.x=n.x,this._pos.y=n.y+d-t.height/2}else if("time-down"===i){const{sum_tree_height:e,sum_tree_width:i,max_tree_height:r,max_tree_width:s,max_tree_width_node:a,max_tree_height_node:l}=this.stat_downstream_nodes_size(o),c=Math.max(a.width,t.width)/2;this._pos.x=n.x+c-t.width/2,this._pos.y=n.y}}get_pos_center(){const e=this.pos,{width:t,height:n}=this.size_bound;return{x:e.x+t/2,y:e.y+n/2}}update_pos_tree_root(){if(!this.node.is_layout_root)return;const e=this.size_tree,t=this.node.env.layout_type,n=this.size_bound,i=this.matrix2d.e,r=this.matrix2d.f;if(t){if(this.node.attrs.fold)this._layout_pos_tree.x=i,this._layout_pos_tree.y=r;else if("right"===t)this._layout_pos_tree.x=i,this._layout_pos_tree.y=r+n.height/2-e.height/2;else if("left"===t)this._layout_pos_tree.x=i+n.width-e.width,this._layout_pos_tree.y=r+n.height/2-e.height/2;else if("down"===t)this._layout_pos_tree.x=i+n.width/2-e.width/2,this._layout_pos_tree.y=r;else if("up"===t)this._layout_pos_tree.x=i+n.width/2-e.width/2,this._layout_pos_tree.y=r+n.height-e.height;else if("time-right"===t){const e=this.node.env.downstream,t=n.height/2,{sum_tree_height:s,sum_tree_width:o,max_tree_height:a,max_tree_width:l,max_tree_width_node:c,max_tree_height_node:d,max_height_node:h,max_width_node:u}=this.stat_downstream_nodes_size(e);this._layout_pos_tree.x=i,this._layout_pos_tree.y=r-Math.max(t,h.height/2)+t}else if("time-down"===t){const e=this.node.env.downstream,t=n.width/2,{sum_tree_height:s,sum_tree_width:o,max_tree_height:a,max_tree_width:l,max_tree_width_node:c,max_tree_height_node:d,max_height_node:h,max_width_node:u}=this.stat_downstream_nodes_size(e);this._layout_pos_tree.x=i+t-Math.max(u.width/2,t),this._layout_pos_tree.y=r}}else this._layout_pos_tree.x=i,this._layout_pos_tree.y=r}update_pos_tree(e,t){this._layout_pos_tree.x=e,this._layout_pos_tree.y=t,this.update_pos()}update_size(e,t){this._size.width=e,this._size.height=t,this.update_size_bound(),this.update_pos_cbox(),this.pcube.has_layout&&Promise.resolve().then(async()=>{if(this.flow("upstream"),this.pcube.has_layout&&!this.node.clipboard.pasting){const e=this.node.env.layout_root;e&&e.layout_throttle()}})}update_size_bound(){const{map_node_padding:e}=this.node.config.data;this._size_bound.width=this.size.width+2*e,this._size_bound.height=this.size.height+2*e}update_size_tree(e){const t=this._node.env.layout_type,{map_node_hgap:n,map_node_vgap:i}=this.config.data,r=this.size_bound,{tail_tree_height:s,tail_tree_width:o,sum_tree_height:a,sum_tree_width:l,max_tree_height:c,max_tree_width:d,max_tree_width_node:h,max_tree_height_node:u,max_height_node:p,max_width_node:f}=this.stat_downstream_nodes_size(e);if("left"===t)0===e.length?this._size_tree.width=r.width:this._size_tree.width=r.width+n+d,this._size_tree.height=Math.max(r.height,a);else if("right"===t)0===e.length?this._size_tree.width=r.width:this._size_tree.width=r.width+n+d,this._size_tree.height=Math.max(r.height,a);else if("down"===t)this._size_tree.width=Math.max(r.width,l),e.length>0?this._size_tree.height=r.height+i+c:this._size_tree.height=r.height;else if("up"===t)this._size_tree.width=Math.max(r.width,l),e.length>0?this._size_tree.height=r.height+i+c:this._size_tree.height=r.height;else if("time-right"===t){u.height;const t=p.height/2,i=r.height/2;e.length>0?this._size_tree.width=r.width+n+l:this._size_tree.width=r.width,this._size_tree.height=Math.max(i,t)+s}else if("time-down"===t){const t=r.width/2,n=(h.width,f.width/2);this._size_tree.width=Math.max(t,n)+o,e.length>0?this._size_tree.height=r.height+i+a:this._size_tree.height=r.height}else Object.assign(this._size_tree,r)}flow(e="downstream"){const t=this._node.env.folded_self?[]:this._node.env.downstream;if(0===t.length&&Object.assign(this._size_tree,this.size_bound),"downstream"===e){for(let e of t)e.bound.flow();this.update_size_tree(t)}else if("upstream"===e){this.update_size_tree(t);const n=this.env.upstream;n&&!n?.is_layout_root&&this.env.upstream?.bound.flow(e)}}get_bound_rect_point(e){const t={...this.pos,...this.size_bound};return Es.MathRect.get_rect_point(t,e)}}class yd{static get_shaple(e,t=8){const n=e.attrs.shape;return"rect"===n?this.rect(e,t):"circle"===n?this.circle(e,t):this.rect(e)}static rect(e,t=8,n=4){const{width:i,height:r}=e.bound.size,s=0,o=0,a=i+2*t,l=0,c=i+2*t,d=r+2*t,h=0,u=r+2*t;return`M${s+n} ${o}H${a-n}Q${a} ${l} ${a} ${l+n}V${d-n}Q${c} ${d} ${c-n} ${d}H ${h+n}Q${h} ${u} ${h} ${u-n}V${o+n}Q${s} ${o} ${s+n} ${o}Z`}static circle(e,t=8){const{width:n,height:i}=e.bound.size,r=Math.sqrt(n*n+i*i)/2,s=0;return`M${r} ${s} A ${r} ${r} 0 1 0 ${r} ${2*r}A${r} ${r} 0 1 0 ${r} ${s}`}}function vd(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class wd extends io{_app;_interaction;_has_layout=Kt(!1);_grider=new rd(this);data;nodes_test=Bt({});nodes=Bt({});node_from=It({});node_to=It({});node_editing=Bt(new Set);linkers=Bt({});nodes_selected=Bt(new Set);line_delete_selected=Bt(new Set);view_nodes=Bt(new Set);view_linkers=Bt(new Set);_view_rect=It({x:0,y:0,width:0,height:0});placeholder=It({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e){super();const t=this.update_data(e.versions[this.meta.type],e).data;this.data=It(t),this.node_to=this.data.info.node_to||{},this.node_from=this.data.info.node_from||{},this._interaction=new Fc(this),this.build_child(t),Hs.init_cmd_handler(this),zs.add_map(this),this._app=ll(zc,{cube:this}),this.stats.view="map"}get grider(){return this._grider}get perf(){return this.config.data.map_perf}get matrix2d(){return this.attrs.matrix2d}get nodes_count(){return Object.keys(this.nodes).length}get linkers_count(){return Object.keys(this.linkers).length}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout.value}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get interaction(){return this._interaction}get matrix2d_dom_string(){return xs.get_dom_string(this.matrix2d)}get domain(){return"map"}get app(){return this._app}get component(){return zc}get meta(){return wd.meta}get children(){return[...this._children]}get view_rect(){return{...this._view_rect}}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_rect,i=Math.max(n.left,0),r=Math.min(n.right,t),s={x:i,y:Math.max(0,n.top)},o={x:r,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y,h={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,h),h}get_view_center(){const e=this.view_rect;return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.view_rect,t=[];for(let n of Object.values(this.nodes)){Es.MathRect.check_intersection(e,n.bound.rect)&&t.push(n)}for(let n of Object.values(this.linkers)){Es.MathRect.check_intersection(e,n.rect)&&t.push(n)}return t}find_layout_root(e){const t=new Set;for(let n of e){const e=n.env.layout_root;e&&t.add(e)}return t}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===P.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===P.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.x+n.width>i.x+i.width)&&(e=t)}return e}if(e===P.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y+n.height>i.y+i.height)&&(e=t)}return e}if(e===P.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y<i.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let i=e,r=1/0;if(t===P.left)for(let t of Object.values(this.nodes)){if(!t.show||e===t)continue;const s=t.bound.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=Es.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=Es.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=Es.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=Es.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}return i}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}wait_nodes_render(e){return ks.wait_nodes_render(e)}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof ao?(this.nodes[t.id]=Ut(t),this.view_nodes.add(t)):t instanceof ad&&(this.linkers[t.id]=Ut(t),this.view_linkers.add(t))}show_all(){for(let e of Object.values(this.nodes))this.view_nodes.add(e);for(let e of Object.values(this.linkers))this.view_linkers.add(e)}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){const t=this.grider.get_intersection_nodes(e);return Array.from(t)}set_graph_visible(e,t){t?e instanceof ao?this.view_nodes.add(e):e instanceof ad&&this.view_linkers.add(e):e instanceof ao?this.view_nodes.delete(e):e instanceof ad&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof ao?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof ad&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}check_node_visible(e){return this.view_nodes.has(e)}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),e.gc()}remove_linker(e){const t=this.node_to[e.from_id],n=this.node_from[e.to_id];let i;if(t&&n){const r=t.indexOf(e.to_id),s=n.indexOf(e.from_id);t.splice(r,1),n.splice(s,1),i={linker:e.export(),index_to:r,index_from:s}}return delete this.linkers[e.id],this.view_linkers.delete(e),e.gc(),i}async build_child(e){const{nodes:t,linkers:n}=e.info;console.time("🍋build-nodes");const i=[];for(let e of t){let t=new gd(e,this);i.push(t),this.nodes[t.id]=Ut(t),this.view_nodes.add(t)}console.timeEnd("🍋build-nodes");for(let e of n){const{from:t,to:n}=e.attrs,i=this.get_node(e.attrs.from),r=this.get_node(e.attrs.to);if(!i||!r){const e=this.node_to[t],i=e.indexOf(n);e.splice(i,0);const r=this.node_from[n],s=r.indexOf(t);r.splice(s,1);continue}const s=new ad(e,this);this.linkers[s.id]=Ut(s),this.perf||this.view_linkers.add(s)}this.init_env()}init_env(){const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&e.push(t);for(let t of e)t.env.flow(t.env)}init_boundbox(){console.time("🍋wait-size-tree");const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&e.push(t);for(let t of e)t.bound.flow();console.timeEnd("🍋wait-size-tree")}init_grider(){const e=Date.now(),t=Object.values(this.nodes);this._grider.update_nodes(t),console.log("🍋init-grider:",Date.now()-e)}async layout(){console.time("🍋layout-nodes");const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&e.push(t);for(let t of e)t.layout();console.timeEnd("🍋layout-nodes")}check_show(){this.perf&&(console.time("🍋动态显示检查"),this.check_show_node(),this.check_show_line(),console.timeEnd("🍋动态显示检查"))}check_show_node(){if(!this.perf)return;const e=this._grider.get_viewport_griders();this.view_nodes.clear();for(let t of e)for(let e of t.nodes)e.env.folded_upstream||this.view_nodes.add(e)}check_show_line(){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}layout_throttle=Es.Notice.throttle(this.layout.bind(this),10);check_show_throttle=Es.Notice.throttle(this.check_show.bind(this),10);check_show_node_throttle=Es.Notice.throttle(this.check_show_node.bind(this),10);gc(){}export(){const e=wd.get_default();e.id=this.id,e.versions=zs.export_versions(),e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs)),e.attrs.matrix2d={...this.matrix2d};const t=[],n=[];e.info={nodes:t,linkers:n,node_from:Vt(this.node_from),node_to:Vt(this.node_to)};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}update_data(e,t){return wd.update_data(e,t)}async render(e){this._dom=e,this.app.mount(e),console.time("🍋wait-svg & nodes"),await Promise.all([mc.ps,ks.wait_nodes_render([...this.view_nodes])]),console.timeEnd("🍋wait-svg & nodes"),await Ts.sleep(100),this.init_boundbox(),this.init_grider(),this.check_show(),this._has_layout.value=!0;const t=this.dom?.querySelector(".note");this.event.emit_status_update(),t&&(this.hotkeys.listen(t),this.interaction.register(t))}on_node_add(e){const{data:t}=e,{cursor:n,courier:i,history:r}=this,s=i.get_recorder();s.add_cmd(e);const o=Ts.build_cubes(t,this);this.pick(...o);const a=t.map(e=>e.id);return s.add_recover(Bs.node_remove(this.id,a)),Promise.resolve().then(async()=>{const e=o.map(e=>e.wait_layout_self());await Promise.all(e),this.grider.update_nodes(o)}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=[],l=new Set,c=[];for(let e of t){const t=this.get_node(e);if(t){a.push(t);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&c.push(t)}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&c.push(n)}}}for(let e of a){o.push(e.export());const t=e.env.layout_root;t&&t!==e&&l.add(e.env.layout_root),this.remove_node(e)}return s.tell(this,Bs.linker_remove(this.id,c)),s.add_recover(Bs.node_add(this.id,o)),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this,s=n.get_recorder();if(0===t.length)return;let o=Promise.resolve();s.add_cmd(e);const a=[],l=[],c=new Set;for(let e of t){const{index_to:t,index_from:n,linker:i}=e,r=new ad(i,this),s=r.from_node,o=r.to_node;if(!s||!o)continue;this.pick(r);let d=this.node_from[r.to_id],h=this.node_to[r.from_id];if(d?d.indexOf(r.from_id)<0&&d.splice(n,0,r.from_id):this.node_from[r.to_id]=[r.from_id],h?h.indexOf(r.to_id)<0&&h.splice(t,0,r.to_id):this.node_to[r.from_id]=[r.to_id],a.unshift(r.id),!o.env.is_captive){const{has_root:e,line:t}=ks.find_line_to_layout_root(o);l.push(o.wait_layout_self()),t[1]&&c.add(t[1])}}const d=new Set;for(let e of c){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&d.add(t)}return s.add_recover(Bs.linker_remove(this.id,a)),o.then(async()=>{await Promise.all(l);for(let e of d)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=new Set,l=new Set;for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=t.from_node,i=t.to_node;n&&a.add(n),i&&l.add(i);const r=this.remove_linker(t);r&&o.unshift(r)}if(0===o.length)return;for(let e of a)e.env.flow(),e.bound.flow("upstream");const c=new Set;for(let e of l){if(e.is_layout_root)continue;const{has_root:t,line:n}=ks.find_line_to_layout_root(e),i=n[1];t&&i?l.has(i)||c.add(i):e.env.clear()}for(let e of c)e.env.flow(),e.bound.flow("downstream"),e.bound.flow("upstream");const d=new Set;for(let e of[...a,...c]){const t=e.env?.layout_root;t&&d.add(t)}for(let e of d)e.layout_throttle();return s.add_recover(Bs.linker_add(this.id,o)),s}on_update_attrs(e){const{courier:t,history:n}=this,{data:i}=e,r=t.get_recorder();return r.add_cmd(e),"matrix2d"in i&&i.matrix2d&&(r.add_recover(Bs.update_attr(this.id,{matrix2d:{...this.matrix2d}})),this.reset_matrix(i.matrix2d)),r}get_linker_id(e,t){return ks.get_linker_id(e,t)}replace_id(e,t={}){return wd.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e),this.get_view_rect(),this.event.emit_status_update()}translate(e,t){const n=xs.multiply(this.matrix2d,xs.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:i,map_scale_min:r}=this.config.data,s=this.matrix2d.a+t;if(s>i||s<r)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=o.x-l.x,d=o.y-l.y,h=xs.multiply(this.matrix2d,xs.get_matrix_translate(c,d));this.reset_matrix(h)}get_upstream_sum_scale(){return{sx:1,sy:1}}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:i}=this.get_upstream_sum_scale();let{x:r,y:s}=e;return{x:(r-t.x)/n,y:(s-t.y)/i}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+i*l+s,y:n*a+r*l+o}}untransform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-i*l)/t,y:(l-o-n*a)/r}}static get meta(){return{type:n.map,cubename:"图形笔记",version:1,block:!0,show:!1}}static get_default(){return{id:Ts.get_id(),type:n.map,versions:zs.export_versions(),info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{matrix2d:xs.get_default()}}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,Ts.replace_id(e,e.cube_versions,t.info.nodes,n),Ts.replace_id(e,e.cube_versions,t.info.linkers,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}vd([Fs(a.node_add)],wd.prototype,"on_node_add",null),vd([Fs(a.node_remove)],wd.prototype,"on_node_remove",null),vd([Fs(a.linker_add)],wd.prototype,"on_linker_add",null),vd([Fs(a.linker_remove)],wd.prototype,"on_linker_remove",null),vd([Fs(a.update_attrs)],wd.prototype,"on_update_attrs",null);const xd=["id","data-type"],kd={class:"cube-api-functions"},Sd={key:0,class:"cube-api-arguments"},Cd={key:1,class:"cube-api-exceptions"},Md=Bn({__name:"cube-api",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Dr("div",{class:"cube-api",id:e.cube.id,"data-type":Zt(n).api,style:me(e.cube.css),ref:"root",onContextmenu:t[0]||(t[0]=t=>Zt(Io)(t,e.cube))},[Fr("div",kd,[t[1]||(t[1]=Fr("div",{class:"legend"},"api",-1)),$r(ia,{cube:e.cube.functions},null,8,["cube"])]),e.cube.arguments?(Nr(),Dr("div",Sd,[t[2]||(t[2]=Fr("div",{class:"legend"},"arguments",-1)),$r(ia,{cube:e.cube.arguments},null,8,["cube"])])):Yr("v-if",!0),e.cube.exceptions?(Nr(),Dr("div",Cd,[t[3]||(t[3]=Fr("div",{class:"legend"},"exceptions",-1)),$r(ia,{cube:e.cube.exceptions},null,8,["cube"])])):Yr("v-if",!0)],44,xd))}),zd=(0,Uo.A)(Md,[["__scopeId","data-v-25e3bd90"]]);class Td extends ro{_functions;_arguments=Kt(void 0);_exceptions=Kt(void 0);_temp_funcnames=[];constructor(e,t){return super(e,t),this.setup(e,t)}static get type_funciton(){return{padding:"0px 4px",background:"var(--api-functions-type-bg)",color:"var(--api-functions-type-color)"}}static get type_argument(){return{padding:"0px 4px",background:"var(--api-arguments-type-bg)",color:"var(--api-arguments-type-color)"}}get functions(){return this._functions}get arguments(){return this._arguments.value}get exceptions(){return this._exceptions.value}get component(){return zd}get children(){const e=[this._functions];return this.arguments&&e.push(this.arguments),this.exceptions&&e.push(this.exceptions),e}get meta(){return Td.meta}add_arguments(){if(this.arguments)return;const e=Yd.get_default();this._arguments.value=Ut(new Yd(e,this))}add_exceptions(){if(this.exceptions)return;const e=Yd.get_default();this._exceptions.value=Ut(new Yd(e,this))}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof ro&&r.push(e.export());return{children:i,data:r}}replace_id(e,t={}){return Td.replace_id(this.root,e,t)}build_child(e){this._functions=new Yd(e.info.functions,this),e.info.arguments&&(this._arguments.value=Ut(new Yd(e.info.arguments,this))),e.info.exceptions&&(this._exceptions.value=Ut(new Yd(e.info.exceptions,this)))}event_bubble(e){const{recorder:t,tcube:n,path:i,cmds:r}=e,s=[c.text_reset,m.remove,m.reset];i.includes(this.functions)&&r.find(e=>s.includes(e.name))&&this.parse(t);const o=r.find(e=>e.name===m.add);if(n===this.functions&&o)for(let e of o.data){const i=e.data.id,r=n.find_cube(i),s=r?.child_first_line;if(!s)continue;const o=Sa.get_default("type",Td.type_funciton),a=Rs.insert_child(s.id,[o],1);t.tell(s,a)}return{stop:!1}}parse(e){const t=[];for(let e of this.functions.items){const{indent:n,data:i}=e,r=i.child_first_line?.children.find(e=>e instanceof Sa);r&&t.push(r)}if(t.length===this._temp_funcnames.length){let e=!0;for(let n=0;n<t.length;n++){if(this._temp_funcnames[n]!==t[n].info){e=!1;break}}if(e)return}this._temp_funcnames=t.map(e=>e.info);const n=new Map;if(this.arguments)for(let e of this.arguments.items){const{indent:t,data:i}=e,r=i.child_first_line?.children.find(e=>e instanceof Sa);r&&n.set(r.info,{item:e,text:r})}const i=new Set;for(let e of t){let t=e.data.info,n=t.indexOf("("),r=t.lastIndexOf(")");if(n>=r)continue;let s=t.slice(n+1,r).split(",").map(e=>e.trim()).filter(e=>e);for(let e of s)i.add(e)}i.size>0&&this.add_arguments();const r=[...n.values()];if(i.size===r.length){for(let[t,n]of Es.Iteration.zip([...i],r))if(t!==n.text.info.trim()){const i=xa.reset(n.text.id,t);e.tell(n.text,i)}}else{const t=[];for(let e of i){const n=r.find(t=>t.text.info===e);if(n)t.push({indent:n.item.indent,data:n.item.data.export()});else{const n=Wl.get_default([Sa.get_default(e),Sa.get_default(" "),Sa.get_default("type",Td.type_argument)]);t.push(Yd.get_list_item([n]))}}if(this.arguments){const n=Oo.reset(this.arguments.id,t);e.tell(this.arguments,n)}}}gc(){super.base_gc()}export(){const e=this.base_export();return e.info.functions=this.functions.export(),this.arguments&&(e.info.arguments=this.arguments.export()),this.exceptions&&(e.info.exceptions=this.exceptions.export()),e}reset_api(e){const{courier:t,history:n}=this,{args:i,funcs:r}=e,s=t.get_recorder();return s.add_cmd(e),s}update_data(e,t){return Td.update_data(e,t)}static update_data(e,t){if(e>this.meta.version)return{data:t,usable:!1};if(e<2){const e=t,i=Td.get_default(e.css,e.attrs),r=[],s=[],o=i.info.functions,a=Yd.get_default();for(let t of e.info.names.info)if(t.type===n.line){const e=t.info.find(e=>e.type===n.text);r.push({name:e,type:void 0,desc:[]})}for(let t=0;t<e.info.funcs.length;t++){const i=e.info.funcs[t],s=i.desc.info[0],o=r[t];if(o){if(s.type===n.line){const e=s,t=e.info[0];if(t&&t.type===n.text&&(o.type=t),s.info.length>1){const t=Wl.get_default(e.info.slice(1));o.desc.push(t)}}o.desc.push(...i.desc.info.slice(1))}}for(let t=0;t<e.info.args.length;t++){const i=e.info.args[t],{name:r,desc:o}=i,a=i.desc.info[0],l={name:Sa.get_default(r),type:void 0,desc:[]};if(a.type===n.line){const e=a,t=e.info[0];if(t&&t.type===n.text&&(l.type=t),a.info.length>1){const t=Wl.get_default(e.info.slice(1));l.desc.push(t)}}l.desc.push(...i.desc.info.slice(1)),s.push(l)}if(r.length>0){o.info.length=0;for(let e=0;e<r.length;e++){const t=r[e],n=Wl.get_default([t.name,Sa.get_default(" ")]),i=t.type||Sa.get_default();Object.assign(i.css,this.type_funciton);const s=i.info.trim();s&&""!==s||(i.info="type"),n.info.push(i);const a=Yd.get_list_item([n,...t.desc]);o.info.push(a)}}if(s.length>0){a.info.length=0;for(let e=0;e<s.length;e++){const t=s[e],n=Wl.get_default([t.name,Sa.get_default(" ")]),i=t.type||Sa.get_default();Object.assign(i.css,this.type_argument);const r=i.info.trim();r&&""!==r||(i.info="type"),n.info.push(i);const o=Yd.get_list_item([n,...t.desc]);a.info.push(o)}i.info.arguments=a}return{data:i,usable:!0}}return{data:t,usable:!0}}static get_default(e={},t={}){return{id:Ts.get_id(),type:n.api,info:{functions:Yd.get_default()},css:e,attrs:t}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,t.info.functions=Yd.replace_id(e,t.info.functions,n),t.info.arguments&&(t.info.arguments=Yd.replace_id(e,t.info.arguments,n)),t.info.exceptions&&(t.info.exceptions=Yd.replace_id(e,t.info.exceptions,n)),t}static get meta(){return{type:n.api,version:2,cubename:"Api",block:!0,show:!0}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([Fs(p.reset)],Td.prototype,"reset_api",null);class Ad{static reset(e,t,n){return{id:e,name:p.reset,args:t,funcs:n}}}function Pd(e,t="tail"){const{courier:n,history:i}=e,r=new Os(n),s=[Ql.get_default(),Ql.get_default()],o=Nd.insert_row(e.id,t,[s]);r.tell(e,o),i.record(r)}class Nd{static insert_row(e,t,n){return{id:e,name:f.insert_row,pos:t,rows:n}}static remove_row(e,t,n=!1){return{id:e,name:f.remove_row,range:t,reserve:n}}static change_width_col1(e,t){return{id:e,width:t,name:f.change_width_col1}}}const Od=["id","data-type"],Rd=Bn({__name:"cube-detail-list",props:{cube:{}},setup(e){const t=e.cube.root,i=qn("root"),r=Kt();ni(()=>{const n=r.value,s=i.value;if(!n)return;const o=new Es.DragDiff(n);let a=e.cube.attrs.width_col1,l=a;o.register_down(()=>{a=e.cube.attrs.width_col1}),o.register_move((e,n)=>{t.stats.is_read_mode||(l=Math.round(e+a),s?.style.setProperty("--width-col1",l+"px"))}),o.register_up((n,i)=>{if(t.stats.is_read_mode)return;if(a===l)return;const r=e.cube.courier.get_recorder(),s=Math.round(n+a);r.tell(e.cube,Nd.change_width_col1(e.cube.id,s)),e.cube.history.record(r)}),o.register_cancel(()=>{e.cube.attrs.width=a,n.style.left=a-2+"px"})});const s=vs(()=>({...e.cube.css,"--width-col1":e.cube.attrs.width_col1+"px"}));return(t,o)=>(Nr(),Dr("div",{class:"cube-detail-list",id:t.cube.id,"data-type":Zt(n).detail_list,ref_key:"root",ref:i,style:me(s.value),onContextmenu:o[1]||(o[1]=e=>Zt(Io)(e,t.cube))},[(Nr(!0),Dr(Cr,null,_i(t.cube.children,t=>(Nr(),Ir(ia,{key:t.id,cube:t,onKeydown:n=>function(t,n){t.ctrlKey&&!t.shiftKey&&"Enter"===t.key?(t.stopPropagation(),Pd(e.cube,Math.floor(n.index/2)+1)):t.ctrlKey&&t.shiftKey&&"Enter"===t.key&&(t.stopPropagation(),Pd(e.cube,Math.floor(n.index/2)))}(n,t)},null,8,["cube","onKeydown"]))),128)),Fr("div",{class:"adder-wrap",onClick:o[0]||(o[0]=()=>Zt(Pd)(t.cube))},[...o[2]||(o[2]=[Fr("div",{class:"adder"},null,-1)])]),Fr("div",{class:"adjuster",ref_key:"adjuster",ref:r},null,512)],44,Od))}}),Ld=(0,Uo.A)(Rd,[["__scopeId","data-v-6b68d605"]]);function Ed(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Dd extends ro{rows;constructor(e,t){return super(e,t),this.rows=Bt([]),this.setup(e,t)}get component(){return Ld}get children(){const e=[];for(let t of this.rows)e.push(...t);return e}get attrs(){return this.data.attrs}get css_col1(){return this.attrs.width_col1||(this.attrs.width_col1=150),{width:this.attrs.width_col1+"px"}}get is_empty(){return!1}get row_count(){return this.rows.length}get col1(){return this.rows.map(e=>e[0])}get col2(){return this.rows.map(e=>e[1])}get meta(){return Dd.meta}update_data(e,t){return Dd.update_data(e,t)}build_child(e){for(let t of e.info){const e=new Ql(t[0],this),n=new Ql(t[1],this);this.rows.push([e,n])}}copy(e,t){if(e===t)return[this.children[e].export()];const n=Math.floor(e/2),i=Math.floor((t-1)/2),r=Dd.get_default();r.info=[];for(let e=n;e<=i;e++){const t=this.rows[e];if(!t)continue;const n=[t[0].export(),t[1].export()];r.info.push(n)}return 0===r.info.length?[]:[r]}gc(){super.base_gc()}export(){const e=this.base_export();e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs)),e.info=[];for(let[t,n]of this.rows){const i=t.export(),r=n.export();e.info.push([i,r])}return e}replace_id(e,t={}){return Dd.replace_id(this.root,e,t)}splice_rows(e,t,...n){const i=this.rows.splice(e,t,...n);for(let[e,t]of i)e.gc(),t.gc();return i}check_delete_edge(e){return 0===e.index%2&&!!e.is_empty}insert_row(e){const{courier:t}=this,{pos:n,rows:i}=e,r=t.get_recorder();r.add_cmd(e);const s=[];for(let[e,t]of i)s.push([new Ql(e,this),new Ql(t,this)]);let o=[0,0];return"tail"===n?(o=[this.row_count,this.row_count+s.length],this.rows.push(...s)):"head"===n?(o=[0,0+s.length],this.rows.unshift(...s)):(o=[n,n+s.length],this.splice_rows(n,0,...s)),r.add_recover(Nd.remove_row(this.id,o)),r}remove_row(e){const{courier:t,cursor:n}=this,{range:i,reserve:r}=e,s=new Os(t);let[o,a]=i;if(o<0&&(o=0),a>this.row_count&&(a=this.row_count),0===o&&a>=this.row_count)if(r){if(this.is_empty)return;s.tell(this,Nd.remove_row(this.id,[1,this.child_count]));const e=this.child_first,t=e.next_cube;t&&s.tell(t,Rs.delete_child(t.id,"backward",[0,t.child_count],!0)),e&&s.tell(e,Rs.delete_child(e.id,"backward",[0,e.child_count],!0))}else s.merge(this.remove_self());else{const e=this.rows[o-1]?.[1],t=this.rows[a+1]?.[1],n=this.splice_rows(o,a-o),i=[];for(let[e,t]of n)i.push([e.export(),t.export()]);s.add_recover(Nd.insert_row(this.id,o,i)),e?s.tell(e,Ls.in_tail(e.id)):t&&s.tell(t,Ls.in_head(t.id))}return s}change_width_col1(e){const{width:t}=e,{courier:n,id:i}=this,r=n.get_recorder();r.add_cmd(e);const s=this.attrs.width_col1;return this.attrs.width_col1=t,this.dom?.style.setProperty("--width-col1",t+"px"),r.add_recover(Nd.change_width_col1(i,s)),r}delete_cube(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,[l,c]=o,d=Math.floor(l/2),h=Math.floor((c-1)/2),u=(this.children[l],Nd.remove_row(this.id,[d,h+1],a));return this.remove_row(u)}static get meta(){return{type:n.detail_list,version:2,cubename:"清单",block:!0,show:!0}}static get_default(e=[],t={},i={}){const r=0===e.length?[[Ql.get_default(),Ql.get_default()]]:e;return{id:Ms(),type:n.detail_list,info:r,css:t,attrs:{width_col1:150}}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info)s.push([Ql.replace_id(e,i[0],n),Ql.replace_id(e,i[1],n)]);return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:(e<2&&(t.attrs.width_col1||(t.attrs.width_col1=150)),{data:t,usable:!0})}}Ed([Fs(f.insert_row)],Dd.prototype,"insert_row",null),Ed([Fs(f.remove_row)],Dd.prototype,"remove_row",null),Ed([Fs(f.change_width_col1)],Dd.prototype,"change_width_col1",null),Ed([Fs(i.cube_delete_child)],Dd.prototype,"delete_cube",null);class Id{static reset(e,t){return{id:e,data:t,name:b.reset}}static add(e,t,n){return{id:e,name:b.add,data:t,pos:n}}static remove(e,t){return{id:e,name:b.remove,range:t}}static indent(e,t){return{id:e,name:b.indent,items:t}}static status(e,t,n){return{id:e,name:b.status,index:t,done:n}}}const Bd=["id","data-type"],jd=["onClick"],qd=Bn({__name:"cube-todo",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:i}=t;return(t,r)=>(Nr(),Dr("div",{class:"cube-todo",id:t.cube.id,style:me(t.cube.css),"data-type":Zt(n).todo,onContextmenu:r[0]||(r[0]=e=>Zt(Io)(e,t.cube))},[(Nr(!0),Dr(Cr,null,_i(t.cube.items,(n,r)=>(Nr(),Dr("div",{key:n.data.id,class:"todoitem",style:me({"margin-left":n.indent*Zt(i).data.line_indent+"px"})},[Fr("div",{class:ve(["todoitem-status",{active:n.done}]),onClick:()=>function(t,n){const i=Id.status(e.cube.id,n,!t.done),r=e.cube.courier.get_recorder();r.tell(e.cube,i),e.cube.history.record(r)}(n,r)},null,10,jd),$r(ia,{class:"todoitem-box",cube:n.data,onKeydown:e=>function(e,t,n,i){const{courier:r,history:s,cursor:o}=t,{indent:a}=n,l=n.data;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(a);n.tell(t,Id.add(t.id,[o],i+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(a);n.tell(t,Id.add(t.id,[o],i)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,Id.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!1}];a.tell(t,Id.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,Id.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!0}];a.tell(t,Id.indent(t.id,e)),s.record(a)}}}(e,t.cube,n,r)},null,8,["cube","onKeydown"])],4))),128))],44,Bd))}}),Hd=(0,Uo.A)(qd,[["__scopeId","data-v-33222767"]]);function Fd(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class $d extends ro{_items=It([]);constructor(e,t){return super(e,t),this.setup(e,t)}get items(){return[...this._items]}get component(){return Hd}get children(){return[...this._items.map(e=>e.data)]}get meta(){return $d.meta}get info(){return this.data.info}update_data(e,t){return $d.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new Ql(n.data,this),i={done:n.done,indent:n.indent,data:Ut(e)};t.push(i)}return t}export(){const e=this.base_export();return e.info=[...this.export_items()],e}export_items(){const e=[];for(let t of this._items)e.push({done:t.done,indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({done:e.done,indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({done:e.done,indent:e.indent,data:e.data.export()});return{children:i,data:r}}replace_id(e,t={}){return $d.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Ql(n.data,this);t.push({done:n.done,indent:n.indent,data:e})}return t}create_item_data(e=0){return{done:!1,indent:e,data:Ql.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=Id.reset(this.id,this.export_items());return this._items.length=0,this._items.push(...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.get_valid_index(n),a=[];for(let e of t){const t=new Ql(e.data,this);let n={done:e.done,indent:e.indent,data:Ut(t)};a.push(n)}this.splice(o,0,...a);const l=a[a.length-1]?.data;return l&&s.tell(l,Ls.in_tail(l.id)),s.add_recover(Id.remove(this.id,[o,o+a.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[s,o]=t;if(s<=0&&o>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[s-1]?.data,c=this._items[o+1]?.data,d=this.splice(s,a);return r.add_recover(Id.add(this.id,d.data,s)),l?r.tell(l,Ls.in_tail(l.id)):c&&r.tell(c,Ls.in_head(c.id)),r}indent_todoitem(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}))}return i.add_recover(Id.indent(this.id,r)),i}update_status(e){const{courier:t}=this,{index:n,done:i}=e,r=t.get_recorder();r.add_cmd(e);const s=this._items[n];if(s)return s.done=i,r.add_recover(Id.status(this.id,n,!i)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o}=e,a=Id.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=Ql.get_default();return{id:Ms(),type:n.todo,info:[{done:!1,indent:0,data:e}],attrs:{},css:{}}}static get_todo_item(e,t=!1){const n=Ts.pick(e).sort;return{done:t,indent:0,data:Ql.get_default(n)}}static get meta(){return{cubename:"待办列表",type:n.todo,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=Ql.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Fd([Fs(b.reset)],$d.prototype,"on_reset",null),Fd([Fs(b.add)],$d.prototype,"add_item",null),Fd([Fs(b.remove)],$d.prototype,"remove_item",null),Fd([Fs(b.indent)],$d.prototype,"indent_todoitem",null),Fd([Fs(b.status)],$d.prototype,"update_status",null),Fd([Fs(i.cube_delete_child)],$d.prototype,"on_delete_child",null);const Gd=["id","data-type"],Vd=Bn({__name:"cube-list",props:{cube:{}},setup(e){const{config:t}=e.cube;return(e,i)=>(Nr(),Dr("div",{class:"cube-list",id:e.cube.id,style:me(e.cube.css),"data-type":Zt(n).list,onContextmenu:i[0]||(i[0]=t=>Zt(Io)(t,e.cube))},[(Nr(!0),Dr(Cr,null,_i(e.cube.items,(n,r)=>(Nr(),Dr("div",{key:n.data.id,class:"listitem",style:me({"margin-left":n.indent*Zt(t).data.line_indent+"px"})},[i[1]||(i[1]=Fr("div",{class:"listitem-symbol"},null,-1)),$r(ia,{class:"listitem-box",cube:n.data,onKeydown:t=>function(e,t,n,i){const{courier:r,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,Oo.add(t.id,[o],i+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,Oo.add(t.id,[o],i)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,Oo.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,Oo.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,Oo.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,Oo.indent(t.id,e)),s.record(a)}}}(t,e.cube,n,r)},null,8,["cube","onKeydown"])],4))),128))],44,Gd))}}),Ud=(0,Uo.A)(Vd,[["__scopeId","data-v-40a8fb6f"]]);function Wd(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Yd extends ro{_component=Ud;_items=It([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return this._component}get items(){return[...this._items]}get children(){return[...this._items.map(e=>e.data)]}get meta(){return Yd.meta}get info(){return this.data.info}update_data(e,t){return Yd.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new Ql(n.data,this),i={indent:n.indent,data:Ut(e)};t.push(i)}return t}export(){const e=this.base_export();return e.info.length=0,e.info.push(...this.export_items()),e}export_items(){const e=[];for(let t of this._items)e.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({indent:e.indent,data:e.data.export()});return{children:i,data:r}}replace_id(e,t={}){return Yd.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Ql(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:Ql.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=Oo.reset(this.id,this.export_items());return this._items.length=0,this._items.push(...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.get_valid_index(n),a=[];for(let e of t){const t=new Ql(e.data,this);let n={indent:e.indent,data:Ut(t)};a.push(n)}this.splice(o,0,...a);const l=a[a.length-1]?.data;return l&&s.tell(l,Ls.in_tail(l.id)),s.add_recover(Oo.remove(this.id,[o,o+a.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[s,o]=t;if(0===s&&o>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[s-1]?.data,c=this._items[o+1]?.data,d=this.splice(s,a);return r.add_recover(Oo.add(this.id,d.data,s)),l?r.tell(l,Ls.in_tail(l.id)):c&&r.tell(c,Ls.in_head(c.id)),r}indent_item(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}))}return i.add_recover(Oo.indent(this.id,r)),i}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o}=e,a=Oo.remove(this.id,o);return this.remove_item(a)}static get_default(e=[]){let t=Ql.get_default(e);return{id:Ms(),type:n.list,info:[{indent:0,data:t}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:Ql.get_default(Ts.pick(e).sort)}}static get meta(){return{cubename:"列表",type:n.list,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=Ql.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Wd([Fs(m.reset)],Yd.prototype,"on_reset",null),Wd([Fs(m.add)],Yd.prototype,"add_item",null),Wd([Fs(m.remove)],Yd.prototype,"remove_item",null),Wd([Fs(m.indent)],Yd.prototype,"indent_item",null),Wd([Fs(i.cube_delete_child)],Yd.prototype,"on_delete_child",null);class Xd{static reset(e,t){return{id:e,data:t,name:_.reset}}static add(e,t,n){return{id:e,name:_.add,data:t,pos:n}}static remove(e,t){return{id:e,name:_.remove,range:t}}static indent(e,t){return{id:e,name:_.indent,items:t}}}const Kd=["id","data-type"],Jd={class:"listitem-symbol"},Qd=Bn({__name:"cube-list-ordered",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:i}=t;return(e,t)=>(Nr(),Dr("div",{class:"cube-list-ordered",id:e.cube.id,style:me(e.cube.css),"data-type":Zt(n).list_ordered,onContextmenu:t[0]||(t[0]=t=>Zt(Io)(t,e.cube))},[(Nr(!0),Dr(Cr,null,_i(e.cube.items,(t,n)=>(Nr(),Dr("div",{key:t.data.id,class:"listitem",style:me({"margin-left":t.indent*Zt(i).data.line_indent+"px"})},[Fr("div",Jd,Ce(n+1),1),$r(ia,{class:"listitem-box",cube:t.data,onKeydown:i=>function(e,t,n,i){const{courier:r,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,Xd.add(t.id,[o],i+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,Xd.add(t.id,[o],i)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,Xd.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,Xd.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,Xd.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,Xd.indent(t.id,e)),s.record(a)}}}(i,e.cube,t,n)},null,8,["cube","onKeydown"])],4))),128))],44,Kd))}}),Zd=(0,Uo.A)(Qd,[["__scopeId","data-v-9f3381f0"]]);function eh(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class th extends ro{_items=It([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return Zd}get children(){return[...this._items.map(e=>e.data)]}get items(){return[...this._items]}get meta(){return th.meta}get info(){return this.data.info}update_data(e,t){return th.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new Ql(n.data,this),i={indent:n.indent,data:Ut(e)};t.push(i)}return t}export(){const e=super.base_export();e.info=[];for(let t of this._items)e.info.push({indent:t.indent,data:t.data.export()});return e}export_items(){const e=[];for(let t of this._items)e.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({indent:e.indent,data:e.data.export()});return{children:i,data:r}}replace_id(e,t={}){return th.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Ql(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:Ql.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=Xd.reset(this.id,this.export_items());return this._items.length=0,this._items.push(...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.get_valid_index(n),a=[];for(let e of t){const t=new Ql(e.data,this);let n={indent:e.indent,data:Ut(t)};a.push(n)}this.splice(o,0,...a);const l=a[a.length-1]?.data;return l&&s.tell(l,Ls.in_tail(l.id)),s.add_recover(Xd.remove(this.id,[o,o+a.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[s,o]=t;if(0===s&&o>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[s-1]?.data,c=this._items[o+1]?.data,d=this.splice(s,a);return r.add_recover(Xd.add(this.id,d.data,s)),l?r.tell(l,Ls.in_tail(l.id)):c&&r.tell(c,Ls.in_head(c.id)),r}indent_item(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}))}return i.add_recover(Xd.indent(this.id,r)),i}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o}=e,a=Xd.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=Ql.get_default();return{id:Ts.get_id(),type:n.list_ordered,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:Ql.get_default(Ts.pick(e).sort)}}static get meta(){return{cubename:"有序列表",type:n.list_ordered,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=Ql.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}eh([Fs(_.reset)],th.prototype,"on_reset",null),eh([Fs(_.add)],th.prototype,"add_item",null),eh([Fs(_.remove)],th.prototype,"remove_item",null),eh([Fs(_.indent)],th.prototype,"indent_item",null),eh([Fs(i.cube_delete_child)],th.prototype,"on_delete_child",null);class nh{static update(e,t,n){return{id:e,name:g.code_update,code:n,tabid:t}}static add(e,t,n=!0){return{id:e,name:g.code_add,item:Vt(t),focus:n}}static remove(e,t){return{id:e,name:g.code_remove,tabid:t}}static rename(e,t,n){return{id:e,name:g.code_rename,tabid:t,filename:n}}static change_lang(e,t,n){return{id:e,name:g.change_lang,tabid:t,lang:n}}static change_active(e,t){return{id:e,name:g.change_active,tabid:t}}static change_theme(e,t,n){return{id:e,tabid:t,theme:n,name:g.change_theme}}}const ih=[{id:"abap",name:"ABAP",import:()=>r.e(8617).then(r.bind(r,8617))},{id:"actionscript-3",name:"ActionScript",import:()=>r.e(3516).then(r.bind(r,3516))},{id:"ada",name:"Ada",import:()=>r.e(7561).then(r.bind(r,7561))},{id:"angular-html",name:"Angular HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(535)]).then(r.bind(r,535))},{id:"angular-ts",name:"Angular TypeScript",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7611),r.e(535),r.e(4886)]).then(r.bind(r,4886))},{id:"apache",name:"Apache Conf",import:()=>r.e(7625).then(r.bind(r,7625))},{id:"apex",name:"Apex",import:()=>r.e(9819).then(r.bind(r,9819))},{id:"apl",name:"APL",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(7504)]).then(r.bind(r,7504))},{id:"applescript",name:"AppleScript",import:()=>r.e(2108).then(r.bind(r,2108))},{id:"ara",name:"Ara",import:()=>r.e(5611).then(r.bind(r,5611))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>r.e(4354).then(r.bind(r,4354))},{id:"asm",name:"Assembly",import:()=>r.e(6324).then(r.bind(r,6324))},{id:"astro",name:"Astro",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4714),r.e(6940),r.e(4408)]).then(r.bind(r,4408))},{id:"awk",name:"AWK",import:()=>r.e(4862).then(r.bind(r,4862))},{id:"ballerina",name:"Ballerina",import:()=>r.e(5141).then(r.bind(r,5141))},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>r.e(2068).then(r.bind(r,2068))},{id:"beancount",name:"Beancount",import:()=>r.e(5026).then(r.bind(r,5026))},{id:"berry",name:"Berry",aliases:["be"],import:()=>r.e(8753).then(r.bind(r,8753))},{id:"bibtex",name:"BibTeX",import:()=>r.e(4009).then(r.bind(r,4009))},{id:"bicep",name:"Bicep",import:()=>r.e(7688).then(r.bind(r,7688))},{id:"blade",name:"Blade",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(5283)]).then(r.bind(r,5283))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>r.e(5314).then(r.bind(r,5314))},{id:"c",name:"C",import:()=>r.e(5814).then(r.bind(r,5814))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>r.e(5728).then(r.bind(r,5728))},{id:"cairo",name:"Cairo",import:()=>Promise.all([r.e(2473),r.e(8237)]).then(r.bind(r,8237))},{id:"clarity",name:"Clarity",import:()=>r.e(6677).then(r.bind(r,6677))},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>r.e(7681).then(r.bind(r,7681))},{id:"cmake",name:"CMake",import:()=>r.e(5936).then(r.bind(r,5936))},{id:"cobol",name:"COBOL",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(780)]).then(r.bind(r,780))},{id:"codeowners",name:"CODEOWNERS",import:()=>r.e(9096).then(r.bind(r,9096))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>r.e(6283).then(r.bind(r,6283))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>Promise.all([r.e(7258),r.e(6563)]).then(r.bind(r,6563))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>r.e(489).then(r.bind(r,489))},{id:"coq",name:"Coq",import:()=>r.e(8418).then(r.bind(r,8418))},{id:"cpp",name:"C++",aliases:["c++"],import:()=>Promise.all([r.e(1230),r.e(5814),r.e(4914)]).then(r.bind(r,4914))},{id:"crystal",name:"Crystal",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1230),r.e(5814),r.e(3894),r.e(3403)]).then(r.bind(r,3403))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>r.e(2354).then(r.bind(r,2354))},{id:"css",name:"CSS",import:()=>r.e(1708).then(r.bind(r,1708))},{id:"csv",name:"CSV",import:()=>r.e(8849).then(r.bind(r,1230))},{id:"cue",name:"CUE",import:()=>r.e(172).then(r.bind(r,172))},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>r.e(9806).then(r.bind(r,9806))},{id:"d",name:"D",import:()=>r.e(5177).then(r.bind(r,5177))},{id:"dart",name:"Dart",import:()=>r.e(9728).then(r.bind(r,9728))},{id:"dax",name:"DAX",import:()=>r.e(874).then(r.bind(r,874))},{id:"desktop",name:"Desktop",import:()=>r.e(6173).then(r.bind(r,6173))},{id:"diff",name:"Diff",import:()=>r.e(7670).then(r.bind(r,7670))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>r.e(415).then(r.bind(r,415))},{id:"dotenv",name:"dotEnv",import:()=>r.e(2173).then(r.bind(r,2173))},{id:"dream-maker",name:"Dream Maker",import:()=>r.e(3227).then(r.bind(r,3227))},{id:"edge",name:"Edge",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(3052)]).then(r.bind(r,3052))},{id:"elixir",name:"Elixir",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(3330)]).then(r.bind(r,3330))},{id:"elm",name:"Elm",import:()=>Promise.all([r.e(5814),r.e(9641)]).then(r.bind(r,9641))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>r.e(2505).then(r.bind(r,2505))},{id:"erb",name:"ERB",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(4007),r.e(9524)]).then(r.bind(r,9524))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>Promise.all([r.e(7900),r.e(2266)]).then(r.bind(r,2266))},{id:"fennel",name:"Fennel",import:()=>r.e(1631).then(r.bind(r,1631))},{id:"fish",name:"Fish",import:()=>r.e(9661).then(r.bind(r,9661))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>r.e(9077).then(r.bind(r,9077))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>Promise.all([r.e(8553),r.e(7549)]).then(r.bind(r,7549))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>r.e(8553).then(r.bind(r,8553))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>Promise.all([r.e(7900),r.e(9689)]).then(r.bind(r,9689))},{id:"gdresource",name:"GDResource",import:()=>r.e(7434).then(r.bind(r,7434))},{id:"gdscript",name:"GDScript",import:()=>r.e(4311).then(r.bind(r,4311))},{id:"gdshader",name:"GDShader",import:()=>r.e(6405).then(r.bind(r,6405))},{id:"genie",name:"Genie",import:()=>r.e(9017).then(r.bind(r,9017))},{id:"gherkin",name:"Gherkin",import:()=>r.e(4451).then(r.bind(r,4451))},{id:"git-commit",name:"Git Commit Message",import:()=>r.e(2861).then(r.bind(r,2861))},{id:"git-rebase",name:"Git Rebase Message",import:()=>Promise.all([r.e(3894),r.e(638)]).then(r.bind(r,638))},{id:"gleam",name:"Gleam",import:()=>r.e(8201).then(r.bind(r,8201))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(8700)]).then(r.bind(r,8700))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(5050)]).then(r.bind(r,5050))},{id:"glsl",name:"GLSL",import:()=>Promise.all([r.e(5814),r.e(2723)]).then(r.bind(r,2723))},{id:"gnuplot",name:"Gnuplot",import:()=>r.e(396).then(r.bind(r,396))},{id:"go",name:"Go",import:()=>r.e(3941).then(r.bind(r,3941))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>Promise.all([r.e(7258),r.e(4714),r.e(6940),r.e(6262),r.e(3170)]).then(r.bind(r,3170))},{id:"groovy",name:"Groovy",import:()=>r.e(1037).then(r.bind(r,1037))},{id:"hack",name:"Hack",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1230),r.e(6356)]).then(r.bind(r,6356))},{id:"haml",name:"Ruby Haml",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(3949)]).then(r.bind(r,3949))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1655)]).then(r.bind(r,1655))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>r.e(9045).then(r.bind(r,9045))},{id:"haxe",name:"Haxe",import:()=>r.e(8107).then(r.bind(r,8107))},{id:"hcl",name:"HashiCorp HCL",import:()=>r.e(6124).then(r.bind(r,6124))},{id:"hjson",name:"Hjson",import:()=>r.e(5203).then(r.bind(r,5203))},{id:"hlsl",name:"HLSL",import:()=>r.e(4598).then(r.bind(r,4598))},{id:"html",name:"HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940)]).then(r.bind(r,4940))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(914)]).then(r.bind(r,914))},{id:"http",name:"HTTP",import:()=>Promise.all([r.e(7258),r.e(4714),r.e(6967),r.e(3894),r.e(6940),r.e(6262),r.e(3170),r.e(5119)]).then(r.bind(r,5119))},{id:"hxml",name:"HXML",import:()=>r.e(8320).then(r.bind(r,8320))},{id:"hy",name:"Hy",import:()=>r.e(7470).then(r.bind(r,7470))},{id:"imba",name:"Imba",import:()=>r.e(3702).then(r.bind(r,3702))},{id:"ini",name:"INI",aliases:["properties"],import:()=>r.e(6343).then(r.bind(r,6343))},{id:"java",name:"Java",import:()=>r.e(6967).then(r.bind(r,6967))},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>r.e(7258).then(r.bind(r,7258))},{id:"jinja",name:"Jinja",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(3837)]).then(r.bind(r,3837))},{id:"jison",name:"Jison",import:()=>Promise.all([r.e(7258),r.e(5536)]).then(r.bind(r,5536))},{id:"json",name:"JSON",import:()=>r.e(5709).then(r.bind(r,5709))},{id:"json5",name:"JSON5",import:()=>r.e(6010).then(r.bind(r,6010))},{id:"jsonc",name:"JSON with Comments",import:()=>r.e(212).then(r.bind(r,212))},{id:"jsonl",name:"JSON Lines",import:()=>r.e(4843).then(r.bind(r,4843))},{id:"jsonnet",name:"Jsonnet",import:()=>r.e(4962).then(r.bind(r,4962))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>r.e(7922).then(r.bind(r,7922))},{id:"jsx",name:"JSX",import:()=>r.e(6262).then(r.bind(r,6262))},{id:"julia",name:"Julia",aliases:["jl"],import:()=>Promise.all([r.e(7258),r.e(1230),r.e(5814),r.e(4914),r.e(2473),r.e(9983),r.e(9910)]).then(r.bind(r,9910))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>r.e(2660).then(r.bind(r,2660))},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>r.e(6297).then(r.bind(r,6297))},{id:"latex",name:"LaTeX",import:()=>Promise.all([r.e(9983),r.e(7817)]).then(r.bind(r,7817))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>r.e(8003).then(r.bind(r,8003))},{id:"less",name:"Less",import:()=>r.e(6964).then(r.bind(r,6964))},{id:"liquid",name:"Liquid",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(327)]).then(r.bind(r,327))},{id:"llvm",name:"LLVM IR",import:()=>r.e(3972).then(r.bind(r,3972))},{id:"log",name:"Log file",import:()=>r.e(3247).then(r.bind(r,3247))},{id:"logo",name:"Logo",import:()=>r.e(9730).then(r.bind(r,9730))},{id:"lua",name:"Lua",import:()=>Promise.all([r.e(5814),r.e(4199)]).then(r.bind(r,4199))},{id:"luau",name:"Luau",import:()=>r.e(5744).then(r.bind(r,5744))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>r.e(1757).then(r.bind(r,1757))},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>r.e(7900).then(r.bind(r,7900))},{id:"marko",name:"Marko",import:()=>Promise.all([r.e(1708),r.e(4714),r.e(7611),r.e(6964),r.e(9175)]).then(r.bind(r,9175))},{id:"matlab",name:"MATLAB",import:()=>r.e(2492).then(r.bind(r,2492))},{id:"mdc",name:"MDC",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7900),r.e(2215)]).then(r.bind(r,2215))},{id:"mdx",name:"MDX",import:()=>r.e(4452).then(r.bind(r,4452))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>r.e(2860).then(r.bind(r,2860))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>r.e(8499).then(r.bind(r,8499))},{id:"mojo",name:"Mojo",import:()=>r.e(9526).then(r.bind(r,9526))},{id:"move",name:"Move",import:()=>r.e(9104).then(r.bind(r,9104))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>r.e(6239).then(r.bind(r,6239))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>r.e(9876).then(r.bind(r,9876))},{id:"nginx",name:"Nginx",import:()=>Promise.all([r.e(5814),r.e(697)]).then(r.bind(r,697))},{id:"nim",name:"Nim",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(5814),r.e(7900),r.e(4697)]).then(r.bind(r,4697))},{id:"nix",name:"Nix",import:()=>r.e(8212).then(r.bind(r,8212))},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>r.e(7374).then(r.bind(r,7374))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>r.e(7148).then(r.bind(r,7148))},{id:"objective-cpp",name:"Objective-C++",import:()=>r.e(9788).then(r.bind(r,9788))},{id:"ocaml",name:"OCaml",import:()=>r.e(9057).then(r.bind(r,9057))},{id:"pascal",name:"Pascal",import:()=>r.e(9079).then(r.bind(r,9079))},{id:"perl",name:"Perl",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(9984)]).then(r.bind(r,9984))},{id:"php",name:"PHP",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(7765),r.e(7966)]).then(r.bind(r,7765))},{id:"plsql",name:"PL/SQL",import:()=>r.e(8389).then(r.bind(r,8389))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>r.e(4520).then(r.bind(r,4520))},{id:"polar",name:"Polar",import:()=>r.e(9845).then(r.bind(r,9845))},{id:"postcss",name:"PostCSS",import:()=>r.e(9270).then(r.bind(r,9270))},{id:"powerquery",name:"PowerQuery",import:()=>r.e(454).then(r.bind(r,454))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>r.e(1476).then(r.bind(r,1476))},{id:"prisma",name:"Prisma",import:()=>r.e(5731).then(r.bind(r,5731))},{id:"prolog",name:"Prolog",import:()=>r.e(9206).then(r.bind(r,9206))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>r.e(5891).then(r.bind(r,5891))},{id:"pug",name:"Pug",aliases:["jade"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6757)]).then(r.bind(r,6757))},{id:"puppet",name:"Puppet",import:()=>r.e(3593).then(r.bind(r,3593))},{id:"purescript",name:"PureScript",import:()=>r.e(9904).then(r.bind(r,9904))},{id:"python",name:"Python",aliases:["py"],import:()=>r.e(2473).then(r.bind(r,2473))},{id:"qml",name:"QML",import:()=>Promise.all([r.e(7258),r.e(1803)]).then(r.bind(r,1803))},{id:"qmldir",name:"QML Directory",import:()=>r.e(4292).then(r.bind(r,4292))},{id:"qss",name:"Qt Style Sheets",import:()=>r.e(402).then(r.bind(r,402))},{id:"r",name:"R",import:()=>r.e(9983).then(r.bind(r,9983))},{id:"racket",name:"Racket",import:()=>r.e(9281).then(r.bind(r,9281))},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>r.e(9780).then(r.bind(r,9780))},{id:"razor",name:"ASP.NET Razor",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(2354),r.e(245)]).then(r.bind(r,245))},{id:"reg",name:"Windows Registry Script",import:()=>r.e(5827).then(r.bind(r,5827))},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>r.e(3124).then(r.bind(r,3124))},{id:"rel",name:"Rel",import:()=>r.e(3043).then(r.bind(r,5424))},{id:"riscv",name:"RISC-V",import:()=>r.e(8684).then(r.bind(r,8684))},{id:"rst",name:"reStructuredText",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(2473),r.e(4007),r.e(8234)]).then(r.bind(r,8234))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(4007)]).then(r.bind(r,4007))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>r.e(7145).then(r.bind(r,7145))},{id:"sas",name:"SAS",import:()=>Promise.all([r.e(1230),r.e(9478)]).then(r.bind(r,9478))},{id:"sass",name:"Sass",import:()=>r.e(8709).then(r.bind(r,8709))},{id:"scala",name:"Scala",import:()=>r.e(3947).then(r.bind(r,3947))},{id:"scheme",name:"Scheme",import:()=>r.e(9982).then(r.bind(r,9982))},{id:"scss",name:"SCSS",import:()=>Promise.all([r.e(1708),r.e(7611)]).then(r.bind(r,7611))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>r.e(1624).then(r.bind(r,1624))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>r.e(8249).then(r.bind(r,8249))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>r.e(3894).then(r.bind(r,3894))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>Promise.all([r.e(3894),r.e(9965)]).then(r.bind(r,9965))},{id:"smalltalk",name:"Smalltalk",import:()=>r.e(1066).then(r.bind(r,1066))},{id:"solidity",name:"Solidity",import:()=>r.e(4780).then(r.bind(r,4780))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7642)]).then(r.bind(r,7642))},{id:"sparql",name:"SPARQL",import:()=>r.e(4108).then(r.bind(r,4108))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>r.e(6514).then(r.bind(r,6514))},{id:"sql",name:"SQL",import:()=>r.e(1230).then(r.bind(r,8849))},{id:"ssh-config",name:"SSH Config",import:()=>r.e(3874).then(r.bind(r,3874))},{id:"stata",name:"Stata",import:()=>Promise.all([r.e(1230),r.e(542)]).then(r.bind(r,542))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>r.e(41).then(r.bind(r,41))},{id:"svelte",name:"Svelte",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4714),r.e(3454)]).then(r.bind(r,3454))},{id:"swift",name:"Swift",import:()=>r.e(8436).then(r.bind(r,8436))},{id:"system-verilog",name:"SystemVerilog",import:()=>r.e(6577).then(r.bind(r,6577))},{id:"systemd",name:"Systemd Units",import:()=>r.e(16).then(r.bind(r,16))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>r.e(4660).then(r.bind(r,4660))},{id:"tasl",name:"Tasl",import:()=>r.e(1839).then(r.bind(r,1839))},{id:"tcl",name:"Tcl",import:()=>r.e(7328).then(r.bind(r,7328))},{id:"templ",name:"Templ",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(3941),r.e(7095)]).then(r.bind(r,7095))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>r.e(4385).then(r.bind(r,4385))},{id:"tex",name:"TeX",import:()=>Promise.all([r.e(9983),r.e(9198)]).then(r.bind(r,9198))},{id:"toml",name:"TOML",import:()=>r.e(5363).then(r.bind(r,5363))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(9556)]).then(r.bind(r,9556))},{id:"tsv",name:"TSV",import:()=>r.e(6045).then(r.bind(r,8426))},{id:"tsx",name:"TSX",import:()=>r.e(6940).then(r.bind(r,6940))},{id:"turtle",name:"Turtle",import:()=>r.e(4877).then(r.bind(r,4877))},{id:"twig",name:"Twig",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(2473),r.e(7611),r.e(4007),r.e(7765),r.e(4236)]).then(r.bind(r,4236))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>r.e(4714).then(r.bind(r,4714))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>r.e(794).then(r.bind(r,794))},{id:"typst",name:"Typst",aliases:["typ"],import:()=>r.e(8711).then(r.bind(r,8711))},{id:"v",name:"V",import:()=>r.e(5443).then(r.bind(r,5443))},{id:"vala",name:"Vala",import:()=>r.e(7141).then(r.bind(r,7141))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>r.e(8235).then(r.bind(r,8235))},{id:"verilog",name:"Verilog",import:()=>r.e(4283).then(r.bind(r,4283))},{id:"vhdl",name:"VHDL",import:()=>r.e(5521).then(r.bind(r,5521))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>r.e(7567).then(r.bind(r,7567))},{id:"vue",name:"Vue",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(1432)]).then(r.bind(r,1432))},{id:"vue-html",name:"Vue HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(1432),r.e(7789)]).then(r.bind(r,7789))},{id:"vue-vine",name:"Vue Vine",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(7611),r.e(6964),r.e(1432),r.e(41),r.e(5954)]).then(r.bind(r,5954))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>r.e(845).then(r.bind(r,845))},{id:"wasm",name:"WebAssembly",import:()=>r.e(7615).then(r.bind(r,7615))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>r.e(8393).then(r.bind(r,8393))},{id:"wgsl",name:"WGSL",import:()=>r.e(5884).then(r.bind(r,5884))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>r.e(2062).then(r.bind(r,2062))},{id:"wit",name:"WebAssembly Interface Types",import:()=>r.e(6957).then(r.bind(r,6957))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>r.e(5589).then(r.bind(r,5589))},{id:"xml",name:"XML",import:()=>Promise.all([r.e(6967),r.e(5585)]).then(r.bind(r,7966))},{id:"xsl",name:"XSL",import:()=>Promise.all([r.e(6967),r.e(5628)]).then(r.bind(r,5628))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>r.e(4546).then(r.bind(r,4546))},{id:"zenscript",name:"ZenScript",import:()=>r.e(5099).then(r.bind(r,5099))},{id:"zig",name:"Zig",import:()=>r.e(3279).then(r.bind(r,3279))}],rh=Object.fromEntries(ih.map(e=>[e.id,e.import])),sh=Object.fromEntries(ih.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),oh={...rh,...sh},ah=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>r.e(2691).then(r.bind(r,2691))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>r.e(7768).then(r.bind(r,7768))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>r.e(7927).then(r.bind(r,7927))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>r.e(1216).then(r.bind(r,1216))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>r.e(7788).then(r.bind(r,7788))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>r.e(2071).then(r.bind(r,2071))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>r.e(9692).then(r.bind(r,9692))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>r.e(3032).then(r.bind(r,3032))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>r.e(8485).then(r.bind(r,8485))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>r.e(284).then(r.bind(r,284))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>r.e(1545).then(r.bind(r,1545))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>r.e(6083).then(r.bind(r,6083))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>r.e(5647).then(r.bind(r,5647))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>r.e(9179).then(r.bind(r,9179))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>r.e(9976).then(r.bind(r,9976))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>r.e(9831).then(r.bind(r,9831))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>r.e(9809).then(r.bind(r,9809))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>r.e(9681).then(r.bind(r,9681))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>r.e(1425).then(r.bind(r,1425))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>r.e(6865).then(r.bind(r,6865))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>r.e(7824).then(r.bind(r,7824))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>r.e(3646).then(r.bind(r,3646))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>r.e(2419).then(r.bind(r,2419))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>r.e(9225).then(r.bind(r,9225))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>r.e(4112).then(r.bind(r,4112))},{id:"houston",displayName:"Houston",type:"dark",import:()=>r.e(8931).then(r.bind(r,8931))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>r.e(2184).then(r.bind(r,2184))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>r.e(2142).then(r.bind(r,2142))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>r.e(5638).then(r.bind(r,5638))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>r.e(7831).then(r.bind(r,7831))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>r.e(8426).then(r.bind(r,6045))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>r.e(3492).then(r.bind(r,3492))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>r.e(3720).then(r.bind(r,3720))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>r.e(9294).then(r.bind(r,9294))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>r.e(4081).then(r.bind(r,4081))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>r.e(1729).then(r.bind(r,1729))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>r.e(4614).then(r.bind(r,4614))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>r.e(2934).then(r.bind(r,2934))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>r.e(2535).then(r.bind(r,2535))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>r.e(4214).then(r.bind(r,4214))},{id:"nord",displayName:"Nord",type:"dark",import:()=>r.e(4552).then(r.bind(r,4552))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>r.e(6736).then(r.bind(r,6736))},{id:"one-light",displayName:"One Light",type:"light",import:()=>r.e(3906).then(r.bind(r,3906))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>r.e(4445).then(r.bind(r,4445))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>r.e(4465).then(r.bind(r,4465))},{id:"red",displayName:"Red",type:"dark",import:()=>r.e(6980).then(r.bind(r,6980))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>r.e(753).then(r.bind(r,753))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>r.e(5424).then(r.bind(r,3043))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>r.e(8093).then(r.bind(r,8093))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>r.e(4838).then(r.bind(r,4838))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>r.e(5601).then(r.bind(r,5601))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>r.e(1857).then(r.bind(r,1857))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>r.e(7217).then(r.bind(r,7217))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>r.e(1931).then(r.bind(r,1931))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>r.e(321).then(r.bind(r,321))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>r.e(5034).then(r.bind(r,5034))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>r.e(224).then(r.bind(r,224))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>r.e(5542).then(r.bind(r,5542))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>r.e(6517).then(r.bind(r,6517))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>r.e(5143).then(r.bind(r,5143))}],lh=Object.fromEntries(ah.map(e=>[e.id,e.import]));class ch extends Error{constructor(e){super(e),this.name="ShikiError"}}function dh(e){return Array.isArray(e)?function(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=dh(e[n]);return t}(e):e instanceof RegExp?e:"object"==typeof e?function(e){let t={};for(let n in e)t[n]=dh(e[n]);return t}(e):e}function hh(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function uh(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t===e.length-1?uh(e.substring(0,e.length-1)):e.substr(1+~t)}var ph=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,fh=class{static hasCaptures(e){return null!==e&&(ph.lastIndex=0,ph.test(e))}static replaceCaptures(e,t,n){return e.replace(ph,(e,i,r,s)=>{let o=n[parseInt(i||r,10)];if(!o)return e;{let e=t.substring(o.start,o.end);for(;"."===e[0];)e=e.substring(1);switch(s){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function mh(e,t){return e<t?-1:e>t?1:0}function _h(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let i=0;i<n;i++){let n=mh(e[i],t[i]);if(0!==n)return n}return 0}return n-i}function gh(e){return!!/^#[0-9a-f]{6}$/i.test(e)||(!!/^#[0-9a-f]{8}$/i.test(e)||(!!/^#[0-9a-f]{3}$/i.test(e)||!!/^#[0-9a-f]{4}$/i.test(e)))}function bh(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var yh=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},vh=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let e=0,r=t.length;e<r;e++){let r,s=t[e];if(!s.settings)continue;if("string"==typeof s.scope){let e=s.scope;e=e.replace(/^[,]+/,""),e=e.replace(/[,]+$/,""),r=e.split(",")}else r=Array.isArray(s.scope)?s.scope:[""];let o=-1;if("string"==typeof s.settings.fontStyle){o=0;let e=s.settings.fontStyle.split(" ");for(let t=0,n=e.length;t<n;t++){switch(e[t]){case"italic":o|=1;break;case"bold":o|=2;break;case"underline":o|=4;break;case"strikethrough":o|=8}}}let a=null;"string"==typeof s.settings.foreground&&gh(s.settings.foreground)&&(a=s.settings.foreground);let l=null;"string"==typeof s.settings.background&&gh(s.settings.background)&&(l=s.settings.background);for(let t=0,s=r.length;t<s;t++){let s=r[t].trim().split(" "),c=s[s.length-1],d=null;s.length>1&&(d=s.slice(0,s.length-1),d.reverse()),n[i++]=new Sh(c,d,e,o,a,l)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{let n=mh(e.scope,t.scope);return 0!==n?n:(n=_h(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)});let n=0,i="#000000",r="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(i=t.foreground),null!==t.background&&(r=t.background)}let s=new Mh(t),o=new kh(n,s.getId(i),s.getId(r)),a=new Ah(new Th(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];a.insert(0,n.scope,n.parentScopes,n.fontStyle,s.getId(n.foreground),s.getId(n.background))}return new vh(s,o,a)}(e,t)}_cachedMatchRoot=new yh(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>function(e,t){if(0===t.length)return!0;for(let n=0;n<t.length;n++){let i=t[n],r=!1;if(">"===i){if(n===t.length-1)return!1;i=t[++n],r=!0}for(;e&&!xh(e.scopeName,i);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}(e.parent,t.parentScopes));return n?new kh(n.fontStyle,n.foreground,n.background):null}},wh=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(const i of n)t=new e(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new e(n,t[i]);return n}push(t){return new e(this,t)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function xh(e,t){return t===e||e.startsWith(t)&&"."===e[t.length]}var kh=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};var Sh=class{constructor(e,t,n,i,r,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=r,this.background=s}},Ch=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Ch||{});var Mh=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},zh=Object.freeze([]),Th=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,i,r){this.scopeDepth=e,this.parentScopes=t||zh,this.fontStyle=n,this.foreground=i,this.background=r}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==i&&(this.background=i)}},Ah=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,i=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[i]&&i++,!(n>=e.parentScopes.length||i>=t.parentScopes.length);){const r=t.parentScopes[i].length-e.parentScopes[n].length;if(0!==r)return r;n++,i++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,i=t.indexOf(".");if(-1===i?(e=t,n=""):(e=t.substring(0,i),n=t.substring(i+1)),this._children.hasOwnProperty(e))return this._children[e].match(n)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,i,r,s,o){if(""===n)return void this._doInsertHere(t,i,r,s,o);let a,l,c,d=n.indexOf(".");-1===d?(a=n,l=""):(a=n.substring(0,d),l=n.substring(d+1)),this._children.hasOwnProperty(a)?c=this._children[a]:(c=new e(this._mainRule.clone(),Th.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,l,i,r,s,o)}_doInsertHere(e,t,n,i,r){if(null!==t){for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let o=this._rulesWithParentScopes[s];if(0===_h(o.parentScopes,t))return void o.acceptOverwrite(e,n,i,r)}-1===n&&(n=this._mainRule.fontStyle),0===i&&(i=this._mainRule.foreground),0===r&&(r=this._mainRule.background),this._rulesWithParentScopes.push(new Th(e,t,n,i,r))}else this._mainRule.acceptOverwrite(e,n,i,r)}},Ph=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){const n=e.getLanguageId(t),i=e.getTokenType(t),r=e.getFontStyle(t),s=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:r,foreground:s,background:o})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static set(t,n,i,r,s,o,a){let l=e.getLanguageId(t),c=e.getTokenType(t),d=e.containsBalancedBrackets(t)?1:0,h=e.getFontStyle(t),u=e.getForeground(t),p=e.getBackground(t);return 0!==n&&(l=n),8!==i&&(c=i),null!==r&&(d=r?1:0),-1!==s&&(h=s),0!==o&&(u=o),0!==a&&(p=a),(l|c<<8|d<<10|h<<11|u<<15|p<<24)>>>0}};function Nh(e){return e}function Oh(e,t){const n=[],i=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}(e);let r=i.next();for(;null!==r;){let e=0;if(2===r.length&&":"===r.charAt(1)){switch(r.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=i.next()}let t=o();if(n.push({matcher:t,priority:e}),","!==r)break;r=i.next()}return n;function s(){if("-"===r){r=i.next();const e=s();return t=>!!e&&!e(t)}if("("===r){r=i.next();const e=function(){const e=[];let t=o();for(;t&&(e.push(t),"|"===r||","===r);){do{r=i.next()}while("|"===r||","===r);t=o()}return t=>e.some(e=>e(t))}();return")"===r&&(r=i.next()),e}if(Rh(r)){const e=[];do{e.push(r),r=i.next()}while(Rh(r));return n=>t(e,n)}return null}function o(){const e=[];let t=s();for(;t;)e.push(t),t=s();return t=>e.every(e=>e(t))}}function Rh(e){return!!e&&!!e.match(/[\w\.:]+/)}function Lh(e){"function"==typeof e.dispose&&e.dispose()}var Eh=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Dh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ih=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Bh=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Eh(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Ih;for(const n of e)jh(n,this.initialScopeName,this.repo,t);for(const e of t.references)if(e instanceof Eh){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName))continue;if(this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function jh(e,t,n,i){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof Eh?Hh({baseGrammar:s,selfGrammar:r},i):qh(e.ruleName,{baseGrammar:s,selfGrammar:r,repository:r.repository},i);const o=n.injections(e.scopeName);if(o)for(const e of o)i.add(new Eh(e))}function qh(e,t,n){if(t.repository&&t.repository[e]){Fh([t.repository[e]],t,n)}}function Hh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Fh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Fh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Fh(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const e=i.repository?hh({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&Fh(i.patterns,{...t,repository:e},n);const r=i.include;if(!r)continue;const s=Yh(r);switch(s.kind){case 0:Hh({...t,selfGrammar:t.baseGrammar},n);break;case 1:Hh(t,n);break;case 2:qh(s.ruleName,{...t,repository:e},n);break;case 3:case 4:const i=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){const r={baseGrammar:t.baseGrammar,selfGrammar:i,repository:e};4===s.kind?qh(s.ruleName,r,n):Hh(r,n)}else 4===s.kind?n.add(new Dh(s.scopeName,s.ruleName)):n.add(new Eh(s.scopeName))}}}var $h=class{kind=0},Gh=class{kind=1},Vh=class{constructor(e){this.ruleName=e}kind=2},Uh=class{constructor(e){this.scopeName=e}kind=3},Wh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Yh(e){if("$base"===e)return new $h;if("$self"===e)return new Gh;const t=e.indexOf("#");if(-1===t)return new Uh(e);if(0===t)return new Vh(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new Wh(n,i)}}var Xh=/\\(\d+)/,Kh=/\\(\d+)/g;Symbol("RuleId");var Jh=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=fh.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=fh.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${uh(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?fh.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?fh.replaceCaptures(this._contentName,e,t):this._contentName}},Qh=class extends Jh{retokenizeCapturedWithRuleId;constructor(e,t,n,i,r){super(e,t,n,i),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},Zh=class extends Jh{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,null),this._match=new ru(i,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new su,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},eu=class extends Jh{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,i),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns){e.getRule(n).collectPatterns(e,t)}}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new su,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tu=class extends Jh{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r,s,o,a,l,c){super(e,t,n,i),this._begin=new ru(r,this.id),this.beginCaptures=s,this._end=new ru(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new su;for(const t of this.patterns){e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},nu=class extends Jh{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,r,s,o,a,l){super(e,t,n,i),this._begin=new ru(r,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new ru(o,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new su;for(const t of this.patterns){e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new su,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},iu=class e{static createCaptureRule(e,t,n,i,r){return e.registerRule(e=>new Qh(t,e,n,i,r))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new Zh(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,i));if(void 0===t.begin){t.repository&&(i=hh({},i,t.repository));let r=t.patterns;return void 0===r&&t.include&&(r=[{include:t.include}]),new eu(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(r,n,i))}return t.while?new nu(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,i),e._compilePatterns(t.patterns,n,i)):new tu(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,e._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let r=[];if(t){let s=0;for(const e in t){if("$vscodeTextmateLocation"===e)continue;const t=parseInt(e,10);t>s&&(s=t)}for(let e=0;e<=s;e++)r[e]=null;for(const s in t){if("$vscodeTextmateLocation"===s)continue;const o=parseInt(s,10);let a=0;t[s].patterns&&(a=e.getCompiledRuleId(t[s],n,i)),r[o]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,a)}}return r}static _compilePatterns(t,n,i){let r=[];if(t)for(let s=0,o=t.length;s<o;s++){const o=t[s];let a=-1;if(o.include){const t=Yh(o.include);switch(t.kind){case 0:case 1:a=e.getCompiledRuleId(i[o.include],n,i);break;case 2:let r=i[t.ruleName];r&&(a=e.getCompiledRuleId(r,n,i));break;case 3:case 4:const s=t.scopeName,l=4===t.kind?t.ruleName:null,c=n.getExternalGrammar(s,i);if(c)if(l){let t=c.repository[l];t&&(a=e.getCompiledRuleId(t,n,c.repository))}else a=e.getCompiledRuleId(c.repository.$self,n,c.repository)}}else a=e.getCompiledRuleId(o,n,i);if(-1!==a){const e=n.getRule(a);let t=!1;if((e instanceof eu||e instanceof tu||e instanceof nu)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},ru=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,i=[],r=!1;for(let s=0;s<t;s++){if("\\"===e.charAt(s)&&s+1<t){const t=e.charAt(s+1);"z"===t?(i.push(e.substring(n,s)),i.push("$(?!\\n)(?<!\\n)"),n=s+2):"A"!==t&&"G"!==t||(r=!0),s++}}this.hasAnchor=r,0===n?this.source=e:(i.push(e.substring(n,t)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=Xh.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let n=t.map(t=>e.substring(t.start,t.end));return Kh.lastIndex=0,this.source.replace(Kh,(e,t)=>bh(n[parseInt(t,10)]||""))}_buildAnchorCache(){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let e,t,n,i,r=[],s=[],o=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),r[e]=n,s[e]=n,o[e]=n,a[e]=n,"\\"===n&&e+1<t&&(i=this.source.charAt(e+1),"A"===i?(r[e+1]="",s[e+1]="",o[e+1]="A",a[e+1]="A"):"G"===i?(r[e+1]="",s[e+1]="G",o[e+1]="",a[e+1]="G"):(r[e+1]=i,s[e+1]=i,o[e+1]=i,a[e+1]=i),e++);return{A0_G0:r.join(""),A0_G1:s.join(""),A1_G0:o.join(""),A1_G1:a.join("")}}resolveAnchors(e,t){return this.hasAnchor&&this._anchorCache&&"string"==typeof this.source?e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source}},su=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new ou(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let i=this._items.map(e=>e.resolveAnchors(t,n));return new ou(e,i,this._items.map(e=>e.ruleId))}},ou=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},au=class{constructor(e,t){this.languageId=e,this.tokenType=t}},lu=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new au(e,8),this._embeddedLanguagesMatcher=new cu(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new au(0,0);_getBasicScopeAttributes=new yh(e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new au(t,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){const n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},cu=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>bh(e));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}},du=("undefined"!=typeof process&&process.env.VSCODE_TEXTMATE_DEBUG,class{constructor(e,t){this.stack=e,this.stoppedEarly=t}});function hu(e,t,n,i,r,s,o,a){const l=t.content.length;let c=!1,d=-1;if(o){const o=function(e,t,n,i,r,s){let o=r.beginRuleCapturedEOL?0:-1;const a=[];for(let t=r;t;t=t.pop()){const n=t.getRule(e);n instanceof nu&&a.push({rule:n,stack:t})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:a,findOptions:c}=pu(l.rule,e,l.stack.endRule,n,i===o),d=a.findNextMatchSync(t,i,c);if(!d){0,r=l.stack.pop();break}if(-2!==d.ruleId){r=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),fu(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>i&&(i=d.captureIndices[0].end,n=!1))}return{stack:r,linePos:i,anchorPosition:o,isFirstLine:n}}(e,t,n,i,r,s);r=o.stack,i=o.linePos,n=o.isFirstLine,d=o.anchorPosition}const h=Date.now();for(;!c;){if(0!==a){if(Date.now()-h>a)return new du(r,!0)}u()}return new du(r,!1);function u(){const o=function(e,t,n,i,r,s){const o=function(e,t,n,i,r,s){const o=r.getRule(e),{ruleScanner:a,findOptions:l}=uu(o,e,r.endRule,n,i===s),c=a.findNextMatchSync(t,i,l);if(c)return{captureIndices:c.captureIndices,matchedRuleId:c.ruleId};return null}(e,t,n,i,r,s),a=e.getInjections();if(0===a.length)return o;const l=function(e,t,n,i,r,s,o){let a,l=Number.MAX_VALUE,c=null,d=0;const h=s.contentNameScopesList.getScopeNames();for(let s=0,u=e.length;s<u;s++){const u=e[s];if(!u.matcher(h))continue;const p=t.getRule(u.ruleId),{ruleScanner:f,findOptions:m}=uu(p,t,null,i,r===o),_=f.findNextMatchSync(n,r,m);if(!_)continue;0;const g=_.captureIndices[0].start;if(!(g>=l)&&(l=g,c=_.captureIndices,a=_.ruleId,d=u.priority,l===r))break}if(c)return{priorityMatch:-1===d,captureIndices:c,matchedRuleId:a};return null}(a,e,t,n,i,r,s);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,d=l.captureIndices[0].start;if(d<c||l.priorityMatch&&d===c)return l;return o}(e,t,n,i,r,d);if(!o)return s.produce(r,l),void(c=!0);const a=o.captureIndices,h=o.matchedRuleId,u=!!(a&&a.length>0)&&a[0].end>i;if(-1===h){const o=r.getRule(e);0,s.produce(r,a[0].start),r=r.withContentNameScopesList(r.nameScopesList),fu(e,t,n,r,s,o.endCaptures,a),s.produce(r,a[0].end);const h=r;if(r=r.parent,d=h.getAnchorPos(),!u&&h.getEnterPos()===i)return r=h,s.produce(r,l),void(c=!0)}else{const o=e.getRule(h);s.produce(r,a[0].start);const p=r,f=o.getName(t.content,a),m=r.contentNameScopesList.pushAttributed(f,e);if(r=r.push(h,i,d,a[0].end===l,null,m,m),o instanceof tu){const i=o;0,fu(e,t,n,r,s,i.beginCaptures,a),s.produce(r,a[0].end),d=a[0].end;const h=i.getContentName(t.content,a),f=m.pushAttributed(h,e);if(r=r.withContentNameScopesList(f),i.endHasBackReferences&&(r=r.withEndRule(i.getEndWithResolvedBackReferences(t.content,a))),!u&&p.hasSameRuleAs(r))return r=r.pop(),s.produce(r,l),void(c=!0)}else if(o instanceof nu){const i=o;0,fu(e,t,n,r,s,i.beginCaptures,a),s.produce(r,a[0].end),d=a[0].end;const h=i.getContentName(t.content,a),f=m.pushAttributed(h,e);if(r=r.withContentNameScopesList(f),i.whileHasBackReferences&&(r=r.withEndRule(i.getWhileWithResolvedBackReferences(t.content,a))),!u&&p.hasSameRuleAs(r))return r=r.pop(),s.produce(r,l),void(c=!0)}else{if(fu(e,t,n,r,s,o.captures,a),s.produce(r,a[0].end),r=r.pop(),!u)return r=r.safePop(),s.produce(r,l),void(c=!0)}}a[0].end>i&&(i=a[0].end,n=!1)}}function uu(e,t,n,i,r){return{ruleScanner:e.compileAG(t,n,i,r),findOptions:0}}function pu(e,t,n,i,r){return{ruleScanner:e.compileWhileAG(t,n,i,r),findOptions:0}}function fu(e,t,n,i,r,s,o){if(0===s.length)return;const a=t.content,l=Math.min(s.length,o.length),c=[],d=o[0].end;for(let t=0;t<l;t++){const l=s[t];if(null===l)continue;const h=o[t];if(0===h.length)continue;if(h.start>d)break;for(;c.length>0&&c[c.length-1].endPos<=h.start;)r.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?r.produceFromScopes(c[c.length-1].scopes,h.start):r.produce(i,h.start),l.retokenizeCapturedWithRuleId){const t=l.getName(a,o),s=i.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(a,o),d=s.pushAttributed(c,e),u=i.push(l.retokenizeCapturedWithRuleId,h.start,-1,!1,null,s,d),p=e.createOnigString(a.substring(0,h.end));hu(e,p,n&&0===h.start,h.start,u,r,!1,0),Lh(p);continue}const u=l.getName(a,o);if(null!==u){const t=(c.length>0?c[c.length-1].scopes:i.contentNameScopesList).pushAttributed(u,e);c.push(new mu(t,h.end))}}for(;c.length>0;)r.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var mu=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function _u(e,t,n,i,r){const s=Oh(t,gu),o=iu.getCompiledRuleId(n,i,r.repository);for(const n of s)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:r,priority:n.priority})}function gu(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let i=n;i<t.length;i++)if(bu(t[i],e))return n=i+1,!0;return!1})}function bu(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}var yu=class{constructor(e,t,n,i,r,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new lu(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=vu(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const e of Object.keys(r)){const t=Oh(e,gu);for(const n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:r[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),t=[],n=this._rootScopeName,i=e(n);if(i){const e=i.injections;if(e)for(let n in e)_u(t,n,e[n],this,i);const r=this._grammarRepository.injections(n);r&&r.forEach(e=>{const n=this.getExternalGrammar(e);if(n){const e=n.injectionSelector;e&&_u(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=vu(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){let r;if(-1===this._rootId&&(this._rootId=iu.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==xu.NULL)r=!1,t.reset();else{r=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),i=Ph.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),s=this.getRule(this._rootId).getName(null,null);let o;o=s?wu.createRootAndLookUpScopeName(s,i,this):wu.createRoot("unknown",i),t=new xu(null,this._rootId,-1,-1,!1,null,o,o)}e+="\n";const s=this.createOnigString(e),o=s.content.length,a=new Su(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=hu(this,s,r,0,t,a,!0,i);return Lh(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function vu(e,t){return(e=dh(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var wu=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let i=t,r=t?.scopePath??null;for(const t of n)r=wh.push(r,t.scopeNames),i=new e(i,r,t.encodedTokenAttributes);return i}static createRoot(t,n){return new e(null,new wh(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const r=i.getMetadataForScope(t),s=new wh(null,t),o=i.themeProvider.themeMatch(s),a=e.mergeAttributes(n,r,o);return new e(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let i=-1,r=0,s=0;return null!==n&&(i=n.fontStyle,r=n.foregroundId,s=n.backgroundId),Ph.set(e,t.languageId,t.tokenType,null,i,r,s)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);const i=t.split(/ /g);let r=this;for(const t of i)r=e._pushAttributed(r,t,n);return r}static _pushAttributed(t,n,i){const r=i.getMetadataForScope(n),s=t.scopePath.push(n),o=i.themeProvider.themeMatch(s),a=e.mergeAttributes(t.tokenAttributes,r,o);return new e(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},xu=class e{constructor(e,t,n,i,r,s,o,a){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=r,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&wu.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,r,s,o,a){return new e(this,t,n,i,r,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const i=wu.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,wu.fromExtension(i,n.contentNameScopesList))}},ku=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):Oh(e,gu).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Oh(e,gu).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Su=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e?.getScopeNames()??[];for(const e of this._tokenTypeOverrides)e.matcher(t)&&(n=Ph.set(n,0,Nh(e.type),null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(t))}return i&&(n=Ph.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n?void(this._lastTokenEndIndex=t):(this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),void(this._lastTokenEndIndex=t))}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Cu=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,r){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,function(e,t,n,i,r,s,o,a){return new yu(e,t,n,i,r,s,o,a)}(e,s,t,n,i,r,this,this._onigLib))}return this._grammars.get(e)}},Mu=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Cu(vh.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(vh.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ku(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,i,r){const s=new Bh(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(e=>this._loadSingleGrammar(e.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,i,r)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,i=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,t=0,n=null,i=null,r=null){return this._syncRegistry.grammarForScopeName(e,t,n,i,r)}},zu=xu.NULL;const Tu=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Au{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Pu(e,t){const n={},i={};for(const t of e)Object.assign(n,t.property),Object.assign(i,t.normal);return new Au(n,i,t)}function Nu(e){return e.toLowerCase()}Au.prototype.normal={},Au.prototype.property={},Au.prototype.space=void 0;class Ou{constructor(e,t){this.attribute=t,this.property=e}}Ou.prototype.attribute="",Ou.prototype.booleanish=!1,Ou.prototype.boolean=!1,Ou.prototype.commaOrSpaceSeparated=!1,Ou.prototype.commaSeparated=!1,Ou.prototype.defined=!1,Ou.prototype.mustUseProperty=!1,Ou.prototype.number=!1,Ou.prototype.overloadedBoolean=!1,Ou.prototype.property="",Ou.prototype.spaceSeparated=!1,Ou.prototype.space=void 0;let Ru=0;const Lu=Hu(),Eu=Hu(),Du=Hu(),Iu=Hu(),Bu=Hu(),ju=Hu(),qu=Hu();function Hu(){return 2**++Ru}const Fu=Object.keys(e);class $u extends Ou{constructor(t,n,i,r){let s=-1;if(super(t,n),Gu(this,"space",r),"number"==typeof i)for(;++s<Fu.length;){const t=Fu[s];Gu(this,Fu[s],(i&e[t])===e[t])}}}function Gu(e,t,n){n&&(e[t]=n)}function Vu(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const s=new $u(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[Nu(i)]=i,n[Nu(s.attribute)]=i}return new Au(t,n,e.space)}$u.prototype.defined=!0;const Uu=Vu({properties:{ariaActiveDescendant:null,ariaAtomic:Eu,ariaAutoComplete:null,ariaBusy:Eu,ariaChecked:Eu,ariaColCount:Iu,ariaColIndex:Iu,ariaColSpan:Iu,ariaControls:Bu,ariaCurrent:null,ariaDescribedBy:Bu,ariaDetails:null,ariaDisabled:Eu,ariaDropEffect:Bu,ariaErrorMessage:null,ariaExpanded:Eu,ariaFlowTo:Bu,ariaGrabbed:Eu,ariaHasPopup:null,ariaHidden:Eu,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Bu,ariaLevel:Iu,ariaLive:null,ariaModal:Eu,ariaMultiLine:Eu,ariaMultiSelectable:Eu,ariaOrientation:null,ariaOwns:Bu,ariaPlaceholder:null,ariaPosInSet:Iu,ariaPressed:Eu,ariaReadOnly:Eu,ariaRelevant:null,ariaRequired:Eu,ariaRoleDescription:Bu,ariaRowCount:Iu,ariaRowIndex:Iu,ariaRowSpan:Iu,ariaSelected:Eu,ariaSetSize:Iu,ariaSort:null,ariaValueMax:Iu,ariaValueMin:Iu,ariaValueNow:Iu,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Wu(e,t){return t in e?e[t]:t}function Yu(e,t){return Wu(e,t.toLowerCase())}const Xu=Vu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ju,acceptCharset:Bu,accessKey:Bu,action:null,allow:null,allowFullScreen:Lu,allowPaymentRequest:Lu,allowUserMedia:Lu,alt:null,as:null,async:Lu,autoCapitalize:null,autoComplete:Bu,autoFocus:Lu,autoPlay:Lu,blocking:Bu,capture:null,charSet:null,checked:Lu,cite:null,className:Bu,cols:Iu,colSpan:null,content:null,contentEditable:Eu,controls:Lu,controlsList:Bu,coords:Iu|ju,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Lu,defer:Lu,dir:null,dirName:null,disabled:Lu,download:Du,draggable:Eu,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Lu,formTarget:null,headers:Bu,height:Iu,hidden:Du,high:Iu,href:null,hrefLang:null,htmlFor:Bu,httpEquiv:Bu,id:null,imageSizes:null,imageSrcSet:null,inert:Lu,inputMode:null,integrity:null,is:null,isMap:Lu,itemId:null,itemProp:Bu,itemRef:Bu,itemScope:Lu,itemType:Bu,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Lu,low:Iu,manifest:null,max:null,maxLength:Iu,media:null,method:null,min:null,minLength:Iu,multiple:Lu,muted:Lu,name:null,nonce:null,noModule:Lu,noValidate:Lu,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Lu,optimum:Iu,pattern:null,ping:Bu,placeholder:null,playsInline:Lu,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Lu,referrerPolicy:null,rel:Bu,required:Lu,reversed:Lu,rows:Iu,rowSpan:Iu,sandbox:Bu,scope:null,scoped:Lu,seamless:Lu,selected:Lu,shadowRootClonable:Lu,shadowRootDelegatesFocus:Lu,shadowRootMode:null,shape:null,size:Iu,sizes:null,slot:null,span:Iu,spellCheck:Eu,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Iu,step:null,style:null,tabIndex:Iu,target:null,title:null,translate:null,type:null,typeMustMatch:Lu,useMap:null,value:Eu,width:Iu,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Bu,axis:null,background:null,bgColor:null,border:Iu,borderColor:null,bottomMargin:Iu,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Lu,declare:Lu,event:null,face:null,frame:null,frameBorder:null,hSpace:Iu,leftMargin:Iu,link:null,longDesc:null,lowSrc:null,marginHeight:Iu,marginWidth:Iu,noResize:Lu,noHref:Lu,noShade:Lu,noWrap:Lu,object:null,profile:null,prompt:null,rev:null,rightMargin:Iu,rules:null,scheme:null,scrolling:Eu,standby:null,summary:null,text:null,topMargin:Iu,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Iu,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Lu,disableRemotePlayback:Lu,prefix:null,property:null,results:Iu,security:null,unselectable:null},space:"html",transform:Yu}),Ku=Vu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:qu,accentHeight:Iu,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Iu,amplitude:Iu,arabicForm:null,ascent:Iu,attributeName:null,attributeType:null,azimuth:Iu,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Iu,by:null,calcMode:null,capHeight:Iu,className:Bu,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Iu,diffuseConstant:Iu,direction:null,display:null,dur:null,divisor:Iu,dominantBaseline:null,download:Lu,dx:null,dy:null,edgeMode:null,editable:null,elevation:Iu,enableBackground:null,end:null,event:null,exponent:Iu,externalResourcesRequired:null,fill:null,fillOpacity:Iu,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ju,g2:ju,glyphName:ju,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Iu,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Iu,horizOriginX:Iu,horizOriginY:Iu,id:null,ideographic:Iu,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Iu,k:Iu,k1:Iu,k2:Iu,k3:Iu,k4:Iu,kernelMatrix:qu,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Iu,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Iu,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Iu,overlineThickness:Iu,paintOrder:null,panose1:null,path:null,pathLength:Iu,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Bu,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Iu,pointsAtY:Iu,pointsAtZ:Iu,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:qu,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:qu,rev:qu,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:qu,requiredFeatures:qu,requiredFonts:qu,requiredFormats:qu,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Iu,specularExponent:Iu,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Iu,strikethroughThickness:Iu,string:null,stroke:null,strokeDashArray:qu,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Iu,strokeOpacity:Iu,strokeWidth:null,style:null,surfaceScale:Iu,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:qu,tabIndex:Iu,tableValues:null,target:null,targetX:Iu,targetY:Iu,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:qu,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Iu,underlineThickness:Iu,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Iu,values:null,vAlphabetic:Iu,vMathematical:Iu,vectorEffect:null,vHanging:Iu,vIdeographic:Iu,version:null,vertAdvY:Iu,vertOriginX:Iu,vertOriginY:Iu,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Iu,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Wu}),Ju=Vu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Qu=Vu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Yu}),Zu=Vu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),ep=Pu([Uu,Xu,Ju,Qu,Zu],"html"),tp=Pu([Uu,Ku,Ju,Qu,Zu],"svg"),np={}.hasOwnProperty;const ip=/["&'<>`]/g,rp=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,sp=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,op=/[|\\{}()[\]^$+*?.]/g,ap=new WeakMap;function lp(e,t){return e=e.replace(t.subset?function(e){let t=ap.get(e);t||(t=function(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(op,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),ap.set(e,t));return t}(t.subset):ip,n),t.subset||t.escapeOnly?e:e.replace(rp,function(e,n,i){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,i.charCodeAt(n+2),t)}).replace(sp,n);function n(e,n,i){return t.format(e.charCodeAt(0),i.charCodeAt(n+1),t)}}const cp=/[\dA-Fa-f]/;const dp=/\d/;const hp=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],up={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},pp=["cent","copy","divide","gt","lt","not","para","times"],fp={}.hasOwnProperty,mp={};let _p;for(_p in up)fp.call(up,_p)&&(mp[up[_p]]=_p);const gp=/[^\dA-Za-z]/;function bp(e,t,n){let i,r=function(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!cp.test(String.fromCharCode(t))?i:i+";"}(e,t,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(i=function(e,t,n,i){const r=String.fromCharCode(e);if(fp.call(mp,r)){const e=mp[r],s="&"+e;return n&&hp.includes(e)&&!pp.includes(e)&&(!i||t&&61!==t&&gp.test(String.fromCharCode(t)))?s:s+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const i=function(e,t,n){const i="&#"+String(e);return n&&t&&!dp.test(String.fromCharCode(t))?i:i+";"}(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function yp(e,t){return lp(e,Object.assign({format:bp},t))}const vp=/^>|^->|<!--|-->|--!>|<!-$/g,wp=[">"],xp=["<",">"];function kp(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;-1!==r;)i++,r=n.indexOf(t,r+t.length);return i}function Sp(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const Cp=/[A-Z]/g,Mp=/-[a-z]/g,zp=/^data[-\w.:]+$/i;function Tp(e){return"-"+e.toLowerCase()}function Ap(e){return e.charAt(1).toUpperCase()}function Pp(e){return e.join(" ").trim()}const Np=/[ \t\n\f\r]/g;function Op(e){return"object"==typeof e?"text"===e.type&&Rp(e.value):Rp(e)}function Rp(e){return""===e.replace(Np,"")}const Lp=Ip(1),Ep=Ip(-1),Dp=[];function Ip(e){return function(t,n,i){const r=t?t.children:Dp;let s=(n||0)+e,o=r[s];if(!i)for(;o&&Op(o);)s+=e,o=r[s];return o}}const Bp={}.hasOwnProperty;function jp(e){return function(t,n,i){return Bp.call(e,t.tagName)&&e[t.tagName](t,n,i)}}const qp=jp({body:function(e,t,n){const i=Lp(n,t);return!i||"comment"!==i.type},caption:Hp,colgroup:Hp,dd:function(e,t,n){const i=Lp(n,t);return!i||"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName)},dt:function(e,t,n){const i=Lp(n,t);return Boolean(i&&"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName))},head:Hp,html:function(e,t,n){const i=Lp(n,t);return!i||"comment"!==i.type},li:function(e,t,n){const i=Lp(n,t);return!i||"element"===i.type&&"li"===i.tagName},optgroup:function(e,t,n){const i=Lp(n,t);return!i||"element"===i.type&&"optgroup"===i.tagName},option:function(e,t,n){const i=Lp(n,t);return!i||"element"===i.type&&("option"===i.tagName||"optgroup"===i.tagName)},p:function(e,t,n){const i=Lp(n,t);return i?"element"===i.type&&("address"===i.tagName||"article"===i.tagName||"aside"===i.tagName||"blockquote"===i.tagName||"details"===i.tagName||"div"===i.tagName||"dl"===i.tagName||"fieldset"===i.tagName||"figcaption"===i.tagName||"figure"===i.tagName||"footer"===i.tagName||"form"===i.tagName||"h1"===i.tagName||"h2"===i.tagName||"h3"===i.tagName||"h4"===i.tagName||"h5"===i.tagName||"h6"===i.tagName||"header"===i.tagName||"hgroup"===i.tagName||"hr"===i.tagName||"main"===i.tagName||"menu"===i.tagName||"nav"===i.tagName||"ol"===i.tagName||"p"===i.tagName||"pre"===i.tagName||"section"===i.tagName||"table"===i.tagName||"ul"===i.tagName):!n||!("element"===n.type&&("a"===n.tagName||"audio"===n.tagName||"del"===n.tagName||"ins"===n.tagName||"map"===n.tagName||"noscript"===n.tagName||"video"===n.tagName))},rp:Fp,rt:Fp,tbody:function(e,t,n){const i=Lp(n,t);return!i||"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName)},td:$p,tfoot:function(e,t,n){return!Lp(n,t)},th:$p,thead:function(e,t,n){const i=Lp(n,t);return Boolean(i&&"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName))},tr:function(e,t,n){const i=Lp(n,t);return!i||"element"===i.type&&"tr"===i.tagName}});function Hp(e,t,n){const i=Lp(n,t,!0);return!i||"comment"!==i.type&&!("text"===i.type&&Op(i.value.charAt(0)))}function Fp(e,t,n){const i=Lp(n,t);return!i||"element"===i.type&&("rp"===i.tagName||"rt"===i.tagName)}function $p(e,t,n){const i=Lp(n,t);return!i||"element"===i.type&&("td"===i.tagName||"th"===i.tagName)}const Gp=jp({body:function(e){const t=Lp(e,-1,!0);return!(t&&("comment"===t.type||"text"===t.type&&Op(t.value.charAt(0))||"element"===t.type&&("meta"===t.tagName||"link"===t.tagName||"script"===t.tagName||"style"===t.tagName||"template"===t.tagName)))},colgroup:function(e,t,n){const i=Ep(n,t),r=Lp(e,-1,!0);if(n&&i&&"element"===i.type&&"colgroup"===i.tagName&&qp(i,n.children.indexOf(i),n))return!1;return Boolean(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const n=e.children[0];return!n||"element"===n.type},html:function(e){const t=Lp(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){const i=Ep(n,t),r=Lp(e,-1);if(n&&i&&"element"===i.type&&("thead"===i.tagName||"tbody"===i.tagName)&&qp(i,n.children.indexOf(i),n))return!1;return Boolean(r&&"element"===r.type&&"tr"===r.tagName)}});const Vp={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Up(e,t,n){const i=function(e,t){const n=Nu(t);let i=t,r=Ou;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&zp.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Mp,Ap);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Mp.test(e)){let n=e.replace(Cp,Tp);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}r=$u}return new r(i,t)}(e.schema,t),r=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,s=e.settings.allowDangerousCharacters?0:1;let o,a=e.quote;if(!i.overloadedBoolean||n!==i.attribute&&""!==n?!i.boolean&&!i.overloadedBoolean||"string"==typeof n&&n!==i.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=yp(i.attribute,Object.assign({},e.settings.characterReferences,{subset:Vp.name[r][s]}));return!0===n?l:(n=Array.isArray(n)?(i.commaSeparated?Sp:Pp)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n?l:(e.settings.preferUnquoted&&(o=yp(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Vp.unquoted[r][s]}))),o!==n&&(e.settings.quoteSmart&&kp(n,a)>kp(n,e.alternative)&&(a=e.alternative),o=a+yp(n,Object.assign({},e.settings.characterReferences,{subset:("'"===a?Vp.single:Vp.double)[r][s],attribute:!0}))+a),l+(o?"="+o:o)))}const Wp=["<","&"];function Yp(e,t,n,i){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?yp(e.value,Object.assign({},i.settings.characterReferences,{subset:Wp})):e.value}const Xp=function(e,t){const n=t||{};function i(t,...n){let r=i.invalid;const s=i.handlers;if(t&&np.call(t,e)){const n=String(t[e]);r=np.call(s,n)?s[n]:i.unknown}if(r)return r.call(this,t,...n)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,n,i){return i.settings.bogusComments?"<?"+yp(e.value,Object.assign({},i.settings.characterReferences,{subset:wp}))+">":"\x3c!--"+e.value.replace(vp,function(e){return yp(e,Object.assign({},i.settings.characterReferences,{subset:xp}))})+"--\x3e"},doctype:function(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,i){const r=i.schema,s="svg"!==r.space&&i.settings.omitOptionalTags;let o="svg"===r.space?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;"html"===r.space&&"svg"===e.tagName&&(i.schema=tp);const c=function(e,t){const n=[];let i,r=-1;if(t)for(i in t)if(null!==t[i]&&void 0!==t[i]){const r=Up(e,i,t[i]);r&&n.push(r)}for(;++r<n.length;){const t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&'"'!==t&&"'"!==t&&(n[r]+=" ")}return n.join("")}(i,e.properties),d=i.all("html"===r.space&&"template"===e.tagName?e.content:e);return i.schema=r,d&&(o=!1),!c&&s&&Gp(e,t,n)||(a.push("<",e.tagName,c?" "+c:""),o&&("svg"===r.space||i.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!i.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&a.push(" "),a.push("/")),a.push(">")),a.push(d),o||s&&qp(e,t,n)||a.push("</"+e.tagName+">"),a.join("")},raw:function(e,t,n,i){return i.settings.allowDangerousHtml?e.value:Yp(e,0,n,i)},root:function(e,t,n,i){return i.all(e)},text:Yp}});const Kp={},Jp={},Qp=[];function Zp(e,t,n){return Xp(e,t,n,this)}function ef(e){const t=[],n=e&&e.children||Qp;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}function tf(e,t){const n="string"==typeof e?{}:{...e.colorReplacements},i="string"==typeof e?e:e.name;for(const[e,r]of Object.entries(t?.colorReplacements||{}))"string"==typeof r?n[e]=r:e===i&&Object.assign(n,r);return n}function nf(e,t){return e&&t?.[e?.toLowerCase()]||e}async function rf(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function sf(e){return!e||["plaintext","txt","text","plain"].includes(e)}function of(e){return"ansi"===e||sf(e)}function af(e){return"none"===e}function lf(e){return af(e)}function cf(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function df(e,t=!1){const n=e.split(/(\r?\n)/g);let i=0;const r=[];for(let e=0;e<n.length;e+=2){const s=t?n[e]+(n[e+1]||""):n[e];r.push([s,i]),i+=n[e].length,i+=n[e+1]?.length||0}return r}const hf="light-dark()",uf=["color","background-color"];function pf(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Ch.Italic&&(t["font-style"]="italic"),e.fontStyle&Ch.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Ch.Underline&&n.push("underline"),e.fontStyle&Ch.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function ff(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}const mf=new WeakMap;function _f(e,t){mf.set(e,t)}function gf(e){return mf.get(e)}class bf{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new bf(Object.fromEntries((n=t,Array.isArray(n)?n:[n]).map(e=>[e,zu])),e);var n}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,i]=e;this.lang=n,this._stacks={[i]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return function(e){const t=[],n=new Set;function i(e){if(n.has(e))return;n.add(e);const r=e?.nameScopesList?.scopeName;r&&t.push(r),e.parent&&i(e.parent)}return i(e),t}(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function yf(){const e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new ch(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...i.indexToPos(e),offset:e}}{const t=i.lines[e.line];if(void 0===t)throw new ch(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${i.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new ch(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:i.posToIndex(e.line,n)}}};const i=function(e){const t=df(e,!0).map(([e])=>e);return{lines:t,indexToPos:function(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=n,r=0;for(const e of t){if(i<e.length)break;i-=e.length,r++}return{line:r,character:i}},posToIndex:function(e,n){let i=0;for(let n=0;n<e;n++)i+=t[n].length;return i+=n,i}}}(t.source),r=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));!function(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new ch(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const t=e[i],r=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,s=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,a=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(r||s||o||a){if(r&&s)continue;if(o&&a)continue;if(o&&n.start.offset===n.end.offset)continue;if(s&&t.start.offset===t.end.offset)continue;throw new ch(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}(r),e.set(t.meta,{decorations:r,converter:i,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){if(!this.options.decorations?.length)return;const n=function(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{const t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?function(e,t){let n=0;const i=[];for(const r of t)r>n&&i.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}(e,t):e})):e}(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]));return n},code(e){if(!this.options.decorations?.length)return;const n=t(this),i=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(i.length!==n.converter.lines.length)throw new ch(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function r(e,t,n,r){const s=i[e];let a="",l=-1,c=-1;if(0===t&&(l=0),0===n&&(c=0),n===Number.POSITIVE_INFINITY&&(c=s.children.length),-1===l||-1===c)for(let e=0;e<s.children.length;e++)a+=vf(s.children[e]),-1===l&&a.length===t&&(l=e+1),-1===c&&a.length===n&&(c=e+1);if(-1===l)throw new ch(`Failed to find start index for decoration ${JSON.stringify(r.start)}`);if(-1===c)throw new ch(`Failed to find end index for decoration ${JSON.stringify(r.end)}`);const d=s.children.slice(l,c);if(r.alwaysWrap||d.length!==s.children.length)if(r.alwaysWrap||1!==d.length||"element"!==d[0].type){const e={type:"element",tagName:"span",properties:{},children:d};o(e,r,"wrapper"),s.children.splice(l,d.length,e)}else o(d[0],r,"token");else o(s,r,"line")}function s(e,t){i[e]=o(i[e],t,"line")}function o(e,t,n){const i=t.properties||{},r=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...i,class:e.properties.class},t.properties?.class&&cf(e,t.properties.class),e=r(e,n)||e}const a=[],l=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(const e of l){const{start:t,end:n}=e;if(t.line===n.line)r(t.line,t.character,n.character,e);else if(t.line<n.line){r(t.line,t.character,Number.POSITIVE_INFINITY,e);for(let i=t.line+1;i<n.line;i++)a.unshift(()=>s(i,e));r(n.line,0,n.character,e)}}a.forEach(e=>e())}}}function vf(e){return"text"===e.type?e.value:"element"===e.type?e.children.map(vf).join(""):""}const wf=[yf()];function xf(e){const t=function(e){const t=[],n=[],i=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...wf]}var kf=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Sf={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Cf(e,t){const n=e.indexOf("",t);if(-1!==n&&"["===e[n+1]){const t=e.indexOf("m",n);if(-1!==t)return{sequence:e.substring(n+2,t).split(";"),startPosition:n,position:t+1}}return{position:e.length}}function Mf(e){const t=e.shift();if("2"===t){const t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){const t=e.shift();if(t)return{type:"table",index:Number(t)}}}function zf(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(0===i)t.push({type:"resetAll"});else if(i<=9){Sf[i]&&t.push({type:"setDecoration",value:Sf[i]})}else if(i<=29){const e=Sf[i-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:kf[i-30]}});else if(38===i){const n=Mf(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===i)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:kf[i-40]}});else if(48===i){const n=Mf(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===i?t.push({type:"resetBackgroundColor"}):53===i?t.push({type:"setDecoration",value:"overline"}):55===i?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:kf[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:kf[i-100+8]}})}return t}var Tf={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Af(e=Tf){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}let i;function r(e){return function(){if(i)return i;i=[];for(let e=0;e<kf.length;e++)i.push(t(kf[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let r=0;r<6;r++)for(let s=0;s<6;s++)i.push(n([e[t],e[r],e[s]]));let r=8;for(let e=0;e<24;e++,r+=10)i.push(n([r,r,r]));return i}()[e]}return{value:function(e){switch(e.type){case"named":return t(e.name);case"rgb":return n(e.rgb);case"table":return r(e.index)}}}}function Pf(e,t,n){const i=tf(e,n),r=df(t),s=Af(Object.fromEntries(kf.map(t=>[t,e.colors?.[`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`]]))),o=function(){let e=null,t=null,n=new Set;return{parse(i){const r=[];let s=0;do{const o=Cf(i,s),a=o.sequence?i.substring(s,o.startPosition):i.substring(s);if(a.length>0&&r.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const i=zf(o.sequence);for(const r of i)"resetAll"===r.type?(e=null,t=null,n.clear()):"resetForegroundColor"===r.type?e=null:"resetBackgroundColor"===r.type?t=null:"resetDecoration"===r.type&&n.delete(r.value);for(const r of i)"setForegroundColor"===r.type?e=r.value:"setBackgroundColor"===r.type?t=r.value:"setDecoration"===r.type&&n.add(r.value)}s=o.position}while(s<i.length);return r}}}();return r.map(t=>o.parse(t[0]).map(n=>{let r,o;n.decorations.has("reverse")?(r=n.background?s.value(n.background):e.bg,o=n.foreground?s.value(n.foreground):e.fg):(r=n.foreground?s.value(n.foreground):e.fg,o=n.background?s.value(n.background):void 0),r=nf(r,i),o=nf(o,i),n.decorations.has("dim")&&(r=function(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t){if(t[3]){const e=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${e}`}return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(e=>`${e}${e}`).join("")}80`}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}(r));let a=Ch.None;return n.decorations.has("bold")&&(a|=Ch.Bold),n.decorations.has("italic")&&(a|=Ch.Italic),n.decorations.has("underline")&&(a|=Ch.Underline),n.decorations.has("strikethrough")&&(a|=Ch.Strikethrough),{content:n.value,offset:t[1],color:r,bgColor:o,fontStyle:a}}))}function Nf(e,t,n={}){const{lang:i="text",theme:r=e.getLoadedThemes()[0]}=n;if(sf(i)||af(r))return df(t).map(e=>[{content:e[0],offset:e[1]}]);const{theme:s,colorMap:o}=e.setTheme(r);if("ansi"===i)return Pf(s,t,n);const a=e.getLanguage(i);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new ch(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new ch(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return function(e,t,n,i,r){const s=Rf(e,t,n,i,r),o=new bf(Rf(e,t,n,i,r).stateStack,t.name,n.name);return _f(s.tokens,o),s.tokens}(t,a,s,o,n)}function Of(...e){if(2===e.length)return gf(e[1]);const[t,n,i={}]=e,{lang:r="text",theme:s=t.getLoadedThemes()[0]}=i;if(sf(r)||af(s))throw new ch("Plain language does not have grammar state");if("ansi"===r)throw new ch("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(r);return new bf(Rf(n,l,o,a,i).stateStack,l.name,o.name)}function Rf(e,t,n,i,r){const s=tf(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=r,l=df(e);let c=r.grammarState?function(e,t){if(!(e instanceof bf))throw new ch("Invalid grammar state");return e.getInternalStack(t)}(r.grammarState,n.name)??zu:null!=r.grammarContextCode?Rf(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:zu,d=[];const h=[];for(let e=0,u=l.length;e<u;e++){const[u,p]=l[e];if(""===u){d=[],h.push([]);continue}if(o>0&&u.length>=o){d=[],h.push([{content:u,offset:p,color:"",fontStyle:0}]);continue}let f,m,_;r.includeExplanation&&(f=t.tokenizeLine(u,c,a),m=f.tokens,_=0);const g=t.tokenizeLine2(u,c,a),b=g.tokens.length/2;for(let e=0;e<b;e++){const t=g.tokens[2*e],o=e+1<b?g.tokens[2*e+2]:u.length;if(t===o)continue;const a=g.tokens[2*e+1],l=nf(i[Ph.getForeground(a)],s),c=Ph.getFontStyle(a),h={content:u.substring(t,o),offset:p+t,color:l,fontStyle:c};if(r.includeExplanation){const e=[];if("scopeName"!==r.includeExplanation)for(const t of n.settings){let n;switch(typeof t.scope){case"string":n=t.scope.split(/,/).map(e=>e.trim());break;case"object":n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}h.explanation=[];let i=0;for(;t+i<o;){const t=m[_],n=u.substring(t.startIndex,t.endIndex);i+=n.length,h.explanation.push({content:n,scopes:"scopeName"===r.includeExplanation?Lf(t.scopes):Ef(e,t.scopes)}),_+=1}}d.push(h)}h.push(d),d=[],c=g.ruleStack}return{tokens:h,stateStack:c}}function Lf(e){return e.map(e=>({scopeName:e}))}function Ef(e,t){const n=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];n[i]={scopeName:r,themeMatches:Bf(e,r,t.slice(0,i))}}return n}function Df(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function If(e,t,n){if(!Df(e[e.length-1],t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)Df(e[i],n[r])&&(i-=1),r-=1;return-1===i}function Bf(e,t,n){const i=[];for(const{selectors:r,settings:s}of e)for(const e of r)if(If(e,t,n)){i.push(s);break}return i}function jf(e,t,n){const i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),r=i.map(i=>{const r=Nf(e,t,{...n,theme:i.theme});return{tokens:r,state:gf(r),theme:"string"==typeof i.theme?i.theme:i.theme.name}}),s=function(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const r=e.map(e=>e[i]),s=t.map(()=>[]);t.forEach((e,t)=>e.push(s[t]));const o=r.map(()=>0),a=r.map(e=>e[0]);for(;a.every(e=>e);){const e=Math.min(...a.map(e=>e.content.length));for(let t=0;t<n;t++){const n=a[t];n.content.length===e?(s[t].push(n),o[t]+=1,a[t]=r[t][o[t]]):(s[t].push({...n,content:n.content.slice(0,e)}),a[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}(...r.map(e=>e.tokens)),o=s[0].map((e,t)=>e.map((e,r)=>{const o={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in n&&n.includeExplanation&&(o.explanation=e.explanation),s.forEach((e,n)=>{const{content:s,explanation:a,offset:l,...c}=e[t][r];o.variants[i[n].color]=c}),o})),a=r[0].state?new bf(Object.fromEntries(r.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),r[0].state.lang):void 0;return a&&_f(o,a),o}function qf(e,t,n){let i,r,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:h="css-vars"}=n,u=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===c?-1:t.color===c?1:0);if(0===u.length)throw new ch("`themes` option must not be empty");const p=jf(e,t,n);if(l=gf(p),c&&hf!==c&&!u.find(e=>e.color===c))throw new ch(`\`themes\` option must contain the defaultColor key \`${c}\``);const f=u.map(t=>e.getTheme(t.theme)),m=u.map(e=>e.color);s=p.map(e=>e.map(e=>function(e,t,n,i,r="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>pf(e.variants[t])),a=new Set(o.flatMap(e=>Object.keys(e))),l={},c=(e,i)=>{const r="color"===i?"":"background-color"===i?"-bg":`-${i}`;return n+t[e]+("color"===i?"":r)};return o.forEach((e,n)=>{for(const s of a){const a=e[s]||"inherit";if(0===n&&i&&uf.includes(s))if(i===hf&&o.length>1){const e=t.findIndex(e=>"light"===e),i=t.findIndex(e=>"dark"===e);if(-1===e||-1===i)throw new ch('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=o[e][s]||"inherit",h=o[i][s]||"inherit";l[s]=`light-dark(${d}, ${h})`,"css-vars"===r&&(l[c(n,s)]=a)}else l[s]=a;else"css-vars"===r&&(l[c(n,s)]=a)}}),s.htmlStyle=l,s}(e,m,d,c,h))),l&&_f(s,l);const _=u.map(e=>tf(e.theme,n));r=Hf(u,f,_,d,c,"fg",h),i=Hf(u,f,_,d,c,"bg",h),o=`shiki-themes ${f.map(e=>e.name).join(" ")}`,a=c?void 0:[r,i].join(";")}else{if(!("theme"in n))throw new ch("Invalid options, either `theme` or `themes` must be provided");{const a=tf(n.theme,n);s=Nf(e,t,n);const c=e.getTheme(n.theme);i=nf(c.bg,a),r=nf(c.fg,a),o=c.name,l=gf(s)}}return{tokens:s,fg:r,bg:i,themeName:o,rootStyle:a,grammarState:l}}function Hf(e,t,n,i,r,s,o){return e.map((a,l)=>{const c=nf(t[l][s],n[l])||"inherit",d=`${i+a.color}${"bg"===s?"-bg":""}:${c}`;if(0===l&&r){if(r===hf&&e.length>1){const i=e.findIndex(e=>"light"===e.color),r=e.findIndex(e=>"dark"===e.color);if(-1===i||-1===r)throw new ch('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${nf(t[i][s],n[i])||"inherit"}, ${nf(t[r][s],n[r])||"inherit"});${d}`}return c}return"css-vars"===o?d:null}).filter(e=>!!e).join(";")}function Ff(e,t,n,i={meta:{},options:n,codeToHast:(t,n)=>Ff(e,t,n),codeToTokens:(t,n)=>qf(e,t,n)}){let r=t;for(const e of xf(n))r=e.preprocess?.call(i,r,n)||r;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:d}=qf(e,r,n);const{mergeWhitespaces:h=!0,mergeSameStyleTokens:u=!1}=n;!0===h?s=function(e){return e.map(e=>{const t=[];let n="",i=0;return e.forEach((r,s)=>{const o=!(r.fontStyle&&(r.fontStyle&Ch.Underline||r.fontStyle&Ch.Strikethrough));o&&r.content.match(/^\s+$/)&&e[s+1]?(i||(i=r.offset),n+=r.content):n?(o?t.push({...r,offset:i,content:n+r.content}):t.push({content:n,offset:i},r),i=0,n=""):t.push(r)}),t})}(s):"never"===h&&(s=function(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;const t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;const[,n,i,r]=t;if(!n&&!r)return e;const s=[{...e,offset:e.offset+n.length,content:i}];return n&&s.unshift({content:n,offset:e.offset}),r&&s.push({content:r,offset:e.offset+n.length+i.length}),s}))}(s)),u&&(s=function(e){return e.map(e=>{const t=[];for(const n of e){if(0===t.length){t.push({...n});continue}const e=t[t.length-1],i=ff(e.htmlStyle||pf(e)),r=ff(n.htmlStyle||pf(n)),s=e.fontStyle&&(e.fontStyle&Ch.Underline||e.fontStyle&Ch.Strikethrough),o=n.fontStyle&&(n.fontStyle&Ch.Underline||n.fontStyle&Ch.Strikethrough);s||o||i!==r?t.push({...n}):e.content+=n.content}return t})}(s));const p={...i,get source(){return r}};for(const e of xf(n))s=e.tokens?.call(p,s)||s;return function(e,t,n,i=gf(e)){const r=xf(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t;let c={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...!1!==l&&null!=l?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([e])=>!e.startsWith("_")))},children:[]},d={type:"element",tagName:"code",properties:{},children:s};const h=[],u={...n,structure:a,addClassToHast:cf,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return c},get code(){return d},get lines(){return h}};if(e.forEach((e,t)=>{t&&("inline"===a?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===a&&s.push({type:"text",value:"\n"}));let n={type:"element",tagName:"span",properties:{class:"line"},children:[]},i=0;for(const s of e){let e={type:"element",tagName:"span",properties:{...s.htmlAttrs},children:[{type:"text",value:s.content}]};const l=ff(s.htmlStyle||pf(s));l&&(e.properties.style=l);for(const o of r)e=o?.span?.call(u,e,t+1,i,n,s)||e;"inline"===a?o.children.push(e):"classic"===a&&n.children.push(e),i+=s.content.length}if("classic"===a){for(const e of r)n=e?.line?.call(u,n,t+1)||n;h.push(n),s.push(n)}}),"classic"===a){for(const e of r)d=e?.code?.call(u,d)||d;c.children.push(d);for(const e of r)c=e?.pre?.call(u,c)||c;o.children.push(c)}let p=o;for(const e of r)p=e?.root?.call(u,p)||p;i&&_f(p,i);return p}(s,{...n,fg:o,bg:a,themeName:l,rootStyle:c},p,d)}const $f=function(e,t){const n=t||Kp,i=n.quote||'"',r='"'===i?"'":'"';if('"'!==i&&"'"!==i)throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:Zp,all:ef,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Tu,characterReferences:n.characterReferences||Jp,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?tp:ep,quote:i,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)};function Gf(e,t,n){const i={meta:{},options:n,codeToHast:(t,n)=>Ff(e,t,n),codeToTokens:(t,n)=>qf(e,t,n)};let r=$f(Ff(e,t,n,i));for(const e of xf(n))r=e.postprocess?.call(i,r,n)||r;return r}const Vf="#333333",Uf="#bbbbbb",Wf="#fffffe",Yf="#1e1e1e",Xf="__shiki_resolved";function Kf(e){if(e?.[Xf])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(i=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i="light"===t.type?Vf:Uf),n||(n="light"===t.type?Wf:Yf),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const s=new Map;function o(e){if(s.has(e))return s.get(e);r+=1;const n=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(s.set(e,n),n)}t.settings=t.settings.map(e=>{const n=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),i=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!i)return e;const r={...e,settings:{...e.settings}};if(n){const n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,r.settings.foreground=n}if(i){const n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,r.settings.background=n}return r});for(const e of Object.keys(t.colors||{}))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){const n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Xf,{enumerable:!1,writable:!1,value:!0}),t}async function Jf(e){return Array.from(new Set((await Promise.all(e.filter(e=>!of(e)).map(async e=>await rf(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function Qf(e){return(await Promise.all(e.map(async e=>lf(e)?null:Kf(await rf(e))))).filter(e=>!!e)}let Zf=3,em=!1;class tm extends Error{constructor(e){super(e),this.name="ShikiError"}}class nm extends Mu{constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Kf(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=vh.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){if(this._alias[e]){const t=new Set([e]);for(;this._alias[e];){if(e=this._alias[e],t.has(e))throw new tm(`Circular alias \`${Array.from(t).join(" -> ")} -> ${e}\``);t.add(e)}}return this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(const e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const t of e)this.resolveEmbeddedLanguages(t);const t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){const e=t.filter(([e,t])=>t&&t.embeddedLangs?.some(e=>n.map(([e])=>e).includes(e))).filter(e=>!n.includes(e));throw new tm(`Missing languages ${n.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(const[e,n]of t)this._resolver.addLanguage(n);for(const[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){if(this._langMap.set(e.name,e),this._langGraph.set(e.name,e),e.embeddedLangs)for(const t of e.embeddedLangs)this._langGraph.set(t,this._langMap.get(t))}}class im{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let e=1;e<=t.length;e++){const i=t.slice(0,e).join(".");n=[...n,...this._injections.get(i)||[]]}return n}}let rm=0;function sm(e){rm+=1,!1!==e.warnings&&rm>=10&&rm%10==0&&console.warn(`[Shiki] ${rm} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new tm("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(Kf),r=new im(e.engine,n),s=new nm(r,i,n,e.langAlias);let o;function a(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};d();const t=s.getTheme(e);if(!t)throw new tm(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(...e){d(),s.loadLanguages(e.flat(1))}function c(...e){d();for(const t of e.flat(1))s.loadTheme(t)}function d(){if(t)throw new tm("Shiki instance has been disposed")}function h(){t||(t=!0,s.dispose(),rm-=1)}return{setTheme:function(e){d();const t=a(e);return o!==e&&(s.setTheme(t),o=e),{theme:t,colorMap:s.getColorMap()}},getTheme:a,getLanguage:function(e){d();const t=s.getGrammar("string"==typeof e?e:e.name);if(!t)throw new tm(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return d(),s.getLoadedThemes()},getLoadedLanguages:function(){return d(),s.getLoadedLanguages()},loadLanguage:async function(...e){return l(await Jf(e))},loadLanguageSync:l,loadTheme:async function(...e){return d(),c(await Qf(e))},loadThemeSync:c,dispose:h,[Symbol.dispose]:h}}async function om(e){e.engine||function(e,t=3){if(Zf&&!("number"==typeof Zf&&t>Zf)){if(em)throw new Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([Qf(e.themes||[]),Jf(e.langs||[]),e.engine]);return sm({...e,themes:t,langs:n,engine:i})}async function am(e){const t=await om(e);return{getLastGrammarState:(...e)=>Of(t,...e),codeToTokensBase:(e,n)=>Nf(t,e,n),codeToTokensWithThemes:(e,n)=>jf(t,e,n),codeToTokens:(e,n)=>qf(t,e,n),codeToHast:(e,n)=>Ff(t,e,n),codeToHtml:(e,n)=>Gf(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function lm(e){const t=e.langs,n=e.themes,i=e.engine;return async function(e){function r(n){if("string"==typeof n){if(of(n))return[];n=e.langAlias?.[n]||n;const i=t[n];if(!i)throw new ch(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return i}return n}function s(e){if(lf(e))return"none";if("string"==typeof e){const t=n[e];if(!t)throw new ch(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}const o=(e.themes??[]).map(e=>s(e)),a=(e.langs??[]).map(e=>r(e)),l=await am({engine:e.engine??i(),...e,themes:o,langs:a});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(r)),loadTheme:(...e)=>l.loadTheme(...e.map(s)),getBundledLanguages:()=>t,getBundledThemes:()=>n}}}function cm(e,t){const n=function(e){let t;return async function(n={}){if(t){const e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}return t=e({...n,themes:n.themes||[],langs:n.langs||[]}),t}}(e);async function i(e,i){const r=await n({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),s=await(t?.guessEmbeddedLanguages?.(e,i.lang,r));return s&&await r.loadLanguage(...s),r}return{getSingletonHighlighter:e=>n(e),codeToHtml:async(e,t)=>(await i(e,t)).codeToHtml(e,t),codeToHast:async(e,t)=>(await i(e,t)).codeToHast(e,t),codeToTokens:async(e,t)=>(await i(e,t)).codeToTokens(e,t),codeToTokensBase:async(e,t)=>(await i(e,t)).codeToTokensBase(e,t),codeToTokensWithThemes:async(e,t)=>(await i(e,t)).codeToTokensWithThemes(e,t),getLastGrammarState:async(e,t)=>(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}class dm extends Error{constructor(e){super(e),this.name="ShikiError"}}function hm(){return"undefined"!=typeof performance?performance.now():Date.now()}const um=(e,t)=>e+(t-e%t)%t;async function pm(e){let t,n;const i={};function r(e){n=e,i.HEAPU8=new Uint8Array(e),i.HEAPU32=new Uint32Array(e)}function s(e){try{return t.grow(e-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}const o="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(e,t){return e?function(e,t,n=1024){const i=t+n;let r=t;for(;e[r]&&!(r>=i);)++r;if(r-t>16&&e.buffer&&o)return o.decode(e.subarray(t,r));let s="";for(;t<r;){let n=e[t++];if(!(128&n)){s+=String.fromCharCode(n);continue}const i=63&e[t++];if(192==(224&n)){s+=String.fromCharCode((31&n)<<6|i);continue}const r=63&e[t++];if(n=224==(240&n)?(15&n)<<12|i<<6|r:(7&n)<<18|i<<12|r<<6|63&e[t++],n<65536)s+=String.fromCharCode(n);else{const e=n-65536;s+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return s}(i.HEAPU8,e,t):""}const l={emscripten_get_now:hm,emscripten_memcpy_big:function(e,t,n){i.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){const t=i.HEAPU8.length,n=2147483648;if((e>>>=0)>n)return!1;for(let i=1;i<=4;i*=2){let r=t*(1+.2/i);r=Math.min(r,e+100663296);if(s(Math.min(n,um(Math.max(e,r),65536))))return!0}return!1},fd_write:()=>0};return await async function(){const n={env:l,wasi_snapshot_preview1:l},s=await e(n);t=s.memory,r(t.buffer),Object.assign(i,s),i.UTF8ToString=a}(),i}var fm=Object.defineProperty,mm=(e,t,n)=>((e,t,n)=>t in e?fm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let _m=null;class gm{constructor(e){mm(this,"utf16Length"),mm(this,"utf8Length"),mm(this,"utf16Value"),mm(this,"utf8Value"),mm(this,"utf16OffsetToUtf8"),mm(this,"utf8OffsetToUtf16");const t=e.length,n=gm._utf8ByteLength(e),i=n!==t,r=i?new Uint32Array(t+1):null;i&&(r[t]=n);const s=i?new Uint32Array(n+1):null;i&&(s[n]=t);const o=new Uint8Array(n);let a=0;for(let n=0;n<t;n++){const l=e.charCodeAt(n);let c=l,d=!1;if(l>=55296&&l<=56319&&n+1<t){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(c=65536+(l-55296<<10)|t-56320,d=!0)}i&&(r[n]=a,d&&(r[n+1]=a),c<=127?s[a+0]=n:c<=2047?(s[a+0]=n,s[a+1]=n):c<=65535?(s[a+0]=n,s[a+1]=n,s[a+2]=n):(s[a+0]=n,s[a+1]=n,s[a+2]=n,s[a+3]=n)),c<=127?o[a++]=c:c<=2047?(o[a++]=192|(1984&c)>>>6,o[a++]=128|(63&c)>>>0):c<=65535?(o[a++]=224|(61440&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0):(o[a++]=240|(1835008&c)>>>18,o[a++]=128|(258048&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0),d&&n++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=o,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let t=0;for(let n=0,i=e.length;n<i;n++){const r=e.charCodeAt(n);let s=r,o=!1;if(r>=55296&&r<=56319&&n+1<i){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(s=65536+(r-55296<<10)|t-56320,o=!0)}t+=s<=127?1:s<=2047?2:s<=65535?3:4,o&&n++}return t}createString(e){const t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}const bm=class e{constructor(t){if(mm(this,"id",++e.LAST_ID),mm(this,"_onigBinding"),mm(this,"content"),mm(this,"utf16Length"),mm(this,"utf8Length"),mm(this,"utf16OffsetToUtf8"),mm(this,"utf8OffsetToUtf16"),mm(this,"ptr"),!_m)throw new dm("Must invoke loadWasm first.");this._onigBinding=_m,this.content=t;const n=new gm(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=_m.omalloc(1e4)),e._sharedPtrInUse=!0,_m.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(_m)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};mm(bm,"LAST_ID",0),mm(bm,"_sharedPtr",0),mm(bm,"_sharedPtrInUse",!1);let ym,vm=bm;class wm{constructor(e){if(mm(this,"_onigBinding"),mm(this,"_ptr"),!_m)throw new dm("Must invoke loadWasm first.");const t=[],n=[];for(let i=0,r=e.length;i<r;i++){const r=new gm(e[i]);t[i]=r.createString(_m),n[i]=r.utf8Length}const i=_m.omalloc(4*e.length);_m.HEAPU32.set(t,i/4);const r=_m.omalloc(4*e.length);_m.HEAPU32.set(n,r/4);const s=_m.createOnigScanner(i,r,e.length);for(let n=0,i=e.length;n<i;n++)_m.ofree(t[n]);_m.ofree(r),_m.ofree(i),0===s&&function(e){throw new dm(e.UTF8ToString(e.getLastOnigError()))}(_m),this._onigBinding=_m,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let i=0;if("number"==typeof n&&(i=n),"string"==typeof e){e=new vm(e);const n=this._findNextMatchSync(e,t,!1,i);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,i)}_findNextMatchSync(e,t,n,i){const r=this._onigBinding,s=r.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),i);if(0===s)return null;const o=r.HEAPU32;let a=s/4;const l=o[a++],c=o[a++],d=[];for(let t=0;t<c;t++){const n=e.convertUtf8OffsetToUtf16(o[a++]),i=e.convertUtf8OffsetToUtf16(o[a++]);d[t]={start:n,end:i,length:i-n}}return{index:l,captureIndices:d}}}function xm(e){if(ym)return ym;return ym=async function(){_m=await pm(async t=>{let n=e;var i;return n=await n,"function"==typeof n&&(n=await n(t)),"function"==typeof n&&(n=await n(t)),"function"==typeof n.instantiator?n=await n.instantiator(t):!function(e){return"function"==typeof e.default}(n)?(function(e){return void 0!==e.data}(n)&&(n=n.data),!function(e){return"undefined"!=typeof Response&&e instanceof Response}(n)?!function(e){return"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||"undefined"!=typeof Buffer&&Buffer.isBuffer?.(e)||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer||"undefined"!=typeof Uint32Array&&e instanceof Uint32Array}(n)?n instanceof WebAssembly.Module?n=await km(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await km(n.default)(t)):n=await km(n)(t):n="function"==typeof WebAssembly.instantiateStreaming?await(i=n,e=>WebAssembly.instantiateStreaming(i,e))(t):await function(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}(n)(t)):n=await n.default(t),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}(),ym}function km(e){return t=>WebAssembly.instantiate(e,t)}const Sm=lm({langs:oh,themes:lh,engine:()=>async function(e){return e&&await xm(e),{createScanner:e=>new wm(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new vm(e)}}(r.e(4709).then(r.bind(r,4709)))}),{codeToHtml:Cm,codeToHast:Mm,codeToTokens:zm,codeToTokensBase:Tm,codeToTokensWithThemes:Am,getSingletonHighlighter:Pm,getLastGrammarState:Nm}=cm(Sm,{guessEmbeddedLanguages:function(e,t,n){const i=new Set;for(const t of e.matchAll(/lang=["']([\w-]+)["']/g))i.add(t[1]);for(const t of e.matchAll(/(?:```|~~~)([\w-]+)/g))i.add(t[1]);for(const t of e.matchAll(/\\begin\{([\w-]+)\}/g))i.add(t[1]);if(!n)return Array.from(i);const r=n.getBundledLanguages();return Array.from(i).filter(e=>e&&r[e])}}),Om=["id","data-type"],Rm=["data-id","onClick"],Lm=["innerHTML"],Em=["disabled"],Dm=Bn({__name:"cube-code",props:{cube:{}},setup(e){const{root:t}=e.cube,{stats:i}=t,r=Kt(),s=Kt(),o=Kt(),a=Kt();function l(e){if(!e._draglist)return;const t=e._draglist.init();return e.items.length>0&&t<=0?requestAnimationFrame(()=>l(e)):void 0}function c(){const t=e.cube._draglist;if(!t)return;const n=e.cube.get_upstream_sum_scale();t.scale_h=n.sx,t.scale_v=n.sy}function d(){const t=r.value,n=o.value;t&&n&&(e.cube._draglist=new Es.DragList(t,"horizental","data-id","insert"),c(),e.cube._draglist.register_start(c),l(e.cube))}let h;cr(()=>[e.cube.active_tab_id,e.cube.active_tab?.code],()=>{const t=e.cube.active_tab,n=a.value;t&&n&&(n.value=t.code)},{immediate:!0}),cr(()=>[e.cube.code_html],()=>{const t=e.cube.active_tab,n=a.value,i=n?.previousElementSibling;if(!t||!n||!i)return;const r=n.parentElement;yn(()=>{const t=i.nextElementSibling,n=i.firstElementChild;if(t&&n){if(r){const t=n.style.backgroundColor;if(t.startsWith("rgb")){const n=t.replace("rgb","rgba").replace(")",", 0.85)");e.cube.attrs.codebg=n}else e.cube.attrs.codebg=t;e.cube.attrs.caret=n.style.color}n.style.border="none",n.style.outline="none"}})}),ni(()=>{d(),function(){const t=o.value,n=a.value;if(!t)return;n&&(n.value=e.cube.active_tab?.code||"");const i=s.value;if(!i)return;h=new Es.DragDiff(i);let r=e.cube.attrs.width,l=e.cube.attrs.height,c=r,d=l;h.register_down(()=>{r=e.cube.attrs.width,l=e.cube.attrs.height}),h.register_move((e,n)=>{c=Math.round(e+r),d=Math.round(n+l),t.style.width=c+"px",t.style.height=d+"px"}),h.register_up((t,n)=>{if(r===c&&l===d)return;const i=e.cube.courier.get_recorder(),s=Math.round(t+r),o=Math.round(n+l);i.tell(e.cube,Rs.resize(e.cube.id,s,o)),e.cube.history.record(i)}),h.register_cancel(()=>{e.cube.attrs.width=r,e.cube.attrs.height=l})}()}),oi(()=>{h?.off()});const u=vs(()=>({"caret-color":e.cube.attrs.caret}));function p(e){e.stopPropagation()}function f(t){const n=t.previousElementSibling;t.parentElement;if(!n)return;const i=t.value,{id:r,courier:s,history:o}=e.cube,a=e.cube.tabbar_height,l=e.cube.max_height_auto,c=s.get_recorder(),d=nh.update(r,e.cube.active_tab_id,i);c.tell(e.cube,d),yn(()=>{const n=t.scrollHeight+a;console.log("🟡",e.cube.attrs.height,t.scrollHeight,a);const i=Math.min(l,n),s=Rs.set_attr(r,{height:i});c.tell(e.cube,s),o.record(c)})}function m(e){const t=e.currentTarget;t.value;f(t)}function _(e){const{hotkeys:n,clipboard:i,history:r}=t,s=e.key.toLowerCase();if([n.data[T["scope-add"]]].some(t=>n.validate(e,t)))return e.preventDefault();if(t.scope_count_normal>0&&["backspace","delete"].includes(s)){e.preventDefault(),e.stopPropagation();const t=i.delete_scope();return void(t&&r.record(t))}const o=e.currentTarget;if("tab"===s){e.preventDefault(),e.stopPropagation();let t=o.value;const n=o.selectionStart,i=o.selectionEnd;t=t.slice(0,n)+"\t"+t.slice(i),o.value=t,o.selectionStart=n+1,o.selectionEnd=n+1,f(o)}}function g(e){e.preventDefault();const t=e.currentTarget;t.scrollTop=0,t.scrollLeft=0}function b(e,t=50){e.stopPropagation();const n=e.currentTarget;e.deltaY>0?Es.DomAnimation.scroll_element(n,t,"horizental"):Es.DomAnimation.scroll_element(n,-t,"horizental")}function y(e){const t=e.currentTarget,n=t.firstElementChild,i=t.lastElementChild;if(!n||!i)return;const r=e.shiftKey,{scrollLeft:s,scrollTop:o,scrollWidth:a,scrollHeight:l}=t,c=t.getBoundingClientRect();e.deltaY>0?r?s+c.width<a&&(e.preventDefault(),e.stopPropagation(),Es.DomAnimation.scroll_element(t,20,"horizental")):o+c.height<l&&(e.preventDefault(),e.stopPropagation(),Es.DomAnimation.scroll_element(t,20,"vertical")):r?s>0&&(e.preventDefault(),e.stopPropagation(),Es.DomAnimation.scroll_element(t,-20,"horizental")):o>0&&(e.preventDefault(),e.stopPropagation(),Es.DomAnimation.scroll_element(t,-20,"vertical"))}function v(t){Io(t,e.cube)}return(t,l)=>(Nr(),Dr("div",{class:"cube-code",id:t.cube.id,"data-type":Zt(n).code,ref_key:"code",ref:o,style:me(t.cube.css),onPointerdown:p,onBeforeinput:p,onCompositionstart:p,onContextmenu:v},[Fr("div",{class:"code-tabbar",onWheel:b},[Fr("div",{class:"code-tabs-box",ref_key:"tabsbox",ref:r},[(Nr(!0),Dr(Cr,null,_i(t.cube.items,n=>(Nr(),Dr("div",{class:"code-tab","data-id":n.id,key:n.id,onClick:()=>function(t){const{courier:n,history:i}=e.cube,r=n.get_recorder();r.tell(e.cube,nh.change_active(e.cube.id,t.id)),i.record(r)}(n)},[Fr("div",{class:ve(["code-tab-name",{"code-active-tab":n.id===t.cube.active_tab_id}])},Ce(n.name),3)],8,Rm))),128))],512)],32),Fr("div",{class:"code-box",onWheel:y},[Fr("div",{class:"code-box-inner",style:me({background:t.cube.attrs.codebg})},[Fr("span",{class:"code-highlight",onWheel:l[0]||(l[0]=e=>e.preventDefault()),innerHTML:t.cube.code_html},null,40,Lm),Fr("textarea",{disabled:Zt(i).is_read_mode,ref_key:"textarea",ref:a,style:me(u.value),onKeyup:g,onKeydown:_,autocapitalize:"false",autocomplete:"false",autocorrect:"false",spellcheck:"false",onInput:m},null,44,Em)],4)],32),Fr("div",{class:"code-dragger",ref_key:"code_dragger",ref:s},null,512)],44,Om))}}),Im=(0,Uo.A)(Dm,[["__scopeId","data-v-046389ca"]]),Bm={".py":"python",".java":"java",".c":"c",".cpp":"c++",".js":"javascript",".html":"html",".css":"css",".php":"php",".rb":"ruby",".go":"go",".swift":"swift",".kt":"kotlin",".rs":"rust",".ts":"typescript",".sh":"shell",".pl":"perl",".cs":"c#",".sql":"sql",".r":"r",".m":"matlab",".adb":"ada",".ads":"ada",".lua":"lua",".scala":"scala",".dart":"dart",".hs":"haskell",".erl":"erlang",".ex":"elixir",".jl":"julia",".groovy":"groovy",".fs":"f#",".clj":"clojure",".scm":"scheme",".ml":"ocaml",".pas":"pascal",".d":"d",".nim":"nim",".zig":"zig",".v":"v",".coffee":"coffeescript",".litcoffee":"coffeescript",".vue":"vue",".svelte":"svelte",".elm":"elm",".purs":"purescript",".exs":"elixir",".eex":"elixir",".heex":"elixir",".tcl":"tcl",".tk":"tcl",".awk":"awk",".ps1":"powershell",".psm1":"powershell",".psd1":"powershell",".bat":"batch",".cmd":"batch",".json":"json",".xml":"xml",".yaml":"yaml",".yml":"yaml",".toml":"toml",".ini":"ini",".md":"markdown",".markdown":"markdown",".tex":"latex",".sty":"latex",".cls":"latex",".bib":"bibtex",".csv":"csv",".tsv":"tsv",".log":"log"};function jm(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const qm="dracula";class Hm extends ro{_code_html=Kt("");static _langs=[...Object.keys(oh)];static _themes=[...Object.keys(lh)];static get langs(){return[...this._langs]}static get themes(){return[...this._themes]}constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get tabbar_height(){return 36}get max_height_auto(){return 600}get langs(){return[...Hm._langs]}get themes(){return[...Hm._themes]}_draglist;get component(){return Im}get items(){return this.info.tabs}get active_tab_id(){return this.info.active_tab_id}set active_tab_id(e){const t=this.items.find(t=>t.id===e);t&&(this.info.active_tab_id=t.id)}get active_tab(){return this.items.find(e=>e.id===this.active_tab_id)}get code_html(){return this._code_html.value}get info(){return this.data.info}get css(){const e=this.config.data.line_indent,t=this.attrs.indent,n=this.attrs.width,i=this.attrs.height;return{...this.data.css,"margin-left":t>0?t*e+"px":"0px",width:n+"px",height:i+"px"}}get attrs(){return this.data.attrs}init(){this.update_active_code_html()}export(){return this.base_export()}gc(){super.base_gc()}build_child(e){}update_data(e,t){return Hm.update_data(e,t)}update_active_code_html(){if(0===this.items.length)this._code_html.value="";else{const e=this.active_tab;if(!e)return;this.code_to_html(e).then(e=>{this._code_html.value=e})}}code_to_html(e){return Cm(e.code,{lang:e.lang,theme:e.theme,cssVariablePrefix:"--shiki-"})}get meta(){return Hm.meta}create_tab(e,t,n=qm){return{id:Ts.get_id(),name:t,lang:e,code:"",theme:n||qm}}replace_id(e,t={}){return Hm.replace_id(this.root,e,t)}copy_code(){const e=this.active_tab;if(!e)return Cs.tips?.tip_error("当前没有激活的代码块tab");const t=e.code,n=new Blob([t],{type:"text/plain"}),i=new ClipboardItem({[n.type]:n});this.clipboard.set_clipboard_data(i).then(e=>{Cs.tips?.tip_info("复制代码成功👏")})}change_lang(e){const{tabid:t,lang:n}=e,{courier:i,id:r}=this,s=i.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.lang;return o.lang=n,s.add_recover(nh.change_lang(r,t,a)),this.update_active_code_html(),s}change_theme(e){const{tabid:t,theme:n}=e,{courier:i,id:r}=this,s=i.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.theme;return o.theme=n,s.add_recover(nh.change_theme(r,t,a)),this.update_active_code_html(),s}code_update(e){const{tabid:t,code:n}=e,{courier:i,id:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.items.find(e=>e.id===t);if(!o)return;const a=o.code;return o.code=n,s.add_recover(nh.update(r,t,a)),this.update_active_code_html(),s}code_add(e){const{item:t,focus:n}=e,{courier:i,id:r}=this,s=i.get_recorder();return s.add_cmd(e),this.info.tabs.push(t),s.add_recover(nh.remove(r,t.id)),this.update_active_code_html(),n&&s.tell(this,nh.change_active(r,t.id)),yn(()=>{this._draglist?.init()}),s}code_remove(e){const{tabid:t}=e,{courier:n,id:i}=this,r=n.get_recorder();r.add_cmd(e);const s=this.items.find(e=>e.id===t);if(!s)return;const o=this.items.indexOf(s),a=this.items[o-1]||this.items[o+1];return o>=0&&this.items.splice(o,1),r.add_recover(nh.add(i,s)),a&&(this.active_tab_id=a.id),this.update_active_code_html(),yn(()=>{this._draglist?.init()}),r}code_rename(e){const{tabid:t,filename:n}=e,{courier:i,id:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.items.find(e=>e.id===t);if(!o)return;const a=o.name;return o.name=n,s.add_recover(nh.rename(r,t,a)),s}change_active(e){const{tabid:t}=e,{courier:n,id:i}=this,r=n.get_recorder(),s=this.items.find(e=>e.id===t);if(!s)return s;const o=this.active_tab_id;return this.active_tab_id=t,r.add_recover(nh.change_active(i,o)),this.update_active_code_html(),r}on_cursor_in_tail(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new Os(t),o=(this.meta,this.dom?.querySelector("textarea"));return o?.focus(),s}on_cursor_in_head(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new Os(t),o=(this.meta,this.dom?.querySelector("textarea"));return o?.focus(),s}static get meta(){return{cubename:"代码块",type:n.code,block:!0,version:1,show:!0}}static get_default(){return{id:Ts.get_id(),type:n.code,info:{tabs:[],active_tab_id:""},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static get_default_by_string(e="typescript",t=""){const i={name:`code${this.get_format_from_lang(e)}`,id:Ts.get_id(),code:t,lang:e,theme:"andromeeda"};return{id:Ts.get_id(),type:n.code,info:{tabs:[i],active_tab_id:i.id},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,t}static get_format_from_lang(e){for(let t in Bm)if(Bm[t]===e)return t;return""}static get_lang_from_format(e){return Bm[e]}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}jm([Fs(g.change_lang)],Hm.prototype,"change_lang",null),jm([Fs(g.change_theme)],Hm.prototype,"change_theme",null),jm([Fs(g.code_update)],Hm.prototype,"code_update",null),jm([Fs(g.code_add)],Hm.prototype,"code_add",null),jm([Fs(g.code_remove)],Hm.prototype,"code_remove",null),jm([Fs(g.code_rename)],Hm.prototype,"code_rename",null),jm([Fs(g.change_active)],Hm.prototype,"change_active",null),jm([Fs(o.cursor_in_tail)],Hm.prototype,"on_cursor_in_tail",null),jm([Fs(o.cursor_in_head)],Hm.prototype,"on_cursor_in_head",null);const Fm=["id","data-type","innerHTML"],$m=Bn({__name:"cube-fomula",props:{cube:{}},setup(e){const{stats:t,event:i}=e.cube.root;function r(){i.emit_show_cube_editor(e.cube)}const s=vs(()=>{let t={...e.cube.css};return e.cube.attrs.block&&(t.display="block",t["text-align"]="center"),t});return(e,t)=>(Nr(),Dr("span",{class:"cube-fomula",onClick:r,id:e.cube.id,"data-type":Zt(n).fomula,style:me(s.value),innerHTML:e.cube.mathml},null,12,Fm))}}),Gm=(0,Uo.A)($m,[["__scopeId","data-v-b85f3e3c"]]);class Vm{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Vm(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Um{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Um(t,Vm.range(this,e))}}class Wm{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,i,r="KaTeX parse error: "+e,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;n=s.start,i=s.end,n===o.length?r+=" at end of input: ":r+=" at position "+(n+1)+": ";var a=o.slice(n,i).replace(/[^]/g,"$&̲");r+=(n>15?"…"+o.slice(n-15,n):o.slice(0,n))+a+(i+15<o.length?o.slice(i,i+15)+"…":o.slice(i))}var l=new Error(r);return l.name="ParseError",l.__proto__=Wm.prototype,l.position=n,null!=n&&null!=i&&(l.length=i-n),l.rawMessage=e,l}}Wm.prototype.__proto__=Error.prototype;var Ym=/([A-Z])/g,Xm={"&":"&",">":">","<":"<",'"':""","'":"'"},Km=/[&><"']/g;var Jm=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},Qm={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(Km,e=>Xm[e])},hyphenate:function(e){return e.replace(Ym,"-$1").toLowerCase()},getBaseElem:Jm,isCharacterBox:function(e){var t=Jm(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},Zm={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function e_(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class t_{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Zm)if(Zm.hasOwnProperty(t)){var n=Zm[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:e_(n)}}reportNonstrict(e,t,n){var i=this.strict;if("function"==typeof i&&(i=i(e,t,n)),i&&"ignore"!==i){if(!0===i||"error"===i)throw new Wm("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===i?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var i=this.strict;if("function"==typeof i)try{i=i(e,t,n)}catch(e){i="error"}return!(!i||"ignore"===i)&&(!0===i||"error"===i||("warn"===i?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if(e.url&&!e.protocol){var t=Qm.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class n_{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return i_[r_[this.id]]}sub(){return i_[s_[this.id]]}fracNum(){return i_[o_[this.id]]}fracDen(){return i_[a_[this.id]]}cramp(){return i_[l_[this.id]]}text(){return i_[c_[this.id]]}isTight(){return this.size>=2}}var i_=[new n_(0,0,!1),new n_(1,0,!0),new n_(2,1,!1),new n_(3,1,!0),new n_(4,2,!1),new n_(5,2,!0),new n_(6,3,!1),new n_(7,3,!0)],r_=[4,5,4,5,6,7,6,7],s_=[5,5,5,5,7,7,7,7],o_=[2,3,4,5,6,7,6,7],a_=[3,3,5,5,7,7,7,7],l_=[1,1,3,3,5,5,7,7],c_=[0,1,2,3,2,3,2,3],d_={DISPLAY:i_[0],TEXT:i_[2],SCRIPT:i_[4],SCRIPTSCRIPT:i_[6]},h_=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var u_=[];function p_(e){for(var t=0;t<u_.length;t+=2)if(e>=u_[t]&&e<=u_[t+1])return!0;return!1}h_.forEach(e=>e.blocks.forEach(e=>u_.push(...e)));var f_=80,m_={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class __{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Qm.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>e.toText()).join("")}}var g_={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},b_={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},y_={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function v_(e,t,n){if(!g_[t])throw new Error("Font metrics not found for font: "+t+".");var i=e.charCodeAt(0),r=g_[t][i];if(!r&&e[0]in y_&&(i=y_[e[0]].charCodeAt(0),r=g_[t][i]),r||"text"!==n||p_(i)&&(r=g_[t][77]),r)return{depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]}}var w_={};var x_=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],k_=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],S_=function(e,t){return t.size<2?e:x_[e-1][t.size-1]};class C_{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||C_.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=k_[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new C_(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:S_(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:k_[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=S_(C_.BASESIZE,e);return this.size===t&&this.textSize===C_.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==C_.BASESIZE?["sizing","reset-size"+this.size,"size"+C_.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!w_[t=e>=5?0:e>=3?1:2]){var n=w_[t]={cssEmPerMu:b_.quad[t]/18};for(var i in b_)b_.hasOwnProperty(i)&&(n[i]=b_[i][t])}return w_[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}C_.BASESIZE=6;var M_={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},z_={ex:!0,em:!0,mu:!0},T_=function(e){return"string"!=typeof e&&(e=e.unit),e in M_||e in z_||"ex"===e},A_=function(e,t){var n;if(e.unit in M_)n=M_[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var i;if(i=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=i.fontMetrics().xHeight;else{if("em"!==e.unit)throw new Wm("Invalid unit: '"+e.unit+"'");n=i.fontMetrics().quad}i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},P_=function(e){return+e.toFixed(4)+"em"},N_=function(e){return e.filter(e=>e).join(" ")},O_=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},R_=function(e){var t=document.createElement(e);for(var n in t.className=N_(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},L_=/[\s"'>/=\x00-\x1f]/,E_=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Qm.escape(N_(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Qm.hyphenate(i)+":"+this.style[i]+";");for(var r in n&&(t+=' style="'+Qm.escape(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(r)){if(L_.test(r))throw new Wm("Invalid attribute name '"+r+"'");t+=" "+r+'="'+Qm.escape(this.attributes[r])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+="</"+e+">"};class D_{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,O_.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Qm.contains(this.classes,e)}toNode(){return R_.call(this,"span")}toMarkup(){return E_.call(this,"span")}}class I_{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,O_.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Qm.contains(this.classes,e)}toNode(){return R_.call(this,"a")}toMarkup(){return E_.call(this,"a")}}class B_{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Qm.contains(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+Qm.escape(this.src)+'" alt="'+Qm.escape(this.alt)+'"',t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=Qm.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Qm.escape(t)+'"'),e+="'/>"}}var j_={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class q_{constructor(e,t,n,i,r,s,o,a){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=r||0,this.width=s||0,this.classes=o||[],this.style=a||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<h_.length;t++)for(var n=h_[t],i=0;i<n.blocks.length;i++){var r=n.blocks[i];if(e>=r[0]&&e<=r[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=j_[this.text])}hasClass(e){return Qm.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=P_(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=N_(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Qm.escape(N_(this.classes)),t+='"');var n="";for(var i in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(i)&&(n+=Qm.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+Qm.escape(n)+'"');var r=Qm.escape(this.text);return e?(t+=">",t+=r,t+="</span>"):r}}class H_{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+Qm.escape(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class F_{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",m_[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+Qm.escape(this.alternate)+'"/>':'<path d="'+Qm.escape(m_[this.pathName])+'"/>'}}class $_{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+Qm.escape(this.attributes[t])+'"');return e+="/>"}}function G_(e){if(e instanceof q_)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var V_={bin:1,close:1,inner:1,open:1,punct:1,rel:1},U_={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},W_={math:{},text:{}};function Y_(e,t,n,i,r,s){W_[e][r]={font:t,group:n,replace:i},s&&i&&(W_[e][i]=W_[e][r])}var X_="math",K_="text",J_="main",Q_="ams",Z_="accent-token",eg="bin",tg="close",ng="inner",ig="mathord",rg="op-token",sg="open",og="punct",ag="rel",lg="spacing",cg="textord";Y_(X_,J_,ag,"≡","\\equiv",!0),Y_(X_,J_,ag,"≺","\\prec",!0),Y_(X_,J_,ag,"≻","\\succ",!0),Y_(X_,J_,ag,"∼","\\sim",!0),Y_(X_,J_,ag,"⊥","\\perp"),Y_(X_,J_,ag,"⪯","\\preceq",!0),Y_(X_,J_,ag,"⪰","\\succeq",!0),Y_(X_,J_,ag,"≃","\\simeq",!0),Y_(X_,J_,ag,"∣","\\mid",!0),Y_(X_,J_,ag,"≪","\\ll",!0),Y_(X_,J_,ag,"≫","\\gg",!0),Y_(X_,J_,ag,"≍","\\asymp",!0),Y_(X_,J_,ag,"∥","\\parallel"),Y_(X_,J_,ag,"⋈","\\bowtie",!0),Y_(X_,J_,ag,"⌣","\\smile",!0),Y_(X_,J_,ag,"⊑","\\sqsubseteq",!0),Y_(X_,J_,ag,"⊒","\\sqsupseteq",!0),Y_(X_,J_,ag,"≐","\\doteq",!0),Y_(X_,J_,ag,"⌢","\\frown",!0),Y_(X_,J_,ag,"∋","\\ni",!0),Y_(X_,J_,ag,"∝","\\propto",!0),Y_(X_,J_,ag,"⊢","\\vdash",!0),Y_(X_,J_,ag,"⊣","\\dashv",!0),Y_(X_,J_,ag,"∋","\\owns"),Y_(X_,J_,og,".","\\ldotp"),Y_(X_,J_,og,"⋅","\\cdotp"),Y_(X_,J_,cg,"#","\\#"),Y_(K_,J_,cg,"#","\\#"),Y_(X_,J_,cg,"&","\\&"),Y_(K_,J_,cg,"&","\\&"),Y_(X_,J_,cg,"ℵ","\\aleph",!0),Y_(X_,J_,cg,"∀","\\forall",!0),Y_(X_,J_,cg,"ℏ","\\hbar",!0),Y_(X_,J_,cg,"∃","\\exists",!0),Y_(X_,J_,cg,"∇","\\nabla",!0),Y_(X_,J_,cg,"♭","\\flat",!0),Y_(X_,J_,cg,"ℓ","\\ell",!0),Y_(X_,J_,cg,"♮","\\natural",!0),Y_(X_,J_,cg,"♣","\\clubsuit",!0),Y_(X_,J_,cg,"℘","\\wp",!0),Y_(X_,J_,cg,"♯","\\sharp",!0),Y_(X_,J_,cg,"♢","\\diamondsuit",!0),Y_(X_,J_,cg,"ℜ","\\Re",!0),Y_(X_,J_,cg,"♡","\\heartsuit",!0),Y_(X_,J_,cg,"ℑ","\\Im",!0),Y_(X_,J_,cg,"♠","\\spadesuit",!0),Y_(X_,J_,cg,"§","\\S",!0),Y_(K_,J_,cg,"§","\\S"),Y_(X_,J_,cg,"¶","\\P",!0),Y_(K_,J_,cg,"¶","\\P"),Y_(X_,J_,cg,"†","\\dag"),Y_(K_,J_,cg,"†","\\dag"),Y_(K_,J_,cg,"†","\\textdagger"),Y_(X_,J_,cg,"‡","\\ddag"),Y_(K_,J_,cg,"‡","\\ddag"),Y_(K_,J_,cg,"‡","\\textdaggerdbl"),Y_(X_,J_,tg,"⎱","\\rmoustache",!0),Y_(X_,J_,sg,"⎰","\\lmoustache",!0),Y_(X_,J_,tg,"⟯","\\rgroup",!0),Y_(X_,J_,sg,"⟮","\\lgroup",!0),Y_(X_,J_,eg,"∓","\\mp",!0),Y_(X_,J_,eg,"⊖","\\ominus",!0),Y_(X_,J_,eg,"⊎","\\uplus",!0),Y_(X_,J_,eg,"⊓","\\sqcap",!0),Y_(X_,J_,eg,"∗","\\ast"),Y_(X_,J_,eg,"⊔","\\sqcup",!0),Y_(X_,J_,eg,"◯","\\bigcirc",!0),Y_(X_,J_,eg,"∙","\\bullet",!0),Y_(X_,J_,eg,"‡","\\ddagger"),Y_(X_,J_,eg,"≀","\\wr",!0),Y_(X_,J_,eg,"⨿","\\amalg"),Y_(X_,J_,eg,"&","\\And"),Y_(X_,J_,ag,"⟵","\\longleftarrow",!0),Y_(X_,J_,ag,"⇐","\\Leftarrow",!0),Y_(X_,J_,ag,"⟸","\\Longleftarrow",!0),Y_(X_,J_,ag,"⟶","\\longrightarrow",!0),Y_(X_,J_,ag,"⇒","\\Rightarrow",!0),Y_(X_,J_,ag,"⟹","\\Longrightarrow",!0),Y_(X_,J_,ag,"↔","\\leftrightarrow",!0),Y_(X_,J_,ag,"⟷","\\longleftrightarrow",!0),Y_(X_,J_,ag,"⇔","\\Leftrightarrow",!0),Y_(X_,J_,ag,"⟺","\\Longleftrightarrow",!0),Y_(X_,J_,ag,"↦","\\mapsto",!0),Y_(X_,J_,ag,"⟼","\\longmapsto",!0),Y_(X_,J_,ag,"↗","\\nearrow",!0),Y_(X_,J_,ag,"↩","\\hookleftarrow",!0),Y_(X_,J_,ag,"↪","\\hookrightarrow",!0),Y_(X_,J_,ag,"↘","\\searrow",!0),Y_(X_,J_,ag,"↼","\\leftharpoonup",!0),Y_(X_,J_,ag,"⇀","\\rightharpoonup",!0),Y_(X_,J_,ag,"↙","\\swarrow",!0),Y_(X_,J_,ag,"↽","\\leftharpoondown",!0),Y_(X_,J_,ag,"⇁","\\rightharpoondown",!0),Y_(X_,J_,ag,"↖","\\nwarrow",!0),Y_(X_,J_,ag,"⇌","\\rightleftharpoons",!0),Y_(X_,Q_,ag,"≮","\\nless",!0),Y_(X_,Q_,ag,"","\\@nleqslant"),Y_(X_,Q_,ag,"","\\@nleqq"),Y_(X_,Q_,ag,"⪇","\\lneq",!0),Y_(X_,Q_,ag,"≨","\\lneqq",!0),Y_(X_,Q_,ag,"","\\@lvertneqq"),Y_(X_,Q_,ag,"⋦","\\lnsim",!0),Y_(X_,Q_,ag,"⪉","\\lnapprox",!0),Y_(X_,Q_,ag,"⊀","\\nprec",!0),Y_(X_,Q_,ag,"⋠","\\npreceq",!0),Y_(X_,Q_,ag,"⋨","\\precnsim",!0),Y_(X_,Q_,ag,"⪹","\\precnapprox",!0),Y_(X_,Q_,ag,"≁","\\nsim",!0),Y_(X_,Q_,ag,"","\\@nshortmid"),Y_(X_,Q_,ag,"∤","\\nmid",!0),Y_(X_,Q_,ag,"⊬","\\nvdash",!0),Y_(X_,Q_,ag,"⊭","\\nvDash",!0),Y_(X_,Q_,ag,"⋪","\\ntriangleleft"),Y_(X_,Q_,ag,"⋬","\\ntrianglelefteq",!0),Y_(X_,Q_,ag,"⊊","\\subsetneq",!0),Y_(X_,Q_,ag,"","\\@varsubsetneq"),Y_(X_,Q_,ag,"⫋","\\subsetneqq",!0),Y_(X_,Q_,ag,"","\\@varsubsetneqq"),Y_(X_,Q_,ag,"≯","\\ngtr",!0),Y_(X_,Q_,ag,"","\\@ngeqslant"),Y_(X_,Q_,ag,"","\\@ngeqq"),Y_(X_,Q_,ag,"⪈","\\gneq",!0),Y_(X_,Q_,ag,"≩","\\gneqq",!0),Y_(X_,Q_,ag,"","\\@gvertneqq"),Y_(X_,Q_,ag,"⋧","\\gnsim",!0),Y_(X_,Q_,ag,"⪊","\\gnapprox",!0),Y_(X_,Q_,ag,"⊁","\\nsucc",!0),Y_(X_,Q_,ag,"⋡","\\nsucceq",!0),Y_(X_,Q_,ag,"⋩","\\succnsim",!0),Y_(X_,Q_,ag,"⪺","\\succnapprox",!0),Y_(X_,Q_,ag,"≆","\\ncong",!0),Y_(X_,Q_,ag,"","\\@nshortparallel"),Y_(X_,Q_,ag,"∦","\\nparallel",!0),Y_(X_,Q_,ag,"⊯","\\nVDash",!0),Y_(X_,Q_,ag,"⋫","\\ntriangleright"),Y_(X_,Q_,ag,"⋭","\\ntrianglerighteq",!0),Y_(X_,Q_,ag,"","\\@nsupseteqq"),Y_(X_,Q_,ag,"⊋","\\supsetneq",!0),Y_(X_,Q_,ag,"","\\@varsupsetneq"),Y_(X_,Q_,ag,"⫌","\\supsetneqq",!0),Y_(X_,Q_,ag,"","\\@varsupsetneqq"),Y_(X_,Q_,ag,"⊮","\\nVdash",!0),Y_(X_,Q_,ag,"⪵","\\precneqq",!0),Y_(X_,Q_,ag,"⪶","\\succneqq",!0),Y_(X_,Q_,ag,"","\\@nsubseteqq"),Y_(X_,Q_,eg,"⊴","\\unlhd"),Y_(X_,Q_,eg,"⊵","\\unrhd"),Y_(X_,Q_,ag,"↚","\\nleftarrow",!0),Y_(X_,Q_,ag,"↛","\\nrightarrow",!0),Y_(X_,Q_,ag,"⇍","\\nLeftarrow",!0),Y_(X_,Q_,ag,"⇏","\\nRightarrow",!0),Y_(X_,Q_,ag,"↮","\\nleftrightarrow",!0),Y_(X_,Q_,ag,"⇎","\\nLeftrightarrow",!0),Y_(X_,Q_,ag,"△","\\vartriangle"),Y_(X_,Q_,cg,"ℏ","\\hslash"),Y_(X_,Q_,cg,"▽","\\triangledown"),Y_(X_,Q_,cg,"◊","\\lozenge"),Y_(X_,Q_,cg,"Ⓢ","\\circledS"),Y_(X_,Q_,cg,"®","\\circledR"),Y_(K_,Q_,cg,"®","\\circledR"),Y_(X_,Q_,cg,"∡","\\measuredangle",!0),Y_(X_,Q_,cg,"∄","\\nexists"),Y_(X_,Q_,cg,"℧","\\mho"),Y_(X_,Q_,cg,"Ⅎ","\\Finv",!0),Y_(X_,Q_,cg,"⅁","\\Game",!0),Y_(X_,Q_,cg,"‵","\\backprime"),Y_(X_,Q_,cg,"▲","\\blacktriangle"),Y_(X_,Q_,cg,"▼","\\blacktriangledown"),Y_(X_,Q_,cg,"■","\\blacksquare"),Y_(X_,Q_,cg,"⧫","\\blacklozenge"),Y_(X_,Q_,cg,"★","\\bigstar"),Y_(X_,Q_,cg,"∢","\\sphericalangle",!0),Y_(X_,Q_,cg,"∁","\\complement",!0),Y_(X_,Q_,cg,"ð","\\eth",!0),Y_(K_,J_,cg,"ð","ð"),Y_(X_,Q_,cg,"╱","\\diagup"),Y_(X_,Q_,cg,"╲","\\diagdown"),Y_(X_,Q_,cg,"□","\\square"),Y_(X_,Q_,cg,"□","\\Box"),Y_(X_,Q_,cg,"◊","\\Diamond"),Y_(X_,Q_,cg,"¥","\\yen",!0),Y_(K_,Q_,cg,"¥","\\yen",!0),Y_(X_,Q_,cg,"✓","\\checkmark",!0),Y_(K_,Q_,cg,"✓","\\checkmark"),Y_(X_,Q_,cg,"ℶ","\\beth",!0),Y_(X_,Q_,cg,"ℸ","\\daleth",!0),Y_(X_,Q_,cg,"ℷ","\\gimel",!0),Y_(X_,Q_,cg,"ϝ","\\digamma",!0),Y_(X_,Q_,cg,"ϰ","\\varkappa"),Y_(X_,Q_,sg,"┌","\\@ulcorner",!0),Y_(X_,Q_,tg,"┐","\\@urcorner",!0),Y_(X_,Q_,sg,"└","\\@llcorner",!0),Y_(X_,Q_,tg,"┘","\\@lrcorner",!0),Y_(X_,Q_,ag,"≦","\\leqq",!0),Y_(X_,Q_,ag,"⩽","\\leqslant",!0),Y_(X_,Q_,ag,"⪕","\\eqslantless",!0),Y_(X_,Q_,ag,"≲","\\lesssim",!0),Y_(X_,Q_,ag,"⪅","\\lessapprox",!0),Y_(X_,Q_,ag,"≊","\\approxeq",!0),Y_(X_,Q_,eg,"⋖","\\lessdot"),Y_(X_,Q_,ag,"⋘","\\lll",!0),Y_(X_,Q_,ag,"≶","\\lessgtr",!0),Y_(X_,Q_,ag,"⋚","\\lesseqgtr",!0),Y_(X_,Q_,ag,"⪋","\\lesseqqgtr",!0),Y_(X_,Q_,ag,"≑","\\doteqdot"),Y_(X_,Q_,ag,"≓","\\risingdotseq",!0),Y_(X_,Q_,ag,"≒","\\fallingdotseq",!0),Y_(X_,Q_,ag,"∽","\\backsim",!0),Y_(X_,Q_,ag,"⋍","\\backsimeq",!0),Y_(X_,Q_,ag,"⫅","\\subseteqq",!0),Y_(X_,Q_,ag,"⋐","\\Subset",!0),Y_(X_,Q_,ag,"⊏","\\sqsubset",!0),Y_(X_,Q_,ag,"≼","\\preccurlyeq",!0),Y_(X_,Q_,ag,"⋞","\\curlyeqprec",!0),Y_(X_,Q_,ag,"≾","\\precsim",!0),Y_(X_,Q_,ag,"⪷","\\precapprox",!0),Y_(X_,Q_,ag,"⊲","\\vartriangleleft"),Y_(X_,Q_,ag,"⊴","\\trianglelefteq"),Y_(X_,Q_,ag,"⊨","\\vDash",!0),Y_(X_,Q_,ag,"⊪","\\Vvdash",!0),Y_(X_,Q_,ag,"⌣","\\smallsmile"),Y_(X_,Q_,ag,"⌢","\\smallfrown"),Y_(X_,Q_,ag,"≏","\\bumpeq",!0),Y_(X_,Q_,ag,"≎","\\Bumpeq",!0),Y_(X_,Q_,ag,"≧","\\geqq",!0),Y_(X_,Q_,ag,"⩾","\\geqslant",!0),Y_(X_,Q_,ag,"⪖","\\eqslantgtr",!0),Y_(X_,Q_,ag,"≳","\\gtrsim",!0),Y_(X_,Q_,ag,"⪆","\\gtrapprox",!0),Y_(X_,Q_,eg,"⋗","\\gtrdot"),Y_(X_,Q_,ag,"⋙","\\ggg",!0),Y_(X_,Q_,ag,"≷","\\gtrless",!0),Y_(X_,Q_,ag,"⋛","\\gtreqless",!0),Y_(X_,Q_,ag,"⪌","\\gtreqqless",!0),Y_(X_,Q_,ag,"≖","\\eqcirc",!0),Y_(X_,Q_,ag,"≗","\\circeq",!0),Y_(X_,Q_,ag,"≜","\\triangleq",!0),Y_(X_,Q_,ag,"∼","\\thicksim"),Y_(X_,Q_,ag,"≈","\\thickapprox"),Y_(X_,Q_,ag,"⫆","\\supseteqq",!0),Y_(X_,Q_,ag,"⋑","\\Supset",!0),Y_(X_,Q_,ag,"⊐","\\sqsupset",!0),Y_(X_,Q_,ag,"≽","\\succcurlyeq",!0),Y_(X_,Q_,ag,"⋟","\\curlyeqsucc",!0),Y_(X_,Q_,ag,"≿","\\succsim",!0),Y_(X_,Q_,ag,"⪸","\\succapprox",!0),Y_(X_,Q_,ag,"⊳","\\vartriangleright"),Y_(X_,Q_,ag,"⊵","\\trianglerighteq"),Y_(X_,Q_,ag,"⊩","\\Vdash",!0),Y_(X_,Q_,ag,"∣","\\shortmid"),Y_(X_,Q_,ag,"∥","\\shortparallel"),Y_(X_,Q_,ag,"≬","\\between",!0),Y_(X_,Q_,ag,"⋔","\\pitchfork",!0),Y_(X_,Q_,ag,"∝","\\varpropto"),Y_(X_,Q_,ag,"◀","\\blacktriangleleft"),Y_(X_,Q_,ag,"∴","\\therefore",!0),Y_(X_,Q_,ag,"∍","\\backepsilon"),Y_(X_,Q_,ag,"▶","\\blacktriangleright"),Y_(X_,Q_,ag,"∵","\\because",!0),Y_(X_,Q_,ag,"⋘","\\llless"),Y_(X_,Q_,ag,"⋙","\\gggtr"),Y_(X_,Q_,eg,"⊲","\\lhd"),Y_(X_,Q_,eg,"⊳","\\rhd"),Y_(X_,Q_,ag,"≂","\\eqsim",!0),Y_(X_,J_,ag,"⋈","\\Join"),Y_(X_,Q_,ag,"≑","\\Doteq",!0),Y_(X_,Q_,eg,"∔","\\dotplus",!0),Y_(X_,Q_,eg,"∖","\\smallsetminus"),Y_(X_,Q_,eg,"⋒","\\Cap",!0),Y_(X_,Q_,eg,"⋓","\\Cup",!0),Y_(X_,Q_,eg,"⩞","\\doublebarwedge",!0),Y_(X_,Q_,eg,"⊟","\\boxminus",!0),Y_(X_,Q_,eg,"⊞","\\boxplus",!0),Y_(X_,Q_,eg,"⋇","\\divideontimes",!0),Y_(X_,Q_,eg,"⋉","\\ltimes",!0),Y_(X_,Q_,eg,"⋊","\\rtimes",!0),Y_(X_,Q_,eg,"⋋","\\leftthreetimes",!0),Y_(X_,Q_,eg,"⋌","\\rightthreetimes",!0),Y_(X_,Q_,eg,"⋏","\\curlywedge",!0),Y_(X_,Q_,eg,"⋎","\\curlyvee",!0),Y_(X_,Q_,eg,"⊝","\\circleddash",!0),Y_(X_,Q_,eg,"⊛","\\circledast",!0),Y_(X_,Q_,eg,"⋅","\\centerdot"),Y_(X_,Q_,eg,"⊺","\\intercal",!0),Y_(X_,Q_,eg,"⋒","\\doublecap"),Y_(X_,Q_,eg,"⋓","\\doublecup"),Y_(X_,Q_,eg,"⊠","\\boxtimes",!0),Y_(X_,Q_,ag,"⇢","\\dashrightarrow",!0),Y_(X_,Q_,ag,"⇠","\\dashleftarrow",!0),Y_(X_,Q_,ag,"⇇","\\leftleftarrows",!0),Y_(X_,Q_,ag,"⇆","\\leftrightarrows",!0),Y_(X_,Q_,ag,"⇚","\\Lleftarrow",!0),Y_(X_,Q_,ag,"↞","\\twoheadleftarrow",!0),Y_(X_,Q_,ag,"↢","\\leftarrowtail",!0),Y_(X_,Q_,ag,"↫","\\looparrowleft",!0),Y_(X_,Q_,ag,"⇋","\\leftrightharpoons",!0),Y_(X_,Q_,ag,"↶","\\curvearrowleft",!0),Y_(X_,Q_,ag,"↺","\\circlearrowleft",!0),Y_(X_,Q_,ag,"↰","\\Lsh",!0),Y_(X_,Q_,ag,"⇈","\\upuparrows",!0),Y_(X_,Q_,ag,"↿","\\upharpoonleft",!0),Y_(X_,Q_,ag,"⇃","\\downharpoonleft",!0),Y_(X_,J_,ag,"⊶","\\origof",!0),Y_(X_,J_,ag,"⊷","\\imageof",!0),Y_(X_,Q_,ag,"⊸","\\multimap",!0),Y_(X_,Q_,ag,"↭","\\leftrightsquigarrow",!0),Y_(X_,Q_,ag,"⇉","\\rightrightarrows",!0),Y_(X_,Q_,ag,"⇄","\\rightleftarrows",!0),Y_(X_,Q_,ag,"↠","\\twoheadrightarrow",!0),Y_(X_,Q_,ag,"↣","\\rightarrowtail",!0),Y_(X_,Q_,ag,"↬","\\looparrowright",!0),Y_(X_,Q_,ag,"↷","\\curvearrowright",!0),Y_(X_,Q_,ag,"↻","\\circlearrowright",!0),Y_(X_,Q_,ag,"↱","\\Rsh",!0),Y_(X_,Q_,ag,"⇊","\\downdownarrows",!0),Y_(X_,Q_,ag,"↾","\\upharpoonright",!0),Y_(X_,Q_,ag,"⇂","\\downharpoonright",!0),Y_(X_,Q_,ag,"⇝","\\rightsquigarrow",!0),Y_(X_,Q_,ag,"⇝","\\leadsto"),Y_(X_,Q_,ag,"⇛","\\Rrightarrow",!0),Y_(X_,Q_,ag,"↾","\\restriction"),Y_(X_,J_,cg,"‘","`"),Y_(X_,J_,cg,"$","\\$"),Y_(K_,J_,cg,"$","\\$"),Y_(K_,J_,cg,"$","\\textdollar"),Y_(X_,J_,cg,"%","\\%"),Y_(K_,J_,cg,"%","\\%"),Y_(X_,J_,cg,"_","\\_"),Y_(K_,J_,cg,"_","\\_"),Y_(K_,J_,cg,"_","\\textunderscore"),Y_(X_,J_,cg,"∠","\\angle",!0),Y_(X_,J_,cg,"∞","\\infty",!0),Y_(X_,J_,cg,"′","\\prime"),Y_(X_,J_,cg,"△","\\triangle"),Y_(X_,J_,cg,"Γ","\\Gamma",!0),Y_(X_,J_,cg,"Δ","\\Delta",!0),Y_(X_,J_,cg,"Θ","\\Theta",!0),Y_(X_,J_,cg,"Λ","\\Lambda",!0),Y_(X_,J_,cg,"Ξ","\\Xi",!0),Y_(X_,J_,cg,"Π","\\Pi",!0),Y_(X_,J_,cg,"Σ","\\Sigma",!0),Y_(X_,J_,cg,"Υ","\\Upsilon",!0),Y_(X_,J_,cg,"Φ","\\Phi",!0),Y_(X_,J_,cg,"Ψ","\\Psi",!0),Y_(X_,J_,cg,"Ω","\\Omega",!0),Y_(X_,J_,cg,"A","Α"),Y_(X_,J_,cg,"B","Β"),Y_(X_,J_,cg,"E","Ε"),Y_(X_,J_,cg,"Z","Ζ"),Y_(X_,J_,cg,"H","Η"),Y_(X_,J_,cg,"I","Ι"),Y_(X_,J_,cg,"K","Κ"),Y_(X_,J_,cg,"M","Μ"),Y_(X_,J_,cg,"N","Ν"),Y_(X_,J_,cg,"O","Ο"),Y_(X_,J_,cg,"P","Ρ"),Y_(X_,J_,cg,"T","Τ"),Y_(X_,J_,cg,"X","Χ"),Y_(X_,J_,cg,"¬","\\neg",!0),Y_(X_,J_,cg,"¬","\\lnot"),Y_(X_,J_,cg,"⊤","\\top"),Y_(X_,J_,cg,"⊥","\\bot"),Y_(X_,J_,cg,"∅","\\emptyset"),Y_(X_,Q_,cg,"∅","\\varnothing"),Y_(X_,J_,ig,"α","\\alpha",!0),Y_(X_,J_,ig,"β","\\beta",!0),Y_(X_,J_,ig,"γ","\\gamma",!0),Y_(X_,J_,ig,"δ","\\delta",!0),Y_(X_,J_,ig,"ϵ","\\epsilon",!0),Y_(X_,J_,ig,"ζ","\\zeta",!0),Y_(X_,J_,ig,"η","\\eta",!0),Y_(X_,J_,ig,"θ","\\theta",!0),Y_(X_,J_,ig,"ι","\\iota",!0),Y_(X_,J_,ig,"κ","\\kappa",!0),Y_(X_,J_,ig,"λ","\\lambda",!0),Y_(X_,J_,ig,"μ","\\mu",!0),Y_(X_,J_,ig,"ν","\\nu",!0),Y_(X_,J_,ig,"ξ","\\xi",!0),Y_(X_,J_,ig,"ο","\\omicron",!0),Y_(X_,J_,ig,"π","\\pi",!0),Y_(X_,J_,ig,"ρ","\\rho",!0),Y_(X_,J_,ig,"σ","\\sigma",!0),Y_(X_,J_,ig,"τ","\\tau",!0),Y_(X_,J_,ig,"υ","\\upsilon",!0),Y_(X_,J_,ig,"ϕ","\\phi",!0),Y_(X_,J_,ig,"χ","\\chi",!0),Y_(X_,J_,ig,"ψ","\\psi",!0),Y_(X_,J_,ig,"ω","\\omega",!0),Y_(X_,J_,ig,"ε","\\varepsilon",!0),Y_(X_,J_,ig,"ϑ","\\vartheta",!0),Y_(X_,J_,ig,"ϖ","\\varpi",!0),Y_(X_,J_,ig,"ϱ","\\varrho",!0),Y_(X_,J_,ig,"ς","\\varsigma",!0),Y_(X_,J_,ig,"φ","\\varphi",!0),Y_(X_,J_,eg,"∗","*",!0),Y_(X_,J_,eg,"+","+"),Y_(X_,J_,eg,"−","-",!0),Y_(X_,J_,eg,"⋅","\\cdot",!0),Y_(X_,J_,eg,"∘","\\circ",!0),Y_(X_,J_,eg,"÷","\\div",!0),Y_(X_,J_,eg,"±","\\pm",!0),Y_(X_,J_,eg,"×","\\times",!0),Y_(X_,J_,eg,"∩","\\cap",!0),Y_(X_,J_,eg,"∪","\\cup",!0),Y_(X_,J_,eg,"∖","\\setminus",!0),Y_(X_,J_,eg,"∧","\\land"),Y_(X_,J_,eg,"∨","\\lor"),Y_(X_,J_,eg,"∧","\\wedge",!0),Y_(X_,J_,eg,"∨","\\vee",!0),Y_(X_,J_,cg,"√","\\surd"),Y_(X_,J_,sg,"⟨","\\langle",!0),Y_(X_,J_,sg,"∣","\\lvert"),Y_(X_,J_,sg,"∥","\\lVert"),Y_(X_,J_,tg,"?","?"),Y_(X_,J_,tg,"!","!"),Y_(X_,J_,tg,"⟩","\\rangle",!0),Y_(X_,J_,tg,"∣","\\rvert"),Y_(X_,J_,tg,"∥","\\rVert"),Y_(X_,J_,ag,"=","="),Y_(X_,J_,ag,":",":"),Y_(X_,J_,ag,"≈","\\approx",!0),Y_(X_,J_,ag,"≅","\\cong",!0),Y_(X_,J_,ag,"≥","\\ge"),Y_(X_,J_,ag,"≥","\\geq",!0),Y_(X_,J_,ag,"←","\\gets"),Y_(X_,J_,ag,">","\\gt",!0),Y_(X_,J_,ag,"∈","\\in",!0),Y_(X_,J_,ag,"","\\@not"),Y_(X_,J_,ag,"⊂","\\subset",!0),Y_(X_,J_,ag,"⊃","\\supset",!0),Y_(X_,J_,ag,"⊆","\\subseteq",!0),Y_(X_,J_,ag,"⊇","\\supseteq",!0),Y_(X_,Q_,ag,"⊈","\\nsubseteq",!0),Y_(X_,Q_,ag,"⊉","\\nsupseteq",!0),Y_(X_,J_,ag,"⊨","\\models"),Y_(X_,J_,ag,"←","\\leftarrow",!0),Y_(X_,J_,ag,"≤","\\le"),Y_(X_,J_,ag,"≤","\\leq",!0),Y_(X_,J_,ag,"<","\\lt",!0),Y_(X_,J_,ag,"→","\\rightarrow",!0),Y_(X_,J_,ag,"→","\\to"),Y_(X_,Q_,ag,"≱","\\ngeq",!0),Y_(X_,Q_,ag,"≰","\\nleq",!0),Y_(X_,J_,lg," ","\\ "),Y_(X_,J_,lg," ","\\space"),Y_(X_,J_,lg," ","\\nobreakspace"),Y_(K_,J_,lg," ","\\ "),Y_(K_,J_,lg," "," "),Y_(K_,J_,lg," ","\\space"),Y_(K_,J_,lg," ","\\nobreakspace"),Y_(X_,J_,lg,null,"\\nobreak"),Y_(X_,J_,lg,null,"\\allowbreak"),Y_(X_,J_,og,",",","),Y_(X_,J_,og,";",";"),Y_(X_,Q_,eg,"⊼","\\barwedge",!0),Y_(X_,Q_,eg,"⊻","\\veebar",!0),Y_(X_,J_,eg,"⊙","\\odot",!0),Y_(X_,J_,eg,"⊕","\\oplus",!0),Y_(X_,J_,eg,"⊗","\\otimes",!0),Y_(X_,J_,cg,"∂","\\partial",!0),Y_(X_,J_,eg,"⊘","\\oslash",!0),Y_(X_,Q_,eg,"⊚","\\circledcirc",!0),Y_(X_,Q_,eg,"⊡","\\boxdot",!0),Y_(X_,J_,eg,"△","\\bigtriangleup"),Y_(X_,J_,eg,"▽","\\bigtriangledown"),Y_(X_,J_,eg,"†","\\dagger"),Y_(X_,J_,eg,"⋄","\\diamond"),Y_(X_,J_,eg,"⋆","\\star"),Y_(X_,J_,eg,"◃","\\triangleleft"),Y_(X_,J_,eg,"▹","\\triangleright"),Y_(X_,J_,sg,"{","\\{"),Y_(K_,J_,cg,"{","\\{"),Y_(K_,J_,cg,"{","\\textbraceleft"),Y_(X_,J_,tg,"}","\\}"),Y_(K_,J_,cg,"}","\\}"),Y_(K_,J_,cg,"}","\\textbraceright"),Y_(X_,J_,sg,"{","\\lbrace"),Y_(X_,J_,tg,"}","\\rbrace"),Y_(X_,J_,sg,"[","\\lbrack",!0),Y_(K_,J_,cg,"[","\\lbrack",!0),Y_(X_,J_,tg,"]","\\rbrack",!0),Y_(K_,J_,cg,"]","\\rbrack",!0),Y_(X_,J_,sg,"(","\\lparen",!0),Y_(X_,J_,tg,")","\\rparen",!0),Y_(K_,J_,cg,"<","\\textless",!0),Y_(K_,J_,cg,">","\\textgreater",!0),Y_(X_,J_,sg,"⌊","\\lfloor",!0),Y_(X_,J_,tg,"⌋","\\rfloor",!0),Y_(X_,J_,sg,"⌈","\\lceil",!0),Y_(X_,J_,tg,"⌉","\\rceil",!0),Y_(X_,J_,cg,"\\","\\backslash"),Y_(X_,J_,cg,"∣","|"),Y_(X_,J_,cg,"∣","\\vert"),Y_(K_,J_,cg,"|","\\textbar",!0),Y_(X_,J_,cg,"∥","\\|"),Y_(X_,J_,cg,"∥","\\Vert"),Y_(K_,J_,cg,"∥","\\textbardbl"),Y_(K_,J_,cg,"~","\\textasciitilde"),Y_(K_,J_,cg,"\\","\\textbackslash"),Y_(K_,J_,cg,"^","\\textasciicircum"),Y_(X_,J_,ag,"↑","\\uparrow",!0),Y_(X_,J_,ag,"⇑","\\Uparrow",!0),Y_(X_,J_,ag,"↓","\\downarrow",!0),Y_(X_,J_,ag,"⇓","\\Downarrow",!0),Y_(X_,J_,ag,"↕","\\updownarrow",!0),Y_(X_,J_,ag,"⇕","\\Updownarrow",!0),Y_(X_,J_,rg,"∐","\\coprod"),Y_(X_,J_,rg,"⋁","\\bigvee"),Y_(X_,J_,rg,"⋀","\\bigwedge"),Y_(X_,J_,rg,"⨄","\\biguplus"),Y_(X_,J_,rg,"⋂","\\bigcap"),Y_(X_,J_,rg,"⋃","\\bigcup"),Y_(X_,J_,rg,"∫","\\int"),Y_(X_,J_,rg,"∫","\\intop"),Y_(X_,J_,rg,"∬","\\iint"),Y_(X_,J_,rg,"∭","\\iiint"),Y_(X_,J_,rg,"∏","\\prod"),Y_(X_,J_,rg,"∑","\\sum"),Y_(X_,J_,rg,"⨂","\\bigotimes"),Y_(X_,J_,rg,"⨁","\\bigoplus"),Y_(X_,J_,rg,"⨀","\\bigodot"),Y_(X_,J_,rg,"∮","\\oint"),Y_(X_,J_,rg,"∯","\\oiint"),Y_(X_,J_,rg,"∰","\\oiiint"),Y_(X_,J_,rg,"⨆","\\bigsqcup"),Y_(X_,J_,rg,"∫","\\smallint"),Y_(K_,J_,ng,"…","\\textellipsis"),Y_(X_,J_,ng,"…","\\mathellipsis"),Y_(K_,J_,ng,"…","\\ldots",!0),Y_(X_,J_,ng,"…","\\ldots",!0),Y_(X_,J_,ng,"⋯","\\@cdots",!0),Y_(X_,J_,ng,"⋱","\\ddots",!0),Y_(X_,J_,cg,"⋮","\\varvdots"),Y_(K_,J_,cg,"⋮","\\varvdots"),Y_(X_,J_,Z_,"ˊ","\\acute"),Y_(X_,J_,Z_,"ˋ","\\grave"),Y_(X_,J_,Z_,"¨","\\ddot"),Y_(X_,J_,Z_,"~","\\tilde"),Y_(X_,J_,Z_,"ˉ","\\bar"),Y_(X_,J_,Z_,"˘","\\breve"),Y_(X_,J_,Z_,"ˇ","\\check"),Y_(X_,J_,Z_,"^","\\hat"),Y_(X_,J_,Z_,"⃗","\\vec"),Y_(X_,J_,Z_,"˙","\\dot"),Y_(X_,J_,Z_,"˚","\\mathring"),Y_(X_,J_,ig,"","\\@imath"),Y_(X_,J_,ig,"","\\@jmath"),Y_(X_,J_,cg,"ı","ı"),Y_(X_,J_,cg,"ȷ","ȷ"),Y_(K_,J_,cg,"ı","\\i",!0),Y_(K_,J_,cg,"ȷ","\\j",!0),Y_(K_,J_,cg,"ß","\\ss",!0),Y_(K_,J_,cg,"æ","\\ae",!0),Y_(K_,J_,cg,"œ","\\oe",!0),Y_(K_,J_,cg,"ø","\\o",!0),Y_(K_,J_,cg,"Æ","\\AE",!0),Y_(K_,J_,cg,"Œ","\\OE",!0),Y_(K_,J_,cg,"Ø","\\O",!0),Y_(K_,J_,Z_,"ˊ","\\'"),Y_(K_,J_,Z_,"ˋ","\\`"),Y_(K_,J_,Z_,"ˆ","\\^"),Y_(K_,J_,Z_,"˜","\\~"),Y_(K_,J_,Z_,"ˉ","\\="),Y_(K_,J_,Z_,"˘","\\u"),Y_(K_,J_,Z_,"˙","\\."),Y_(K_,J_,Z_,"¸","\\c"),Y_(K_,J_,Z_,"˚","\\r"),Y_(K_,J_,Z_,"ˇ","\\v"),Y_(K_,J_,Z_,"¨",'\\"'),Y_(K_,J_,Z_,"˝","\\H"),Y_(K_,J_,Z_,"◯","\\textcircled");var dg={"--":!0,"---":!0,"``":!0,"''":!0};Y_(K_,J_,cg,"–","--",!0),Y_(K_,J_,cg,"–","\\textendash"),Y_(K_,J_,cg,"—","---",!0),Y_(K_,J_,cg,"—","\\textemdash"),Y_(K_,J_,cg,"‘","`",!0),Y_(K_,J_,cg,"‘","\\textquoteleft"),Y_(K_,J_,cg,"’","'",!0),Y_(K_,J_,cg,"’","\\textquoteright"),Y_(K_,J_,cg,"“","``",!0),Y_(K_,J_,cg,"“","\\textquotedblleft"),Y_(K_,J_,cg,"”","''",!0),Y_(K_,J_,cg,"”","\\textquotedblright"),Y_(X_,J_,cg,"°","\\degree",!0),Y_(K_,J_,cg,"°","\\degree"),Y_(K_,J_,cg,"°","\\textdegree",!0),Y_(X_,J_,cg,"£","\\pounds"),Y_(X_,J_,cg,"£","\\mathsterling",!0),Y_(K_,J_,cg,"£","\\pounds"),Y_(K_,J_,cg,"£","\\textsterling",!0),Y_(X_,Q_,cg,"✠","\\maltese"),Y_(K_,Q_,cg,"✠","\\maltese");for(var hg='0123456789/@."',ug=0;ug<14;ug++){var pg=hg.charAt(ug);Y_(X_,J_,cg,pg,pg)}for(var fg='0123456789!@*()-=+";:?/.,',mg=0;mg<25;mg++){var _g=fg.charAt(mg);Y_(K_,J_,cg,_g,_g)}for(var gg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",bg=0;bg<52;bg++){var yg=gg.charAt(bg);Y_(X_,J_,ig,yg,yg),Y_(K_,J_,cg,yg,yg)}Y_(X_,Q_,cg,"C","ℂ"),Y_(K_,Q_,cg,"C","ℂ"),Y_(X_,Q_,cg,"H","ℍ"),Y_(K_,Q_,cg,"H","ℍ"),Y_(X_,Q_,cg,"N","ℕ"),Y_(K_,Q_,cg,"N","ℕ"),Y_(X_,Q_,cg,"P","ℙ"),Y_(K_,Q_,cg,"P","ℙ"),Y_(X_,Q_,cg,"Q","ℚ"),Y_(K_,Q_,cg,"Q","ℚ"),Y_(X_,Q_,cg,"R","ℝ"),Y_(K_,Q_,cg,"R","ℝ"),Y_(X_,Q_,cg,"Z","ℤ"),Y_(K_,Q_,cg,"Z","ℤ"),Y_(X_,J_,ig,"h","ℎ"),Y_(K_,J_,ig,"h","ℎ");for(var vg="",wg=0;wg<52;wg++){var xg=gg.charAt(wg);Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56320+wg)),Y_(K_,J_,cg,xg,vg),Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56372+wg)),Y_(K_,J_,cg,xg,vg),Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56424+wg)),Y_(K_,J_,cg,xg,vg),Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56580+wg)),Y_(K_,J_,cg,xg,vg),Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56684+wg)),Y_(K_,J_,cg,xg,vg),Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56736+wg)),Y_(K_,J_,cg,xg,vg),Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56788+wg)),Y_(K_,J_,cg,xg,vg),Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56840+wg)),Y_(K_,J_,cg,xg,vg),Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56944+wg)),Y_(K_,J_,cg,xg,vg),wg<26&&(Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56632+wg)),Y_(K_,J_,cg,xg,vg),Y_(X_,J_,ig,xg,vg=String.fromCharCode(55349,56476+wg)),Y_(K_,J_,cg,xg,vg))}Y_(X_,J_,ig,"k",vg=String.fromCharCode(55349,56668)),Y_(K_,J_,cg,"k",vg);for(var kg=0;kg<10;kg++){var Sg=kg.toString();Y_(X_,J_,ig,Sg,vg=String.fromCharCode(55349,57294+kg)),Y_(K_,J_,cg,Sg,vg),Y_(X_,J_,ig,Sg,vg=String.fromCharCode(55349,57314+kg)),Y_(K_,J_,cg,Sg,vg),Y_(X_,J_,ig,Sg,vg=String.fromCharCode(55349,57324+kg)),Y_(K_,J_,cg,Sg,vg),Y_(X_,J_,ig,Sg,vg=String.fromCharCode(55349,57334+kg)),Y_(K_,J_,cg,Sg,vg)}for(var Cg="ÐÞþ",Mg=0;Mg<3;Mg++){var zg=Cg.charAt(Mg);Y_(X_,J_,ig,zg,zg),Y_(K_,J_,cg,zg,zg)}var Tg=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Ag=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Pg=function(e,t,n){return W_[n][e]&&W_[n][e].replace&&(e=W_[n][e].replace),{value:e,metrics:v_(e,t,n)}},Ng=function(e,t,n,i,r){var s,o=Pg(e,t,n),a=o.metrics;if(e=o.value,a){var l=a.italic;("text"===n||i&&"mathit"===i.font)&&(l=0),s=new q_(e,a.height,a.depth,l,a.skew,a.width,r)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),s=new q_(e,0,0,0,0,0,r);if(i){s.maxFontSize=i.sizeMultiplier,i.style.isTight()&&s.classes.push("mtight");var c=i.getColor();c&&(s.style.color=c)}return s},Og=(e,t)=>{if(N_(e.classes)!==N_(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var i in e.style)if(e.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;for(var r in t.style)if(t.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;return!0},Rg=function(e){for(var t=0,n=0,i=0,r=0;r<e.children.length;r++){var s=e.children[r];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},Lg=function(e,t,n,i){var r=new D_(e,t,n,i);return Rg(r),r},Eg=(e,t,n,i)=>new D_(e,t,n,i),Dg=function(e){var t=new __(e);return Rg(t),t},Ig=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}return i+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},Bg={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},jg={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},qg={fontMap:Bg,makeSymbol:Ng,mathsym:function(e,t,n,i){return void 0===i&&(i=[]),"boldsymbol"===n.font&&Pg(e,"Main-Bold",t).metrics?Ng(e,"Main-Bold",t,n,i.concat(["mathbf"])):"\\"===e||"main"===W_[t][e].font?Ng(e,"Main-Regular",t,n,i):Ng(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},makeSpan:Lg,makeSvgSpan:Eg,makeLineSpan:function(e,t,n){var i=Lg([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=P_(i.height),i.maxFontSize=1,i},makeAnchor:function(e,t,n,i){var r=new I_(e,t,n,i);return Rg(r),r},makeFragment:Dg,wrapFragment:function(e,t){return e instanceof __?Lg([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:i}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,r=i,s=1;s<t.length;s++){var o=-t[s].shift-r-t[s].elem.depth,a=o-(t[s-1].elem.height+t[s-1].elem.depth);r+=o,n.push({type:"kern",size:a}),n.push(t[s])}return{children:n,depth:i}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var h=e.children[d];c-="kern"===h.type?h.size:h.elem.height+h.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var u=e.children[0];if("elem"!==u.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-u.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-u.elem.depth}}return{children:e.children,depth:l}}(e),r=0,s=0;s<n.length;s++){var o=n[s];if("elem"===o.type){var a=o.elem;r=Math.max(r,a.maxFontSize,a.height)}}r+=2;var l=Lg(["pstrut"],[]);l.style.height=P_(r);for(var c=[],d=i,h=i,u=i,p=0;p<n.length;p++){var f=n[p];if("kern"===f.type)u+=f.size;else{var m=f.elem,_=f.wrapperClasses||[],g=f.wrapperStyle||{},b=Lg(_,[l,m],void 0,g);b.style.top=P_(-r-u-m.depth),f.marginLeft&&(b.style.marginLeft=f.marginLeft),f.marginRight&&(b.style.marginRight=f.marginRight),c.push(b),u+=m.height+m.depth}d=Math.min(d,u),h=Math.max(h,u)}var y,v=Lg(["vlist"],c);if(v.style.height=P_(h),d<0){var w=Lg([],[]),x=Lg(["vlist"],[w]);x.style.height=P_(-d);var k=Lg(["vlist-s"],[new q_("")]);y=[Lg(["vlist-r"],[v,k]),Lg(["vlist-r"],[x])]}else y=[Lg(["vlist-r"],[v])];var S=Lg(["vlist-t"],y);return 2===y.length&&S.classes.push("vlist-t2"),S.height=h,S.depth=-d,S},makeOrd:function(e,t,n){var i=e.mode,r=e.text,s=["mord"],o="math"===i||"text"===i&&t.font,a=o?t.font:t.fontFamily,l="",c="";if(55349===r.charCodeAt(0)&&([l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,i="math"===t?0:1;if(119808<=n&&n<120484){var r=Math.floor((n-119808)/26);return[Tg[r][2],Tg[r][i]]}if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return[Ag[s][2],Ag[s][i]]}if(120485===n||120486===n)return[Tg[0][2],Tg[0][i]];if(120486<n&&n<120782)return["",""];throw new Wm("Unsupported character: "+e)}(r,i)),l.length>0)return Ng(r,l,i,t,s.concat(c));if(a){var d,h;if("boldsymbol"===a){var u=function(e,t,n,i,r){return"textord"!==r&&Pg(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(r,i,0,0,n);d=u.fontName,h=[u.fontClass]}else o?(d=Bg[a].fontName,h=[a]):(d=Ig(a,t.fontWeight,t.fontShape),h=[a,t.fontWeight,t.fontShape]);if(Pg(r,d,i).metrics)return Ng(r,d,i,t,s.concat(h));if(dg.hasOwnProperty(r)&&"Typewriter"===d.slice(0,10)){for(var p=[],f=0;f<r.length;f++)p.push(Ng(r[f],d,i,t,s.concat(h)));return Dg(p)}}if("mathord"===n)return Ng(r,"Math-Italic",i,t,s.concat(["mathnormal"]));if("textord"===n){var m=W_[i][r]&&W_[i][r].font;if("ams"===m){var _=Ig("amsrm",t.fontWeight,t.fontShape);return Ng(r,_,i,t,s.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==m&&m){var g=Ig(m,t.fontWeight,t.fontShape);return Ng(r,g,i,t,s.concat(g,t.fontWeight,t.fontShape))}var b=Ig("textrm",t.fontWeight,t.fontShape);return Ng(r,b,i,t,s.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=Lg(["mspace"],[],t),i=A_(e,t);return n.style.marginRight=P_(i),n},staticSvg:function(e,t){var[n,i,r]=jg[e],s=new F_(n),o=new H_([s],{width:P_(i),height:P_(r),style:"width:"+P_(i),viewBox:"0 0 "+1e3*i+" "+1e3*r,preserveAspectRatio:"xMinYMin"}),a=Eg(["overlay"],[o],t);return a.height=r,a.style.height=P_(r),a.style.width=P_(i),a},svgData:jg,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],i=e[t+1];n instanceof q_&&i instanceof q_&&Og(n,i)&&(n.text+=i.text,n.height=Math.max(n.height,i.height),n.depth=Math.max(n.depth,i.depth),n.italic=i.italic,e.splice(t+1,1),t--)}return e}},Hg={number:3,unit:"mu"},Fg={number:4,unit:"mu"},$g={number:5,unit:"mu"},Gg={mord:{mop:Hg,mbin:Fg,mrel:$g,minner:Hg},mop:{mord:Hg,mop:Hg,mrel:$g,minner:Hg},mbin:{mord:Fg,mop:Fg,mopen:Fg,minner:Fg},mrel:{mord:$g,mop:$g,mopen:$g,minner:$g},mopen:{},mclose:{mop:Hg,mbin:Fg,mrel:$g,minner:Hg},mpunct:{mord:Hg,mop:Hg,mrel:$g,mopen:Hg,mclose:Hg,mpunct:Hg,minner:Hg},minner:{mord:Hg,mop:Hg,mbin:Fg,mrel:$g,mopen:Hg,mpunct:Hg,minner:Hg}},Vg={mord:{mop:Hg},mop:{mord:Hg,mop:Hg},mbin:{},mrel:{},mopen:{},mclose:{mop:Hg},mpunct:{},minner:{mop:Hg}},Ug={},Wg={},Yg={};function Xg(e){for(var{type:t,names:n,props:i,handler:r,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:i.numArgs,argTypes:i.argTypes,allowedInArgument:!!i.allowedInArgument,allowedInText:!!i.allowedInText,allowedInMath:void 0===i.allowedInMath||i.allowedInMath,numOptionalArgs:i.numOptionalArgs||0,infix:!!i.infix,primitive:!!i.primitive,handler:r},l=0;l<n.length;++l)Ug[n[l]]=a;t&&(s&&(Wg[t]=s),o&&(Yg[t]=o))}function Kg(e){var{type:t,htmlBuilder:n,mathmlBuilder:i}=e;Xg({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:i})}var Jg=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},Qg=function(e){return"ordgroup"===e.type?e.body:[e]},Zg=qg.makeSpan,eb=["leftmost","mbin","mopen","mrel","mop","mpunct"],tb=["rightmost","mrel","mclose","mpunct"],nb={display:d_.DISPLAY,text:d_.TEXT,script:d_.SCRIPT,scriptscript:d_.SCRIPTSCRIPT},ib={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},rb=function(e,t,n,i){void 0===i&&(i=[null,null]);for(var r=[],s=0;s<e.length;s++){var o=db(e[s],t);if(o instanceof __){var a=o.children;r.push(...a)}else r.push(o)}if(qg.tryCombineChars(r),!n)return r;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(nb[c.style]))}var d=Zg([i[0]||"leftmost"],[],t),h=Zg([i[1]||"rightmost"],[],t),u="root"===n;return sb(r,(e,t)=>{var n=t.classes[0],i=e.classes[0];"mbin"===n&&Qm.contains(tb,i)?t.classes[0]="mord":"mbin"===i&&Qm.contains(eb,n)&&(e.classes[0]="mord")},{node:d},h,u),sb(r,(e,t)=>{var n=lb(t),i=lb(e),r=n&&i?e.hasClass("mtight")?Vg[n][i]:Gg[n][i]:null;if(r)return qg.makeGlue(r,l)},{node:d},h,u),r},sb=function e(t,n,i,r,s){r&&t.push(r);for(var o=0;o<t.length;o++){var a=t[o],l=ob(a);if(l)e(l.children,n,i,null,s);else{var c=!a.hasClass("mspace");if(c){var d=n(a,i.node);d&&(i.insertAfter?i.insertAfter(d):(t.unshift(d),o++))}c?i.node=a:s&&a.hasClass("newline")&&(i.node=Zg(["leftmost"])),i.insertAfter=(e=>n=>{t.splice(e+1,0,n),o++})(o)}}r&&t.pop()},ob=function(e){return e instanceof __||e instanceof I_||e instanceof D_&&e.hasClass("enclosing")?e:null},ab=function e(t,n){var i=ob(t);if(i){var r=i.children;if(r.length){if("right"===n)return e(r[r.length-1],"right");if("left"===n)return e(r[0],"left")}}return t},lb=function(e,t){return e?(t&&(e=ab(e,t)),ib[e.classes[0]]||null):null},cb=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Zg(t.concat(n))},db=function(e,t,n){if(!e)return Zg();if(Wg[e.type]){var i=Wg[e.type](e,t);if(n&&t.size!==n.size){i=Zg(t.sizingClasses(n),[i],t);var r=t.sizeMultiplier/n.sizeMultiplier;i.height*=r,i.depth*=r}return i}throw new Wm("Got group of unknown type: '"+e.type+"'")};function hb(e,t){var n=Zg(["base"],e,t),i=Zg(["strut"]);return i.style.height=P_(n.height+n.depth),n.depth&&(i.style.verticalAlign=P_(-n.depth)),n.children.unshift(i),n}function ub(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var i,r=rb(e,t,"root");2===r.length&&r[1].hasClass("tag")&&(i=r.pop());for(var s,o=[],a=[],l=0;l<r.length;l++)if(a.push(r[l]),r[l].hasClass("mbin")||r[l].hasClass("mrel")||r[l].hasClass("allowbreak")){for(var c=!1;l<r.length-1&&r[l+1].hasClass("mspace")&&!r[l+1].hasClass("newline");)l++,a.push(r[l]),r[l].hasClass("nobreak")&&(c=!0);c||(o.push(hb(a,t)),a=[])}else r[l].hasClass("newline")&&(a.pop(),a.length>0&&(o.push(hb(a,t)),a=[]),o.push(r[l]));a.length>0&&o.push(hb(a,t)),n?((s=hb(rb(n,t,!0))).classes=["tag"],o.push(s)):i&&o.push(i);var d=Zg(["katex-html"],o);if(d.setAttribute("aria-hidden","true"),s){var h=s.children[0];h.style.height=P_(d.height+d.depth),d.depth&&(h.style.verticalAlign=P_(-d.depth))}return d}function pb(e){return new __(e)}class fb{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=N_(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof mb&&this.children[n+1]instanceof mb){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof mb;)i+=this.children[++n].toText();e.appendChild(new mb(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Qm.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Qm.escape(N_(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class mb{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Qm.escape(this.toText())}toText(){return this.text}}var _b={MathNode:fb,TextNode:mb,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",P_(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+P_(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:pb},gb=function(e,t,n){return!W_[t][e]||!W_[t][e].replace||55349===e.charCodeAt(0)||dg.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=W_[t][e].replace),new _b.TextNode(e)},bb=function(e){return 1===e.length?e[0]:new _b.MathNode("mrow",e)},yb=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var i=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var r=e.text;return Qm.contains(["\\imath","\\jmath"],r)?null:(W_[i][r]&&W_[i][r].replace&&(r=W_[i][r].replace),v_(r,qg.fontMap[n].fontName,i)?qg.fontMap[n].variant:null)};function vb(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof mb&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof mb&&","===n.text}return!1}var wb=function(e,t,n){if(1===e.length){var i=kb(e[0],t);return n&&i instanceof fb&&"mo"===i.type&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var r,s=[],o=0;o<e.length;o++){var a=kb(e[o],t);if(a instanceof fb&&r instanceof fb){if("mtext"===a.type&&"mtext"===r.type&&a.getAttribute("mathvariant")===r.getAttribute("mathvariant")){r.children.push(...a.children);continue}if("mn"===a.type&&"mn"===r.type){r.children.push(...a.children);continue}if(vb(a)&&"mn"===r.type){r.children.push(...a.children);continue}if("mn"===a.type&&vb(r))a.children=[...r.children,...a.children],s.pop();else if(("msup"===a.type||"msub"===a.type)&&a.children.length>=1&&("mn"===r.type||vb(r))){var l=a.children[0];l instanceof fb&&"mn"===l.type&&(l.children=[...r.children,...l.children],s.pop())}else if("mi"===r.type&&1===r.children.length){var c=r.children[0];if(c instanceof mb&&"̸"===c.text&&("mo"===a.type||"mi"===a.type||"mn"===a.type)){var d=a.children[0];d instanceof mb&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(a),r=a}return s},xb=function(e,t,n){return bb(wb(e,t,n))},kb=function(e,t){if(!e)return new _b.MathNode("mrow");if(Yg[e.type])return Yg[e.type](e,t);throw new Wm("Got group of unknown type: '"+e.type+"'")};function Sb(e,t,n,i,r){var s,o=wb(e,n);s=1===o.length&&o[0]instanceof fb&&Qm.contains(["mrow","mtable"],o[0].type)?o[0]:new _b.MathNode("mrow",o);var a=new _b.MathNode("annotation",[new _b.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new _b.MathNode("semantics",[s,a]),c=new _b.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),i&&c.setAttribute("display","block");var d=r?"katex":"katex-mathml";return qg.makeSpan([d],[c])}var Cb=function(e){return new C_({style:e.displayMode?d_.DISPLAY:d_.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Mb=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=qg.makeSpan(n,[e])}return e},zb={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Tb={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Ab=function(e,t,n,i,r){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(s=qg.makeSpan(["stretchy",t],[],r),"fbox"===t){var a=r.color&&r.getColor();a&&(s.style.borderColor=a)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new $_({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new $_({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new H_(l,{width:"100%",height:P_(o)});s=qg.makeSvgSpan([],[c],r)}return s.height=o,s.style.height=P_(o),s},Pb=function(e){var t=new _b.MathNode("mo",[new _b.TextNode(zb[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Nb=function(e,t){var{span:n,minWidth:i,height:r}=function(){var n=4e5,i=e.label.slice(1);if(Qm.contains(["widehat","widecheck","widetilde","utilde"],i)){var r,s,o,a="ordgroup"===(p=e.base).type?p.body.length:1;if(a>5)"widehat"===i||"widecheck"===i?(r=420,n=2364,o=.42,s=i+"4"):(r=312,n=2340,o=.34,s="tilde4");else{var l=[1,1,2,2,3,3][a];"widehat"===i||"widecheck"===i?(n=[0,1062,2364,2364,2364][l],r=[0,239,300,360,420][l],o=[0,.24,.3,.3,.36,.42][l],s=i+l):(n=[0,600,1033,2339,2340][l],r=[0,260,286,306,312][l],o=[0,.26,.286,.3,.306,.34][l],s="tilde"+l)}var c=new F_(s),d=new H_([c],{width:"100%",height:P_(o),viewBox:"0 0 "+n+" "+r,preserveAspectRatio:"none"});return{span:qg.makeSvgSpan([],[d],t),minWidth:0,height:o}}var h,u,p,f=[],m=Tb[i],[_,g,b]=m,y=b/1e3,v=_.length;if(1===v)h=["hide-tail"],u=[m[3]];else if(2===v)h=["halfarrow-left","halfarrow-right"],u=["xMinYMin","xMaxYMin"];else{if(3!==v)throw new Error("Correct katexImagesData or update code here to support\n "+v+" children.");h=["brace-left","brace-center","brace-right"],u=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<v;w++){var x=new F_(_[w]),k=new H_([x],{width:"400em",height:P_(y),viewBox:"0 0 "+n+" "+b,preserveAspectRatio:u[w]+" slice"}),S=qg.makeSvgSpan([h[w]],[k],t);if(1===v)return{span:S,minWidth:g,height:y};S.style.height=P_(y),f.push(S)}return{span:qg.makeSpan(["stretchy"],f,t),minWidth:g,height:y}}();return n.height=r,n.style.height=P_(r),i>0&&(n.style.minWidth=P_(i)),n};function Ob(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Rb(e){var t=Lb(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Lb(e){return e&&("atom"===e.type||U_.hasOwnProperty(e.type))?e:null}var Eb=(e,t)=>{var n,i,r;e&&"supsub"===e.type?(n=(i=Ob(e.base,"accent")).base,e.base=n,r=function(e){if(e instanceof D_)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(db(e,t)),e.base=i):n=(i=Ob(e,"accent")).base;var s=db(n,t.havingCrampedStyle()),o=0;if(i.isShifty&&Qm.isCharacterBox(n)){var a=Qm.getBaseElem(n);o=G_(db(a,t.havingCrampedStyle())).skew}var l,c="\\c"===i.label,d=c?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(i.isStretchy)l=Nb(i,t),l=qg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+P_(2*o)+")",marginLeft:P_(2*o)}:void 0}]},t);else{var h,u;"\\vec"===i.label?(h=qg.staticSvg("vec",t),u=qg.svgData.vec[1]):((h=G_(h=qg.makeOrd({mode:i.mode,text:i.label},t,"textord"))).italic=0,u=h.width,c&&(d+=h.depth)),l=qg.makeSpan(["accent-body"],[h]);var p="\\textcircled"===i.label;p&&(l.classes.push("accent-full"),d=s.height);var f=o;p||(f-=u/2),l.style.left=P_(f),"\\textcircled"===i.label&&(l.style.top=".2em"),l=qg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:l}]},t)}var m=qg.makeSpan(["mord","accent"],[l],t);return r?(r.children[0]=m,r.height=Math.max(m.height,r.height),r.classes[0]="mord",r):m},Db=(e,t)=>{var n=e.isStretchy?Pb(e.label):new _b.MathNode("mo",[gb(e.label,e.mode)]),i=new _b.MathNode("mover",[kb(e.base,t),n]);return i.setAttribute("accent","true"),i},Ib=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Xg({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Jg(t[0]),i=!Ib.test(e.funcName),r=!i||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:i,isShifty:r,base:n}},htmlBuilder:Eb,mathmlBuilder:Db}),Xg({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],i=e.parser.mode;return"math"===i&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),i="text"),{type:"accent",mode:i,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Eb,mathmlBuilder:Db}),Xg({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"accentUnder",mode:n.mode,label:i,base:r}},htmlBuilder:(e,t)=>{var n=db(e.base,t),i=Nb(e,t),r="\\utilde"===e.label?.12:0,s=qg.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:i,wrapperClasses:["svg-align"]},{type:"kern",size:r},{type:"elem",elem:n}]},t);return qg.makeSpan(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{var n=Pb(e.label),i=new _b.MathNode("munder",[kb(e.base,t),n]);return i.setAttribute("accentunder","true"),i}});var Bb=e=>{var t=new _b.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Xg({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:i,funcName:r}=e;return{type:"xArrow",mode:i.mode,label:r,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,i=t.style,r=t.havingStyle(i.sup()),s=qg.wrapFragment(db(e.body,r,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";s.classes.push(o+"-arrow-pad"),e.below&&(r=t.havingStyle(i.sub()),(n=qg.wrapFragment(db(e.below,r,t),t)).classes.push(o+"-arrow-pad"));var a,l=Nb(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;if((s.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=s.depth),n){var h=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;a=qg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:h}]},t)}else a=qg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},t);return a.children[0].children[0].children[1].classes.push("svg-align"),qg.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var n,i=Pb(e.label);if(i.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var r=Bb(kb(e.body,t));if(e.below){var s=Bb(kb(e.below,t));n=new _b.MathNode("munderover",[i,s,r])}else n=new _b.MathNode("mover",[i,r])}else if(e.below){var o=Bb(kb(e.below,t));n=new _b.MathNode("munder",[i,o])}else n=Bb(),n=new _b.MathNode("mover",[i,n]);return n}});var jb=qg.makeSpan;function qb(e,t){var n=rb(e.body,t,!0);return jb([e.mclass],n,t)}function Hb(e,t){var n,i=wb(e.body,t);return"minner"===e.mclass?n=new _b.MathNode("mpadded",i):"mord"===e.mclass?e.isCharacterBox?(n=i[0]).type="mi":n=new _b.MathNode("mi",i):(e.isCharacterBox?(n=i[0]).type="mo":n=new _b.MathNode("mo",i),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Xg({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+i.slice(5),body:Qg(r),isCharacterBox:Qm.isCharacterBox(r)}},htmlBuilder:qb,mathmlBuilder:Hb});var Fb=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};Xg({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Fb(t[0]),body:Qg(t[1]),isCharacterBox:Qm.isCharacterBox(t[1])}}}),Xg({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:i,funcName:r}=e,s=t[1],o=t[0];n="\\stackrel"!==r?Fb(s):"mrel";var a={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==r,body:Qg(s)},l={type:"supsub",mode:o.mode,base:a,sup:"\\underset"===r?null:o,sub:"\\underset"===r?o:null};return{type:"mclass",mode:i.mode,mclass:n,body:[l],isCharacterBox:Qm.isCharacterBox(l)}},htmlBuilder:qb,mathmlBuilder:Hb}),Xg({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Fb(t[0]),body:Qg(t[0])}},htmlBuilder(e,t){var n=rb(e.body,t,!0),i=qg.makeSpan([e.mclass],n,t);return i.style.textShadow="0.02em 0.01em 0.04px",i},mathmlBuilder(e,t){var n=wb(e.body,t),i=new _b.MathNode("mstyle",n);return i.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),i}});var $b={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Gb=()=>({type:"styling",body:[],mode:"math",style:"display"}),Vb=e=>"textord"===e.type&&"@"===e.text,Ub=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function Wb(e,t,n){var i=$b[e];switch(i){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(i,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var r={type:"atom",text:i,mode:"math",family:"rel"},s={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[r],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[s],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}Xg({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e;return{type:"cdlabel",mode:n.mode,side:i.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),i=qg.wrapFragment(db(e.label,n,t),t);return i.classes.push("cd-label-"+e.side),i.style.bottom=P_(.8-i.depth),i.height=0,i.depth=0,i},mathmlBuilder(e,t){var n=new _b.MathNode("mrow",[kb(e.label,t)]);return(n=new _b.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new _b.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Xg({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=qg.wrapFragment(db(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new _b.MathNode("mrow",[kb(e.fragment,t)])}),Xg({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,i=Ob(t[0],"ordgroup").body,r="",s=0;s<i.length;s++){r+=Ob(i[s],"textord").text}var o,a=parseInt(r);if(isNaN(a))throw new Wm("\\@char has non-numeric argument "+r);if(a<0||a>=1114111)throw new Wm("\\@char with invalid code point "+r);return a<=65535?o=String.fromCharCode(a):(a-=65536,o=String.fromCharCode(55296+(a>>10),56320+(1023&a))),{type:"textord",mode:n.mode,text:o}}});var Yb=(e,t)=>{var n=rb(e.body,t.withColor(e.color),!1);return qg.makeFragment(n)},Xb=(e,t)=>{var n=wb(e.body,t.withColor(e.color)),i=new _b.MathNode("mstyle",n);return i.setAttribute("mathcolor",e.color),i};Xg({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,i=Ob(t[0],"color-token").color,r=t[1];return{type:"color",mode:n.mode,color:i,body:Qg(r)}},htmlBuilder:Yb,mathmlBuilder:Xb}),Xg({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:i}=e,r=Ob(t[0],"color-token").color;n.gullet.macros.set("\\current@color",r);var s=n.parseExpression(!0,i);return{type:"color",mode:n.mode,color:r,body:s}},htmlBuilder:Yb,mathmlBuilder:Xb}),Xg({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:i}=e,r="["===i.gullet.future().text?i.parseSizeGroup(!0):null,s=!i.settings.displayMode||!i.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:i.mode,newLine:s,size:r&&Ob(r,"size").value}},htmlBuilder(e,t){var n=qg.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=P_(A_(e.size,t)))),n},mathmlBuilder(e,t){var n=new _b.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",P_(A_(e.size,t)))),n}});var Kb={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Jb=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Wm("Expected a control sequence",e);return t},Qb=(e,t,n,i)=>{var r=e.gullet.macros.get(n.text);null==r&&(n.noexpand=!0,r={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,r,i)};Xg({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var i=t.fetch();if(Kb[i.text])return"\\global"!==n&&"\\\\globallong"!==n||(i.text=Kb[i.text]),Ob(t.parseFunction(),"internal");throw new Wm("Invalid token after macro prefix",i)}}),Xg({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=t.gullet.popToken(),r=i.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(r))throw new Wm("Expected a control sequence",i);for(var s,o=0,a=[[]];"{"!==t.gullet.future().text;)if("#"===(i=t.gullet.popToken()).text){if("{"===t.gullet.future().text){s=t.gullet.future(),a[o].push("{");break}if(i=t.gullet.popToken(),!/^[1-9]$/.test(i.text))throw new Wm('Invalid argument number "'+i.text+'"');if(parseInt(i.text)!==o+1)throw new Wm('Argument number "'+i.text+'" out of order');o++,a.push([])}else{if("EOF"===i.text)throw new Wm("Expected a macro definition");a[o].push(i.text)}var{tokens:l}=t.gullet.consumeArg();return s&&l.unshift(s),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(r,{tokens:l,numArgs:o,delimiters:a},n===Kb[n]),{type:"internal",mode:t.mode}}}),Xg({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=Jb(t.gullet.popToken());t.gullet.consumeSpaces();var r=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return Qb(t,i,r,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Xg({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=Jb(t.gullet.popToken()),r=t.gullet.popToken(),s=t.gullet.popToken();return Qb(t,i,s,"\\\\globalfuture"===n),t.gullet.pushToken(s),t.gullet.pushToken(r),{type:"internal",mode:t.mode}}});var Zb=function(e,t,n){var i=v_(W_.math[e]&&W_.math[e].replace||e,t,n);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return i},ey=function(e,t,n,i){var r=n.havingBaseStyle(t),s=qg.makeSpan(i.concat(r.sizingClasses(n)),[e],n),o=r.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=r.sizeMultiplier,s},ty=function(e,t,n){var i=t.havingBaseStyle(n),r=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=P_(r),e.height-=r,e.depth+=r},ny=function(e,t,n,i,r,s){var o=function(e,t,n,i){return qg.makeSymbol(e,"Size"+t+"-Regular",n,i)}(e,t,r,i),a=ey(qg.makeSpan(["delimsizing","size"+t],[o],i),d_.TEXT,i,s);return n&&ty(a,i,d_.TEXT),a},iy=function(e,t,n){var i;return i="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:qg.makeSpan(["delimsizinginner",i],[qg.makeSpan([],[qg.makeSymbol(e,t,n)])])}},ry=function(e,t,n){var i=g_["Size4-Regular"][e.charCodeAt(0)]?g_["Size4-Regular"][e.charCodeAt(0)][4]:g_["Size1-Regular"][e.charCodeAt(0)][4],r=new F_("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),s=new H_([r],{width:P_(i),height:P_(t),style:"width:"+P_(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=qg.makeSvgSpan([],[s],n);return o.height=t,o.style.height=P_(t),o.style.width=P_(i),{type:"elem",elem:o}},sy={type:"kern",size:-.008},oy=["|","\\lvert","\\rvert","\\vert"],ay=["\\|","\\lVert","\\rVert","\\Vert"],ly=function(e,t,n,i,r,s){var o,a,l,c,d="",h=0;o=l=c=e,a=null;var u="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?o=l="⏐":"\\Downarrow"===e?o=l="‖":"\\updownarrow"===e?(o="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",l="‖",c="\\Downarrow"):Qm.contains(oy,e)?(l="∣",d="vert",h=333):Qm.contains(ay,e)?(l="∥",d="doublevert",h=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",c="⎣",u="Size4-Regular",d="lbrack",h=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",c="⎦",u="Size4-Regular",d="rbrack",h=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",c="⎣",u="Size4-Regular",d="lfloor",h=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=c="⎢",u="Size4-Regular",d="lceil",h=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",c="⎦",u="Size4-Regular",d="rfloor",h=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=c="⎥",u="Size4-Regular",d="rceil",h=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",c="⎝",u="Size4-Regular",d="lparen",h=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",c="⎠",u="Size4-Regular",d="rparen",h=875):"\\{"===e||"\\lbrace"===e?(o="⎧",a="⎨",c="⎩",l="⎪",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",a="⎬",c="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",c="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",c="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",c="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",c="⎩",l="⎪",u="Size4-Regular");var p=Zb(o,u,r),f=p.height+p.depth,m=Zb(l,u,r),_=m.height+m.depth,g=Zb(c,u,r),b=g.height+g.depth,y=0,v=1;if(null!==a){var w=Zb(a,u,r);y=w.height+w.depth,v=2}var x=f+b+y,k=x+Math.max(0,Math.ceil((t-x)/(v*_)))*v*_,S=i.fontMetrics().axisHeight;n&&(S*=i.sizeMultiplier);var C=k/2-S,M=[];if(d.length>0){var z=k-f-b,T=Math.round(1e3*k),A=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*z)),P=new F_(d,A),N=(h/1e3).toFixed(3)+"em",O=(T/1e3).toFixed(3)+"em",R=new H_([P],{width:N,height:O,viewBox:"0 0 "+h+" "+T}),L=qg.makeSvgSpan([],[R],i);L.height=T/1e3,L.style.width=N,L.style.height=O,M.push({type:"elem",elem:L})}else{if(M.push(iy(c,u,r)),M.push(sy),null===a){var E=k-f-b+.016;M.push(ry(l,E,i))}else{var D=(k-f-b-y)/2+.016;M.push(ry(l,D,i)),M.push(sy),M.push(iy(a,u,r)),M.push(sy),M.push(ry(l,D,i))}M.push(sy),M.push(iy(o,u,r))}var I=i.havingBaseStyle(d_.TEXT),B=qg.makeVList({positionType:"bottom",positionData:C,children:M},I);return ey(qg.makeSpan(["delimsizing","mult"],[B],I),d_.TEXT,i,s)},cy=.08,dy=function(e,t,n,i,r){var s=function(e,t,n){t*=1e3;var i="";switch(e){case"sqrtMain":i=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,f_);break;case"sqrtSize1":i=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,f_);break;case"sqrtSize2":i=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,f_);break;case"sqrtSize3":i=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,f_);break;case"sqrtSize4":i=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,f_);break;case"sqrtTall":i=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,f_,n)}return i}(e,i,n),o=new F_(e,s),a=new H_([o],{width:"400em",height:P_(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return qg.makeSvgSpan(["hide-tail"],[a],r)},hy=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],uy=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],py=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],fy=[0,1.2,1.8,2.4,3],my=[{type:"small",style:d_.SCRIPTSCRIPT},{type:"small",style:d_.SCRIPT},{type:"small",style:d_.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],_y=[{type:"small",style:d_.SCRIPTSCRIPT},{type:"small",style:d_.SCRIPT},{type:"small",style:d_.TEXT},{type:"stack"}],gy=[{type:"small",style:d_.SCRIPTSCRIPT},{type:"small",style:d_.SCRIPT},{type:"small",style:d_.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],by=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},yy=function(e,t,n,i){for(var r=Math.min(2,3-i.style.size);r<n.length&&"stack"!==n[r].type;r++){var s=Zb(e,by(n[r]),"math"),o=s.height+s.depth;if("small"===n[r].type&&(o*=i.havingBaseStyle(n[r].style).sizeMultiplier),o>t)return n[r]}return n[n.length-1]},vy=function(e,t,n,i,r,s){var o;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),o=Qm.contains(py,e)?my:Qm.contains(hy,e)?gy:_y;var a=yy(e,t,o,i);return"small"===a.type?function(e,t,n,i,r,s){var o=qg.makeSymbol(e,"Main-Regular",r,i),a=ey(o,t,i,s);return n&&ty(a,i,t),a}(e,a.style,n,i,r,s):"large"===a.type?ny(e,a.size,n,i,r,s):ly(e,t,n,i,r,s)},wy={sqrtImage:function(e,t){var n,i,r=t.havingBaseSizing(),s=yy("\\surd",e*r.sizeMultiplier,gy,r),o=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,d=0;return"small"===s.type?(e<1?o=1:e<1.4&&(o=.7),c=(1+a)/o,(n=dy("sqrtMain",l=(1+a+cy)/o,d=1e3+1e3*a+80,a,t)).style.minWidth="0.853em",i=.833/o):"large"===s.type?(d=1080*fy[s.size],c=(fy[s.size]+a)/o,l=(fy[s.size]+a+cy)/o,(n=dy("sqrtSize"+s.size,l,d,a,t)).style.minWidth="1.02em",i=1/o):(l=e+a+cy,c=e+a,d=Math.floor(1e3*e+a)+80,(n=dy("sqrtTall",l,d,a,t)).style.minWidth="0.742em",i=1.056),n.height=c,n.style.height=P_(l),{span:n,advanceWidth:i,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*o}},sizedDelim:function(e,t,n,i,r){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),Qm.contains(hy,e)||Qm.contains(py,e))return ny(e,t,!1,n,i,r);if(Qm.contains(uy,e))return ly(e,fy[t],!1,n,i,r);throw new Wm("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:fy,customSizedDelim:vy,leftRightDelim:function(e,t,n,i,r,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,a=5/i.fontMetrics().ptPerEm,l=Math.max(t-o,n+o),c=Math.max(l/500*901,2*l-a);return vy(e,c,!0,i,r,s)}},xy={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},ky=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Sy(e,t){var n=Lb(e);if(n&&Qm.contains(ky,n.text))return n;throw new Wm(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Cy(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Xg({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Sy(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:xy[e.funcName].size,mclass:xy[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?qg.makeSpan([e.mclass]):wy.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(gb(e.delim,e.mode));var n=new _b.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var i=P_(wy.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",i),n.setAttribute("maxsize",i),n}}),Xg({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new Wm("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Sy(t[0],e).text,color:n}}}),Xg({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Sy(t[0],e),i=e.parser;++i.leftrightDepth;var r=i.parseExpression(!1);--i.leftrightDepth,i.expect("\\right",!1);var s=Ob(i.parseFunction(),"leftright-right");return{type:"leftright",mode:i.mode,body:r,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{Cy(e);for(var n,i,r=rb(e.body,t,!0,["mopen","mclose"]),s=0,o=0,a=!1,l=0;l<r.length;l++)r[l].isMiddle?a=!0:(s=Math.max(r[l].height,s),o=Math.max(r[l].depth,o));if(s*=t.sizeMultiplier,o*=t.sizeMultiplier,n="."===e.left?cb(t,["mopen"]):wy.leftRightDelim(e.left,s,o,t,e.mode,["mopen"]),r.unshift(n),a)for(var c=1;c<r.length;c++){var d=r[c].isMiddle;d&&(r[c]=wy.leftRightDelim(d.delim,s,o,d.options,e.mode,[]))}if("."===e.right)i=cb(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;i=wy.leftRightDelim(e.right,s,o,h,e.mode,["mclose"])}return r.push(i),qg.makeSpan(["minner"],r,t)},mathmlBuilder:(e,t)=>{Cy(e);var n=wb(e.body,t);if("."!==e.left){var i=new _b.MathNode("mo",[gb(e.left,e.mode)]);i.setAttribute("fence","true"),n.unshift(i)}if("."!==e.right){var r=new _b.MathNode("mo",[gb(e.right,e.mode)]);r.setAttribute("fence","true"),e.rightColor&&r.setAttribute("mathcolor",e.rightColor),n.push(r)}return bb(n)}}),Xg({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Sy(t[0],e);if(!e.parser.leftrightDepth)throw new Wm("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=cb(t,[]);else{n=wy.sizedDelim(e.delim,1,t,e.mode,[]);var i={delim:e.delim,options:t};n.isMiddle=i}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?gb("|","text"):gb(e.delim,e.mode),i=new _b.MathNode("mo",[n]);return i.setAttribute("fence","true"),i.setAttribute("lspace","0.05em"),i.setAttribute("rspace","0.05em"),i}});var My=(e,t)=>{var n,i,r,s=qg.wrapFragment(db(e.body,t),t),o=e.label.slice(1),a=t.sizeMultiplier,l=0,c=Qm.isCharacterBox(e.body);if("sout"===o)(n=qg.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,l=-.5*t.fontMetrics().xHeight;else if("phase"===o){var d=A_({number:.6,unit:"pt"},t),h=A_({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var u=s.height+s.depth+d+h;s.style.paddingLeft=P_(u/2+d);var p=Math.floor(1e3*u*a),f="M400000 "+(i=p)+" H0 L"+i/2+" 0 l65 45 L145 "+(i-80)+" H400000z",m=new H_([new F_("phase",f)],{width:"400em",height:P_(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});(n=qg.makeSvgSpan(["hide-tail"],[m],t)).style.height=P_(u),l=s.depth+d+h}else{/cancel/.test(o)?c||s.classes.push("cancel-pad"):"angl"===o?s.classes.push("anglpad"):s.classes.push("boxpad");var _=0,g=0,b=0;/box/.test(o)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=_=t.fontMetrics().fboxsep+("colorbox"===o?0:b)):"angl"===o?(_=4*(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-s.depth)):g=_=c?.2:0,n=Ab(s,o,_,g,t),/fbox|boxed|fcolorbox/.test(o)?(n.style.borderStyle="solid",n.style.borderWidth=P_(b)):"angl"===o&&.049!==b&&(n.style.borderTopWidth=P_(b),n.style.borderRightWidth=P_(b)),l=s.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=qg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:l},{type:"elem",elem:s,shift:0}]},t);else{var y=/cancel|phase/.test(o)?["svg-align"]:[];r=qg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:n,shift:l,wrapperClasses:y}]},t)}return/cancel/.test(o)&&(r.height=s.height,r.depth=s.depth),/cancel/.test(o)&&!c?qg.makeSpan(["mord","cancel-lap"],[r],t):qg.makeSpan(["mord"],[r],t)},zy=(e,t)=>{var n=0,i=new _b.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[kb(e.body,t)]);switch(e.label){case"\\cancel":i.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":i.setAttribute("notation","downdiagonalstrike");break;case"\\phase":i.setAttribute("notation","phasorangle");break;case"\\sout":i.setAttribute("notation","horizontalstrike");break;case"\\fbox":i.setAttribute("notation","box");break;case"\\angl":i.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,i.setAttribute("width","+"+2*n+"pt"),i.setAttribute("height","+"+2*n+"pt"),i.setAttribute("lspace",n+"pt"),i.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var r=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);i.setAttribute("style","border: "+r+"em solid "+String(e.borderColor))}break;case"\\xcancel":i.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&i.setAttribute("mathbackground",e.backgroundColor),i};Xg({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:i,funcName:r}=e,s=Ob(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:i.mode,label:r,backgroundColor:s,body:o}},htmlBuilder:My,mathmlBuilder:zy}),Xg({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:i,funcName:r}=e,s=Ob(t[0],"color-token").color,o=Ob(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:i.mode,label:r,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:My,mathmlBuilder:zy}),Xg({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),Xg({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"enclose",mode:n.mode,label:i,body:r}},htmlBuilder:My,mathmlBuilder:zy}),Xg({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Ty={};function Ay(e){for(var{type:t,names:n,props:i,handler:r,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:i.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:r},l=0;l<n.length;++l)Ty[n[l]]=a;s&&(Wg[t]=s),o&&(Yg[t]=o)}var Py={};function Ny(e,t){Py[e]=t}function Oy(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var Ry=e=>{if(!e.parser.settings.displayMode)throw new Wm("{"+e.envName+"} can be used only in display mode.")};function Ly(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Ey(e,t,n){var{hskipBeforeAndAfter:i,addJot:r,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:h,leqno:u}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)o=1;else if(!(o=parseFloat(p))||o<0)throw new Wm("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var f=[],m=[f],_=[],g=[],b=null!=l?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function v(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new Um("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(y(),g.push(Oy(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),f.push(w);var x=e.fetch().text;if("&"===x){if(h&&f.length===h){if(c||a)throw new Wm("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){v(),1===f.length&&"styling"===w.type&&0===w.body[0].body.length&&(m.length>1||!d)&&m.pop(),g.length<m.length+1&&g.push([]);break}if("\\\\"!==x)throw new Wm("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),_.push(k?k.value:null),v(),g.push(Oy(e)),f=[],m.push(f),y()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:r,arraystretch:o,body:m,cols:s,rowGaps:_,hskipBeforeAndAfter:i,hLinesBeforeRow:g,colSeparationType:a,tags:b,leqno:u}}function Dy(e){return"d"===e.slice(0,1)?"display":"text"}var Iy=function(e,t){var n,i,r=e.body.length,s=e.hLinesBeforeRow,o=0,a=new Array(r),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,h=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(h=t.havingStyle(d_.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var u="CD"===e.colSeparationType?A_({number:3,unit:"ex"},t):12*d,p=3*d,f=e.arraystretch*u,m=.7*f,_=.3*f,g=0;function b(e){for(var t=0;t<e.length;++t)t>0&&(g+=.25),l.push({pos:g,isDashed:e[t]})}for(b(s[0]),n=0;n<e.body.length;++n){var y=e.body[n],v=m,w=_;o<y.length&&(o=y.length);var x=new Array(y.length);for(i=0;i<y.length;++i){var k=db(y[i],t);w<k.depth&&(w=k.depth),v<k.height&&(v=k.height),x[i]=k}var S=e.rowGaps[n],C=0;S&&(C=A_(S,t))>0&&(w<(C+=_)&&(w=C),C=0),e.addJot&&(w+=p),x.height=v,x.depth=w,g+=v,x.pos=g,g+=w+C,a[n]=x,b(s[n+1])}var M,z,T=g/2+t.fontMetrics().axisHeight,A=e.cols||[],P=[],N=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<r;++n){var O=a[n],R=O.pos-T,L=e.tags[n],E=void 0;(E=!0===L?qg.makeSpan(["eqn-num"],[],t):!1===L?qg.makeSpan([],[],t):qg.makeSpan([],rb(L,t,!0),t)).depth=O.depth,E.height=O.height,N.push({type:"elem",elem:E,shift:R})}for(i=0,z=0;i<o||z<A.length;++i,++z){for(var D=A[z]||{},I=!0;"separator"===D.type;){if(I||((M=qg.makeSpan(["arraycolsep"],[])).style.width=P_(t.fontMetrics().doubleRuleSep),P.push(M)),"|"!==D.separator&&":"!==D.separator)throw new Wm("Invalid separator type: "+D.separator);var B="|"===D.separator?"solid":"dashed",j=qg.makeSpan(["vertical-separator"],[],t);j.style.height=P_(g),j.style.borderRightWidth=P_(c),j.style.borderRightStyle=B,j.style.margin="0 "+P_(-c/2);var q=g-T;q&&(j.style.verticalAlign=P_(-q)),P.push(j),D=A[++z]||{},I=!1}if(!(i>=o)){var H=void 0;(i>0||e.hskipBeforeAndAfter)&&0!==(H=Qm.deflt(D.pregap,h))&&((M=qg.makeSpan(["arraycolsep"],[])).style.width=P_(H),P.push(M));var F=[];for(n=0;n<r;++n){var $=a[n],G=$[i];if(G){var V=$.pos-T;G.depth=$.depth,G.height=$.height,F.push({type:"elem",elem:G,shift:V})}}F=qg.makeVList({positionType:"individualShift",children:F},t),F=qg.makeSpan(["col-align-"+(D.align||"c")],[F]),P.push(F),(i<o-1||e.hskipBeforeAndAfter)&&0!==(H=Qm.deflt(D.postgap,h))&&((M=qg.makeSpan(["arraycolsep"],[])).style.width=P_(H),P.push(M))}}if(a=qg.makeSpan(["mtable"],P),l.length>0){for(var U=qg.makeLineSpan("hline",t,c),W=qg.makeLineSpan("hdashline",t,c),Y=[{type:"elem",elem:a,shift:0}];l.length>0;){var X=l.pop(),K=X.pos-T;X.isDashed?Y.push({type:"elem",elem:W,shift:K}):Y.push({type:"elem",elem:U,shift:K})}a=qg.makeVList({positionType:"individualShift",children:Y},t)}if(0===N.length)return qg.makeSpan(["mord"],[a],t);var J=qg.makeVList({positionType:"individualShift",children:N},t);return J=qg.makeSpan(["tag"],[J],t),qg.makeFragment([a,J])},By={c:"center ",l:"left ",r:"right "},jy=function(e,t){for(var n=[],i=new _b.MathNode("mtd",[],["mtr-glue"]),r=new _b.MathNode("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var o=e.body[s],a=[],l=0;l<o.length;l++)a.push(new _b.MathNode("mtd",[kb(o[l],t)]));e.tags&&e.tags[s]&&(a.unshift(i),a.push(i),e.leqno?a.unshift(r):a.push(r)),n.push(new _b.MathNode("mtr",a))}var c=new _b.MathNode("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",P_(d));var h="",u="";if(e.cols&&e.cols.length>0){var p=e.cols,f="",m=!1,_=0,g=p.length;"separator"===p[0].type&&(h+="top ",_=1),"separator"===p[p.length-1].type&&(h+="bottom ",g-=1);for(var b=_;b<g;b++)"align"===p[b].type?(u+=By[p[b].align],m&&(f+="none "),m=!0):"separator"===p[b].type&&m&&(f+="|"===p[b].separator?"solid ":"dashed ",m=!1);c.setAttribute("columnalign",u.trim()),/[sd]/.test(f)&&c.setAttribute("columnlines",f.trim())}if("align"===e.colSeparationType){for(var y=e.cols||[],v="",w=1;w<y.length;w++)v+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",v.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;h+=k[0].length>0?"left ":"",h+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==h&&(c=new _b.MathNode("menclose",[c])).setAttribute("notation",h.trim()),e.arraystretch&&e.arraystretch<1&&(c=new _b.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},qy=function(e,t){-1===e.envName.indexOf("ed")&&Ry(e);var n,i=[],r=e.envName.indexOf("at")>-1?"alignat":"align",s="split"===e.envName,o=Ey(e.parser,{cols:i,addJot:!0,autoTag:s?void 0:Ly(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",d=0;d<t[0].body.length;d++){c+=Ob(t[0].body[d],"textord").text}n=Number(c),a=2*n}var h=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var i=Ob(e[t],"styling");Ob(i.body[0],"ordgroup").body.unshift(l)}if(h)a<e.length&&(a=e.length);else{var r=e.length/2;if(n<r)throw new Wm("Too many math in a row: expected "+n+", but got "+r,e[0])}});for(var u=0;u<a;++u){var p="r",f=0;u%2==1?p="l":u>0&&h&&(f=1),i[u]={type:"align",align:p,pregap:f,postgap:0}}return o.colSeparationType=h?"align":"alignat",o};Ay({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Lb(t[0])?[t[0]]:Ob(t[0],"ordgroup").body).map(function(e){var t=Rb(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new Wm("Unknown column alignment: "+t,e)}),i={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Ey(e.parser,i,Dy(e.envName))},htmlBuilder:Iy,mathmlBuilder:jy}),Ay({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",i={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var r=e.parser;if(r.consumeSpaces(),"["===r.fetch().text){if(r.consume(),r.consumeSpaces(),n=r.fetch().text,-1==="lcr".indexOf(n))throw new Wm("Expected l or c or r",r.nextToken);r.consume(),r.consumeSpaces(),r.expect("]"),r.consume(),i.cols=[{type:"align",align:n}]}}var s=Ey(e.parser,i,Dy(e.envName)),o=Math.max(0,...s.body.map(e=>e.length));return s.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:Iy,mathmlBuilder:jy}),Ay({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=Ey(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Iy,mathmlBuilder:jy}),Ay({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Lb(t[0])?[t[0]]:Ob(t[0],"ordgroup").body).map(function(e){var t=Rb(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new Wm("Unknown column alignment: "+t,e)});if(n.length>1)throw new Wm("{subarray} can contain only one column");var i={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((i=Ey(e.parser,i,"script")).body.length>0&&i.body[0].length>1)throw new Wm("{subarray} can contain only one column");return i},htmlBuilder:Iy,mathmlBuilder:jy}),Ay({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=Ey(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Dy(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Iy,mathmlBuilder:jy}),Ay({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:qy,htmlBuilder:Iy,mathmlBuilder:jy}),Ay({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Qm.contains(["gather","gather*"],e.envName)&&Ry(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Ly(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Ey(e.parser,t,"display")},htmlBuilder:Iy,mathmlBuilder:jy}),Ay({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:qy,htmlBuilder:Iy,mathmlBuilder:jy}),Ay({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ry(e);var t={autoTag:Ly(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Ey(e.parser,t,"display")},htmlBuilder:Iy,mathmlBuilder:jy}),Ay({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Ry(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new Wm("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var i=[],r=[i],s=0;s<t.length;s++){for(var o=t[s],a=Gb(),l=0;l<o.length;l++)if(Vb(o[l])){i.push(a);var c=Rb(o[l+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(c)>-1);else{if(!("<>AV".indexOf(c)>-1))throw new Wm('Expected one of "<>AV=|." after @',o[l]);for(var h=0;h<2;h++){for(var u=!0,p=l+1;p<o.length;p++){if(Ub(o[p],c)){u=!1,l=p;break}if(Vb(o[p]))throw new Wm("Missing a "+c+" character to complete a CD arrow.",o[p]);d[h].body.push(o[p])}if(u)throw new Wm("Missing a "+c+" character to complete a CD arrow.",o[l])}}var f={type:"styling",body:[Wb(c,d,e)],mode:"math",style:"display"};i.push(f),a=Gb()}else a.body.push(o[l]);s%2==0?i.push(a):i.shift(),i=[],r.push(i)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:r,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(r[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(r.length+1).fill([])}}(e.parser)),htmlBuilder:Iy,mathmlBuilder:jy}),Ny("\\nonumber","\\gdef\\@eqnsw{0}"),Ny("\\notag","\\nonumber"),Xg({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Wm(e.funcName+" valid only within array environment")}});var Hy=Ty;Xg({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];if("ordgroup"!==r.type)throw new Wm("Invalid environment name",r);for(var s="",o=0;o<r.body.length;++o)s+=Ob(r.body[o],"textord").text;if("\\begin"===i){if(!Hy.hasOwnProperty(s))throw new Wm("No such environment: "+s,r);var a=Hy[s],{args:l,optArgs:c}=n.parseArguments("\\begin{"+s+"}",a),d={mode:n.mode,envName:s,parser:n},h=a.handler(d,l,c);n.expect("\\end",!1);var u=n.nextToken,p=Ob(n.parseFunction(),"environment");if(p.name!==s)throw new Wm("Mismatch: \\begin{"+s+"} matched by \\end{"+p.name+"}",u);return h}return{type:"environment",mode:n.mode,name:s,nameGroup:r}}});var Fy=(e,t)=>{var n=e.font,i=t.withFont(n);return db(e.body,i)},$y=(e,t)=>{var n=e.font,i=t.withFont(n);return kb(e.body,i)},Gy={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Xg({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=Jg(t[0]),s=i;return s in Gy&&(s=Gy[s]),{type:"font",mode:n.mode,font:s.slice(1),body:r}},htmlBuilder:Fy,mathmlBuilder:$y}),Xg({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,i=t[0],r=Qm.isCharacterBox(i);return{type:"mclass",mode:n.mode,mclass:Fb(i),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:i}],isCharacterBox:r}}}),Xg({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:i,breakOnTokenText:r}=e,{mode:s}=n,o=n.parseExpression(!0,r);return{type:"font",mode:s,font:"math"+i.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:Fy,mathmlBuilder:$y});var Vy=(e,t)=>{var n=t;return"display"===e?n=n.id>=d_.SCRIPT.id?n.text():d_.DISPLAY:"text"===e&&n.size===d_.DISPLAY.size?n=d_.TEXT:"script"===e?n=d_.SCRIPT:"scriptscript"===e&&(n=d_.SCRIPTSCRIPT),n},Uy=(e,t)=>{var n,i=Vy(e.size,t.style),r=i.fracNum(),s=i.fracDen();n=t.havingStyle(r);var o=db(e.numer,n,t);if(e.continued){var a=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}n=t.havingStyle(s);var c,d,h,u,p,f,m,_,g,b,y=db(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=A_(e.barSize,t),c=qg.makeLineSpan("frac-line",t,d)):c=qg.makeLineSpan("frac-line",t),d=c.height,h=c.height):(c=null,d=0,h=t.fontMetrics().defaultRuleThickness),i.size===d_.DISPLAY.size||"display"===e.size?(u=t.fontMetrics().num1,p=d>0?3*h:7*h,f=t.fontMetrics().denom1):(d>0?(u=t.fontMetrics().num2,p=h):(u=t.fontMetrics().num3,p=3*h),f=t.fontMetrics().denom2),c){var v=t.fontMetrics().axisHeight;u-o.depth-(v+.5*d)<p&&(u+=p-(u-o.depth-(v+.5*d))),v-.5*d-(y.height-f)<p&&(f+=p-(v-.5*d-(y.height-f)));var w=-(v-.5*d);m=qg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:f},{type:"elem",elem:c,shift:w},{type:"elem",elem:o,shift:-u}]},t)}else{var x=u-o.depth-(y.height-f);x<p&&(u+=.5*(p-x),f+=.5*(p-x)),m=qg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:f},{type:"elem",elem:o,shift:-u}]},t)}return n=t.havingStyle(i),m.height*=n.sizeMultiplier/t.sizeMultiplier,m.depth*=n.sizeMultiplier/t.sizeMultiplier,_=i.size===d_.DISPLAY.size?t.fontMetrics().delim1:i.size===d_.SCRIPTSCRIPT.size?t.havingStyle(d_.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,g=null==e.leftDelim?cb(t,["mopen"]):wy.customSizedDelim(e.leftDelim,_,!0,t.havingStyle(i),e.mode,["mopen"]),b=e.continued?qg.makeSpan([]):null==e.rightDelim?cb(t,["mclose"]):wy.customSizedDelim(e.rightDelim,_,!0,t.havingStyle(i),e.mode,["mclose"]),qg.makeSpan(["mord"].concat(n.sizingClasses(t)),[g,qg.makeSpan(["mfrac"],[m]),b],t)},Wy=(e,t)=>{var n=new _b.MathNode("mfrac",[kb(e.numer,t),kb(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var i=A_(e.barSize,t);n.setAttribute("linethickness",P_(i))}}else n.setAttribute("linethickness","0px");var r=Vy(e.size,t.style);if(r.size!==t.style.size){n=new _b.MathNode("mstyle",[n]);var s=r.size===d_.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",s),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var a=new _b.MathNode("mo",[new _b.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(n),null!=e.rightDelim){var l=new _b.MathNode("mo",[new _b.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return bb(o)}return n};Xg({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:i,funcName:r}=e,s=t[0],o=t[1],a=null,l=null,c="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,a="(",l=")";break;case"\\\\bracefrac":n=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:i.mode,continued:!1,numer:s,denom:o,hasBarLine:n,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:Uy,mathmlBuilder:Wy}),Xg({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0],s=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:r,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Xg({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:i,token:r}=e;switch(i){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:r}}});var Yy=["display","text","script","scriptscript"],Xy=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Xg({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:i}=e,r=t[4],s=t[5],o=Jg(t[0]),a="atom"===o.type&&"open"===o.family?Xy(o.text):null,l=Jg(t[1]),c="atom"===l.type&&"close"===l.family?Xy(l.text):null,d=Ob(t[2],"size"),h=null;n=!!d.isBlank||(h=d.value).number>0;var u="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var f=Ob(p.body[0],"textord");u=Yy[Number(f.text)]}}else p=Ob(p,"textord"),u=Yy[Number(p.text)];return{type:"genfrac",mode:i.mode,numer:r,denom:s,continued:!1,hasBarLine:n,barSize:h,leftDelim:a,rightDelim:c,size:u}},htmlBuilder:Uy,mathmlBuilder:Wy}),Xg({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:i,token:r}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Ob(t[0],"size").value,token:r}}}),Xg({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0],s=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Ob(t[1],"infix").size),o=t[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:r,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Uy,mathmlBuilder:Wy});var Ky=(e,t)=>{var n,i,r=t.style;"supsub"===e.type?(n=e.sup?db(e.sup,t.havingStyle(r.sup()),t):db(e.sub,t.havingStyle(r.sub()),t),i=Ob(e.base,"horizBrace")):i=Ob(e,"horizBrace");var s,o=db(i.base,t.havingBaseStyle(d_.DISPLAY)),a=Nb(i,t);if(i.isOver?(s=qg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(s=qg.makeVList({positionType:"bottom",positionData:o.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=qg.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t);s=i.isOver?qg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):qg.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return qg.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t)};Xg({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e;return{type:"horizBrace",mode:n.mode,label:i,isOver:/^\\over/.test(i),base:t[0]}},htmlBuilder:Ky,mathmlBuilder:(e,t)=>{var n=Pb(e.label);return new _b.MathNode(e.isOver?"mover":"munder",[kb(e.base,t),n])}}),Xg({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[1],r=Ob(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:r})?{type:"href",mode:n.mode,href:r,body:Qg(i)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=rb(e.body,t,!1);return qg.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=xb(e.body,t);return n instanceof fb||(n=new fb("mrow",[n])),n.setAttribute("href",e.href),n}}),Xg({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=Ob(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:i}))return n.formatUnsupportedCmd("\\url");for(var r=[],s=0;s<i.length;s++){var o=i[s];"~"===o&&(o="\\textasciitilde"),r.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:n.mode,font:"\\texttt",body:r};return{type:"href",mode:n.mode,href:i,body:Qg(a)}}}),Xg({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Qg(t[0])}},htmlBuilder(e,t){var n=rb(e.body,t,!1);return qg.makeFragment(n)},mathmlBuilder:(e,t)=>new _b.MathNode("mrow",wb(e.body,t))}),Xg({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:i,funcName:r,token:s}=e,o=Ob(t[0],"raw").string,a=t[1];i.settings.strict&&i.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(r){case"\\htmlClass":l.class=o,n={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o,n={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o,n={command:"\\htmlStyle",style:o};break;case"\\htmlData":for(var c=o.split(","),d=0;d<c.length;d++){var h=c[d].split("=");if(2!==h.length)throw new Wm("Error parsing key-value for \\htmlData");l["data-"+h[0].trim()]=h[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return i.settings.isTrusted(n)?{type:"html",mode:i.mode,attributes:l,body:Qg(a)}:i.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=rb(e.body,t,!1),i=["enclosing"];e.attributes.class&&i.push(...e.attributes.class.trim().split(/\s+/));var r=qg.makeSpan(i,n,t);for(var s in e.attributes)"class"!==s&&e.attributes.hasOwnProperty(s)&&r.setAttribute(s,e.attributes[s]);return r},mathmlBuilder:(e,t)=>xb(e.body,t)}),Xg({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Qg(t[0]),mathml:Qg(t[1])}},htmlBuilder:(e,t)=>{var n=rb(e.html,t,!1);return qg.makeFragment(n)},mathmlBuilder:(e,t)=>xb(e.mathml,t)});var Jy=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Wm("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!T_(n))throw new Wm("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Xg({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:i}=e,r={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(n[0])for(var l=Ob(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var h=d[1].trim();switch(d[0].trim()){case"alt":a=h;break;case"width":r=Jy(h);break;case"height":s=Jy(h);break;case"totalheight":o=Jy(h);break;default:throw new Wm("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var u=Ob(t[0],"url").url;return""===a&&(a=(a=(a=u).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),i.settings.isTrusted({command:"\\includegraphics",url:u})?{type:"includegraphics",mode:i.mode,alt:a,width:r,height:s,totalheight:o,src:u}:i.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=A_(e.height,t),i=0;e.totalheight.number>0&&(i=A_(e.totalheight,t)-n);var r=0;e.width.number>0&&(r=A_(e.width,t));var s={height:P_(n+i)};r>0&&(s.width=P_(r)),i>0&&(s.verticalAlign=P_(-i));var o=new B_(e.src,e.alt,s);return o.height=n,o.depth=i,o},mathmlBuilder:(e,t)=>{var n=new _b.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var i=A_(e.height,t),r=0;if(e.totalheight.number>0&&(r=A_(e.totalheight,t)-i,n.setAttribute("valign",P_(-r))),n.setAttribute("height",P_(i+r)),e.width.number>0){var s=A_(e.width,t);n.setAttribute("width",P_(s))}return n.setAttribute("src",e.src),n}}),Xg({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:i}=e,r=Ob(t[0],"size");if(n.settings.strict){var s="m"===i[1],o="mu"===r.value.unit;s?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" supports only mu units, not "+r.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:r.value}},htmlBuilder:(e,t)=>qg.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=A_(e.dimension,t);return new _b.SpaceNode(n)}}),Xg({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"lap",mode:n.mode,alignment:i.slice(5),body:r}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=qg.makeSpan([],[db(e.body,t)]),n=qg.makeSpan(["inner"],[n],t)):n=qg.makeSpan(["inner"],[db(e.body,t)]);var i=qg.makeSpan(["fix"],[]),r=qg.makeSpan([e.alignment],[n,i],t),s=qg.makeSpan(["strut"]);return s.style.height=P_(r.height+r.depth),r.depth&&(s.style.verticalAlign=P_(-r.depth)),r.children.unshift(s),r=qg.makeSpan(["thinbox"],[r],t),qg.makeSpan(["mord","vbox"],[r],t)},mathmlBuilder:(e,t)=>{var n=new _b.MathNode("mpadded",[kb(e.body,t)]);if("rlap"!==e.alignment){var i="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",i+"width")}return n.setAttribute("width","0px"),n}}),Xg({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:i}=e,r=i.mode;i.switchMode("math");var s="\\("===n?"\\)":"$",o=i.parseExpression(!1,s);return i.expect(s),i.switchMode(r),{type:"styling",mode:i.mode,style:"text",body:o}}}),Xg({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Wm("Mismatched "+e.funcName)}});var Qy=(e,t)=>{switch(t.style.size){case d_.DISPLAY.size:return e.display;case d_.TEXT.size:return e.text;case d_.SCRIPT.size:return e.script;case d_.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Xg({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Qg(t[0]),text:Qg(t[1]),script:Qg(t[2]),scriptscript:Qg(t[3])}},htmlBuilder:(e,t)=>{var n=Qy(e,t),i=rb(n,t,!1);return qg.makeFragment(i)},mathmlBuilder:(e,t)=>{var n=Qy(e,t);return xb(n,t)}});var Zy=(e,t,n,i,r,s,o)=>{e=qg.makeSpan([],[e]);var a,l,c,d=n&&Qm.isCharacterBox(n);if(t){var h=db(t,i.havingStyle(r.sup()),i);l={elem:h,kern:Math.max(i.fontMetrics().bigOpSpacing1,i.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var u=db(n,i.havingStyle(r.sub()),i);a={elem:u,kern:Math.max(i.fontMetrics().bigOpSpacing2,i.fontMetrics().bigOpSpacing4-u.height)}}if(l&&a){var p=i.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+o;c=qg.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:P_(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:P_(s)},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}else if(a){var f=e.height-o;c=qg.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:P_(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]},i)}else{if(!l)return e;var m=e.depth+o;c=qg.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:P_(s)},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}var _=[c];if(a&&0!==s&&!d){var g=qg.makeSpan(["mspace"],[],i);g.style.marginRight=P_(s),_.unshift(g)}return qg.makeSpan(["mop","op-limits"],_,i)},ev=["\\smallint"],tv=(e,t)=>{var n,i,r,s=!1;"supsub"===e.type?(n=e.sup,i=e.sub,r=Ob(e.base,"op"),s=!0):r=Ob(e,"op");var o,a=t.style,l=!1;if(a.size===d_.DISPLAY.size&&r.symbol&&!Qm.contains(ev,r.name)&&(l=!0),r.symbol){var c=l?"Size2-Regular":"Size1-Regular",d="";if("\\oiint"!==r.name&&"\\oiiint"!==r.name||(d=r.name.slice(1),r.name="oiint"===d?"\\iint":"\\iiint"),o=qg.makeSymbol(r.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d.length>0){var h=o.italic,u=qg.staticSvg(d+"Size"+(l?"2":"1"),t);o=qg.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:u,shift:l?.08:0}]},t),r.name="\\"+d,o.classes.unshift("mop"),o.italic=h}}else if(r.body){var p=rb(r.body,t,!0);1===p.length&&p[0]instanceof q_?(o=p[0]).classes[0]="mop":o=qg.makeSpan(["mop"],p,t)}else{for(var f=[],m=1;m<r.name.length;m++)f.push(qg.mathsym(r.name[m],r.mode,t));o=qg.makeSpan(["mop"],f,t)}var _=0,g=0;return(o instanceof q_||"\\oiint"===r.name||"\\oiiint"===r.name)&&!r.suppressBaseShift&&(_=(o.height-o.depth)/2-t.fontMetrics().axisHeight,g=o.italic),s?Zy(o,n,i,t,a,g,_):(_&&(o.style.position="relative",o.style.top=P_(_)),o)},nv=(e,t)=>{var n;if(e.symbol)n=new fb("mo",[gb(e.name,e.mode)]),Qm.contains(ev,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new fb("mo",wb(e.body,t));else{n=new fb("mi",[new mb(e.name.slice(1))]);var i=new fb("mo",[gb("","text")]);n=e.parentIsSupSub?new fb("mrow",[n,i]):pb([n,i])}return n},iv={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Xg({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=i;return 1===r.length&&(r=iv[r]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:tv,mathmlBuilder:nv}),Xg({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Qg(i)}},htmlBuilder:tv,mathmlBuilder:nv});var rv={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Xg({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:tv,mathmlBuilder:nv}),Xg({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:tv,mathmlBuilder:nv}),Xg({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,i=n;return 1===i.length&&(i=rv[i]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:tv,mathmlBuilder:nv});var sv=(e,t)=>{var n,i,r,s,o=!1;if("supsub"===e.type?(n=e.sup,i=e.sub,r=Ob(e.base,"operatorname"),o=!0):r=Ob(e,"operatorname"),r.body.length>0){for(var a=r.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=rb(a,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof q_&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=qg.makeSpan(["mop"],l,t)}else s=qg.makeSpan(["mop"],[],t);return o?Zy(s,n,i,t,t.style,0,0):s};function ov(e,t,n){for(var i=rb(e,t,!1),r=t.sizeMultiplier/n.sizeMultiplier,s=0;s<i.length;s++){var o=i[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(i[s].classes,t.sizingClasses(n)):i[s].classes[o+1]==="reset-size"+t.size&&(i[s].classes[o+1]="reset-size"+n.size),i[s].height*=r,i[s].depth*=r}return qg.makeFragment(i)}Xg({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"operatorname",mode:n.mode,body:Qg(r),alwaysHandleSupSub:"\\operatornamewithlimits"===i,limits:!1,parentIsSupSub:!1}},htmlBuilder:sv,mathmlBuilder:(e,t)=>{for(var n=wb(e.body,t.withFont("mathrm")),i=!0,r=0;r<n.length;r++){var s=n[r];if(s instanceof _b.SpaceNode);else if(s instanceof _b.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var o=s.children[0];1===s.children.length&&o instanceof _b.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):i=!1;break;default:i=!1}else i=!1}if(i){var a=n.map(e=>e.toText()).join("");n=[new _b.TextNode(a)]}var l=new _b.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new _b.MathNode("mo",[gb("","text")]);return e.parentIsSupSub?new _b.MathNode("mrow",[l,c]):_b.newDocumentFragment([l,c])}}),Ny("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Kg({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?qg.makeFragment(rb(e.body,t,!1)):qg.makeSpan(["mord"],rb(e.body,t,!0),t),mathmlBuilder:(e,t)=>xb(e.body,t,!0)}),Xg({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,i=t[0];return{type:"overline",mode:n.mode,body:i}},htmlBuilder(e,t){var n=db(e.body,t.havingCrampedStyle()),i=qg.makeLineSpan("overline-line",t),r=t.fontMetrics().defaultRuleThickness,s=qg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*r},{type:"elem",elem:i},{type:"kern",size:r}]},t);return qg.makeSpan(["mord","overline"],[s],t)},mathmlBuilder(e,t){var n=new _b.MathNode("mo",[new _b.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new _b.MathNode("mover",[kb(e.body,t),n]);return i.setAttribute("accent","true"),i}}),Xg({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"phantom",mode:n.mode,body:Qg(i)}},htmlBuilder:(e,t)=>{var n=rb(e.body,t.withPhantom(),!1);return qg.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=wb(e.body,t);return new _b.MathNode("mphantom",n)}}),Xg({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"hphantom",mode:n.mode,body:i}},htmlBuilder:(e,t)=>{var n=qg.makeSpan([],[db(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var i=0;i<n.children.length;i++)n.children[i].height=0,n.children[i].depth=0;return n=qg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),qg.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=wb(Qg(e.body),t),i=new _b.MathNode("mphantom",n),r=new _b.MathNode("mpadded",[i]);return r.setAttribute("height","0px"),r.setAttribute("depth","0px"),r}}),Xg({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"vphantom",mode:n.mode,body:i}},htmlBuilder:(e,t)=>{var n=qg.makeSpan(["inner"],[db(e.body,t.withPhantom())]),i=qg.makeSpan(["fix"],[]);return qg.makeSpan(["mord","rlap"],[n,i],t)},mathmlBuilder:(e,t)=>{var n=wb(Qg(e.body),t),i=new _b.MathNode("mphantom",n),r=new _b.MathNode("mpadded",[i]);return r.setAttribute("width","0px"),r}}),Xg({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,i=Ob(t[0],"size").value,r=t[1];return{type:"raisebox",mode:n.mode,dy:i,body:r}},htmlBuilder(e,t){var n=db(e.body,t),i=A_(e.dy,t);return qg.makeVList({positionType:"shift",positionData:-i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new _b.MathNode("mpadded",[kb(e.body,t)]),i=e.dy.number+e.dy.unit;return n.setAttribute("voffset",i),n}}),Xg({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Xg({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:i}=e,r=n[0],s=Ob(t[0],"size"),o=Ob(t[1],"size");return{type:"rule",mode:i.mode,shift:r&&Ob(r,"size").value,width:s.value,height:o.value}},htmlBuilder(e,t){var n=qg.makeSpan(["mord","rule"],[],t),i=A_(e.width,t),r=A_(e.height,t),s=e.shift?A_(e.shift,t):0;return n.style.borderRightWidth=P_(i),n.style.borderTopWidth=P_(r),n.style.bottom=P_(s),n.width=i,n.height=r+s,n.depth=-s,n.maxFontSize=1.125*r*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=A_(e.width,t),i=A_(e.height,t),r=e.shift?A_(e.shift,t):0,s=t.color&&t.getColor()||"black",o=new _b.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",P_(n)),o.setAttribute("height",P_(i));var a=new _b.MathNode("mpadded",[o]);return r>=0?a.setAttribute("height",P_(r)):(a.setAttribute("height",P_(r)),a.setAttribute("depth",P_(-r))),a.setAttribute("voffset",P_(r)),a}});var av=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Xg({type:"sizing",names:av,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:i,parser:r}=e,s=r.parseExpression(!1,n);return{type:"sizing",mode:r.mode,size:av.indexOf(i)+1,body:s}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return ov(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),i=wb(e.body,n),r=new _b.MathNode("mstyle",i);return r.setAttribute("mathsize",P_(n.sizeMultiplier)),r}}),Xg({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:i}=e,r=!1,s=!1,o=n[0]&&Ob(n[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l){if("t"===(a=o.body[l].text))r=!0;else{if("b"!==a){r=!1,s=!1;break}s=!0}}else r=!0,s=!0;var c=t[0];return{type:"smash",mode:i.mode,body:c,smashHeight:r,smashDepth:s}},htmlBuilder:(e,t)=>{var n=qg.makeSpan([],[db(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].depth=0;var s=qg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return qg.makeSpan(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new _b.MathNode("mpadded",[kb(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Xg({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:i}=e,r=n[0],s=t[0];return{type:"sqrt",mode:i.mode,body:s,index:r}},htmlBuilder(e,t){var n=db(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=qg.wrapFragment(n,t);var i=t.fontMetrics().defaultRuleThickness,r=i;t.style.id<d_.TEXT.id&&(r=t.fontMetrics().xHeight);var s=i+r/4,o=n.height+n.depth+s+i,{span:a,ruleWidth:l,advanceWidth:c}=wy.sqrtImage(o,t),d=a.height-l;d>n.height+n.depth+s&&(s=(s+d-n.height-n.depth)/2);var h=a.height-n.height-s-l;n.style.paddingLeft=P_(c);var u=qg.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(d_.SCRIPTSCRIPT),f=db(e.index,p,t),m=.6*(u.height-u.depth),_=qg.makeVList({positionType:"shift",positionData:-m,children:[{type:"elem",elem:f}]},t),g=qg.makeSpan(["root"],[_]);return qg.makeSpan(["mord","sqrt"],[g,u],t)}return qg.makeSpan(["mord","sqrt"],[u],t)},mathmlBuilder(e,t){var{body:n,index:i}=e;return i?new _b.MathNode("mroot",[kb(n,t),kb(i,t)]):new _b.MathNode("msqrt",[kb(n,t)])}});var lv={display:d_.DISPLAY,text:d_.TEXT,script:d_.SCRIPT,scriptscript:d_.SCRIPTSCRIPT};Xg({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:i,parser:r}=e,s=r.parseExpression(!0,n),o=i.slice(1,i.length-5);return{type:"styling",mode:r.mode,style:o,body:s}},htmlBuilder(e,t){var n=lv[e.style],i=t.havingStyle(n).withFont("");return ov(e.body,i,t)},mathmlBuilder(e,t){var n=lv[e.style],i=t.havingStyle(n),r=wb(e.body,i),s=new _b.MathNode("mstyle",r),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}});Kg({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===d_.DISPLAY.size||n.alwaysHandleSupSub)?tv:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===d_.DISPLAY.size||n.limits)?sv:null:"accent"===n.type?Qm.isCharacterBox(n.base)?Eb:null:"horizBrace"===n.type&&!e.sub===n.isOver?Ky:null:null}(e,t);if(n)return n(e,t);var i,r,s,{base:o,sup:a,sub:l}=e,c=db(o,t),d=t.fontMetrics(),h=0,u=0,p=o&&Qm.isCharacterBox(o);if(a){var f=t.havingStyle(t.style.sup());i=db(a,f,t),p||(h=c.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(l){var m=t.havingStyle(t.style.sub());r=db(l,m,t),p||(u=c.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}s=t.style===d_.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var _,g=t.sizeMultiplier,b=P_(.5/d.ptPerEm/g),y=null;if(r){var v=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof q_||v)&&(y=P_(-c.italic))}if(i&&r){h=Math.max(h,s,i.depth+.25*d.xHeight),u=Math.max(u,d.sub2);var w=4*d.defaultRuleThickness;if(h-i.depth-(r.height-u)<w){u=w-(h-i.depth)+r.height;var x=.8*d.xHeight-(h-i.depth);x>0&&(h+=x,u-=x)}var k=[{type:"elem",elem:r,shift:u,marginRight:b,marginLeft:y},{type:"elem",elem:i,shift:-h,marginRight:b}];_=qg.makeVList({positionType:"individualShift",children:k},t)}else if(r){u=Math.max(u,d.sub1,r.height-.8*d.xHeight);var S=[{type:"elem",elem:r,marginLeft:y,marginRight:b}];_=qg.makeVList({positionType:"shift",positionData:u,children:S},t)}else{if(!i)throw new Error("supsub must have either sup or sub.");h=Math.max(h,s,i.depth+.25*d.xHeight),_=qg.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:i,marginRight:b}]},t)}var C=lb(c,"right")||"mord";return qg.makeSpan([C],[c,qg.makeSpan(["msupsub"],[_])],t)},mathmlBuilder(e,t){var n,i=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(i=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var r,s=[kb(e.base,t)];if(e.sub&&s.push(kb(e.sub,t)),e.sup&&s.push(kb(e.sup,t)),i)r=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;r=o&&"op"===o.type&&o.limits&&t.style===d_.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===d_.DISPLAY||o.limits)?"munderover":"msubsup"}else{var a=e.base;r=a&&"op"===a.type&&a.limits&&(t.style===d_.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===d_.DISPLAY)?"munder":"msub"}else{var l=e.base;r=l&&"op"===l.type&&l.limits&&(t.style===d_.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===d_.DISPLAY)?"mover":"msup"}return new _b.MathNode(r,s)}}),Kg({type:"atom",htmlBuilder:(e,t)=>qg.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new _b.MathNode("mo",[gb(e.text,e.mode)]);if("bin"===e.family){var i=yb(e,t);"bold-italic"===i&&n.setAttribute("mathvariant",i)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var cv={mi:"italic",mn:"normal",mtext:"normal"};Kg({type:"mathord",htmlBuilder:(e,t)=>qg.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new _b.MathNode("mi",[gb(e.text,e.mode,t)]),i=yb(e,t)||"italic";return i!==cv[n.type]&&n.setAttribute("mathvariant",i),n}}),Kg({type:"textord",htmlBuilder:(e,t)=>qg.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,i=gb(e.text,e.mode,t),r=yb(e,t)||"normal";return n="text"===e.mode?new _b.MathNode("mtext",[i]):/[0-9]/.test(e.text)?new _b.MathNode("mn",[i]):"\\prime"===e.text?new _b.MathNode("mo",[i]):new _b.MathNode("mi",[i]),r!==cv[n.type]&&n.setAttribute("mathvariant",r),n}});var dv={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},hv={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Kg({type:"spacing",htmlBuilder(e,t){if(hv.hasOwnProperty(e.text)){var n=hv[e.text].className||"";if("text"===e.mode){var i=qg.makeOrd(e,t,"textord");return i.classes.push(n),i}return qg.makeSpan(["mspace",n],[qg.mathsym(e.text,e.mode,t)],t)}if(dv.hasOwnProperty(e.text))return qg.makeSpan(["mspace",dv[e.text]],[],t);throw new Wm('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!hv.hasOwnProperty(e.text)){if(dv.hasOwnProperty(e.text))return new _b.MathNode("mspace");throw new Wm('Unknown type of space "'+e.text+'"')}return new _b.MathNode("mtext",[new _b.TextNode(" ")])}});var uv=()=>{var e=new _b.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Kg({type:"tag",mathmlBuilder(e,t){var n=new _b.MathNode("mtable",[new _b.MathNode("mtr",[uv(),new _b.MathNode("mtd",[xb(e.body,t)]),uv(),new _b.MathNode("mtd",[xb(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var pv={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},fv={"\\textbf":"textbf","\\textmd":"textmd"},mv={"\\textit":"textit","\\textup":"textup"},_v=(e,t)=>{var n=e.font;return n?pv[n]?t.withTextFontFamily(pv[n]):fv[n]?t.withTextFontWeight(fv[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(mv[n]):t};Xg({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"text",mode:n.mode,body:Qg(r),font:i}},htmlBuilder(e,t){var n=_v(e,t),i=rb(e.body,n,!0);return qg.makeSpan(["mord","text"],i,n)},mathmlBuilder(e,t){var n=_v(e,t);return xb(e.body,n)}}),Xg({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=db(e.body,t),i=qg.makeLineSpan("underline-line",t),r=t.fontMetrics().defaultRuleThickness,s=qg.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:r},{type:"elem",elem:i},{type:"kern",size:3*r},{type:"elem",elem:n}]},t);return qg.makeSpan(["mord","underline"],[s],t)},mathmlBuilder(e,t){var n=new _b.MathNode("mo",[new _b.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new _b.MathNode("munder",[kb(e.body,t),n]);return i.setAttribute("accentunder","true"),i}}),Xg({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=db(e.body,t),i=t.fontMetrics().axisHeight,r=.5*(n.height-i-(n.depth+i));return qg.makeVList({positionType:"shift",positionData:r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new _b.MathNode("mpadded",[kb(e.body,t)],["vcenter"])}),Xg({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Wm("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=gv(e),i=[],r=t.havingStyle(t.style.text()),s=0;s<n.length;s++){var o=n[s];"~"===o&&(o="\\textasciitilde"),i.push(qg.makeSymbol(o,"Typewriter-Regular",e.mode,r,["mord","texttt"]))}return qg.makeSpan(["mord","text"].concat(r.sizingClasses(t)),qg.tryCombineChars(i),r)},mathmlBuilder(e,t){var n=new _b.TextNode(gv(e)),i=new _b.MathNode("mtext",[n]);return i.setAttribute("mathvariant","monospace"),i}});var gv=e=>e.body.replace(/ /g,e.star?"␣":" "),bv=Ug,yv="[ \r\n\t]",vv="(\\\\[a-zA-Z@]+)"+yv+"*",wv="[̀-ͯ]",xv=new RegExp(wv+"+$"),kv="("+yv+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+wv+"*|[\ud800-\udbff][\udc00-\udfff]"+wv+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+vv+"|\\\\[^\ud800-\udfff])";class Sv{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(kv,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Um("EOF",new Vm(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new Wm("Unexpected character: '"+e[t]+"'",new Um(e[t],new Vm(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[i]){var r=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===r?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=r+1,this.lex()}return new Um(i,new Vm(this,t,this.tokenRegex.lastIndex))}}class Cv{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new Wm("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var r=this.undefStack[this.undefStack.length-1];r&&!r.hasOwnProperty(e)&&(r[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var Mv=Py;Ny("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Ny("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Ny("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Ny("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Ny("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Ny("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Ny("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var zv={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Ny("\\char",function(e){var t,n=e.popToken(),i="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])i=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new Wm("\\char` missing argument");i=n.text.charCodeAt(0)}else t=10;if(t){if(null==(i=zv[n.text])||i>=t)throw new Wm("Invalid base-"+t+" digit "+n.text);for(var r;null!=(r=zv[e.future().text])&&r<t;)i*=t,i+=r,e.popToken()}return"\\@char{"+i+"}"});var Tv=(e,t,n,i)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new Wm("\\newcommand's first argument must be a macro name");var s=r[0].text,o=e.isDefined(s);if(o&&!t)throw new Wm("\\newcommand{"+s+"} attempting to redefine "+s+"; use \\renewcommand");if(!o&&!n)throw new Wm("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(1===(r=e.consumeArg().tokens).length&&"["===r[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Wm("Invalid number of arguments: "+l);a=parseInt(l),r=e.consumeArg().tokens}return o&&i||e.macros.set(s,{tokens:r,numArgs:a}),""};Ny("\\newcommand",e=>Tv(e,!1,!0,!1)),Ny("\\renewcommand",e=>Tv(e,!0,!1,!1)),Ny("\\providecommand",e=>Tv(e,!0,!0,!0)),Ny("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Ny("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Ny("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),bv[n],W_.math[n],W_.text[n]),""}),Ny("\\bgroup","{"),Ny("\\egroup","}"),Ny("~","\\nobreakspace"),Ny("\\lq","`"),Ny("\\rq","'"),Ny("\\aa","\\r a"),Ny("\\AA","\\r A"),Ny("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Ny("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Ny("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Ny("ℬ","\\mathscr{B}"),Ny("ℰ","\\mathscr{E}"),Ny("ℱ","\\mathscr{F}"),Ny("ℋ","\\mathscr{H}"),Ny("ℐ","\\mathscr{I}"),Ny("ℒ","\\mathscr{L}"),Ny("ℳ","\\mathscr{M}"),Ny("ℛ","\\mathscr{R}"),Ny("ℭ","\\mathfrak{C}"),Ny("ℌ","\\mathfrak{H}"),Ny("ℨ","\\mathfrak{Z}"),Ny("\\Bbbk","\\Bbb{k}"),Ny("·","\\cdotp"),Ny("\\llap","\\mathllap{\\textrm{#1}}"),Ny("\\rlap","\\mathrlap{\\textrm{#1}}"),Ny("\\clap","\\mathclap{\\textrm{#1}}"),Ny("\\mathstrut","\\vphantom{(}"),Ny("\\underbar","\\underline{\\text{#1}}"),Ny("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Ny("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Ny("\\ne","\\neq"),Ny("≠","\\neq"),Ny("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Ny("∉","\\notin"),Ny("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Ny("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Ny("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Ny("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Ny("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Ny("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Ny("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Ny("⟂","\\perp"),Ny("‼","\\mathclose{!\\mkern-0.8mu!}"),Ny("∌","\\notni"),Ny("⌜","\\ulcorner"),Ny("⌝","\\urcorner"),Ny("⌞","\\llcorner"),Ny("⌟","\\lrcorner"),Ny("©","\\copyright"),Ny("®","\\textregistered"),Ny("️","\\textregistered"),Ny("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Ny("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Ny("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Ny("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Ny("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Ny("⋮","\\vdots"),Ny("\\varGamma","\\mathit{\\Gamma}"),Ny("\\varDelta","\\mathit{\\Delta}"),Ny("\\varTheta","\\mathit{\\Theta}"),Ny("\\varLambda","\\mathit{\\Lambda}"),Ny("\\varXi","\\mathit{\\Xi}"),Ny("\\varPi","\\mathit{\\Pi}"),Ny("\\varSigma","\\mathit{\\Sigma}"),Ny("\\varUpsilon","\\mathit{\\Upsilon}"),Ny("\\varPhi","\\mathit{\\Phi}"),Ny("\\varPsi","\\mathit{\\Psi}"),Ny("\\varOmega","\\mathit{\\Omega}"),Ny("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Ny("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Ny("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Ny("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Ny("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Ny("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Ny("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Ny("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Av={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Ny("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Av?t=Av[n]:("\\not"===n.slice(0,4)||n in W_.math&&Qm.contains(["bin","rel"],W_.math[n].group))&&(t="\\dotsb"),t});var Pv={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Ny("\\dotso",function(e){return e.future().text in Pv?"\\ldots\\,":"\\ldots"}),Ny("\\dotsc",function(e){var t=e.future().text;return t in Pv&&","!==t?"\\ldots\\,":"\\ldots"}),Ny("\\cdots",function(e){return e.future().text in Pv?"\\@cdots\\,":"\\@cdots"}),Ny("\\dotsb","\\cdots"),Ny("\\dotsm","\\cdots"),Ny("\\dotsi","\\!\\cdots"),Ny("\\dotsx","\\ldots\\,"),Ny("\\DOTSI","\\relax"),Ny("\\DOTSB","\\relax"),Ny("\\DOTSX","\\relax"),Ny("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Ny("\\,","\\tmspace+{3mu}{.1667em}"),Ny("\\thinspace","\\,"),Ny("\\>","\\mskip{4mu}"),Ny("\\:","\\tmspace+{4mu}{.2222em}"),Ny("\\medspace","\\:"),Ny("\\;","\\tmspace+{5mu}{.2777em}"),Ny("\\thickspace","\\;"),Ny("\\!","\\tmspace-{3mu}{.1667em}"),Ny("\\negthinspace","\\!"),Ny("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Ny("\\negthickspace","\\tmspace-{5mu}{.277em}"),Ny("\\enspace","\\kern.5em "),Ny("\\enskip","\\hskip.5em\\relax"),Ny("\\quad","\\hskip1em\\relax"),Ny("\\qquad","\\hskip2em\\relax"),Ny("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Ny("\\tag@paren","\\tag@literal{({#1})}"),Ny("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Wm("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Ny("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Ny("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Ny("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Ny("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Ny("\\newline","\\\\\\relax"),Ny("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Nv=P_(g_["Main-Regular"]["T".charCodeAt(0)][1]-.7*g_["Main-Regular"]["A".charCodeAt(0)][1]);Ny("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Nv+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Ny("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Nv+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Ny("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Ny("\\@hspace","\\hskip #1\\relax"),Ny("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Ny("\\ordinarycolon",":"),Ny("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Ny("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Ny("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Ny("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Ny("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Ny("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Ny("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Ny("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Ny("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Ny("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Ny("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Ny("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Ny("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Ny("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Ny("∷","\\dblcolon"),Ny("∹","\\eqcolon"),Ny("≔","\\coloneqq"),Ny("≕","\\eqqcolon"),Ny("⩴","\\Coloneqq"),Ny("\\ratio","\\vcentcolon"),Ny("\\coloncolon","\\dblcolon"),Ny("\\colonequals","\\coloneqq"),Ny("\\coloncolonequals","\\Coloneqq"),Ny("\\equalscolon","\\eqqcolon"),Ny("\\equalscoloncolon","\\Eqqcolon"),Ny("\\colonminus","\\coloneq"),Ny("\\coloncolonminus","\\Coloneq"),Ny("\\minuscolon","\\eqcolon"),Ny("\\minuscoloncolon","\\Eqcolon"),Ny("\\coloncolonapprox","\\Colonapprox"),Ny("\\coloncolonsim","\\Colonsim"),Ny("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ny("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ny("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ny("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ny("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Ny("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Ny("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Ny("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Ny("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Ny("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Ny("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Ny("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Ny("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Ny("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Ny("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Ny("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Ny("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Ny("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Ny("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Ny("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Ny("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Ny("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Ny("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Ny("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Ny("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Ny("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Ny("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Ny("\\imath","\\html@mathml{\\@imath}{ı}"),Ny("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Ny("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Ny("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Ny("⟦","\\llbracket"),Ny("⟧","\\rrbracket"),Ny("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Ny("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Ny("⦃","\\lBrace"),Ny("⦄","\\rBrace"),Ny("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Ny("⦵","\\minuso"),Ny("\\darr","\\downarrow"),Ny("\\dArr","\\Downarrow"),Ny("\\Darr","\\Downarrow"),Ny("\\lang","\\langle"),Ny("\\rang","\\rangle"),Ny("\\uarr","\\uparrow"),Ny("\\uArr","\\Uparrow"),Ny("\\Uarr","\\Uparrow"),Ny("\\N","\\mathbb{N}"),Ny("\\R","\\mathbb{R}"),Ny("\\Z","\\mathbb{Z}"),Ny("\\alef","\\aleph"),Ny("\\alefsym","\\aleph"),Ny("\\Alpha","\\mathrm{A}"),Ny("\\Beta","\\mathrm{B}"),Ny("\\bull","\\bullet"),Ny("\\Chi","\\mathrm{X}"),Ny("\\clubs","\\clubsuit"),Ny("\\cnums","\\mathbb{C}"),Ny("\\Complex","\\mathbb{C}"),Ny("\\Dagger","\\ddagger"),Ny("\\diamonds","\\diamondsuit"),Ny("\\empty","\\emptyset"),Ny("\\Epsilon","\\mathrm{E}"),Ny("\\Eta","\\mathrm{H}"),Ny("\\exist","\\exists"),Ny("\\harr","\\leftrightarrow"),Ny("\\hArr","\\Leftrightarrow"),Ny("\\Harr","\\Leftrightarrow"),Ny("\\hearts","\\heartsuit"),Ny("\\image","\\Im"),Ny("\\infin","\\infty"),Ny("\\Iota","\\mathrm{I}"),Ny("\\isin","\\in"),Ny("\\Kappa","\\mathrm{K}"),Ny("\\larr","\\leftarrow"),Ny("\\lArr","\\Leftarrow"),Ny("\\Larr","\\Leftarrow"),Ny("\\lrarr","\\leftrightarrow"),Ny("\\lrArr","\\Leftrightarrow"),Ny("\\Lrarr","\\Leftrightarrow"),Ny("\\Mu","\\mathrm{M}"),Ny("\\natnums","\\mathbb{N}"),Ny("\\Nu","\\mathrm{N}"),Ny("\\Omicron","\\mathrm{O}"),Ny("\\plusmn","\\pm"),Ny("\\rarr","\\rightarrow"),Ny("\\rArr","\\Rightarrow"),Ny("\\Rarr","\\Rightarrow"),Ny("\\real","\\Re"),Ny("\\reals","\\mathbb{R}"),Ny("\\Reals","\\mathbb{R}"),Ny("\\Rho","\\mathrm{P}"),Ny("\\sdot","\\cdot"),Ny("\\sect","\\S"),Ny("\\spades","\\spadesuit"),Ny("\\sub","\\subset"),Ny("\\sube","\\subseteq"),Ny("\\supe","\\supseteq"),Ny("\\Tau","\\mathrm{T}"),Ny("\\thetasym","\\vartheta"),Ny("\\weierp","\\wp"),Ny("\\Zeta","\\mathrm{Z}"),Ny("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Ny("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Ny("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Ny("\\bra","\\mathinner{\\langle{#1}|}"),Ny("\\ket","\\mathinner{|{#1}\\rangle}"),Ny("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Ny("\\Bra","\\left\\langle#1\\right|"),Ny("\\Ket","\\left|#1\\right\\rangle");var Ov=e=>t=>{var n=t.consumeArg().tokens,i=t.consumeArg().tokens,r=t.consumeArg().tokens,s=t.consumeArg().tokens,o=t.macros.get("|"),a=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",o),r.length&&n.macros.set("\\|",a));var s=t;!t&&r.length&&("|"===n.future().text&&(n.popToken(),s=!0));return{tokens:s?r:i,numArgs:0}};t.macros.set("|",l(!1)),r.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...s,...c,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};Ny("\\bra@ket",Ov(!1)),Ny("\\bra@set",Ov(!0)),Ny("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Ny("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Ny("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Ny("\\angln","{\\angl n}"),Ny("\\blue","\\textcolor{##6495ed}{#1}"),Ny("\\orange","\\textcolor{##ffa500}{#1}"),Ny("\\pink","\\textcolor{##ff00af}{#1}"),Ny("\\red","\\textcolor{##df0030}{#1}"),Ny("\\green","\\textcolor{##28ae7b}{#1}"),Ny("\\gray","\\textcolor{gray}{#1}"),Ny("\\purple","\\textcolor{##9d38bd}{#1}"),Ny("\\blueA","\\textcolor{##ccfaff}{#1}"),Ny("\\blueB","\\textcolor{##80f6ff}{#1}"),Ny("\\blueC","\\textcolor{##63d9ea}{#1}"),Ny("\\blueD","\\textcolor{##11accd}{#1}"),Ny("\\blueE","\\textcolor{##0c7f99}{#1}"),Ny("\\tealA","\\textcolor{##94fff5}{#1}"),Ny("\\tealB","\\textcolor{##26edd5}{#1}"),Ny("\\tealC","\\textcolor{##01d1c1}{#1}"),Ny("\\tealD","\\textcolor{##01a995}{#1}"),Ny("\\tealE","\\textcolor{##208170}{#1}"),Ny("\\greenA","\\textcolor{##b6ffb0}{#1}"),Ny("\\greenB","\\textcolor{##8af281}{#1}"),Ny("\\greenC","\\textcolor{##74cf70}{#1}"),Ny("\\greenD","\\textcolor{##1fab54}{#1}"),Ny("\\greenE","\\textcolor{##0d923f}{#1}"),Ny("\\goldA","\\textcolor{##ffd0a9}{#1}"),Ny("\\goldB","\\textcolor{##ffbb71}{#1}"),Ny("\\goldC","\\textcolor{##ff9c39}{#1}"),Ny("\\goldD","\\textcolor{##e07d10}{#1}"),Ny("\\goldE","\\textcolor{##a75a05}{#1}"),Ny("\\redA","\\textcolor{##fca9a9}{#1}"),Ny("\\redB","\\textcolor{##ff8482}{#1}"),Ny("\\redC","\\textcolor{##f9685d}{#1}"),Ny("\\redD","\\textcolor{##e84d39}{#1}"),Ny("\\redE","\\textcolor{##bc2612}{#1}"),Ny("\\maroonA","\\textcolor{##ffbde0}{#1}"),Ny("\\maroonB","\\textcolor{##ff92c6}{#1}"),Ny("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Ny("\\maroonD","\\textcolor{##ca337c}{#1}"),Ny("\\maroonE","\\textcolor{##9e034e}{#1}"),Ny("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Ny("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Ny("\\purpleC","\\textcolor{##aa87ff}{#1}"),Ny("\\purpleD","\\textcolor{##7854ab}{#1}"),Ny("\\purpleE","\\textcolor{##543b78}{#1}"),Ny("\\mintA","\\textcolor{##f5f9e8}{#1}"),Ny("\\mintB","\\textcolor{##edf2df}{#1}"),Ny("\\mintC","\\textcolor{##e0e5cc}{#1}"),Ny("\\grayA","\\textcolor{##f6f7f7}{#1}"),Ny("\\grayB","\\textcolor{##f0f1f2}{#1}"),Ny("\\grayC","\\textcolor{##e3e5e6}{#1}"),Ny("\\grayD","\\textcolor{##d6d8da}{#1}"),Ny("\\grayE","\\textcolor{##babec2}{#1}"),Ny("\\grayF","\\textcolor{##888d93}{#1}"),Ny("\\grayG","\\textcolor{##626569}{#1}"),Ny("\\grayH","\\textcolor{##3b3e40}{#1}"),Ny("\\grayI","\\textcolor{##21242c}{#1}"),Ny("\\kaBlue","\\textcolor{##314453}{#1}"),Ny("\\kaGreen","\\textcolor{##71B307}{#1}");var Rv={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Lv{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Cv(Mv,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Sv(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:i,end:n}=this.consumeArg(["]"]))}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new Um("EOF",n.loc)),this.pushTokens(i),t.range(n,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i,r=this.future(),s=0,o=0;do{if(i=this.popToken(),t.push(i),"{"===i.text)++s;else if("}"===i.text){if(-1===--s)throw new Wm("Extra }",i)}else if("EOF"===i.text)throw new Wm("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",i);if(e&&n)if((0===s||1===s&&"{"===e[o])&&i.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==s||n);return"{"===r.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Wm("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var r=this.popToken();if(n[i]!==r.text)throw new Wm("Use of the macro doesn't match its definition",r)}}for(var s=[],o=0;o<e;o++)s.push(this.consumeArg(t&&t[o+1]).tokens);return s}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new Wm("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(null==i||e&&i.unexpandable){if(e&&null==i&&"\\"===n[0]&&!this.isDefined(n))throw new Wm("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var r=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs)for(var o=(r=r.slice()).length-1;o>=0;--o){var a=r[o];if("#"===a.text){if(0===o)throw new Wm("Incomplete placeholder at end of macro body",a);if("#"===(a=r[--o]).text)r.splice(o+1,1);else{if(!/^[1-9]$/.test(a.text))throw new Wm("Not a valid argument number",a);r.splice(o,2,...s[+a.text-1])}}}return this.pushTokens(r),r.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Um(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var i="function"==typeof t?t(this):t;if("string"==typeof i){var r=0;if(-1!==i.indexOf("#"))for(var s=i.replace(/##/g,"");-1!==s.indexOf("#"+(r+1));)++r;for(var o=new Sv(i,this.settings),a=[],l=o.lex();"EOF"!==l.text;)a.push(l),l=o.lex();return a.reverse(),{tokens:a,numArgs:r}}return i}isDefined(e){return this.macros.has(e)||bv.hasOwnProperty(e)||W_.math.hasOwnProperty(e)||W_.text.hasOwnProperty(e)||Rv.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:bv.hasOwnProperty(e)&&!bv[e].primitive}}var Ev=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Dv=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9",ₐ:"a",ₑ:"e",ₕ:"h",ᵢ:"i",ⱼ:"j",ₖ:"k",ₗ:"l",ₘ:"m",ₙ:"n",ₒ:"o",ₚ:"p",ᵣ:"r",ₛ:"s",ₜ:"t",ᵤ:"u",ᵥ:"v",ₓ:"x",ᵦ:"β",ᵧ:"γ",ᵨ:"ρ",ᵩ:"ϕ",ᵪ:"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9",ᴬ:"A",ᴮ:"B",ᴰ:"D",ᴱ:"E",ᴳ:"G",ᴴ:"H",ᴵ:"I",ᴶ:"J",ᴷ:"K",ᴸ:"L",ᴹ:"M",ᴺ:"N",ᴼ:"O",ᴾ:"P",ᴿ:"R",ᵀ:"T",ᵁ:"U",ⱽ:"V",ᵂ:"W",ᵃ:"a",ᵇ:"b",ᶜ:"c",ᵈ:"d",ᵉ:"e",ᶠ:"f",ᵍ:"g",ʰ:"h",ⁱ:"i",ʲ:"j",ᵏ:"k",ˡ:"l",ᵐ:"m",ⁿ:"n",ᵒ:"o",ᵖ:"p",ʳ:"r",ˢ:"s",ᵗ:"t",ᵘ:"u",ᵛ:"v",ʷ:"w",ˣ:"x",ʸ:"y",ᶻ:"z",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),Iv={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Bv={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class jv{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Lv(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new Wm("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Um("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==jv.endOfExpression.indexOf(i.text))break;if(t&&i.text===t)break;if(e&&bv[i.text]&&bv[i.text].infix)break;var r=this.parseAtom(t);if(!r)break;"internal"!==r.type&&n.push(r)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,i=0;i<e.length;i++)if("infix"===e[i].type){if(-1!==n)throw new Wm("only one infix operator per group",e[i].token);n=i,t=e[i].replaceWith}if(-1!==n&&t){var r,s,o=e.slice(0,n),a=e.slice(n+1);return r=1===o.length&&"ordgroup"===o[0].type?o[0]:{type:"ordgroup",mode:this.mode,body:o},s=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},["\\\\abovefrac"===t?this.callFunction(t,[r,e[n],s],[]):this.callFunction(t,[r,s],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),i=n.text;this.consume(),this.consumeSpaces();do{var r;t=this.parseGroup(e)}while("internal"===(null==(r=t)?void 0:r.type));if(!t)throw new Wm("Expected group after '"+i+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]}}parseAtom(e){var t,n,i=this.parseGroup("atom",e);if("internal"===(null==i?void 0:i.type))return i;if("text"===this.mode)return i;for(;;){this.consumeSpaces();var r=this.fetch();if("\\limits"===r.text||"\\nolimits"===r.text){if(i&&"op"===i.type){var s="\\limits"===r.text;i.limits=s,i.alwaysHandleSupSub=!0}else{if(!i||"operatorname"!==i.type)throw new Wm("Limit controls must follow a math operator",r);i.alwaysHandleSupSub&&(i.limits="\\limits"===r.text)}this.consume()}else if("^"===r.text){if(t)throw new Wm("Double superscript",r);t=this.handleSupSubscript("superscript")}else if("_"===r.text){if(n)throw new Wm("Double subscript",r);n=this.handleSupSubscript("subscript")}else if("'"===r.text){if(t)throw new Wm("Double superscript",r);var o={type:"textord",mode:this.mode,text:"\\prime"},a=[o];for(this.consume();"'"===this.fetch().text;)a.push(o),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!Dv[r.text])break;var l=Ev.test(r.text),c=[];for(c.push(new Um(Dv[r.text])),this.consume();;){var d=this.fetch().text;if(!Dv[d])break;if(Ev.test(d)!==l)break;c.unshift(new Um(Dv[d])),this.consume()}var h=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:h}:t={type:"ordgroup",mode:"math",body:h}}}return t||n?{type:"supsub",mode:this.mode,base:i,sup:t,sub:n}:i}parseFunction(e,t){var n=this.fetch(),i=n.text,r=bv[i];if(!r)return null;if(this.consume(),t&&"atom"!==t&&!r.allowedInArgument)throw new Wm("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!r.allowedInText)throw new Wm("Can't use function '"+i+"' in text mode",n);if("math"===this.mode&&!1===r.allowedInMath)throw new Wm("Can't use function '"+i+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(i,r);return this.callFunction(i,s,o,n,e)}callFunction(e,t,n,i,r){var s={funcName:e,parser:this,token:i,breakOnTokenText:r},o=bv[e];if(o&&o.handler)return o.handler(s,t,n);throw new Wm("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var i=[],r=[],s=0;s<n;s++){var o=t.argTypes&&t.argTypes[s],a=s<t.numOptionalArgs;(t.primitive&&null==o||"sqrt"===t.type&&1===s&&null==r[0])&&(o="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",o,a);if(a)r.push(l);else{if(null==l)throw new Wm("Null argument, please report this as a bug");i.push(l)}}return{args:i,optArgs:r}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var i=this.parseArgumentGroup(n,"text");return null!=i?{type:"styling",mode:i.mode,body:[i],style:"text"}:null;case"raw":var r=this.parseStringGroup("raw",n);return null!=r?{type:"raw",mode:"text",string:r.text}:null;case"primitive":if(n)throw new Wm("A primitive argument cannot be optional");var s=this.parseGroup(e);if(null==s)throw new Wm("Expected group as "+e,this.fetch());return s;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new Wm("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var i,r="";"EOF"!==(i=this.fetch()).text;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n,i=this.fetch(),r=i,s="";"EOF"!==(n=this.fetch()).text&&e.test(s+n.text);)s+=(r=n).text,this.consume();if(""===s)throw new Wm("Invalid "+t+": '"+i.text+"'",i);return i.range(r,s)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new Wm("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new Wm("Invalid size: '"+t.text+"'",t);var r={number:+(i[1]+i[2]),unit:i[3]};if(!T_(r))throw new Wm("Invalid unit: '"+r.unit+"'",t);return{type:"size",mode:this.mode,value:r,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var r=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:r};return t&&this.switchMode(i),s}parseGroup(e,t){var n,i=this.fetch(),r=i.text;if("{"===r||"\\begingroup"===r){this.consume();var s="{"===r?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),a=this.fetch();this.expect(s),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Vm.range(i,a),body:o,semisimple:"\\begingroup"===r||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===r[0]&&!Rv.hasOwnProperty(r)){if(this.settings.throwOnError)throw new Wm("Undefined control sequence: "+r,i);n=this.formatUnsupportedCmd(r),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n],r=i.text;"-"===r&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:Vm.range(i,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Vm.range(i,e[n+1]),text:"--"}),t-=1)),"'"!==r&&"`"!==r||e[n+1].text!==r||(e.splice(n,2,{type:"textord",mode:"text",loc:Vm.range(i,e[n+1]),text:r+r}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i="*"===n.charAt(0);if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Wm("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:i}}Bv.hasOwnProperty(t[0])&&!W_[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Bv[t[0]]+t.slice(1));var r,s=xv.exec(t);if(s&&("i"===(t=t.substring(0,s.index))?t="ı":"j"===t&&(t="ȷ")),W_[this.mode][t]){this.settings.strict&&"math"===this.mode&&Cg.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o,a=W_[this.mode][t].group,l=Vm.range(e);if(V_.hasOwnProperty(a)){var c=a;o={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else o={type:a,mode:this.mode,loc:l,text:t};r=o}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(p_(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),r={type:"textord",mode:"text",loc:Vm.range(e),text:t}}if(this.consume(),s)for(var d=0;d<s[0].length;d++){var h=s[0][d];if(!Iv[h])throw new Wm("Unknown accent ' "+h+"'",e);var u=Iv[h][this.mode]||Iv[h].text;if(!u)throw new Wm("Accent "+h+" unsupported in "+this.mode+" mode",e);r={type:"accent",mode:this.mode,loc:Vm.range(e),label:u,isStretchy:!1,isShifty:!0,base:r}}return r}}jv.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var qv=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new jv(e,t);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Wm("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new Um("\\df@tag")])}]}return i};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."));var Hv=function(e,t,n){if(n.throwOnError||!(e instanceof Wm))throw e;var i=qg.makeSpan(["katex-error"],[new q_(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},Fv=function(e,t){var n=new t_(t);try{return function(e,t,n){var i,r=Cb(n);if("mathml"===n.output)return Sb(e,t,r,n.displayMode,!0);if("html"===n.output){var s=ub(e,r);i=qg.makeSpan(["katex"],[s])}else{var o=Sb(e,t,r,n.displayMode,!1),a=ub(e,r);i=qg.makeSpan(["katex"],[o,a])}return Mb(i,n)}(qv(e,n),e,n)}catch(t){return Hv(t,e,n)}},$v=function(e,t){return Fv(e,t).toMarkup()};class Gv{static update(e,t,n,i=!1){return{id:e,name:v.update,size:n,latex:t,block:i}}}class Vv extends ro{_mathml=Kt("");constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return Gm}get mathml(){const e=this.attrs.size+this.info;return Vv.render(e,{displayMode:this.attrs.block})}get attrs(){return this.data.attrs}get meta(){return Vv.meta}build_child(e){}export(){return this.base_export()}gc(){super.base_gc()}update_data(e,t){return Vv.update_data(e,t)}replace_id(e,t={}){return Vv.replace_id(this.root,e,t)}update(e){const{latex:t,block:n,size:i}=e,{courier:r,id:s}=this,o=r.get_recorder();o.add_cmd(e);const a=this.info,l=this.attrs.block,c=this.attrs.size;return this.data.info=t,this.data.attrs.block=n,this.data.attrs.size=i,o.add_recover(Gv.update(s,a,c,l)),o}static render(e,t={}){const n={...t,throwOnError:!1,output:"html"};try{return $v(e,{...n})}catch(e){return""}}static get meta(){return{cubename:"公式",type:n.fomula,block:!1,version:1,show:!0}}static get_default(e="",t={},i={}){return{id:Ts.get_id(),type:n.fomula,info:e,attrs:{block:!1,size:y.h4,...i},css:t}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([Fs(v.update)],Vv.prototype,"update",null);class Uv{static add_title(e,t){return{id:e,name:w.add_title,data:t}}static remove_title(e){return{id:e,name:w.remove_title}}static add_cell(e,t){return{id:e,name:w.add_cell,data:t}}static remove_cell(e,t){return{id:e,name:w.remove_cell,cid:t}}static add_row(e,t,n){return{id:e,name:w.add_row,index:t,rows:n}}static remove_row(e,t){return{id:e,name:w.remove_row,index:t}}static add_col(e,t,n){return{id:e,name:w.add_col,index:t,cols:n}}static remove_col(e,t){return{id:e,name:w.remove_col,index:t}}static moveto(e,t,n){return{id:e,name:w.moveto,tid:t,cells:n}}static merge(e,t){return{id:e,name:w.merge,area:t}}static update_cell_area(e,t,n){return{id:e,name:w.update_area,tid:t,area:n}}static add_grid_col(e,t,n){return{id:e,name:w.add_grid_col,index:t,width:n}}static remove_grid_col(e,t){return{id:e,name:w.remove_grid_col,index:t}}static col_resize(e,t,n){return{id:e,name:w.col_resize,cols:t,step:n}}}function Wv(e,t){const{hotkeys:n,courier:i,id:r,history:s}=t,o=Cs.tips;if(n.validate_hotkeys(e))return;if(!e.ctrlKey)return;e.stopPropagation();const a=e.key.toLowerCase(),l=e.shiftKey,c=t.get_active_cell();if(!c)return o?.tip_info("未发现激活单元格");if(a===P.up)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_row_top(e.top))return o?.tip_info("上方不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[1];e++)r.push(Ql.get_default());n.tell(t,Uv.add_row(t.id,c.row,r)),s.record(n)}else{if(t.get_cell(c.row-1,c.col))return o?.tip_info("上方已存在单元格");if(c.row-1<0)return o?.tip_info("上方已达边界");{const e=i.get_recorder(),n={row:c.row-1,col:c.col,rowspan:1,colspan:1,data:Ql.get_default()};e.tell(t,Uv.add_cell(t.id,n)),s.record(e)}}else if(a===P.down)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_row_bottom(e.bottom))return o?.tip_info("下方不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[1];e++)r.push(Ql.get_default());n.tell(t,Uv.add_row(t.id,c.row+c.rowspan,r)),s.record(n)}else{if(t.get_cell(c.row+1,c.col))return o?.tip_info("下方已存在单元格");if(c.row+1>=t.size[0])return o?.tip_info("下方已达边界");{const e=i.get_recorder(),n={row:c.row+1,col:c.col,rowspan:1,colspan:1,data:Ql.get_default()};e.tell(t,Uv.add_cell(t.id,n)),s.record(e)}}else if(a===P.left)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_col_left(e.left))return o?.tip_info("左侧不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[0];e++)r.push(Ql.get_default());n.tell(t,Uv.add_col(t.id,c.col,r)),s.record(n)}else{if(t.get_cell(c.row,c.col-1))return o?.tip_info("左侧已存在单元格");if(c.col-1<0)return o?.tip_info("左侧已达边界");{const e=i.get_recorder(),n={row:c.row,col:c.col-1,rowspan:1,colspan:1,data:Ql.get_default()};e.tell(t,Uv.add_cell(t.id,n)),s.record(e)}}else if(a===P.right)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_col_right(e.right))return o?.tip_info("右侧不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[0];e++)r.push(Ql.get_default());n.tell(t,Uv.add_col(t.id,c.col+c.colspan,r)),s.record(n)}else{if(t.get_cell(c.row,c.col+1))return o?.tip_info("右侧已存在单元格");if(c.col+1>=t.size[1])return o?.tip_info("右侧已达边界");{const e=i.get_recorder(),n={row:c.row,col:c.col+1,rowspan:1,colspan:1,data:Ql.get_default()};e.tell(t,Uv.add_cell(t.id,n)),s.record(e)}}}const Yv={drag_cell:void 0,hover:void 0};function Xv(e,t){const n=e.currentTarget;n.parentElement?.style.setProperty("--drag-pointer-events","none"),e.stopPropagation(),Yv.drag_cell=t}function Kv(e,t){if(Yv.drag_cell===t)return;const n=e.currentTarget;n.classList.add("cube-cell-selection"),Yv.hover=n}function Jv(e,t){e.currentTarget.classList.remove("cube-cell-selection")}function Qv(e,t){const{drag_cell:n,hover:i}=Yv,{pcube:r,courier:s,history:o}=t.box;if(!n)return;const a=e.currentTarget;a.parentElement?.style.setProperty("--drag-pointer-events","auto"),i&&i.classList.remove("cube-cell-selection");const l=s.get_recorder();l.tell(r,Uv.moveto(r.id,t.box.id,[n.box.id])),o.record(l)}const Zv={anchor:void 0,hover:void 0,down_point:void 0,has_down:!1,has_move:!1};function ew(e,t){const{root:n,cursor:i}=t;if(e.ctrlKey)e.stopPropagation();else{Ts.check_mouse_key(e,"left")&&t.clear_selection();const n=e.target;if(!(n instanceof Node))return;const i=t.find_dom_cube(n),r=i?.find_upstream_untill(t);if(!r)return;const s=t.cells.find(e=>e.box===r);if(!s)return;Zv.down_point={x:e.clientX,y:e.clientY},Zv.has_down=!0,Zv.anchor=s}}function tw(e,t){const{cursor:n}=t,{down_point:i,has_down:r,anchor:s,has_move:o}=Zv;if(!i)return;if(Zv.has_move=Math.sqrt((e.clientX-i.x)**2+(e.clientY-i.y)**2)>5,!r||!s||!o||e.buttons<=0)return;const a=e.target;if(!(a instanceof Node))return;const l=t.find_dom_cube(a),c=l?.find_upstream_untill(t),d=t.cells.find(e=>e.box===c);if(!d||d===s)return void t.clear_selection();const h={left:Math.min(s.col,d.col),right:Math.max(s.col+s.colspan-1,d.col+d.colspan-1),top:Math.min(s.row,d.row),bottom:Math.max(s.row+s.rowspan-1,d.row+d.rowspan-1)},u=t.get_rectarea_cell(h);t.clear_selection();for(let e of u.cells)e.selection=!0;u.cells.length>1&&e.stopPropagation()}function nw(e,t){const{cursor:n}=t;Zv.has_down=!1,Zv.anchor=void 0}const iw=["id","data-type"],rw=Bn({__name:"cube-table",props:{cube:{}},setup(e){const t=qn("dragger"),i=qn("box");function r(e){return{"grid-row":`${e.row+1}/span ${e.rowspan}`,"grid-column":`${e.col+1}/span ${e.colspan}`}}function s(e){return{"cube-cell-selection":e.selection}}const o=vs(()=>({"grid-template-columns":e.cube.cols.map(e=>e>0?e+"fr":"1fr").join(" ")}));return ni(()=>{const n=t.value,r=i.value;if(!n||!r)return;let s=e.cube.data.attrs.width,o=s;const a=new Es.DragDiff(n);a.register_down(()=>{s=e.cube.data.attrs.width}),a.register_move((t,n)=>{s+t<e.cube.min_width||(o=s+t,r.style.width=o+"px")}),a.register_up((t,n)=>{if(o===s)return;const{courier:i,history:r}=e.cube,a=i.get_recorder();a.tell(e.cube,Rs.resize(e.cube.id,o)),r.record(a)}),a.register_cancel(()=>{r.style.width=s+"px"})}),(e,a)=>(Nr(),Dr("div",{ref_key:"box",ref:i,class:"cube-table",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).table,onPointerdown:a[0]||(a[0]=t=>Zt(ew)(t,e.cube)),onPointermove:a[1]||(a[1]=t=>Zt(tw)(t,e.cube)),onPointerup:a[2]||(a[2]=t=>Zt(nw)(t,e.cube)),onPointercancel:a[3]||(a[3]=t=>Zt(nw)(t,e.cube)),onKeyup:a[4]||(a[4]=t=>Zt(Wv)(t,e.cube)),onContextmenu:a[5]||(a[5]=t=>Zt(Io)(t,e.cube))},[e.cube.title?(Nr(),Ir(ia,{key:0,class:"cube-table-title",cube:Ut(e.cube.title)},null,8,["cube"])):Yr("v-if",!0),Fr("div",{class:"cube-table-container",style:me(o.value)},[(Nr(!0),Dr(Cr,null,_i(e.cube.cells,(e,t)=>(Nr(),Ir(ia,{key:e.box.id,cube:Ut(e.box),style:me(r(e)),class:ve(s(e)),draggable:"true",onDragstart:t=>Zt(Xv)(t,e),onDragenter:t=>Zt(Kv)(t,e),onDragleave:t=>Zt(Jv)(t,e),onDrop:t=>Zt(Qv)(t,e)},null,8,["cube","style","class","onDragstart","onDragenter","onDragleave","onDrop"]))),128))],4),Fr("div",{class:"cube-table-dragger",ref_key:"dragger",ref:t},null,512)],44,iw))}}),sw=(0,Uo.A)(rw,[["__scopeId","data-v-47068d72"]]);function ow(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class aw extends ro{cells=It([]);_title=Kt(void 0);get title(){return this._title.value}set title(e){this._title.value=e}get component(){return sw}get meta(){return aw.meta}get children(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),this.title&&e.unshift(this.title),e.push(...t.map(e=>e.box)),e}get cells_sorted(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),e.push(...t),e}get css(){const e=this.attrs;return{...super.css,width:e.width+"px"}}get attrs(){return this.data.attrs}get cols(){return this.data.info.cols}get size(){return this.data.info.size}get selection_cells(){const e=[];for(let t of this.cells_sorted)t.selection&&e.push(t);return e}get min_width(){return 500}constructor(e,t){super(e,t);return this.setup(e,t)}build_child(e){e.info.title&&(this.title=Ut(new Ql(e.info.title,this)));for(let t of e.info.cells){const e=new Ql(t.data,this),n={row:t.row,col:t.col,rowspan:t.rowspan,colspan:t.colspan,box:Ut(e),selection:!1};this.cells.push(n)}}export(){const e=this.base_export();this.title&&(e.info.title=this.title.export()),e.info.cells=[];for(let t of this.cells)e.info.cells.push(this.get_cell_data(t));return e}update_data(e,t){return aw.update_data(e,t)}gc(){this.base_gc()}get_cell_data(e){return{row:e.row,col:e.col,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()}}replace_id(e,t={}){return aw.replace_id(this.root,e,t)}get_rows(e){const t=[];for(let n of this.cells_sorted)e>=n.row&&e<n.row+n.rowspan&&t.push(n);return t}get_cols(e){const t=[];for(let n of this.cells_sorted)e>=n.col&&e<n.col+n.colspan&&t.push(n);return t}check_orderly_col(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const i=1===new Set(n.map(e=>e.right)).size,r=1===new Set(n.map(e=>e.left)).size;return i&&r}check_orderly_col_left(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.left)).size}check_orderly_col_right(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.right)).size}check_orderly_row(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const i=1===new Set(n.map(e=>e.bottom)).size,r=1===new Set(n.map(e=>e.top)).size;return i&&r}check_orderly_row_top(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));new Set(n.map(e=>e.bottom)).size;return 1===new Set(n.map(e=>e.top)).size}check_orderly_row_bottom(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.bottom)).size}get_cell_area(e){return{left:e.col,right:e.col+e.colspan-1,top:e.row,bottom:e.row+e.rowspan-1}}get_cell(e,t){for(let n of this.cells){const i=e>=n.row&&e<n.row+n.rowspan,r=t>=n.col&&t<n.col+n.colspan;if(i&&r)return n}}get_rectarea_cell(e){let t=!1;for(;!t;){const{left:n,right:i,top:r,bottom:s}=e;for(let o of this.cells){let{row:a,rowspan:l,col:c,colspan:d}=o,h=a,u=a+l-1,p=c,f=c+d-1;if(n>=p&&n<=f||n<=p&&f<=i||i>=p&&i<=f){if(h<r&&u>=r){e.top=a;break}if(h<=s&&u>s){e.bottom=a+l-1;break}}if(r>=h&&r<=u||r<h&&s>=u||s>=h&&s<=u){if(p<n&&f>=n){e.left=c;break}if(p<=i&&f>i){e.right=c+d-1;break}}o===this.cells[this.cells.length-1]&&(t=!0)}}const n=[];for(let t of this.cells_sorted){let{row:i,col:r,rowspan:s,colspan:o}=t;r>=e.left&&r+o-1<=e.right&&i>=e.top&&i+s-1<=e.bottom&&n.push(t)}return{...e,cells:n}}clear_selection(){for(let e of this.cells)e.selection=!1}get_active_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t?.find_upstream_untill(this);return this.cells.find(e=>e.box===n)}set_selection_area(e){this.get_rectarea_cell(e);for(let e of this.cells)e.selection=!1;for(let e of this.cells)e.selection=!0}get_focus_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t.find_upstream_untill(this);return n?this.cells.find(e=>e.box.id===n.id):void 0}get_selection_area(){let e,t;const n=this.selection_cells;if(0===n.length)return;for(let i of n){const n=this.get_cell_area(i);e||(e=[n.top,n.bottom]),t||(t=[n.left,n.right]),n.top<e[0]&&(e[0]=n.top),n.left<t[0]&&(t[0]=n.left),n.bottom>e[1]&&(e[1]=n.bottom),n.right>t[1]&&(t[1]=n.right)}if(!e||!t)return;return{left:t[0],right:t[1],top:e[0],bottom:e[1]}}get_selection_size(){const e=this.get_selection_area();if(e)return[e.bottom-e.top+1,e.right-e.left+1]}get_selection_text(){const e=this.selection_cells;let t="";if(0===e.length)return t;for(let n of e)t+=n.box.text;return t}copy_selection_table(){const e=this.get_selection_size(),t=this.selection_cells,n=this.get_selection_area();if(!e||!t||!n)return;const i=[];for(let e of t)i.push({row:e.row-n.top,col:e.col-n.left,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()});const r=aw.get_default_by_data(e,i);return r.attrs=structuredClone(Vt(this.attrs)),r}add_title(e){const{data:t}=e,{courier:n,cursor:i,id:r}=this,s=n.get_recorder();s.add_cmd(e);const o=new Ql(t,this);return this.title=Ut(o),s.add_recover(Uv.remove_title(r)),s}remove_title(e){const{id:t,courier:n,cursor:i}=this;if(!this.title)return;const r=this.title.export(),s=n.get_recorder();return s.add_cmd(e),this.title=void 0,s.add_recover(Uv.add_title(t,r)),s}add_cell(e){const{id:t,courier:n,cursor:i}=this,{data:r}=e;this.clear_selection();const s=n.get_recorder();s.add_cmd(e);const o={row:r.row,col:r.col,rowspan:r.rowspan,colspan:r.colspan,box:Ut(new Ql(r.data,this)),selection:!1};return this.cells.push(o),s.add_recover(Uv.remove_cell(t,o.box.id)),s}remove_cell(e){const{id:t,courier:n,cursor:i}=this,{cid:r}=e,s=n.get_recorder();s.add_cmd(e);const o=this.cells.findIndex(e=>e.box.id===r),a=this.cells[o];if(!a)return;const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan,data:a.box.export()};return o>=0&&this.cells.splice(o,1),s.add_recover(Uv.add_cell(t,l)),s}add_row(e){const{courier:t,cursor:n,id:i}=this,{index:r,rows:s}=e,o=t.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:r,col:e,rowspan:1,colspan:1,data:t})}this.size[0]++;for(let e of this.cells)e.row<r||o.tell(this,Uv.update_cell_area(i,e.box.id,{row:e.row+1,col:e.col,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,Uv.add_cell(i,e));return o}remove_row(e){const{id:t,courier:n,cursor:i}=this,{index:r}=e,s=this.get_rows(r),o=n.get_recorder();for(let e of s)o.tell(this,Uv.remove_cell(t,e.box.id));return this.size[0]--,o}add_col(e){const{id:t,cursor:n,courier:i}=this,{index:r,cols:s}=e,o=i.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:e,col:r,rowspan:1,colspan:1,data:t})}o.tell(this,Uv.add_grid_col(t,r,2));for(let e of this.cells)e.col<r||o.tell(this,Uv.update_cell_area(t,e.box.id,{row:e.row,col:e.col+1,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,Uv.add_cell(t,e));return o}remove_col(e){const{id:t,cursor:n,courier:i}=this,{index:r}=e;if(!this.check_orderly_col(r))return Cs.tips?.tip_info("目标列不整齐");let s;for(let e=0;e<=this.size[0]&&(s||(s=this.get_cell(e,r),!s));e++);if(!s)return;const o=i.get_recorder();for(let e=s.col;e<s.col+s.colspan;e++)o.tell(this,Uv.remove_grid_col(t,e));const a=this.get_cols(r);for(let e of a)o.tell(this,Uv.remove_cell(t,e.box.id));for(let e of this.cells){if(e.col<r)continue;const n={row:e.row,col:e.col-1,rowspan:e.rowspan,colspan:e.colspan};o.tell(this,Uv.update_cell_area(t,e.box.id,n))}return o}moveto(e){const{id:t,courier:n,cursor:i}=this,{tid:r,cells:s}=e,o=n.get_recorder(),a=this.cells.find(e=>e.box.id===r);if(!a)return;const l=a.box,c=this.cells_sorted.filter(e=>e.box.id!==r&&s.includes(e.box.id));for(let e of c){const n=e.box.export();o.tell(this,Uv.remove_cell(t,e.box.id)),o.tell(l,Rs.insert_child(l.id,n.info,l.child_count))}return o}update_area(e){const{id:t,courier:n,cursor:i}=this,{tid:r,area:s}=e,o=n.get_recorder(),a=this.cells.find(e=>e.box.id===r);if(!a)return;o.add_cmd(e);const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return a.row=s.row,a.col=s.col,a.rowspan=s.rowspan,a.colspan=s.colspan,o.add_recover(Uv.update_cell_area(t,r,l)),o}merge_cell(e){const{id:t,cursor:n,courier:i}=this,{area:r}=e,s=i.get_recorder(),o=this.get_rectarea_cell(r);let a=o.cells[0];if(!a)return;const l={row:r.top,col:r.left,rowspan:r.bottom-r.top+1,colspan:r.right-r.left+1},c=a.box.id;return s.tell(this,Uv.update_cell_area(t,c,l)),s.tell(this,Uv.moveto(t,c,o.cells.map(e=>e.box.id))),s}add_grid_col(e){const{id:t,courier:n,cursor:i}=this,{index:r,width:s}=e,o=n.get_recorder();return o.add_cmd(e),this.cols.splice(r,0,s),this.size[1]++,o.add_recover(Uv.remove_grid_col(t,r)),o}remove_grid_col(e){const{id:t,courier:n,cursor:i}=this,{index:r}=e,s=n.get_recorder(),o=this.cols.splice(r,1);if(0!==o.length)return this.size[1]--,s.add_recover(Uv.add_grid_col(t,r,o[0])),s}col_resize(e){const{id:t,courier:n,cursor:i}=this,{cols:r,step:s}=e,o=n.get_recorder();o.add_cmd(e);let a=!1;for(let e=r[0];e<=r[1];e++){let t=this.cols[e]+s;t<=0||(a=!0,this.cols[e]=t)}if(a)return o.add_recover(Uv.col_resize(t,r,-s)),o}delete_child(e){const{dir:t,range:n,reserve:i}=e,{courier:r,cursor:s,history:o}=this,a=r.get_recorder();let[l,c]=this.get_valid_range(n);if(0===l&&c>=this.child_count)if(i){if(this.is_empty)return;const e=this.child_first;a.tell(this,Rs.delete_child(this.id,"backward",[1,this.child_count],i)),a.tell(e,Rs.delete_child(e.id,"backward",[0,e.child_count],i))}else a.merge(this.remove_self());else{let e=[];for(let t=l;t<c;t++){let n=this.children[t];e.push(n.id)}for(let t of e)a.tell(this,Uv.remove_cell(this.id,t))}return a}static get meta(){return{cubename:"表格",type:n.table,block:!0,version:1,show:!0}}static get_default(e=3,t=3){const i=[],r=[];r.length=t,r.fill(2);for(let n=0;n<e;n++)for(let e=0;e<t;e++){const t={row:n,col:e,rowspan:1,colspan:1,data:Ql.get_default()};i.push(t)}return{id:Ts.get_id(),type:n.table,info:{size:[e,t],cols:r,cells:i},attrs:{width:500},css:{}}}static get_default_by_data(e,t){const[i,r]=e,s=[];return s.length=r,s.fill(2),{id:Ts.get_id(),type:n.table,info:{size:[i,r],cols:s,cells:t},attrs:{width:500},css:{}}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();n[i]=r,t.id=r,t.info.title&&(t.info.title=Ql.replace_id(e,t.info.title,n));for(let i of t.info.cells)i.data=Ql.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}ow([Fs(w.add_title)],aw.prototype,"add_title",null),ow([Fs(w.remove_title)],aw.prototype,"remove_title",null),ow([Fs(w.add_cell)],aw.prototype,"add_cell",null),ow([Fs(w.remove_cell)],aw.prototype,"remove_cell",null),ow([Fs(w.add_row)],aw.prototype,"add_row",null),ow([Fs(w.remove_row)],aw.prototype,"remove_row",null),ow([Fs(w.add_col)],aw.prototype,"add_col",null),ow([Fs(w.remove_col)],aw.prototype,"remove_col",null),ow([Fs(w.moveto)],aw.prototype,"moveto",null),ow([Fs(w.update_area)],aw.prototype,"update_area",null),ow([Fs(w.merge)],aw.prototype,"merge_cell",null),ow([Fs(w.add_grid_col)],aw.prototype,"add_grid_col",null),ow([Fs(w.remove_grid_col)],aw.prototype,"remove_grid_col",null),ow([Fs(w.col_resize)],aw.prototype,"col_resize",null),ow([Fs(i.cube_delete_child)],aw.prototype,"delete_child",null);const lw=["id","data-type"],cw=Bn({__name:"cube-tip",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Dr("div",{class:"cube-tip",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).tip},[$r(ia,{cube:e.cube.box},null,8,["cube"])],12,lw))}),dw=(0,Uo.A)(cw,[["__scopeId","data-v-433bbb71"]]);function hw(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class uw extends ro{get component(){return dw}get children(){return[this.box]}box;constructor(e,t){return super(e,t),this.setup(e,t)}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof ro&&r.push(e.export());return{children:i,data:r}}replace_id(e,t={}){return uw.replace_id(this.root,e,t)}build_child(e){this.box=new Ql(e.info,this)}update_data(e,t){return uw.update_data(e,t)}export(){const e=this.base_export();return e.info=this.box.export(),e}gc(){super.base_gc()}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Rs.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,Ls.in_head(a.id)):r.tell(this.child_last,Ls.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,s=t.get_recorder();s.add_cmd(e);const{dir:o,range:a}=e,[l,c]=a;let d=l<0?0:l,h=c>this.child_count?this.child_count:c;if(d>=h)return;if(d<=0&&h>=this.child_count)return this.is_empty?s.tell(r,Rs.delete_child(n,o,[i,i+1])):s.tell(this,Rs.reset(this.id,[])),s;const u=this.children[d-1],p=this.children[h],f=h-d;let m=this.splice(l,f);return s.add_recover(Rs.insert_child(this.id,m.data,l)),"backward"===o?u?s.tell(u,Ls.in_tail(u.id)):p&&s.tell(p,Ls.in_head(p.id)):"forward"===o&&(p?s.tell(p,Ls.in_head(p.id)):u&&s.tell(u,Ls.in_tail(u.id))),s}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new Os(t),s=[];for(let e of this.children)s.push(e.export());const o=Ts.build_cubes(i,this);this.splice(0,this.child_count,...o);return r.add_recover(Rs.reset(this.id,s)),r}get meta(){return uw.meta}static get meta(){return{cubename:"提示",type:n.tip,block:!0,version:1,show:!0}}static get_default(e,t={},i={}){return{id:Ts.get_id(),type:n.tip,info:Ql.get_default(e),attrs:i,css:t}}static get_default_by_string(e,t={},i={}){const r=Wl.get_default_by_string(e),s=Ql.get_default([r]);return{id:Ts.get_id(),type:n.tip,info:s,attrs:i,css:t}}static replace_id(e,t,n={}){const i=t.id,r=Ts.get_id();return n[i]=r,t.id=r,t.info=Ql.replace_id(e,t.info,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}hw([Fs(i.cube_insert_child)],uw.prototype,"on_insert_child",null),hw([Fs(i.cube_delete_child)],uw.prototype,"on_delete_child",null),hw([Fs(i.cube_reset)],uw.prototype,"on_reset",null);const pw=["id","data-type"],fw=Bn({__name:"cube-box-columns",props:{cube:{}},setup(e){const t=Kt(),i=Kt();It({open:!1});let r;return ni(()=>{const n=t.value;if(!n)return;const s=i.value;if(!s)return;r=new Es.DragDiff(s);let o=e.cube.attrs.width,a=e.cube.attrs.height,l=o,c=a;r.register_down(()=>{o=e.cube.attrs.width,a=e.cube.attrs.height}),r.register_move((t,i)=>{l=Math.round(t+o),l<e.cube.min_width&&(l=e.cube.min_width),n.style.width=l+"px",n.style.height=c+"px"}),r.register_up((t,n)=>{if(o===l&&a===c)return;const i=e.cube.courier.get_recorder(),r=Math.round(t+o);i.tell(e.cube,Rs.resize(e.cube.id,r)),e.cube.history.record(i)}),r.register_cancel(()=>{e.cube.attrs.width=o,e.cube.attrs.height=a})}),oi(()=>{r?.off()}),(r,s)=>(Nr(),Dr("div",{class:"cube-box-columns",ref_key:"box",ref:t,style:me(r.cube.css),id:r.cube.id,"data-type":Zt(n).box_columns,onContextmenu:s[0]||(s[0]=e=>Zt(Io)(e,r.cube))},[Fr("div",{class:"box-columns-content",style:me(e.cube.attrs.column_count?{"column-count":e.cube.attrs.column_count}:e.cube.attrs.column_width?{"column-width":e.cube.attrs.column_width+"px"}:{})},[(Nr(!0),Dr(Cr,null,_i(r.cube.children,e=>(Nr(),Ir(ia,{key:e.id,cube:e},null,8,["cube"]))),128))],4),Fr("div",{class:"box-columns-dragger",ref_key:"dragger",ref:i},null,512)],44,pw))}}),mw=(0,Uo.A)(fw,[["__scopeId","data-v-84430922"]]);function _w(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class gw extends ro{constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return mw}get css(){const{width:e}=this.data.attrs;return{...super.css,width:e+"px"}}get attrs(){return this.data.attrs}get meta(){return gw.meta}get min_width(){return 200}build_child(e){const t=Ts.build_cubes(e.info,this);this._children.push(...t)}update_data(e,t){return gw.update_data(e,t)}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}gc(){this.base_gc()}replace_id(e,t){return gw.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t,history:n}=this,{data:i}=e,r=t.get_recorder();r.add_cmd(e);const s=Ts.build_cubes(e.data,this),o=this.child_count;return this._children.push(...s),r.add_recover(Rs.delete_child(this.id,"backward",[o,this.child_count])),r}on_delete_child(e){const{courier:t,history:n}=this,{dir:i,range:r,reserve:s}=e,o=t.get_recorder(),a=this.get_valid_index(r[0]),l=this.get_valid_index(r[1]),c=[],d=this._children.splice(a,l-a);for(let e of d)c.push(e.export());return o.add_recover(Rs.insert_child(this.id,c,a)),o}static replace_id(e,t,n){const i=t.id,r=n[i]||Ts.get_id();return n[i]=r,t.id=r,Ts.replace_id(e,e.cube_versions,t.info,n),t}static get_default(){const e=Ql.get_default(),t=Ql.get_default(),i=Ql.get_default();return{id:Ts.get_id(),type:n.box_columns,info:[e,t,i],attrs:{width:400,column_count:3},css:{}}}static get meta(){return{cubename:"多列容器",type:n.box_columns,block:!0,version:1,show:!0}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}_w([Fs(i.cube_insert_child)],gw.prototype,"on_insert_child",null),_w([Fs(i.cube_delete_child)],gw.prototype,"on_delete_child",null);class bw{static reset(e,t){return{id:e,name:S.reset_explanation,explanation:t}}}const yw=["id","data-type"],vw=Bn({__name:"cube-rt",props:{cube:{}},setup(e){const{event:t}=e.cube;function i(){t.emit_show_cube_editor(e.cube)}return(t,r)=>(Nr(),Dr("ruby",{class:"cube-rt",id:t.cube.id,style:me(t.cube.css),"data-type":Zt(n).rt,onClick:i},[Ur(Ce(t.cube.info.text)+" ",1),Fr("rt",{style:me({"font-size":`max(calc(0.6 * ${e.cube.css["font-size"]||"16px"}),${xw.min_size}px)`})},Ce(t.cube.info.explanation),5),r[0]||(r[0]=Ur(" ",-1))],12,yw))}}),ww=vw;class xw extends ro{data;static get min_size(){return 12}static get scale(){return.6}constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return ww}get meta(){return xw.meta}build_child(e){}update_data(e,t){return xw.update_data(e,t)}export(){return this.base_export()}gc(){this.base_gc()}replace_id(e,t){return xw.replace_id(this.root,e,t)}reset_explanation(e){const{explanation:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=this.info.explanation;this.info.explanation=t;const s=bw.reset(this.id,r);return i.add_recover(s),i}static get meta(){return{cubename:"标注文本",type:n.rt,block:!1,version:1,show:!1}}static get_default(e="",t="",i={}){return{id:Ts.get_id(),type:n.rt,info:{text:e,explanation:t},attrs:{},css:i}}static replace_id(e,t,n){const i=t.id;return t.id=n[i]||Ts.get_id(),n[i]=t.id,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([Fs(S.reset_explanation)],xw.prototype,"reset_explanation",null)})(),s})());
|