deepsky-core 1.83.2 → 1.83.7
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/index.css +113 -103
- package/dist/index.d.ts +6 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
- /package/dist/chunk/{1037-140ecdca17488a71c4a8.js → 1037-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1066-140ecdca17488a71c4a8.js → 1066-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1216-140ecdca17488a71c4a8.js → 1216-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1230-140ecdca17488a71c4a8.js → 1230-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1425-140ecdca17488a71c4a8.js → 1425-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1432-140ecdca17488a71c4a8.js → 1432-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1476-140ecdca17488a71c4a8.js → 1476-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1545-140ecdca17488a71c4a8.js → 1545-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{16-140ecdca17488a71c4a8.js → 16-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1624-140ecdca17488a71c4a8.js → 1624-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1631-140ecdca17488a71c4a8.js → 1631-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1655-140ecdca17488a71c4a8.js → 1655-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1708-140ecdca17488a71c4a8.js → 1708-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{172-140ecdca17488a71c4a8.js → 172-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1729-140ecdca17488a71c4a8.js → 1729-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1757-140ecdca17488a71c4a8.js → 1757-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1803-140ecdca17488a71c4a8.js → 1803-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1839-140ecdca17488a71c4a8.js → 1839-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1857-140ecdca17488a71c4a8.js → 1857-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{1931-140ecdca17488a71c4a8.js → 1931-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2062-140ecdca17488a71c4a8.js → 2062-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2068-140ecdca17488a71c4a8.js → 2068-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2071-140ecdca17488a71c4a8.js → 2071-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2108-140ecdca17488a71c4a8.js → 2108-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{212-140ecdca17488a71c4a8.js → 212-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2142-140ecdca17488a71c4a8.js → 2142-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2173-140ecdca17488a71c4a8.js → 2173-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2184-140ecdca17488a71c4a8.js → 2184-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2215-140ecdca17488a71c4a8.js → 2215-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{224-140ecdca17488a71c4a8.js → 224-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2266-140ecdca17488a71c4a8.js → 2266-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2354-140ecdca17488a71c4a8.js → 2354-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2419-140ecdca17488a71c4a8.js → 2419-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{245-140ecdca17488a71c4a8.js → 245-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2473-140ecdca17488a71c4a8.js → 2473-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2492-140ecdca17488a71c4a8.js → 2492-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2505-140ecdca17488a71c4a8.js → 2505-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2535-140ecdca17488a71c4a8.js → 2535-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2660-140ecdca17488a71c4a8.js → 2660-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2691-140ecdca17488a71c4a8.js → 2691-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2723-140ecdca17488a71c4a8.js → 2723-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{284-140ecdca17488a71c4a8.js → 284-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2860-140ecdca17488a71c4a8.js → 2860-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2861-140ecdca17488a71c4a8.js → 2861-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{2934-140ecdca17488a71c4a8.js → 2934-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3032-140ecdca17488a71c4a8.js → 3032-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3043-140ecdca17488a71c4a8.js → 3043-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3052-140ecdca17488a71c4a8.js → 3052-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3124-140ecdca17488a71c4a8.js → 3124-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3170-140ecdca17488a71c4a8.js → 3170-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{321-140ecdca17488a71c4a8.js → 321-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3227-140ecdca17488a71c4a8.js → 3227-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3247-140ecdca17488a71c4a8.js → 3247-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{327-140ecdca17488a71c4a8.js → 327-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3279-140ecdca17488a71c4a8.js → 3279-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3330-140ecdca17488a71c4a8.js → 3330-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3403-140ecdca17488a71c4a8.js → 3403-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3454-140ecdca17488a71c4a8.js → 3454-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3492-140ecdca17488a71c4a8.js → 3492-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3516-140ecdca17488a71c4a8.js → 3516-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3593-140ecdca17488a71c4a8.js → 3593-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3646-140ecdca17488a71c4a8.js → 3646-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3702-140ecdca17488a71c4a8.js → 3702-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3720-140ecdca17488a71c4a8.js → 3720-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3837-140ecdca17488a71c4a8.js → 3837-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3874-140ecdca17488a71c4a8.js → 3874-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3894-140ecdca17488a71c4a8.js → 3894-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3906-140ecdca17488a71c4a8.js → 3906-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3941-140ecdca17488a71c4a8.js → 3941-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3947-140ecdca17488a71c4a8.js → 3947-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3949-140ecdca17488a71c4a8.js → 3949-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{396-140ecdca17488a71c4a8.js → 396-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{3972-140ecdca17488a71c4a8.js → 3972-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4007-140ecdca17488a71c4a8.js → 4007-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4009-140ecdca17488a71c4a8.js → 4009-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{402-140ecdca17488a71c4a8.js → 402-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4081-140ecdca17488a71c4a8.js → 4081-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{41-140ecdca17488a71c4a8.js → 41-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4108-140ecdca17488a71c4a8.js → 4108-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4112-140ecdca17488a71c4a8.js → 4112-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{415-140ecdca17488a71c4a8.js → 415-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4199-140ecdca17488a71c4a8.js → 4199-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4214-140ecdca17488a71c4a8.js → 4214-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4236-140ecdca17488a71c4a8.js → 4236-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4283-140ecdca17488a71c4a8.js → 4283-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4292-140ecdca17488a71c4a8.js → 4292-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4311-140ecdca17488a71c4a8.js → 4311-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4354-140ecdca17488a71c4a8.js → 4354-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4385-140ecdca17488a71c4a8.js → 4385-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4408-140ecdca17488a71c4a8.js → 4408-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4445-140ecdca17488a71c4a8.js → 4445-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4451-140ecdca17488a71c4a8.js → 4451-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4452-140ecdca17488a71c4a8.js → 4452-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4465-140ecdca17488a71c4a8.js → 4465-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4520-140ecdca17488a71c4a8.js → 4520-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{454-140ecdca17488a71c4a8.js → 454-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4546-140ecdca17488a71c4a8.js → 4546-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4552-140ecdca17488a71c4a8.js → 4552-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4598-140ecdca17488a71c4a8.js → 4598-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4614-140ecdca17488a71c4a8.js → 4614-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4660-140ecdca17488a71c4a8.js → 4660-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4697-140ecdca17488a71c4a8.js → 4697-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4709-140ecdca17488a71c4a8.js → 4709-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4714-140ecdca17488a71c4a8.js → 4714-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4780-140ecdca17488a71c4a8.js → 4780-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4838-140ecdca17488a71c4a8.js → 4838-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4843-140ecdca17488a71c4a8.js → 4843-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4862-140ecdca17488a71c4a8.js → 4862-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4877-140ecdca17488a71c4a8.js → 4877-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4886-140ecdca17488a71c4a8.js → 4886-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{489-140ecdca17488a71c4a8.js → 489-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4914-140ecdca17488a71c4a8.js → 4914-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4940-140ecdca17488a71c4a8.js → 4940-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{4962-140ecdca17488a71c4a8.js → 4962-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5026-140ecdca17488a71c4a8.js → 5026-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5034-140ecdca17488a71c4a8.js → 5034-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5050-140ecdca17488a71c4a8.js → 5050-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5099-140ecdca17488a71c4a8.js → 5099-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5119-140ecdca17488a71c4a8.js → 5119-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5141-140ecdca17488a71c4a8.js → 5141-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5143-140ecdca17488a71c4a8.js → 5143-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5177-140ecdca17488a71c4a8.js → 5177-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5203-140ecdca17488a71c4a8.js → 5203-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5283-140ecdca17488a71c4a8.js → 5283-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5314-140ecdca17488a71c4a8.js → 5314-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{535-140ecdca17488a71c4a8.js → 535-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5363-140ecdca17488a71c4a8.js → 5363-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{542-140ecdca17488a71c4a8.js → 542-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5424-140ecdca17488a71c4a8.js → 5424-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5443-140ecdca17488a71c4a8.js → 5443-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5521-140ecdca17488a71c4a8.js → 5521-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5536-140ecdca17488a71c4a8.js → 5536-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5542-140ecdca17488a71c4a8.js → 5542-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5585-140ecdca17488a71c4a8.js → 5585-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5589-140ecdca17488a71c4a8.js → 5589-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5601-140ecdca17488a71c4a8.js → 5601-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5611-140ecdca17488a71c4a8.js → 5611-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5628-140ecdca17488a71c4a8.js → 5628-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5638-140ecdca17488a71c4a8.js → 5638-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5647-140ecdca17488a71c4a8.js → 5647-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5709-140ecdca17488a71c4a8.js → 5709-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5728-140ecdca17488a71c4a8.js → 5728-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5731-140ecdca17488a71c4a8.js → 5731-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5744-140ecdca17488a71c4a8.js → 5744-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5814-140ecdca17488a71c4a8.js → 5814-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5827-140ecdca17488a71c4a8.js → 5827-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5884-140ecdca17488a71c4a8.js → 5884-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5891-140ecdca17488a71c4a8.js → 5891-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5936-140ecdca17488a71c4a8.js → 5936-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{5954-140ecdca17488a71c4a8.js → 5954-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6010-140ecdca17488a71c4a8.js → 6010-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6045-140ecdca17488a71c4a8.js → 6045-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6083-140ecdca17488a71c4a8.js → 6083-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6124-140ecdca17488a71c4a8.js → 6124-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6173-140ecdca17488a71c4a8.js → 6173-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6239-140ecdca17488a71c4a8.js → 6239-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6262-140ecdca17488a71c4a8.js → 6262-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6283-140ecdca17488a71c4a8.js → 6283-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6297-140ecdca17488a71c4a8.js → 6297-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6324-140ecdca17488a71c4a8.js → 6324-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6343-140ecdca17488a71c4a8.js → 6343-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6356-140ecdca17488a71c4a8.js → 6356-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{638-140ecdca17488a71c4a8.js → 638-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6405-140ecdca17488a71c4a8.js → 6405-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6514-140ecdca17488a71c4a8.js → 6514-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6517-140ecdca17488a71c4a8.js → 6517-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6563-140ecdca17488a71c4a8.js → 6563-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6577-140ecdca17488a71c4a8.js → 6577-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6677-140ecdca17488a71c4a8.js → 6677-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6736-140ecdca17488a71c4a8.js → 6736-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6757-140ecdca17488a71c4a8.js → 6757-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6865-140ecdca17488a71c4a8.js → 6865-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6940-140ecdca17488a71c4a8.js → 6940-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6957-140ecdca17488a71c4a8.js → 6957-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6964-140ecdca17488a71c4a8.js → 6964-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6967-140ecdca17488a71c4a8.js → 6967-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{697-140ecdca17488a71c4a8.js → 697-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{6980-140ecdca17488a71c4a8.js → 6980-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7095-140ecdca17488a71c4a8.js → 7095-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7141-140ecdca17488a71c4a8.js → 7141-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7145-140ecdca17488a71c4a8.js → 7145-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7148-140ecdca17488a71c4a8.js → 7148-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7217-140ecdca17488a71c4a8.js → 7217-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7258-140ecdca17488a71c4a8.js → 7258-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7328-140ecdca17488a71c4a8.js → 7328-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7374-140ecdca17488a71c4a8.js → 7374-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7434-140ecdca17488a71c4a8.js → 7434-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7470-140ecdca17488a71c4a8.js → 7470-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7504-140ecdca17488a71c4a8.js → 7504-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{753-140ecdca17488a71c4a8.js → 753-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7549-140ecdca17488a71c4a8.js → 7549-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7561-140ecdca17488a71c4a8.js → 7561-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7567-140ecdca17488a71c4a8.js → 7567-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7611-140ecdca17488a71c4a8.js → 7611-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7615-140ecdca17488a71c4a8.js → 7615-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7625-140ecdca17488a71c4a8.js → 7625-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7642-140ecdca17488a71c4a8.js → 7642-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7670-140ecdca17488a71c4a8.js → 7670-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7681-140ecdca17488a71c4a8.js → 7681-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7688-140ecdca17488a71c4a8.js → 7688-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7765-140ecdca17488a71c4a8.js → 7765-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7768-140ecdca17488a71c4a8.js → 7768-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7788-140ecdca17488a71c4a8.js → 7788-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7789-140ecdca17488a71c4a8.js → 7789-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{780-140ecdca17488a71c4a8.js → 780-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7817-140ecdca17488a71c4a8.js → 7817-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7824-140ecdca17488a71c4a8.js → 7824-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7831-140ecdca17488a71c4a8.js → 7831-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7900-140ecdca17488a71c4a8.js → 7900-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7922-140ecdca17488a71c4a8.js → 7922-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7927-140ecdca17488a71c4a8.js → 7927-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{794-140ecdca17488a71c4a8.js → 794-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{7966-140ecdca17488a71c4a8.js → 7966-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8003-140ecdca17488a71c4a8.js → 8003-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8093-140ecdca17488a71c4a8.js → 8093-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8107-140ecdca17488a71c4a8.js → 8107-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8201-140ecdca17488a71c4a8.js → 8201-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8212-140ecdca17488a71c4a8.js → 8212-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8234-140ecdca17488a71c4a8.js → 8234-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8235-140ecdca17488a71c4a8.js → 8235-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8237-140ecdca17488a71c4a8.js → 8237-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8249-140ecdca17488a71c4a8.js → 8249-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8320-140ecdca17488a71c4a8.js → 8320-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8389-140ecdca17488a71c4a8.js → 8389-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8393-140ecdca17488a71c4a8.js → 8393-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8418-140ecdca17488a71c4a8.js → 8418-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8426-140ecdca17488a71c4a8.js → 8426-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8436-140ecdca17488a71c4a8.js → 8436-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{845-140ecdca17488a71c4a8.js → 845-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8485-140ecdca17488a71c4a8.js → 8485-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8499-140ecdca17488a71c4a8.js → 8499-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8553-140ecdca17488a71c4a8.js → 8553-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8617-140ecdca17488a71c4a8.js → 8617-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8684-140ecdca17488a71c4a8.js → 8684-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8700-140ecdca17488a71c4a8.js → 8700-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8709-140ecdca17488a71c4a8.js → 8709-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8711-140ecdca17488a71c4a8.js → 8711-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{874-140ecdca17488a71c4a8.js → 874-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8753-140ecdca17488a71c4a8.js → 8753-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8849-140ecdca17488a71c4a8.js → 8849-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{8931-140ecdca17488a71c4a8.js → 8931-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9017-140ecdca17488a71c4a8.js → 9017-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9045-140ecdca17488a71c4a8.js → 9045-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9057-140ecdca17488a71c4a8.js → 9057-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9077-140ecdca17488a71c4a8.js → 9077-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9079-140ecdca17488a71c4a8.js → 9079-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9096-140ecdca17488a71c4a8.js → 9096-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9104-140ecdca17488a71c4a8.js → 9104-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{914-140ecdca17488a71c4a8.js → 914-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9175-140ecdca17488a71c4a8.js → 9175-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9179-140ecdca17488a71c4a8.js → 9179-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9198-140ecdca17488a71c4a8.js → 9198-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9206-140ecdca17488a71c4a8.js → 9206-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9225-140ecdca17488a71c4a8.js → 9225-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9270-140ecdca17488a71c4a8.js → 9270-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9281-140ecdca17488a71c4a8.js → 9281-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9294-140ecdca17488a71c4a8.js → 9294-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9478-140ecdca17488a71c4a8.js → 9478-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9524-140ecdca17488a71c4a8.js → 9524-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9526-140ecdca17488a71c4a8.js → 9526-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9556-140ecdca17488a71c4a8.js → 9556-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9641-140ecdca17488a71c4a8.js → 9641-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9661-140ecdca17488a71c4a8.js → 9661-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9681-140ecdca17488a71c4a8.js → 9681-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9689-140ecdca17488a71c4a8.js → 9689-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9692-140ecdca17488a71c4a8.js → 9692-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9728-140ecdca17488a71c4a8.js → 9728-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9730-140ecdca17488a71c4a8.js → 9730-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9780-140ecdca17488a71c4a8.js → 9780-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9788-140ecdca17488a71c4a8.js → 9788-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9806-140ecdca17488a71c4a8.js → 9806-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9809-140ecdca17488a71c4a8.js → 9809-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9819-140ecdca17488a71c4a8.js → 9819-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9831-140ecdca17488a71c4a8.js → 9831-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9845-140ecdca17488a71c4a8.js → 9845-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9876-140ecdca17488a71c4a8.js → 9876-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9904-140ecdca17488a71c4a8.js → 9904-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9910-140ecdca17488a71c4a8.js → 9910-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9965-140ecdca17488a71c4a8.js → 9965-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9976-140ecdca17488a71c4a8.js → 9976-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9982-140ecdca17488a71c4a8.js → 9982-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9983-140ecdca17488a71c4a8.js → 9983-7dc1af3dd58697c08a24.js} +0 -0
- /package/dist/chunk/{9984-140ecdca17488a71c4a8.js → 9984-7dc1af3dd58697c08a24.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={122:(e,t,n)=>{"use strict";n.d(t,{uz:()=>r.uz}),n(1742);var r=n(8984)},346:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(1556);class i{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={[r.oY.meta.type]:r.oY.meta.version};for(const[t,n]of this._cubes)e[t]=n.meta.version;return e}static get_sdk_meta(){return{version:"1.83.2",time_publish:1766118251641}}static register_cube_core(){i.register_cube(r.P6),i.register_cube(r.gK),i.register_cube(r.fC),i.register_cube(r.$u),i.register_cube(r.ju),i.register_cube(r.vV),i.register_cube(r.HR),i.register_cube(r.Kw),i.register_cube(r.NQ),i.register_cube(r.k9),i.register_cube(r.LZ),i.register_cube(r.RQ),i.register_cube(r.Ku),i.register_cube(r.qH),i.register_cube(r.p4),i.register_cube(r.c9),i.register_cube(r.XV),i.register_cube(r.de),i.register_cube(r.gL),i.register_cube(r.R$),i.register_cube(r.mM),i.register_cube(r.gv),i.register_cube(r.at)}}},443:(e,t,n)=>{"use strict";n.d(t,{F:()=>h});var r=n(1556),i=n(7744),s=n(8860),o=n(1717),a=n(4412),l=n(6996),c=n(5955),d=n(3755),u=n(4089);class h extends o.K{_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 h.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:n}=this;if(n.has_selection){this._copy_data=n.find_inline_data();let r=n.get_selection_text();const i={noteid:t.id,cubedata:this._copy_data},s=JSON.stringify(i);return e.setData("application/json",s),e.setData("text/plain",r),!0}{const{cube_end:r}=n;if(!r)return!1;const i=[r.export()];this._copy_data=i;let s="";for(let e of this._copy_data)e.type===l.u0.text&&(s+=e.info);const o={noteid:t.id,cubedata:i},a=JSON.stringify(o);return e.setData("application/json",a),e.setData("text/plain",s),!0}}async copy_scope(e){const t=d.F.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 r=[];let i="";for(let e of n){for(let t of e.cube.children.slice(...e.range))i+=t.text;r.push(...e.cube.copy(...e.range))}this._copy_data=r;const s={noteid:this.root.id,cubedata:this._copy_data},o=JSON.stringify(s);return e.setData("application/json",o),e.setData("text/plain",i),!0}set_clipboard_cubedata(e,t){const n={noteid:this.root.id,cubedata:t},r=JSON.stringify(n),i=(new TextEncoder).encode(r),s=JSON.stringify([...i]),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,r=e.items,i=n.get_recorder();let s=[];i.merge(this.delete()),await(0,u.dY)();for(let e=0;e<r.length;e++){const t=r[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);i.merge(t)}return i}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,i.merge(this.paste_cubes(t.cubedata)),i}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),r=(new TextDecoder).decode(n),s=JSON.parse(r);let o=!1;try{if(s&&s.cubedata&&s.noteid)return this._paste_stack.push(s),o=!0,i.merge(this.paste_cubes(s.cubedata)),i}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 i?.merge(),i.merge(this.paste_cubes(e)),i}return i}get_cubedata_from_text(e){const t=e.replace("\r","").split("\n"),n=[];if(1===t.length){const e=r.P6.get_default(t[0]);n.push(e)}else for(let e of t){if(!e.trim())continue;const t=r.gK.get_default_by_string(e);n.push(t)}return n}paste_cubes(e){if(0===e.length)return;const{courier:t,history:n,cursor:r}=this,s=new a.vk(t),{cube_selection:o,cube_end:l,cube_start:d,offset_start:u,offset_end:h}=r;if(!o||!l||!d)return;r.has_selection&&s.tell(o,i.VL.delete(o.id,"backward",d.id,l.id,u,h,!0));const p=c.I.replace_id(this.root,e);return s.tell(d,i.VL.insert(d.id,p,d.id,d.id,u,u)),s}async paste_img(e){const{courier:t,history:n,cursor:r}=this,o=new a.vk(t),{cube_selection:l,cube_end:c,cube_start:d,offset_start:u,offset_end:h}=r;if(!l||!c||!d)return;const p=s.f.get_default();if(this.root.isdev)p.info=URL.createObjectURL(e),o.tell(c,i.VL.insert(c.id,[p],d.id,c.id,u,h));else{const t=p.id+".png",n=t;await this.event.emit_asset_save("image",t,e),p.info=n,o.tell(c,i.VL.insert(c.id,[p],d.id,c.id,u,h))}return o}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,r=new a.vk(e),{cube_end:s,cube_start:o,cube_selection:l,offset_start:c,offset_end:d}=t;if(!l||!s||!o)return;const u=o.id,h=s.id,p=l.id,f=i.VL.delete(p,"backward",u,h,c,d);return r.tell(l,f),r}delete_scope(){const e=d.F.tips,{root:t,courier:n,history:r,cursor:i}=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 a.vk(n),o=this._root.get_scope_cubes(),l=new Map;for(let e of o){let t=l.get(e.cube);t?t.push(e.range):l.set(e.cube,[e.range])}const c=new Set;for(let[e,t]of l){const n=e.children;for(let e of t){const t=n.slice(e[0],e[1]);for(let e of t)c.add(e)}for(let e of c)s.merge(e.remove_self())}return this.root.clear_scope(),s}cut(e){const{root:t,courier:n,cursor:r}=this;t.scope_count_normal>0?this.cut_scope(e):this.cut_selection(e)}cut_scope(e){const{root:t,courier:n,history:r,cursor:i}=this,s=d.F.tips;if(0===t.scope.size)return s?.tip_info("无块选区"),!1;if(0===t.scope_count_normal)return s?.tip_info("无常规块选区"),!1;const o=new a.vk(n),c=this._root.get_scope_cubes(),u=new Map;for(let e of c){let t=u.get(e.cube);t?t.push(e.range):u.set(e.cube,[e.range])}const h=[];for(let[e,t]of u){const n=new Set;e.children;for(let r of t){const t=e.children.slice(r[0],r[1]);for(let e of t)n.add(e);h.push(...e.copy(...r))}for(let e of n)o.merge(e.remove_self())}this._copy_data=h;let p="";for(let e of this._copy_data)e.type===l.u0.text&&(p+=e.info);const f={noteid:this.root.id,cubedata:h},m=JSON.stringify(f);e.setData("text/plain",p),e.setData("application/json",m),this.root.clear_scope(),r.record(o)}cut_selection(e){const{courier:t,cursor:n,history:r}=this,s=new a.vk(t),{cube_end:o,cube_start:c,cube_selection:d,offset_start:u,offset_end:h}=n;if(d&&o&&c)if(n.has_selection){this._copy_data=n.find_inline_data();let t="";for(let e of this._copy_data)e.type===l.u0.text&&(t+=e.info);const a={noteid:this.root.id,cubedata:this._copy_data},p=JSON.stringify(a);e.setData("text/plain",t),e.setData("application/json",p);const f=c.id,m=o.id,_=d.id,g=i.VL.delete(_,"backward",f,m,u,h);s.tell(d,g),r.record(s)}else{const t=o.export();this._copy_data=[t];let n="";for(let e of this._copy_data)e.type===l.u0.text&&(n+=e.info);const a={noteid:this.root.id,cubedata:this._copy_data},c=JSON.stringify(a);e.setData("text/plain",n),e.setData("application/json",c);const d=o.pcube,u=o.index,h=i.VL.delete_child(d.id,"backward",[u,u+1]);s.tell(d,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 r of t)await e.getType(r).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:l.Mu.clipboard,version:1}}}},1068:e=>{var t;self,t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},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:()=>u,DateTime:()=>c,DomAnimation:()=>d,DragDiff:()=>m,DragList:()=>p,Iteration:()=>a,MathBase:()=>_,MathLine:()=>y,MathPoint:()=>b,MathPolygon:()=>v,MathRect:()=>g,Notice:()=>o,_RectPosition:()=>s});var n,r,i,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 r=Symbol();return this.scope[e]=r,t(()=>r===this.scope[e],...n)}}static throttle(e,t=100){let n;return function(...r){n||(n=setTimeout(()=>{e(...r),n=void 0},t))}}static debounce(e,t=100){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}}i={},(r="scope")in(n=o)?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i;class a{static*zip(...e){let t=e.map(e=>Array.isArray(e)?e:[e]),n=t.map(e=>e.length),r=Math.min(...n);for(let e=0;e<r;e++){let n=[];for(let r=0;r<t.length;r++)n.push(t[r][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(),r=t.getDay(),i=new Date(t.getFullYear(),t.getMonth(),n-r),s=new Date(t.getFullYear(),t.getMonth(),n+(6-r));return`${this.get_date_string(i)}:${this.get_date_string(s)}`}static get_week_days(e){const t=[];let n;n=e||new Date;const r=n.getFullYear(),i=n.getMonth(),s=n.getDate(),o=n.getDay(),a=new Date(r,i,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 r=t;const i=()=>{if(Math.abs(r)>2){let t=r/10;r-=t,"vertical"===n?e.scrollTop+=t:e.scrollLeft+=t,requestAnimationFrame(i)}"vertical"===n?e.scrollTop+=r:e.scrollLeft+=r};i()}}class u{static swap(e,t,n){const r=e[t],i=e[n];e[t]=i,e[n]=r}}function h(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],r=n.getAttribute(this.attr);r&&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(r),t.add(r),this.map.has(r)||this.register(n),this.map.set(r,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 r=this.sum_translate(this.order.slice(0,e));"horizental"===this.dir?n.style.transform=`translateX(${r}px)`:n.style.transform=`translateY(${r}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),r=this.drag_id;if(!n||!r||n===r)return;const i=this.order.indexOf(n),s=this.order.indexOf(r);i<0||s<0||("swap"===this.effect?u.swap(this.order,i,s):(this.order.splice(s,1),this.order.splice(i,0,r)),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),r=this.drag_id;if(!n||!r||n===r)return;const i=this.order.indexOf(n),s=this.order.indexOf(r);i<0||s<0||("swap"===this.effect?u.swap(this.order,i,s):(this.order.splice(s,1),this.order.splice(i,0,r)),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,r,i=!0){h(this,"container",void 0),h(this,"drag_id",void 0),h(this,"dir","vertical"),h(this,"effect",void 0),h(this,"attr",void 0),h(this,"realtime",!0),h(this,"order_origin",[]),h(this,"order",[]),h(this,"css_var_point_events","--drag-item-point-event"),h(this,"map",new Map),h(this,"callback",new Set),h(this,"callback_start",new Set),h(this,"callback_end",new Set),h(this,"scale_h",1),h(this,"scale_v",1),h(this,"_func_start",void 0),h(this,"_func_over",void 0),h(this,"_func_enter",void 0),h(this,"_func_end",void 0),h(this,"_callback_start",void 0),this.container=e,this.dir=t,this.attr=n,this.realtime=i,this.effect=r,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:r,width:i,height:o}=e,a=r+o,l=n+i,c=n+i/2,d=r+o/2;if(t===s.left_bottom)return{x:n,y:a};if(t===s.left_top)return{x:n,y:r};if(t===s.left_mid)return{x:n,y:d};if(t===s.right_top)return{x:l,y:r};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:r};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 r=e.x===t.x||e.x===t.x+t.width,i=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||r)&&(o||i):s&&o}static get_point_in_rects(e,t,n=!0){const r=[];for(let i of t)this.is_point_in_rect(e,i,n)&&r.push(i);return r}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,r=5){const i={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 i=t.width+n.x-e.width,s=n.y+n.height+r;return{x:i<0?n.x:n.x-i,y:s}}if(g.can_include(i,t)){const i=t.width+n.x-e.width,s=n.y-t.height-r;return{x:i<0?n.x:n.x-i,y:s}}if(g.can_include(o,t)){const i=n.y+t.height-e.height;return{x:n.x-t.width-r,y:i<0?n.y:n.y-i}}if(g.can_include(a,t)){const i=n.y+t.height-e.height;return{x:n.x+n.width+r,y:i<0?n.y:n.y-i}}if(g.can_include(e,t)){const r=e.y+e.height-t.height;let i=n.x;return a.width>=t.width?i=n.x+n.width:o.width>=t.width&&(i=n.x-t.width),{x:i,y:r}}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,r=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?r=t.y-e.y:e.y+e.height>t.y+t.height&&(r=t.y+t.height-(e.y+e.height)),{dx:n,dy:r}}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,r=e.y+e.height/2,i=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-i),a=Math.abs(r-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,r=t.y,i=t.x+t.width,s=t.y+t.height;let o=e.x,a=e.y;return o<n&&(o=n),o>i&&(o=i),a<r&&(a=r),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,r=t.y+t.height/2,i=t.width/2,s=t.height/2,o=Math.abs(n-e.x),a=Math.abs(r-e.y);return o<=i&&a>s?a-s:a<=s&&o>i?o-i:Math.sqrt(Math.pow(o-i,2)+Math.pow(a-s,2))}static distance_with(e,t){const n=this.get_point_center(e),r=this.get_point_center(t),i=Math.abs(n.x-r.x),s=Math.abs(n.y-r.y),o=(e.width+t.width)/2,a=(e.height+t.height)/2;if(i<=o&&s<=a)return 0;if(i>o&&s<=a)return i-o;if(i<=o&&s>a)return s-a;{let e=Math.pow(i-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,r=Number.POSITIVE_INFINITY;for(let i of t){let t=this.point_distance_with_rect(e,i);t<r&&(r=t,n=i)}return n}static get_shadow_point_horizental(e,t){let n=t.x,r=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:r}}static merge(...e){const t=e[0];let n=t.x,r=t.x+t.width,i=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>r&&(r=e+a),o<i&&(i=o),o+l>s&&(s=o+l)}return{x:n,y:i,width:r-n,height:s-i}}}class b{static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],r=this.path.getTotalLength()/t;for(let e=0;e<t;e++){const t=e*r,i=this.path.getPointAtLength(t);n.push({x:i.x,y:i.y})}return n}static get_line_k(e,t,n=100){const r=t.y-e.y,i=t.x-e.x;return 0===i?Number.POSITIVE_INFINITY:r/i}static distance(e,t){const n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}static find_closet_point(e,t){let n=1/0,r=e[0];const{x:i,y:s}=t;for(let t of e){let e=Math.pow(i-t.x,2)+Math.pow(s-t.y,2);e<n&&(n=e,r=t)}return r}static offset_points(e,t){const n=[],{x:r,y:i}=t;for(let t of e)n.push({x:t.x+r,y:t.y+i});return n}static find_closest_points(e,t){let n=1/0,r=e[0],i=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,r=o,i=s)}}return{from:r,to:i}}}!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 v{static polygon_center(e){let t=0,n=0,r=0;const i=e.length;for(let s=0;s<i;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%i],d=o*c-l*a;r+=d,t+=(o+l)*d,n+=(a+c)*d}return r*=.5,t/=6*r,n/=6*r,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const{x:i,y:s}=e[r],{x:o,y:a}=e[(r+1)%n];t+=i*a-o*s}return t/2}}class y{static check_intersection(e,t){const{from:n,to:r}=e,{from:i,to:s}=t;let o,a;if(o=n.x===r.x?Number.POSITIVE_INFINITY:(r.y-n.y)/(r.x-n.x),a=i.x===s.x?Number.POSITIVE_INFINITY:(s.y-i.y)/(s.x-i.x),o===a)return!1;const l=Math.min(n.x,r.x),c=Math.max(n.x,r.x),d=Math.min(n.y,r.y),u=Math.max(n.y,r.y),h=Math.min(i.x,s.x),p=Math.max(i.x,s.x),f=Math.min(i.y,s.y),m=Math.max(i.y,s.y);if(o===Number.POSITIVE_INFINITY){const e=n.x,t=a*(e-i.x)+i.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=f&&t<=m}if(a===Number.POSITIVE_INFINITY){const e=i.x,t=(r.y-n.y)/(r.x-n.x)*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=f&&t<=m}{const e=(i.y-n.y+o*n.x-a*i.x)/(o-a),t=o*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=f&&t<=m}}}return t})(),e.exports=t()},1150:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});var r=n(6996);class i{static node_add(e,t){return{id:e,name:r.kU.node_add,data:t}}static node_remove(e,t){return{id:e,name:r.kU.node_remove,data:t}}static linker_add(e,t){return{id:e,name:r.kU.linker_add,data:t}}static linker_remove(e,t){return{id:e,name:r.kU.linker_remove,data:t}}static update_attr(e,t){return{id:e,name:r.kU.update_attrs,data:t}}}},1445:(e,t,n)=>{"use strict";n.d(t,{AG:()=>f,KS:()=>v,M3:()=>_,_V:()=>g,bQ:()=>d,dw:()=>u,gV:()=>h,kE:()=>y,o:()=>m,pn:()=>p,yg:()=>b});var r=n(4412),i=n(7744);let s,o,a=!1,l=null,c=null;function d(e,t){if(e.stopPropagation(),!a)return void e.preventDefault();const n=e.currentTarget;n instanceof HTMLElement&&(l=n,s=t,document.body.style.setProperty("--box-root-pointer-events","none"))}function u(e,t){if(!a||!s)return;e.stopPropagation();const n=e.currentTarget;n instanceof HTMLElement&&t!==s&&(n!==c&&c?.classList.remove("drag-enter"),c=n,o=t,c.classList.add("drag-enter"))}function h(e,t){e.stopPropagation(),c&&c.classList.remove("drag-enter")}function p(e,t){e.preventDefault(),e.stopPropagation(),c&&c.classList.add("drag-enter")}function f(e,t){a&&(e.preventDefault(),e.stopPropagation(),s&&o&&l&&c&&s!==o&&(l.style["view-transition-name"]=s.id,document.startViewTransition(()=>{if(!(s&&o&&l&&c))return;const{courier:e,history:n}=t,a=new r.vk(e),d=l.getBoundingClientRect(),u=o.index,h=s.export(),p=o.pcube;s.pcube===p?a.tell(s.pcube,i.VL.reorder(s.pid,s.id,o.index)):(a.merge(s.remove_self()),a.tell(p,i.VL.insert_child(p.id,[h],u))),n.record(a);const f=c.getBoundingClientRect(),m=f.x-d.x,_=f.y-d.y;document.body.style.setProperty("--x",m+"px"),document.body.style.setProperty("--y",_+"px")}),a=!1))}function m(e,t){c&&c.classList.remove("drag-enter"),l&&l.classList.remove("drag-enter"),a=!1}function _(e,t){const n=e.target;n instanceof HTMLElement&&"cube-box-root-dragger"===n.dataset.tag&&(a=!0,e.stopPropagation())}function g(e,t){const{stats:n}=t.root,r=t.index+1;n.active_root_index=r}function b(e){const{courier:t,history:n,id:r,cubes:s}=e,o=t.get_recorder();o.tell(e,i.VL.fold(r,!e.attrs.fold)),n.record(o);for(let t of Object.values(s.postils))t.pcube?.top===e&&t.visible(!1);const a=e.child_first.id;if(!a)return;const l=document.getElementById(a);l?.scrollIntoView({block:"nearest",behavior:"smooth"})}function v(e,t){b(t)}function y(e,t){e.preventDefault();const{root:n,stats:r}=t;r.anchor_root_id===t.id?r.anchor_root_id="":n.stats.anchor_root_id=t.id}},1556:(e,t,n)=>{"use strict";n.d(t,{yI:()=>On,UF:()=>Xa,ev:()=>Bn,$6:()=>Lt,LU:()=>ft,DW:()=>kr,ry:()=>Yn,OA:()=>Yh,PL:()=>tn,LO:()=>_r,fl:()=>Sp,en:()=>Qh,zl:()=>$,ZU:()=>D,A6:()=>rr,vV:()=>R,c9:()=>Kn,XV:()=>xt,mM:()=>kp,de:()=>Tt,HR:()=>pt,p4:()=>Za,RQ:()=>nr,oY:()=>mt,qH:()=>Zh,fC:()=>i.f,gK:()=>gt,R$:()=>xn,Kw:()=>mr,NQ:()=>xr,Qm:()=>b,EU:()=>Sn,gL:()=>En,$u:()=>q,at:()=>Tp,gv:()=>wn,Ku:()=>pp,P6:()=>X,ju:()=>V,LZ:()=>bp,k9:()=>cr,sf:()=>Jt,e8:()=>en,Nj:()=>Cn,AG:()=>In,iO:()=>Mn});var r={};n.r(r),n.d(r,{boolean:()=>ts,booleanish:()=>ns,commaOrSpaceSeparated:()=>as,commaSeparated:()=>os,number:()=>is,overloadedBoolean:()=>rs,spaceSeparated:()=>ss});var i=n(8860),s=n(8606),o=n(7744),a=n(6996),l=n(7633),c=n(4089),d=n(3972);const u=["id","data-type"],h={class:"lost-info"},p=(0,c.pM)({__name:"cube-lost",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-lost",id:e.cube.id,"data-type":(0,l.R1)(a.u0).lost},[t[2]||(t[2]=(0,c.Lk)("div",{class:"lost-title"},"异常方块",-1)),(0,c.Lk)("div",h,[t[0]||(t[0]=(0,c.Lk)("div",null,"方块类型: ",-1)),(0,c.Lk)("div",null,(0,d.v_)(e.cube.cube_name),1),t[1]||(t[1]=(0,c.Lk)("div",null,"异常原因: ",-1)),(0,c.Lk)("div",null,(0,d.v_)(e.cube.msg),1)])],8,u))});var f=n(5856);const m=(0,f.A)(p,[["__scopeId","data-v-2525a8c9"]]);var _=n(4412),g=n(5955);class b extends o._D{_msg=(0,l.KR)("");get msg(){return this._msg.value}set msg(e){this._msg.value=e}_component=m;get component(){return this._component}get meta(){return b.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}gc(){}replace_id(e,t={}){return b.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,r=new _.vk(t);return n&&r.tell(n,o.UB.in_head(n.id,0)),r}on_cursor_in_tail(e){const{courier:t,prev_cube:n}=this,r=new _.vk(t);return n&&r.tell(n,o.UB.in_head(n.id,0)),r}static get_default(e){return{id:(0,s.Ak)(),type:a.u0.lost,info:e,css:{},attrs:{}}}static get meta(){return{cubename:"异常方块",type:a.u0.lost,block:!1,version:1,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}const v=["id","data-type"],y=(0,c.pM)({__name:"cube-text",props:{cube:{}},setup(e){function t(){const t=e.cube.postil;t&&t.visible(!t.show)}return(e,n)=>((0,c.uX)(),(0,c.CE)("span",{class:(0,d.C4)(["cube-text",{"text-mark":e.cube.has_postil}]),style:(0,d.Tr)(e.cube.css),onClick:t,id:e.cube.id,"data-type":(0,l.R1)(a.u0).text},(0,d.v_)(e.cube.text),15,v))}}),w=(0,f.A)(y,[["__scopeId","data-v-54fe1fb2"]]);var x=n(5857),k=n(8219);const S=(0,c.pM)({__name:"cube-view",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.Wv)((0,c.$y)(e.cube.component),{cube:(0,l.IG)(e.cube)},null,8,["cube"]))});var C=n(6853);const M=["id","data-type"],T={class:"iconbox"},L=(0,c.pM)({__name:"cube-annotation",props:{cube:{}},setup(e){const t=(0,l.Kh)({fold:!1});function n(){const{courier:t,history:n}=e.cube.root,r=e.cube.pcube,i=e.cube.index,s=new _.vk(t);s.tell(r,o.VL.delete_child(r.id,"backward",[i,i+1])),n.record(s)}function r(){t.fold=!t.fold}return(e,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-annotation",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).annotation},[(0,c.Lk)("div",T,[(0,c.Lk)("div",{class:(0,d.C4)(["iconfont",(0,l.R1)(C.R).icons.fold,t.fold?"annotation-icon-active":""]),onClick:r,title:"折叠批注块"},null,2),(0,c.Lk)("div",{class:"iconfont icon-Delete",onClick:n,title:"删除批注块"})]),t.fold?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("div",{key:0,class:(0,d.C4)(["annotation-contents",{"annotation-fold":t.fold}])},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e,class:"annotation-box"},null,8,["cube"]))),128))],2))],12,M))}}),z=(0,f.A)(L,[["__scopeId","data-v-b157e116"]]);var A=n(346);function P(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class R extends o._D{_component=z;constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get component(){return this._component}get meta(){return R.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=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return R.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return this.is_empty?s.tell(i,o.VL.delete_child(n,a,[r,r+1])):s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],f=this.children[h],m=h-u;let _=this.splice(c,m);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):f&&s.tell(f,o.UB.in_head(f.id,0)):"forward"===a&&(f?s.tell(f,o.UB.in_head(f.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}static get meta(){return{cubename:"批注",type:x.u0.annotation,block:!0,version:1,show:!1}}static get_default(e={},t={}){const n={id:(0,s.Ak)(),type:x.u0.text,info:"",attrs:{},css:{}},r={id:(0,s.Ak)(),type:x.u0.line,info:[n],attrs:{},css:{}},i={id:(0,s.Ak)(),type:x.u0.box,info:[r],attrs:{},css:{}};return{id:(0,s.Ak)(),type:x.u0.annotation,info:[i],css:e,attrs:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;let s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}P([(0,k.H)(a.zS.cube_insert_child)],R.prototype,"on_insert_child",null),P([(0,k.H)(a.zS.cube_delete_child)],R.prototype,"on_delete_child",null),P([(0,k.H)(a.zS.cube_reset)],R.prototype,"on_reset",null);var N=n(1068);const E=["id","data-type"],O={class:"title"},I=(0,c.pM)({__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 n(){e.cube.event.emit_text_link_edit(e.cube)}function r(){const{courier:t,history:n}=e.cube.root,{pcube:r,index:i}=e.cube,s=new _.vk(t);s.tell(r,o.VL.delete_child(r.id,"backward",[i,i+1])),n.record(s)}return(e,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-link",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).link},[(0,c.Lk)("div",O,(0,d.v_)(e.cube.data.info.title),1),(0,c.Lk)("div",{class:"link",onClick:t},(0,d.v_)(e.cube.data.info.url),1),(0,c.Lk)("div",{class:"iconbox"},[(0,c.Lk)("div",{class:"iconfont icon-rename",onClick:n}),(0,c.Lk)("div",{class:"iconfont icon-Delete",onClick:r})])],12,E))}}),B=(0,f.A)(I,[["__scopeId","data-v-2946c9fa"]]);class D{static update(e,t,n){return{id:e,name:a.gS.update,title:t,url:n}}}class V extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return B}get meta(){return V.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 V.replace_id(this.root,e,t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}on_update_info(e){const{courier:t,cursor:n}=this,{url:r,title:i}=e,s=t.get_recorder();s.add_cmd(e);const o=this.info.title,a=this.info.url;return this.info.url=r,this.info.title=i,s.add_recover(D.update(this.id,o,a)),s}static get meta(){return{cubename:"文本链接",type:a.u0.link,block:!0,show:!1,version:1}}static get_default(e,t,n={},r={}){return{id:(0,s.Ak)(),type:a.u0.link,info:{url:e,title:t},css:n,attrs:r}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.gS.update)],V.prototype,"on_update_info",null);const H=["id","data-type"],j=(0,c.pM)({__name:"cube-postil",props:{cube:{}},setup(e){const t=(0,c.EW)(()=>e.cube.children.filter(e=>e instanceof V)),n=(0,c.EW)(()=>e.cube.children.filter(e=>!(e instanceof V))),r=(0,c.EW)(()=>({...e.cube.css}));function i(){e.cube.visible(!1)}function s(){const{courier:t,history:n}=e.cube.root,r=e.cube.pcube,i=new _.vk(t);i.tell(r,o.VL.postil_remove(r.id,[0,e.cube.child_count])),n.record(i)}function u(e){e.preventDefault(),e.stopPropagation();const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const{deltaY:n}=e;n>0?N.DomAnimation.scroll_element(t,20,"vertical"):N.DomAnimation.scroll_element(t,-20,"vertical")}return(e,o)=>e.cube.show?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"cube-postil",style:(0,d.Tr)(r.value),id:e.cube.id,"data-type":(0,l.R1)(a.u0).postil},[(0,c.Lk)("div",{class:"iconbox"},[(0,c.Lk)("div",{class:"iconfont icon-Delete delete",title:"清空",onClick:s}),(0,c.Lk)("div",{class:"iconfont icon-close close",title:"关闭",onClick:i})]),(0,c.Lk)("div",{class:"mark-contents",onWheel:u},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.value,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(n.value,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],32)],12,H)):(0,c.Q3)("v-if",!0)}}),F=(0,f.A)(j,[["__scopeId","data-v-7ca0a800"]]);function U(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class q extends o._D{_handler_update_pos;_handler_corrent;_timer_corrent;_show=(0,l.KR)(!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 R)return!0;return!1}get meta(){return q.meta}get component(){return F}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}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 q.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],f=this.children[h],m=h-u;let _=this.splice(c,m);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):f&&s.tell(f,o.UB.in_head(f.id,0)):"forward"===a&&(f?s.tell(f,o.UB.in_head(f.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}visible(e){if(e){const{courier:e,child_last:t}=this;this.update_pos(),this.show=!0,(0,c.dY)(()=>{const n=e.get_recorder();n.tell(t,o.UB.in_tail(t.id,0)),this.history.record(n)})}else this.show=!1}update_pos(e=!0){(0,c.dY)(()=>{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},r=N.MathRect.move_rect_to_other(n,t,e,5);this.data.css.left=`${r.x}px`,this.data.css.top=`${r.y}px`})}static get_default(e=[],t={}){return{id:(0,s.Ak)(),type:a.u0.postil,info:e,attrs:{},css:t}}static get meta(){return{cubename:"标注内容",type:a.u0.postil,show:!1,version:1,block:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}U([(0,k.H)(a.zS.cube_insert_child)],q.prototype,"on_insert_child",null),U([(0,k.H)(a.zS.cube_delete_child)],q.prototype,"on_delete_child",null),U([(0,k.H)(a.zS.cube_reset)],q.prototype,"on_reset",null);class ${static reset(e,t,n,r){return{id:e,name:a.lm.text_reset,info:t,cursor_after:r,cursor_before:n}}static break(e,t){return{id:e,name:a.lm.text_break,offset:t}}}function G(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class X extends o._D{_component=w;get attrs(){return this.data.attrs}get component(){return this._component}get meta(){return X.meta}get is_empty(){return X.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 gt)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 q(t,this))}gc(){super.base_gc(),this.root.stats.update_count_word(-this.len)}replace_id(e,t={}){return X.replace_id(this.root,e,t)}find_child_cube(e){}export(){return this.base_export()}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}merge_text(e){const{courier:t}=this,n=t.get_recorder(),r=this.prev_cube,i=this.next_cube,s=r instanceof X,a=i instanceof X;if(s&&a){const t=o.VL.merge(this.id,"both",this.id,e);n.tell(this,t)}else if(s){const t=o.VL.merge(this.id,"left",this.id,e);n.tell(this,t)}else if(a){const t=o.VL.merge(this.id,"right",this.id,e);n.tell(this,t)}return n}on_partition(e){const{courier:t,cursor:n,pcube:r}=this,{start_id:i,end_id:s,offset_end:a,offset_start:c}=e,d=this.get_valid_index(c),u=this.get_valid_index(a),h=new _.vk(t),p=this.text.slice(0,d),f=this.text.slice(d,u),m=this.text.slice(u);if(f){const e=X.get_default(f,structuredClone((0,l.ux)(this.css)));if(p){if(p){if(h.tell(this,$.reset(this.id,p,p.length,p.length)),m){const e=X.get_default(m,structuredClone((0,l.ux)(this.css)));h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}}else if(h.tell(this,$.reset(this.id,f,f.length,f.length)),m){const e=X.get_default(m,structuredClone((0,l.ux)(this.css)));h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}return h}if(0===d){const e=X.get_default();h.tell(r,o.VL.insert_child(r.id,[e],this.index))}else if(d===this.len){const e=X.get_default();h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}else if(d>0&&d<this.len){const e=X.get_default(m,structuredClone((0,l.ux)(this.css)));return h.tell(r,o.VL.insert_child(r.id,[e],this.index+1)),h.tell(this,$.reset(this.id,p,p.length,p.length)),h}return h}on_cube_merge(e){const{courier:t,prev_cube:n,pcube:r,next_cube:i,pid:s,index:a}=this,{method:l,offset:c,cubeid:d}=e;let u=this.get_valid_index(c);const h=new _.vk(t);if("left"===l&&n instanceof X&&this.can_merge_with(n)){const e=n.id;h.tell(r,o.VL.delete_child(s,"forward",[a-1,a])),h.tell(this,$.reset(this.id,n.text+this.text,u,u+n.len)),this.event.emit_text_merge(e,this.id)}else if("right"===l&&i instanceof X&&this.can_merge_with(i)){const e=i.id;h.tell(r,o.VL.delete_child(s,"backward",[a+1,a+2])),h.tell(this,$.reset(this.id,this.text+i.text,u,u)),this.event.emit_text_merge(e,this.id)}else if("both"===l)if(n instanceof X&&i instanceof X&&this.can_merge_with(n)&&this.can_merge_with(i)){const e=n.len+u,t=n.id,s=i.id;h.tell(r,o.VL.delete_child(this.pid,"backward",[this.index-1,this.index])),h.tell(r,o.VL.delete_child(this.pid,"backward",[this.index+1,this.index+2])),h.tell(this,$.reset(this.id,n.text+this.text+i.text,u,e)),this.event.emit_text_merge(t,this.id),this.event.emit_text_merge(s,this.id)}else if(n instanceof X&&this.can_merge_with(n)){const e=n.id;h.tell(r,o.VL.delete_child(s,"forward",[a-1,a])),h.tell(this,$.reset(this.id,n.text+this.text,u,u+n.len)),this.event.emit_text_merge(e,this.id)}else if(i instanceof X&&this.can_merge_with(i)){const e=i.id;h.tell(r,o.VL.delete_child(s,"backward",[a+1,a+2])),h.tell(this,$.reset(this.id,this.text+i.text,u,u)),this.event.emit_text_merge(e,this.id)}return h}on_cube_insert(e){const{data:t,start_id:n,end_id:r,offset_end:i,offset_start:s}=e,{courier:a,pid:c,pcube:d}=this,u=new _.vk(a);this.cursor.has_selection;let h=s,p=i;if(h<0&&(h=0),p>this.text.length&&(p=this.text.length),i!==s){const e=o.VL.delete(this.id,"backward",this.id,this.id,s,i,!0);u.tell(this,e)}const f=g.I.pick(t),m=this.text.slice(0,h),b=this.text.slice(p);if(f.head.length>0)if(m)if(m&&b){u.tell(this,$.reset(this.id,m,m.length,m.length));const e=X.get_default(b,structuredClone((0,l.ux)(this.css)),structuredClone((0,l.ux)(this.attrs)));u.tell(d,o.VL.insert_child(c,[e],this.index+1)),u.tell(d,o.VL.insert_child(c,f.head,this.index+1))}else b||u.tell(d,o.VL.insert_child(c,f.head,this.index+1));else u.tell(d,o.VL.insert_child(c,f.head,this.index));const v=[...f.body];if(f.tail.length>0&&v.push(gt.get_default(f.tail)),f.root.length>0)for(let e of f.root)v.push(...e.info);if(v.length>0){if(0===f.head.length&&i>0&&i<this.len){u.tell(this,$.reset(this.id,m,m.length,m.length));const e=X.get_default(b,structuredClone((0,l.ux)(this.css)),structuredClone((0,l.ux)(this.attrs)));u.tell(d,o.VL.insert_child(c,[e],this.index+1))}u.tell(d,o.VL.insert_child(this.pid,v,this.index+f.head.length+1))}return u}on_cube_delete(e){const{courier:t,index:n,pcube:r,pid:i}=this,{dir:s,start_id:a,end_id:l,offset_start:c,offset_end:d,reserve:u}=e,h=new _.vk(t),p=this.get_valid_index(c),f=this.get_valid_index(d),m=p!==f||"head"===c||"tail"===d;if(0===p&&f===this.len)return u?h.tell(this,$.reset(this.id,"",this.len,1)):h.tell(r,o.VL.delete_child(i,"backward",[n,n+1])),h;const g=this.text.slice(0,p),b=this.text.slice(f);if(m)h.tell(this,$.reset(this.id,g+b,f,p));else{const e=p;if("backward"===s)if(0===e||0===X.drop_zero_width_space(this.text,p).pos)if(this.pcube.is_empty&&this.pcube instanceof o._D)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,o.VL.delete_adjacent(e.id,"right",this.id,0))}else if(this.is_empty)h.tell(r,o.VL.delete_child(i,"backward",[n,n+1]));else{const e=this.find_text_deleted(p,"left");h.tell(this,$.reset(this.id,e.text,g.length,e.pos)),e.text&&h.tell(this,o.VL.merge(this.id,"both",this.id,g.length-1))}else if("forward"===s)if(e===this.len||e===X.drop_zero_width_space(this.text,p).len)if(this.pcube.is_empty&&this.pcube instanceof o._D)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,o.VL.delete_adjacent(e.id,"left",this.id,this.len))}else if(this.is_empty)h.tell(r,o.VL.delete_child(i,"forward",[n,n+1]));else{const t=this.find_text_deleted(e,"right");h.tell(this,$.reset(this.id,t.text,g.length,g.length)),h.tell(this,o.VL.merge(this.id,"both",this.id,g.length))}}return h}on_text_reset(e){const{courier:t,pid:n,index:r,pcube:i,len:s}=this,{info:a,cursor_after:l,cursor_before:c}=e,d=t.get_recorder();d.add_cmd(e);let u=this.text;!a&&this.is_empty;const h=X.drop_zero_intelligence(a,l);return this.data.info=h.text,this.root.stats.update_count_word(h.len-s),d.tell(this,o.UB.in_head(this.id,h.pos)),d.add_recover($.reset(this.id,u,h.pos,c)),d}on_cube_set_selection_css(e){const{courier:t,pid:n,pcube:r}=this,{css:i,start_id:s,end_id:a,offset_start:c,offset_end:d,toggle:u,replace:h}=e;if(0===Object.keys(i).length&&!h)return;const p=new _.vk(t),f=this.get_valid_index(c),m=this.get_valid_index(d),g=X.drop_zero_width_space(this.text.slice(0,f),0).text,b=X.drop_zero_width_space(this.text.slice(f,m),0).text,v=X.drop_zero_width_space(this.text.slice(m),0).text;if(0===f&&m===this.len||f===m&&s===a)p.tell(this,o.VL.set_css(this.id,i,u,h)),p.tell(this,o.VL.merge(this.id,"both",this.id,m));else if(0===f&&b){const e=structuredClone((0,l.ux)(this.css));if(p.tell(this,$.reset(this.id,b,m,m)),p.tell(this,o.VL.set_css(this.id,i,u,h)),v){const t=X.get_default(v,e);p.tell(r,o.VL.insert_child(n,[t],this.index+1));const i=r.find_cube(t.id);i&&p.tell(i,o.VL.merge(t.id,"both",t.id,0))}p.tell(this,o.UB.in_tail(this.id,0)),p.tell(this,o.VL.merge(this.id,"left",this.id,this.len))}else if(f>0){if(g&&(p.tell(this,$.reset(this.id,g,f,f)),p.tell(this,o.VL.merge(this.id,"left",this.id,m))),v){const e=X.get_default(v,structuredClone((0,l.ux)(this.css))),t=[e];p.tell(r,o.VL.insert_child(n,t,this.index+1));const i=r.find_cube(e.id);i&&p.tell(i,o.VL.merge(i.id,"right",i.id,0))}if(b){const e=X.get_default(b,structuredClone((0,l.ux)(this.css)));p.tell(r,o.VL.insert_child(n,[e],this.index+1));const t=r.find_cube(e.id);t&&(p.tell(t,o.VL.set_css(e.id,i,u,h)),p.tell(t,o.VL.merge(e.id,"both",e.id,g.length+f)))}}return p}on_cube_break(e){const{courier:t,cursor:n,pcube:r,pid:i,index:s}=this,a=r.pcube;if(!a)return;const{offset:l}=e;let c=s+1;const d=new _.vk(t),u=this.text[l-1],h=this.text[l];let p=l,f=!1;if(u){const e=u.charCodeAt(0);55296<=e&&e<=56319&&(f=!0)}if(h&&!f){const e=h.charCodeAt(0);56320<=e&&e<=57343&&(f=!0)}f&&(p+=1),d.tell(this,o.VL.partition(this.id,this.id,this.id,p,p));const m=[];for(let e of r.children.slice(c))m.push(e.export());d.tell(r,o.VL.delete_child(r.id,"backward",[c,r.child_count]));const g=gt.get_default(m),b=this.line;b&&b.inherit_line([g]),d.tell(a,o.VL.insert_child(a.id,[g],r.index+1));const v=r.next_cube;return v?.id===g.id&&d.tell(v,o.UB.in_head(v.id,0,void 0)),d}on_cube_delete_adjacent(e){const{courier:t,pcube:n}=this,{from:r,from_id:i,offset:s}=e,a=new _.vk(t);if("left"===r)if(this.is_empty)a.merge(this.remove_self());else{const e=this.prev_cube_deep;e?.meta.block?a.tell(this,o.UB.in_head(this.id,0)):a.tell(this,o.VL.delete(this.id,"forward",this.id,this.id,0,0))}else if(this.is_empty)a.merge(this.remove_self());else{const e=this.next_cube_deep;e?.meta.block?a.tell(this,o.UB.in_tail(this.id,0)):a.tell(this,o.VL.delete(this.id,"backward",this.id,this.id,this.len,this.len))}return a}add_link(e,t){const{cursor:n,courier:r}=this,i=r.get_recorder(),s=V.get_default(t,e);return i.tell(this,o.VL.postil_add(this.id,[s])),i}add_annotation(e){const t=this.courier.get_recorder(),n=e||R.get_default();return t.tell(this,o.VL.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);(0,c.dY)(()=>{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);(0,c.dY)(()=>{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 r=e;if(e<0&&(r=0),e>n.length&&(r=n.length),"left"===t){let e=r-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=r+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),r=this.text.slice(0,n),i=this.text.slice(e),s=r[r.length-1];if(s){const t=s.charCodeAt(0);55296<=t&&t<=56319&&(r=r.slice(0,-1),e-=1)}return{text:r+i,pos:n}}{let n=this.find_text_nav_pos(e,t),r=this.text.slice(0,e),i=this.text.slice(n),s=i[0];if(s){const e=s.charCodeAt(0);56320<=e&&e<=57343&&(i=i.slice(1))}return{text:r+i,pos:e}}}is_text_remain(e,t){if(0===this.len)return!1;const[n,r]=t;if(n===r)return"backward"===e?0!==this.find_text_nav_pos(n,"left")||this.find_text_nav_pos(r-1,"right")!==this.len:this.find_text_nav_pos(n,"right")!==this.len||0!==this.find_text_nav_pos(n,"left");{if(0===n&&r===this.len)return!1;const e=this.find_text_nav_pos(n+1,"left"),t=this.find_text_nav_pos(r-1,"right");return e>0||t<this.len}}drop_zero_width_space(e){return X.drop_zero_width_space(this.text,e)}can_merge_with(e){const t=g.I.is_same_style(this.css,e.css)||0===Object.keys(e.css).length,n=g.I.is_same_attrs(this.attrs,e.attrs),r=!this.postil&&!e.postil;return t&&n&&r}static drop_zero_width_space(e,t){let n="",r=t;r<0&&(r=0),r>e.length&&(r=e.length);const i=e.slice(0,r),s=e.slice(r);if(i){for(let e of i)""!==e&&(n+=e);r=n.length}if(s)for(let e of s)""!==e&&(n+=e);return{text:n,pos:r,get len(){return this.text.length}}}static drop_zero_intelligence(e,t){let n="",r=t;r<0&&(r=0),r>e.length&&(r=e.length);const i=e.slice(0,r),s=e.slice(r);if(i){for(let e=0;e<i.length;e++){let t=i[e],r=i[e-1];""===t&&"\n"!==r||(n+=t)}r=n.length}if(s)for(let e=0;e<s.length;e++){let t=s[e],r=s[e-1];""===t&&"\n"!==r||(n+=t)}return n||(n="",r=1),{text:n,pos:r,get len(){return this.text.length}}}static is_empty_text(e){if(e.type!==x.u0.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:x.u0.text,cubename:"文本",block:!1,show:!1}}static get_default(e="",t={},n={}){const r=e||"";return{id:(0,s.Ak)(),type:x.u0.text,info:r,css:structuredClone((0,l.ux)(t)),attrs:structuredClone((0,l.ux)(n))}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,e.event.emit_replace_id(r,i),t}}G([(0,k.H)(a.zS.cube_partition)],X.prototype,"on_partition",null),G([(0,k.H)(a.zS.cube_merge)],X.prototype,"on_cube_merge",null),G([(0,k.H)(a.zS.cube_insert)],X.prototype,"on_cube_insert",null),G([(0,k.H)(a.zS.cube_delete)],X.prototype,"on_cube_delete",null),G([(0,k.H)(a.lm.text_reset)],X.prototype,"on_text_reset",null),G([(0,k.H)(a.zS.cube_set_selection_css)],X.prototype,"on_cube_set_selection_css",null),G([(0,k.H)(a.lm.text_break)],X.prototype,"on_cube_break",null),G([(0,k.H)(a.zS.cube_delete_adjacent)],X.prototype,"on_cube_delete_adjacent",null);const K=["id","data-type","contenteditable"],W=(0,c.pM)({__name:"cube-line",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["cube-line",{"line-first-letter-lower":e.cube.attrs.first_letter_lower}]),id:e.cube.id,"data-type":(0,l.R1)(a.u0).line,style:(0,d.Tr)(e.cube.css),contenteditable:e.cube.editable,spellcheck:"false"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],14,K))}),Y=(0,f.A)(W,[["__scopeId","data-v-f72cf81e"]]);let Z;const Q="undefined"!=typeof window&&window.trustedTypes;if(Q)try{Z=Q.createPolicy("vue",{createHTML:e=>e})}catch(e){}const J=Z?e=>Z.createHTML(e):e=>e,ee="undefined"!=typeof document?document:null,te=ee&&ee.createElement("template"),ne={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i="svg"===t?ee.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?ee.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?ee.createElement(e,{is:n}):ee.createElement(e);return"select"===e&&r&&null!=r.multiple&&i.setAttribute("multiple",r.multiple),i},createText:e=>ee.createTextNode(e),createComment:e=>ee.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ee.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,s){const o=n?n.previousSibling:t.lastChild;if(i&&(i===s||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==s&&(i=i.nextSibling););else{te.innerHTML=J("svg"===r?`<svg>${e}</svg>`:"mathml"===r?`<math>${e}</math>`:e);const i=te.content;if("svg"===r||"mathml"===r){const e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},re=Symbol("_vtc");Boolean;c.QP;const ie=Symbol("_vod"),se=Symbol("_vsh"),oe=Symbol(""),ae=/(?:^|;)\s*display\s*:/,le=/\s*!important$/;function ce(e,t,n){if((0,d.cy)(n))n.forEach(n=>ce(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=function(e,t){const n=ue[t];if(n)return n;let r=(0,d.PT)(t);if("filter"!==r&&r in e)return ue[t]=r;r=(0,d.ZH)(r);for(let n=0;n<de.length;n++){const i=de[n]+r;if(i in e)return ue[t]=i}return t}(e,t);le.test(n)?e.setProperty((0,d.Tg)(r),n.replace(le,""),"important"):e[r]=n}}const de=["Webkit","Moz","ms"],ue={},he="http://www.w3.org/1999/xlink";function pe(e,t,n,r,i,s=(0,d.J$)(t)){r&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(he,t.slice(6,t.length)):e.setAttributeNS(he,t,n):null==n||s&&!(0,d.Y2)(n)?e.removeAttribute(t):e.setAttribute(t,s?"":(0,d.Bm)(n)?String(n):n)}function fe(e,t,n,r,i){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?J(n):n));const s=e.tagName;if("value"===t&&"PROGRESS"!==s&&!s.includes("-")){const r="OPTION"===s?e.getAttribute("value")||"":e.value,i=null==n?"checkbox"===e.type?"on":"":String(n);return r===i&&"_value"in e||(e.value=i),null==n&&e.removeAttribute(t),void(e._value=n)}let o=!1;if(""===n||null==n){const r=typeof e[t];"boolean"===r?n=(0,d.Y2)(n):null==n&&"string"===r?(n="",o=!0):"number"===r&&(n=0,o=!0)}try{e[t]=n}catch(e){}o&&e.removeAttribute(i||t)}function me(e,t,n,r){e.addEventListener(t,n,r)}const _e=Symbol("_vei");const ge=/(?:Once|Passive|Capture)$/;let be=0;const ve=Promise.resolve(),ye=()=>be||(ve.then(()=>be=0),be=Date.now()),we=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 xe=e=>{const t=e.props["onUpdate:modelValue"]||!1;return(0,d.cy)(t)?e=>(0,d.DY)(t,e):t};function ke(e){e.target.composing=!0}function Se(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ce=Symbol("_assign"),Me={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[Ce]=xe(i);const s=r||i.props&&"number"===i.props.type;me(e,t?"change":"input",t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),s&&(r=(0,d.bB)(r)),e[Ce](r)}),n&&me(e,"change",()=>{e.value=e.value.trim()}),t||(me(e,"compositionstart",ke),me(e,"compositionend",Se),me(e,"change",Se))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[Ce]=xe(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:(0,d.bB)(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(r&&t===n)return;if(i&&e.value.trim()===a)return}e.value=a}}},Te=(0,d.X$)({patchProp:(e,t,n,r,i,s)=>{const o="svg"===i;"class"===t?function(e,t,n){const r=e[re];r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,o):"style"===t?function(e,t,n){const r=e.style,i=(0,d.Kg)(n);let s=!1;if(n&&!i){if(t)if((0,d.Kg)(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&ce(r,t,"")}else for(const e in t)null==n[e]&&ce(r,e,"");for(const e in n)"display"===e&&(s=!0),ce(r,e,n[e])}else if(i){if(t!==n){const e=r[oe];e&&(n+=";"+e),r.cssText=n,s=ae.test(n)}}else t&&e.removeAttribute("style");ie in e&&(e[ie]=s?r.display:"",e[se]&&(r.display="none"))}(e,n,r):(0,d.Mp)(t)?(0,d.CP)(t)||function(e,t,n,r,i=null){const s=e[_e]||(e[_e]={}),o=s[t];if(r&&o)o.value=r;else{const[n,a]=function(e){let t;if(ge.test(e)){let n;for(t={};n=e.match(ge);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):(0,d.Tg)(e.slice(2)),t]}(t);if(r){const o=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();(0,c.qL)(function(e,t){if((0,d.cy)(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=ye(),n}(r,i);me(e,n,o,a)}else o&&(function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,o,a),s[t]=void 0)}}(e,t,0,r,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,r){if(r)return"innerHTML"===t||"textContent"===t||!!(t in e&&we(t)&&(0,d.Tn)(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(!we(t)||!(0,d.Kg)(n))&&t in e}(e,t,r,o))?(fe(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||pe(e,t,r,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&(0,d.Kg)(r)?("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),pe(e,t,r,o)):fe(e,(0,d.PT)(t),r,0,t)}},ne);let Le;const ze=(...e)=>{const t=(Le||(Le=(0,c.K9)(Te))).createApp(...e),{mount:n}=t;return t.mount=e=>{const r=function(e){if((0,d.Kg)(e))return document.querySelector(e);return e}(e);if(!r)return;const i=t._component;(0,d.Tn)(i)||i.render||i.template||(i.template=r.innerHTML),1===r.nodeType&&(r.textContent="");const s=n(r,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t};function Ae(e,t){if(t.freeze)return;e.preventDefault(),e.stopPropagation();const{doc:n,stats:r}=t,{deltaY:i,currentTarget:s}=e,o=t.config.data.revert_scope;i>0&&!o?t.expand("down"):t.expand("up")}const Pe={class:"iconbox"},Re=(0,c.pM)({__name:"note-scope",props:{selection:{}},setup(e){const t=(0,c.EW)(()=>{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=(0,c.EW)(()=>{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 r(){e.selection.freeze=!e.selection.freeze}function i(t,n,r){t.stopPropagation();const{root:i}=e.selection,s=new _.vk(i.courier),a=n.get_scope_info(),l=a.cube.children[a.range[0]],c=a.cube.children[a.range[1]-1];if("A"===r&&c)if(c instanceof pt){const e=pt.get_default();s.tell(a.cube,o.VL.insert_child(a.cube.id,[e],c.index+1))}else{const e=gt.get_default(),t=o.VL.insert_child(a.cube.id,[e],c.index+1);s.tell(a.cube,t)}else if("B"===r&&l)if(l instanceof pt){const e=pt.get_default();s.tell(a.cube,o.VL.insert_child(a.cube.id,[e],l.index))}else{const e=gt.get_default(),t=o.VL.insert_child(a.cube.id,[e],l.index);s.tell(a.cube,t)}i.history.record(s)}function s(t){t.preventDefault(),t.stopPropagation(),e.selection.remove()}return(e,o)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["doc-scope",{freeze:e.selection.freeze}]),style:(0,d.Tr)(e.selection.css),onWheel:o[3]||(o[3]=t=>(0,l.R1)(Ae)(t,e.selection)),onClick:r,onContextmenu:s},[(0,c.Lk)("div",Pe,[(0,c.Lk)("div",{class:"iconfont icon-a-copy",style:(0,d.Tr)(n.value),title:"在上方插入行",onClick:o[0]||(o[0]=t=>i(t,e.selection,"A"))},null,4),(0,c.Lk)("div",{class:"iconfont icon-force_vortex-copy",title:"取消选区",style:(0,d.Tr)(t.value),onClick:o[1]||(o[1]=()=>e.selection.remove())},null,4),(0,c.Lk)("div",{class:"iconfont icon-B-copy",style:(0,d.Tr)(n.value),title:"在上方插入行",onClick:o[2]||(o[2]=t=>i(t,e.selection,"B"))},null,4)])],38))}}),Ne=(0,f.A)(Re,[["__scopeId","data-v-bdec0da6"]]);var Ee=n(4031);class Oe extends Ee.K{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_doc_input_before(e).some(e=>"stop"===e))return;e.preventDefault();const{courier:t,cursor:n,history:r}=this,i=e.data,{cube_end:s,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n;if(!l||!s||!a)return;const u=a.id,h=s.id,p=l.id;if("insertText"===e.inputType){if(!(l instanceof X&&i)){const e=t.get_recorder(),n=X.get_default(i||""),s=o.VL.insert(p,[n],u,h,c,d);return e.tell(l,s),r.record(e)}{const e=t.get_recorder();this.ins(e,this.root,i,l,c,d),r.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 i=o.VL.delete(p,t,u,h,c,d);return n.tell(l,i),r.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){}compositionend(e){const{courier:t,cursor:n,history:r,stats:i,event:s}=this.root;if(n.has_selection)return;if(!i.in_composition_mode)return;const{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n,u=e.data,h=new _.vk(t);if(l&&o&&a){if(l instanceof X){const e=l.text,t=d-u.length,n=`${e.slice(0,t)}${u}${e.slice(t)}`,r=$.reset(l.id,n,t,d);h.tell(l,r)}else console.error("编辑目标无法在内存结构中找到,此问题多由于未将子cube计算到children属性");i.in_composition_mode=!1,r.record(h),s.emit_doc_input_compositionend(e)}}clear_selection_text(){const{cursor:e,courier:t,history:n}=this;if(!e.has_selection)return;const{cube_end:r,cube_start:i,cube_selection:s,offset_start:a,offset_end:l}=e;if(!s||!r||!i)return;const c=new _.vk(t);c.tell(s,o.VL.delete(s.id,"backward",i.id,r.id,a,l)),n.record(c)}ins(e,t,n,r,i,s){const{courier:a,history:l}=t,c=r.text,d=c.slice(0,i)+n+c.slice(s),u=i+n.length,h=$.reset(r.id,d,i,u);e.tell(r,h);const p=o.VL.merge(r.id,"both",r.id,u);return e.tell(r,p),e}click_selection_text(e){if(!this.down_caret||!e.shiftKey)return;const{offset_end:t,node_end:n}=this.cursor,{offset:r,offsetNode:i}=this.down_caret;n instanceof Text&&i instanceof Text&&Promise.resolve().then(()=>{this.cursor.set_selection_between(n,t,i,r)})}drag_selection_text(e){if(!this.has_down||!this.down_caret||!g.I.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 Ie extends Oe{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:r}=t,i=e.dataTransfer;if(!i)return;const s=new DOMParser,o=i.getData("text/plain"),a=i.getData("text/html"),l=i.files;if(console.log("🍊",l),o){const e=this.courier.get_recorder();console.log("💠text",o);const{offset_end:t,offset_start:n,cube_selection:r}=this.cursor;if(!(r instanceof X))return;this.ins(e,this._root,o,r,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:r}=this.root,i=this.root.child_last;if(i&&i.is_empty){let e=i;for(;e;){if(e instanceof X){e.line?.dom?.focus(),e.set_cursor_in_tail();break}e=e.child_last}}else{const e=new _.vk(t),n=pt.get_default();e.tell(this.root,o.VL.insert_child(this.root.id,[n],this.root.child_count)),r.record(e)}}}class Be extends Oe{}var De=n(1742),Ve=n(8984);const He={class:"dialog-form"},je={class:"form-grid"},Fe={class:"label"},Ue=["onUpdate:modelValue"],qe=(0,c.pM)({__name:"menu-dialog",setup(e){const t=(0,l.KR)();function n(){const e=t.value;e&&(De.Bz.open=!1,e.close())}function r(){n(),De.Bz.submit(De.Bz.data)}return(0,c.wB)(()=>De.Bz.open,()=>{const e=t.value;e&&(De.Bz.open?e.showModal():e.close())}),(e,i)=>((0,c.uX)(),(0,c.CE)("dialog",{class:"menu-dialog",ref_key:"root",ref:t,onClose:n},[(0,c.Lk)("div",He,[(0,c.Lk)("div",{class:"close-corner",onClick:n}),(0,c.Lk)("div",je,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(Object.keys((0,l.R1)(De.Bz).data),e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e},[(0,c.Lk)("div",Fe,(0,d.v_)(e),1),(0,c.bo)((0,c.Lk)("input",{type:"text","onUpdate:modelValue":t=>(0,l.R1)(De.Bz).data[e]=t},null,8,Ue),[[Me,(0,l.R1)(De.Bz).data[e]]])],64))),128))]),(0,c.Lk)("div",{class:"dialog-submit",onClick:r},"确认")])],544))}}),$e=(0,f.A)(qe,[["__scopeId","data-v-edfb8f60"]]),Ge={class:"menu-title iconfont icon-sp"},Xe=["onPointerdown","onMouseenter"],Ke={class:"item-shortcut"},We={key:0,class:"iconfont icon-arrow-right"},Ye={class:"menu-title iconfont icon-sp"},Ze=["onPointerdown","onMouseenter"],Qe={class:"item-shortcut"},Je={key:0,class:"iconfont icon-arrow-right"},et=(0,c.pM)({__name:"note-menu",props:{root:{}},setup(e){const t=(0,l.KR)(),n=(0,l.KR)([]);function r(e,t=!1){t?(De.h_.stack_menus.length=e,De.h_.stack_rect.length=e,De.h_.menu=void 0):(De.h_.stack_menus.length=e,De.h_.stack_rect.length=e)}function i(e,t,n){if(r(t),!n.has_submenu)return;const i=e.currentTarget;De.h_.stack_rect.push(i.getBoundingClientRect());const s=n.mouseenter(e);De.h_.stack_menus.push(s)}function s(e,t){r(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(0,c.wB)(()=>De.h_.point,async()=>{const e=t.value;if(!e)return;await(0,c.dY)(),De.h_.stack_pos.length=0;const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},r=e.getBoundingClientRect(),i={x:De.h_.point.x,y:De.h_.point.y,width:0,height:0},s=N.MathRect.move_rect_to_other(n,r,i);De.h_.css={left:s.x+"px",top:s.y+"px"}}),(0,c.wB)(De.h_.stack_menus,async()=>{await(0,c.dY)();const e=n.value;if(!e)return;De.h_.stack_pos.length=0;const t={x:0,y:0,width:window.innerWidth,height:window.innerHeight};for(let n=0;n<De.h_.stack_menus.length;n++){const r=De.h_.stack_rect[n],i=e[n].getBoundingClientRect(),s=(0,Ve.LU)(t,i,r);De.h_.stack_pos.push({left:s.x+"px",top:s.y+"px"})}}),(0,c.sV)(()=>{document.documentElement.addEventListener("pointerdown",e=>{const n=t.value;if(!n)return;const r=e.target;r&&!n.contains(r)&&(De.h_.menu=void 0,De.h_.stack_menus.length=0,De.h_.stack_pos.length=0,De.h_.stack_rect.length=0)},{capture:!0})}),(e,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"note-menus",style:(0,d.Tr)((0,l.R1)(De.h_).css),ref_key:"dom",ref:t,onWheel:a},[(0,c.Q3)(" 弹窗 "),(0,c.bF)($e),(0,c.Q3)(" 主菜单列表 "),(0,l.R1)(De.h_).menu?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"menu-list",ref_key:"ms",ref:n},[(0,c.Lk)("div",Ge,(0,d.v_)((0,l.R1)(De.h_).menu.title),1),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(De.h_).menu.menus,e=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["menu-item",{"active-item":(0,l.R1)(De.h_).menu.active.includes(e.title)}]),style:(0,d.Tr)(o(e)),key:e.title,onPointerdown:t=>s(t,e),onMouseenter:t=>i(t,0,e)},[(0,c.Lk)("div",{class:(0,d.C4)(["item-title",e.icon])},(0,d.v_)(e.title),3),(0,c.Lk)("div",Ke,(0,d.v_)(e.shortcut),1),e.has_submenu?((0,c.uX)(),(0,c.CE)("div",We)):(0,c.Q3)("v-if",!0)],46,Xe))),128))],512)):(0,c.Q3)("v-if",!0),(0,c.Q3)(" 子菜单列表 "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(De.h_).stack_menus,(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"submenu-list",ref_for:!0,ref_key:"ms",ref:n,style:(0,d.Tr)((0,l.R1)(De.h_).stack_pos[t])},[(0,c.Lk)("div",Ye,(0,d.v_)(e.title),1),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.menus,n=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["menu-item",{"active-item":e.active.includes(n.title)}]),style:(0,d.Tr)(o(n)),key:n.title,onPointerdown:e=>s(e,n),onMouseenter:e=>i(e,t+1,n)},[(0,c.Lk)("div",{class:(0,d.C4)(["item-title",n.icon])},(0,d.v_)(n.title),3),(0,c.Lk)("div",Qe,(0,d.v_)(n.shortcut),1),n.has_submenu?((0,c.uX)(),(0,c.CE)("div",Je)):(0,c.Q3)("v-if",!0)],46,Ze))),128))],4))),256))],36))}}),tt=(0,f.A)(et,[["__scopeId","data-v-37bc0e84"]]),nt=["id","data-type"],rt={class:"doc-postils"},it=(0,c.pM)({__name:"cube-doc",props:{cube:{}},setup(e){const t=e.cube,{config:n}=e.cube,r=new Ie(t),i=e=>r.pointerdown(e),s=e=>r.pointermove(e),o=e=>r.pointerup(e),u=e=>r.pointercancel(e),h=e=>r.handler_click_foot(e),p=e=>r.compositionstart(e),f=e=>r.compositionupdate(e),m=e=>r.compositionend(e),_=e=>r.beforeinput(e),g=e=>r.dragover(e),b=e=>r.dragenter(e),v=e=>r.dragleave(e),y=e=>r.drop(e);return(0,c.sV)(()=>{document.documentElement.addEventListener("pointerup",o),document.documentElement.addEventListener("pointermove",s),document.documentElement.addEventListener("pointercancel",u)}),(e,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-doc",id:(0,l.R1)(t).id,"data-type":(0,l.R1)(a.u0).doc,style:(0,d.Tr)((0,l.R1)(n).css_vars),onDragover:g,onDragenter:b,onDragleave:v,onDrop:y},[(0,c.Lk)("div",{class:"note",onPointerdown:i,onCompositionstart:p,onCompositionupdate:f,onCompositionend:m,onBeforeinput:_},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)((0,c.$y)(e.component),{key:e.id,cube:e,id:e.id},null,8,["cube","id"]))),128)),(0,c.Q3)(" doc-cubes "),(0,c.Lk)("div",rt,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).cubes.postils,([e,t])=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t},null,8,["cube"]))),128))]),(0,c.Q3)(" footer "),(0,c.Lk)("div",{class:"cube-doc-footer",onPointerdown:h},null,32)],32),(0,c.Q3)(" scope selection "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).scope,e=>((0,c.uX)(),(0,c.Wv)(Ne,{key:e.id,selection:(0,l.IG)(e)},null,8,["selection"]))),128)),(0,c.Q3)(" menus "),(0,c.bF)(tt,{root:e.cube},null,8,["root"])],44,nt))}}),st=(0,f.A)(it,[["__scopeId","data-v-728e5342"]]);var ot=n(1445),at=n(122);const lt=["id","data-type"],ct={class:"cube-box-root-content"},dt=(0,c.pM)({__name:"cube-box-root",props:{cube:{}},setup(e){const t=e.cube,{stats:n}=e.cube,r=(0,c.EW)(()=>({opacity:(e.cube.child_count+10)/60})),i=e=>(0,ot.bQ)(e,t),s=e=>(0,ot.dw)(e,t),o=e=>(0,ot.AG)(e,t),u=e=>(0,ot.o)(e,t),h=e=>(0,ot.pn)(e,t),p=e=>(0,ot.gV)(e,t),f=e=>(0,ot.M3)(e,t),m=e=>(0,ot._V)(e,t);function _(e){const{stats:t}=e;return{"anchor-root":t.anchor_root_id===e.id,"fold-root":e.attrs.fold}}return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box-root",style:(0,d.Tr)((0,l.R1)(t).css),draggable:"true",id:e.cube.id,"data-type":(0,l.R1)(a.u0).box_root,onContextmenu:n[2]||(n[2]=t=>(0,l.R1)(at.uz)(t,e.cube)),onFocusin:m,onDragstart:i,onDragenter:s,onDrop:o,onDragend:u,onDragover:h,onDragleave:p,onPointerdown:f},[(0,c.Lk)("div",{class:(0,d.C4)(["cube-dragger",_(e.cube)]),style:(0,d.Tr)(r.value),onClick:n[0]||(n[0]=t=>(0,l.R1)(ot.KS)(t,e.cube)),onContextmenu:n[1]||(n[1]=t=>(0,l.R1)(ot.kE)(t,e.cube)),"data-tag":"cube-box-root-dragger"},null,38),(0,c.Lk)("div",ct,[e.cube.attrs.fold?((0,c.uX)(),(0,c.Wv)(S,{key:0,cube:e.cube.child_first},null,8,["cube"])):((0,c.uX)(!0),(0,c.CE)(c.FK,{key:1},(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:(0,l.IG)(e)},null,8,["cube"]))),128))])],44,lt))}}),ut=(0,f.A)(dt,[["__scopeId","data-v-76631106"]]);function ht(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class pt extends o._D{_component=ut;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 this._component}get meta(){return pt.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof gt&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return pt.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:r,from_id:i}=e,s=new _.vk(t);return"left"===n?this.prev_cube_deep instanceof pt?s.tell(this,o.VL.merge(this.id,"left",i,r)):s.tell(this,o.UB.in_head(this.id,0)):"right"===n&&(this.next_cube_deep instanceof pt?s.merge(this.on(o.VL.merge(this.id,"right",i,r))):s.tell(this,o.UB.in_tail(this.id,0))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof pt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof pt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof pt&&r instanceof pt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof pt&&!(r instanceof pt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof pt)&&r instanceof pt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_cube_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){const e=this.children[0];if(1===this.child_count&&e instanceof X&&e.is_empty)return;const t=this.export().info,n=new gt(gt.get_default(),this);this.splice(0,this.child_count,n),r.add_recover(o.VL.reset(this.id,t)),r.tell(n,o.UB.in_tail(n.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;let s=this.get_valid_index(n);const a=g.I.pick(r,!0),l=g.I.build_cubes(a.sort,this);this.splice(s,0,...l),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+l.length]));const c=l[l.length-1],d=this.children[s+1];return c?i.tell(c,o.UB.in_tail(c.id,0)):i.tell(d,o.UB.in_head(d.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count&&!l){if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));return c}{const e=this.children[h-1],t=this.children[p],n=p-h;let r=this.splice(d,n);c.add_recover(o.VL.insert_child(this.id,r.data,d)),"backward"===s?e?c.tell(e,o.UB.in_tail(e.id,0)):t&&c.tell(t,o.UB.in_head(t.id,0)):"forward"===s&&(t?c.tell(t,o.UB.in_head(t.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}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=>!X.is_empty_text(e))}static get meta(){return{type:a.u0.box_root,cubename:"根级块",version:1,block:!0,show:!1}}static get_default(e=[],t={},n={fold:!1}){const r=0===e.length?[gt.get_default()]:e;return{id:g.I.get_id(),type:a.u0.box_root,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}ht([(0,k.H)(a.zS.cube_delete_adjacent)],pt.prototype,"on_cube_delete_adjacent",null),ht([(0,k.H)(a.zS.cube_merge)],pt.prototype,"on_merge",null),ht([(0,k.H)(a.zS.cube_reorder)],pt.prototype,"on_cube_reorder",null),ht([(0,k.H)(a.zS.cube_reset)],pt.prototype,"on_cube_reset",null),ht([(0,k.H)(a.zS.cube_insert_child)],pt.prototype,"on_insert_child",null),ht([(0,k.H)(a.zS.cube_delete_child)],pt.prototype,"on_delete_child",null);class ft{}class mt extends o.MR{_app;data;constructor(e){super();const t=this.update_data(e).data;this.data=(0,l.Kh)(t),this.build_child(t),k.o.init_cmd_handler(this),A.K.add_doc(this),this._app=ze(st,{cube:this})}get domain(){return"doc"}get app(){return this._app}get component(){return st}get meta(){return mt.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=g.I.build_cubes(e.info,this);return this._children.push(...t),t}gc(){}export(){const e=(0,l.ux)(this.data);e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return e.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return mt.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:a.u0.doc,cubename:"文档",version:1,block:!0,show:!1}}static get_default(){return pt.get_default(),{id:(0,s.Ak)(),type:a.u0.doc,versions:A.K.export_versions(),info:[],css:{},attrs:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}function _t(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class gt extends o._D{_component=Y;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 gt.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 X)return e}get child_last_text(){for(let e of[...this._children].reverse())if(e instanceof X)return e}get next_line(){let e=this.next_cube_deep;for(;e;){if(e instanceof mt)return;let t=g.I.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 mt)return;let t=g.I.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 r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return gt.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 r=n.attrs.indent||0;n.attrs.indent=e+r-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:r,index:i,pid:s,pcube:a}=this,{method:l,cubeid:c,offset:d}=e,u=new _.vk(t);if("left"===l&&n instanceof gt){const e=this.export().info,t=g.I.filter_out_empty(e);u.tell(n,o.VL.insert_child(n.id,t,"tail")),u.tell(a,o.VL.delete_child(this.pid,"forward",[i,i+1]));const r=n.find_child_cube(c);r&&u.tell(r,o.UB.in_head(c,d))}else if("right"===l&&r instanceof gt){const e=r.export().info,t=g.I.filter_out_empty(e);u.tell(this,o.VL.insert_child(this.id,t,"tail")),u.tell(a,o.VL.delete_child(s,"backward",[i+1,i+2]));const n=this.find_child_cube(c);n&&u.tell(n,o.UB.in_head(c,d))}else if("both"===l)if(n instanceof gt&&r instanceof gt){const e=g.I.filter_out_empty(this.export().info),t=g.I.filter_out_empty(r.export().info);u.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),u.tell(a,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_child_cube(c);i&&u.tell(i,o.UB.in_head(c,d))}else if(n instanceof gt&&!(r instanceof gt)){const e=g.I.filter_out_empty(this.export().info);u.tell(n,o.VL.insert_child(n.id,e,"tail")),u.tell(a,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_child_cube(c);t&&u.tell(t,o.UB.in_head(c,d))}else if(!(n instanceof gt)&&r instanceof gt){const e=g.I.filter_out_empty(r.export().info);u.tell(this,o.VL.insert_child(this.id,e,"tail")),u.tell(a,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_child_cube(c);t&&u.tell(t,o.UB.in_head(c,d))}return u}on_cube_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){if(this.is_empty)return;const e=this.export().info,t=new X(X.get_default(),this);this.splice(0,this.child_count,t),r.add_recover(o.VL.reset(this.id,e)),r.tell(t,o.UB.in_tail(t.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t,pid:n,pcube:r}=this,{pos:i,data:s}=e,a=new _.vk(t);if(0===s.length)return a;let l=this.get_valid_index(i);const c=g.I.pick(s);if(c.head.length>0){a.add_cmd(e);const t=g.I.build_cubes(s,this),n=t[t.length-1];this.splice(l,0,...t),a.add_recover(o.VL.delete_child(this.id,"backward",[l,l+t.length])),n&&a.tell(n,o.UB.in_tail(n.id,0))}const d=[...c.body];if(c.tail.length>0&&d.push(gt.get_default(c.tail)),c.root.length>0)for(let e of c.root)d.push(...e.info);if(d.length>0)if(this.inherit_line(d),this.is_empty)a.tell(r,o.VL.insert_child(n,d,this.index)),a.tell(r,o.VL.delete_child(n,"backward",[this.index,this.index+1]));else{const e=this.get_valid_index(l+c.head.length);if(e<this.child_count){const t=this._children.slice(e);if(t.length>0){const i=t.map(e=>e.export()),s=gt.get_default(i);this.inherit_line([s]),a.tell(this,o.VL.delete_child(this.id,"backward",[e,this.child_count])),a.tell(r,o.VL.insert_child(n,[s],this.index+1))}}a.tell(r,o.VL.insert_child(n,d,this.index+1))}return a}on_delete_child(e){const{dir:t,range:n,reserve:r}=e,{courier:i,pid:s,index:a,pcube:l}=this,c=i.get_recorder();c.add_cmd(e);const[d,u]=n;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count)if(r){if(this.is_empty)return;const e=this.child_first;e instanceof X?(c.tell(this,o.VL.delete_child(this.id,t,[1,this.child_count])),c.tell(e,$.reset(e.id,"",1,1))):c.tell(this,o.VL.reset(this.id,[]))}else this.is_empty?c.tell(l,o.VL.delete_child(s,t,[a,a+1])):c.tell(this,o.VL.reset(this.id,[]));else{const e=this.children[h-1],n=this.children[p],r=p-h;if(h>=this.child_count||r<=0)return;let i=this.splice(h,r);c.add_recover(o.VL.insert_child(this.id,i.data,d)),"backward"===t?e?c.tell(e,o.UB.in_tail(e.id,0)):n&&c.tell(n,o.UB.in_head(n.id,0)):"forward"===t&&(n?c.tell(n,o.UB.in_head(n.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}on_cube_delete_adjacent(e){const{courier:t,pid:n,prev_cube:r,next_cube:i,pcube:s}=this,{from:a,from_id:l,offset:c}=e,d=new _.vk(t);return"left"===a?this.prev_cube_deep instanceof gt?d.tell(this,o.VL.merge(this.id,"left",l,c)):d.tell(this,o.UB.in_head(this.id,0,void 0)):"right"===a&&(this.next_cube_deep instanceof gt?d.tell(this,o.VL.merge(this.id,"right",l,c)):d.tell(this,o.UB.in_tail(this.id,0,void 0))),d}static filter_out_empty(e){return e.filter(e=>!X.is_empty_text(e))}static get meta(){return{version:1,type:a.u0.line,cubename:"行",block:!0,show:!1}}static get_default(e=[],t={},n={}){const r=0===e.length?[X.get_default()]:e;return{id:(0,s.Ak)(),type:a.u0.line,info:r,css:t,attrs:n}}static get_default_by_string(e="",t={},n={}){const r=[X.get_default(e||"")];return{id:(0,s.Ak)(),type:a.u0.line,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}_t([(0,k.H)(a.zS.cube_merge)],gt.prototype,"on_cube_merge",null),_t([(0,k.H)(a.zS.cube_reset)],gt.prototype,"on_cube_reset",null),_t([(0,k.H)(a.zS.cube_insert_child)],gt.prototype,"on_insert_child",null),_t([(0,k.H)(a.zS.cube_delete_child)],gt.prototype,"on_delete_child",null),_t([(0,k.H)(a.zS.cube_delete_adjacent)],gt.prototype,"on_cube_delete_adjacent",null);const bt=["id","data-type"],vt=(0,c.pM)({__name:"cube-box",props:{cube:{}},setup(e){function t(t){if(t.target===t.currentTarget){t.stopPropagation();const{courier:n,history:r}=e.cube,i=n.get_recorder(),s=o.UB.in_tail(e.cube.id,0,"none");i.tell(e.cube,s),r.record(i)}}return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(x.u0).box,onPointerup:t},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],44,bt))}}),yt=(0,f.A)(vt,[["__scopeId","data-v-29b5ba30"]]);function wt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class xt extends o._D{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(0,l.IG)(yt)}get attrs(){return this.data.attrs}get meta(){return xt.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}gc(){super.base_gc()}replace_id(e,t={}){return xt.replace_id(this.root,e,t)}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof xt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_child_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof xt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof xt&&r instanceof xt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof xt&&!(r instanceof xt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof xt)&&r instanceof xt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_box_order(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count)if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));else{const e=this.children[h-1],t=this.children[p],n=p-h;if(h>=this.child_count||n<=0)return;let r=this.splice(h,n);c.add_recover(o.VL.insert_child(this.id,r.data,d)),"backward"===s?e?c.tell(e,o.UB.in_tail(e.id,0)):t&&c.tell(t,o.UB.in_head(t.id,0)):"forward"===s&&(t?c.tell(t,o.UB.in_head(t.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}on_box_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){if(this.is_empty)return;const e=this.export().info,t=new gt(gt.get_default(),this);this.splice(0,this.child_count,t),r.add_recover(o.VL.reset(this.id,e)),r.tell(t,o.UB.in_tail(t.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:r}=this,{from:i,from_id:s,offset:a}=e,l=new _.vk(t);if("left"===i)if(this.prev_cube_deep instanceof xt)l.tell(this,o.VL.merge(this.id,"left",s,a));else{const e=this.export().info,t=this.child_first.id;l.tell(n,o.VL.insert_child(r,e,this.index)),l.merge(this.remove_self());const c=n.find_cube(t);c&&l.tell(c,o.VL.delete_adjacent(t,i,s,a))}else if("right"===i)if(this.next_cube_deep instanceof xt)l.merge(this.on(o.VL.merge(this.id,"right",s,a)));else{const e=this.export().info,t=this.child_first.id;l.tell(n,o.VL.insert_child(r,e,this.index)),l.merge(this.remove_self());const c=n.find_cube(t);c&&l.tell(c,o.VL.delete_adjacent(t,i,s,a))}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 get meta(){return{type:a.u0.box,cubename:"块",version:1,block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=[];return 0===e.length?r.push(gt.get_default()):r.push(...g.I.pick(e).sort),{id:g.I.get_id(),type:a.u0.box,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}wt([(0,k.H)(a.zS.cube_merge)],xt.prototype,"on_merge",null),wt([(0,k.H)(a.zS.cube_reorder)],xt.prototype,"on_box_order",null),wt([(0,k.H)(a.zS.cube_insert_child)],xt.prototype,"on_insert_child",null),wt([(0,k.H)(a.zS.cube_delete_child)],xt.prototype,"on_delete_child",null),wt([(0,k.H)(a.zS.cube_reset)],xt.prototype,"on_box_reset",null),wt([(0,k.H)(a.zS.cube_delete_adjacent)],xt.prototype,"on_cube_delete_adjacent",null);const kt=["id","data-type"],St=(0,c.pM)({__name:"cube-box-folder",props:{cube:{}},setup(e){const t=e.cube,{stats:n}=e.cube;return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["cube-box-folder",{"cube-box-folder-active":e.cube.attrs.fold}]),id:e.cube.id,style:(0,d.Tr)((0,l.R1)(t).css),"data-type":(0,l.R1)(a.u0).box_folder},[e.cube.attrs.fold?((0,c.uX)(),(0,c.Wv)(S,{key:0,cube:e.cube.child_first},null,8,["cube"])):((0,c.uX)(!0),(0,c.CE)(c.FK,{key:1},(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:(0,l.IG)(e)},null,8,["cube"]))),128)),(0,c.Lk)("div",{class:(0,d.C4)(["folder-tag",{"folder-tag-active":e.cube.attrs.fold}]),onClick:n[0]||(n[0]=t=>function(e,t){const{courier:n,history:r,cubes:i,id:s,pcube:a}=t,l=n.get_recorder();l.tell(t,o.VL.fold(s,!t.attrs.fold)),r.record(l);for(let e of Object.values(i.postils))e.find_upstream_untill(a)===t&&e.visible(!1);const c=t.child_first.id;if(!c)return;const d=document.getElementById(c);d?.scrollIntoView({block:"nearest",behavior:"smooth"})}(0,e.cube))},null,2)],14,kt))}}),Ct=(0,f.A)(St,[["__scopeId","data-v-e4ce51da"]]);function Mt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Tt extends o._D{_component=Ct;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 this._component}get meta(){return Tt.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof gt&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t){return Tt.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:r,from_id:i}=e,s=new _.vk(t);return"left"===n?this.prev_cube_deep instanceof Tt?s.tell(this,o.VL.merge(this.id,"left",i,r)):s.tell(this,o.UB.in_head(this.id,0)):"right"===n&&(this.next_cube_deep instanceof Tt?s.merge(this.on(o.VL.merge(this.id,"right",i,r))):s.tell(this,o.UB.in_tail(this.id,0))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof Tt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof Tt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof Tt&&r instanceof Tt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof Tt&&!(r instanceof Tt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof Tt)&&r instanceof Tt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_cube_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){const e=this.children[0];if(1===this.child_count&&e instanceof X&&e.is_empty)return;const t=this.export().info,n=new gt(gt.get_default(),this);this.splice(0,this.child_count,n),r.add_recover(o.VL.reset(this.id,t)),r.tell(n,o.UB.in_tail(n.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=a[a.length-1],c=this.children[s+1];return l?i.tell(l,o.UB.in_tail(l.id,0)):i.tell(c,o.UB.in_head(c.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(h>=p)return;if(h<=0&&p>=this.child_count){if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));return c}const f=this.children[h-1],m=this.children[p],_=p-h;let g=this.splice(d,_);return c.add_recover(o.VL.insert_child(this.id,g.data,d)),"backward"===s?f?c.tell(f,o.UB.in_tail(f.id,0)):m&&c.tell(m,o.UB.in_head(m.id,0)):"forward"===s&&(m?c.tell(m,o.UB.in_head(m.id,0)):f&&c.tell(f,o.UB.in_tail(f.id,0))),c}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=>!X.is_empty_text(e))}static get meta(){return{type:a.u0.box_folder,cubename:"折叠块",version:1,block:!0,show:!0}}static get_default(e=[],t={},n={fold:!1}){const r=0===e.length?[gt.get_default()]:e;return{id:g.I.get_id(),type:a.u0.box_folder,info:r,css:t,attrs:n}}static replace_id(e,t,n){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}Mt([(0,k.H)(a.zS.cube_delete_adjacent)],Tt.prototype,"on_cube_delete_adjacent",null),Mt([(0,k.H)(a.zS.cube_merge)],Tt.prototype,"on_merge",null),Mt([(0,k.H)(a.zS.cube_reorder)],Tt.prototype,"on_cube_reorder",null),Mt([(0,k.H)(a.zS.cube_reset)],Tt.prototype,"on_cube_reset",null),Mt([(0,k.H)(a.zS.cube_insert_child)],Tt.prototype,"on_insert_child",null),Mt([(0,k.H)(a.zS.cube_delete_child)],Tt.prototype,"on_delete_child",null);class Lt{}const zt=["d","id","data-type","stroke-width","stroke","marker-start","marker-end"],At=(0,c.pM)({__name:"cube-linker",props:{cube:{}},setup:e=>(t,n)=>((0,c.uX)(),(0,c.CE)("path",{d:t.cube.path,id:t.cube.id,class:(0,d.C4)({"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}),style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).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,zt))}),Pt=(0,f.A)(At,[["__scopeId","data-v-76929958"]]),Rt=["cx","cy"],Nt=(0,c.pM)({__name:"op-node-drag",props:{interaction:{}},setup(e){const{info_node_drag:t}=e.interaction;return(e,n)=>((0,c.uX)(),(0,c.CE)(c.FK,null,[(0,l.R1)(t).show?((0,c.uX)(),(0,c.CE)("circle",{key:0,cx:(0,l.R1)(t).x,cy:(0,l.R1)(t).y,r:"20",stroke:"black","stroke-width":"2","stroke-dasharray":"4 4",fill:"none"},null,8,Rt)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <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))}}),Et={class:"map-status"},Ot={class:"map-scale"},It={class:"map-nodes"},Bt=(0,c.pM)({__name:"map-status",props:{cube:{}},setup(e){const t=e.cube,n=(0,c.EW)(()=>e.cube.cubes.get_types_cube(a.u0.node));function r(e){const n=t.dom_rect,r={x:n.x+n.width/2,y:n.y+n.height/2};t.scale_by_point(r,e,e)}return(t,i)=>((0,c.uX)(),(0,c.CE)("div",Et,[(0,c.Lk)("div",Ot,[(0,c.Lk)("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:i[0]||(i[0]=e=>r(-.1))}),(0,c.Lk)("span",null,(0,d.v_)((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),(0,c.Lk)("span",{class:"iconfont icon-add",onClick:i[1]||(i[1]=e=>r(.1))})]),(0,c.Lk)("div",It,[(0,c.Lk)("span",null,"节点 : "+(0,d.v_)(n.value.size),1)])]))}}),Dt=(0,f.A)(Bt,[["__scopeId","data-v-0d43440f"]]),Vt=new g.J,Ht=["id","data-type"],jt=["transform"],Ft=["data-group"],Ut=["data-group"],qt=["data-group"],$t=["data-group"],Gt=["d"],Xt=["d","stroke-width","stroke","marker-start","marker-end"],Kt=["d"],Wt={class:"doc-postils"},Yt=(0,c.pM)({__name:"cube-map",props:{cube:{}},setup(e){const t=e.cube,{placeholder:n,config:r}=e.cube,i=r.data,s=new Be(t),o=(0,l.KR)(),u=new ResizeObserver(e=>{t.get_view_rect(),Vt.resolve()});(0,c.sV)(()=>{const t=o.value;t&&u.observe(t),window.addEventListener("resize",t=>{e.cube.check_show_throttle()})});const h=e=>s.pointerdown(e),p=e=>s.pointermove(e),f=e=>s.pointerup(e),m=e=>s.pointercancel(e),_=e=>s.compositionstart(e),g=e=>s.compositionupdate(e),b=e=>s.compositionend(e),v=e=>s.beforeinput(e);return(0,c.sV)(()=>{document.documentElement.addEventListener("pointerup",f),document.documentElement.addEventListener("pointermove",p),document.documentElement.addEventListener("pointercancel",m)}),(e,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-map",id:e.cube.id,"data-type":(0,l.R1)(a.u0).map},[(0,c.Lk)("div",{class:"note",onPointerdown:h,onCompositionstart:_,onCompositionupdate:g,onCompositionend:b,onBeforeinput:v},[((0,c.uX)(),(0,c.CE)("svg",{ref_key:"svg",ref:o,style:(0,d.Tr)((0,l.R1)(r).css_vars)},[(0,c.Lk)("g",{transform:(0,l.R1)(t).matrix2d_dom_string},[(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).markers,class:"group-defs"},[...s[0]||(s[0]=[(0,c.Fv)('<defs data-v-f5f318f6>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-f5f318f6><path d="M 0 0 L 6 3 L 0 6 z" data-v-f5f318f6></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-f5f318f6><circle cx="3" cy="3" r="3" data-v-f5f318f6></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-f5f318f6><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-f5f318f6></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-f5f318f6><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-f5f318f6></rect></marker></defs>',1)])],8,Ft),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).linkers,class:"group-linkers"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).get_linkers_view(),e=>((0,c.uX)(),(0,c.Wv)(Pt,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Ut),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).nodes,class:"group-nodes"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_nodes_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,qt),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).placeholder,class:"group-placeholder"},[(0,l.R1)(n).box_selector?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-box-selector",d:(0,l.R1)(n).box_selector},null,8,Gt)):(0,c.Q3)("v-if",!0),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(n).linker,e=>((0,c.uX)(),(0,c.CE)(c.FK,null,[e?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":(0,l.R1)(i).map_linker_stroke_width,stroke:(0,l.R1)(i).map_linker_stroke,"marker-start":`url(#${(0,l.R1)(i).map_linker_anchor_left})`,"marker-end":`url(#${(0,l.R1)(i).map_linker_anchor_right})`},null,8,Xt)):(0,c.Q3)("v-if",!0)],64))),256)),(0,l.R1)(n).line_delete?((0,c.uX)(),(0,c.CE)("path",{key:1,class:"placeholder-line-delete",d:(0,l.R1)(n).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,Kt)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <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> '),(0,c.bF)(Nt,{interaction:e.cube.interaction},null,8,["interaction"])],8,$t),(0,c.Q3)(" --------------------------------------------------------以下是测试信息----------------------------------------------------------- "),(0,c.Q3)(" ------------------节点信息---------------------- "),(0,c.Q3)(' <template v-for="node of cube.nodes_test" v-if="cube.isdev"> '),(0,c.Q3)(" 采样点 "),(0,c.Q3)(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of node.sample"></circle> '),(0,c.Q3)(" 中心点 "),(0,c.Q3)(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),(0,c.Q3)(" 左上角 "),(0,c.Q3)(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),(0,c.Q3)(" 边界框 "),(0,c.Q3)(' <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> '),(0,c.Q3)(" 树边界框 "),(0,c.Q3)(' <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> '),(0,c.Q3)(" </template> "),(0,c.Q3)(" ------------------连线信息---------------------- "),(0,c.Q3)(' <template v-if="cube.root.isdev" v-for="linker of Object.values(cube.linkers)"> '),(0,c.Q3)(" 采样点 "),(0,c.Q3)(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of linker.sample"></circle> '),(0,c.Q3)(" 中心点 "),(0,c.Q3)(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),(0,c.Q3)(" 左上角 "),(0,c.Q3)(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),(0,c.Q3)(" 边界框 "),(0,c.Q3)(' <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> '),(0,c.Q3)(" 树边界框 "),(0,c.Q3)(' <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> '),(0,c.Q3)(" </template> "),(0,c.Q3)(" ------------------意图区域---------------------- "),(0,c.Q3)(' <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,jt)],4)),(0,c.Q3)(" doc-cubes "),(0,c.Lk)("div",Wt,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).cubes.postils,([e,t])=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t},null,8,["cube"]))),128))])],32),(0,c.Q3)(" scope selection "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).scope,e=>((0,c.uX)(),(0,c.Wv)(Ne,{key:e.id,selection:(0,l.IG)(e)},null,8,["selection"]))),128)),(0,c.Q3)(" map status "),(0,c.bF)(Dt,{cube:e.cube},null,8,["cube"]),(0,c.Q3)(" menus "),(0,c.bF)(tt,{root:e.cube},null,8,["root"])],8,Ht))}}),Zt=(0,f.A)(Yt,[["__scopeId","data-v-f5f318f6"]]);var Qt=n(2547);class Jt{static draw(e){const{type:t,from:n,to:r}=e;return"line"===t?this.line(n,r):"bezier2"===t?this.bezier2(n,r):"polyline"===t?this.polyline(n,r):"polyline2"===t?this.polyline2(n,r):"polyline3"===t?this.polyline3(n,r):"wave"===t?this.wave(n,r):this.bezier2(n,r)}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,r=n,i=e.y,s=n,o=t.y;return`M${e.x.toFixed(1)} ${e.y.toFixed(1)} C${r} ${i} ${s} ${o} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static polyline(e,t,n=4){const r=(e.x+t.x)/2,i=e,s=t,o=r,a=i.y,l=r,c=s.y,d=Math.sign(e.x-t.x),u=Math.sign(t.y-e.y),h=Math.sign(e.y-t.y),p=Math.sign(t.x-e.x);return`M${i.x} ${i.y} H ${o+d*n} Q ${o} ${a} ${o} ${a+u*n} V ${c+h*n} Q${l} ${c} ${l+p*n} ${c} H ${s.x}`}static polyline2(e,t,n=4){const r=e,i=t,s=(e.x+t.x)/2,o=r.y;return`M${r.x} ${r.y} L${s} ${o} L ${i.x} ${i.y}`}static polyline3(e,t,n=4){const r=(e.x+t.x)/2,i=e,s=t,o=(i.y,r),a=s.y;return`M${i.x} ${i.y} L${o} ${a} L ${s.x} ${s.y}`}static wave(e,t,n=2,r=8){const i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s),a=Math.atan2(s,i),l=r??o/10;let c=`M ${e.x} ${e.y}`;const d=20*n;for(let t=0;t<=d;t++){const r=t/d,o=e.x+i*r,u=e.y+s*r,h=l*Math.sin(r*n*Math.PI*2),p=o+-Math.sin(a)*h,f=u+Math.cos(a)*h;if(0===t)c+=` M ${p} ${f}`;else{const r=(t-1)/d,o=l*Math.sin(r*n*Math.PI*2),u=-Math.sin(a)*o,h=Math.cos(a)*o,m=e.x+i*r+u,_=e.y+s*r+h;c+=` C ${m+(p-m)/3} ${_+(f-_)/3}, ${p-(p-m)/3} ${f-(f-_)/3}, ${p} ${f}`}}return c}}class en{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?N.MathRect.get_rect_point(n,N._RectPosition.right_mid):"left"===t?N.MathRect.get_rect_point(n,N._RectPosition.left_mid):"down"===t?N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid):"up"===t?N.MathRect.get_rect_point(n,N._RectPosition.top_mid):"time-down"===t?N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid):"time-right"===t?N.MathRect.get_rect_point(n,N._RectPosition.right_mid):void 0}static time_down(e,t){const n=t.env.prev_node||e,r={...n.bound.pos,...n.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(r,N._RectPosition.bottom_mid),to:N.MathRect.get_rect_point(i,N._RectPosition.top_mid)}}static time_right(e,t){const n=t.env.prev_node||e,r={...n.bound.pos,...n.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(r,N._RectPosition.right_mid),to:N.MathRect.get_rect_point(i,N._RectPosition.left_mid)}}static up(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.top_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.bottom_mid)}}static right(e,t){const n=e.bound.rect,r=t.bound.rect;return{from:N.MathRect.get_rect_point(n,N._RectPosition.right_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.left_mid)}}static left(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.left_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.right_mid)}}static down(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.top_mid)}}static free_to_any(e,t){const n=e.sample,r=t.sample;if(0!==n.length&&0!==r.length)return Qt.U.find_closest_points(n,r)}}class tn{static update(e,t){return{id:e,name:a.Sd.update,attrs:t}}}var nn=n(2935),rn=n(3214),sn=n(3676);const on={class:"map-status"},an=(0,c.pM)({__name:"submap-status",props:{cube:{}},setup(e){function t(t){const n=e.cube.dom_rect,r={x:n.x+n.width/2,y:n.y+n.height/2};e.cube.scale_by_point(r,t,t)}return(n,r)=>((0,c.uX)(),(0,c.CE)("div",on,[(0,c.Lk)("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:r[0]||(r[0]=e=>t(-.1))}),(0,c.Lk)("span",null,(0,d.v_)((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),(0,c.Lk)("span",{class:"iconfont icon-add",onClick:r[1]||(r[1]=e=>t(.1))})]))}}),ln=(0,f.A)(an,[["__scopeId","data-v-cb09d654"]]),cn=["id","data-type"],dn=["transform"],un=["data-group"],hn=["data-group"],pn=["data-group"],fn=["data-group"],mn=["d"],_n=["d","stroke-width","stroke","marker-start","marker-end"],gn=["d"],bn=(0,c.pM)({__name:"cube-submap",props:{cube:{}},setup(e){const{placeholder:t}=e.cube,n=e.cube.config.data,r=(0,l.KR)(),i=(0,l.KR)(),s=new ResizeObserver(t=>{e.cube.get_view_rect()}),u=(0,l.KR)();let h;function p(){e.cube.dom_svg_rect}return(0,c.sV)(()=>{const t=i.value;t&&s.observe(t);const n=r.value;n&&e.cube.interaction.register(n);const a=u.value;if(!a)return;h=new N.DragDiff(a);let l=e.cube.attrs.width,c=e.cube.attrs.height,d=l,p=c;h.register_down(()=>{l=e.cube.attrs.width,c=e.cube.attrs.height}),h.register_move((e,t)=>{d=Math.round(e+l),p=Math.round(t+c),n.style.width=d+"px",n.style.height=p+"px"}),h.register_up((t,n)=>{if(l===d&&c===p)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+l),s=Math.round(n+c);r.tell(e.cube,o.VL.resize(e.cube.id,i,s)),e.cube.history.record(r),e.cube.check_show()}),h.register_cancel(()=>{e.cube.attrs.width=l,e.cube.attrs.height=c})}),(0,c.hi)(()=>{h?.off()}),(e,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-submap",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).submap,ref_key:"box",ref:r,onClick:p},[((0,c.uX)(),(0,c.CE)("svg",{ref_key:"svg",ref:i},[(0,c.Lk)("g",{transform:e.cube.matrix2d_dom_string},[(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).markers,class:"group-defs"},[...s[0]||(s[0]=[(0,c.Fv)('<defs data-v-2ce35c78>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-2ce35c78><path d="M 0 0 L 6 3 L 0 6 z" data-v-2ce35c78></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-2ce35c78><circle cx="3" cy="3" r="3" data-v-2ce35c78></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-2ce35c78><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-2ce35c78></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-2ce35c78><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-2ce35c78></rect></marker></defs>',1)])],8,un),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).linkers,class:"group-linkers"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_linkers_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,hn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).nodes,class:"group-nodes"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_nodes_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,pn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).placeholder,class:"group-placeholder"},[(0,l.R1)(t).box_selector?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-box-selector",d:(0,l.R1)(t).box_selector},null,8,mn)):(0,c.Q3)("v-if",!0),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).linker,e=>((0,c.uX)(),(0,c.CE)(c.FK,null,[e?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":(0,l.R1)(n).map_linker_stroke_width,stroke:(0,l.R1)(n).map_linker_stroke,"marker-start":`url(#${(0,l.R1)(n).map_linker_anchor_left})`,"marker-end":`url(#${(0,l.R1)(n).map_linker_anchor_right})`},null,8,_n)):(0,c.Q3)("v-if",!0)],64))),256)),(0,l.R1)(t).line_delete?((0,c.uX)(),(0,c.CE)("path",{key:1,class:"placeholder-line-delete",d:(0,l.R1)(t).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,gn)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <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> '),(0,c.bF)(Nt,{interaction:e.cube.interaction},null,8,["interaction"])],8,fn)],8,dn)],512)),(0,c.bF)(ln,{cube:e.cube},null,8,["cube"]),(0,c.Lk)("div",{class:"submap-dragger",ref_key:"dragger",ref:u},null,512)],12,cn))}}),vn=(0,f.A)(bn,[["__scopeId","data-v-2ce35c78"]]);function yn(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class wn extends o._D{_interaction;_has_layout=!1;_display_success=!1;data;nodes_test=(0,l.Gc)({});matrix2d=(0,l.Kh)(Qt.c.get_default());nodes=(0,l.Gc)({});node_from=(0,l.Kh)({});node_to=(0,l.Kh)({});node_editing=(0,l.Gc)(new Set);linkers=(0,l.Gc)({});nodes_selected=(0,l.Gc)(new Set);line_delete_selected=(0,l.Gc)(new Set);view_nodes=(0,l.Gc)(new Set);view_linkers=(0,l.Gc)(new Set);_view_rect=(0,l.Kh)({x:0,y:0,width:0,height:0});placeholder=(0,l.Kh)({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e,t){return super(e,t),this._interaction=new sn.T(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 Qt.c.get_dom_string(this.matrix2d)}get interaction(){return this._interaction}get domain(){return"doc"}get meta(){return wn.meta}get component(){return vn}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,r=Math.max(n.left,0),i=Math.min(n.right,t),s={x:r,y:Math.max(0,n.top)},o={x:i,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,u={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,u),u}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))N.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))N.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 o.wP?(this.nodes[t.id]=t,this.view_nodes.add(t)):t instanceof xn&&(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 r=n.bound.rect;N.MathRect.check_intersection(e,r)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof o.wP?this.view_nodes.add(e):e instanceof xn&&this.view_linkers.add(e):e instanceof o.wP?this.view_nodes.delete(e):e instanceof xn&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof o.wP?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof xn&&(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===a.tX.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===a.tX.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.x+n.width>r.x+r.width)&&(e=t)}return e}if(e===a.tX.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y+n.height>r.y+r.height)&&(e=t)}return e}if(e===a.tX.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y<r.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let r=e,i=1/0;if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}return r}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();this.perf&&this.check_show_line()}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(),this.check_show_line())}check_show_line(){if(this.perf){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}}check_show_node(){if(this.perf)for(let e of Object.values(this.nodes))e.check_show()}layout_throttle=N.Notice.throttle(this.layout.bind(this),70);check_show_throttle=N.Notice.throttle(this.check_show.bind(this),100);check_show_line_throttle=N.Notice.throttle(this.check_show_line.bind(this),100);check_show_node_throttle=N.Notice.throttle(this.check_show_node.bind(this),100);async build_child(e){const{nodes:t,linkers:n}=e.info,r=g.I.build_cubes(t,this);for(let e of r)this.nodes[e.id]=e,this.view_nodes=(0,l.Gc)(new Set(r));await this.wait_nodes_render(r),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 r=new xn(e,this);this.linkers[r.id]=r,this.perf||this.view_linkers.add(r)}}update_data(e){return{usable:!0,data:e}}export(){const e=wn.get_default();e.id=this.id,e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs));const t=[],n=[];e.info={nodes:t,linkers:n,node_from:structuredClone((0,l.ux)(this.node_from)),node_to:structuredClone((0,l.ux)(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:r,history:i}=this,s=r.get_recorder();s.add_cmd(e);const a=g.I.build_cubes(t,this);this.pick(...a);const l=t.map(e=>e.id);return s.add_recover(o.yc.node_remove(this.id,l)),Promise.resolve().then(async()=>{const e=this.find_layout_root(a);for(let t of e)t.layout_throttle();this.config.data.map_perf&&this.check_show_line_throttle()}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=new Set;for(let e of t){const t=this.get_node(e);if(!t)continue;a.push(t.export());const n=t.env.layout_root;n&&n!==t&&l.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,o.yc.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,o.yc.linker_remove(this.id,[n]))}this.remove_node(t)}s.add_recover(o.yc.node_add(this.id,a));for(let e of l)e.layout_throttle();return this.config.data.map_perf&&this.check_show_line_throttle(),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this,s=n.get_recorder();s.add_cmd(e);let a=Promise.resolve();const l=[],c=new Set,d=[];for(let e of t){const{index_to:t,index_from:n,linker:r}=e,i=new xn(r,this),s=i.from_node,o=i.to_node;if(!s||!o)continue;this.pick(i);let a=this.node_from[i.to_id],u=this.node_to[i.from_id];if(a?a.indexOf(i.from_id)<0&&a.splice(n,0,i.from_id):this.node_from[i.to_id]=[i.from_id],u?u.indexOf(i.to_id)<0&&u.splice(t,0,i.to_id):this.node_to[i.from_id]=[i.to_id],d.unshift(i.id),!o.env.is_captive){const{has_root:e,line:t}=Qt.U.find_line_to_layout_root(o);l.push(o.wait_layout_self()),t[1]&&c.add(t[1])}}const u=new Set;for(let e of c){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&u.add(t)}return s.add_recover(o.yc.linker_remove(this.id,d)),a.then(async()=>{await Promise.all(l);for(let e of u)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=[];for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=this.get_node(t.from_id);n&&l.push(n);const r=this.node_to[t.from_id],i=this.node_from[t.to_id];if(r&&i){const e=r.indexOf(t.to_id),n=i.indexOf(t.from_id);r.splice(e,1),i.splice(n,1),a.unshift({linker:t.export(),index_to:e,index_from:n})}this.remove_linker(t)}const c=this.find_layout_root(l);for(let e of c)e.layout_throttle();return this.config.data.map_perf&&this.check_show_line_throttle(),s.add_recover(o.yc.linker_add(this.id,a)),s}get_linker_id(e,t){return e+"-"+t}replace_id(e,t={}){return wn.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e)}translate(e,t){const n=Qt.c.multiply(this.matrix2d,Qt.c.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:r,map_scale_min:i}=this.config.data,s=this.matrix2d.a+t;if(s>r||s<i)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=Qt.c.multiply(this.matrix2d,Qt.c.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:r}=this.get_upstream_sum_scale();let{x:i,y:s}=e;return{x:(i-t.x)/n,y:(s-t.y)/r}}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:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+r*l+s,y:n*a+i*l+o}}untransform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-r*l)/t,y:(l-o-n*a)/i}}static get meta(){return{type:a.u0.submap,cubename:"子图",version:1,block:!0,show:!0}}static get_default(e=400,t=200){return{id:g.I.get_id(),type:a.u0.submap,info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{width:e,height:t}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info.nodes,n),g.I.replace_id(e,t.info.linkers,n),t}}yn([(0,k.H)(a.kU.node_add)],wn.prototype,"on_node_add",null),yn([(0,k.H)(a.kU.node_remove)],wn.prototype,"on_node_remove",null),yn([(0,k.H)(a.kU.linker_add)],wn.prototype,"on_linker_add",null),yn([(0,k.H)(a.kU.linker_remove)],wn.prototype,"on_linker_remove",null);class xn extends rn.M{_point_from={x:0,y:0};_point_to={x:0,y:0};_show=!1;pcube;sample=(0,l.Gc)([]);_path=(0,c.EW)(()=>this.layout_self());constructor(e,t){return super(e,t),this.pcube=t,this.setup(e,t)}_from_node=(0,c.EW)(()=>this.pcube.get_node(this.from_id));_to_node=(0,c.EW)(()=>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||a._A.point}get anchor_right(){return this.attrs.anchor_right||a._A.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 Pt}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){return{usable:!0,data:e}}get meta(){return xn.meta}get domain(){return"map"}get id(){return Qt.U.get_linker_id(this.from_id,this.to_id)}get path(){return this._path.value}replace_id(e,t={}){return xn.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,r=en.find(e,t);if(r){this._point_from=r.from,this._point_to=r.to;const e=Jt.draw({type:n,...r});return this.sample=Qt.U.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),r=this.pcube.get_node_from(t.id),i=n?.indexOf(t.id)||-1,s=r?.indexOf(e.id)||-1;return{linker:this.export(),index_from:s,index_to:i}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof wn||t instanceof Zt)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}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:r}=e,i=t.get_recorder();i.add_cmd(e);const s=structuredClone((0,l.ux)(this.data.attrs));Object.assign(this.attrs,r);const o=tn.update(this.id,s);return i.add_recover(o),i}get_link_right(){const e=this.from_node?.bound.get_bound_rect_point(N._RectPosition.right_mid),t=this.to_node?.bound.get_bound_rect_point(N._RectPosition.left_mid),n=this.attrs.type;return e&&t?"line"===n?Jt.line(e,t):"bezier2"===n?Jt.bezier2(e,t):Jt.line(e,t):""}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,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:a.u0.linker,block:!1,version:1,show:!1}}static get_default(e,t,n){const{map_linker_anchor_left:r,map_linker_anchor_right:i,map_linker_line:s,map_linker_stroke:o,map_linker_stroke_width:l}=nn.B.config;return{id:Qt.U.get_linker_id(e,t),type:a.u0.linker,info:{},attrs:{from:e,to:t,type:n||s,anchor_left:r,anchor_right:i,stroke:o,stroke_width:l},css:{}}}}function kn(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.Sd.update)],xn.prototype,"on_linker_update",null);class Sn extends o.MR{_app;_interaction;_has_layout=(0,l.KR)(!1);data;nodes_test=(0,l.Gc)({});nodes=(0,l.Gc)({});node_from=(0,l.Kh)({});node_to=(0,l.Kh)({});node_editing=(0,l.Gc)(new Set);linkers=(0,l.Gc)({});nodes_selected=(0,l.Gc)(new Set);line_delete_selected=(0,l.Gc)(new Set);view_nodes=(0,l.Gc)(new Set);view_linkers=(0,l.Gc)(new Set);_view_rect=(0,l.Kh)({x:0,y:0,width:0,height:0});placeholder=(0,l.Kh)({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e){super();const t=this.update_data(e).data;this.data=(0,l.Kh)(t),this.node_to=this.data.info.node_to||{},this.node_from=this.data.info.node_from||{},this._interaction=new sn.T(this),this.build_child(t),k.o.init_cmd_handler(this),A.K.add_map(this),this._app=ze(Zt,{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 Qt.c.get_dom_string(this.matrix2d)}get domain(){return"map"}get app(){return this._app}get component(){return Zt}get meta(){return Sn.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,r=Math.max(n.left,0),i=Math.min(n.right,t),s={x:r,y:Math.max(0,n.top)},o={x:i,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,u={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,u),u}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))N.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))N.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===a.tX.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===a.tX.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.x+n.width>r.x+r.width)&&(e=t)}return e}if(e===a.tX.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y+n.height>r.y+r.height)&&(e=t)}return e}if(e===a.tX.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y<r.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let r=e,i=1/0;if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}return r}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 Qt.U.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 o.wP?(this.nodes[t.id]=(0,l.IG)(t),this.view_nodes.add(t)):t instanceof xn&&(this.linkers[t.id]=(0,l.IG)(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 r=n.bound.rect;N.MathRect.check_intersection(e,r)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof o.wP?this.view_nodes.add(e):e instanceof xn&&this.view_linkers.add(e):e instanceof o.wP?this.view_nodes.delete(e):e instanceof xn&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof o.wP?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof xn&&(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 r;if(t&&n){const i=t.indexOf(e.to_id),s=n.indexOf(e.from_id);t.splice(i,1),n.splice(s,1),r={linker:e.export(),index_to:i,index_from:s}}return delete this.linkers[e.id],this.view_linkers.delete(e),e.gc(),r}async build_child(e){const{nodes:t,linkers:n}=e.info;console.time("🍋build-nodes");const r=g.I.build_cubes(t,this);console.timeEnd("🍋build-nodes");for(let e of r)this.nodes[e.id]=(0,l.IG)(e),this.view_nodes=(0,l.Gc)(new Set(r));for(let e of n){const{from:t,to:n}=e.attrs,r=this.get_node(e.attrs.from),i=this.get_node(e.attrs.to);if(!r||!i){const e=this.node_to[t],r=e.indexOf(n);e.splice(r,0);const i=this.node_from[n],s=i.indexOf(t);i.splice(s,1);continue}const s=new xn(e,this);this.linkers[s.id]=(0,l.IG)(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")}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"),this.perf&&this.check_show_line()}check_show(){this.perf&&(console.time("🍋动态显示检查"),this.check_show_node(),console.timeEnd("🍋动态显示检查"),(0,c.dY)(()=>this.check_show_line()))}check_show_line(){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}check_show_node(){if(this.perf)for(let e of Object.values(this.nodes))e.check_show()}layout_throttle=N.Notice.throttle(this.layout.bind(this),50);check_show_throttle=N.Notice.throttle(this.check_show.bind(this),50);check_show_line_throttle=N.Notice.throttle(this.check_show_line.bind(this),50);check_show_node_throttle=N.Notice.throttle(this.check_show_node.bind(this),50);gc(){}export(){const e=Sn.get_default();e.id=this.id,e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.attrs.matrix2d={...this.matrix2d};const t=[],n=[];e.info={nodes:t,linkers:n,node_from:(0,l.ux)(this.node_from),node_to:(0,l.ux)(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){return e.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}async render(e){this._dom=e,this.app.mount(e),console.time("🍋wait-svg & nodes"),await Promise.all([Vt.ps,Qt.U.wait_nodes_render([...this.view_nodes])]),console.timeEnd("🍋wait-svg & nodes"),await g.I.sleep(100),this.init_boundbox(),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:r,history:i}=this,s=r.get_recorder();s.add_cmd(e);const a=g.I.build_cubes(t,this);this.pick(...a);const l=t.map(e=>e.id);return s.add_recover(o.yc.node_remove(this.id,l)),Promise.resolve().then(async()=>{await Qt.U.wait_nodes_render(a);const e=this.find_layout_root(a);for(let t of e)t.layout_throttle()}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=[],c=new Set,d=[];for(let e of t){const t=this.get_node(e);if(t){l.push(t);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&d.push(t)}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&d.push(n)}}}for(let e of l){a.push(e.export());const t=e.env.layout_root;t&&t!==e&&c.add(e.env.layout_root),this.remove_node(e)}return s.tell(this,o.yc.linker_remove(this.id,d)),s.add_recover(o.yc.node_add(this.id,a)),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this,s=n.get_recorder();if(0===t.length)return;s.add_cmd(e);const a=[];let l=Promise.resolve();const c=[],d=new Set;for(let e of t){const{index_to:t,index_from:n,linker:r}=e,i=new xn(r,this),s=i.from_node,o=i.to_node;if(!s||!o)continue;this.pick(i);let l=this.node_from[i.to_id],u=this.node_to[i.from_id];if(l?l.indexOf(i.from_id)<0&&l.splice(n,0,i.from_id):this.node_from[i.to_id]=[i.from_id],u?u.indexOf(i.to_id)<0&&u.splice(t,0,i.to_id):this.node_to[i.from_id]=[i.to_id],a.unshift(i.id),!o.env.is_captive){const{has_root:e,line:t}=Qt.U.find_line_to_layout_root(o);c.push(o.wait_layout_self()),t[1]&&d.add(t[1])}}const u=new Set;for(let e of d){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&u.add(t)}return s.add_recover(o.yc.linker_remove(this.id,a)),l.then(async()=>{await Promise.all(c);for(let e of u)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=new Set,c=new Set;for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=t.from_node,r=t.to_node;n&&l.add(n),r&&c.add(r);const i=this.remove_linker(t);i&&a.unshift(i)}if(0===a.length)return;for(let e of l)e.env.flow(),e.bound.flow("upstream");const d=new Set;for(let e of c){if(e.is_layout_root)continue;const{has_root:t,line:n}=Qt.U.find_line_to_layout_root(e),r=n[1];t&&r?c.has(r)||d.add(r):e.env.clear()}for(let e of d)e.env.flow(),e.bound.flow("downstream"),e.bound.flow("upstream");const u=new Set;for(let e of[...l,...d]){const t=e.env?.layout_root;t&&u.add(t)}for(let e of u)e.layout_throttle();return s.add_recover(o.yc.linker_add(this.id,a)),s}on_update_attrs(e){const{courier:t,history:n}=this,{data:r}=e,i=t.get_recorder();return i.add_cmd(e),"matrix2d"in r&&r.matrix2d&&(i.add_recover(o.yc.update_attr(this.id,{matrix2d:{...this.matrix2d}})),this.reset_matrix(r.matrix2d)),i}get_linker_id(e,t){return Qt.U.get_linker_id(e,t)}replace_id(e,t={}){return Sn.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=Qt.c.multiply(this.matrix2d,Qt.c.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:r,map_scale_min:i}=this.config.data,s=this.matrix2d.a+t;if(s>r||s<i)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,u=Qt.c.multiply(this.matrix2d,Qt.c.get_matrix_translate(c,d));this.reset_matrix(u)}get_upstream_sum_scale(){return{sx:1,sy:1}}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:r}=this.get_upstream_sum_scale();let{x:i,y:s}=e;return{x:(i-t.x)/n,y:(s-t.y)/r}}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:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+r*l+s,y:n*a+i*l+o}}untransform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-r*l)/t,y:(l-o-n*a)/i}}static get meta(){return{type:a.u0.map,cubename:"图形笔记",version:1,block:!0,show:!1}}static get_default(){return{id:g.I.get_id(),type:a.u0.map,versions:A.K.export_versions(),info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{matrix2d:Qt.c.get_default()}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info.nodes,n),g.I.replace_id(e,t.info.linkers,n),t}}kn([(0,k.H)(a.kU.node_add)],Sn.prototype,"on_node_add",null),kn([(0,k.H)(a.kU.node_remove)],Sn.prototype,"on_node_remove",null),kn([(0,k.H)(a.kU.linker_add)],Sn.prototype,"on_linker_add",null),kn([(0,k.H)(a.kU.linker_remove)],Sn.prototype,"on_linker_remove",null),kn([(0,k.H)(a.kU.update_attrs)],Sn.prototype,"on_update_attrs",null);class Cn{_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,r=this._nodes[n];r&&e.isConnected&&r.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 Mn=new Cn,Tn=["id","data-type","transform","data-editing"],Ln=["d"],zn=["x","y","width","height"],An=["data-id"],Pn={class:"node-status"},Rn=(0,c.pM)({__name:"cube-node",props:{cube:{}},setup(e){const{bound:t,shape:n}=e.cube,r=(0,l.KR)(),{map_node_padding:i}=e.cube.config.data;(0,c.sV)(()=>{const t=r.value;t&&Mn.register(t,e.cube)}),(0,c.xo)(()=>{const e=r.value;e&&Mn.unregister(e)});const s=(0,c.EW)(()=>({"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 u(t,n){e.cube.event.emit_node_status_click(t,{node:e.cube,click:n})}function h(t=!0){const{courier:n,history:r}=e.cube,i=n.get_recorder(),s=o.Sv.layout_change(e.cube.id,{fold:t});i.tell(e.cube,s),r.record(i)}return(e,i)=>((0,c.uX)(),(0,c.CE)("g",{id:e.cube.id,"data-type":(0,l.R1)(a.u0).node,class:(0,d.C4)(["cube-node",s.value]),transform:e.cube.matrix2d_dom_string,"data-editing":e.cube.editable},[(0,c.Lk)("path",{d:(0,l.R1)(n).path,ref:"p",style:(0,d.Tr)({fill:e.cube.attrs.fill})},null,12,Ln),((0,c.uX)(),(0,c.CE)("foreignObject",{x:(0,l.R1)(t).pos_cbox.x,y:(0,l.R1)(t).pos_cbox.y,width:(0,l.R1)(t).size.width,height:(0,l.R1)(t).size.height,style:(0,d.Tr)(e.cube.css)},[(0,c.Lk)("div",{class:"cube-node-box",ref_key:"box",ref:r,"data-id":e.cube.id},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128)),(0,c.Q3)(" node statusbar "),(0,c.Lk)("div",Pn,[e.cube.is_layout_root?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"iconfont icon-system-mind-map-filled",onClick:i[0]||(i[0]=e=>u(e,"root"))})):(0,c.Q3)("v-if",!0),e.cube.attrs.layout?((0,c.uX)(),(0,c.CE)("div",{key:1,class:(0,d.C4)(e.cube.icons[e.cube.attrs.layout]),onClick:i[1]||(i[1]=e=>u(e,"layout"))},null,2)):(0,c.Q3)("v-if",!0),e.cube.env.upstream&&e.cube.env.downstream.length>0?((0,c.uX)(),(0,c.CE)(c.FK,{key:2},[e.cube.attrs.fold?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"status-fold",onClick:i[2]||(i[2]=e=>h(!1))},(0,d.v_)(e.cube.env.downstream_nodes.length),1)):((0,c.uX)(),(0,c.CE)("div",{key:1,class:"iconfont icon-minus2",onClick:i[3]||(i[3]=e=>h(!0))}))],64)):(0,c.Q3)("v-if",!0)])],8,An)],12,zn))],10,Tn))}}),Nn=(0,f.A)(Rn,[["__scopeId","data-v-138cbca0"]]);class En extends o.wP{constructor(e,t){return super(e,t),this.setup(e,t)}get domain(){return"map"}get meta(){return En.meta}get component(){return Nn}build_child(e){this._children.push(...g.I.build_cubes(e.info,this))}update_data(e){return e.attrs.matrix&&(e.attrs.matrix2d=e.attrs.matrix,delete e.attrs.matrix),{usable:!0,data:e}}gc(){this.base_gc()}export(){const e=this.base_export();e.info=[],e.attrs=structuredClone((0,l.ux)(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 En.replace_id(this.root,e,t)}static get meta(){return{cubename:"图形节点",type:a.u0.node,block:!0,version:1,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info,n),t}static get_default(e,t="rect"){return{id:g.I.get_id(),type:a.u0.node,info:[pt.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:{}}}a(e=!0,t="left",n=!1){const{courier:r}=this,i=r.get_recorder(),s=o.Sv.layout_change(this.id,{root:e,layout:t,fold:n});i.tell(this,s),this.history.record(i),this.env.layout_root?.layout()}}class On{_node;_size=(0,l.Kh)(o.wP.get_default_node_size());_size_bound=(0,l.Kh)(o.wP.get_default_node_size());_size_tree=(0,l.Kh)(o.wP.get_default_node_size());_pos_cbox=(0,l.Kh)({x:nn.B.default_config.map_node_padding,y:nn.B.default_config.map_node_padding});_pos;_pos_tree;_layout_pos_tree;constructor(e,t){this._node=e,this._pos=(0,l.Kh)({x:t.e,y:t.f}),this._pos_tree=(0,l.Kh)({x:t.e,y:t.f}),this._layout_pos_tree=(0,l.Kh)({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 r=0,i=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,u={x:0,y:0,width:0,height:0},h={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,e.width>=r&&(r=e.width,u=n),e.height>=i&&(i=e.height,h=n),n.width>=c&&(c=n.width,l=n),n.height>=d&&(d=n.height,a=n)}return{max_tree_height:i,max_tree_width:r,sum_tree_height:s+(e.length-1)*n,sum_tree_width:o+(e.length-1)*t,max_height_node:a,max_width_node:l,mw_rect:u,mh_rect:h}}update_pos_cbox(){const e=this.node.attrs.shape,{width:t,height:n}=this.size_bound,{map_node_padding:r}=this.node.config.data,i=t/2,s=n/2;"circle"===e?(this._pos_cbox.x=i-this.size.width/2,this._pos_cbox.y=s-this.size.height/2):(this._pos_cbox.x=r,this._pos_cbox.y=r)}update_pos(){const e=this.size_tree,t=this.size_bound,n=this.pos_tree,r=this.node.env.layout_type,i=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=i,this._pos.y=s;else if(this.env.folded_self)this._pos.x=n.x,this._pos.y=n.y;else if("right"===r)this._pos.x=n.x,this._pos.y=n.y-t.height/2+e.height/2;else if("left"===r)this._pos.x=n.x+e.width-t.width,this._pos.y=n.y+e.height/2-t.height/2;else if("down"===r)this._pos.x=n.x+e.width/2-t.width/2,this._pos.y=n.y;else if("up"===r)this._pos.x=n.x+e.width/2-t.width/2,this._pos.y=n.y+e.height-t.height;else if("time-right"===r){const{sum_tree_height:e,sum_tree_width:r,max_tree_height:i,max_tree_width:s,mw_rect:a,mh_rect:l}=this.stat_downstream_nodes_size(o),c=Math.max(l.height,t.height)/2;this._pos.x=n.x,this._pos.y=n.y+c-t.height/2}else if("time-down"===r){const{sum_tree_height:e,sum_tree_width:r,max_tree_height:i,max_tree_width:s,mw_rect:a,mh_rect: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,r=this.matrix2d.e,i=this.matrix2d.f;if(t){if(this.node.attrs.fold)this._layout_pos_tree.x=r,this._layout_pos_tree.y=i;else if("right"===t)this._layout_pos_tree.x=r,this._layout_pos_tree.y=i+n.height/2-e.height/2;else if("left"===t)this._layout_pos_tree.x=r+n.width-e.width,this._layout_pos_tree.y=i+n.height/2-e.height/2;else if("down"===t)this._layout_pos_tree.x=r+n.width/2-e.width/2,this._layout_pos_tree.y=i;else if("up"===t)this._layout_pos_tree.x=r+n.width/2-e.width/2,this._layout_pos_tree.y=i+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,mw_rect:c,mh_rect:d,max_height_node:u,max_width_node:h}=this.stat_downstream_nodes_size(e);this._layout_pos_tree.x=r,this._layout_pos_tree.y=i-Math.max(t,u.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,mw_rect:c,mh_rect:d,max_height_node:u,max_width_node:h}=this.stat_downstream_nodes_size(e);this._layout_pos_tree.x=r+t-Math.max(h.width/2,t),this._layout_pos_tree.y=i}}else this._layout_pos_tree.x=r,this._layout_pos_tree.y=i}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}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);else{const n=this._node.env.layout_type,{map_node_hgap:r,map_node_vgap:i}=this.config.data,s=this.size_bound;if("downstream"===e)for(let e of t)e.bound.flow();const{sum_tree_height:o,sum_tree_width:a,max_tree_height:l,max_tree_width:c,mw_rect:d,mh_rect:u,max_height_node:h,max_width_node:p}=this.stat_downstream_nodes_size(t);if("left"===n)this._size_tree.width=s.width+r+c,this._size_tree.height=Math.max(s.height,o);else if("right"===n)this._size_tree.width=s.width+r+c,this._size_tree.height=Math.max(s.height,o);else if("down"===n)this._size_tree.width=Math.max(s.width,a),this._size_tree.height=s.height+i+l;else if("up"===n)this._size_tree.width=Math.max(s.width,a),this._size_tree.height=s.height+i+l;else if("time-right"===n){const e=u.height/2,t=h.height/2,n=s.height/2;this._size_tree.width=s.width+r+a,this._size_tree.height=Math.max(n,t)+Math.max(l-e,n,t)}else if("time-down"===n){const e=s.width/2,t=d.width/2,n=p.width/2;this._size_tree.width=Math.max(e,n)+Math.max(e,c-t),this._size_tree.height=s.height+i+o}else Object.assign(this._size_tree,s)}if("upstream"===e){const t=this.env.upstream;t&&!t?.is_layout_root&&this.env.upstream?.bound.flow(e)}}get_bound_rect_point(e){const t={...this.pos,...this.size_bound};return N.MathRect.get_rect_point(t,e)}}class In{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:r,height:i}=e.bound.size,s=r+2*t,o=r+2*t,a=i+2*t,l=i+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,r=Math.sqrt(t*t+n*n)/2;return`M${r} 0 A ${r} ${r} 0 1 0 ${r} ${2*r}A${r} ${r} 0 1 0 ${r} 0`}}class Bn{static reset(e,t,n){return{id:e,name:a.tK.reset,args:t,funcs:n}}}let Dn="";function Vn(e,t){if(Dn===t.funcname.text)return;Dn=t.funcname.text;const{funcname:n,args:r,funcs:i,courier:s,history:o}=t,a=new _.vk(s),l=new Set,c=new Set;for(let e of n.children){if(!(e instanceof gt))continue;const t=e.text.trim();if(!t||""===t)continue;const n=Hn(t);for(let e of n.args)l.add(e);c.add(n.name)}const d=[],u=[],h=[...l],p=[...c];if(h.length===r.length)for(let e=0;e<r.length;e++)d.push({name:h[e],desc:r[e].desc.export()});else for(let e of h){const t=r.find(t=>t.name===e);if(t)d.push({name:e,desc:t.desc.export()});else{const t=gt.get_default(),n=gt.get_default();d.push({name:e,desc:xt.get_default([t,n])})}}if(p.length===i.length)for(let e=0;e<i.length;e++)u.push({name:p[e],desc:i[e].desc.export()});else for(let e of p){const t=i.find(t=>t.name===e);if(t)u.push({name:e,desc:t.desc.export()});else{const t=gt.get_default(),n=gt.get_default();u.push({name:e,desc:xt.get_default([t,n])})}}a.tell(t,Bn.reset(t.id,d,u)),o.record(a)}function Hn(e){const t=e.replace("...",""),n=t.indexOf("("),r=t.indexOf(")"),i=t.indexOf("."),s={name:"",args:[]};if(s.name=i<0&&n>0?t.slice(0,n):i>0&&n>0?t.slice(i+1,n):t.slice(i+1),n<0||r<0)return s.name=t,s;const o=t.slice(n+1,r);for(let e of o.split(",")){let t=e.trim();t&&s.args.push(t)}return s}const jn=["id","data-type"],Fn={class:"cube-api-content"},Un={class:"api-description"},qn={class:"arg-name"},$n={class:"func-name"},Gn=(0,c.pM)({__name:"cube-api",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-api",id:e.cube.id,"data-type":(0,l.R1)(a.u0).api,style:(0,d.Tr)(e.cube.css),ref:"root"},[(0,c.Lk)("div",Fn,[(0,c.Lk)("div",{class:"header",onKeyup:t[0]||(t[0]=t=>(0,l.R1)(Vn)(t,e.cube))},[(0,c.bF)(S,{cube:e.cube.funcname},null,8,["cube"])],32),(0,c.Lk)("div",Un,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.args,e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e.desc.id},[(0,c.Lk)("div",qn,(0,d.v_)(e.name),1),(0,c.bF)(S,{class:"arg-desc",cube:e.desc},null,8,["cube"]),(0,c.Q3)(' <component class=\'arg-desc\' :is="item.component" :cube="item" :id="item.id"></component> ')],64))),128)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.funcs,e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e.desc.id},[(0,c.Lk)("div",$n,(0,d.v_)(e.name),1),(0,c.bF)(S,{class:"func-desc",cube:e.desc},null,8,["cube"]),(0,c.Q3)(' <component class=\'func-desc\' :is="item.component" :cube="item" :id="item.id"></component> ')],64))),128))])])],12,jn))}),Xn=(0,f.A)(Gn,[["__scopeId","data-v-4fff7da0"]]);class Kn extends o._D{_component=Xn;funcname;args=(0,l.Gc)([]);funcs=(0,l.Gc)([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return this._component}get children(){const e=this.args.map(e=>e.desc),t=this.funcs.map(e=>e.desc);return[this.funcname,...e,...t]}get meta(){return Kn.meta}get is_empty(){return 1===this.funcname.child_count&&this.funcname.child_first.is_empty}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return Kn.replace_id(this.root,e,t)}build_child(e){this.funcname=new xt(e.info.names,this),this.build_desc(this.info.args,this.info.funcs)}gc(){super.base_gc()}export(){const e=this.base_export();return e.info.names=this.funcname.export(),e.info.args=this.get_args_data(),e.info.funcs=this.get_funcs_data(),e}build_desc(e,t){for(let e of this.args)e.desc.gc();for(let e of this.funcs)e.desc.gc();this.args.length=0,this.funcs.length=0;for(let t of e){const e={name:t.name,desc:new xt(t.desc,this)};this.args.push(e)}for(let e of t){const t={name:e.name,desc:new xt(e.desc,this)};this.funcs.push(t)}}get_args_data(){const e=[];for(let t of this.args){const n={name:t.name,desc:t.desc.export()};e.push(n)}return e}get_funcs_data(){const e=[];for(let t of this.funcs){const n={name:t.name,desc:t.desc.export()};e.push(n)}return e}reset_api(e){const{courier:t,history:n}=this,{args:r,funcs:i}=e,s=t.get_recorder();s.add_cmd(e);const o=structuredClone(this.get_args_data()),a=structuredClone(this.get_funcs_data());return this.build_desc(r,i),s.add_recover(Bn.reset(this.id,o,a)),s}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}static get meta(){return{type:a.u0.api,version:1,cubename:"Api",block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=[];for(let t of e)r.push(gt.get_default_by_string(t));return{id:(0,s.Ak)(),type:a.u0.api,info:{names:xt.get_default(r),args:[],funcs:[]},css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i,t.info.names=xt.replace_id(e,t.info.names,n);for(let r of t.info.args)r.desc=xt.replace_id(e,r.desc,n);for(let r of t.info.funcs)r.desc=xt.replace_id(e,r.desc,n);return t}}function Wn(e,t="tail"){const{courier:n,history:r}=e,i=new _.vk(n),s=[xt.get_default(),xt.get_default()],o=Yn.insert_row(e.id,t,[s]);i.tell(e,o),r.record(i)}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.tK.reset)],Kn.prototype,"reset_api",null);class Yn{static insert_row(e,t,n){return{id:e,name:a.J8.insert_row,pos:t,rows:n}}static remove_row(e,t,n=!1){return{id:e,name:a.J8.remove_row,range:t,reserve:n}}static change_width_col1(e,t){return{id:e,width:t,name:a.J8.change_width_col1}}}const Zn=["id","data-type"],Qn=(0,c.pM)({__name:"cube-detail-list",props:{cube:{}},setup(e){const t=e.cube.root,n=(0,c.rk)("root"),r=(0,l.KR)();(0,c.sV)(()=>{const i=r.value,s=n.value;if(!i)return;const o=new N.DragDiff(i);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,r)=>{if(t.stats.is_read_mode)return;if(a===l)return;const i=e.cube.courier.get_recorder(),s=Math.round(n+a);i.tell(e.cube,Yn.change_width_col1(e.cube.id,s)),e.cube.history.record(i)}),o.register_cancel(()=>{e.cube.attrs.width=a,i.style.left=a-2+"px"})});const i=(0,c.EW)(()=>({...e.cube.css,"--width-col1":e.cube.attrs.width_col1+"px"}));return(t,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-detail-list",id:t.cube.id,"data-type":(0,l.R1)(a.u0).detail_list,ref_key:"root",ref:n,style:(0,d.Tr)(i.value),onContextmenu:s[1]||(s[1]=e=>(0,l.R1)(at.uz)(e,t.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.children,t=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t,onKeydown:n=>function(t,n){t.ctrlKey&&!t.shiftKey&&"Enter"===t.key?(t.stopPropagation(),Wn(e.cube,Math.floor(n.index/2)+1)):t.ctrlKey&&t.shiftKey&&"Enter"===t.key&&(t.stopPropagation(),Wn(e.cube,Math.floor(n.index/2)))}(n,t)},null,8,["cube","onKeydown"]))),128)),(0,c.Lk)("div",{class:"adder-wrap",onClick:s[0]||(s[0]=()=>(0,l.R1)(Wn)(t.cube))},[...s[2]||(s[2]=[(0,c.Lk)("div",{class:"adder"},null,-1)])]),(0,c.Lk)("div",{class:"adjuster",ref_key:"adjuster",ref:r},null,512)],44,Zn))}}),Jn=(0,f.A)(Qn,[["__scopeId","data-v-6b68d605"]]),er=[function(e,t){return t>=2||e.attrs.width_col1||(e.attrs.width_col1=150),e}];function tr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class nr extends o._D{rows;_component=Jn;constructor(e,t){return super(e,t),this.rows=(0,l.Gc)([]),this.setup(e,t)}get component(){return this._component}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 nr.meta}update_data(e){return function(e,t){const n=t[nr.meta.type];return n>nr.meta.version?{data:e,usable:!1}:{data:er.reduce((e,t)=>t(e,n),e),usable:!0}}(e,this.root.versions)}build_child(e){for(let t of e.info){const e=new xt(t[0],this),n=new xt(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),r=Math.floor((t-1)/2),i=nr.get_default();i.info=[];for(let e=n;e<=r;e++){const t=this.rows[e];if(!t)continue;const n=[t[0].export(),t[1].export()];i.info.push(n)}return 0===i.info.length?[]:[i]}gc(){super.base_gc()}export(){const e=this.base_export();e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.info=[];for(let[t,n]of this.rows){const r=t.export(),i=n.export();e.info.push([r,i])}return e}replace_id(e,t={}){return nr.replace_id(this.root,e,t)}splice_rows(e,t,...n){const r=this.rows.splice(e,t,...n);for(let[e,t]of r)e.gc(),t.gc();return r}check_delete_edge(e){return 0==e.index%2&&!!e.is_empty}insert_row(e){const{courier:t}=this,{pos:n,rows:r}=e,i=t.get_recorder();i.add_cmd(e);const s=[];for(let[e,t]of r)s.push([new xt(e,this),new xt(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)),i.add_recover(Yn.remove_row(this.id,o)),i}remove_row(e){const{courier:t,cursor:n}=this,{range:r,reserve:i}=e,s=new _.vk(t);let[a,l]=r;if(a<0&&(a=0),l>this.row_count&&(l=this.row_count),0===a&&l>=this.row_count)if(i){if(this.is_empty)return;s.tell(this,Yn.remove_row(this.id,[1,this.child_count]));const e=this.child_first,t=e.next_cube;t&&s.tell(t,o.VL.delete_child(t.id,"backward",[0,t.child_count],!0)),e&&s.tell(e,o.VL.delete_child(e.id,"backward",[0,e.child_count],!0))}else s.merge(this.remove_self());else{const e=this.rows[a-1]?.[1],t=this.rows[l+1]?.[1],n=this.splice_rows(a,l-a),r=[];for(let[e,t]of n)r.push([e.export(),t.export()]);s.add_recover(Yn.insert_row(this.id,a,r)),e?s.tell(e,o.UB.in_tail(e.id,0,void 0)):t&&s.tell(t,o.UB.in_head(t.id,0,void 0))}return s}change_width_col1(e){const{width:t}=e,{courier:n,id:r}=this,i=n.get_recorder();i.add_cmd(e);const s=this.attrs.width_col1;return this.attrs.width_col1=t,this.dom?.style.setProperty("--width-col1",t+"px"),i.add_recover(Yn.change_width_col1(r,s)),i}delete_cube(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o,reserve:a}=e,[l,c]=o,d=Math.floor(l/2),u=Math.floor((c-1)/2),h=(this.children[l],Yn.remove_row(this.id,[d,u+1],a));return this.remove_row(h)}static get meta(){return{type:x.u0.detail_list,version:2,cubename:"清单",block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=0===e.length?[[xt.get_default(),xt.get_default()]]:e;return{id:(0,s.Ak)(),type:x.u0.detail_list,info:r,css:t,attrs:{width_col1:150}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info)s.push([xt.replace_id(e,r[0],n),xt.replace_id(e,r[1],n)]);return t.info=s,t}}tr([(0,k.H)(a.J8.insert_row)],nr.prototype,"insert_row",null),tr([(0,k.H)(a.J8.remove_row)],nr.prototype,"remove_row",null),tr([(0,k.H)(a.J8.change_width_col1)],nr.prototype,"change_width_col1",null),tr([(0,k.H)(a.zS.cube_delete_child)],nr.prototype,"delete_cube",null);class rr{static add(e,t,n){return{id:e,name:a.Ny.add,data:t,pos:n}}static remove(e,t){return{id:e,name:a.Ny.remove,range:t}}static indent(e,t){return{id:e,name:a.Ny.indent,items:t}}static status(e,t,n){return{id:e,name:a.Ny.status,index:t,done:n}}}const ir=["id","data-type"],sr=["onClick"],or=(0,c.pM)({__name:"cube-todo",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:n}=t;return(t,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-todo",id:t.cube.id,style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).todo,onContextmenu:r[0]||(r[0]=e=>(0,l.R1)(at.uz)(e,t.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.items,(r,i)=>((0,c.uX)(),(0,c.CE)("div",{key:r.data.id,class:"todoitem",style:(0,d.Tr)({"margin-left":r.indent*(0,l.R1)(n).data.line_indent+"px"})},[(0,c.Lk)("div",{class:(0,d.C4)(["todoitem-status",{active:r.done}]),onClick:()=>function(t,n){const r=rr.status(e.cube.id,n,!t.done),i=e.cube.courier.get_recorder();i.tell(e.cube,r),e.cube.history.record(i)}(r,i)},null,10,sr),(0,c.bF)(S,{class:"todoitem-box",cube:r.data,onKeydown:e=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{indent:a}=n,l=n.data;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(a);n.tell(t,rr.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(a);n.tell(t,rr.add(t.id,[o],r)),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:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,rr.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!1}];a.tell(t,rr.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,rr.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!0}];a.tell(t,rr.indent(t.id,e)),s.record(a)}}}(e,t.cube,r,i)},null,8,["cube","onKeydown"])],4))),128))],44,ir))}}),ar=(0,f.A)(or,[["__scopeId","data-v-33222767"]]);function lr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class cr extends o._D{_component=ar;items=(0,l.Kh)([]);get component(){return this._component}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return cr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new xt(t.data,this),n={done:t.done,indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=this.base_export();e.info=[];for(let t of this.items)e.info.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 r=this.items.slice(e,t);for(let e of r)n.info.push({done:e.done,indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({done:e.done,indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return cr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new xt(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:xt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new xt(e.data,this);let n={done:e.done,indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(rr.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(s<=0&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(rr.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_todoitem(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];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),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(rr.indent(this.id,i)),r}update_status(e){const{courier:t}=this,{index:n,done:r}=e,i=t.get_recorder();i.add_cmd(e);const s=this.items[n];if(s)return s.done=r,i.add_recover(rr.status(this.id,n,!r)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=rr.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=xt.get_default();return{id:(0,s.Ak)(),type:a.u0.todo,info:[{done:!1,indent:0,data:e}],attrs:{},css:{}}}static get_todo_item(e,t=!1){const n=g.I.pick(e).sort;return{done:t,indent:0,data:xt.get_default(n)}}static get meta(){return{cubename:"待办列表",type:a.u0.todo,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=xt.replace_id(e,r.data,n);return t}}lr([(0,k.H)(a.Ny.add)],cr.prototype,"add_item",null),lr([(0,k.H)(a.Ny.remove)],cr.prototype,"remove_item",null),lr([(0,k.H)(a.Ny.indent)],cr.prototype,"indent_todoitem",null),lr([(0,k.H)(a.Ny.status)],cr.prototype,"update_status",null),lr([(0,k.H)(a.zS.cube_delete_child)],cr.prototype,"on_delete_child",null);var dr=n(3803);const ur=["id","data-type"],hr=(0,c.pM)({__name:"cube-list",props:{cube:{}},setup(e){const{config:t}=e.cube;return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-list",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).list,onContextmenu:n[0]||(n[0]=t=>(0,l.R1)(at.uz)(t,e.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.items,(r,i)=>((0,c.uX)(),(0,c.CE)("div",{key:r.data.id,class:"listitem",style:(0,d.Tr)({"margin-left":r.indent*(0,l.R1)(t).data.line_indent+"px"})},[n[1]||(n[1]=(0,c.Lk)("div",{class:"listitem-symbol"},null,-1)),(0,c.bF)(S,{class:"listitem-box",cube:r.data,onKeydown:t=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,dr.o.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,dr.o.add(t.id,[o],r)),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:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,dr.o.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,dr.o.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,dr.o.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,dr.o.indent(t.id,e)),s.record(a)}}}(t,e.cube,r,i)},null,8,["cube","onKeydown"])],4))),128))],44,ur))}}),pr=(0,f.A)(hr,[["__scopeId","data-v-4c4b9f9c"]]);function fr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class mr extends o._D{_component=pr;items=(0,l.Kh)([]);get component(){return this._component}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return mr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new xt(t.data,this),n={indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=this.base_export();e.info=[];for(let t of this.items)e.info.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 r=this.items.slice(e,t);for(let e of r)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return mr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new xt(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:xt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new xt(e.data,this);let n={indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(dr.o.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(0===s&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(dr.o.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_item(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];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),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(dr.o.indent(this.id,i)),r}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=dr.o.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=xt.get_default();return{id:(0,s.Ak)(),type:a.u0.list,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:xt.get_default(g.I.pick(e).sort)}}static get meta(){return{cubename:"列表",type:a.u0.list,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=xt.replace_id(e,r.data,n);return t}}fr([(0,k.H)(a.JC.add)],mr.prototype,"add_item",null),fr([(0,k.H)(a.JC.remove)],mr.prototype,"remove_item",null),fr([(0,k.H)(a.JC.indent)],mr.prototype,"indent_item",null),fr([(0,k.H)(a.zS.cube_delete_child)],mr.prototype,"on_delete_child",null);class _r{static add(e,t,n){return{id:e,name:a.mM.add,data:t,pos:n}}static remove(e,t){return{id:e,name:a.mM.remove,range:t}}static indent(e,t){return{id:e,name:a.mM.indent,items:t}}}const gr=["id","data-type"],br={class:"listitem-symbol"},vr=(0,c.pM)({__name:"cube-list-ordered",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:n}=t;return(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-list-ordered",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).list_ordered,onContextmenu:t[0]||(t[0]=t=>(0,l.R1)(at.uz)(t,e.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.items,(t,r)=>((0,c.uX)(),(0,c.CE)("div",{key:t.data.id,class:"listitem",style:(0,d.Tr)({"margin-left":t.indent*(0,l.R1)(n).data.line_indent+"px"})},[(0,c.Lk)("div",br,(0,d.v_)(r+1),1),(0,c.bF)(S,{class:"listitem-box",cube:t.data,onKeydown:n=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,_r.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,_r.add(t.id,[o],r)),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:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,_r.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,_r.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,_r.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,_r.indent(t.id,e)),s.record(a)}}}(n,e.cube,t,r)},null,8,["cube","onKeydown"])],4))),128))],44,gr))}}),yr=(0,f.A)(vr,[["__scopeId","data-v-743fd90a"]]);function wr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class xr extends o._D{items=(0,l.Kh)([]);get component(){return yr}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return xr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new xt(t.data,this),n={indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}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}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const r=this.items.slice(e,t);for(let e of r)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return xr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new xt(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:xt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new xt(e.data,this);let n={indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(_r.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(0===s&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(_r.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_item(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];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),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(_r.indent(this.id,i)),r}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=_r.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=xt.get_default();return{id:g.I.get_id(),type:a.u0.list_ordered,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:xt.get_default(g.I.pick(e).sort)}}static get meta(){return{cubename:"有序列表",type:a.u0.list_ordered,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=xt.replace_id(e,r.data,n);return t}}wr([(0,k.H)(a.mM.add)],xr.prototype,"add_item",null),wr([(0,k.H)(a.mM.remove)],xr.prototype,"remove_item",null),wr([(0,k.H)(a.mM.indent)],xr.prototype,"indent_item",null),wr([(0,k.H)(a.zS.cube_delete_child)],xr.prototype,"on_delete_child",null);class kr{static update(e,t,n){return{id:e,name:a.GW.code_update,code:n,tabid:t}}static add(e,t,n=!0){return{id:e,name:a.GW.code_add,item:(0,l.ux)(t),focus:n}}static remove(e,t){return{id:e,name:a.GW.code_remove,tabid:t}}static rename(e,t,n){return{id:e,name:a.GW.code_rename,tabid:t,filename:n}}static change_lang(e,t,n){return{id:e,name:a.GW.change_lang,tabid:t,lang:n}}static change_active(e,t){return{id:e,name:a.GW.change_active,tabid:t}}static change_theme(e,t,n){return{id:e,tabid:t,theme:n,name:a.GW.change_theme}}}const Sr=[{id:"abap",name:"ABAP",import:()=>n.e(8617).then(n.bind(n,8617))},{id:"actionscript-3",name:"ActionScript",import:()=>n.e(3516).then(n.bind(n,3516))},{id:"ada",name:"Ada",import:()=>n.e(7561).then(n.bind(n,7561))},{id:"angular-html",name:"Angular HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(535)]).then(n.bind(n,535))},{id:"angular-ts",name:"Angular TypeScript",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7611),n.e(535),n.e(4886)]).then(n.bind(n,4886))},{id:"apache",name:"Apache Conf",import:()=>n.e(7625).then(n.bind(n,7625))},{id:"apex",name:"Apex",import:()=>n.e(9819).then(n.bind(n,9819))},{id:"apl",name:"APL",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(7504)]).then(n.bind(n,7504))},{id:"applescript",name:"AppleScript",import:()=>n.e(2108).then(n.bind(n,2108))},{id:"ara",name:"Ara",import:()=>n.e(5611).then(n.bind(n,5611))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>n.e(4354).then(n.bind(n,4354))},{id:"asm",name:"Assembly",import:()=>n.e(6324).then(n.bind(n,6324))},{id:"astro",name:"Astro",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4714),n.e(6940),n.e(4408)]).then(n.bind(n,4408))},{id:"awk",name:"AWK",import:()=>n.e(4862).then(n.bind(n,4862))},{id:"ballerina",name:"Ballerina",import:()=>n.e(5141).then(n.bind(n,5141))},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>n.e(2068).then(n.bind(n,2068))},{id:"beancount",name:"Beancount",import:()=>n.e(5026).then(n.bind(n,5026))},{id:"berry",name:"Berry",aliases:["be"],import:()=>n.e(8753).then(n.bind(n,8753))},{id:"bibtex",name:"BibTeX",import:()=>n.e(4009).then(n.bind(n,4009))},{id:"bicep",name:"Bicep",import:()=>n.e(7688).then(n.bind(n,7688))},{id:"blade",name:"Blade",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(5283)]).then(n.bind(n,5283))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>n.e(5314).then(n.bind(n,5314))},{id:"c",name:"C",import:()=>n.e(5814).then(n.bind(n,5814))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>n.e(5728).then(n.bind(n,5728))},{id:"cairo",name:"Cairo",import:()=>Promise.all([n.e(2473),n.e(8237)]).then(n.bind(n,8237))},{id:"clarity",name:"Clarity",import:()=>n.e(6677).then(n.bind(n,6677))},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>n.e(7681).then(n.bind(n,7681))},{id:"cmake",name:"CMake",import:()=>n.e(5936).then(n.bind(n,5936))},{id:"cobol",name:"COBOL",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(780)]).then(n.bind(n,780))},{id:"codeowners",name:"CODEOWNERS",import:()=>n.e(9096).then(n.bind(n,9096))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>n.e(6283).then(n.bind(n,6283))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>Promise.all([n.e(7258),n.e(6563)]).then(n.bind(n,6563))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>n.e(489).then(n.bind(n,489))},{id:"coq",name:"Coq",import:()=>n.e(8418).then(n.bind(n,8418))},{id:"cpp",name:"C++",aliases:["c++"],import:()=>Promise.all([n.e(1230),n.e(5814),n.e(4914)]).then(n.bind(n,4914))},{id:"crystal",name:"Crystal",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1230),n.e(5814),n.e(3894),n.e(3403)]).then(n.bind(n,3403))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>n.e(2354).then(n.bind(n,2354))},{id:"css",name:"CSS",import:()=>n.e(1708).then(n.bind(n,1708))},{id:"csv",name:"CSV",import:()=>n.e(8849).then(n.bind(n,1230))},{id:"cue",name:"CUE",import:()=>n.e(172).then(n.bind(n,172))},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>n.e(9806).then(n.bind(n,9806))},{id:"d",name:"D",import:()=>n.e(5177).then(n.bind(n,5177))},{id:"dart",name:"Dart",import:()=>n.e(9728).then(n.bind(n,9728))},{id:"dax",name:"DAX",import:()=>n.e(874).then(n.bind(n,874))},{id:"desktop",name:"Desktop",import:()=>n.e(6173).then(n.bind(n,6173))},{id:"diff",name:"Diff",import:()=>n.e(7670).then(n.bind(n,7670))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>n.e(415).then(n.bind(n,415))},{id:"dotenv",name:"dotEnv",import:()=>n.e(2173).then(n.bind(n,2173))},{id:"dream-maker",name:"Dream Maker",import:()=>n.e(3227).then(n.bind(n,3227))},{id:"edge",name:"Edge",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(3052)]).then(n.bind(n,3052))},{id:"elixir",name:"Elixir",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(3330)]).then(n.bind(n,3330))},{id:"elm",name:"Elm",import:()=>Promise.all([n.e(5814),n.e(9641)]).then(n.bind(n,9641))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>n.e(2505).then(n.bind(n,2505))},{id:"erb",name:"ERB",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(4007),n.e(9524)]).then(n.bind(n,9524))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>Promise.all([n.e(7900),n.e(2266)]).then(n.bind(n,2266))},{id:"fennel",name:"Fennel",import:()=>n.e(1631).then(n.bind(n,1631))},{id:"fish",name:"Fish",import:()=>n.e(9661).then(n.bind(n,9661))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>n.e(9077).then(n.bind(n,9077))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>Promise.all([n.e(8553),n.e(7549)]).then(n.bind(n,7549))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>n.e(8553).then(n.bind(n,8553))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>Promise.all([n.e(7900),n.e(9689)]).then(n.bind(n,9689))},{id:"gdresource",name:"GDResource",import:()=>n.e(7434).then(n.bind(n,7434))},{id:"gdscript",name:"GDScript",import:()=>n.e(4311).then(n.bind(n,4311))},{id:"gdshader",name:"GDShader",import:()=>n.e(6405).then(n.bind(n,6405))},{id:"genie",name:"Genie",import:()=>n.e(9017).then(n.bind(n,9017))},{id:"gherkin",name:"Gherkin",import:()=>n.e(4451).then(n.bind(n,4451))},{id:"git-commit",name:"Git Commit Message",import:()=>n.e(2861).then(n.bind(n,2861))},{id:"git-rebase",name:"Git Rebase Message",import:()=>Promise.all([n.e(3894),n.e(638)]).then(n.bind(n,638))},{id:"gleam",name:"Gleam",import:()=>n.e(8201).then(n.bind(n,8201))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(8700)]).then(n.bind(n,8700))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(5050)]).then(n.bind(n,5050))},{id:"glsl",name:"GLSL",import:()=>Promise.all([n.e(5814),n.e(2723)]).then(n.bind(n,2723))},{id:"gnuplot",name:"Gnuplot",import:()=>n.e(396).then(n.bind(n,396))},{id:"go",name:"Go",import:()=>n.e(3941).then(n.bind(n,3941))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>Promise.all([n.e(7258),n.e(4714),n.e(6940),n.e(6262),n.e(3170)]).then(n.bind(n,3170))},{id:"groovy",name:"Groovy",import:()=>n.e(1037).then(n.bind(n,1037))},{id:"hack",name:"Hack",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1230),n.e(6356)]).then(n.bind(n,6356))},{id:"haml",name:"Ruby Haml",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(3949)]).then(n.bind(n,3949))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1655)]).then(n.bind(n,1655))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>n.e(9045).then(n.bind(n,9045))},{id:"haxe",name:"Haxe",import:()=>n.e(8107).then(n.bind(n,8107))},{id:"hcl",name:"HashiCorp HCL",import:()=>n.e(6124).then(n.bind(n,6124))},{id:"hjson",name:"Hjson",import:()=>n.e(5203).then(n.bind(n,5203))},{id:"hlsl",name:"HLSL",import:()=>n.e(4598).then(n.bind(n,4598))},{id:"html",name:"HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940)]).then(n.bind(n,4940))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(914)]).then(n.bind(n,914))},{id:"http",name:"HTTP",import:()=>Promise.all([n.e(7258),n.e(4714),n.e(6967),n.e(3894),n.e(6940),n.e(6262),n.e(3170),n.e(5119)]).then(n.bind(n,5119))},{id:"hxml",name:"HXML",import:()=>n.e(8320).then(n.bind(n,8320))},{id:"hy",name:"Hy",import:()=>n.e(7470).then(n.bind(n,7470))},{id:"imba",name:"Imba",import:()=>n.e(3702).then(n.bind(n,3702))},{id:"ini",name:"INI",aliases:["properties"],import:()=>n.e(6343).then(n.bind(n,6343))},{id:"java",name:"Java",import:()=>n.e(6967).then(n.bind(n,6967))},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>n.e(7258).then(n.bind(n,7258))},{id:"jinja",name:"Jinja",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(3837)]).then(n.bind(n,3837))},{id:"jison",name:"Jison",import:()=>Promise.all([n.e(7258),n.e(5536)]).then(n.bind(n,5536))},{id:"json",name:"JSON",import:()=>n.e(5709).then(n.bind(n,5709))},{id:"json5",name:"JSON5",import:()=>n.e(6010).then(n.bind(n,6010))},{id:"jsonc",name:"JSON with Comments",import:()=>n.e(212).then(n.bind(n,212))},{id:"jsonl",name:"JSON Lines",import:()=>n.e(4843).then(n.bind(n,4843))},{id:"jsonnet",name:"Jsonnet",import:()=>n.e(4962).then(n.bind(n,4962))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>n.e(7922).then(n.bind(n,7922))},{id:"jsx",name:"JSX",import:()=>n.e(6262).then(n.bind(n,6262))},{id:"julia",name:"Julia",aliases:["jl"],import:()=>Promise.all([n.e(7258),n.e(1230),n.e(5814),n.e(4914),n.e(2473),n.e(9983),n.e(9910)]).then(n.bind(n,9910))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>n.e(2660).then(n.bind(n,2660))},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>n.e(6297).then(n.bind(n,6297))},{id:"latex",name:"LaTeX",import:()=>Promise.all([n.e(9983),n.e(7817)]).then(n.bind(n,7817))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>n.e(8003).then(n.bind(n,8003))},{id:"less",name:"Less",import:()=>n.e(6964).then(n.bind(n,6964))},{id:"liquid",name:"Liquid",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(327)]).then(n.bind(n,327))},{id:"llvm",name:"LLVM IR",import:()=>n.e(3972).then(n.bind(n,1591))},{id:"log",name:"Log file",import:()=>n.e(3247).then(n.bind(n,3247))},{id:"logo",name:"Logo",import:()=>n.e(9730).then(n.bind(n,9730))},{id:"lua",name:"Lua",import:()=>Promise.all([n.e(5814),n.e(4199)]).then(n.bind(n,4199))},{id:"luau",name:"Luau",import:()=>n.e(5744).then(n.bind(n,5744))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>n.e(1757).then(n.bind(n,1757))},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>n.e(7900).then(n.bind(n,7900))},{id:"marko",name:"Marko",import:()=>Promise.all([n.e(1708),n.e(4714),n.e(7611),n.e(6964),n.e(9175)]).then(n.bind(n,9175))},{id:"matlab",name:"MATLAB",import:()=>n.e(2492).then(n.bind(n,2492))},{id:"mdc",name:"MDC",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7900),n.e(2215)]).then(n.bind(n,2215))},{id:"mdx",name:"MDX",import:()=>n.e(4452).then(n.bind(n,4452))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>n.e(2860).then(n.bind(n,2860))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>n.e(8499).then(n.bind(n,8499))},{id:"mojo",name:"Mojo",import:()=>n.e(9526).then(n.bind(n,9526))},{id:"move",name:"Move",import:()=>n.e(9104).then(n.bind(n,9104))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>n.e(6239).then(n.bind(n,6239))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>n.e(9876).then(n.bind(n,9876))},{id:"nginx",name:"Nginx",import:()=>Promise.all([n.e(5814),n.e(697)]).then(n.bind(n,697))},{id:"nim",name:"Nim",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(5814),n.e(7900),n.e(4697)]).then(n.bind(n,4697))},{id:"nix",name:"Nix",import:()=>n.e(8212).then(n.bind(n,8212))},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>n.e(7374).then(n.bind(n,7374))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>n.e(7148).then(n.bind(n,7148))},{id:"objective-cpp",name:"Objective-C++",import:()=>n.e(9788).then(n.bind(n,9788))},{id:"ocaml",name:"OCaml",import:()=>n.e(9057).then(n.bind(n,9057))},{id:"pascal",name:"Pascal",import:()=>n.e(9079).then(n.bind(n,9079))},{id:"perl",name:"Perl",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(9984)]).then(n.bind(n,9984))},{id:"php",name:"PHP",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(7765),n.e(7966)]).then(n.bind(n,7765))},{id:"plsql",name:"PL/SQL",import:()=>n.e(8389).then(n.bind(n,8389))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>n.e(4520).then(n.bind(n,4520))},{id:"polar",name:"Polar",import:()=>n.e(9845).then(n.bind(n,9845))},{id:"postcss",name:"PostCSS",import:()=>n.e(9270).then(n.bind(n,9270))},{id:"powerquery",name:"PowerQuery",import:()=>n.e(454).then(n.bind(n,454))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>n.e(1476).then(n.bind(n,1476))},{id:"prisma",name:"Prisma",import:()=>n.e(5731).then(n.bind(n,5731))},{id:"prolog",name:"Prolog",import:()=>n.e(9206).then(n.bind(n,9206))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>n.e(5891).then(n.bind(n,5891))},{id:"pug",name:"Pug",aliases:["jade"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6757)]).then(n.bind(n,6757))},{id:"puppet",name:"Puppet",import:()=>n.e(3593).then(n.bind(n,3593))},{id:"purescript",name:"PureScript",import:()=>n.e(9904).then(n.bind(n,9904))},{id:"python",name:"Python",aliases:["py"],import:()=>n.e(2473).then(n.bind(n,2473))},{id:"qml",name:"QML",import:()=>Promise.all([n.e(7258),n.e(1803)]).then(n.bind(n,1803))},{id:"qmldir",name:"QML Directory",import:()=>n.e(4292).then(n.bind(n,4292))},{id:"qss",name:"Qt Style Sheets",import:()=>n.e(402).then(n.bind(n,402))},{id:"r",name:"R",import:()=>n.e(9983).then(n.bind(n,9983))},{id:"racket",name:"Racket",import:()=>n.e(9281).then(n.bind(n,9281))},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>n.e(9780).then(n.bind(n,9780))},{id:"razor",name:"ASP.NET Razor",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(2354),n.e(245)]).then(n.bind(n,245))},{id:"reg",name:"Windows Registry Script",import:()=>n.e(5827).then(n.bind(n,5827))},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>n.e(3124).then(n.bind(n,3124))},{id:"rel",name:"Rel",import:()=>n.e(3043).then(n.bind(n,5424))},{id:"riscv",name:"RISC-V",import:()=>n.e(8684).then(n.bind(n,8684))},{id:"rst",name:"reStructuredText",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(2473),n.e(4007),n.e(8234)]).then(n.bind(n,8234))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(4007)]).then(n.bind(n,4007))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>n.e(7145).then(n.bind(n,7145))},{id:"sas",name:"SAS",import:()=>Promise.all([n.e(1230),n.e(9478)]).then(n.bind(n,9478))},{id:"sass",name:"Sass",import:()=>n.e(8709).then(n.bind(n,8709))},{id:"scala",name:"Scala",import:()=>n.e(3947).then(n.bind(n,3947))},{id:"scheme",name:"Scheme",import:()=>n.e(9982).then(n.bind(n,9982))},{id:"scss",name:"SCSS",import:()=>Promise.all([n.e(1708),n.e(7611)]).then(n.bind(n,7611))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>n.e(1624).then(n.bind(n,1624))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>n.e(8249).then(n.bind(n,8249))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>n.e(3894).then(n.bind(n,3894))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>Promise.all([n.e(3894),n.e(9965)]).then(n.bind(n,9965))},{id:"smalltalk",name:"Smalltalk",import:()=>n.e(1066).then(n.bind(n,1066))},{id:"solidity",name:"Solidity",import:()=>n.e(4780).then(n.bind(n,4780))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7642)]).then(n.bind(n,7642))},{id:"sparql",name:"SPARQL",import:()=>n.e(4108).then(n.bind(n,4108))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>n.e(6514).then(n.bind(n,6514))},{id:"sql",name:"SQL",import:()=>n.e(1230).then(n.bind(n,8849))},{id:"ssh-config",name:"SSH Config",import:()=>n.e(3874).then(n.bind(n,3874))},{id:"stata",name:"Stata",import:()=>Promise.all([n.e(1230),n.e(542)]).then(n.bind(n,542))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>n.e(41).then(n.bind(n,41))},{id:"svelte",name:"Svelte",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4714),n.e(3454)]).then(n.bind(n,3454))},{id:"swift",name:"Swift",import:()=>n.e(8436).then(n.bind(n,8436))},{id:"system-verilog",name:"SystemVerilog",import:()=>n.e(6577).then(n.bind(n,6577))},{id:"systemd",name:"Systemd Units",import:()=>n.e(16).then(n.bind(n,16))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>n.e(4660).then(n.bind(n,4660))},{id:"tasl",name:"Tasl",import:()=>n.e(1839).then(n.bind(n,1839))},{id:"tcl",name:"Tcl",import:()=>n.e(7328).then(n.bind(n,7328))},{id:"templ",name:"Templ",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(3941),n.e(7095)]).then(n.bind(n,7095))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>n.e(4385).then(n.bind(n,4385))},{id:"tex",name:"TeX",import:()=>Promise.all([n.e(9983),n.e(9198)]).then(n.bind(n,9198))},{id:"toml",name:"TOML",import:()=>n.e(5363).then(n.bind(n,5363))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(9556)]).then(n.bind(n,9556))},{id:"tsv",name:"TSV",import:()=>n.e(6045).then(n.bind(n,8426))},{id:"tsx",name:"TSX",import:()=>n.e(6940).then(n.bind(n,6940))},{id:"turtle",name:"Turtle",import:()=>n.e(4877).then(n.bind(n,4877))},{id:"twig",name:"Twig",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(2473),n.e(7611),n.e(4007),n.e(7765),n.e(4236)]).then(n.bind(n,4236))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>n.e(4714).then(n.bind(n,4714))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>n.e(794).then(n.bind(n,794))},{id:"typst",name:"Typst",aliases:["typ"],import:()=>n.e(8711).then(n.bind(n,8711))},{id:"v",name:"V",import:()=>n.e(5443).then(n.bind(n,5443))},{id:"vala",name:"Vala",import:()=>n.e(7141).then(n.bind(n,7141))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>n.e(8235).then(n.bind(n,8235))},{id:"verilog",name:"Verilog",import:()=>n.e(4283).then(n.bind(n,4283))},{id:"vhdl",name:"VHDL",import:()=>n.e(5521).then(n.bind(n,5521))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>n.e(7567).then(n.bind(n,7567))},{id:"vue",name:"Vue",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(1432)]).then(n.bind(n,1432))},{id:"vue-html",name:"Vue HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(1432),n.e(7789)]).then(n.bind(n,7789))},{id:"vue-vine",name:"Vue Vine",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(7611),n.e(6964),n.e(1432),n.e(41),n.e(5954)]).then(n.bind(n,5954))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>n.e(845).then(n.bind(n,845))},{id:"wasm",name:"WebAssembly",import:()=>n.e(7615).then(n.bind(n,7615))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>n.e(8393).then(n.bind(n,8393))},{id:"wgsl",name:"WGSL",import:()=>n.e(5884).then(n.bind(n,5884))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>n.e(2062).then(n.bind(n,2062))},{id:"wit",name:"WebAssembly Interface Types",import:()=>n.e(6957).then(n.bind(n,6957))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>n.e(5589).then(n.bind(n,5589))},{id:"xml",name:"XML",import:()=>Promise.all([n.e(6967),n.e(5585)]).then(n.bind(n,7966))},{id:"xsl",name:"XSL",import:()=>Promise.all([n.e(6967),n.e(5628)]).then(n.bind(n,5628))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>n.e(4546).then(n.bind(n,4546))},{id:"zenscript",name:"ZenScript",import:()=>n.e(5099).then(n.bind(n,5099))},{id:"zig",name:"Zig",import:()=>n.e(3279).then(n.bind(n,3279))}],Cr=Object.fromEntries(Sr.map(e=>[e.id,e.import])),Mr=Object.fromEntries(Sr.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Tr={...Cr,...Mr},Lr=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>n.e(2691).then(n.bind(n,2691))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>n.e(7768).then(n.bind(n,7768))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>n.e(7927).then(n.bind(n,7927))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>n.e(1216).then(n.bind(n,1216))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>n.e(7788).then(n.bind(n,7788))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>n.e(2071).then(n.bind(n,2071))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>n.e(9692).then(n.bind(n,9692))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>n.e(3032).then(n.bind(n,3032))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>n.e(8485).then(n.bind(n,8485))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>n.e(284).then(n.bind(n,284))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>n.e(1545).then(n.bind(n,1545))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>n.e(6083).then(n.bind(n,6083))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>n.e(5647).then(n.bind(n,5647))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>n.e(9179).then(n.bind(n,9179))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>n.e(9976).then(n.bind(n,9976))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>n.e(9831).then(n.bind(n,9831))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>n.e(9809).then(n.bind(n,9809))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>n.e(9681).then(n.bind(n,9681))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>n.e(1425).then(n.bind(n,1425))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>n.e(6865).then(n.bind(n,6865))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>n.e(7824).then(n.bind(n,7824))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>n.e(3646).then(n.bind(n,3646))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>n.e(2419).then(n.bind(n,2419))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>n.e(9225).then(n.bind(n,9225))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>n.e(4112).then(n.bind(n,4112))},{id:"houston",displayName:"Houston",type:"dark",import:()=>n.e(8931).then(n.bind(n,8931))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>n.e(2184).then(n.bind(n,2184))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>n.e(2142).then(n.bind(n,2142))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>n.e(5638).then(n.bind(n,5638))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>n.e(7831).then(n.bind(n,7831))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>n.e(8426).then(n.bind(n,6045))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>n.e(3492).then(n.bind(n,3492))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>n.e(3720).then(n.bind(n,3720))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>n.e(9294).then(n.bind(n,9294))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>n.e(4081).then(n.bind(n,4081))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>n.e(1729).then(n.bind(n,1729))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>n.e(4614).then(n.bind(n,4614))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>n.e(2934).then(n.bind(n,2934))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>n.e(2535).then(n.bind(n,2535))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>n.e(4214).then(n.bind(n,4214))},{id:"nord",displayName:"Nord",type:"dark",import:()=>n.e(4552).then(n.bind(n,4552))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>n.e(6736).then(n.bind(n,6736))},{id:"one-light",displayName:"One Light",type:"light",import:()=>n.e(3906).then(n.bind(n,3906))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>n.e(4445).then(n.bind(n,4445))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>n.e(4465).then(n.bind(n,4465))},{id:"red",displayName:"Red",type:"dark",import:()=>n.e(6980).then(n.bind(n,6980))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>n.e(753).then(n.bind(n,753))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>n.e(5424).then(n.bind(n,3043))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>n.e(8093).then(n.bind(n,8093))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>n.e(4838).then(n.bind(n,4838))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>n.e(5601).then(n.bind(n,5601))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>n.e(1857).then(n.bind(n,1857))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>n.e(7217).then(n.bind(n,7217))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>n.e(1931).then(n.bind(n,1931))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>n.e(321).then(n.bind(n,321))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>n.e(5034).then(n.bind(n,5034))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>n.e(224).then(n.bind(n,224))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>n.e(5542).then(n.bind(n,5542))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>n.e(6517).then(n.bind(n,6517))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>n.e(5143).then(n.bind(n,5143))}],zr=Object.fromEntries(Lr.map(e=>[e.id,e.import]));class Ar extends Error{constructor(e){super(e),this.name="ShikiError"}}function Pr(e){return Array.isArray(e)?function(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Pr(e[n]);return t}(e):e instanceof RegExp?e:"object"==typeof e?function(e){let t={};for(let n in e)t[n]=Pr(e[n]);return t}(e):e}function Rr(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Nr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t===e.length-1?Nr(e.substring(0,e.length-1)):e.substr(1+~t)}var Er=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Or=class{static hasCaptures(e){return null!==e&&(Er.lastIndex=0,Er.test(e))}static replaceCaptures(e,t,n){return e.replace(Er,(e,r,i,s)=>{let o=n[parseInt(r||i,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 Ir(e,t){return e<t?-1:e>t?1:0}function Br(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Ir(e[r],t[r]);if(0!==n)return n}return 0}return n-r}function Dr(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 Vr(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Hr=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}},jr=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=[],r=0;for(let e=0,i=t.length;e<i;e++){let i,s=t[e];if(!s.settings)continue;if("string"==typeof s.scope){let e=s.scope;e=e.replace(/^[,]+/,""),e=e.replace(/[,]+$/,""),i=e.split(",")}else i=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&&Dr(s.settings.foreground)&&(a=s.settings.foreground);let l=null;"string"==typeof s.settings.background&&Dr(s.settings.background)&&(l=s.settings.background);for(let t=0,s=i.length;t<s;t++){let s=i[t].trim().split(" "),c=s[s.length-1],d=null;s.length>1&&(d=s.slice(0,s.length-1),d.reverse()),n[r++]=new $r(c,d,e,o,a,l)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{let n=Ir(e.scope,t.scope);return 0!==n?n:(n=Br(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(r=t.foreground),null!==t.background&&(i=t.background)}let s=new Xr(t),o=new qr(n,s.getId(r),s.getId(i)),a=new Yr(new Wr(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 jr(s,o,a)}(e,t)}_cachedMatchRoot=new Hr(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 r=t[n],i=!1;if(">"===r){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Ur(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}(e.parent,t.parentScopes));return n?new qr(n.fontStyle,n.foreground,n.background):null}},Fr=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(const r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);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 Ur(e,t){return t===e||e.startsWith(t)&&"."===e[t.length]}var qr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}},$r=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},Gr=(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))(Gr||{}),Xr=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)}},Kr=Object.freeze([]),Wr=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Kr,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r)}},Yr=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,r=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[r]&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){const i=t.parentScopes[r].length-e.parentScopes[n].length;if(0!==i)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,r=t.indexOf(".");if(-1===r?(e=t,n=""):(e=t.substring(0,r),n=t.substring(r+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,r,i,s,o){if(""===n)return void this._doInsertHere(t,r,i,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(),Wr.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,l,r,i,s,o)}_doInsertHere(e,t,n,r,i){if(null!==t){for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let o=this._rulesWithParentScopes[s];if(0===Br(o.parentScopes,t))return void o.acceptOverwrite(e,n,r,i)}-1===n&&(n=this._mainRule.fontStyle),0===r&&(r=this._mainRule.foreground),0===i&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Wr(e,t,n,r,i))}else this._mainRule.acceptOverwrite(e,n,r,i)}},Zr=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){const n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),s=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,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,r,i,s,o,a){let l=e.getLanguageId(t),c=e.getTokenType(t),d=e.containsBalancedBrackets(t)?1:0,u=e.getFontStyle(t),h=e.getForeground(t),p=e.getBackground(t);return 0!==n&&(l=n),8!==r&&(c=r),null!==i&&(d=i?1:0),-1!==s&&(u=s),0!==o&&(h=o),0!==a&&(p=a),(l|c<<8|d<<10|u<<11|h<<15|p<<24)>>>0}};function Qr(e){return e}function Jr(e,t){const n=[],r=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}(e);let i=r.next();for(;null!==i;){let e=0;if(2===i.length&&":"===i.charAt(1)){switch(i.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),","!==i)break;i=r.next()}return n;function s(){if("-"===i){i=r.next();const e=s();return t=>!!e&&!e(t)}if("("===i){i=r.next();const e=function(){const e=[];let t=o();for(;t&&(e.push(t),"|"===i||","===i);){do{i=r.next()}while("|"===i||","===i);t=o()}return t=>e.some(e=>e(t))}();return")"===i&&(i=r.next()),e}if(ei(i)){const e=[];do{e.push(i),i=r.next()}while(ei(i));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 ei(e){return!!e&&!!e.match(/[\w\.:]+/)}function ti(e){"function"==typeof e.dispose&&e.dispose()}var ni=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ri=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ii=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))}},si=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new ni(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new ii;for(const n of e)oi(n,this.initialScopeName,this.repo,t);for(const e of t.references)if(e instanceof ni){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 oi(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof ni?li({baseGrammar:s,selfGrammar:i},r):ai(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const e of o)r.add(new ni(e))}function ai(e,t,n){t.repository&&t.repository[e]&&ci([t.repository[e]],t,n)}function li(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ci(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ci(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ci(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const e=r.repository?Rr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&ci(r.patterns,{...t,repository:e},n);const i=r.include;if(!i)continue;const s=mi(i);switch(s.kind){case 0:li({...t,selfGrammar:t.baseGrammar},n);break;case 1:li(t,n);break;case 2:ai(s.ruleName,{...t,repository:e},n);break;case 3:case 4:const r=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){const i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};4===s.kind?ai(s.ruleName,i,n):li(i,n)}else 4===s.kind?n.add(new ri(s.scopeName,s.ruleName)):n.add(new ni(s.scopeName))}}}var di=class{kind=0},ui=class{kind=1},hi=class{constructor(e){this.ruleName=e}kind=2},pi=class{constructor(e){this.scopeName=e}kind=3},fi=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function mi(e){if("$base"===e)return new di;if("$self"===e)return new ui;const t=e.indexOf("#");if(-1===t)return new pi(e);if(0===t)return new hi(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new fi(n,r)}}var _i=/\\(\d+)/,gi=/\\(\d+)/g;Symbol("RuleId");var bi=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Or.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Or.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Nr(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?Or.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?Or.replaceCaptures(this._contentName,e,t):this._contentName}},vi=class extends bi{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},yi=class extends bi{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ci(r,this.id),this.captures=i,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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Mi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},wi=class extends bi{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Mi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},xi=class extends bi{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,s,o,a,l,c){super(e,t,n,r),this._begin=new Ci(i,this.id),this.beginCaptures=s,this._end=new Ci(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,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Mi;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}},ki=class extends bi{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,s,o,a,l){super(e,t,n,r),this._begin=new Ci(i,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Ci(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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Mi;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,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Mi,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},Si=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new vi(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new yi(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(void 0===t.begin){t.repository&&(r=Rr({},r,t.repository));let i=t.patterns;return void 0===i&&t.include&&(i=[{include:t.include}]),new wi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new ki(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new xi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];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++)i[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,r)),i[o]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,a)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const o=t[s];let a=-1;if(o.include){const t=mi(o.include);switch(t.kind){case 0:case 1:a=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(a=e.getCompiledRuleId(i,n,r));break;case 3:case 4:const s=t.scopeName,l=4===t.kind?t.ruleName:null,c=n.getExternalGrammar(s,r);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,r);if(-1!==a){const e=n.getRule(a);let t=!1;if((e instanceof wi||e instanceof xi||e instanceof ki)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ci=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,r=[],i=!1;for(let s=0;s<t;s++)if("\\"===e.charAt(s)&&s+1<t){const t=e.charAt(s+1);"z"===t?(r.push(e.substring(n,s)),r.push("$(?!\\n)(?<!\\n)"),n=s+2):"A"!==t&&"G"!==t||(i=!0),s++}this.hasAnchor=i,0===n?this.source=e:(r.push(e.substring(n,t)),this.source=r.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=_i.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 gi.lastIndex=0,this.source.replace(gi,(e,t)=>Vr(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,r,i=[],s=[],o=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),i[e]=n,s[e]=n,o[e]=n,a[e]=n,"\\"===n&&e+1<t&&(r=this.source.charAt(e+1),"A"===r?(i[e+1]="",s[e+1]="",o[e+1]="A",a[e+1]="A"):"G"===r?(i[e+1]="",s[e+1]="G",o[e+1]="",a[e+1]="G"):(i[e+1]=r,s[e+1]=r,o[e+1]=r,a[e+1]=r),e++);return{A0_G0:i.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}},Mi=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 Ti(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 r=this._items.map(e=>e.resolveAnchors(t,n));return new Ti(e,r,this._items.map(e=>e.ruleId))}},Ti=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 r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Li=class{constructor(e,t){this.languageId=e,this.tokenType=t}},zi=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Li(e,8),this._embeddedLanguagesMatcher=new Ai(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 Li(0,0);_getBasicScopeAttributes=new Hr(e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new Li(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/},Ai=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])=>Vr(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}},Pi=("undefined"!=typeof process&&process.env.VSCODE_TEXTMATE_DEBUG,class{constructor(e,t){this.stack=e,this.stoppedEarly=t}});function Ri(e,t,n,r,i,s,o,a){const l=t.content.length;let c=!1,d=-1;if(o){const o=function(e,t,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let t=i;t;t=t.pop()){const n=t.getRule(e);n instanceof ki&&a.push({rule:n,stack:t})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:a,findOptions:c}=Ei(l.rule,e,l.stack.endRule,n,r===o),d=a.findNextMatchSync(t,r,c);if(!d){i=l.stack.pop();break}if(-2!==d.ruleId){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),Oi(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>r&&(r=d.captureIndices[0].end,n=!1))}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}(e,t,n,r,i,s);i=o.stack,r=o.linePos,n=o.isFirstLine,d=o.anchorPosition}const u=Date.now();for(;!c;){if(0!==a&&Date.now()-u>a)return new Pi(i,!0);h()}return new Pi(i,!1);function h(){const o=function(e,t,n,r,i,s){const o=function(e,t,n,r,i,s){const o=i.getRule(e),{ruleScanner:a,findOptions:l}=Ni(o,e,i.endRule,n,r===s),c=a.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}(e,t,n,r,i,s),a=e.getInjections();if(0===a.length)return o;const l=function(e,t,n,r,i,s,o){let a,l=Number.MAX_VALUE,c=null,d=0;const u=s.contentNameScopesList.getScopeNames();for(let s=0,h=e.length;s<h;s++){const h=e[s];if(!h.matcher(u))continue;const p=t.getRule(h.ruleId),{ruleScanner:f,findOptions:m}=Ni(p,t,null,r,i===o),_=f.findNextMatchSync(n,i,m);if(!_)continue;const g=_.captureIndices[0].start;if(!(g>=l)&&(l=g,c=_.captureIndices,a=_.ruleId,d=h.priority,l===i))break}return c?{priorityMatch:-1===d,captureIndices:c,matchedRuleId:a}:null}(a,e,t,n,r,i,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,r,i,d);if(!o)return s.produce(i,l),void(c=!0);const a=o.captureIndices,u=o.matchedRuleId,h=!!(a&&a.length>0)&&a[0].end>r;if(-1===u){const o=i.getRule(e);s.produce(i,a[0].start),i=i.withContentNameScopesList(i.nameScopesList),Oi(e,t,n,i,s,o.endCaptures,a),s.produce(i,a[0].end);const u=i;if(i=i.parent,d=u.getAnchorPos(),!h&&u.getEnterPos()===r)return i=u,s.produce(i,l),void(c=!0)}else{const o=e.getRule(u);s.produce(i,a[0].start);const p=i,f=o.getName(t.content,a),m=i.contentNameScopesList.pushAttributed(f,e);if(i=i.push(u,r,d,a[0].end===l,null,m,m),o instanceof xi){const r=o;Oi(e,t,n,i,s,r.beginCaptures,a),s.produce(i,a[0].end),d=a[0].end;const u=r.getContentName(t.content,a),f=m.pushAttributed(u,e);if(i=i.withContentNameScopesList(f),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(i))return i=i.pop(),s.produce(i,l),void(c=!0)}else if(o instanceof ki){const r=o;Oi(e,t,n,i,s,r.beginCaptures,a),s.produce(i,a[0].end),d=a[0].end;const u=r.getContentName(t.content,a),f=m.pushAttributed(u,e);if(i=i.withContentNameScopesList(f),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(i))return i=i.pop(),s.produce(i,l),void(c=!0)}else if(Oi(e,t,n,i,s,o.captures,a),s.produce(i,a[0].end),i=i.pop(),!h)return i=i.safePop(),s.produce(i,l),void(c=!0)}a[0].end>r&&(r=a[0].end,n=!1)}}function Ni(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Ei(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Oi(e,t,n,r,i,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 u=o[t];if(0===u.length)continue;if(u.start>d)break;for(;c.length>0&&c[c.length-1].endPos<=u.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,u.start):i.produce(r,u.start),l.retokenizeCapturedWithRuleId){const t=l.getName(a,o),s=r.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(a,o),d=s.pushAttributed(c,e),h=r.push(l.retokenizeCapturedWithRuleId,u.start,-1,!1,null,s,d),p=e.createOnigString(a.substring(0,u.end));Ri(e,p,n&&0===u.start,u.start,h,i,!1,0),ti(p);continue}const h=l.getName(a,o);if(null!==h){const t=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(h,e);c.push(new Ii(t,u.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Ii=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Bi(e,t,n,r,i){const s=Jr(t,Di),o=Si.getCompiledRuleId(n,r,i.repository);for(const n of s)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Di(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Vi(t[r],e))return n=r+1,!0;return!1})}function Vi(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 Hi=class{constructor(e,t,n,r,i,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new zi(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ji(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const e of Object.keys(i)){const t=Jr(e,Di);for(const n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[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 r=n.injections;if(r)for(let t in r)Bi(e,t,r[t],this,n);const i=this._grammarRepository.injections(t);i&&i.forEach(t=>{const n=this.getExternalGrammar(t);if(n){const t=n.injectionSelector;t&&Bi(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]=ji(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){let i;if(-1===this._rootId&&(this._rootId=Si.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==Ui.NULL)i=!1,t.reset();else{i=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Zr.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?Fi.createRootAndLookUpScopeName(s,r,this):Fi.createRoot("unknown",r),t=new Ui(null,this._rootId,-1,-1,!1,null,o,o)}e+="\n";const s=this.createOnigString(e),o=s.content.length,a=new $i(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Ri(this,s,i,0,t,a,!0,r);return ti(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function ji(e,t){return(e=Pr(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 Fi=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const t of n)i=Fr.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Fr(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new Fr(null,t),o=r.themeProvider.themeMatch(s),a=e.mergeAttributes(n,i,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 r=-1,i=0,s=0;return null!==n&&(r=n.fontStyle,i=n.foregroundId,s=n.backgroundId),Zr.set(e,t.languageId,t.tokenType,null,r,i,s)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=e.mergeAttributes(t.tokenAttributes,i,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}},Ui=class e{constructor(e,t,n,r,i,s,o,a){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_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)&&Fi.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,r,i,s,o,a){return new e(this,t,n,r,i,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 r=Fi.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Fi.fromExtension(r,n.contentNameScopesList))}},qi=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):Jr(e,Di).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Jr(e,Di).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}},$i=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,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,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!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=Zr.set(n,0,Qr(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}return r&&(n=Zr.set(n,0,8,r,-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}},Gi=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,r,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,function(e,t,n,r,i,s,o,a){return new Hi(e,t,n,r,i,s,o,a)}(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Xi=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Gi(jr.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(jr.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 qi(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){const s=new si(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(e=>this._loadSingleGrammar(e.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_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,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Ki=Ui.NULL;const Wi=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Yi{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Zi(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Yi(n,r,t)}function Qi(e){return e.toLowerCase()}Yi.prototype.normal={},Yi.prototype.property={},Yi.prototype.space=void 0;class Ji{constructor(e,t){this.attribute=t,this.property=e}}Ji.prototype.attribute="",Ji.prototype.booleanish=!1,Ji.prototype.boolean=!1,Ji.prototype.commaOrSpaceSeparated=!1,Ji.prototype.commaSeparated=!1,Ji.prototype.defined=!1,Ji.prototype.mustUseProperty=!1,Ji.prototype.number=!1,Ji.prototype.overloadedBoolean=!1,Ji.prototype.property="",Ji.prototype.spaceSeparated=!1,Ji.prototype.space=void 0;let es=0;const ts=ls(),ns=ls(),rs=ls(),is=ls(),ss=ls(),os=ls(),as=ls();function ls(){return 2**++es}const cs=Object.keys(r);class ds extends Ji{constructor(e,t,n,i){let s=-1;if(super(e,t),us(this,"space",i),"number"==typeof n)for(;++s<cs.length;){const e=cs[s];us(this,cs[s],(n&r[e])===r[e])}}}function us(e,t,n){n&&(e[t]=n)}function hs(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new ds(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Qi(r)]=r,n[Qi(s.attribute)]=r}return new Yi(t,n,e.space)}ds.prototype.defined=!0;const ps=hs({properties:{ariaActiveDescendant:null,ariaAtomic:ns,ariaAutoComplete:null,ariaBusy:ns,ariaChecked:ns,ariaColCount:is,ariaColIndex:is,ariaColSpan:is,ariaControls:ss,ariaCurrent:null,ariaDescribedBy:ss,ariaDetails:null,ariaDisabled:ns,ariaDropEffect:ss,ariaErrorMessage:null,ariaExpanded:ns,ariaFlowTo:ss,ariaGrabbed:ns,ariaHasPopup:null,ariaHidden:ns,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ss,ariaLevel:is,ariaLive:null,ariaModal:ns,ariaMultiLine:ns,ariaMultiSelectable:ns,ariaOrientation:null,ariaOwns:ss,ariaPlaceholder:null,ariaPosInSet:is,ariaPressed:ns,ariaReadOnly:ns,ariaRelevant:null,ariaRequired:ns,ariaRoleDescription:ss,ariaRowCount:is,ariaRowIndex:is,ariaRowSpan:is,ariaSelected:ns,ariaSetSize:is,ariaSort:null,ariaValueMax:is,ariaValueMin:is,ariaValueNow:is,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function fs(e,t){return t in e?e[t]:t}function ms(e,t){return fs(e,t.toLowerCase())}const _s=hs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:os,acceptCharset:ss,accessKey:ss,action:null,allow:null,allowFullScreen:ts,allowPaymentRequest:ts,allowUserMedia:ts,alt:null,as:null,async:ts,autoCapitalize:null,autoComplete:ss,autoFocus:ts,autoPlay:ts,blocking:ss,capture:null,charSet:null,checked:ts,cite:null,className:ss,cols:is,colSpan:null,content:null,contentEditable:ns,controls:ts,controlsList:ss,coords:is|os,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ts,defer:ts,dir:null,dirName:null,disabled:ts,download:rs,draggable:ns,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ts,formTarget:null,headers:ss,height:is,hidden:rs,high:is,href:null,hrefLang:null,htmlFor:ss,httpEquiv:ss,id:null,imageSizes:null,imageSrcSet:null,inert:ts,inputMode:null,integrity:null,is:null,isMap:ts,itemId:null,itemProp:ss,itemRef:ss,itemScope:ts,itemType:ss,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ts,low:is,manifest:null,max:null,maxLength:is,media:null,method:null,min:null,minLength:is,multiple:ts,muted:ts,name:null,nonce:null,noModule:ts,noValidate:ts,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:ts,optimum:is,pattern:null,ping:ss,placeholder:null,playsInline:ts,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ts,referrerPolicy:null,rel:ss,required:ts,reversed:ts,rows:is,rowSpan:is,sandbox:ss,scope:null,scoped:ts,seamless:ts,selected:ts,shadowRootClonable:ts,shadowRootDelegatesFocus:ts,shadowRootMode:null,shape:null,size:is,sizes:null,slot:null,span:is,spellCheck:ns,src:null,srcDoc:null,srcLang:null,srcSet:null,start:is,step:null,style:null,tabIndex:is,target:null,title:null,translate:null,type:null,typeMustMatch:ts,useMap:null,value:ns,width:is,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ss,axis:null,background:null,bgColor:null,border:is,borderColor:null,bottomMargin:is,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ts,declare:ts,event:null,face:null,frame:null,frameBorder:null,hSpace:is,leftMargin:is,link:null,longDesc:null,lowSrc:null,marginHeight:is,marginWidth:is,noResize:ts,noHref:ts,noShade:ts,noWrap:ts,object:null,profile:null,prompt:null,rev:null,rightMargin:is,rules:null,scheme:null,scrolling:ns,standby:null,summary:null,text:null,topMargin:is,valueType:null,version:null,vAlign:null,vLink:null,vSpace:is,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ts,disableRemotePlayback:ts,prefix:null,property:null,results:is,security:null,unselectable:null},space:"html",transform:ms}),gs=hs({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:as,accentHeight:is,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:is,amplitude:is,arabicForm:null,ascent:is,attributeName:null,attributeType:null,azimuth:is,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:is,by:null,calcMode:null,capHeight:is,className:ss,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:is,diffuseConstant:is,direction:null,display:null,dur:null,divisor:is,dominantBaseline:null,download:ts,dx:null,dy:null,edgeMode:null,editable:null,elevation:is,enableBackground:null,end:null,event:null,exponent:is,externalResourcesRequired:null,fill:null,fillOpacity:is,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:os,g2:os,glyphName:os,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:is,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:is,horizOriginX:is,horizOriginY:is,id:null,ideographic:is,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:is,k:is,k1:is,k2:is,k3:is,k4:is,kernelMatrix:as,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:is,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:is,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:is,overlineThickness:is,paintOrder:null,panose1:null,path:null,pathLength:is,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ss,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:is,pointsAtY:is,pointsAtZ:is,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:as,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:as,rev:as,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:as,requiredFeatures:as,requiredFonts:as,requiredFormats:as,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:is,specularExponent:is,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:is,strikethroughThickness:is,string:null,stroke:null,strokeDashArray:as,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:is,strokeOpacity:is,strokeWidth:null,style:null,surfaceScale:is,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:as,tabIndex:is,tableValues:null,target:null,targetX:is,targetY:is,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:as,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:is,underlineThickness:is,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:is,values:null,vAlphabetic:is,vMathematical:is,vectorEffect:null,vHanging:is,vIdeographic:is,version:null,vertAdvY:is,vertOriginX:is,vertOriginY:is,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:is,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fs}),bs=hs({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()}),vs=hs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ms}),ys=hs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),ws=Zi([ps,_s,bs,vs,ys],"html"),xs=Zi([ps,gs,bs,vs,ys],"svg"),ks={}.hasOwnProperty,Ss=/["&'<>`]/g,Cs=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ms=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ts=/[|\\{}()[\]^$+*?.]/g,Ls=new WeakMap;const zs=/[\dA-Fa-f]/,As=/\d/,Ps=["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"],Rs={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:"€"},Ns=["cent","copy","divide","gt","lt","not","para","times"],Es={}.hasOwnProperty,Os={};let Is;for(Is in Rs)Es.call(Rs,Is)&&(Os[Rs[Is]]=Is);const Bs=/[^\dA-Za-z]/;function Ds(e,t,n){let r,i=function(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!zs.test(String.fromCharCode(t))?r:r+";"}(e,t,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(r=function(e,t,n,r){const i=String.fromCharCode(e);if(Es.call(Os,i)){const e=Os[i],s="&"+e;return n&&Ps.includes(e)&&!Ns.includes(e)&&(!r||t&&61!==t&&Bs.test(String.fromCharCode(t)))?s:s+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const r=function(e,t,n){const r="&#"+String(e);return n&&t&&!As.test(String.fromCharCode(t))?r:r+";"}(e,t,n.omitOptionalSemicolons);r.length<i.length&&(i=r)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function Vs(e,t){return function(e,t){return e=e.replace(t.subset?function(e){let t=Ls.get(e);return t||(t=function(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Ts,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),Ls.set(e,t)),t}(t.subset):Ss,n),t.subset||t.escapeOnly?e:e.replace(Cs,function(e,n,r){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}).replace(Ms,n);function n(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}(e,Object.assign({format:Ds},t))}const Hs=/^>|^->|<!--|-->|--!>|<!-$/g,js=[">"],Fs=["<",">"];function Us(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}function qs(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const $s=/[A-Z]/g,Gs=/-[a-z]/g,Xs=/^data[-\w.:]+$/i;function Ks(e){return"-"+e.toLowerCase()}function Ws(e){return e.charAt(1).toUpperCase()}function Ys(e){return e.join(" ").trim()}const Zs=/[ \t\n\f\r]/g;function Qs(e){return"object"==typeof e?"text"===e.type&&Js(e.value):Js(e)}function Js(e){return""===e.replace(Zs,"")}const eo=ro(1),to=ro(-1),no=[];function ro(e){return function(t,n,r){const i=t?t.children:no;let s=(n||0)+e,o=i[s];if(!r)for(;o&&Qs(o);)s+=e,o=i[s];return o}}const io={}.hasOwnProperty;function so(e){return function(t,n,r){return io.call(e,t.tagName)&&e[t.tagName](t,n,r)}}const oo=so({body:function(e,t,n){const r=eo(n,t);return!r||"comment"!==r.type},caption:ao,colgroup:ao,dd:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName)},dt:function(e,t,n){const r=eo(n,t);return Boolean(r&&"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName))},head:ao,html:function(e,t,n){const r=eo(n,t);return!r||"comment"!==r.type},li:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&"li"===r.tagName},optgroup:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&"optgroup"===r.tagName},option:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("option"===r.tagName||"optgroup"===r.tagName)},p:function(e,t,n){const r=eo(n,t);return r?"element"===r.type&&("address"===r.tagName||"article"===r.tagName||"aside"===r.tagName||"blockquote"===r.tagName||"details"===r.tagName||"div"===r.tagName||"dl"===r.tagName||"fieldset"===r.tagName||"figcaption"===r.tagName||"figure"===r.tagName||"footer"===r.tagName||"form"===r.tagName||"h1"===r.tagName||"h2"===r.tagName||"h3"===r.tagName||"h4"===r.tagName||"h5"===r.tagName||"h6"===r.tagName||"header"===r.tagName||"hgroup"===r.tagName||"hr"===r.tagName||"main"===r.tagName||"menu"===r.tagName||"nav"===r.tagName||"ol"===r.tagName||"p"===r.tagName||"pre"===r.tagName||"section"===r.tagName||"table"===r.tagName||"ul"===r.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:lo,rt:lo,tbody:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName)},td:co,tfoot:function(e,t,n){return!eo(n,t)},th:co,thead:function(e,t,n){const r=eo(n,t);return Boolean(r&&"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName))},tr:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&"tr"===r.tagName}});function ao(e,t,n){const r=eo(n,t,!0);return!r||"comment"!==r.type&&!("text"===r.type&&Qs(r.value.charAt(0)))}function lo(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("rp"===r.tagName||"rt"===r.tagName)}function co(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("td"===r.tagName||"th"===r.tagName)}const uo=so({body:function(e){const t=eo(e,-1,!0);return!(t&&("comment"===t.type||"text"===t.type&&Qs(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 r=to(n,t),i=eo(e,-1,!0);return!(n&&r&&"element"===r.type&&"colgroup"===r.tagName&&oo(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"col"===i.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=eo(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){const r=to(n,t),i=eo(e,-1);return(!n||!r||"element"!==r.type||"thead"!==r.tagName&&"tbody"!==r.tagName||!oo(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"tr"===i.tagName)}}),ho={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 po(e,t,n){const r=function(e,t){const n=Qi(t);let r=t,i=Ji;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Xs.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Gs,Ws);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Gs.test(e)){let n=e.replace($s,Ks);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=ds}return new i(r,t)}(e.schema,t),i=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,s=e.settings.allowDangerousCharacters?0:1;let o,a=e.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=Vs(r.attribute,Object.assign({},e.settings.characterReferences,{subset:ho.name[i][s]}));return!0===n?l:(n=Array.isArray(n)?(r.commaSeparated?qs:Ys)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n?l:(e.settings.preferUnquoted&&(o=Vs(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ho.unquoted[i][s]}))),o!==n&&(e.settings.quoteSmart&&Us(n,a)>Us(n,e.alternative)&&(a=e.alternative),o=a+Vs(n,Object.assign({},e.settings.characterReferences,{subset:("'"===a?ho.single:ho.double)[i][s],attribute:!0}))+a),l+(o?"="+o:o)))}const fo=["<","&"];function mo(e,t,n,r){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?Vs(e.value,Object.assign({},r.settings.characterReferences,{subset:fo})):e.value}const _o=function(e,t){const n=t||{};function r(t,...n){let i=r.invalid;const s=r.handlers;if(t&&ks.call(t,e)){const n=String(t[e]);i=ks.call(s,n)?s[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}("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,r){return r.settings.bogusComments?"<?"+Vs(e.value,Object.assign({},r.settings.characterReferences,{subset:js}))+">":"\x3c!--"+e.value.replace(Hs,function(e){return Vs(e,Object.assign({},r.settings.characterReferences,{subset:Fs}))})+"--\x3e"},doctype:function(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,r){const i=r.schema,s="svg"!==i.space&&r.settings.omitOptionalTags;let o="svg"===i.space?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;"html"===i.space&&"svg"===e.tagName&&(r.schema=xs);const c=function(e,t){const n=[];let r,i=-1;if(t)for(r in t)if(null!==t[r]&&void 0!==t[r]){const i=po(e,r,t[r]);i&&n.push(i)}for(;++i<n.length;){const t=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&'"'!==t&&"'"!==t&&(n[i]+=" ")}return n.join("")}(r,e.properties),d=r.all("html"===i.space&&"template"===e.tagName?e.content:e);return r.schema=i,d&&(o=!1),!c&&s&&uo(e,t,n)||(a.push("<",e.tagName,c?" "+c:""),o&&("svg"===i.space||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&a.push(" "),a.push("/")),a.push(">")),a.push(d),o||s&&oo(e,t,n)||a.push("</"+e.tagName+">"),a.join("")},raw:function(e,t,n,r){return r.settings.allowDangerousHtml?e.value:mo(e,0,n,r)},root:function(e,t,n,r){return r.all(e)},text:mo}}),go={},bo={},vo=[];function yo(e,t,n){return _o(e,t,n,this)}function wo(e){const t=[],n=e&&e.children||vo;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function xo(e,t){const n="string"==typeof e?{}:{...e.colorReplacements},r="string"==typeof e?e:e.name;for(const[e,i]of Object.entries(t?.colorReplacements||{}))"string"==typeof i?n[e]=i:e===r&&Object.assign(n,i);return n}function ko(e,t){return e&&t?.[e?.toLowerCase()]||e}async function So(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function Co(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Mo(e){return"ansi"===e||Co(e)}function To(e){return"none"===e}function Lo(e){return To(e)}function zo(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 Ao(e,t=!1){const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let e=0;e<n.length;e+=2){const s=t?n[e]+(n[e+1]||""):n[e];i.push([s,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}const Po="light-dark()",Ro=["color","background-color"];function No(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Gr.Italic&&(t["font-style"]="italic"),e.fontStyle&Gr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Gr.Underline&&n.push("underline"),e.fontStyle&Gr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Eo(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}const Oo=new WeakMap;function Io(e,t){Oo.set(e,t)}function Bo(e){return Oo.get(e)}class Do{_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 Do(Object.fromEntries((n=t,Array.isArray(n)?n:[n]).map(e=>[e,Ki])),e);var n}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return function(e){const t=[],n=new Set;return function e(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&e(r.parent)}(e),t}(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Vo(){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 Ar(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}{const t=r.lines[e.line];if(void 0===t)throw new Ar(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Ar(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}};const r=function(e){const t=Ao(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 r=n,i=0;for(const e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}},posToIndex:function(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}}}(t.source),i=(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 Ar(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const t=e[r],i=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(i||s||o||a){if(i&&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 Ar(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}(i),e.set(t.meta,{decorations:i,converter:r,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 r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}(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),r=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(r.length!==n.converter.lines.length)throw new Ar(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){const s=r[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+=Ho(s.children[e]),-1===l&&a.length===t&&(l=e+1),-1===c&&a.length===n&&(c=e+1);if(-1===l)throw new Ar(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(-1===c)throw new Ar(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);const d=s.children.slice(l,c);if(i.alwaysWrap||d.length!==s.children.length)if(i.alwaysWrap||1!==d.length||"element"!==d[0].type){const e={type:"element",tagName:"span",properties:{},children:d};o(e,i,"wrapper"),s.children.splice(l,d.length,e)}else o(d[0],i,"token");else o(s,i,"line")}function s(e,t){r[e]=o(r[e],t,"line")}function o(e,t,n){const r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&zo(e,t.properties.class),i(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)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,Number.POSITIVE_INFINITY,e);for(let r=t.line+1;r<n.line;r++)a.unshift(()=>s(r,e));i(n.line,0,n.character,e)}}a.forEach(e=>e())}}}function Ho(e){return"text"===e.type?e.value:"element"===e.type?e.children.map(Ho).join(""):""}const jo=[Vo()];function Fo(e){const t=function(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...jo]}var Uo=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],qo={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function $o(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 Go(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 Xo(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(0===r)t.push({type:"resetAll"});else if(r<=9)qo[r]&&t.push({type:"setDecoration",value:qo[r]});else if(r<=29){const e=qo[r-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Uo[r-30]}});else if(38===r){const n=Go(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===r)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Uo[r-40]}});else if(48===r){const n=Go(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===r?t.push({type:"resetBackgroundColor"}):53===r?t.push({type:"setDecoration",value:"overline"}):55===r?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Uo[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Uo[r-100+8]}})}return t}var Ko={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 Wo(e=Ko){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 r;return{value:function(e){switch(e.type){case"named":return t(e.name);case"rgb":return n(e.rgb);case"table":return i=e.index,function(){if(r)return r;r=[];for(let e=0;e<Uo.length;e++)r.push(t(Uo[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let s=0;s<6;s++)r.push(n([e[t],e[i],e[s]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}()[i]}var i}}}function Yo(e,t,n={}){const{lang:r="text",theme:i=e.getLoadedThemes()[0]}=n;if(Co(r)||To(i))return Ao(t).map(e=>[{content:e[0],offset:e[1]}]);const{theme:s,colorMap:o}=e.setTheme(i);if("ansi"===r)return function(e,t,n){const r=xo(e,n),i=Ao(t),s=Wo(Object.fromEntries(Uo.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(r){const i=[];let s=0;do{const o=$o(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const r=Xo(o.sequence);for(const i of r)"resetAll"===i.type?(e=null,t=null,n.clear()):"resetForegroundColor"===i.type?e=null:"resetBackgroundColor"===i.type?t=null:"resetDecoration"===i.type&&n.delete(i.value);for(const i of r)"setForegroundColor"===i.type?e=i.value:"setBackgroundColor"===i.type?t=i.value:"setDecoration"===i.type&&n.add(i.value)}s=o.position}while(s<r.length);return i}}}();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has("reverse")?(i=n.background?s.value(n.background):e.bg,o=n.foreground?s.value(n.foreground):e.fg):(i=n.foreground?s.value(n.foreground):e.fg,o=n.background?s.value(n.background):void 0),i=ko(i,r),o=ko(o,r),n.decorations.has("dim")&&(i=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}(i));let a=Gr.None;return n.decorations.has("bold")&&(a|=Gr.Bold),n.decorations.has("italic")&&(a|=Gr.Italic),n.decorations.has("underline")&&(a|=Gr.Underline),n.decorations.has("strikethrough")&&(a|=Gr.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:a}}))}(s,t,n);const a=e.getLanguage(r);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Ar(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Ar(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return function(e,t,n,r,i){const s=Zo(e,t,n,r,i),o=new Do(Zo(e,t,n,r,i).stateStack,t.name,n.name);return Io(s.tokens,o),s.tokens}(t,a,s,o,n)}function Zo(e,t,n,r,i){const s=xo(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=Ao(e);let c=i.grammarState?function(e,t){if(!(e instanceof Do))throw new Ar("Invalid grammar state");return e.getInternalStack(t)}(i.grammarState,n.name)??Ki:null!=i.grammarContextCode?Zo(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ki,d=[];const u=[];for(let e=0,h=l.length;e<h;e++){const[h,p]=l[e];if(""===h){d=[],u.push([]);continue}if(o>0&&h.length>=o){d=[],u.push([{content:h,offset:p,color:"",fontStyle:0}]);continue}let f,m,_;i.includeExplanation&&(f=t.tokenizeLine(h,c,a),m=f.tokens,_=0);const g=t.tokenizeLine2(h,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]:h.length;if(t===o)continue;const a=g.tokens[2*e+1],l=ko(r[Zr.getForeground(a)],s),c=Zr.getFontStyle(a),u={content:h.substring(t,o),offset:p+t,color:l,fontStyle:c};if(i.includeExplanation){const e=[];if("scopeName"!==i.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(/ /))})}u.explanation=[];let r=0;for(;t+r<o;){const t=m[_],n=h.substring(t.startIndex,t.endIndex);r+=n.length,u.explanation.push({content:n,scopes:"scopeName"===i.includeExplanation?Qo(t.scopes):Jo(e,t.scopes)}),_+=1}}d.push(u)}u.push(d),d=[],c=g.ruleStack}return{tokens:u,stateStack:c}}function Qo(e){return e.map(e=>({scopeName:e}))}function Jo(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];n[r]={scopeName:i,themeMatches:na(e,i,t.slice(0,r))}}return n}function ea(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function ta(e,t,n){if(!ea(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)ea(e[r],n[i])&&(r-=1),i-=1;return-1===r}function na(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const e of i)if(ta(e,t,n)){r.push(s);break}return r}function ra(e,t,n){const r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{const i=Yo(e,t,{...n,theme:r.theme});return{tokens:i,state:Bo(i),theme:"string"==typeof r.theme?r.theme:r.theme.name}}),s=function(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(e=>e[r]),s=t.map(()=>[]);t.forEach((e,t)=>e.push(s[t]));const o=i.map(()=>0),a=i.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]=i[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}(...i.map(e=>e.tokens)),o=s[0].map((e,t)=>e.map((e,i)=>{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][i];o.variants[r[n].color]=c}),o})),a=i[0].state?new Do(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return a&&Io(o,a),o}function ia(e,t,n){let r,i,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:u="css-vars"}=n,h=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===h.length)throw new Ar("`themes` option must not be empty");const p=ra(e,t,n);if(l=Bo(p),c&&Po!==c&&!h.find(e=>e.color===c))throw new Ar(`\`themes\` option must contain the defaultColor key \`${c}\``);const f=h.map(t=>e.getTheme(t.theme)),m=h.map(e=>e.color);s=p.map(e=>e.map(e=>function(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>No(e.variants[t])),a=new Set(o.flatMap(e=>Object.keys(e))),l={},c=(e,r)=>{const i="color"===r?"":"background-color"===r?"-bg":`-${r}`;return n+t[e]+("color"===r?"":i)};return o.forEach((e,n)=>{for(const s of a){const a=e[s]||"inherit";if(0===n&&r&&Ro.includes(s))if(r===Po&&o.length>1){const e=t.findIndex(e=>"light"===e),r=t.findIndex(e=>"dark"===e);if(-1===e||-1===r)throw new Ar('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=o[e][s]||"inherit",u=o[r][s]||"inherit";l[s]=`light-dark(${d}, ${u})`,"css-vars"===i&&(l[c(n,s)]=a)}else l[s]=a;else"css-vars"===i&&(l[c(n,s)]=a)}}),s.htmlStyle=l,s}(e,m,d,c,u))),l&&Io(s,l);const _=h.map(e=>xo(e.theme,n));i=sa(h,f,_,d,c,"fg",u),r=sa(h,f,_,d,c,"bg",u),o=`shiki-themes ${f.map(e=>e.name).join(" ")}`,a=c?void 0:[i,r].join(";")}else{if(!("theme"in n))throw new Ar("Invalid options, either `theme` or `themes` must be provided");{const a=xo(n.theme,n);s=Yo(e,t,n);const c=e.getTheme(n.theme);r=ko(c.bg,a),i=ko(c.fg,a),o=c.name,l=Bo(s)}}return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function sa(e,t,n,r,i,s,o){return e.map((a,l)=>{const c=ko(t[l][s],n[l])||"inherit",d=`${r+a.color}${"bg"===s?"-bg":""}:${c}`;if(0===l&&i){if(i===Po&&e.length>1){const r=e.findIndex(e=>"light"===e.color),i=e.findIndex(e=>"dark"===e.color);if(-1===r||-1===i)throw new Ar('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${ko(t[r][s],n[r])||"inherit"}, ${ko(t[i][s],n[i])||"inherit"});${d}`}return c}return"css-vars"===o?d:null}).filter(e=>!!e).join(";")}function oa(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>oa(e,t,n),codeToTokens:(t,n)=>ia(e,t,n)}){let i=t;for(const e of Fo(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:d}=ia(e,i,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;!0===u?s=function(e){return e.map(e=>{const t=[];let n="",r=0;return e.forEach((i,s)=>{const o=!(i.fontStyle&&(i.fontStyle&Gr.Underline||i.fontStyle&Gr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[s+1]?(r||(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=0,n=""):t.push(i)}),t})}(s):"never"===u&&(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,r,i]=t;if(!n&&!i)return e;const s=[{...e,offset:e.offset+n.length,content:r}];return n&&s.unshift({content:n,offset:e.offset}),i&&s.push({content:i,offset:e.offset+n.length+r.length}),s}))}(s)),h&&(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],r=Eo(e.htmlStyle||No(e)),i=Eo(n.htmlStyle||No(n)),s=e.fontStyle&&(e.fontStyle&Gr.Underline||e.fontStyle&Gr.Strikethrough),o=n.fontStyle&&(n.fontStyle&Gr.Underline||n.fontStyle&Gr.Strikethrough);s||o||r!==i?t.push({...n}):e.content+=n.content}return t})}(s));const p={...r,get source(){return i}};for(const e of Fo(n))s=e.tokens?.call(p,s)||s;return function(e,t,n,r=Bo(e)){const i=Fo(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 u=[],h={...n,structure:a,addClassToHast:zo,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 u}};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:[]},r=0;for(const s of e){let e={type:"element",tagName:"span",properties:{...s.htmlAttrs},children:[{type:"text",value:s.content}]};const l=Eo(s.htmlStyle||No(s));l&&(e.properties.style=l);for(const o of i)e=o?.span?.call(h,e,t+1,r,n,s)||e;"inline"===a?o.children.push(e):"classic"===a&&n.children.push(e),r+=s.content.length}if("classic"===a){for(const e of i)n=e?.line?.call(h,n,t+1)||n;u.push(n),s.push(n)}}),"classic"===a){for(const e of i)d=e?.code?.call(h,d)||d;c.children.push(d);for(const e of i)c=e?.pre?.call(h,c)||c;o.children.push(c)}let p=o;for(const e of i)p=e?.root?.call(h,p)||p;return r&&Io(p,r),p}(s,{...n,fg:o,bg:a,themeName:l,rootStyle:c},p,d)}function aa(e,t,n){const r={meta:{},options:n,codeToHast:(t,n)=>oa(e,t,n),codeToTokens:(t,n)=>ia(e,t,n)};let i=function(e,t){const n=t||go,r=n.quote||'"',i='"'===r?"'":'"';if('"'!==r&&"'"!==r)throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:yo,all:wo,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||Wi,characterReferences:n.characterReferences||bo,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?xs:ws,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}(oa(e,t,n,r));for(const e of Fo(n))i=e.postprocess?.call(r,i,n)||i;return i}const la="__shiki_resolved";function ca(e){if(e?.[la])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:r}=t;if(!n||!r){const e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r="light"===t.type?"#333333":"#bbbbbb"),n||(n="light"===t.type?"#fffffe":"#1e1e1e"),t.fg=r,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 i=0;const s=new Map;function o(e){if(s.has(e))return s.get(e);i+=1;const n=`#${i.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("#"),r=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!r)return e;const i={...e,settings:{...e.settings}};if(n){const n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){const n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});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,la,{enumerable:!1,writable:!1,value:!0}),t}async function da(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Mo(e)).map(async e=>await So(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function ua(e){return(await Promise.all(e.map(async e=>Lo(e)?null:ca(await So(e))))).filter(e=>!!e)}class ha extends Error{constructor(e){super(e),this.name="ShikiError"}}class pa extends Xi{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,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=ca(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=jr.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 ha(`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 r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),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 ha(`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 fa{_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 r=t.slice(0,e).join(".");n=[...n,...this._injections.get(r)||[]]}return n}}let ma=0;async function _a(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,r]=await Promise.all([ua(e.themes||[]),da(e.langs||[]),e.engine]);return function(e){ma+=1,!1!==e.warnings&&ma>=10&&ma%10==0&&console.warn(`[Shiki] ${ma} 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 ha("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ca),i=new fa(e.engine,n),s=new pa(i,r,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 ha(`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 ha("Shiki instance has been disposed")}function u(){t||(t=!0,s.dispose(),ma-=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 ha(`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 da(e))},loadLanguageSync:l,loadTheme:async function(...e){return d(),c(await ua(e))},loadThemeSync:c,dispose:u,[Symbol.dispose]:u}}({...e,themes:t,langs:n,engine:r})}async function ga(e){const t=await _a(e);return{getLastGrammarState:(...e)=>function(...e){if(2===e.length)return Bo(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(Co(i)||To(s))throw new Ar("Plain language does not have grammar state");if("ansi"===i)throw new Ar("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(i);return new Do(Zo(n,l,o,a,r).stateStack,l.name,o.name)}(t,...e),codeToTokensBase:(e,n)=>Yo(t,e,n),codeToTokensWithThemes:(e,n)=>ra(t,e,n),codeToTokens:(e,n)=>ia(t,e,n),codeToHast:(e,n)=>oa(t,e,n),codeToHtml:(e,n)=>aa(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function ba(e){const t=e.langs,n=e.themes,r=e.engine;return async function(e){function i(n){if("string"==typeof n){if(Mo(n))return[];n=e.langAlias?.[n]||n;const r=t[n];if(!r)throw new Ar(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function s(e){if(Lo(e))return"none";if("string"==typeof e){const t=n[e];if(!t)throw new Ar(`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=>i(e)),l=await ga({engine:e.engine??r(),...e,themes:o,langs:a});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(i)),loadTheme:(...e)=>l.loadTheme(...e.map(s)),getBundledLanguages:()=>t,getBundledThemes:()=>n}}}function va(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 r(e,r){const i=await n({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)}),s=await(t?.guessEmbeddedLanguages?.(e,r.lang,i));return s&&await i.loadLanguage(...s),i}return{getSingletonHighlighter:e=>n(e),codeToHtml:async(e,t)=>(await r(e,t)).codeToHtml(e,t),codeToHast:async(e,t)=>(await r(e,t)).codeToHast(e,t),codeToTokens:async(e,t)=>(await r(e,t)).codeToTokens(e,t),codeToTokensBase:async(e,t)=>(await r(e,t)).codeToTokensBase(e,t),codeToTokensWithThemes:async(e,t)=>(await r(e,t)).codeToTokensWithThemes(e,t),getLastGrammarState:async(e,t)=>(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}class ya extends Error{constructor(e){super(e),this.name="ShikiError"}}function wa(){return"undefined"!=typeof performance?performance.now():Date.now()}const xa=(e,t)=>e+(t-e%t)%t;var ka=Object.defineProperty,Sa=(e,t,n)=>((e,t,n)=>t in e?ka(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let Ca=null;class Ma{constructor(e){Sa(this,"utf16Length"),Sa(this,"utf8Length"),Sa(this,"utf16Value"),Sa(this,"utf8Value"),Sa(this,"utf16OffsetToUtf8"),Sa(this,"utf8OffsetToUtf16");const t=e.length,n=Ma._utf8ByteLength(e),r=n!==t,i=r?new Uint32Array(t+1):null;r&&(i[t]=n);const s=r?new Uint32Array(n+1):null;r&&(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)}r&&(i[n]=a,d&&(i[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=i,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){const i=e.charCodeAt(n);let s=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(s=65536+(i-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 Ta=class e{constructor(t){if(Sa(this,"id",++e.LAST_ID),Sa(this,"_onigBinding"),Sa(this,"content"),Sa(this,"utf16Length"),Sa(this,"utf8Length"),Sa(this,"utf16OffsetToUtf8"),Sa(this,"utf8OffsetToUtf16"),Sa(this,"ptr"),!Ca)throw new ya("Must invoke loadWasm first.");this._onigBinding=Ca,this.content=t;const n=new Ma(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=Ca.omalloc(1e4)),e._sharedPtrInUse=!0,Ca.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Ca)}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)}};Sa(Ta,"LAST_ID",0),Sa(Ta,"_sharedPtr",0),Sa(Ta,"_sharedPtrInUse",!1);let La,za=Ta;class Aa{constructor(e){if(Sa(this,"_onigBinding"),Sa(this,"_ptr"),!Ca)throw new ya("Must invoke loadWasm first.");const t=[],n=[];for(let r=0,i=e.length;r<i;r++){const i=new Ma(e[r]);t[r]=i.createString(Ca),n[r]=i.utf8Length}const r=Ca.omalloc(4*e.length);Ca.HEAPU32.set(t,r/4);const i=Ca.omalloc(4*e.length);Ca.HEAPU32.set(n,i/4);const s=Ca.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Ca.ofree(t[n]);Ca.ofree(i),Ca.ofree(r),0===s&&function(e){throw new ya(e.UTF8ToString(e.getLastOnigError()))}(Ca),this._onigBinding=Ca,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if("number"==typeof n&&(r=n),"string"==typeof e){e=new za(e);const n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){const i=this._onigBinding,s=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(0===s)return null;const o=i.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++]),r=e.convertUtf8OffsetToUtf16(o[a++]);d[t]={start:n,end:r,length:r-n}}return{index:l,captureIndices:d}}}function Pa(e){return La||(La=async function(){Ca=await async function(e){let t,n;const r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function s(e){try{return t.grow(e-n.byteLength+65535>>>16),i(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 r=t+n;let i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&o)return o.decode(e.subarray(t,i));let s="";for(;t<i;){let n=e[t++];if(!(128&n)){s+=String.fromCharCode(n);continue}const r=63&e[t++];if(192==(224&n)){s+=String.fromCharCode((31&n)<<6|r);continue}const i=63&e[t++];if(n=224==(240&n)?(15&n)<<12|r<<6|i:(7&n)<<18|r<<12|i<<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}(r.HEAPU8,e,t):""}const l={emscripten_get_now:wa,emscripten_memcpy_big:function(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){const t=r.HEAPU8.length,n=2147483648;if((e>>>=0)>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),s(Math.min(n,xa(Math.max(e,i),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,i(t.buffer),Object.assign(r,s),r.UTF8ToString=a}(),r}(async t=>{let n=e;var r;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(r=n,e=>WebAssembly.instantiateStreaming(r,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 Ra(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await Ra(n.default)(t))):n=await n.default(t),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}(),La)}function Ra(e){return t=>WebAssembly.instantiate(e,t)}const Na=ba({langs:Tr,themes:zr,engine:()=>async function(e){return e&&await Pa(e),{createScanner:e=>new Aa(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new za(e)}}(n.e(4709).then(n.bind(n,7090)))}),{codeToHtml:Ea,codeToHast:Oa,codeToTokens:Ia,codeToTokensBase:Ba,codeToTokensWithThemes:Da,getSingletonHighlighter:Va,getLastGrammarState:Ha}=va(Na,{guessEmbeddedLanguages:function(e,t,n){const r=new Set;for(const t of e.matchAll(/lang=["']([\w-]+)["']/g))r.add(t[1]);for(const t of e.matchAll(/(?:```|~~~)([\w-]+)/g))r.add(t[1]);for(const t of e.matchAll(/\\begin\{([\w-]+)\}/g))r.add(t[1]);if(!n)return Array.from(r);const i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}}),ja=["id","data-type"],Fa=["data-id","onClick"],Ua=["innerHTML"],qa=["disabled"],$a=(0,c.pM)({__name:"cube-code",props:{cube:{}},setup(e){const{root:t}=e.cube,{stats:n}=t,r=(0,l.KR)(),i=(0,l.KR)(),s=(0,l.KR)(),u=(0,l.KR)();function h(e){if(!e._draglist)return;const t=e._draglist.init();return e.items.length>0&&t<=0?requestAnimationFrame(()=>h(e)):void 0}function p(){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 f(){const t=r.value,n=s.value;t&&n&&(e.cube._draglist=new N.DragList(t,"horizental","data-id","insert"),p(),e.cube._draglist.register_start(p),h(e.cube))}let m;(0,c.wB)(()=>[e.cube.active_tab_id,e.cube.active_tab?.code],()=>{const t=e.cube.active_tab,n=u.value;t&&n&&(n.value=t.code)},{immediate:!0}),(0,c.wB)(()=>[e.cube.code_html],()=>{const t=e.cube.active_tab,n=u.value,r=n?.previousElementSibling;if(!t||!n||!r)return;const i=n.parentElement;(0,c.dY)(()=>{const t=r.nextElementSibling,n=r.firstElementChild;if(t&&n){if(i){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"}})}),(0,c.sV)(()=>{f(),function(){const t=s.value,n=u.value;if(!t)return;n&&(n.value=e.cube.active_tab?.code||"");const r=i.value;if(!r)return;m=new N.DragDiff(r);let a=e.cube.attrs.width,l=e.cube.attrs.height,c=a,d=l;m.register_down(()=>{a=e.cube.attrs.width,l=e.cube.attrs.height}),m.register_move((e,n)=>{c=Math.round(e+a),d=Math.round(n+l),t.style.width=c+"px",t.style.height=d+"px"}),m.register_up((t,n)=>{if(a===c&&l===d)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+a),s=Math.round(n+l);r.tell(e.cube,o.VL.resize(e.cube.id,i,s)),e.cube.history.record(r)}),m.register_cancel(()=>{e.cube.attrs.width=a,e.cube.attrs.height=l})}()}),(0,c.hi)(()=>{m?.off()});const _=(0,c.EW)(()=>({"caret-color":e.cube.attrs.caret}));function g(e){e.stopPropagation()}function b(t){const n=t.previousElementSibling;if(t.parentElement,!n)return;const r=t.value,{id:i,courier:s,history:a}=e.cube,l=e.cube.tabbar_height,c=e.cube.max_height_auto,d=s.get_recorder(),u=kr.update(i,e.cube.active_tab_id,r);d.tell(e.cube,u);const h=n.scrollHeight+l,p=Math.min(c,h),f=o.VL.set_attr(i,{height:p});d.tell(e.cube,f),a.record(d)}function v(e){const t=e.currentTarget;t.value,b(t)}function y(e){const{hotkeys:n,clipboard:r,history:i}=t,s=e.key.toLowerCase();if([n.data[a.ZS["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=r.delete_scope();return void(t&&i.record(t))}const o=e.currentTarget;if("tab"===s){e.preventDefault(),e.stopPropagation();let t=o.value;const n=o.selectionStart,r=o.selectionEnd;t=t.slice(0,n)+"\t"+t.slice(r),o.value=t,o.selectionStart=n+1,o.selectionEnd=n+1,b(o)}}function w(e){e.preventDefault();const t=e.currentTarget;t.scrollTop=0,t.scrollLeft=0}function x(e,t=50){e.stopPropagation();const n=e.currentTarget;e.deltaY>0?N.DomAnimation.scroll_element(n,t,"horizental"):N.DomAnimation.scroll_element(n,-t,"horizental")}function k(e){const t=e.currentTarget,n=t.firstElementChild,r=t.lastElementChild;if(!n||!r)return;const i=e.shiftKey,{scrollLeft:s,scrollTop:o,scrollWidth:a,scrollHeight:l}=t,c=t.getBoundingClientRect();e.deltaY>0?i?s+c.width<a&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,20,"horizental")):o+c.height<l&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,20,"vertical")):i?s>0&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,-20,"horizental")):o>0&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,-20,"vertical"))}function S(t){(0,at.uz)(t,e.cube)}return(t,o)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-code",id:t.cube.id,"data-type":(0,l.R1)(a.u0).code,ref_key:"code",ref:s,style:(0,d.Tr)(t.cube.css),onPointerdown:g,onBeforeinput:g,onCompositionstart:g,onContextmenu:S},[(0,c.Lk)("div",{class:"code-tabbar",onWheel:x},[(0,c.Lk)("div",{class:"code-tabs-box",ref_key:"tabsbox",ref:r},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.items,n=>((0,c.uX)(),(0,c.CE)("div",{class:"code-tab","data-id":n.id,key:n.id,onClick:()=>function(t){const{courier:n,history:r}=e.cube,i=n.get_recorder();i.tell(e.cube,kr.change_active(e.cube.id,t.id)),r.record(i)}(n)},[(0,c.Lk)("div",{class:(0,d.C4)(["code-tab-name",{"code-active-tab":n.id===t.cube.active_tab_id}])},(0,d.v_)(n.name),3)],8,Fa))),128))],512)],32),(0,c.Lk)("div",{class:"code-box",onWheel:k},[(0,c.Lk)("div",{class:"code-box-inner",style:(0,d.Tr)({background:t.cube.attrs.codebg})},[(0,c.Lk)("span",{class:"code-highlight",onWheel:o[0]||(o[0]=e=>e.preventDefault()),innerHTML:t.cube.code_html},null,40,Ua),(0,c.Lk)("textarea",{disabled:(0,l.R1)(n).is_read_mode,ref_key:"textarea",ref:u,style:(0,d.Tr)(_.value),onKeyup:w,onKeydown:y,autocapitalize:"false",autocomplete:"false",autocorrect:"false",spellcheck:"false",onInput:v},null,44,qa)],4)],32),(0,c.Lk)("div",{class:"code-dragger",ref_key:"code_dragger",ref:i},null,512)],44,ja))}}),Ga=(0,f.A)($a,[["__scopeId","data-v-3a01d6f7"]]),Xa={".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"};var Ka=n(3755);function Wa(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const Ya="dracula";class Za extends o._D{_code_html=(0,l.KR)("");static _langs=[...Object.keys(Tr)];static _themes=[...Object.keys(zr)];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 40}get max_height_auto(){return 600}get langs(){return[...Za._langs]}get themes(){return[...Za._themes]}_draglist;get component(){return Ga}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,r=this.attrs.height;return{...this.data.css,"margin-left":t>0?t*e+"px":"0px",width:n+"px",height:r+"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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}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 Ea(e.code,{lang:e.lang,theme:e.theme,cssVariablePrefix:"--shiki-"})}get meta(){return Za.meta}create_tab(e,t,n=Ya){return{id:g.I.get_id(),name:t,lang:e,code:"",theme:n||Ya}}replace_id(e,t={}){return Za.replace_id(this.root,e,t)}copy_code(){const e=this.active_tab;if(!e)return Ka.F.tips?.tip_error("当前没有激活的代码块tab");const t=e.code,n=new Blob([t],{type:"text/plain"}),r=new ClipboardItem({[n.type]:n});this.clipboard.set_clipboard_data(r).then(e=>{Ka.F.tips?.tip_info("复制代码成功👏")})}change_lang(e){const{tabid:t,lang:n}=e,{courier:r,id:i}=this,s=r.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.lang;return o.lang=n,s.add_recover(kr.change_lang(i,t,a)),this.update_active_code_html(),s}change_theme(e){const{tabid:t,theme:n}=e,{courier:r,id:i}=this,s=r.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.theme;return o.theme=n,s.add_recover(kr.change_theme(i,t,a)),this.update_active_code_html(),s}code_update(e){const{tabid:t,code:n}=e,{courier:r,id:i}=this,s=r.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(kr.update(i,t,a)),this.update_active_code_html(),s}code_add(e){const{item:t,focus:n}=e,{courier:r,id:i}=this,s=r.get_recorder();return s.add_cmd(e),this.info.tabs.push(t),s.add_recover(kr.remove(i,t.id)),this.update_active_code_html(),n&&s.tell(this,kr.change_active(i,t.id)),(0,c.dY)(()=>{this._draglist?.init()}),s}code_remove(e){const{tabid:t}=e,{courier:n,id:r}=this,i=n.get_recorder();i.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),i.add_recover(kr.add(r,s)),a&&(this.active_tab_id=a.id),this.update_active_code_html(),(0,c.dY)(()=>{this._draglist?.init()}),i}code_rename(e){const{tabid:t,filename:n}=e,{courier:r,id:i}=this,s=r.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(kr.rename(i,t,a)),s}change_active(e){const{tabid:t}=e,{courier:n,id:r}=this,i=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,i.add_recover(kr.change_active(r,o)),this.update_active_code_html(),i}on_cursor_in_tail(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new _.vk(r),l=(this.meta,this.dom?.querySelector("textarea"));return l?.focus(),a}on_cursor_in_head(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new _.vk(r),l=(this.meta,this.dom?.querySelector("textarea"));return l?.focus(),a}static get meta(){return{cubename:"代码块",type:a.u0.code,block:!0,version:1,show:!0}}static get_default(){return{id:g.I.get_id(),type:a.u0.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 n={name:`code${this.get_format_from_lang(e)}`,id:g.I.get_id(),code:t,lang:e,theme:"andromeeda"};return{id:g.I.get_id(),type:a.u0.code,info:{tabs:[n],active_tab_id:n.id},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}static get_format_from_lang(e){for(let t in Xa)if(Xa[t]===e)return t;return""}static get_lang_from_format(e){return Xa[e]}}Wa([(0,k.H)(a.GW.change_lang)],Za.prototype,"change_lang",null),Wa([(0,k.H)(a.GW.change_theme)],Za.prototype,"change_theme",null),Wa([(0,k.H)(a.GW.code_update)],Za.prototype,"code_update",null),Wa([(0,k.H)(a.GW.code_add)],Za.prototype,"code_add",null),Wa([(0,k.H)(a.GW.code_remove)],Za.prototype,"code_remove",null),Wa([(0,k.H)(a.GW.code_rename)],Za.prototype,"code_rename",null),Wa([(0,k.H)(a.GW.change_active)],Za.prototype,"change_active",null),Wa([(0,k.H)(a.K9.cursor_in_tail)],Za.prototype,"on_cursor_in_tail",null),Wa([(0,k.H)(a.K9.cursor_in_head)],Za.prototype,"on_cursor_in_head",null);const Qa=["id","data-type","innerHTML"],Ja=(0,c.pM)({__name:"cube-fomula",props:{cube:{}},setup(e){const{stats:t,event:n}=e.cube.root;function r(){n.emit_show_cube_editor(e.cube)}const i=(0,c.EW)(()=>{let t={...e.cube.css};return e.cube.attrs.block&&(t.display="block",t["text-align"]="center"),t});return(e,t)=>((0,c.uX)(),(0,c.CE)("span",{class:"cube-fomula",onClick:r,id:e.cube.id,"data-type":(0,l.R1)(a.u0).fomula,style:(0,d.Tr)(i.value),innerHTML:e.cube.mathml},null,12,Qa))}}),el=(0,f.A)(Ja,[["__scopeId","data-v-b85f3e3c"]]);class tl{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 tl(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class nl{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 nl(t,tl.range(this,e))}}class rl{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,r,i="KaTeX parse error: "+e,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;n=s.start,r=s.end,n===o.length?i+=" at end of input: ":i+=" at position "+(n+1)+": ";var a=o.slice(n,r).replace(/[^]/g,"$&̲");i+=(n>15?"…"+o.slice(n-15,n):o.slice(0,n))+a+(r+15<o.length?o.slice(r,r+15)+"…":o.slice(r))}var l=new Error(i);return l.name="ParseError",l.__proto__=rl.prototype,l.position=n,null!=n&&null!=r&&(l.length=r-n),l.rawMessage=e,l}}rl.prototype.__proto__=Error.prototype;var il=/([A-Z])/g,sl={"&":"&",">":">","<":"<",'"':""","'":"'"},ol=/[&><"']/g,al=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},ll=function(e,t){return-1!==e.indexOf(t)},cl=function(e,t){return void 0===e?t:e},dl=function(e){return String(e).replace(ol,e=>sl[e])},ul=function(e){return e.replace(il,"-$1").toLowerCase()},hl=al,pl=function(e){var t=al(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},fl=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"},ml={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 _l(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 gl{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||{},ml)if(ml.hasOwnProperty(t)){var n=ml[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:_l(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new rl("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"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 '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r||!0!==r&&"error"!==r&&("warn"===r?("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 '"+r+"': "+t+" ["+e+"]"),1)))}isTrusted(e){if(e.url&&!e.protocol){var t=fl(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 bl{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 vl[yl[this.id]]}sub(){return vl[wl[this.id]]}fracNum(){return vl[xl[this.id]]}fracDen(){return vl[kl[this.id]]}cramp(){return vl[Sl[this.id]]}text(){return vl[Cl[this.id]]}isTight(){return this.size>=2}}var vl=[new bl(0,0,!1),new bl(1,0,!0),new bl(2,1,!1),new bl(3,1,!0),new bl(4,2,!1),new bl(5,2,!0),new bl(6,3,!1),new bl(7,3,!0)],yl=[4,5,4,5,6,7,6,7],wl=[5,5,5,5,7,7,7,7],xl=[2,3,4,5,6,7,6,7],kl=[3,3,5,5,7,7,7,7],Sl=[1,1,3,3,5,5,7,7],Cl=[0,1,2,3,2,3,2,3],Ml={DISPLAY:vl[0],TEXT:vl[2],SCRIPT:vl[4],SCRIPTSCRIPT:vl[6]},Tl=[{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]]}],Ll=[];function zl(e){for(var t=0;t<Ll.length;t+=2)if(e>=Ll[t]&&e<=Ll[t+1])return!0;return!1}Tl.forEach(e=>e.blocks.forEach(e=>Ll.push(...e)));var Al={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 Pl{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 ll(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 Rl={"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]}},Nl={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]},El={Å:"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 Ol(e,t,n){if(!Rl[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Rl[t][r];if(!i&&e[0]in El&&(r=El[e[0]].charCodeAt(0),i=Rl[t][r]),i||"text"!==n||zl(r)&&(i=Rl[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Il={},Bl=[[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]],Dl=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Vl=function(e,t){return t.size<2?e:Bl[e-1][t.size-1]};class Hl{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||Hl.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=Dl[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 Hl(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Vl(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:Dl[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Vl(Hl.BASESIZE,e);return this.size===t&&this.textSize===Hl.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!==Hl.BASESIZE?["sizing","reset-size"+this.size,"size"+Hl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!Il[t=e>=5?0:e>=3?1:2]){var n=Il[t]={cssEmPerMu:Nl.quad[t]/18};for(var r in Nl)Nl.hasOwnProperty(r)&&(n[r]=Nl[r][t])}return Il[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Hl.BASESIZE=6;var jl={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},Fl={ex:!0,em:!0,mu:!0},Ul=function(e){return"string"!=typeof e&&(e=e.unit),e in jl||e in Fl||"ex"===e},ql=function(e,t){var n;if(e.unit in jl)n=jl[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new rl("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},$l=function(e){return+e.toFixed(4)+"em"},Gl=function(e){return e.filter(e=>e).join(" ")},Xl=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 r=t.getColor();r&&(this.style.color=r)}},Kl=function(e){var t=document.createElement(e);for(var n in t.className=Gl(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},Wl=/[\s"'>/=\x00-\x1f]/,Yl=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+dl(Gl(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=ul(r)+":"+this.style[r]+";");for(var i in n&&(t+=' style="'+dl(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(i)){if(Wl.test(i))throw new rl("Invalid attribute name '"+i+"'");t+=" "+i+'="'+dl(this.attributes[i])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+"</"+e+">"};class Zl{constructor(e,t,n,r){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,Xl.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ll(this.classes,e)}toNode(){return Kl.call(this,"span")}toMarkup(){return Yl.call(this,"span")}}class Ql{constructor(e,t,n,r){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,Xl.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ll(this.classes,e)}toNode(){return Kl.call(this,"a")}toMarkup(){return Yl.call(this,"a")}}class Jl{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 ll(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="'+dl(this.src)+'" alt="'+dl(this.alt)+'"',t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=ul(n)+":"+this.style[n]+";");return t&&(e+=' style="'+dl(t)+'"'),e+"'/>"}}var ec={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class tc{constructor(e,t,n,r,i,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=r||0,this.skew=i||0,this.width=s||0,this.classes=o||[],this.style=a||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Tl.length;t++)for(var n=Tl[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ec[this.text])}hasClass(e){return ll(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=$l(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Gl(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+=dl(Gl(this.classes)),t+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=ul(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+dl(n)+'"');var i=dl(this.text);return e?(t+=">",t+=i,t+="</span>"):i}}class nc{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+'="'+dl(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class rc{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",Al[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+dl(this.alternate)+'"/>':'<path d="'+dl(Al[this.pathName])+'"/>'}}class ic{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+'="'+dl(this.attributes[t])+'"');return e+"/>"}}function sc(e){if(e instanceof tc)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var oc={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ac={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},lc={math:{},text:{}};function cc(e,t,n,r,i,s){lc[e][i]={font:t,group:n,replace:r},s&&r&&(lc[e][r]=lc[e][i])}var dc="math",uc="text",hc="main",pc="ams",fc="accent-token",mc="bin",_c="close",gc="inner",bc="mathord",vc="op-token",yc="open",wc="punct",xc="rel",kc="spacing",Sc="textord";cc(dc,hc,xc,"≡","\\equiv",!0),cc(dc,hc,xc,"≺","\\prec",!0),cc(dc,hc,xc,"≻","\\succ",!0),cc(dc,hc,xc,"∼","\\sim",!0),cc(dc,hc,xc,"⊥","\\perp"),cc(dc,hc,xc,"⪯","\\preceq",!0),cc(dc,hc,xc,"⪰","\\succeq",!0),cc(dc,hc,xc,"≃","\\simeq",!0),cc(dc,hc,xc,"∣","\\mid",!0),cc(dc,hc,xc,"≪","\\ll",!0),cc(dc,hc,xc,"≫","\\gg",!0),cc(dc,hc,xc,"≍","\\asymp",!0),cc(dc,hc,xc,"∥","\\parallel"),cc(dc,hc,xc,"⋈","\\bowtie",!0),cc(dc,hc,xc,"⌣","\\smile",!0),cc(dc,hc,xc,"⊑","\\sqsubseteq",!0),cc(dc,hc,xc,"⊒","\\sqsupseteq",!0),cc(dc,hc,xc,"≐","\\doteq",!0),cc(dc,hc,xc,"⌢","\\frown",!0),cc(dc,hc,xc,"∋","\\ni",!0),cc(dc,hc,xc,"∝","\\propto",!0),cc(dc,hc,xc,"⊢","\\vdash",!0),cc(dc,hc,xc,"⊣","\\dashv",!0),cc(dc,hc,xc,"∋","\\owns"),cc(dc,hc,wc,".","\\ldotp"),cc(dc,hc,wc,"⋅","\\cdotp"),cc(dc,hc,Sc,"#","\\#"),cc(uc,hc,Sc,"#","\\#"),cc(dc,hc,Sc,"&","\\&"),cc(uc,hc,Sc,"&","\\&"),cc(dc,hc,Sc,"ℵ","\\aleph",!0),cc(dc,hc,Sc,"∀","\\forall",!0),cc(dc,hc,Sc,"ℏ","\\hbar",!0),cc(dc,hc,Sc,"∃","\\exists",!0),cc(dc,hc,Sc,"∇","\\nabla",!0),cc(dc,hc,Sc,"♭","\\flat",!0),cc(dc,hc,Sc,"ℓ","\\ell",!0),cc(dc,hc,Sc,"♮","\\natural",!0),cc(dc,hc,Sc,"♣","\\clubsuit",!0),cc(dc,hc,Sc,"℘","\\wp",!0),cc(dc,hc,Sc,"♯","\\sharp",!0),cc(dc,hc,Sc,"♢","\\diamondsuit",!0),cc(dc,hc,Sc,"ℜ","\\Re",!0),cc(dc,hc,Sc,"♡","\\heartsuit",!0),cc(dc,hc,Sc,"ℑ","\\Im",!0),cc(dc,hc,Sc,"♠","\\spadesuit",!0),cc(dc,hc,Sc,"§","\\S",!0),cc(uc,hc,Sc,"§","\\S"),cc(dc,hc,Sc,"¶","\\P",!0),cc(uc,hc,Sc,"¶","\\P"),cc(dc,hc,Sc,"†","\\dag"),cc(uc,hc,Sc,"†","\\dag"),cc(uc,hc,Sc,"†","\\textdagger"),cc(dc,hc,Sc,"‡","\\ddag"),cc(uc,hc,Sc,"‡","\\ddag"),cc(uc,hc,Sc,"‡","\\textdaggerdbl"),cc(dc,hc,_c,"⎱","\\rmoustache",!0),cc(dc,hc,yc,"⎰","\\lmoustache",!0),cc(dc,hc,_c,"⟯","\\rgroup",!0),cc(dc,hc,yc,"⟮","\\lgroup",!0),cc(dc,hc,mc,"∓","\\mp",!0),cc(dc,hc,mc,"⊖","\\ominus",!0),cc(dc,hc,mc,"⊎","\\uplus",!0),cc(dc,hc,mc,"⊓","\\sqcap",!0),cc(dc,hc,mc,"∗","\\ast"),cc(dc,hc,mc,"⊔","\\sqcup",!0),cc(dc,hc,mc,"◯","\\bigcirc",!0),cc(dc,hc,mc,"∙","\\bullet",!0),cc(dc,hc,mc,"‡","\\ddagger"),cc(dc,hc,mc,"≀","\\wr",!0),cc(dc,hc,mc,"⨿","\\amalg"),cc(dc,hc,mc,"&","\\And"),cc(dc,hc,xc,"⟵","\\longleftarrow",!0),cc(dc,hc,xc,"⇐","\\Leftarrow",!0),cc(dc,hc,xc,"⟸","\\Longleftarrow",!0),cc(dc,hc,xc,"⟶","\\longrightarrow",!0),cc(dc,hc,xc,"⇒","\\Rightarrow",!0),cc(dc,hc,xc,"⟹","\\Longrightarrow",!0),cc(dc,hc,xc,"↔","\\leftrightarrow",!0),cc(dc,hc,xc,"⟷","\\longleftrightarrow",!0),cc(dc,hc,xc,"⇔","\\Leftrightarrow",!0),cc(dc,hc,xc,"⟺","\\Longleftrightarrow",!0),cc(dc,hc,xc,"↦","\\mapsto",!0),cc(dc,hc,xc,"⟼","\\longmapsto",!0),cc(dc,hc,xc,"↗","\\nearrow",!0),cc(dc,hc,xc,"↩","\\hookleftarrow",!0),cc(dc,hc,xc,"↪","\\hookrightarrow",!0),cc(dc,hc,xc,"↘","\\searrow",!0),cc(dc,hc,xc,"↼","\\leftharpoonup",!0),cc(dc,hc,xc,"⇀","\\rightharpoonup",!0),cc(dc,hc,xc,"↙","\\swarrow",!0),cc(dc,hc,xc,"↽","\\leftharpoondown",!0),cc(dc,hc,xc,"⇁","\\rightharpoondown",!0),cc(dc,hc,xc,"↖","\\nwarrow",!0),cc(dc,hc,xc,"⇌","\\rightleftharpoons",!0),cc(dc,pc,xc,"≮","\\nless",!0),cc(dc,pc,xc,"","\\@nleqslant"),cc(dc,pc,xc,"","\\@nleqq"),cc(dc,pc,xc,"⪇","\\lneq",!0),cc(dc,pc,xc,"≨","\\lneqq",!0),cc(dc,pc,xc,"","\\@lvertneqq"),cc(dc,pc,xc,"⋦","\\lnsim",!0),cc(dc,pc,xc,"⪉","\\lnapprox",!0),cc(dc,pc,xc,"⊀","\\nprec",!0),cc(dc,pc,xc,"⋠","\\npreceq",!0),cc(dc,pc,xc,"⋨","\\precnsim",!0),cc(dc,pc,xc,"⪹","\\precnapprox",!0),cc(dc,pc,xc,"≁","\\nsim",!0),cc(dc,pc,xc,"","\\@nshortmid"),cc(dc,pc,xc,"∤","\\nmid",!0),cc(dc,pc,xc,"⊬","\\nvdash",!0),cc(dc,pc,xc,"⊭","\\nvDash",!0),cc(dc,pc,xc,"⋪","\\ntriangleleft"),cc(dc,pc,xc,"⋬","\\ntrianglelefteq",!0),cc(dc,pc,xc,"⊊","\\subsetneq",!0),cc(dc,pc,xc,"","\\@varsubsetneq"),cc(dc,pc,xc,"⫋","\\subsetneqq",!0),cc(dc,pc,xc,"","\\@varsubsetneqq"),cc(dc,pc,xc,"≯","\\ngtr",!0),cc(dc,pc,xc,"","\\@ngeqslant"),cc(dc,pc,xc,"","\\@ngeqq"),cc(dc,pc,xc,"⪈","\\gneq",!0),cc(dc,pc,xc,"≩","\\gneqq",!0),cc(dc,pc,xc,"","\\@gvertneqq"),cc(dc,pc,xc,"⋧","\\gnsim",!0),cc(dc,pc,xc,"⪊","\\gnapprox",!0),cc(dc,pc,xc,"⊁","\\nsucc",!0),cc(dc,pc,xc,"⋡","\\nsucceq",!0),cc(dc,pc,xc,"⋩","\\succnsim",!0),cc(dc,pc,xc,"⪺","\\succnapprox",!0),cc(dc,pc,xc,"≆","\\ncong",!0),cc(dc,pc,xc,"","\\@nshortparallel"),cc(dc,pc,xc,"∦","\\nparallel",!0),cc(dc,pc,xc,"⊯","\\nVDash",!0),cc(dc,pc,xc,"⋫","\\ntriangleright"),cc(dc,pc,xc,"⋭","\\ntrianglerighteq",!0),cc(dc,pc,xc,"","\\@nsupseteqq"),cc(dc,pc,xc,"⊋","\\supsetneq",!0),cc(dc,pc,xc,"","\\@varsupsetneq"),cc(dc,pc,xc,"⫌","\\supsetneqq",!0),cc(dc,pc,xc,"","\\@varsupsetneqq"),cc(dc,pc,xc,"⊮","\\nVdash",!0),cc(dc,pc,xc,"⪵","\\precneqq",!0),cc(dc,pc,xc,"⪶","\\succneqq",!0),cc(dc,pc,xc,"","\\@nsubseteqq"),cc(dc,pc,mc,"⊴","\\unlhd"),cc(dc,pc,mc,"⊵","\\unrhd"),cc(dc,pc,xc,"↚","\\nleftarrow",!0),cc(dc,pc,xc,"↛","\\nrightarrow",!0),cc(dc,pc,xc,"⇍","\\nLeftarrow",!0),cc(dc,pc,xc,"⇏","\\nRightarrow",!0),cc(dc,pc,xc,"↮","\\nleftrightarrow",!0),cc(dc,pc,xc,"⇎","\\nLeftrightarrow",!0),cc(dc,pc,xc,"△","\\vartriangle"),cc(dc,pc,Sc,"ℏ","\\hslash"),cc(dc,pc,Sc,"▽","\\triangledown"),cc(dc,pc,Sc,"◊","\\lozenge"),cc(dc,pc,Sc,"Ⓢ","\\circledS"),cc(dc,pc,Sc,"®","\\circledR"),cc(uc,pc,Sc,"®","\\circledR"),cc(dc,pc,Sc,"∡","\\measuredangle",!0),cc(dc,pc,Sc,"∄","\\nexists"),cc(dc,pc,Sc,"℧","\\mho"),cc(dc,pc,Sc,"Ⅎ","\\Finv",!0),cc(dc,pc,Sc,"⅁","\\Game",!0),cc(dc,pc,Sc,"‵","\\backprime"),cc(dc,pc,Sc,"▲","\\blacktriangle"),cc(dc,pc,Sc,"▼","\\blacktriangledown"),cc(dc,pc,Sc,"■","\\blacksquare"),cc(dc,pc,Sc,"⧫","\\blacklozenge"),cc(dc,pc,Sc,"★","\\bigstar"),cc(dc,pc,Sc,"∢","\\sphericalangle",!0),cc(dc,pc,Sc,"∁","\\complement",!0),cc(dc,pc,Sc,"ð","\\eth",!0),cc(uc,hc,Sc,"ð","ð"),cc(dc,pc,Sc,"╱","\\diagup"),cc(dc,pc,Sc,"╲","\\diagdown"),cc(dc,pc,Sc,"□","\\square"),cc(dc,pc,Sc,"□","\\Box"),cc(dc,pc,Sc,"◊","\\Diamond"),cc(dc,pc,Sc,"¥","\\yen",!0),cc(uc,pc,Sc,"¥","\\yen",!0),cc(dc,pc,Sc,"✓","\\checkmark",!0),cc(uc,pc,Sc,"✓","\\checkmark"),cc(dc,pc,Sc,"ℶ","\\beth",!0),cc(dc,pc,Sc,"ℸ","\\daleth",!0),cc(dc,pc,Sc,"ℷ","\\gimel",!0),cc(dc,pc,Sc,"ϝ","\\digamma",!0),cc(dc,pc,Sc,"ϰ","\\varkappa"),cc(dc,pc,yc,"┌","\\@ulcorner",!0),cc(dc,pc,_c,"┐","\\@urcorner",!0),cc(dc,pc,yc,"└","\\@llcorner",!0),cc(dc,pc,_c,"┘","\\@lrcorner",!0),cc(dc,pc,xc,"≦","\\leqq",!0),cc(dc,pc,xc,"⩽","\\leqslant",!0),cc(dc,pc,xc,"⪕","\\eqslantless",!0),cc(dc,pc,xc,"≲","\\lesssim",!0),cc(dc,pc,xc,"⪅","\\lessapprox",!0),cc(dc,pc,xc,"≊","\\approxeq",!0),cc(dc,pc,mc,"⋖","\\lessdot"),cc(dc,pc,xc,"⋘","\\lll",!0),cc(dc,pc,xc,"≶","\\lessgtr",!0),cc(dc,pc,xc,"⋚","\\lesseqgtr",!0),cc(dc,pc,xc,"⪋","\\lesseqqgtr",!0),cc(dc,pc,xc,"≑","\\doteqdot"),cc(dc,pc,xc,"≓","\\risingdotseq",!0),cc(dc,pc,xc,"≒","\\fallingdotseq",!0),cc(dc,pc,xc,"∽","\\backsim",!0),cc(dc,pc,xc,"⋍","\\backsimeq",!0),cc(dc,pc,xc,"⫅","\\subseteqq",!0),cc(dc,pc,xc,"⋐","\\Subset",!0),cc(dc,pc,xc,"⊏","\\sqsubset",!0),cc(dc,pc,xc,"≼","\\preccurlyeq",!0),cc(dc,pc,xc,"⋞","\\curlyeqprec",!0),cc(dc,pc,xc,"≾","\\precsim",!0),cc(dc,pc,xc,"⪷","\\precapprox",!0),cc(dc,pc,xc,"⊲","\\vartriangleleft"),cc(dc,pc,xc,"⊴","\\trianglelefteq"),cc(dc,pc,xc,"⊨","\\vDash",!0),cc(dc,pc,xc,"⊪","\\Vvdash",!0),cc(dc,pc,xc,"⌣","\\smallsmile"),cc(dc,pc,xc,"⌢","\\smallfrown"),cc(dc,pc,xc,"≏","\\bumpeq",!0),cc(dc,pc,xc,"≎","\\Bumpeq",!0),cc(dc,pc,xc,"≧","\\geqq",!0),cc(dc,pc,xc,"⩾","\\geqslant",!0),cc(dc,pc,xc,"⪖","\\eqslantgtr",!0),cc(dc,pc,xc,"≳","\\gtrsim",!0),cc(dc,pc,xc,"⪆","\\gtrapprox",!0),cc(dc,pc,mc,"⋗","\\gtrdot"),cc(dc,pc,xc,"⋙","\\ggg",!0),cc(dc,pc,xc,"≷","\\gtrless",!0),cc(dc,pc,xc,"⋛","\\gtreqless",!0),cc(dc,pc,xc,"⪌","\\gtreqqless",!0),cc(dc,pc,xc,"≖","\\eqcirc",!0),cc(dc,pc,xc,"≗","\\circeq",!0),cc(dc,pc,xc,"≜","\\triangleq",!0),cc(dc,pc,xc,"∼","\\thicksim"),cc(dc,pc,xc,"≈","\\thickapprox"),cc(dc,pc,xc,"⫆","\\supseteqq",!0),cc(dc,pc,xc,"⋑","\\Supset",!0),cc(dc,pc,xc,"⊐","\\sqsupset",!0),cc(dc,pc,xc,"≽","\\succcurlyeq",!0),cc(dc,pc,xc,"⋟","\\curlyeqsucc",!0),cc(dc,pc,xc,"≿","\\succsim",!0),cc(dc,pc,xc,"⪸","\\succapprox",!0),cc(dc,pc,xc,"⊳","\\vartriangleright"),cc(dc,pc,xc,"⊵","\\trianglerighteq"),cc(dc,pc,xc,"⊩","\\Vdash",!0),cc(dc,pc,xc,"∣","\\shortmid"),cc(dc,pc,xc,"∥","\\shortparallel"),cc(dc,pc,xc,"≬","\\between",!0),cc(dc,pc,xc,"⋔","\\pitchfork",!0),cc(dc,pc,xc,"∝","\\varpropto"),cc(dc,pc,xc,"◀","\\blacktriangleleft"),cc(dc,pc,xc,"∴","\\therefore",!0),cc(dc,pc,xc,"∍","\\backepsilon"),cc(dc,pc,xc,"▶","\\blacktriangleright"),cc(dc,pc,xc,"∵","\\because",!0),cc(dc,pc,xc,"⋘","\\llless"),cc(dc,pc,xc,"⋙","\\gggtr"),cc(dc,pc,mc,"⊲","\\lhd"),cc(dc,pc,mc,"⊳","\\rhd"),cc(dc,pc,xc,"≂","\\eqsim",!0),cc(dc,hc,xc,"⋈","\\Join"),cc(dc,pc,xc,"≑","\\Doteq",!0),cc(dc,pc,mc,"∔","\\dotplus",!0),cc(dc,pc,mc,"∖","\\smallsetminus"),cc(dc,pc,mc,"⋒","\\Cap",!0),cc(dc,pc,mc,"⋓","\\Cup",!0),cc(dc,pc,mc,"⩞","\\doublebarwedge",!0),cc(dc,pc,mc,"⊟","\\boxminus",!0),cc(dc,pc,mc,"⊞","\\boxplus",!0),cc(dc,pc,mc,"⋇","\\divideontimes",!0),cc(dc,pc,mc,"⋉","\\ltimes",!0),cc(dc,pc,mc,"⋊","\\rtimes",!0),cc(dc,pc,mc,"⋋","\\leftthreetimes",!0),cc(dc,pc,mc,"⋌","\\rightthreetimes",!0),cc(dc,pc,mc,"⋏","\\curlywedge",!0),cc(dc,pc,mc,"⋎","\\curlyvee",!0),cc(dc,pc,mc,"⊝","\\circleddash",!0),cc(dc,pc,mc,"⊛","\\circledast",!0),cc(dc,pc,mc,"⋅","\\centerdot"),cc(dc,pc,mc,"⊺","\\intercal",!0),cc(dc,pc,mc,"⋒","\\doublecap"),cc(dc,pc,mc,"⋓","\\doublecup"),cc(dc,pc,mc,"⊠","\\boxtimes",!0),cc(dc,pc,xc,"⇢","\\dashrightarrow",!0),cc(dc,pc,xc,"⇠","\\dashleftarrow",!0),cc(dc,pc,xc,"⇇","\\leftleftarrows",!0),cc(dc,pc,xc,"⇆","\\leftrightarrows",!0),cc(dc,pc,xc,"⇚","\\Lleftarrow",!0),cc(dc,pc,xc,"↞","\\twoheadleftarrow",!0),cc(dc,pc,xc,"↢","\\leftarrowtail",!0),cc(dc,pc,xc,"↫","\\looparrowleft",!0),cc(dc,pc,xc,"⇋","\\leftrightharpoons",!0),cc(dc,pc,xc,"↶","\\curvearrowleft",!0),cc(dc,pc,xc,"↺","\\circlearrowleft",!0),cc(dc,pc,xc,"↰","\\Lsh",!0),cc(dc,pc,xc,"⇈","\\upuparrows",!0),cc(dc,pc,xc,"↿","\\upharpoonleft",!0),cc(dc,pc,xc,"⇃","\\downharpoonleft",!0),cc(dc,hc,xc,"⊶","\\origof",!0),cc(dc,hc,xc,"⊷","\\imageof",!0),cc(dc,pc,xc,"⊸","\\multimap",!0),cc(dc,pc,xc,"↭","\\leftrightsquigarrow",!0),cc(dc,pc,xc,"⇉","\\rightrightarrows",!0),cc(dc,pc,xc,"⇄","\\rightleftarrows",!0),cc(dc,pc,xc,"↠","\\twoheadrightarrow",!0),cc(dc,pc,xc,"↣","\\rightarrowtail",!0),cc(dc,pc,xc,"↬","\\looparrowright",!0),cc(dc,pc,xc,"↷","\\curvearrowright",!0),cc(dc,pc,xc,"↻","\\circlearrowright",!0),cc(dc,pc,xc,"↱","\\Rsh",!0),cc(dc,pc,xc,"⇊","\\downdownarrows",!0),cc(dc,pc,xc,"↾","\\upharpoonright",!0),cc(dc,pc,xc,"⇂","\\downharpoonright",!0),cc(dc,pc,xc,"⇝","\\rightsquigarrow",!0),cc(dc,pc,xc,"⇝","\\leadsto"),cc(dc,pc,xc,"⇛","\\Rrightarrow",!0),cc(dc,pc,xc,"↾","\\restriction"),cc(dc,hc,Sc,"‘","`"),cc(dc,hc,Sc,"$","\\$"),cc(uc,hc,Sc,"$","\\$"),cc(uc,hc,Sc,"$","\\textdollar"),cc(dc,hc,Sc,"%","\\%"),cc(uc,hc,Sc,"%","\\%"),cc(dc,hc,Sc,"_","\\_"),cc(uc,hc,Sc,"_","\\_"),cc(uc,hc,Sc,"_","\\textunderscore"),cc(dc,hc,Sc,"∠","\\angle",!0),cc(dc,hc,Sc,"∞","\\infty",!0),cc(dc,hc,Sc,"′","\\prime"),cc(dc,hc,Sc,"△","\\triangle"),cc(dc,hc,Sc,"Γ","\\Gamma",!0),cc(dc,hc,Sc,"Δ","\\Delta",!0),cc(dc,hc,Sc,"Θ","\\Theta",!0),cc(dc,hc,Sc,"Λ","\\Lambda",!0),cc(dc,hc,Sc,"Ξ","\\Xi",!0),cc(dc,hc,Sc,"Π","\\Pi",!0),cc(dc,hc,Sc,"Σ","\\Sigma",!0),cc(dc,hc,Sc,"Υ","\\Upsilon",!0),cc(dc,hc,Sc,"Φ","\\Phi",!0),cc(dc,hc,Sc,"Ψ","\\Psi",!0),cc(dc,hc,Sc,"Ω","\\Omega",!0),cc(dc,hc,Sc,"A","Α"),cc(dc,hc,Sc,"B","Β"),cc(dc,hc,Sc,"E","Ε"),cc(dc,hc,Sc,"Z","Ζ"),cc(dc,hc,Sc,"H","Η"),cc(dc,hc,Sc,"I","Ι"),cc(dc,hc,Sc,"K","Κ"),cc(dc,hc,Sc,"M","Μ"),cc(dc,hc,Sc,"N","Ν"),cc(dc,hc,Sc,"O","Ο"),cc(dc,hc,Sc,"P","Ρ"),cc(dc,hc,Sc,"T","Τ"),cc(dc,hc,Sc,"X","Χ"),cc(dc,hc,Sc,"¬","\\neg",!0),cc(dc,hc,Sc,"¬","\\lnot"),cc(dc,hc,Sc,"⊤","\\top"),cc(dc,hc,Sc,"⊥","\\bot"),cc(dc,hc,Sc,"∅","\\emptyset"),cc(dc,pc,Sc,"∅","\\varnothing"),cc(dc,hc,bc,"α","\\alpha",!0),cc(dc,hc,bc,"β","\\beta",!0),cc(dc,hc,bc,"γ","\\gamma",!0),cc(dc,hc,bc,"δ","\\delta",!0),cc(dc,hc,bc,"ϵ","\\epsilon",!0),cc(dc,hc,bc,"ζ","\\zeta",!0),cc(dc,hc,bc,"η","\\eta",!0),cc(dc,hc,bc,"θ","\\theta",!0),cc(dc,hc,bc,"ι","\\iota",!0),cc(dc,hc,bc,"κ","\\kappa",!0),cc(dc,hc,bc,"λ","\\lambda",!0),cc(dc,hc,bc,"μ","\\mu",!0),cc(dc,hc,bc,"ν","\\nu",!0),cc(dc,hc,bc,"ξ","\\xi",!0),cc(dc,hc,bc,"ο","\\omicron",!0),cc(dc,hc,bc,"π","\\pi",!0),cc(dc,hc,bc,"ρ","\\rho",!0),cc(dc,hc,bc,"σ","\\sigma",!0),cc(dc,hc,bc,"τ","\\tau",!0),cc(dc,hc,bc,"υ","\\upsilon",!0),cc(dc,hc,bc,"ϕ","\\phi",!0),cc(dc,hc,bc,"χ","\\chi",!0),cc(dc,hc,bc,"ψ","\\psi",!0),cc(dc,hc,bc,"ω","\\omega",!0),cc(dc,hc,bc,"ε","\\varepsilon",!0),cc(dc,hc,bc,"ϑ","\\vartheta",!0),cc(dc,hc,bc,"ϖ","\\varpi",!0),cc(dc,hc,bc,"ϱ","\\varrho",!0),cc(dc,hc,bc,"ς","\\varsigma",!0),cc(dc,hc,bc,"φ","\\varphi",!0),cc(dc,hc,mc,"∗","*",!0),cc(dc,hc,mc,"+","+"),cc(dc,hc,mc,"−","-",!0),cc(dc,hc,mc,"⋅","\\cdot",!0),cc(dc,hc,mc,"∘","\\circ",!0),cc(dc,hc,mc,"÷","\\div",!0),cc(dc,hc,mc,"±","\\pm",!0),cc(dc,hc,mc,"×","\\times",!0),cc(dc,hc,mc,"∩","\\cap",!0),cc(dc,hc,mc,"∪","\\cup",!0),cc(dc,hc,mc,"∖","\\setminus",!0),cc(dc,hc,mc,"∧","\\land"),cc(dc,hc,mc,"∨","\\lor"),cc(dc,hc,mc,"∧","\\wedge",!0),cc(dc,hc,mc,"∨","\\vee",!0),cc(dc,hc,Sc,"√","\\surd"),cc(dc,hc,yc,"⟨","\\langle",!0),cc(dc,hc,yc,"∣","\\lvert"),cc(dc,hc,yc,"∥","\\lVert"),cc(dc,hc,_c,"?","?"),cc(dc,hc,_c,"!","!"),cc(dc,hc,_c,"⟩","\\rangle",!0),cc(dc,hc,_c,"∣","\\rvert"),cc(dc,hc,_c,"∥","\\rVert"),cc(dc,hc,xc,"=","="),cc(dc,hc,xc,":",":"),cc(dc,hc,xc,"≈","\\approx",!0),cc(dc,hc,xc,"≅","\\cong",!0),cc(dc,hc,xc,"≥","\\ge"),cc(dc,hc,xc,"≥","\\geq",!0),cc(dc,hc,xc,"←","\\gets"),cc(dc,hc,xc,">","\\gt",!0),cc(dc,hc,xc,"∈","\\in",!0),cc(dc,hc,xc,"","\\@not"),cc(dc,hc,xc,"⊂","\\subset",!0),cc(dc,hc,xc,"⊃","\\supset",!0),cc(dc,hc,xc,"⊆","\\subseteq",!0),cc(dc,hc,xc,"⊇","\\supseteq",!0),cc(dc,pc,xc,"⊈","\\nsubseteq",!0),cc(dc,pc,xc,"⊉","\\nsupseteq",!0),cc(dc,hc,xc,"⊨","\\models"),cc(dc,hc,xc,"←","\\leftarrow",!0),cc(dc,hc,xc,"≤","\\le"),cc(dc,hc,xc,"≤","\\leq",!0),cc(dc,hc,xc,"<","\\lt",!0),cc(dc,hc,xc,"→","\\rightarrow",!0),cc(dc,hc,xc,"→","\\to"),cc(dc,pc,xc,"≱","\\ngeq",!0),cc(dc,pc,xc,"≰","\\nleq",!0),cc(dc,hc,kc," ","\\ "),cc(dc,hc,kc," ","\\space"),cc(dc,hc,kc," ","\\nobreakspace"),cc(uc,hc,kc," ","\\ "),cc(uc,hc,kc," "," "),cc(uc,hc,kc," ","\\space"),cc(uc,hc,kc," ","\\nobreakspace"),cc(dc,hc,kc,null,"\\nobreak"),cc(dc,hc,kc,null,"\\allowbreak"),cc(dc,hc,wc,",",","),cc(dc,hc,wc,";",";"),cc(dc,pc,mc,"⊼","\\barwedge",!0),cc(dc,pc,mc,"⊻","\\veebar",!0),cc(dc,hc,mc,"⊙","\\odot",!0),cc(dc,hc,mc,"⊕","\\oplus",!0),cc(dc,hc,mc,"⊗","\\otimes",!0),cc(dc,hc,Sc,"∂","\\partial",!0),cc(dc,hc,mc,"⊘","\\oslash",!0),cc(dc,pc,mc,"⊚","\\circledcirc",!0),cc(dc,pc,mc,"⊡","\\boxdot",!0),cc(dc,hc,mc,"△","\\bigtriangleup"),cc(dc,hc,mc,"▽","\\bigtriangledown"),cc(dc,hc,mc,"†","\\dagger"),cc(dc,hc,mc,"⋄","\\diamond"),cc(dc,hc,mc,"⋆","\\star"),cc(dc,hc,mc,"◃","\\triangleleft"),cc(dc,hc,mc,"▹","\\triangleright"),cc(dc,hc,yc,"{","\\{"),cc(uc,hc,Sc,"{","\\{"),cc(uc,hc,Sc,"{","\\textbraceleft"),cc(dc,hc,_c,"}","\\}"),cc(uc,hc,Sc,"}","\\}"),cc(uc,hc,Sc,"}","\\textbraceright"),cc(dc,hc,yc,"{","\\lbrace"),cc(dc,hc,_c,"}","\\rbrace"),cc(dc,hc,yc,"[","\\lbrack",!0),cc(uc,hc,Sc,"[","\\lbrack",!0),cc(dc,hc,_c,"]","\\rbrack",!0),cc(uc,hc,Sc,"]","\\rbrack",!0),cc(dc,hc,yc,"(","\\lparen",!0),cc(dc,hc,_c,")","\\rparen",!0),cc(uc,hc,Sc,"<","\\textless",!0),cc(uc,hc,Sc,">","\\textgreater",!0),cc(dc,hc,yc,"⌊","\\lfloor",!0),cc(dc,hc,_c,"⌋","\\rfloor",!0),cc(dc,hc,yc,"⌈","\\lceil",!0),cc(dc,hc,_c,"⌉","\\rceil",!0),cc(dc,hc,Sc,"\\","\\backslash"),cc(dc,hc,Sc,"∣","|"),cc(dc,hc,Sc,"∣","\\vert"),cc(uc,hc,Sc,"|","\\textbar",!0),cc(dc,hc,Sc,"∥","\\|"),cc(dc,hc,Sc,"∥","\\Vert"),cc(uc,hc,Sc,"∥","\\textbardbl"),cc(uc,hc,Sc,"~","\\textasciitilde"),cc(uc,hc,Sc,"\\","\\textbackslash"),cc(uc,hc,Sc,"^","\\textasciicircum"),cc(dc,hc,xc,"↑","\\uparrow",!0),cc(dc,hc,xc,"⇑","\\Uparrow",!0),cc(dc,hc,xc,"↓","\\downarrow",!0),cc(dc,hc,xc,"⇓","\\Downarrow",!0),cc(dc,hc,xc,"↕","\\updownarrow",!0),cc(dc,hc,xc,"⇕","\\Updownarrow",!0),cc(dc,hc,vc,"∐","\\coprod"),cc(dc,hc,vc,"⋁","\\bigvee"),cc(dc,hc,vc,"⋀","\\bigwedge"),cc(dc,hc,vc,"⨄","\\biguplus"),cc(dc,hc,vc,"⋂","\\bigcap"),cc(dc,hc,vc,"⋃","\\bigcup"),cc(dc,hc,vc,"∫","\\int"),cc(dc,hc,vc,"∫","\\intop"),cc(dc,hc,vc,"∬","\\iint"),cc(dc,hc,vc,"∭","\\iiint"),cc(dc,hc,vc,"∏","\\prod"),cc(dc,hc,vc,"∑","\\sum"),cc(dc,hc,vc,"⨂","\\bigotimes"),cc(dc,hc,vc,"⨁","\\bigoplus"),cc(dc,hc,vc,"⨀","\\bigodot"),cc(dc,hc,vc,"∮","\\oint"),cc(dc,hc,vc,"∯","\\oiint"),cc(dc,hc,vc,"∰","\\oiiint"),cc(dc,hc,vc,"⨆","\\bigsqcup"),cc(dc,hc,vc,"∫","\\smallint"),cc(uc,hc,gc,"…","\\textellipsis"),cc(dc,hc,gc,"…","\\mathellipsis"),cc(uc,hc,gc,"…","\\ldots",!0),cc(dc,hc,gc,"…","\\ldots",!0),cc(dc,hc,gc,"⋯","\\@cdots",!0),cc(dc,hc,gc,"⋱","\\ddots",!0),cc(dc,hc,Sc,"⋮","\\varvdots"),cc(uc,hc,Sc,"⋮","\\varvdots"),cc(dc,hc,fc,"ˊ","\\acute"),cc(dc,hc,fc,"ˋ","\\grave"),cc(dc,hc,fc,"¨","\\ddot"),cc(dc,hc,fc,"~","\\tilde"),cc(dc,hc,fc,"ˉ","\\bar"),cc(dc,hc,fc,"˘","\\breve"),cc(dc,hc,fc,"ˇ","\\check"),cc(dc,hc,fc,"^","\\hat"),cc(dc,hc,fc,"⃗","\\vec"),cc(dc,hc,fc,"˙","\\dot"),cc(dc,hc,fc,"˚","\\mathring"),cc(dc,hc,bc,"","\\@imath"),cc(dc,hc,bc,"","\\@jmath"),cc(dc,hc,Sc,"ı","ı"),cc(dc,hc,Sc,"ȷ","ȷ"),cc(uc,hc,Sc,"ı","\\i",!0),cc(uc,hc,Sc,"ȷ","\\j",!0),cc(uc,hc,Sc,"ß","\\ss",!0),cc(uc,hc,Sc,"æ","\\ae",!0),cc(uc,hc,Sc,"œ","\\oe",!0),cc(uc,hc,Sc,"ø","\\o",!0),cc(uc,hc,Sc,"Æ","\\AE",!0),cc(uc,hc,Sc,"Œ","\\OE",!0),cc(uc,hc,Sc,"Ø","\\O",!0),cc(uc,hc,fc,"ˊ","\\'"),cc(uc,hc,fc,"ˋ","\\`"),cc(uc,hc,fc,"ˆ","\\^"),cc(uc,hc,fc,"˜","\\~"),cc(uc,hc,fc,"ˉ","\\="),cc(uc,hc,fc,"˘","\\u"),cc(uc,hc,fc,"˙","\\."),cc(uc,hc,fc,"¸","\\c"),cc(uc,hc,fc,"˚","\\r"),cc(uc,hc,fc,"ˇ","\\v"),cc(uc,hc,fc,"¨",'\\"'),cc(uc,hc,fc,"˝","\\H"),cc(uc,hc,fc,"◯","\\textcircled");var Cc={"--":!0,"---":!0,"``":!0,"''":!0};cc(uc,hc,Sc,"–","--",!0),cc(uc,hc,Sc,"–","\\textendash"),cc(uc,hc,Sc,"—","---",!0),cc(uc,hc,Sc,"—","\\textemdash"),cc(uc,hc,Sc,"‘","`",!0),cc(uc,hc,Sc,"‘","\\textquoteleft"),cc(uc,hc,Sc,"’","'",!0),cc(uc,hc,Sc,"’","\\textquoteright"),cc(uc,hc,Sc,"“","``",!0),cc(uc,hc,Sc,"“","\\textquotedblleft"),cc(uc,hc,Sc,"”","''",!0),cc(uc,hc,Sc,"”","\\textquotedblright"),cc(dc,hc,Sc,"°","\\degree",!0),cc(uc,hc,Sc,"°","\\degree"),cc(uc,hc,Sc,"°","\\textdegree",!0),cc(dc,hc,Sc,"£","\\pounds"),cc(dc,hc,Sc,"£","\\mathsterling",!0),cc(uc,hc,Sc,"£","\\pounds"),cc(uc,hc,Sc,"£","\\textsterling",!0),cc(dc,pc,Sc,"✠","\\maltese"),cc(uc,pc,Sc,"✠","\\maltese");for(var Mc=0;Mc<14;Mc++){var Tc='0123456789/@."'.charAt(Mc);cc(dc,hc,Sc,Tc,Tc)}for(var Lc=0;Lc<25;Lc++){var zc='0123456789!@*()-=+";:?/.,'.charAt(Lc);cc(uc,hc,Sc,zc,zc)}for(var Ac="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Pc=0;Pc<52;Pc++){var Rc=Ac.charAt(Pc);cc(dc,hc,bc,Rc,Rc),cc(uc,hc,Sc,Rc,Rc)}cc(dc,pc,Sc,"C","ℂ"),cc(uc,pc,Sc,"C","ℂ"),cc(dc,pc,Sc,"H","ℍ"),cc(uc,pc,Sc,"H","ℍ"),cc(dc,pc,Sc,"N","ℕ"),cc(uc,pc,Sc,"N","ℕ"),cc(dc,pc,Sc,"P","ℙ"),cc(uc,pc,Sc,"P","ℙ"),cc(dc,pc,Sc,"Q","ℚ"),cc(uc,pc,Sc,"Q","ℚ"),cc(dc,pc,Sc,"R","ℝ"),cc(uc,pc,Sc,"R","ℝ"),cc(dc,pc,Sc,"Z","ℤ"),cc(uc,pc,Sc,"Z","ℤ"),cc(dc,hc,bc,"h","ℎ"),cc(uc,hc,bc,"h","ℎ");for(var Nc="",Ec=0;Ec<52;Ec++){var Oc=Ac.charAt(Ec);cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56320+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56372+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56424+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56580+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56684+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56736+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56788+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56840+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56944+Ec)),cc(uc,hc,Sc,Oc,Nc),Ec<26&&(cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56632+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56476+Ec)),cc(uc,hc,Sc,Oc,Nc))}cc(dc,hc,bc,"k",Nc=String.fromCharCode(55349,56668)),cc(uc,hc,Sc,"k",Nc);for(var Ic=0;Ic<10;Ic++){var Bc=Ic.toString();cc(dc,hc,bc,Bc,Nc=String.fromCharCode(55349,57294+Ic)),cc(uc,hc,Sc,Bc,Nc),cc(dc,hc,bc,Bc,Nc=String.fromCharCode(55349,57314+Ic)),cc(uc,hc,Sc,Bc,Nc),cc(dc,hc,bc,Bc,Nc=String.fromCharCode(55349,57324+Ic)),cc(uc,hc,Sc,Bc,Nc),cc(dc,hc,bc,Bc,Nc=String.fromCharCode(55349,57334+Ic)),cc(uc,hc,Sc,Bc,Nc)}for(var Dc=0;Dc<3;Dc++){var Vc="ÐÞþ".charAt(Dc);cc(dc,hc,bc,Vc,Vc),cc(uc,hc,Sc,Vc,Vc)}var Hc=[["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"]],jc=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Fc=function(e,t,n){return lc[n][e]&&lc[n][e].replace&&(e=lc[n][e].replace),{value:e,metrics:Ol(e,t,n)}},Uc=function(e,t,n,r,i){var s,o=Fc(e,t,n),a=o.metrics;if(e=o.value,a){var l=a.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),s=new tc(e,a.height,a.depth,l,a.skew,a.width,i)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),s=new tc(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push("mtight");var c=r.getColor();c&&(s.style.color=c)}return s},qc=(e,t)=>{if(Gl(e.classes)!==Gl(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 r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},$c=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var s=e.children[i];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>r&&(r=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Gc=function(e,t,n,r){var i=new Zl(e,t,n,r);return $c(i),i},Xc=(e,t,n,r)=>new Zl(e,t,n,r),Kc=function(e){var t=new Pl(e);return $c(t),t},Wc=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},Yc={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"}},Zc={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Qc={fontMap:Yc,makeSymbol:Uc,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&Fc(e,"Main-Bold",t).metrics?Uc(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===lc[t][e].font?Uc(e,"Main-Regular",t,n,r):Uc(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:Gc,makeSvgSpan:Xc,makeLineSpan:function(e,t,n){var r=Gc([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=$l(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var i=new Ql(e,t,n,r);return $c(i),i},makeFragment:Kc,wrapFragment:function(e,t){return e instanceof Pl?Gc([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,s=1;s<t.length;s++){var o=-t[s].shift-i-t[s].elem.depth,a=o-(t[s-1].elem.height+t[s-1].elem.depth);i+=o,n.push({type:"kern",size:a}),n.push(t[s])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),i=0,s=0;s<n.length;s++){var o=n[s];if("elem"===o.type){var a=o.elem;i=Math.max(i,a.maxFontSize,a.height)}}i+=2;var l=Gc(["pstrut"],[]);l.style.height=$l(i);for(var c=[],d=r,u=r,h=r,p=0;p<n.length;p++){var f=n[p];if("kern"===f.type)h+=f.size;else{var m=f.elem,_=f.wrapperClasses||[],g=f.wrapperStyle||{},b=Gc(_,[l,m],void 0,g);b.style.top=$l(-i-h-m.depth),f.marginLeft&&(b.style.marginLeft=f.marginLeft),f.marginRight&&(b.style.marginRight=f.marginRight),c.push(b),h+=m.height+m.depth}d=Math.min(d,h),u=Math.max(u,h)}var v,y=Gc(["vlist"],c);if(y.style.height=$l(u),d<0){var w=Gc([],[]),x=Gc(["vlist"],[w]);x.style.height=$l(-d);var k=Gc(["vlist-s"],[new tc("")]);v=[Gc(["vlist-r"],[y,k]),Gc(["vlist-r"],[x])]}else v=[Gc(["vlist-r"],[y])];var S=Gc(["vlist-t"],v);return 2===v.length&&S.classes.push("vlist-t2"),S.height=u,S.depth=-d,S},makeOrd:function(e,t,n){var r=e.mode,i=e.text,s=["mord"],o="math"===r||"text"===r&&t.font,a=o?t.font:t.fontFamily,l="",c="";if(55349===i.charCodeAt(0)&&([l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,r="math"===t?0:1;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return[Hc[i][2],Hc[i][r]]}if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return[jc[s][2],jc[s][r]]}if(120485===n||120486===n)return[Hc[0][2],Hc[0][r]];if(120486<n&&n<120782)return["",""];throw new rl("Unsupported character: "+e)}(i,r)),l.length>0)return Uc(i,l,r,t,s.concat(c));if(a){var d,u;if("boldsymbol"===a){var h=function(e,t,n,r,i){return"textord"!==i&&Fc(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(i,r,0,0,n);d=h.fontName,u=[h.fontClass]}else o?(d=Yc[a].fontName,u=[a]):(d=Wc(a,t.fontWeight,t.fontShape),u=[a,t.fontWeight,t.fontShape]);if(Fc(i,d,r).metrics)return Uc(i,d,r,t,s.concat(u));if(Cc.hasOwnProperty(i)&&"Typewriter"===d.slice(0,10)){for(var p=[],f=0;f<i.length;f++)p.push(Uc(i[f],d,r,t,s.concat(u)));return Kc(p)}}if("mathord"===n)return Uc(i,"Math-Italic",r,t,s.concat(["mathnormal"]));if("textord"===n){var m=lc[r][i]&&lc[r][i].font;if("ams"===m){var _=Wc("amsrm",t.fontWeight,t.fontShape);return Uc(i,_,r,t,s.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==m&&m){var g=Wc(m,t.fontWeight,t.fontShape);return Uc(i,g,r,t,s.concat(g,t.fontWeight,t.fontShape))}var b=Wc("textrm",t.fontWeight,t.fontShape);return Uc(i,b,r,t,s.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=Gc(["mspace"],[],t),r=ql(e,t);return n.style.marginRight=$l(r),n},staticSvg:function(e,t){var[n,r,i]=Zc[e],s=new rc(n),o=new nc([s],{width:$l(r),height:$l(i),style:"width:"+$l(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),a=Xc(["overlay"],[o],t);return a.height=i,a.style.height=$l(i),a.style.width=$l(r),a},svgData:Zc,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof tc&&r instanceof tc&&qc(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e}},Jc={number:3,unit:"mu"},ed={number:4,unit:"mu"},td={number:5,unit:"mu"},nd={mord:{mop:Jc,mbin:ed,mrel:td,minner:Jc},mop:{mord:Jc,mop:Jc,mrel:td,minner:Jc},mbin:{mord:ed,mop:ed,mopen:ed,minner:ed},mrel:{mord:td,mop:td,mopen:td,minner:td},mopen:{},mclose:{mop:Jc,mbin:ed,mrel:td,minner:Jc},mpunct:{mord:Jc,mop:Jc,mrel:td,mopen:Jc,mclose:Jc,mpunct:Jc,minner:Jc},minner:{mord:Jc,mop:Jc,mbin:ed,mrel:td,mopen:Jc,mpunct:Jc,minner:Jc}},rd={mord:{mop:Jc},mop:{mord:Jc,mop:Jc},mbin:{},mrel:{},mopen:{},mclose:{mop:Jc},mpunct:{},minner:{mop:Jc}},id={},sd={},od={};function ad(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)id[n[l]]=a;t&&(s&&(sd[t]=s),o&&(od[t]=o))}function ld(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;ad({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var cd=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},dd=function(e){return"ordgroup"===e.type?e.body:[e]},ud=Qc.makeSpan,hd=["leftmost","mbin","mopen","mrel","mop","mpunct"],pd=["rightmost","mrel","mclose","mpunct"],fd={display:Ml.DISPLAY,text:Ml.TEXT,script:Ml.SCRIPT,scriptscript:Ml.SCRIPTSCRIPT},md={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},_d=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var i=[],s=0;s<e.length;s++){var o=xd(e[s],t);if(o instanceof Pl){var a=o.children;i.push(...a)}else i.push(o)}if(Qc.tryCombineChars(i),!n)return i;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(fd[c.style]))}var d=ud([r[0]||"leftmost"],[],t),u=ud([r[1]||"rightmost"],[],t),h="root"===n;return gd(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&ll(pd,r)?t.classes[0]="mord":"mbin"===r&&ll(hd,n)&&(e.classes[0]="mord")},{node:d},u,h),gd(i,(e,t)=>{var n=yd(t),r=yd(e),i=n&&r?e.hasClass("mtight")?rd[n][r]:nd[n][r]:null;if(i)return Qc.makeGlue(i,l)},{node:d},u,h),i},gd=function e(t,n,r,i,s){i&&t.push(i);for(var o=0;o<t.length;o++){var a=t[o],l=bd(a);if(l)e(l.children,n,r,null,s);else{var c=!a.hasClass("mspace");if(c){var d=n(a,r.node);d&&(r.insertAfter?r.insertAfter(d):(t.unshift(d),o++))}c?r.node=a:s&&a.hasClass("newline")&&(r.node=ud(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),o++})(o)}}i&&t.pop()},bd=function(e){return e instanceof Pl||e instanceof Ql||e instanceof Zl&&e.hasClass("enclosing")?e:null},vd=function e(t,n){var r=bd(t);if(r){var i=r.children;if(i.length){if("right"===n)return e(i[i.length-1],"right");if("left"===n)return e(i[0],"left")}}return t},yd=function(e,t){return e?(t&&(e=vd(e,t)),md[e.classes[0]]||null):null},wd=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return ud(t.concat(n))},xd=function(e,t,n){if(!e)return ud();if(sd[e.type]){var r=sd[e.type](e,t);if(n&&t.size!==n.size){r=ud(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new rl("Got group of unknown type: '"+e.type+"'")};function kd(e,t){var n=ud(["base"],e,t),r=ud(["strut"]);return r.style.height=$l(n.height+n.depth),n.depth&&(r.style.verticalAlign=$l(-n.depth)),n.children.unshift(r),n}function Sd(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,i=_d(e,t,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var s,o=[],a=[],l=0;l<i.length;l++)if(a.push(i[l]),i[l].hasClass("mbin")||i[l].hasClass("mrel")||i[l].hasClass("allowbreak")){for(var c=!1;l<i.length-1&&i[l+1].hasClass("mspace")&&!i[l+1].hasClass("newline");)l++,a.push(i[l]),i[l].hasClass("nobreak")&&(c=!0);c||(o.push(kd(a,t)),a=[])}else i[l].hasClass("newline")&&(a.pop(),a.length>0&&(o.push(kd(a,t)),a=[]),o.push(i[l]));a.length>0&&o.push(kd(a,t)),n?((s=kd(_d(n,t,!0))).classes=["tag"],o.push(s)):r&&o.push(r);var d=ud(["katex-html"],o);if(d.setAttribute("aria-hidden","true"),s){var u=s.children[0];u.style.height=$l(d.height+d.depth),d.depth&&(u.style.verticalAlign=$l(-d.depth))}return d}function Cd(e){return new Pl(e)}class Md{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=Gl(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Td&&this.children[n+1]instanceof Td){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Td;)r+=this.children[++n].toText();e.appendChild(new Td(r).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+=dl(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+dl(Gl(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 Td{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return dl(this.toText())}toText(){return this.text}}var Ld={MathNode:Md,TextNode:Td,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",$l(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+$l(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:Cd},zd=function(e,t,n){return!lc[t][e]||!lc[t][e].replace||55349===e.charCodeAt(0)||Cc.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=lc[t][e].replace),new Ld.TextNode(e)},Ad=function(e){return 1===e.length?e[0]:new Ld.MathNode("mrow",e)},Pd=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 r=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 i=e.text;return ll(["\\imath","\\jmath"],i)?null:(lc[r][i]&&lc[r][i].replace&&(i=lc[r][i].replace),Ol(i,Qc.fontMap[n].fontName,r)?Qc.fontMap[n].variant:null)};function Rd(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof Td&&"."===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 Td&&","===n.text}return!1}var Nd=function(e,t,n){if(1===e.length){var r=Od(e[0],t);return n&&r instanceof Md&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,s=[],o=0;o<e.length;o++){var a=Od(e[o],t);if(a instanceof Md&&i instanceof Md){if("mtext"===a.type&&"mtext"===i.type&&a.getAttribute("mathvariant")===i.getAttribute("mathvariant")){i.children.push(...a.children);continue}if("mn"===a.type&&"mn"===i.type){i.children.push(...a.children);continue}if(Rd(a)&&"mn"===i.type){i.children.push(...a.children);continue}if("mn"===a.type&&Rd(i))a.children=[...i.children,...a.children],s.pop();else if(("msup"===a.type||"msub"===a.type)&&a.children.length>=1&&("mn"===i.type||Rd(i))){var l=a.children[0];l instanceof Md&&"mn"===l.type&&(l.children=[...i.children,...l.children],s.pop())}else if("mi"===i.type&&1===i.children.length){var c=i.children[0];if(c instanceof Td&&"̸"===c.text&&("mo"===a.type||"mi"===a.type||"mn"===a.type)){var d=a.children[0];d instanceof Td&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(a),i=a}return s},Ed=function(e,t,n){return Ad(Nd(e,t,n))},Od=function(e,t){if(!e)return new Ld.MathNode("mrow");if(od[e.type])return od[e.type](e,t);throw new rl("Got group of unknown type: '"+e.type+"'")};function Id(e,t,n,r,i){var s,o=Nd(e,n);s=1===o.length&&o[0]instanceof Md&&ll(["mrow","mtable"],o[0].type)?o[0]:new Ld.MathNode("mrow",o);var a=new Ld.MathNode("annotation",[new Ld.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new Ld.MathNode("semantics",[s,a]),c=new Ld.MathNode("math",[l]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block"),Qc.makeSpan([i?"katex":"katex-mathml"],[c])}var Bd={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":"="},Dd={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]},Vd=function(e){var t=new Ld.MathNode("mo",[new Ld.TextNode(Bd[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Hd=function(e,t){var{span:n,minWidth:r,height:i}=function(){var n=4e5,r=e.label.slice(1);if(ll(["widehat","widecheck","widetilde","utilde"],r)){var i,s,o,a="ordgroup"===(p=e.base).type?p.body.length:1;if(a>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,o=.42,s=r+"4"):(i=312,n=2340,o=.34,s="tilde4");else{var l=[1,1,2,2,3,3][a];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],o=[0,.24,.3,.3,.36,.42][l],s=r+l):(n=[0,600,1033,2339,2340][l],i=[0,260,286,306,312][l],o=[0,.26,.286,.3,.306,.34][l],s="tilde"+l)}var c=new rc(s),d=new nc([c],{width:"100%",height:$l(o),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:Qc.makeSvgSpan([],[d],t),minWidth:0,height:o}}var u,h,p,f=[],m=Dd[r],[_,g,b]=m,v=b/1e3,y=_.length;if(1===y)u=["hide-tail"],h=[m[3]];else if(2===y)u=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{if(3!==y)throw new Error("Correct katexImagesData or update code here to support\n "+y+" children.");u=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<y;w++){var x=new rc(_[w]),k=new nc([x],{width:"400em",height:$l(v),viewBox:"0 0 "+n+" "+b,preserveAspectRatio:h[w]+" slice"}),S=Qc.makeSvgSpan([u[w]],[k],t);if(1===y)return{span:S,minWidth:g,height:v};S.style.height=$l(v),f.push(S)}return{span:Qc.makeSpan(["stretchy"],f,t),minWidth:g,height:v}}();return n.height=i,n.style.height=$l(i),r>0&&(n.style.minWidth=$l(r)),n};function jd(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 Fd(e){var t=Ud(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 Ud(e){return e&&("atom"===e.type||ac.hasOwnProperty(e.type))?e:null}var qd=(e,t)=>{var n,r,i;e&&"supsub"===e.type?(n=(r=jd(e.base,"accent")).base,e.base=n,i=function(e){if(e instanceof Zl)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(xd(e,t)),e.base=r):n=(r=jd(e,"accent")).base;var s=xd(n,t.havingCrampedStyle()),o=0;if(r.isShifty&&pl(n)){var a=hl(n);o=sc(xd(a,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,d=c?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(r.isStretchy)l=Hd(r,t),l=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+$l(2*o)+")",marginLeft:$l(2*o)}:void 0}]},t);else{var u,h;"\\vec"===r.label?(u=Qc.staticSvg("vec",t),h=Qc.svgData.vec[1]):((u=sc(u=Qc.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,h=u.width,c&&(d+=u.depth)),l=Qc.makeSpan(["accent-body"],[u]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),d=s.height);var f=o;p||(f-=h/2),l.style.left=$l(f),"\\textcircled"===r.label&&(l.style.top=".2em"),l=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:l}]},t)}var m=Qc.makeSpan(["mord","accent"],[l],t);return i?(i.children[0]=m,i.height=Math.max(m.height,i.height),i.classes[0]="mord",i):m},$d=(e,t)=>{var n=e.isStretchy?Vd(e.label):new Ld.MathNode("mo",[zd(e.label,e.mode)]),r=new Ld.MathNode("mover",[Od(e.base,t),n]);return r.setAttribute("accent","true"),r},Gd=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ad({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=cd(t[0]),r=!Gd.test(e.funcName),i=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:qd,mathmlBuilder:$d}),ad({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],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:qd,mathmlBuilder:$d}),ad({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=xd(e.base,t),r=Hd(e,t),i="\\utilde"===e.label?.12:0,s=Qc.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},t);return Qc.makeSpan(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{var n=Vd(e.label),r=new Ld.MathNode("munder",[Od(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Xd=e=>{var t=new Ld.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ad({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:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,i=t.havingStyle(r.sup()),s=Qc.wrapFragment(xd(e.body,i,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";s.classes.push(o+"-arrow-pad"),e.below&&(i=t.havingStyle(r.sub()),(n=Qc.wrapFragment(xd(e.below,i,t),t)).classes.push(o+"-arrow-pad"));var a,l=Hd(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 u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;a=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:u}]},t)}else a=Qc.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"),Qc.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var n,r=Vd(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var i=Xd(Od(e.body,t));if(e.below){var s=Xd(Od(e.below,t));n=new Ld.MathNode("munderover",[r,s,i])}else n=new Ld.MathNode("mover",[r,i])}else if(e.below){var o=Xd(Od(e.below,t));n=new Ld.MathNode("munder",[r,o])}else n=Xd(),n=new Ld.MathNode("mover",[r,n]);return n}});var Kd=Qc.makeSpan;function Wd(e,t){var n=_d(e.body,t,!0);return Kd([e.mclass],n,t)}function Yd(e,t){var n,r=Nd(e.body,t);return"minner"===e.mclass?n=new Ld.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new Ld.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new Ld.MathNode("mo",r),"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}ad({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:dd(i),isCharacterBox:pl(i)}},htmlBuilder:Wd,mathmlBuilder:Yd});var Zd=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};ad({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Zd(t[0]),body:dd(t[1]),isCharacterBox:pl(t[1])}}}),ad({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:i}=e,s=t[1],o=t[0];n="\\stackrel"!==i?Zd(s):"mrel";var a={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:dd(s)},l={type:"supsub",mode:o.mode,base:a,sup:"\\underset"===i?null:o,sub:"\\underset"===i?o:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:pl(l)}},htmlBuilder:Wd,mathmlBuilder:Yd}),ad({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Zd(t[0]),body:dd(t[0])}},htmlBuilder(e,t){var n=_d(e.body,t,!0),r=Qc.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Nd(e.body,t),r=new Ld.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Qd={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Jd=()=>({type:"styling",body:[],mode:"math",style:"display"}),eu=e=>"textord"===e.type&&"@"===e.text,tu=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function nu(e,t,n){var r=Qd[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:r,mode:"math",family:"rel"},s={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[i],[]),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"}}}ad({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Qc.wrapFragment(xd(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=$l(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Ld.MathNode("mrow",[Od(e.label,t)]);return(n=new Ld.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new Ld.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),ad({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=Qc.wrapFragment(xd(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new Ld.MathNode("mrow",[Od(e.fragment,t)])}),ad({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=jd(t[0],"ordgroup").body,i="",s=0;s<r.length;s++)i+=jd(r[s],"textord").text;var o,a=parseInt(i);if(isNaN(a))throw new rl("\\@char has non-numeric argument "+i);if(a<0||a>=1114111)throw new rl("\\@char with invalid code point "+i);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 ru=(e,t)=>{var n=_d(e.body,t.withColor(e.color),!1);return Qc.makeFragment(n)},iu=(e,t)=>{var n=Nd(e.body,t.withColor(e.color)),r=new Ld.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};ad({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=jd(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:dd(i)}},htmlBuilder:ru,mathmlBuilder:iu}),ad({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=jd(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:s}},htmlBuilder:ru,mathmlBuilder:iu}),ad({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:i&&jd(i,"size").value}},htmlBuilder(e,t){var n=Qc.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=$l(ql(e.size,t)))),n},mathmlBuilder(e,t){var n=new Ld.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",$l(ql(e.size,t)))),n}});var su={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ou=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new rl("Expected a control sequence",e);return t},au=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};ad({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(su[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=su[r.text]),jd(t.parseFunction(),"internal");throw new rl("Invalid token after macro prefix",r)}}),ad({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new rl("Expected a control sequence",r);for(var s,o=0,a=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){s=t.gullet.future(),a[o].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new rl('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==o+1)throw new rl('Argument number "'+r.text+'" out of order');o++,a.push([])}else{if("EOF"===r.text)throw new rl("Expected a macro definition");a[o].push(r.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(i,{tokens:l,numArgs:o,delimiters:a},n===su[n]),{type:"internal",mode:t.mode}}}),ad({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=ou(t.gullet.popToken());t.gullet.consumeSpaces();var i=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return au(t,r,i,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),ad({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=ou(t.gullet.popToken()),i=t.gullet.popToken(),s=t.gullet.popToken();return au(t,r,s,"\\\\globalfuture"===n),t.gullet.pushToken(s),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var lu=function(e,t,n){var r=Ol(lc.math[e]&&lc.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},cu=function(e,t,n,r){var i=n.havingBaseStyle(t),s=Qc.makeSpan(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=i.sizeMultiplier,s},du=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=$l(i),e.height-=i,e.depth+=i},uu=function(e,t,n,r,i,s){var o=function(e,t,n,r){return Qc.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,i,r),a=cu(Qc.makeSpan(["delimsizing","size"+t],[o],r),Ml.TEXT,r,s);return n&&du(a,r,Ml.TEXT),a},hu=function(e,t,n){return{type:"elem",elem:Qc.makeSpan(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[Qc.makeSpan([],[Qc.makeSymbol(e,t,n)])])}},pu=function(e,t,n){var r=Rl["Size4-Regular"][e.charCodeAt(0)]?Rl["Size4-Regular"][e.charCodeAt(0)][4]:Rl["Size1-Regular"][e.charCodeAt(0)][4],i=new rc("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 nc([i],{width:$l(r),height:$l(t),style:"width:"+$l(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=Qc.makeSvgSpan([],[s],n);return o.height=t,o.style.height=$l(t),o.style.width=$l(r),{type:"elem",elem:o}},fu={type:"kern",size:-.008},mu=["|","\\lvert","\\rvert","\\vert"],_u=["\\|","\\lVert","\\rVert","\\Vert"],gu=function(e,t,n,r,i,s){var o,a,l,c,d="",u=0;o=l=c=e,a=null;var h="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"):ll(mu,e)?(l="∣",d="vert",u=333):ll(_u,e)?(l="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(o="⎧",a="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",a="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=lu(o,h,i),f=p.height+p.depth,m=lu(l,h,i),_=m.height+m.depth,g=lu(c,h,i),b=g.height+g.depth,v=0,y=1;if(null!==a){var w=lu(a,h,i);v=w.height+w.depth,y=2}var x=f+b+v,k=x+Math.max(0,Math.ceil((t-x)/(y*_)))*y*_,S=r.fontMetrics().axisHeight;n&&(S*=r.sizeMultiplier);var C=k/2-S,M=[];if(d.length>0){var T=k-f-b,L=Math.round(1e3*k),z=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*T)),A=new rc(d,z),P=(u/1e3).toFixed(3)+"em",R=(L/1e3).toFixed(3)+"em",N=new nc([A],{width:P,height:R,viewBox:"0 0 "+u+" "+L}),E=Qc.makeSvgSpan([],[N],r);E.height=L/1e3,E.style.width=P,E.style.height=R,M.push({type:"elem",elem:E})}else{if(M.push(hu(c,h,i)),M.push(fu),null===a){var O=k-f-b+.016;M.push(pu(l,O,r))}else{var I=(k-f-b-v)/2+.016;M.push(pu(l,I,r)),M.push(fu),M.push(hu(a,h,i)),M.push(fu),M.push(pu(l,I,r))}M.push(fu),M.push(hu(o,h,i))}var B=r.havingBaseStyle(Ml.TEXT),D=Qc.makeVList({positionType:"bottom",positionData:C,children:M},B);return cu(Qc.makeSpan(["delimsizing","mult"],[D],B),Ml.TEXT,r,s)},bu=.08,vu=function(e,t,n,r,i){var s=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=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":r=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":r=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":r=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":r=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":r=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 r}(e,r,n),o=new rc(e,s),a=new nc([o],{width:"400em",height:$l(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Qc.makeSvgSpan(["hide-tail"],[a],i)},yu=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],wu=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],xu=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ku=[0,1.2,1.8,2.4,3],Su=[{type:"small",style:Ml.SCRIPTSCRIPT},{type:"small",style:Ml.SCRIPT},{type:"small",style:Ml.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Cu=[{type:"small",style:Ml.SCRIPTSCRIPT},{type:"small",style:Ml.SCRIPT},{type:"small",style:Ml.TEXT},{type:"stack"}],Mu=[{type:"small",style:Ml.SCRIPTSCRIPT},{type:"small",style:Ml.SCRIPT},{type:"small",style:Ml.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Tu=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.")},Lu=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length&&"stack"!==n[i].type;i++){var s=lu(e,Tu(n[i]),"math"),o=s.height+s.depth;if("small"===n[i].type&&(o*=r.havingBaseStyle(n[i].style).sizeMultiplier),o>t)return n[i]}return n[n.length-1]},zu=function(e,t,n,r,i,s){var o;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),o=ll(xu,e)?Su:ll(yu,e)?Mu:Cu;var a=Lu(e,t,o,r);return"small"===a.type?function(e,t,n,r,i,s){var o=Qc.makeSymbol(e,"Main-Regular",i,r),a=cu(o,t,r,s);return n&&du(a,r,t),a}(e,a.style,n,r,i,s):"large"===a.type?uu(e,a.size,n,r,i,s):gu(e,t,n,r,i,s)},Au={sqrtImage:function(e,t){var n,r,i=t.havingBaseSizing(),s=Lu("\\surd",e*i.sizeMultiplier,Mu,i),o=i.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=vu("sqrtMain",l=(1+a+bu)/o,d=1e3+1e3*a+80,a,t)).style.minWidth="0.853em",r=.833/o):"large"===s.type?(d=1080*ku[s.size],c=(ku[s.size]+a)/o,l=(ku[s.size]+a+bu)/o,(n=vu("sqrtSize"+s.size,l,d,a,t)).style.minWidth="1.02em",r=1/o):(l=e+a+bu,c=e+a,d=Math.floor(1e3*e+a)+80,(n=vu("sqrtTall",l,d,a,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=$l(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*o}},sizedDelim:function(e,t,n,r,i){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),ll(yu,e)||ll(xu,e))return uu(e,t,!1,n,r,i);if(ll(wu,e))return gu(e,ku[t],!1,n,r,i);throw new rl("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:ku,customSizedDelim:zu,leftRightDelim:function(e,t,n,r,i,s){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,a=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o),c=Math.max(l/500*901,2*l-a);return zu(e,c,!0,r,i,s)}},Pu={"\\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}},Ru=["(","\\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 Nu(e,t){var n=Ud(e);if(n&&ll(Ru,n.text))return n;throw new rl(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Eu(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ad({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=Nu(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Pu[e.funcName].size,mclass:Pu[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Qc.makeSpan([e.mclass]):Au.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(zd(e.delim,e.mode));var n=new Ld.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=$l(Au.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),ad({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 rl("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Nu(t[0],e).text,color:n}}}),ad({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Nu(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=jd(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{Eu(e);for(var n,r,i=_d(e.body,t,!0,["mopen","mclose"]),s=0,o=0,a=!1,l=0;l<i.length;l++)i[l].isMiddle?a=!0:(s=Math.max(i[l].height,s),o=Math.max(i[l].depth,o));if(s*=t.sizeMultiplier,o*=t.sizeMultiplier,n="."===e.left?wd(t,["mopen"]):Au.leftRightDelim(e.left,s,o,t,e.mode,["mopen"]),i.unshift(n),a)for(var c=1;c<i.length;c++){var d=i[c].isMiddle;d&&(i[c]=Au.leftRightDelim(d.delim,s,o,d.options,e.mode,[]))}if("."===e.right)r=wd(t,["mclose"]);else{var u=e.rightColor?t.withColor(e.rightColor):t;r=Au.leftRightDelim(e.right,s,o,u,e.mode,["mclose"])}return i.push(r),Qc.makeSpan(["minner"],i,t)},mathmlBuilder:(e,t)=>{Eu(e);var n=Nd(e.body,t);if("."!==e.left){var r=new Ld.MathNode("mo",[zd(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var i=new Ld.MathNode("mo",[zd(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return Ad(n)}}),ad({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Nu(t[0],e);if(!e.parser.leftrightDepth)throw new rl("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=wd(t,[]);else{n=Au.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?zd("|","text"):zd(e.delim,e.mode),r=new Ld.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Ou=(e,t)=>{var n,r,i,s=Qc.wrapFragment(xd(e.body,t),t),o=e.label.slice(1),a=t.sizeMultiplier,l=0,c=pl(e.body);if("sout"===o)(n=Qc.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,l=-.5*t.fontMetrics().xHeight;else if("phase"===o){var d=ql({number:.6,unit:"pt"},t),u=ql({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=s.height+s.depth+d+u;s.style.paddingLeft=$l(h/2+d);var p=Math.floor(1e3*h*a),f="M400000 "+(r=p)+" H0 L"+r/2+" 0 l65 45 L145 "+(r-80)+" H400000z",m=new nc([new rc("phase",f)],{width:"400em",height:$l(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});(n=Qc.makeSvgSpan(["hide-tail"],[m],t)).style.height=$l(h),l=s.depth+d+u}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,r,i){var s,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(s=Qc.makeSpan(["stretchy",t],[],i),"fbox"===t){var a=i.color&&i.getColor();a&&(s.style.borderColor=a)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new ic({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new ic({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new nc(l,{width:"100%",height:$l(o)});s=Qc.makeSvgSpan([],[c],i)}return s.height=o,s.style.height=$l(o),s}(s,o,_,g,t),/fbox|boxed|fcolorbox/.test(o)?(n.style.borderStyle="solid",n.style.borderWidth=$l(b)):"angl"===o&&.049!==b&&(n.style.borderTopWidth=$l(b),n.style.borderRightWidth=$l(b)),l=s.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)i=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:l},{type:"elem",elem:s,shift:0}]},t);else{var v=/cancel|phase/.test(o)?["svg-align"]:[];i=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:n,shift:l,wrapperClasses:v}]},t)}return/cancel/.test(o)&&(i.height=s.height,i.depth=s.depth),/cancel/.test(o)&&!c?Qc.makeSpan(["mord","cancel-lap"],[i],t):Qc.makeSpan(["mord"],[i],t)},Iu=(e,t)=>{var n=0,r=new Ld.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Od(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ad({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=jd(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:Ou,mathmlBuilder:Iu}),ad({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=jd(t[0],"color-token").color,o=jd(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:Ou,mathmlBuilder:Iu}),ad({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]}}}),ad({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Ou,mathmlBuilder:Iu}),ad({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 Bu={};function Du(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)Bu[n[l]]=a;s&&(sd[t]=s),o&&(od[t]=o)}var Vu={};function Hu(e,t){Vu[e]=t}function ju(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 Fu=e=>{if(!e.parser.settings.displayMode)throw new rl("{"+e.envName+"} can be used only in display mode.")};function Uu(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function qu(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=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 rl("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var f=[],m=[f],_=[],g=[],b=null!=l?[]:void 0;function v(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function y(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new nl("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(v(),g.push(ju(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(u&&f.length===u){if(c||a)throw new rl("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){y(),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 rl("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),y(),g.push(ju(e)),f=[],m.push(f),v()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:i,arraystretch:o,body:m,cols:s,rowGaps:_,hskipBeforeAndAfter:r,hLinesBeforeRow:g,colSeparationType:a,tags:b,leqno:h}}function $u(e){return"d"===e.slice(0,1)?"display":"text"}var Gu=function(e,t){var n,r,i=e.body.length,s=e.hLinesBeforeRow,o=0,a=new Array(i),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(Ml.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?ql({number:3,unit:"ex"},t):12*d,p=3*d,f=e.arraystretch*h,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 v=e.body[n],y=m,w=_;o<v.length&&(o=v.length);var x=new Array(v.length);for(r=0;r<v.length;++r){var k=xd(v[r],t);w<k.depth&&(w=k.depth),y<k.height&&(y=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=ql(S,t))>0&&(w<(C+=_)&&(w=C),C=0),e.addJot&&(w+=p),x.height=y,x.depth=w,g+=y,x.pos=g,g+=w+C,a[n]=x,b(s[n+1])}var M,T,L=g/2+t.fontMetrics().axisHeight,z=e.cols||[],A=[],P=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var R=a[n],N=R.pos-L,E=e.tags[n],O=void 0;(O=!0===E?Qc.makeSpan(["eqn-num"],[],t):Qc.makeSpan([],!1===E?[]:_d(E,t,!0),t)).depth=R.depth,O.height=R.height,P.push({type:"elem",elem:O,shift:N})}for(r=0,T=0;r<o||T<z.length;++r,++T){for(var I=z[T]||{},B=!0;"separator"===I.type;){if(B||((M=Qc.makeSpan(["arraycolsep"],[])).style.width=$l(t.fontMetrics().doubleRuleSep),A.push(M)),"|"!==I.separator&&":"!==I.separator)throw new rl("Invalid separator type: "+I.separator);var D="|"===I.separator?"solid":"dashed",V=Qc.makeSpan(["vertical-separator"],[],t);V.style.height=$l(g),V.style.borderRightWidth=$l(c),V.style.borderRightStyle=D,V.style.margin="0 "+$l(-c/2);var H=g-L;H&&(V.style.verticalAlign=$l(-H)),A.push(V),I=z[++T]||{},B=!1}if(!(r>=o)){var j=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(j=cl(I.pregap,u))&&((M=Qc.makeSpan(["arraycolsep"],[])).style.width=$l(j),A.push(M));var F=[];for(n=0;n<i;++n){var U=a[n],q=U[r];if(q){var $=U.pos-L;q.depth=U.depth,q.height=U.height,F.push({type:"elem",elem:q,shift:$})}}F=Qc.makeVList({positionType:"individualShift",children:F},t),F=Qc.makeSpan(["col-align-"+(I.align||"c")],[F]),A.push(F),(r<o-1||e.hskipBeforeAndAfter)&&0!==(j=cl(I.postgap,u))&&((M=Qc.makeSpan(["arraycolsep"],[])).style.width=$l(j),A.push(M))}}if(a=Qc.makeSpan(["mtable"],A),l.length>0){for(var G=Qc.makeLineSpan("hline",t,c),X=Qc.makeLineSpan("hdashline",t,c),K=[{type:"elem",elem:a,shift:0}];l.length>0;){var W=l.pop(),Y=W.pos-L;W.isDashed?K.push({type:"elem",elem:X,shift:Y}):K.push({type:"elem",elem:G,shift:Y})}a=Qc.makeVList({positionType:"individualShift",children:K},t)}if(0===P.length)return Qc.makeSpan(["mord"],[a],t);var Z=Qc.makeVList({positionType:"individualShift",children:P},t);return Z=Qc.makeSpan(["tag"],[Z],t),Qc.makeFragment([a,Z])},Xu={c:"center ",l:"left ",r:"right "},Ku=function(e,t){for(var n=[],r=new Ld.MathNode("mtd",[],["mtr-glue"]),i=new Ld.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 Ld.MathNode("mtd",[Od(o[l],t)]));e.tags&&e.tags[s]&&(a.unshift(r),a.push(r),e.leqno?a.unshift(i):a.push(i)),n.push(new Ld.MathNode("mtr",a))}var c=new Ld.MathNode("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",$l(d));var u="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,f="",m=!1,_=0,g=p.length;"separator"===p[0].type&&(u+="top ",_=1),"separator"===p[p.length-1].type&&(u+="bottom ",g-=1);for(var b=_;b<g;b++)"align"===p[b].type?(h+=Xu[p[b].align],m&&(f+="none "),m=!0):"separator"===p[b].type&&m&&(f+="|"===p[b].separator?"solid ":"dashed ",m=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(f)&&c.setAttribute("columnlines",f.trim())}if("align"===e.colSeparationType){for(var v=e.cols||[],y="",w=1;w<v.length;w++)y+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",y.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;u+=k[0].length>0?"left ":"",u+=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()),""!==u&&(c=new Ld.MathNode("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new Ld.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},Wu=function(e,t){-1===e.envName.indexOf("ed")&&Fu(e);var n,r=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s="split"===e.envName,o=qu(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:Uu(e.envName),emptySingleRow:!0,colSeparationType:i,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+=jd(t[0].body[d],"textord").text;n=Number(c),a=2*n}var u=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var r=jd(e[t],"styling");jd(r.body[0],"ordgroup").body.unshift(l)}if(u)a<e.length&&(a=e.length);else{var i=e.length/2;if(n<i)throw new rl("Too many math in a row: expected "+n+", but got "+i,e[0])}});for(var h=0;h<a;++h){var p="r",f=0;h%2==1?p="l":h>0&&u&&(f=1),r[h]={type:"align",align:p,pregap:f,postgap:0}}return o.colSeparationType=u?"align":"alignat",o};Du({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Ud(t[0])?[t[0]]:jd(t[0],"ordgroup").body).map(function(e){var t=Fd(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 rl("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return qu(e.parser,r,$u(e.envName))},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({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",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,-1==="lcr".indexOf(n))throw new rl("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var s=qu(e.parser,r,$u(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:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=qu(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Ud(t[0])?[t[0]]:jd(t[0],"ordgroup").body).map(function(e){var t=Fd(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new rl("Unknown column alignment: "+t,e)});if(n.length>1)throw new rl("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=qu(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new rl("{subarray} can contain only one column");return r},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=qu(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},$u(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:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Wu,htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){ll(["gather","gather*"],e.envName)&&Fu(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Uu(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return qu(e.parser,t,"display")},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Wu,htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Fu(e);var t={autoTag:Uu(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return qu(e.parser,t,"display")},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Fu(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 rl("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],i=[r],s=0;s<t.length;s++){for(var o=t[s],a=Jd(),l=0;l<o.length;l++)if(eu(o[l])){r.push(a);var c=Fd(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 rl('Expected one of "<>AV=|." after @',o[l]);for(var u=0;u<2;u++){for(var h=!0,p=l+1;p<o.length;p++){if(tu(o[p],c)){h=!1,l=p;break}if(eu(o[p]))throw new rl("Missing a "+c+" character to complete a CD arrow.",o[p]);d[u].body.push(o[p])}if(h)throw new rl("Missing a "+c+" character to complete a CD arrow.",o[l])}}var f={type:"styling",body:[nu(c,d,e)],mode:"math",style:"display"};r.push(f),a=Jd()}else a.body.push(o[l]);s%2==0?r.push(a):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}(e.parser)),htmlBuilder:Gu,mathmlBuilder:Ku}),Hu("\\nonumber","\\gdef\\@eqnsw{0}"),Hu("\\notag","\\nonumber"),ad({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new rl(e.funcName+" valid only within array environment")}});var Yu=Bu;ad({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if("ordgroup"!==i.type)throw new rl("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=jd(i.body[o],"textord").text;if("\\begin"===r){if(!Yu.hasOwnProperty(s))throw new rl("No such environment: "+s,i);var a=Yu[s],{args:l,optArgs:c}=n.parseArguments("\\begin{"+s+"}",a),d={mode:n.mode,envName:s,parser:n},u=a.handler(d,l,c);n.expect("\\end",!1);var h=n.nextToken,p=jd(n.parseFunction(),"environment");if(p.name!==s)throw new rl("Mismatch: \\begin{"+s+"} matched by \\end{"+p.name+"}",h);return u}return{type:"environment",mode:n.mode,name:s,nameGroup:i}}});var Zu=(e,t)=>{var n=e.font,r=t.withFont(n);return xd(e.body,r)},Qu=(e,t)=>{var n=e.font,r=t.withFont(n);return Od(e.body,r)},Ju={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};ad({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:r}=e,i=cd(t[0]),s=r;return s in Ju&&(s=Ju[s]),{type:"font",mode:n.mode,font:s.slice(1),body:i}},htmlBuilder:Zu,mathmlBuilder:Qu}),ad({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=pl(r);return{type:"mclass",mode:n.mode,mclass:Zd(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}}),ad({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:s}=n,o=n.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:Zu,mathmlBuilder:Qu});var eh=(e,t)=>{var n=t;return"display"===e?n=n.id>=Ml.SCRIPT.id?n.text():Ml.DISPLAY:"text"===e&&n.size===Ml.DISPLAY.size?n=Ml.TEXT:"script"===e?n=Ml.SCRIPT:"scriptscript"===e&&(n=Ml.SCRIPTSCRIPT),n},th=(e,t)=>{var n,r=eh(e.size,t.style),i=r.fracNum(),s=r.fracDen();n=t.havingStyle(i);var o=xd(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,u,h,p,f,m,_,g,b,v=xd(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=ql(e.barSize,t),c=Qc.makeLineSpan("frac-line",t,d)):c=Qc.makeLineSpan("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),r.size===Ml.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,p=d>0?3*u:7*u,f=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,p=u):(h=t.fontMetrics().num3,p=3*u),f=t.fontMetrics().denom2),c){var y=t.fontMetrics().axisHeight;h-o.depth-(y+.5*d)<p&&(h+=p-(h-o.depth-(y+.5*d))),y-.5*d-(v.height-f)<p&&(f+=p-(y-.5*d-(v.height-f))),m=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:v,shift:f},{type:"elem",elem:c,shift:-(y-.5*d)},{type:"elem",elem:o,shift:-h}]},t)}else{var w=h-o.depth-(v.height-f);w<p&&(h+=.5*(p-w),f+=.5*(p-w)),m=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:v,shift:f},{type:"elem",elem:o,shift:-h}]},t)}return n=t.havingStyle(r),m.height*=n.sizeMultiplier/t.sizeMultiplier,m.depth*=n.sizeMultiplier/t.sizeMultiplier,_=r.size===Ml.DISPLAY.size?t.fontMetrics().delim1:r.size===Ml.SCRIPTSCRIPT.size?t.havingStyle(Ml.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,g=null==e.leftDelim?wd(t,["mopen"]):Au.customSizedDelim(e.leftDelim,_,!0,t.havingStyle(r),e.mode,["mopen"]),b=e.continued?Qc.makeSpan([]):null==e.rightDelim?wd(t,["mclose"]):Au.customSizedDelim(e.rightDelim,_,!0,t.havingStyle(r),e.mode,["mclose"]),Qc.makeSpan(["mord"].concat(n.sizingClasses(t)),[g,Qc.makeSpan(["mfrac"],[m]),b],t)},nh=(e,t)=>{var n=new Ld.MathNode("mfrac",[Od(e.numer,t),Od(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=ql(e.barSize,t);n.setAttribute("linethickness",$l(r))}}else n.setAttribute("linethickness","0px");var i=eh(e.size,t.style);if(i.size!==t.style.size){n=new Ld.MathNode("mstyle",[n]);var s=i.size===Ml.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 Ld.MathNode("mo",[new Ld.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(n),null!=e.rightDelim){var l=new Ld.MathNode("mo",[new Ld.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Ad(o)}return n};ad({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:i}=e,s=t[0],o=t[1],a=null,l=null,c="auto";switch(i){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(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:s,denom:o,hasBarLine:n,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:th,mathmlBuilder:nh}),ad({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),ad({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:i}=e;switch(r){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:i}}});var rh=["display","text","script","scriptscript"],ih=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};ad({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,i=t[4],s=t[5],o=cd(t[0]),a="atom"===o.type&&"open"===o.family?ih(o.text):null,l=cd(t[1]),c="atom"===l.type&&"close"===l.family?ih(l.text):null,d=jd(t[2],"size"),u=null;n=!!d.isBlank||(u=d.value).number>0;var h="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var f=jd(p.body[0],"textord");h=rh[Number(f.text)]}}else p=jd(p,"textord"),h=rh[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:n,barSize:u,leftDelim:a,rightDelim:c,size:h}},htmlBuilder:th,mathmlBuilder:nh}),ad({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:jd(t[0],"size").value,token:i}}}),ad({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(jd(t[1],"infix").size),o=t[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:th,mathmlBuilder:nh});var sh=(e,t)=>{var n,r,i=t.style;"supsub"===e.type?(n=e.sup?xd(e.sup,t.havingStyle(i.sup()),t):xd(e.sub,t.havingStyle(i.sub()),t),r=jd(e.base,"horizBrace")):r=jd(e,"horizBrace");var s,o=xd(r.base,t.havingBaseStyle(Ml.DISPLAY)),a=Hd(r,t);if(r.isOver?(s=Qc.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=Qc.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=Qc.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t);s=r.isOver?Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Qc.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 Qc.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t)};ad({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:sh,mathmlBuilder:(e,t)=>{var n=Vd(e.label);return new Ld.MathNode(e.isOver?"mover":"munder",[Od(e.base,t),n])}}),ad({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=jd(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:dd(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=_d(e.body,t,!1);return Qc.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Ed(e.body,t);return n instanceof Md||(n=new Md("mrow",[n])),n.setAttribute("href",e.href),n}}),ad({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=jd(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<r.length;s++){var o=r[s];"~"===o&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:dd(a)}}}),ad({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:dd(t[0])}},htmlBuilder(e,t){var n=_d(e.body,t,!1);return Qc.makeFragment(n)},mathmlBuilder:(e,t)=>new Ld.MathNode("mrow",Nd(e.body,t))}),ad({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:i,token:s}=e,o=jd(t[0],"raw").string,a=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){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 u=c[d].split("=");if(2!==u.length)throw new rl("Error parsing key-value for \\htmlData");l["data-"+u[0].trim()]=u[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:dd(a)}:r.formatUnsupportedCmd(i)},htmlBuilder:(e,t)=>{var n=_d(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Qc.makeSpan(r,n,t);for(var s in e.attributes)"class"!==s&&e.attributes.hasOwnProperty(s)&&i.setAttribute(s,e.attributes[s]);return i},mathmlBuilder:(e,t)=>Ed(e.body,t)}),ad({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:dd(t[0]),mathml:dd(t[1])}},htmlBuilder:(e,t)=>{var n=_d(e.html,t,!1);return Qc.makeFragment(n)},mathmlBuilder:(e,t)=>Ed(e.mathml,t)});var oh=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 rl("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Ul(n))throw new rl("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ad({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(n[0])for(var l=jd(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":a=u;break;case"width":i=oh(u);break;case"height":s=oh(u);break;case"totalheight":o=oh(u);break;default:throw new rl("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=jd(t[0],"url").url;return""===a&&(a=(a=(a=h).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:a,width:i,height:s,totalheight:o,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=ql(e.height,t),r=0;e.totalheight.number>0&&(r=ql(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=ql(e.width,t));var s={height:$l(n+r)};i>0&&(s.width=$l(i)),r>0&&(s.verticalAlign=$l(-r));var o=new Jl(e.src,e.alt,s);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Ld.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=ql(e.height,t),i=0;if(e.totalheight.number>0&&(i=ql(e.totalheight,t)-r,n.setAttribute("valign",$l(-i))),n.setAttribute("height",$l(r+i)),e.width.number>0){var s=ql(e.width,t);n.setAttribute("width",$l(s))}return n.setAttribute("src",e.src),n}}),ad({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=jd(t[0],"size");if(n.settings.strict){var s="m"===r[1],o="mu"===i.value.unit;s?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:(e,t)=>Qc.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=ql(e.dimension,t);return new Ld.SpaceNode(n)}}),ad({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=Qc.makeSpan([],[xd(e.body,t)]),n=Qc.makeSpan(["inner"],[n],t)):n=Qc.makeSpan(["inner"],[xd(e.body,t)]);var r=Qc.makeSpan(["fix"],[]),i=Qc.makeSpan([e.alignment],[n,r],t),s=Qc.makeSpan(["strut"]);return s.style.height=$l(i.height+i.depth),i.depth&&(s.style.verticalAlign=$l(-i.depth)),i.children.unshift(s),i=Qc.makeSpan(["thinbox"],[i],t),Qc.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Ld.MathNode("mpadded",[Od(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),ad({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var s="\\("===n?"\\)":"$",o=r.parseExpression(!1,s);return r.expect(s),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:o}}}),ad({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new rl("Mismatched "+e.funcName)}});var ah=(e,t)=>{switch(t.style.size){case Ml.DISPLAY.size:return e.display;case Ml.TEXT.size:return e.text;case Ml.SCRIPT.size:return e.script;case Ml.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ad({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:dd(t[0]),text:dd(t[1]),script:dd(t[2]),scriptscript:dd(t[3])}},htmlBuilder:(e,t)=>{var n=ah(e,t),r=_d(n,t,!1);return Qc.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=ah(e,t);return Ed(n,t)}});var lh=(e,t,n,r,i,s,o)=>{e=Qc.makeSpan([],[e]);var a,l,c,d=n&&pl(n);if(t){var u=xd(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var h=xd(n,r.havingStyle(i.sub()),r);a={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&a){var p=r.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+o;c=Qc.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:$l(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:$l(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(a){var f=e.height-o;c=Qc.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:$l(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var m=e.depth+o;c=Qc.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:$l(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var _=[c];if(a&&0!==s&&!d){var g=Qc.makeSpan(["mspace"],[],r);g.style.marginRight=$l(s),_.unshift(g)}return Qc.makeSpan(["mop","op-limits"],_,r)},ch=["\\smallint"],dh=(e,t)=>{var n,r,i,s=!1;"supsub"===e.type?(n=e.sup,r=e.sub,i=jd(e.base,"op"),s=!0):i=jd(e,"op");var o,a=t.style,l=!1;if(a.size===Ml.DISPLAY.size&&i.symbol&&!ll(ch,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",d="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(d=i.name.slice(1),i.name="oiint"===d?"\\iint":"\\iiint"),o=Qc.makeSymbol(i.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d.length>0){var u=o.italic,h=Qc.staticSvg(d+"Size"+(l?"2":"1"),t);o=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},t),i.name="\\"+d,o.classes.unshift("mop"),o.italic=u}}else if(i.body){var p=_d(i.body,t,!0);1===p.length&&p[0]instanceof tc?(o=p[0]).classes[0]="mop":o=Qc.makeSpan(["mop"],p,t)}else{for(var f=[],m=1;m<i.name.length;m++)f.push(Qc.mathsym(i.name[m],i.mode,t));o=Qc.makeSpan(["mop"],f,t)}var _=0,g=0;return(o instanceof tc||"\\oiint"===i.name||"\\oiiint"===i.name)&&!i.suppressBaseShift&&(_=(o.height-o.depth)/2-t.fontMetrics().axisHeight,g=o.italic),s?lh(o,n,r,t,a,g,_):(_&&(o.style.position="relative",o.style.top=$l(_)),o)},uh=(e,t)=>{var n;if(e.symbol)n=new Md("mo",[zd(e.name,e.mode)]),ll(ch,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Md("mo",Nd(e.body,t));else{n=new Md("mi",[new Td(e.name.slice(1))]);var r=new Md("mo",[zd("","text")]);n=e.parentIsSupSub?new Md("mrow",[n,r]):Cd([n,r])}return n},hh={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ad({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:r}=e,i=r;return 1===i.length&&(i=hh[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:dh,mathmlBuilder:uh}),ad({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:dd(r)}},htmlBuilder:dh,mathmlBuilder:uh});var ph={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ad({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:dh,mathmlBuilder:uh}),ad({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:dh,mathmlBuilder:uh}),ad({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=ph[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:dh,mathmlBuilder:uh});var fh=(e,t)=>{var n,r,i,s,o=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,i=jd(e.base,"operatorname"),o=!0):i=jd(e,"operatorname"),i.body.length>0){for(var a=i.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=_d(a,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof tc&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=Qc.makeSpan(["mop"],l,t)}else s=Qc.makeSpan(["mop"],[],t);return o?lh(s,n,r,t,t.style,0,0):s};function mh(e,t,n){for(var r=_d(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,s=0;s<r.length;s++){var o=r[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(r[s].classes,t.sizingClasses(n)):r[s].classes[o+1]==="reset-size"+t.size&&(r[s].classes[o+1]="reset-size"+n.size),r[s].height*=i,r[s].depth*=i}return Qc.makeFragment(r)}ad({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:dd(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:fh,mathmlBuilder:(e,t)=>{for(var n=Nd(e.body,t.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var s=n[i];if(s instanceof Ld.SpaceNode);else if(s instanceof Ld.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 Ld.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var a=n.map(e=>e.toText()).join("");n=[new Ld.TextNode(a)]}var l=new Ld.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new Ld.MathNode("mo",[zd("","text")]);return e.parentIsSupSub?new Ld.MathNode("mrow",[l,c]):Ld.newDocumentFragment([l,c])}}),Hu("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),ld({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Qc.makeFragment(_d(e.body,t,!1)):Qc.makeSpan(["mord"],_d(e.body,t,!0),t),mathmlBuilder:(e,t)=>Ed(e.body,t,!0)}),ad({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=xd(e.body,t.havingCrampedStyle()),r=Qc.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,s=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},t);return Qc.makeSpan(["mord","overline"],[s],t)},mathmlBuilder(e,t){var n=new Ld.MathNode("mo",[new Ld.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Ld.MathNode("mover",[Od(e.body,t),n]);return r.setAttribute("accent","true"),r}}),ad({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:dd(r)}},htmlBuilder:(e,t)=>{var n=_d(e.body,t.withPhantom(),!1);return Qc.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Nd(e.body,t);return new Ld.MathNode("mphantom",n)}}),ad({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Qc.makeSpan([],[xd(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Qc.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Nd(dd(e.body),t),r=new Ld.MathNode("mphantom",n),i=new Ld.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),ad({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Qc.makeSpan(["inner"],[xd(e.body,t.withPhantom())]),r=Qc.makeSpan(["fix"],[]);return Qc.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Nd(dd(e.body),t),r=new Ld.MathNode("mphantom",n),i=new Ld.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}}),ad({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=jd(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=xd(e.body,t),r=ql(e.dy,t);return Qc.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Ld.MathNode("mpadded",[Od(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),ad({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),ad({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],s=jd(t[0],"size"),o=jd(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&jd(i,"size").value,width:s.value,height:o.value}},htmlBuilder(e,t){var n=Qc.makeSpan(["mord","rule"],[],t),r=ql(e.width,t),i=ql(e.height,t),s=e.shift?ql(e.shift,t):0;return n.style.borderRightWidth=$l(r),n.style.borderTopWidth=$l(i),n.style.bottom=$l(s),n.width=r,n.height=i+s,n.depth=-s,n.maxFontSize=1.125*i*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=ql(e.width,t),r=ql(e.height,t),i=e.shift?ql(e.shift,t):0,s=t.color&&t.getColor()||"black",o=new Ld.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",$l(n)),o.setAttribute("height",$l(r));var a=new Ld.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",$l(i)):(a.setAttribute("height",$l(i)),a.setAttribute("depth",$l(-i))),a.setAttribute("voffset",$l(i)),a}});var _h=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];ad({type:"sizing",names:_h,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:_h.indexOf(r)+1,body:s}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return mh(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Nd(e.body,n),i=new Ld.MathNode("mstyle",r);return i.setAttribute("mathsize",$l(n.sizeMultiplier)),i}}),ad({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,s=!1,o=n[0]&&jd(n[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l)if("t"===(a=o.body[l].text))i=!0;else{if("b"!==a){i=!1,s=!1;break}s=!0}else i=!0,s=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:i,smashDepth:s}},htmlBuilder:(e,t)=>{var n=Qc.makeSpan([],[xd(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].depth=0;var s=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Qc.makeSpan(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Ld.MathNode("mpadded",[Od(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),ad({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],s=t[0];return{type:"sqrt",mode:r.mode,body:s,index:i}},htmlBuilder(e,t){var n=xd(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Qc.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Ml.TEXT.id&&(i=t.fontMetrics().xHeight);var s=r+i/4,o=n.height+n.depth+s+r,{span:a,ruleWidth:l,advanceWidth:c}=Au.sqrtImage(o,t),d=a.height-l;d>n.height+n.depth+s&&(s=(s+d-n.height-n.depth)/2);var u=a.height-n.height-s-l;n.style.paddingLeft=$l(c);var h=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(Ml.SCRIPTSCRIPT),f=xd(e.index,p,t),m=.6*(h.height-h.depth),_=Qc.makeVList({positionType:"shift",positionData:-m,children:[{type:"elem",elem:f}]},t),g=Qc.makeSpan(["root"],[_]);return Qc.makeSpan(["mord","sqrt"],[g,h],t)}return Qc.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Ld.MathNode("mroot",[Od(n,t),Od(r,t)]):new Ld.MathNode("msqrt",[Od(n,t)])}});var gh={display:Ml.DISPLAY,text:Ml.TEXT,script:Ml.SCRIPT,scriptscript:Ml.SCRIPTSCRIPT};ad({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(e,t){var n=gh[e.style],r=t.havingStyle(n).withFont("");return mh(e.body,r,t)},mathmlBuilder(e,t){var n=gh[e.style],r=t.havingStyle(n),i=Nd(e.body,r),s=new Ld.MathNode("mstyle",i),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}}),ld({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Ml.DISPLAY.size||n.alwaysHandleSupSub)?dh:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Ml.DISPLAY.size||n.limits)?fh:null:"accent"===n.type?pl(n.base)?qd:null:"horizBrace"===n.type&&!e.sub===n.isOver?sh:null:null}(e,t);if(n)return n(e,t);var r,i,s,{base:o,sup:a,sub:l}=e,c=xd(o,t),d=t.fontMetrics(),u=0,h=0,p=o&&pl(o);if(a){var f=t.havingStyle(t.style.sup());r=xd(a,f,t),p||(u=c.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(l){var m=t.havingStyle(t.style.sub());i=xd(l,m,t),p||(h=c.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}s=t.style===Ml.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var _,g=t.sizeMultiplier,b=$l(.5/d.ptPerEm/g),v=null;if(i){var y=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof tc||y)&&(v=$l(-c.italic))}if(r&&i){u=Math.max(u,s,r.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var w=4*d.defaultRuleThickness;if(u-r.depth-(i.height-h)<w){h=w-(u-r.depth)+i.height;var x=.8*d.xHeight-(u-r.depth);x>0&&(u+=x,h-=x)}_=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h,marginRight:b,marginLeft:v},{type:"elem",elem:r,shift:-u,marginRight:b}]},t)}else if(i){h=Math.max(h,d.sub1,i.height-.8*d.xHeight),_=Qc.makeVList({positionType:"shift",positionData:h,children:[{type:"elem",elem:i,marginLeft:v,marginRight:b}]},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,s,r.depth+.25*d.xHeight),_=Qc.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:b}]},t)}var k=yd(c,"right")||"mord";return Qc.makeSpan([k],[c,Qc.makeSpan(["msupsub"],[_])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var i,s=[Od(e.base,t)];if(e.sub&&s.push(Od(e.sub,t)),e.sup&&s.push(Od(e.sup,t)),r)i=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;i=o&&"op"===o.type&&o.limits&&t.style===Ml.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===Ml.DISPLAY||o.limits)?"munderover":"msubsup"}else{var a=e.base;i=a&&"op"===a.type&&a.limits&&(t.style===Ml.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===Ml.DISPLAY)?"munder":"msub"}else{var l=e.base;i=l&&"op"===l.type&&l.limits&&(t.style===Ml.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Ml.DISPLAY)?"mover":"msup"}return new Ld.MathNode(i,s)}}),ld({type:"atom",htmlBuilder:(e,t)=>Qc.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new Ld.MathNode("mo",[zd(e.text,e.mode)]);if("bin"===e.family){var r=Pd(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var bh={mi:"italic",mn:"normal",mtext:"normal"};ld({type:"mathord",htmlBuilder:(e,t)=>Qc.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new Ld.MathNode("mi",[zd(e.text,e.mode,t)]),r=Pd(e,t)||"italic";return r!==bh[n.type]&&n.setAttribute("mathvariant",r),n}}),ld({type:"textord",htmlBuilder:(e,t)=>Qc.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=zd(e.text,e.mode,t),i=Pd(e,t)||"normal";return n="text"===e.mode?new Ld.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new Ld.MathNode("mn",[r]):"\\prime"===e.text?new Ld.MathNode("mo",[r]):new Ld.MathNode("mi",[r]),i!==bh[n.type]&&n.setAttribute("mathvariant",i),n}});var vh={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},yh={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ld({type:"spacing",htmlBuilder(e,t){if(yh.hasOwnProperty(e.text)){var n=yh[e.text].className||"";if("text"===e.mode){var r=Qc.makeOrd(e,t,"textord");return r.classes.push(n),r}return Qc.makeSpan(["mspace",n],[Qc.mathsym(e.text,e.mode,t)],t)}if(vh.hasOwnProperty(e.text))return Qc.makeSpan(["mspace",vh[e.text]],[],t);throw new rl('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!yh.hasOwnProperty(e.text)){if(vh.hasOwnProperty(e.text))return new Ld.MathNode("mspace");throw new rl('Unknown type of space "'+e.text+'"')}return new Ld.MathNode("mtext",[new Ld.TextNode(" ")])}});var wh=()=>{var e=new Ld.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};ld({type:"tag",mathmlBuilder(e,t){var n=new Ld.MathNode("mtable",[new Ld.MathNode("mtr",[wh(),new Ld.MathNode("mtd",[Ed(e.body,t)]),wh(),new Ld.MathNode("mtd",[Ed(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var xh={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},kh={"\\textbf":"textbf","\\textmd":"textmd"},Sh={"\\textit":"textit","\\textup":"textup"},Ch=(e,t)=>{var n=e.font;return n?xh[n]?t.withTextFontFamily(xh[n]):kh[n]?t.withTextFontWeight(kh[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(Sh[n]):t};ad({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:r}=e,i=t[0];return{type:"text",mode:n.mode,body:dd(i),font:r}},htmlBuilder(e,t){var n=Ch(e,t),r=_d(e.body,n,!0);return Qc.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Ch(e,t);return Ed(e.body,n)}}),ad({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=xd(e.body,t),r=Qc.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,s=Qc.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},t);return Qc.makeSpan(["mord","underline"],[s],t)},mathmlBuilder(e,t){var n=new Ld.MathNode("mo",[new Ld.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Ld.MathNode("munder",[Od(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),ad({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=xd(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return Qc.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new Ld.MathNode("mpadded",[Od(e.body,t)],["vcenter"])}),ad({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new rl("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Mh(e),r=[],i=t.havingStyle(t.style.text()),s=0;s<n.length;s++){var o=n[s];"~"===o&&(o="\\textasciitilde"),r.push(Qc.makeSymbol(o,"Typewriter-Regular",e.mode,i,["mord","texttt"]))}return Qc.makeSpan(["mord","text"].concat(i.sizingClasses(t)),Qc.tryCombineChars(r),i)},mathmlBuilder(e,t){var n=new Ld.TextNode(Mh(e)),r=new Ld.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Mh=e=>e.body.replace(/ /g,e.star?"␣":" "),Th=id,Lh="[ \r\n\t]",zh="(\\\\[a-zA-Z@]+)"+Lh+"*",Ah="[̀-ͯ]",Ph=new RegExp(Ah+"+$"),Rh="("+Lh+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+Ah+"*|[\ud800-\udbff][\udc00-\udfff]"+Ah+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+zh+"|\\\\[^\ud800-\udfff])";class Nh{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(Rh,"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 nl("EOF",new tl(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new rl("Unexpected character: '"+e[t]+"'",new nl(e[t],new tl(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(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=i+1,this.lex()}return new nl(r,new tl(this,t,this.tokenRegex.lastIndex))}}class Eh{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 rl("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 r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var Oh=Vu;Hu("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Hu("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Hu("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Hu("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Hu("\\@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}}),Hu("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Hu("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Ih={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};Hu("\\char",function(e){var t,n=e.popToken(),r="";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])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new rl("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=Ih[n.text])||r>=t)throw new rl("Invalid base-"+t+" digit "+n.text);for(var i;null!=(i=Ih[e.future().text])&&i<t;)r*=t,r+=i,e.popToken()}return"\\@char{"+r+"}"});var Bh=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(1!==i.length)throw new rl("\\newcommand's first argument must be a macro name");var s=i[0].text,o=e.isDefined(s);if(o&&!t)throw new rl("\\newcommand{"+s+"} attempting to redefine "+s+"; use \\renewcommand");if(!o&&!n)throw new rl("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(1===(i=e.consumeArg().tokens).length&&"["===i[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 rl("Invalid number of arguments: "+l);a=parseInt(l),i=e.consumeArg().tokens}return o&&r||e.macros.set(s,{tokens:i,numArgs:a}),""};Hu("\\newcommand",e=>Bh(e,!1,!0,!1)),Hu("\\renewcommand",e=>Bh(e,!0,!1,!1)),Hu("\\providecommand",e=>Bh(e,!0,!0,!0)),Hu("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Hu("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Hu("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Th[n],lc.math[n],lc.text[n]),""}),Hu("\\bgroup","{"),Hu("\\egroup","}"),Hu("~","\\nobreakspace"),Hu("\\lq","`"),Hu("\\rq","'"),Hu("\\aa","\\r a"),Hu("\\AA","\\r A"),Hu("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Hu("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Hu("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Hu("ℬ","\\mathscr{B}"),Hu("ℰ","\\mathscr{E}"),Hu("ℱ","\\mathscr{F}"),Hu("ℋ","\\mathscr{H}"),Hu("ℐ","\\mathscr{I}"),Hu("ℒ","\\mathscr{L}"),Hu("ℳ","\\mathscr{M}"),Hu("ℛ","\\mathscr{R}"),Hu("ℭ","\\mathfrak{C}"),Hu("ℌ","\\mathfrak{H}"),Hu("ℨ","\\mathfrak{Z}"),Hu("\\Bbbk","\\Bbb{k}"),Hu("·","\\cdotp"),Hu("\\llap","\\mathllap{\\textrm{#1}}"),Hu("\\rlap","\\mathrlap{\\textrm{#1}}"),Hu("\\clap","\\mathclap{\\textrm{#1}}"),Hu("\\mathstrut","\\vphantom{(}"),Hu("\\underbar","\\underline{\\text{#1}}"),Hu("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Hu("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Hu("\\ne","\\neq"),Hu("≠","\\neq"),Hu("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Hu("∉","\\notin"),Hu("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Hu("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Hu("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Hu("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Hu("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Hu("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Hu("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Hu("⟂","\\perp"),Hu("‼","\\mathclose{!\\mkern-0.8mu!}"),Hu("∌","\\notni"),Hu("⌜","\\ulcorner"),Hu("⌝","\\urcorner"),Hu("⌞","\\llcorner"),Hu("⌟","\\lrcorner"),Hu("©","\\copyright"),Hu("®","\\textregistered"),Hu("️","\\textregistered"),Hu("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Hu("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Hu("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Hu("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Hu("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Hu("⋮","\\vdots"),Hu("\\varGamma","\\mathit{\\Gamma}"),Hu("\\varDelta","\\mathit{\\Delta}"),Hu("\\varTheta","\\mathit{\\Theta}"),Hu("\\varLambda","\\mathit{\\Lambda}"),Hu("\\varXi","\\mathit{\\Xi}"),Hu("\\varPi","\\mathit{\\Pi}"),Hu("\\varSigma","\\mathit{\\Sigma}"),Hu("\\varUpsilon","\\mathit{\\Upsilon}"),Hu("\\varPhi","\\mathit{\\Phi}"),Hu("\\varPsi","\\mathit{\\Psi}"),Hu("\\varOmega","\\mathit{\\Omega}"),Hu("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Hu("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Hu("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Hu("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Hu("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Hu("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Hu("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Hu("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Dh={",":"\\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"};Hu("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Dh?t=Dh[n]:("\\not"===n.slice(0,4)||n in lc.math&&ll(["bin","rel"],lc.math[n].group))&&(t="\\dotsb"),t});var Vh={")":!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};Hu("\\dotso",function(e){return e.future().text in Vh?"\\ldots\\,":"\\ldots"}),Hu("\\dotsc",function(e){var t=e.future().text;return t in Vh&&","!==t?"\\ldots\\,":"\\ldots"}),Hu("\\cdots",function(e){return e.future().text in Vh?"\\@cdots\\,":"\\@cdots"}),Hu("\\dotsb","\\cdots"),Hu("\\dotsm","\\cdots"),Hu("\\dotsi","\\!\\cdots"),Hu("\\dotsx","\\ldots\\,"),Hu("\\DOTSI","\\relax"),Hu("\\DOTSB","\\relax"),Hu("\\DOTSX","\\relax"),Hu("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Hu("\\,","\\tmspace+{3mu}{.1667em}"),Hu("\\thinspace","\\,"),Hu("\\>","\\mskip{4mu}"),Hu("\\:","\\tmspace+{4mu}{.2222em}"),Hu("\\medspace","\\:"),Hu("\\;","\\tmspace+{5mu}{.2777em}"),Hu("\\thickspace","\\;"),Hu("\\!","\\tmspace-{3mu}{.1667em}"),Hu("\\negthinspace","\\!"),Hu("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Hu("\\negthickspace","\\tmspace-{5mu}{.277em}"),Hu("\\enspace","\\kern.5em "),Hu("\\enskip","\\hskip.5em\\relax"),Hu("\\quad","\\hskip1em\\relax"),Hu("\\qquad","\\hskip2em\\relax"),Hu("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Hu("\\tag@paren","\\tag@literal{({#1})}"),Hu("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new rl("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Hu("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Hu("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Hu("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Hu("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Hu("\\newline","\\\\\\relax"),Hu("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Hh=$l(Rl["Main-Regular"]["T".charCodeAt(0)][1]-.7*Rl["Main-Regular"]["A".charCodeAt(0)][1]);Hu("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Hh+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Hu("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Hh+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Hu("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Hu("\\@hspace","\\hskip #1\\relax"),Hu("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Hu("\\ordinarycolon",":"),Hu("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Hu("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Hu("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Hu("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Hu("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Hu("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Hu("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Hu("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Hu("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Hu("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Hu("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Hu("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Hu("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Hu("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Hu("∷","\\dblcolon"),Hu("∹","\\eqcolon"),Hu("≔","\\coloneqq"),Hu("≕","\\eqqcolon"),Hu("⩴","\\Coloneqq"),Hu("\\ratio","\\vcentcolon"),Hu("\\coloncolon","\\dblcolon"),Hu("\\colonequals","\\coloneqq"),Hu("\\coloncolonequals","\\Coloneqq"),Hu("\\equalscolon","\\eqqcolon"),Hu("\\equalscoloncolon","\\Eqqcolon"),Hu("\\colonminus","\\coloneq"),Hu("\\coloncolonminus","\\Coloneq"),Hu("\\minuscolon","\\eqcolon"),Hu("\\minuscoloncolon","\\Eqcolon"),Hu("\\coloncolonapprox","\\Colonapprox"),Hu("\\coloncolonsim","\\Colonsim"),Hu("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Hu("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Hu("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Hu("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Hu("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Hu("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Hu("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Hu("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Hu("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Hu("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Hu("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Hu("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Hu("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Hu("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Hu("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Hu("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Hu("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Hu("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Hu("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Hu("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Hu("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Hu("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Hu("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Hu("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Hu("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Hu("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Hu("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Hu("\\imath","\\html@mathml{\\@imath}{ı}"),Hu("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Hu("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Hu("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Hu("⟦","\\llbracket"),Hu("⟧","\\rrbracket"),Hu("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Hu("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Hu("⦃","\\lBrace"),Hu("⦄","\\rBrace"),Hu("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Hu("⦵","\\minuso"),Hu("\\darr","\\downarrow"),Hu("\\dArr","\\Downarrow"),Hu("\\Darr","\\Downarrow"),Hu("\\lang","\\langle"),Hu("\\rang","\\rangle"),Hu("\\uarr","\\uparrow"),Hu("\\uArr","\\Uparrow"),Hu("\\Uarr","\\Uparrow"),Hu("\\N","\\mathbb{N}"),Hu("\\R","\\mathbb{R}"),Hu("\\Z","\\mathbb{Z}"),Hu("\\alef","\\aleph"),Hu("\\alefsym","\\aleph"),Hu("\\Alpha","\\mathrm{A}"),Hu("\\Beta","\\mathrm{B}"),Hu("\\bull","\\bullet"),Hu("\\Chi","\\mathrm{X}"),Hu("\\clubs","\\clubsuit"),Hu("\\cnums","\\mathbb{C}"),Hu("\\Complex","\\mathbb{C}"),Hu("\\Dagger","\\ddagger"),Hu("\\diamonds","\\diamondsuit"),Hu("\\empty","\\emptyset"),Hu("\\Epsilon","\\mathrm{E}"),Hu("\\Eta","\\mathrm{H}"),Hu("\\exist","\\exists"),Hu("\\harr","\\leftrightarrow"),Hu("\\hArr","\\Leftrightarrow"),Hu("\\Harr","\\Leftrightarrow"),Hu("\\hearts","\\heartsuit"),Hu("\\image","\\Im"),Hu("\\infin","\\infty"),Hu("\\Iota","\\mathrm{I}"),Hu("\\isin","\\in"),Hu("\\Kappa","\\mathrm{K}"),Hu("\\larr","\\leftarrow"),Hu("\\lArr","\\Leftarrow"),Hu("\\Larr","\\Leftarrow"),Hu("\\lrarr","\\leftrightarrow"),Hu("\\lrArr","\\Leftrightarrow"),Hu("\\Lrarr","\\Leftrightarrow"),Hu("\\Mu","\\mathrm{M}"),Hu("\\natnums","\\mathbb{N}"),Hu("\\Nu","\\mathrm{N}"),Hu("\\Omicron","\\mathrm{O}"),Hu("\\plusmn","\\pm"),Hu("\\rarr","\\rightarrow"),Hu("\\rArr","\\Rightarrow"),Hu("\\Rarr","\\Rightarrow"),Hu("\\real","\\Re"),Hu("\\reals","\\mathbb{R}"),Hu("\\Reals","\\mathbb{R}"),Hu("\\Rho","\\mathrm{P}"),Hu("\\sdot","\\cdot"),Hu("\\sect","\\S"),Hu("\\spades","\\spadesuit"),Hu("\\sub","\\subset"),Hu("\\sube","\\subseteq"),Hu("\\supe","\\supseteq"),Hu("\\Tau","\\mathrm{T}"),Hu("\\thetasym","\\vartheta"),Hu("\\weierp","\\wp"),Hu("\\Zeta","\\mathrm{Z}"),Hu("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Hu("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Hu("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Hu("\\bra","\\mathinner{\\langle{#1}|}"),Hu("\\ket","\\mathinner{|{#1}\\rangle}"),Hu("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Hu("\\Bra","\\left\\langle#1\\right|"),Hu("\\Ket","\\left|#1\\right\\rangle");var jh=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=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),i.length&&n.macros.set("\\|",a));var s=t;return!t&&i.length&&"|"===n.future().text&&(n.popToken(),s=!0),{tokens:s?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.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}};Hu("\\bra@ket",jh(!1)),Hu("\\bra@set",jh(!0)),Hu("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Hu("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Hu("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Hu("\\angln","{\\angl n}"),Hu("\\blue","\\textcolor{##6495ed}{#1}"),Hu("\\orange","\\textcolor{##ffa500}{#1}"),Hu("\\pink","\\textcolor{##ff00af}{#1}"),Hu("\\red","\\textcolor{##df0030}{#1}"),Hu("\\green","\\textcolor{##28ae7b}{#1}"),Hu("\\gray","\\textcolor{gray}{#1}"),Hu("\\purple","\\textcolor{##9d38bd}{#1}"),Hu("\\blueA","\\textcolor{##ccfaff}{#1}"),Hu("\\blueB","\\textcolor{##80f6ff}{#1}"),Hu("\\blueC","\\textcolor{##63d9ea}{#1}"),Hu("\\blueD","\\textcolor{##11accd}{#1}"),Hu("\\blueE","\\textcolor{##0c7f99}{#1}"),Hu("\\tealA","\\textcolor{##94fff5}{#1}"),Hu("\\tealB","\\textcolor{##26edd5}{#1}"),Hu("\\tealC","\\textcolor{##01d1c1}{#1}"),Hu("\\tealD","\\textcolor{##01a995}{#1}"),Hu("\\tealE","\\textcolor{##208170}{#1}"),Hu("\\greenA","\\textcolor{##b6ffb0}{#1}"),Hu("\\greenB","\\textcolor{##8af281}{#1}"),Hu("\\greenC","\\textcolor{##74cf70}{#1}"),Hu("\\greenD","\\textcolor{##1fab54}{#1}"),Hu("\\greenE","\\textcolor{##0d923f}{#1}"),Hu("\\goldA","\\textcolor{##ffd0a9}{#1}"),Hu("\\goldB","\\textcolor{##ffbb71}{#1}"),Hu("\\goldC","\\textcolor{##ff9c39}{#1}"),Hu("\\goldD","\\textcolor{##e07d10}{#1}"),Hu("\\goldE","\\textcolor{##a75a05}{#1}"),Hu("\\redA","\\textcolor{##fca9a9}{#1}"),Hu("\\redB","\\textcolor{##ff8482}{#1}"),Hu("\\redC","\\textcolor{##f9685d}{#1}"),Hu("\\redD","\\textcolor{##e84d39}{#1}"),Hu("\\redE","\\textcolor{##bc2612}{#1}"),Hu("\\maroonA","\\textcolor{##ffbde0}{#1}"),Hu("\\maroonB","\\textcolor{##ff92c6}{#1}"),Hu("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Hu("\\maroonD","\\textcolor{##ca337c}{#1}"),Hu("\\maroonE","\\textcolor{##9e034e}{#1}"),Hu("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Hu("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Hu("\\purpleC","\\textcolor{##aa87ff}{#1}"),Hu("\\purpleD","\\textcolor{##7854ab}{#1}"),Hu("\\purpleE","\\textcolor{##543b78}{#1}"),Hu("\\mintA","\\textcolor{##f5f9e8}{#1}"),Hu("\\mintB","\\textcolor{##edf2df}{#1}"),Hu("\\mintC","\\textcolor{##e0e5cc}{#1}"),Hu("\\grayA","\\textcolor{##f6f7f7}{#1}"),Hu("\\grayB","\\textcolor{##f0f1f2}{#1}"),Hu("\\grayC","\\textcolor{##e3e5e6}{#1}"),Hu("\\grayD","\\textcolor{##d6d8da}{#1}"),Hu("\\grayE","\\textcolor{##babec2}{#1}"),Hu("\\grayF","\\textcolor{##888d93}{#1}"),Hu("\\grayG","\\textcolor{##626569}{#1}"),Hu("\\grayH","\\textcolor{##3b3e40}{#1}"),Hu("\\grayI","\\textcolor{##21242c}{#1}"),Hu("\\kaBlue","\\textcolor{##314453}{#1}"),Hu("\\kaGreen","\\textcolor{##71B307}{#1}");var Fh={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Uh{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 Eh(Oh,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Nh(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,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new nl("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,i=this.future(),s=0,o=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++s;else if("}"===r.text){if(-1===--s)throw new rl("Extra }",r)}else if("EOF"===r.text)throw new rl("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",r);if(e&&n)if((0===s||1===s&&"{"===e[o])&&r.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==s||n);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new rl("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new rl("Use of the macro doesn't match its definition",i)}}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 rl("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new rl("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,s=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var o=(i=i.slice()).length-1;o>=0;--o){var a=i[o];if("#"===a.text){if(0===o)throw new rl("Incomplete placeholder at end of macro body",a);if("#"===(a=i[--o]).text)i.splice(o+1,1);else{if(!/^[1-9]$/.test(a.text))throw new rl("Not a valid argument number",a);i.splice(o,2,...s[+a.text-1])}}}return this.pushTokens(i),i.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 nl(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 r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}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 r="function"==typeof t?t(this):t;if("string"==typeof r){var i=0;if(-1!==r.indexOf("#"))for(var s=r.replace(/##/g,"");-1!==s.indexOf("#"+(i+1));)++i;for(var o=new Nh(r,this.settings),a=[],l=o.lex();"EOF"!==l.text;)a.push(l),l=o.lex();return a.reverse(),{tokens:a,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Th.hasOwnProperty(e)||lc.math.hasOwnProperty(e)||lc.text.hasOwnProperty(e)||Fh.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Th.hasOwnProperty(e)&&!Th[e].primitive}}var qh=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,$h=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",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),Gh={"́":{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"}},Xh={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Kh{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 Uh(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 rl("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 nl("}")),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 r=this.fetch();if(-1!==Kh.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&Th[r.text]&&Th[r.text].infix)break;var i=this.parseAtom(t);if(!i)break;"internal"!==i.type&&n.push(i)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++)if("infix"===e[r].type){if(-1!==n)throw new rl("only one infix operator per group",e[r].token);n=r,t=e[r].replaceWith}if(-1!==n&&t){var i,s,o=e.slice(0,n),a=e.slice(n+1);return i=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,[i,e[n],s],[]):this.callFunction(t,[i,s],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do{var i;t=this.parseGroup(e)}while("internal"===(null==(i=t)?void 0:i.type));if(!t)throw new rl("Expected group after '"+r+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("internal"===(null==r?void 0:r.type))return r;if("text"===this.mode)return r;for(;;){this.consumeSpaces();var i=this.fetch();if("\\limits"===i.text||"\\nolimits"===i.text){if(r&&"op"===r.type){var s="\\limits"===i.text;r.limits=s,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new rl("Limit controls must follow a math operator",i);r.alwaysHandleSupSub&&(r.limits="\\limits"===i.text)}this.consume()}else if("^"===i.text){if(t)throw new rl("Double superscript",i);t=this.handleSupSubscript("superscript")}else if("_"===i.text){if(n)throw new rl("Double subscript",i);n=this.handleSupSubscript("subscript")}else if("'"===i.text){if(t)throw new rl("Double superscript",i);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(!$h[i.text])break;var l=qh.test(i.text),c=[];for(c.push(new nl($h[i.text])),this.consume();;){var d=this.fetch().text;if(!$h[d])break;if(qh.test(d)!==l)break;c.unshift(new nl($h[d])),this.consume()}var u=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:u}:t={type:"ordgroup",mode:"math",body:u}}}return t||n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,i=Th[r];if(!i)return null;if(this.consume(),t&&"atom"!==t&&!i.allowedInArgument)throw new rl("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!i.allowedInText)throw new rl("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===i.allowedInMath)throw new rl("Can't use function '"+r+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,s,o,n,e)}callFunction(e,t,n,r,i){var s={funcName:e,parser:this,token:r,breakOnTokenText:i},o=Th[e];if(o&&o.handler)return o.handler(s,t,n);throw new rl("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],i=[],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==i[0])&&(o="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",o,a);if(a)i.push(l);else{if(null==l)throw new rl("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:i}}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 r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var i=this.parseStringGroup("raw",n);return null!=i?{type:"raw",mode:"text",string:i.text}:null;case"primitive":if(n)throw new rl("A primitive argument cannot be optional");var s=this.parseGroup(e);if(null==s)throw new rl("Expected group as "+e,this.fetch());return s;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new rl("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 r,i="";"EOF"!==(r=this.fetch()).text;)i+=r.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,t){for(var n,r=this.fetch(),i=r,s="";"EOF"!==(n=this.fetch()).text&&e.test(s+n.text);)s+=(i=n).text,this.consume();if(""===s)throw new rl("Invalid "+t+": '"+r.text+"'",r);return r.range(i,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 rl("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}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 r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new rl("Invalid size: '"+t.text+"'",t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!Ul(i))throw new rl("Invalid unit: '"+i.unit+"'",t);return{type:"size",mode:this.mode,value:i,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 r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),s}parseGroup(e,t){var n,r=this.fetch(),i=r.text;if("{"===i||"\\begingroup"===i){this.consume();var s="{"===i?"}":"\\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:tl.range(r,a),body:o,semisimple:"\\begingroup"===i||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===i[0]&&!Fh.hasOwnProperty(i)){if(this.settings.throwOnError)throw new rl("Undefined control sequence: "+i,r);n=this.formatUnsupportedCmd(i),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],i=r.text;"-"===i&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:tl.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:tl.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==i&&"`"!==i||e[n+1].text!==i||(e.splice(n,2,{type:"textord",mode:"text",loc:tl.range(r,e[n+1]),text:i+i}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new rl("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Xh.hasOwnProperty(t[0])&&!lc[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=Xh[t[0]]+t.slice(1));var i,s=Ph.exec(t);if(s&&("i"===(t=t.substring(0,s.index))?t="ı":"j"===t&&(t="ȷ")),lc[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=lc[this.mode][t].group,l=tl.range(e);if(oc.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};i=o}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(zl(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)),i={type:"textord",mode:"text",loc:tl.range(e),text:t}}if(this.consume(),s)for(var d=0;d<s[0].length;d++){var u=s[0][d];if(!Gh[u])throw new rl("Unknown accent ' "+u+"'",e);var h=Gh[u][this.mode]||Gh[u].text;if(!h)throw new rl("Accent "+u+" unsupported in "+this.mode+" mode",e);i={type:"accent",mode:this.mode,loc:tl.range(e),label:h,isStretchy:!1,isShifty:!0,base:i}}return i}}Kh.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 Wh=function(e,t){var n=new gl(t);try{return function(e,t,n){var r,i=function(e){return new Hl({style:e.displayMode?Ml.DISPLAY:Ml.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})}(n);if("mathml"===n.output)return Id(e,t,i,n.displayMode,!0);if("html"===n.output){var s=Sd(e,i);r=Qc.makeSpan(["katex"],[s])}else{var o=Id(e,t,i,n.displayMode,!1),a=Sd(e,i);r=Qc.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=Qc.makeSpan(n,[e])}return e}(r,n)}(function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Kh(e,t);delete n.gullet.macros.current["\\df@tag"];var r=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 rl("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new nl("\\df@tag")])}]}return r}(e,n),e,n)}catch(t){return function(e,t,n){if(n.throwOnError||!(e instanceof rl))throw e;var r=Qc.makeSpan(["katex-error"],[new tc(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r}(t,e,n)}};class Yh{static update(e,t,n,r=!1){return{id:e,name:a.nY.update,size:n,latex:t,block:r}}}class Zh extends o._D{_mathml=(0,l.KR)("");constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return el}get mathml(){const e=this.attrs.size+this.info;return Zh.render(e,{displayMode:this.attrs.block})}get attrs(){return this.data.attrs}get meta(){return Zh.meta}build_child(e){}export(){return this.base_export()}gc(){super.base_gc()}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return Zh.replace_id(this.root,e,t)}update(e){const{latex:t,block:n,size:r}=e,{courier:i,id:s}=this,o=i.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=r,o.add_recover(Yh.update(s,a,c,l)),o}static render(e,t={}){const n={...t,throwOnError:!1,output:"html"};try{return function(e,t){return Wh(e,t).toMarkup()}(e,{...n})}catch(e){return""}}static get meta(){return{cubename:"公式",type:a.u0.fomula,block:!1,version:1,show:!0}}static get_default(e="",t={},n={}){return{id:g.I.get_id(),type:a.u0.fomula,info:e,attrs:{block:!1,size:a.$f.h4,...n},css:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.nY.update)],Zh.prototype,"update",null);class Qh{static add_title(e,t){return{id:e,name:a.BS.add_title,data:t}}static remove_title(e){return{id:e,name:a.BS.remove_title}}static add_cell(e,t){return{id:e,name:a.BS.add_cell,data:t}}static remove_cell(e,t){return{id:e,name:a.BS.remove_cell,cid:t}}static add_row(e,t,n){return{id:e,name:a.BS.add_row,index:t,rows:n}}static remove_row(e,t){return{id:e,name:a.BS.remove_row,index:t}}static add_col(e,t,n){return{id:e,name:a.BS.add_col,index:t,cols:n}}static remove_col(e,t){return{id:e,name:a.BS.remove_col,index:t}}static moveto(e,t,n){return{id:e,name:a.BS.moveto,tid:t,cells:n}}static merge(e,t){return{id:e,name:a.BS.merge,area:t}}static update_cell_area(e,t,n){return{id:e,name:a.BS.update_area,tid:t,area:n}}static add_grid_col(e,t,n){return{id:e,name:a.BS.add_grid_col,index:t,width:n}}static remove_grid_col(e,t){return{id:e,name:a.BS.remove_grid_col,index:t}}static col_resize(e,t,n){return{id:e,name:a.BS.col_resize,cols:t,step:n}}}function Jh(e,t){const{hotkeys:n,courier:r,id:i,history:s}=t,o=Ka.F.tips;if(n.validate_hotkeys(e))return;if(!e.ctrlKey)return;e.stopPropagation();const l=e.key.toLowerCase(),c=e.shiftKey,d=t.get_active_cell();if(!d)return o?.tip_info("未发现激活单元格");if(l===a.tX.up)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_row_top(e.top))return o?.tip_info("上方不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[1];e++)i.push(xt.get_default());n.tell(t,Qh.add_row(t.id,d.row,i)),s.record(n)}else{if(t.get_cell(d.row-1,d.col))return o?.tip_info("上方已存在单元格");if(d.row-1<0)return o?.tip_info("上方已达边界");{const e=r.get_recorder(),n={row:d.row-1,col:d.col,rowspan:1,colspan:1,data:xt.get_default()};e.tell(t,Qh.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.down)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_row_bottom(e.bottom))return o?.tip_info("下方不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[1];e++)i.push(xt.get_default());n.tell(t,Qh.add_row(t.id,d.row+d.rowspan,i)),s.record(n)}else{if(t.get_cell(d.row+1,d.col))return o?.tip_info("下方已存在单元格");if(d.row+1>=t.size[0])return o?.tip_info("下方已达边界");{const e=r.get_recorder(),n={row:d.row+1,col:d.col,rowspan:1,colspan:1,data:xt.get_default()};e.tell(t,Qh.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.left)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_col_left(e.left))return o?.tip_info("左侧不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[0];e++)i.push(xt.get_default());n.tell(t,Qh.add_col(t.id,d.col,i)),s.record(n)}else{if(t.get_cell(d.row,d.col-1))return o?.tip_info("左侧已存在单元格");if(d.col-1<0)return o?.tip_info("左侧已达边界");{const e=r.get_recorder(),n={row:d.row,col:d.col-1,rowspan:1,colspan:1,data:xt.get_default()};e.tell(t,Qh.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.right)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_col_right(e.right))return o?.tip_info("右侧不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[0];e++)i.push(xt.get_default());n.tell(t,Qh.add_col(t.id,d.col+d.colspan,i)),s.record(n)}else{if(t.get_cell(d.row,d.col+1))return o?.tip_info("右侧已存在单元格");if(d.col+1>=t.size[1])return o?.tip_info("右侧已达边界");{const e=r.get_recorder(),n={row:d.row,col:d.col+1,rowspan:1,colspan:1,data:xt.get_default()};e.tell(t,Qh.add_cell(t.id,n)),s.record(e)}}}const ep={drag_cell:void 0,hover:void 0};function tp(e,t){const n=e.currentTarget;n.parentElement?.style.setProperty("--drag-pointer-events","none"),e.stopPropagation(),ep.drag_cell=t}function np(e,t){if(ep.drag_cell===t)return;const n=e.currentTarget;n.classList.add("cube-cell-selection"),ep.hover=n}function rp(e,t){e.currentTarget.classList.remove("cube-cell-selection")}function ip(e,t){const{drag_cell:n,hover:r}=ep,{pcube:i,courier:s,history:o}=t.box;if(!n)return;const a=e.currentTarget;a.parentElement?.style.setProperty("--drag-pointer-events","auto"),r&&r.classList.remove("cube-cell-selection");const l=s.get_recorder();l.tell(i,Qh.moveto(i.id,t.box.id,[n.box.id])),o.record(l)}const sp={anchor:void 0,hover:void 0,down_point:void 0,has_down:!1,has_move:!1};function op(e,t){const{root:n,cursor:r}=t;if(e.ctrlKey)e.stopPropagation();else{g.I.check_mouse_key(e,"left")&&t.clear_selection();const n=e.target;if(!(n instanceof Node))return;const r=t.find_dom_cube(n),i=r?.find_upstream_untill(t);if(!i)return;const s=t.cells.find(e=>e.box===i);if(!s)return;sp.down_point={x:e.clientX,y:e.clientY},sp.has_down=!0,sp.anchor=s}}function ap(e,t){const{cursor:n}=t,{down_point:r,has_down:i,anchor:s,has_move:o}=sp;if(!r)return;if(sp.has_move=Math.sqrt((e.clientX-r.x)**2+(e.clientY-r.y)**2)>5,!i||!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 u={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)},h=t.get_rectarea_cell(u);t.clear_selection();for(let e of h.cells)e.selection=!0;h.cells.length>1&&e.stopPropagation()}function lp(e,t){const{cursor:n}=t;sp.has_down=!1,sp.anchor=void 0}const cp=["id","data-type"],dp=(0,c.pM)({__name:"cube-table",props:{cube:{}},setup(e){const t=(0,c.rk)("dragger"),n=(0,c.rk)("box");function r(e){return{"grid-row":`${e.row+1}/span ${e.rowspan}`,"grid-column":`${e.col+1}/span ${e.colspan}`}}function i(e){return{"cube-cell-selection":e.selection}}const s=(0,c.EW)(()=>({"grid-template-columns":e.cube.cols.map(e=>e>0?e+"fr":"1fr").join(" ")}));return(0,c.sV)(()=>{const r=t.value,i=n.value;if(!r||!i)return;let s=e.cube.data.attrs.width,a=s;const l=new N.DragDiff(r);l.register_down(()=>{s=e.cube.data.attrs.width}),l.register_move((t,n)=>{s+t<e.cube.min_width||(a=s+t,i.style.width=a+"px")}),l.register_up((t,n)=>{if(a===s)return;const{courier:r,history:i}=e.cube,l=r.get_recorder();l.tell(e.cube,o.VL.resize(e.cube.id,a)),i.record(l)}),l.register_cancel(()=>{i.style.width=s+"px"})}),(e,o)=>((0,c.uX)(),(0,c.CE)("div",{ref_key:"box",ref:n,class:"cube-table",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).table,onPointerdown:o[0]||(o[0]=t=>(0,l.R1)(op)(t,e.cube)),onPointermove:o[1]||(o[1]=t=>(0,l.R1)(ap)(t,e.cube)),onPointerup:o[2]||(o[2]=t=>(0,l.R1)(lp)(t,e.cube)),onPointercancel:o[3]||(o[3]=t=>(0,l.R1)(lp)(t,e.cube)),onKeyup:o[4]||(o[4]=t=>(0,l.R1)(Jh)(t,e.cube)),onContextmenu:o[5]||(o[5]=t=>(0,l.R1)(at.uz)(t,e.cube))},[e.cube.title?((0,c.uX)(),(0,c.Wv)(S,{key:0,class:"cube-table-title",cube:(0,l.IG)(e.cube.title)},null,8,["cube"])):(0,c.Q3)("v-if",!0),(0,c.Lk)("div",{class:"cube-table-container",style:(0,d.Tr)(s.value)},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.cells,(e,t)=>((0,c.uX)(),(0,c.Wv)(S,{key:e.box.id,cube:(0,l.IG)(e.box),style:(0,d.Tr)(r(e)),class:(0,d.C4)(i(e)),draggable:"true",onDragstart:t=>(0,l.R1)(tp)(t,e),onDragenter:t=>(0,l.R1)(np)(t,e),onDragleave:t=>(0,l.R1)(rp)(t,e),onDrop:t=>(0,l.R1)(ip)(t,e)},null,8,["cube","style","class","onDragstart","onDragenter","onDragleave","onDrop"]))),128))],4),(0,c.Lk)("div",{class:"cube-table-dragger",ref_key:"dragger",ref:t},null,512)],44,cp))}}),up=(0,f.A)(dp,[["__scopeId","data-v-727c5c78"]]);function hp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class pp extends o._D{cells=(0,l.Kh)([]);_title=(0,l.KR)(void 0);get title(){return this._title.value}set title(e){this._title.value=e}get component(){return up}get meta(){return pp.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=(0,l.IG)(new xt(e.info.title,this)));for(let t of e.info.cells){const e=new xt(t.data,this),n={row:t.row,col:t.col,rowspan:t.rowspan,colspan:t.colspan,box:(0,l.IG)(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){return{usable:!0,data:e}}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 pp.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 r=1===new Set(n.map(e=>e.right)).size,i=1===new Set(n.map(e=>e.left)).size;return r&&i}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 r=1===new Set(n.map(e=>e.bottom)).size,i=1===new Set(n.map(e=>e.top)).size;return r&&i}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 r=e>=n.row&&e<n.row+n.rowspan,i=t>=n.col&&t<n.col+n.colspan;if(r&&i)return n}}get_rectarea_cell(e){let t=!1;for(;!t;){const{left:n,right:r,top:i,bottom:s}=e;for(let o of this.cells){let{row:a,rowspan:l,col:c,colspan:d}=o,u=a,h=a+l-1,p=c,f=c+d-1;if(n>=p&&n<=f||n<=p&&f<=r||r>=p&&r<=f){if(u<i&&h>=i){e.top=a;break}if(u<=s&&h>s){e.bottom=a+l-1;break}}if(i>=u&&i<=h||i<u&&s>=h||s>=u&&s<=h){if(p<n&&f>=n){e.left=c;break}if(p<=r&&f>r){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:r,col:i,rowspan:s,colspan:o}=t;i>=e.left&&i+o-1<=e.right&&r>=e.top&&r+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 r of n){const n=this.get_cell_area(r);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 r=[];for(let e of t)r.push({row:e.row-n.top,col:e.col-n.left,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()});const i=pp.get_default_by_data(e,r);return i.attrs=structuredClone((0,l.ux)(this.attrs)),i}add_title(e){const{data:t}=e,{courier:n,cursor:r,id:i}=this,s=n.get_recorder();s.add_cmd(e);const o=new xt(t,this);return this.title=(0,l.IG)(o),s.add_recover(Qh.remove_title(i)),s}remove_title(e){const{id:t,courier:n,cursor:r}=this;if(!this.title)return;const i=this.title.export(),s=n.get_recorder();return s.add_cmd(e),this.title=void 0,s.add_recover(Qh.add_title(t,i)),s}add_cell(e){const{id:t,courier:n,cursor:r}=this,{data:i}=e;this.clear_selection();const s=n.get_recorder();s.add_cmd(e);const o={row:i.row,col:i.col,rowspan:i.rowspan,colspan:i.colspan,box:(0,l.IG)(new xt(i.data,this)),selection:!1};return this.cells.push(o),s.add_recover(Qh.remove_cell(t,o.box.id)),s}remove_cell(e){const{id:t,courier:n,cursor:r}=this,{cid:i}=e,s=n.get_recorder();s.add_cmd(e);const o=this.cells.findIndex(e=>e.box.id===i),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(Qh.add_cell(t,l)),s}add_row(e){const{courier:t,cursor:n,id:r}=this,{index:i,rows:s}=e,o=t.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:i,col:e,rowspan:1,colspan:1,data:t})}this.size[0]++;for(let e of this.cells)e.row<i||o.tell(this,Qh.update_cell_area(r,e.box.id,{row:e.row+1,col:e.col,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,Qh.add_cell(r,e));return o}remove_row(e){const{id:t,courier:n,cursor:r}=this,{index:i}=e,s=this.get_rows(i),o=n.get_recorder();for(let e of s)o.tell(this,Qh.remove_cell(t,e.box.id));return this.size[0]--,o}add_col(e){const{id:t,cursor:n,courier:r}=this,{index:i,cols:s}=e,o=r.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:e,col:i,rowspan:1,colspan:1,data:t})}o.tell(this,Qh.add_grid_col(t,i,2));for(let e of this.cells)e.col<i||o.tell(this,Qh.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,Qh.add_cell(t,e));return o}remove_col(e){const{id:t,cursor:n,courier:r}=this,{index:i}=e;if(!this.check_orderly_col(i))return Ka.F.tips?.tip_info("目标列不整齐");let s;for(let e=0;e<=this.size[0]&&(s||(s=this.get_cell(e,i),!s));e++);if(!s)return;const o=r.get_recorder();for(let e=s.col;e<s.col+s.colspan;e++)o.tell(this,Qh.remove_grid_col(t,e));const a=this.get_cols(i);for(let e of a)o.tell(this,Qh.remove_cell(t,e.box.id));for(let e of this.cells){if(e.col<i)continue;const n={row:e.row,col:e.col-1,rowspan:e.rowspan,colspan:e.colspan};o.tell(this,Qh.update_cell_area(t,e.box.id,n))}return o}moveto(e){const{id:t,courier:n,cursor:r}=this,{tid:i,cells:s}=e,a=n.get_recorder(),l=this.cells.find(e=>e.box.id===i);if(!l)return;const c=l.box,d=this.cells_sorted.filter(e=>e.box.id!==i&&s.includes(e.box.id));for(let e of d){const n=e.box.export();a.tell(this,Qh.remove_cell(t,e.box.id)),a.tell(c,o.VL.insert_child(c.id,n.info,c.child_count))}return a}update_area(e){const{id:t,courier:n,cursor:r}=this,{tid:i,area:s}=e,o=n.get_recorder(),a=this.cells.find(e=>e.box.id===i);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(Qh.update_cell_area(t,i,l)),o}merge_cell(e){const{id:t,cursor:n,courier:r}=this,{area:i}=e,s=r.get_recorder(),o=this.get_rectarea_cell(i);let a=o.cells[0];if(!a)return;const l={row:i.top,col:i.left,rowspan:i.bottom-i.top+1,colspan:i.right-i.left+1},c=a.box.id;return s.tell(this,Qh.update_cell_area(t,c,l)),s.tell(this,Qh.moveto(t,c,o.cells.map(e=>e.box.id))),s}add_grid_col(e){const{id:t,courier:n,cursor:r}=this,{index:i,width:s}=e,o=n.get_recorder();return o.add_cmd(e),this.cols.splice(i,0,s),this.size[1]++,o.add_recover(Qh.remove_grid_col(t,i)),o}remove_grid_col(e){const{id:t,courier:n,cursor:r}=this,{index:i}=e,s=n.get_recorder(),o=this.cols.splice(i,1);if(0!==o.length)return this.size[1]--,s.add_recover(Qh.add_grid_col(t,i,o[0])),s}col_resize(e){const{id:t,courier:n,cursor:r}=this,{cols:i,step:s}=e,o=n.get_recorder();o.add_cmd(e);let a=!1;for(let e=i[0];e<=i[1];e++){let t=this.cols[e]+s;t<=0||(a=!0,this.cols[e]=t)}if(a)return o.add_recover(Qh.col_resize(t,i,-s)),o}delete_child(e){const{dir:t,range:n,reserve:r}=e,{courier:i,cursor:s,history:a}=this,l=i.get_recorder();let[c,d]=this.get_valid_range(n);if(0===c&&d>=this.child_count)if(r){if(this.is_empty)return;const e=this.child_first;l.tell(this,o.VL.delete_child(this.id,"backward",[1,this.child_count],r)),l.tell(e,o.VL.delete_child(e.id,"backward",[0,e.child_count],r))}else l.merge(this.remove_self());else{let e=[];for(let t=c;t<d;t++){let n=this.children[t];e.push(n.id)}for(let t of e)l.tell(this,Qh.remove_cell(this.id,t))}return l}static get meta(){return{cubename:"表格",type:a.u0.table,block:!0,version:1,show:!0}}static get_default(e=3,t=3){const n=[],r=[];r.length=t,r.fill(2);for(let r=0;r<e;r++)for(let e=0;e<t;e++){const t={row:r,col:e,rowspan:1,colspan:1,data:xt.get_default()};n.push(t)}return{id:g.I.get_id(),type:a.u0.table,info:{size:[e,t],cols:r,cells:n},attrs:{width:500},css:{}}}static get_default_by_data(e,t){const[n,r]=e,i=[];return i.length=r,i.fill(2),{id:g.I.get_id(),type:a.u0.table,info:{size:[n,r],cols:i,cells:t},attrs:{width:500},css:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i,t.info.title&&(t.info.title=xt.replace_id(e,t.info.title,n));for(let r of t.info.cells)r.data=xt.replace_id(e,r.data,n);return t}}hp([(0,k.H)(a.BS.add_title)],pp.prototype,"add_title",null),hp([(0,k.H)(a.BS.remove_title)],pp.prototype,"remove_title",null),hp([(0,k.H)(a.BS.add_cell)],pp.prototype,"add_cell",null),hp([(0,k.H)(a.BS.remove_cell)],pp.prototype,"remove_cell",null),hp([(0,k.H)(a.BS.add_row)],pp.prototype,"add_row",null),hp([(0,k.H)(a.BS.remove_row)],pp.prototype,"remove_row",null),hp([(0,k.H)(a.BS.add_col)],pp.prototype,"add_col",null),hp([(0,k.H)(a.BS.remove_col)],pp.prototype,"remove_col",null),hp([(0,k.H)(a.BS.moveto)],pp.prototype,"moveto",null),hp([(0,k.H)(a.BS.update_area)],pp.prototype,"update_area",null),hp([(0,k.H)(a.BS.merge)],pp.prototype,"merge_cell",null),hp([(0,k.H)(a.BS.add_grid_col)],pp.prototype,"add_grid_col",null),hp([(0,k.H)(a.BS.remove_grid_col)],pp.prototype,"remove_grid_col",null),hp([(0,k.H)(a.BS.col_resize)],pp.prototype,"col_resize",null),hp([(0,k.H)(a.zS.cube_delete_child)],pp.prototype,"delete_child",null);const fp=["id","data-type"],mp=(0,c.pM)({__name:"cube-tip",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-tip",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).tip},[(0,c.bF)(S,{cube:e.cube.box},null,8,["cube"])],12,fp))}),_p=(0,f.A)(mp,[["__scopeId","data-v-433bbb71"]]);function gp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class bp extends o._D{_component=_p;get component(){return this._component}get children(){return[this.box]}box;constructor(e,t){return super(e,t),this.setup(e,t)}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return bp.replace_id(this.root,e,t)}build_child(e){this.box=new xt(e.info,this)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}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:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return this.is_empty?s.tell(i,o.VL.delete_child(n,a,[r,r+1])):s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],f=this.children[h],m=h-u;let _=this.splice(c,m);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):f&&s.tell(f,o.UB.in_head(f.id,0)):"forward"===a&&(f?s.tell(f,o.UB.in_head(f.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}get meta(){return bp.meta}static get meta(){return{cubename:"提示",type:a.u0.tip,block:!0,version:1,show:!0}}static get_default(e,t={},n={}){return{id:g.I.get_id(),type:a.u0.tip,info:xt.get_default(e),attrs:n,css:t}}static get_default_by_string(e,t={},n={}){const r=gt.get_default_by_string(e),i=xt.get_default([r]);return{id:g.I.get_id(),type:a.u0.tip,info:i,attrs:n,css:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t.info=xt.replace_id(e,t.info,n),t}}gp([(0,k.H)(a.zS.cube_insert_child)],bp.prototype,"on_insert_child",null),gp([(0,k.H)(a.zS.cube_delete_child)],bp.prototype,"on_delete_child",null),gp([(0,k.H)(a.zS.cube_reset)],bp.prototype,"on_reset",null);const vp=["id","data-type"],yp=(0,c.pM)({__name:"cube-box-columns",props:{cube:{}},setup(e){const t=(0,l.KR)(),n=(0,l.KR)();let r;return(0,l.Kh)({open:!1}),(0,c.sV)(()=>{const i=t.value;if(!i)return;const s=n.value;if(!s)return;r=new N.DragDiff(s);let a=e.cube.attrs.width,l=e.cube.attrs.height,c=a,d=l;r.register_down(()=>{a=e.cube.attrs.width,l=e.cube.attrs.height}),r.register_move((t,n)=>{c=Math.round(t+a),c<e.cube.min_width&&(c=e.cube.min_width),i.style.width=c+"px",i.style.height=d+"px"}),r.register_up((t,n)=>{if(a===c&&l===d)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+a);r.tell(e.cube,o.VL.resize(e.cube.id,i)),e.cube.history.record(r)}),r.register_cancel(()=>{e.cube.attrs.width=a,e.cube.attrs.height=l})}),(0,c.hi)(()=>{r?.off()}),(r,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box-columns",ref_key:"box",ref:t,style:(0,d.Tr)(r.cube.css),id:r.cube.id,"data-type":(0,l.R1)(a.u0).box_columns,onContextmenu:i[0]||(i[0]=e=>(0,l.R1)(at.uz)(e,r.cube))},[(0,c.Lk)("div",{class:"box-columns-content",style:(0,d.Tr)(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"}:{})},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(r.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],4),(0,c.Lk)("div",{class:"box-columns-dragger",ref_key:"dragger",ref:n},null,512)],44,vp))}}),wp=(0,f.A)(yp,[["__scopeId","data-v-622bc65f"]]);function xp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class kp extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return wp}get css(){const{width:e}=this.data.attrs;return{...super.css,width:e+"px"}}get attrs(){return this.data.attrs}get meta(){return kp.meta}get min_width(){return 200}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return{data:e,usable:!0}}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 kp.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t,history:n}=this,{data:r}=e,i=t.get_recorder();i.add_cmd(e);const s=g.I.build_cubes(e.data,this),a=this.child_count;return this._children.push(...s),i.add_recover(o.VL.delete_child(this.id,"backward",[a,this.child_count])),i}on_delete_child(e){const{courier:t,history:n}=this,{dir:r,range:i,reserve:s}=e,a=t.get_recorder(),l=this.get_valid_index(i[0]),c=this.get_valid_index(i[1]),d=[],u=this._children.splice(l,c-l);for(let e of u)d.push(e.export());return a.add_recover(o.VL.insert_child(this.id,d,l)),a}static replace_id(e,t,n){const r=t.id,i=n[r]||g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info,n),t}static get_default(){const e=xt.get_default(),t=xt.get_default(),n=xt.get_default();return{id:g.I.get_id(),type:a.u0.box_columns,info:[e,t,n],attrs:{width:400,column_count:3},css:{}}}static get meta(){return{cubename:"多列容器",type:a.u0.box_columns,block:!0,version:1,show:!0}}}xp([(0,k.H)(a.zS.cube_insert_child)],kp.prototype,"on_insert_child",null),xp([(0,k.H)(a.zS.cube_delete_child)],kp.prototype,"on_delete_child",null);class Sp{static reset(e,t){return{id:e,name:a.DI.reset_explanation,explanation:t}}}const Cp=["id","data-type"],Mp=(0,c.pM)({__name:"cube-rt",props:{cube:{}},setup(e){const{event:t}=e.cube;function n(){t.emit_show_cube_editor(e.cube)}return(t,r)=>((0,c.uX)(),(0,c.CE)("ruby",{class:"cube-rt",id:t.cube.id,style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).rt,onClick:n},[(0,c.eW)((0,d.v_)(t.cube.info.text)+" ",1),(0,c.Lk)("rt",{style:(0,d.Tr)({"font-size":`max(calc(0.6 * ${e.cube.css["font-size"]||"16px"}),${Tp.min_size}px)`})},(0,d.v_)(t.cube.info.explanation),5),r[0]||(r[0]=(0,c.eW)(" ",-1))],12,Cp))}});class Tp extends o._D{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 Mp}get meta(){return Tp.meta}build_child(e){}update_data(e){return{usable:!0,data:e}}export(){return this.base_export()}gc(){this.base_gc()}replace_id(e,t){return Tp.replace_id(this.root,e,t)}reset_explanation(e){const{explanation:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=this.info.explanation;this.info.explanation=t;const s=Sp.reset(this.id,i);return r.add_recover(s),r}static get meta(){return{cubename:"标注文本",type:a.u0.rt,block:!1,version:1,show:!1}}static get_default(e="",t="",n={}){return{id:g.I.get_id(),type:a.u0.rt,info:{text:e,explanation:t},attrs:{},css:n}}static replace_id(e,t,n){const r=t.id;return t.id=n[r]||g.I.get_id(),n[r]=t.id,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.DI.reset_explanation)],Tp.prototype,"reset_explanation",null)},1701:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(4089),i=n(4412),s=n(6996),o=n(1717);class a extends o.K{command_group_do=[];command_group_undo=[];get meta(){return a.meta}execute_command_group(e){if(this.stats.mode===s.fv.read)return;const t=(e,n,i)=>{n<i.length&&(0,r.dY)(()=>{this.pass(e),t(i[n+1],n+1,i)})};t(e[0],0,e)}constructor(e){super(e)}get_recorder(){return new i.vk(this)}pass(e){if(this.stats.mode===s.fv.read)return;const t=e,n=e.id,r=this.root.find_cube(n);if(!r)return void console.error("未发现cube:",n);console.log("🟨",r,r.type,t);const o=new i.vk(this);let a=r.on(t);return a instanceof i.vk&&o.merge(a),o}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.courier,version:1}}}},1717:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(1556);class i{_root;get root(){return this._root}get doc(){const e=this.root;if(e instanceof r.oY)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}}},1742:(e,t,n)=>{"use strict";n.d(t,{Bz:()=>s,NW:()=>o,h_:()=>i});var r=n(7633);const i=(0,r.Kh)({point:{x:0,y:0},css:{},cube:void 0,menu:void 0,stack_pos:[],stack_menus:[],stack_rect:[]}),s=(0,r.Kh)({open:!1,data:{},submit(){}});function o(e,t){s.open=!0,s.submit=t,s.data=e}},2189:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});class r{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)}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")}}},2277:(e,t,n)=>{"use strict";n.d(t,{P:()=>u});var r=n(1068),i=n(1556),s=n(7744),o=n(5955),a=n(6996),l=n(4412),c=n(1717),d=n(4089);class u extends c.K{selection;cursor_step=20;scroll_distance=50;safa_distance=20;get meta(){return u.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,r=this.get_node_cube(n,t);return r instanceof s._D?r:void 0}get cube_end(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.endContainer,r=this.get_node_cube(n,t);return r instanceof s._D?r: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 s._D?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 s._D?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 s="up"===e?t.prev_line:t.next_line;const o=t.clientRect;let a=s?.clientRect;for(;s&&a&&o&&(a.left>=o.right||a.right<=o.left);){let t="up"===e?s.prev_line:s.next_line;if(!t)break;s=t,a=t.clientRect}if(!s)return;const l=[],c=new Map;for(let e of s.children)if(e instanceof i.P6){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++)l.push(t[n]),c.set(t[n],e)}const d="up"===e?r.MathRect.get_rect_point(n.left,r._RectPosition.left_mid):r.MathRect.get_rect_point(n.left,r._RectPosition.right_mid),u=r.MathRect.get_nearest_rect(d,l);if(!u)return;const h=r.MathRect.get_shadow_point_horizental(d,u),p=document.caretPositionFromPoint(h.x,h.y);if(p&&p.offsetNode instanceof Text)this.set_cursor(p.offsetNode,p.offset);else if(p&&!(p.offsetNode instanceof Text)){const e=c.get(u);if(!e)return;e.set_cursor_in_tail()}}locate_current_line(e,t,n){const s=[],o=[],a=new Map;for(let e of t.children)if(e instanceof i.P6){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++){const r=t[n];s.push(r),a.set(r,e)}}if(1===s.length)return!1;if("up"===e){const e=n.left.top;for(let t of s)t.bottom<=e&&o.push(t)}else if("down"===e){const e=n.right.bottom;for(let t of s)t.y>=e&&o.push(t)}if(o.length>0){const t="down"===e?{x:n.right.x,y:n.right.y}:{x:n.left.x,y:n.left.y},i=r.MathRect.get_nearest_rect(t,o);if(!i)return!1;const s=r.MathRect.get_shadow_point_horizental(t,i),l=document.caretPositionFromPoint(s.x,s.y);if(l&&l.offsetNode instanceof Text)return this.set_cursor(l.offsetNode,l.offset),!0;{const e=a.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 i.P6&&n instanceof i.P6))return;const r="up"===e?t.line:n.line,s=this.get_selection_edge_position();r&&s&&(this.locate_current_line(e,r,s)||this.locate_next_line(e,r,s))}move_left(){if(!this.range)return;const{cube_start:e,offset_start:t,offset_end:n,node_end:r}=this,{doc:o,courier:a}=this,c=new l.vk(a);if(e instanceof i.P6){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&&c.tell(t,s.UB.in_tail(t.id,0))}else{const n=e.find_text_nav_pos(t,"left");r&&this.set_cursor(r,n)}else{const t=e.prev_cube_deep;if(t){const n=e.meta.block||t.meta.block?0:1;c.tell(t,s.UB.in_tail(t.id,n,"right"))}}}}move_right(){if(!this.range)return;const{cube_end:e,offset_start:t,offset_end:n,node_end:r}=this,{doc:o,courier:a}=this,c=new l.vk(a);if(e instanceof i.P6){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&&c.tell(t,s.UB.in_head(t.id,0))}else{const t=e.find_text_nav_pos(n,"right");r&&this.set_cursor(r,t)}else{const t=e.next_cube_deep;if(t){const n=e.meta.block||t.meta.block?0:1;c.tell(t,s.UB.in_head(t.id,n,"left"))}}}}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:s}=this.range;if(!e)return;this.set_cursor(this.range.endContainer,this.range.endOffset);const a=this.range.getClientRects();if(0===a.length)return;const l=r.MathRect.get_rect_point(a[a.length-1],r._RectPosition.center);let c=o.I.get_client_rects(e.id);if(!c)return;let d=c.length,u=c[0],h=c[c.length-1],p=h;if(d>1){for(let e=0;e<d;e++){const t=c[e];if(r.MathRect.is_point_in_rect(l,t)){p=t;break}}if(p!==h)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid)}let f=e.next_cube;if(!f)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid);for(c=o.I.get_client_rects(f.id);c;){if(d=c.length,u=c[0],u.x<p.right)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid);if(d>1)return this.locate_cursor_on_rect(u,r._RectPosition.right_mid);if(f=f?.next_cube,!f)return this.locate_cursor_on_rect(u,r._RectPosition.right_mid);c=o.I.get_client_rects(f.id)}}move_home(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:s}=this.range;if(this.set_cursor(this.range.startContainer,this.range.startOffset),!e)return;const a=this.range.getClientRects();if(0===a.length)return;const l=r.MathRect.get_rect_point(a[a.length-1],r._RectPosition.center);let c=o.I.get_client_rects(e.id);if(!c)return;let d=c.length,u=c[0],h=c[c.length-1],p=u;if(d>1){for(let e=0;e<d;e++){const t=c[e];if(r.MathRect.is_point_in_rect(l,t)){p=t;break}}if(p!==u)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid)}let f=e.prev_cube;if(!f)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid);for(c=o.I.get_client_rects(f.id);c;){if(d=c.length,h=c[c.length-1],h.right>p.left)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid);if(d>1)return this.locate_cursor_on_rect(h,r._RectPosition.left_mid);if(f=f?.prev_cube,!f)return this.locate_cursor_on_rect(h,r._RectPosition.left_mid);c=o.I.get_client_rects(f.id)}}extend_left(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,u=o||n,h="number"==typeof a?a:r;this.set_cursor(u,h),this.move_left(),(0,d.dY)(()=>{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:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,u=o||n,h="number"==typeof a?a:r;this.set_cursor(u,h),this.move_right(),(0,d.dY)(()=>{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:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_up();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_down(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_down();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_home(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_home();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_end(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_end();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,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 r=[];for(;n;){if(n.id){let e;if(r.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 i.P6?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=r.MathRect.get_rect_point(e,t);const i=document.caretPositionFromPoint(n.x,n.y),s=window.getSelection();if(i&&s&&i.offsetNode instanceof Text)return s.setPosition(i.offsetNode,i.offset)}locate_cursor_by_coor(e,t){const{courier:n,history:r,root:i}=this,o=document.caretPositionFromPoint(e,t),a=o?.offsetNode,c=new l.vk(n);if(a){if(a instanceof Text)o.offsetNode instanceof Text&&(a.parentElement?.parentElement?.focus(),this.set_cursor(o.offsetNode,o.offset));else{const e=i.cursor.get_node_cube(a,i);if(e?.in_postil)return;const t=e?.pcube;if(!e||!t)return;const n=e.meta;e.next_cube,n.block||c.tell(e,s.UB.in_head(e.id,0,"left"))}r.record(c)}}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;r.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;r.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,r){this.selection.setBaseAndExtent(e,t,n,r)}get_selection_text(e=!0){const{cube_end:t,cube_start:n,offset_start:r,offset_end:s}=this;let o="";if(e&&!this.has_selection&&n instanceof i.P6)return n.text;if(this.cube_selection instanceof i.P6)return this.cube_selection.text.slice(r,s);{let e=!1,a=!1;const l=this.find_inline_cube();for(let c of l){for(let l of c){if(a)break;e||l!==n||(e=!0,l instanceof i.P6&&(o+=l.text.slice(r))),a||l!==t||(a=!0,l instanceof i.P6&&(o+=l.text.slice(0,s))),e&&!a&&l instanceof i.P6&&l!==n&&l!==t&&(o+=l.text)}o+="\n"}}return o}find_cube_by_coor(e){const{x:t,y:n}=e,r=document.elementFromPoint(t,n);if(r)return this.get_node_cube(r,this.root)}find_selection_lines(){const e=[],{cube_selection:t,cube_start:n,cube_end:r}=this;if(t instanceof i.P6){let e=t.line;if(e)return[e]}else{if(t instanceof i.gK)return[t];if(n instanceof i.P6&&r instanceof i.P6){const t=n.line,i=r.line;if(t&&i){let n=t;for(;n&&(e.push(n),n!==i);)n=n.next_line}}}return e}find_inline_cube(){const e=[],{cube_start:t,cube_end:n,offset_start:r,offset_end:s}=this;if(!t||!n)return e;if(!(t instanceof i.P6&&n instanceof i.P6))return e;const o=this.find_selection_lines();if(0===o.length)return[];const a=o[0],l=o[o.length-1],c=t.index,d=n.index;if(1===o.length){const t=[];for(let e of a.children.slice(c,d+1))t.push(e);e.push(t)}else{let t=[];for(let e of a.children.slice(c))t.push(e);e.push(t),t=[];for(let n of o.slice(1,-1)){for(let e of n.children)t.push(e);e.push(t),t=[]}for(let e of l.children.slice(0,d+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],r=t[t.length-1],s=n[0],o=r[r.length-1],{cube_start:a,cube_end:l,offset_start:c,offset_end:d}=this;if(!a||!l)return e;if(a===l){const t=a.export();t.info=t.info.slice(c,d),e.push(t)}else if(n===r){if(a instanceof i.P6&&a===s){const t=a.export();t.info=t.info.slice(c),e.push(t)}for(let t of n.slice(1,-1))e.push(t.export());if(l instanceof i.P6&&l===o){const t=l.export();t.info=t.info.slice(0,d),e.push(t)}}else{if(a instanceof i.P6&&a===s){const t=a.export();t.info=t.info.slice(c),e.push(t)}e.push(...n.slice(1).map(e=>e.export()));for(let n of t.slice(1,-1)){const t=i.gK.get_default(n.map(e=>e.export()));e.push(t)}const u=i.gK.get_default(r.slice(0,-1).map(e=>e.export()));if(l instanceof i.P6&&l===o){const e=l.export();e.info=e.info.slice(0,d),u.info.push(e)}e.push(u)}return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:a.Mu.cursor,version:1}}}},2547:(e,t,n)=>{"use strict";n.d(t,{U:()=>s,c:()=>r});class r{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,r,i,s){return{a:e,b:t,c:n,d:r,e:i,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 r=this.get_matrix_translate(t,n);return this.multiply(e,r)}static get_dom_string(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=e;return`matrix(${t.toFixed(1)},${n},${r},${i.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}}}var i=n(1556);class s{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=[],r=this.path.getTotalLength()/t;for(let e=0;e<=t;e++){const t=e*r,i=this.path.getPointAtLength(t);n.push({x:i.x,y:i.y})}return n}static get_line_k(e,t){const n=t.y-e.y,r=t.x-e.x;return 0===r?Number.POSITIVE_INFINITY:n/r}static find_closet_point(e,t){let n=1/0,r=e[0];const{x:i,y:s}=t;for(let t of e){let e=(i-t.x)**2+(s-t.y)**2;e<n&&(n=e,r=t)}return r}static offset_points(e,t){const n=[],{x:r,y:i}=t;for(let t of e)n.push({x:t.x+r,y:t.y+i});return n}static find_closest_points(e,t){let n=1/0,r=e[0],i=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,r=o,i=s)}}return{from:r,to:i}}static polygonCentroid(e){let t=0,n=0,r=0;const i=e.length;for(let s=0;s<i;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%i],d=o*c-l*a;r+=d,t+=(o+l)*d,n+=(a+c)*d}return r*=.5,t/=6*r,n/=6*r,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const{x:i,y:s}=e[r],{x:o,y:a}=e[(r+1)%n];t+=i*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 r=e.pcube.get_node(n);if(r){if(r.is_layout_root)return{has_root:!0,line:[e,r]};{const n=this.find_line_to_layout_root(r,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 r=e.get_node(t),s=e.get_node(n),o=r?.to.size||0,a=s?.from.size||0;return{linker:i.R$.get_default(t,n),index_from:a,index_to:o}}}},2742:(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var r=n(7633),i=n(4031),s=n(6996),o=n(1556);class a extends i.K{_count_word=(0,r.KR)(0);_active_root_index=(0,r.KR)(0);_anchor_root_id=(0,r.KR)("");_mode=(0,r.KR)(s.fv.read);_view=(0,r.KR)("doc");_in_composition_mode=(0,r.KR)(!1);_in_recording=(0,r.KR)(!1);_showing=(0,r.KR)(!1);view_point=(0,r.Kh)({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{[s.fv.edit]:"编辑模式",[s.fv.read]:"阅读模式",[s.fv.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===s.fv.read}get is_edit_mode(){return this._mode.value===s.fv.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 o.oY?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 a.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:s.Mu.stats,version:1}}}},2819:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});var r=n(6996);class i{static insert_child(e,t,n){return{id:e,name:r.zS.cube_insert_child,data:t,pos:n}}static delete_child(e,t,n,i=!1){return{id:e,name:r.zS.cube_delete_child,dir:t,range:n,reserve:i}}static insert(e,t,n,i,s,o){return{id:e,name:r.zS.cube_insert,data:t,start_id:n,end_id:i,offset_end:o,offset_start:s}}static delete(e,t,n,i,s,o,a=!1){return{id:e,name:r.zS.cube_delete,dir:t,start_id:n,end_id:i,offset_start:s,offset_end:o,reserve:a}}static delete_adjacent(e,t,n,i){return{id:e,name:r.zS.cube_delete_adjacent,from:t,offset:i,from_id:n}}static set_selection_css(e,t,n,i,s,o,a=!1,l=!1){return{id:e,name:r.zS.cube_set_selection_css,css:t,start_id:n,end_id:i,offset_start:s,offset_end:o,toggle:a,replace:l}}static set_css(e,t,n=!1,i=!1){return{id:e,name:r.zS.cube_set_css,css:t,toggle:n,replace:i}}static partition(e,t,n,i,s){return{name:r.zS.cube_partition,id:e,start_id:t,end_id:n,offset_start:i,offset_end:s}}static reorder(e,t,n){return{id:e,name:r.zS.cube_reorder,cubeid:t,index:n}}static reset(e,t){return{id:e,name:r.zS.cube_reset,data:t}}static merge(e,t,n,i){return{id:e,name:r.zS.cube_merge,method:t,cubeid:n,offset:i}}static postil_add(e,t=[]){return{name:r.zS.cube_postil_add,id:e,data:t}}static postil_remove(e,t){return{name:r.zS.cube_postil_remove,id:e,range:t}}static set_attr(e,t){return{id:e,name:r.zS.cube_set_attr,attr:t}}static resize(e,t,n){return this.set_attr(e,{width:t,height:n})}static fold(e,t){return this.set_attr(e,{fold:t})}}},2935:(e,t,n)=>{"use strict";n.d(t,{B:()=>l});var r=n(7633),i=n(4089),s=n(4031),o=n(6996),a=n(1556);class l extends s.K{static config;cp=l.default_config;data;get meta(){return l.meta}get css_vars(){const e=this.data;return{"--text-transition":e.text_transition?"0.5s":"none","--text-family":`${e.text_family}`,"--node-max-width":`${e.map_node_max_width}px`}}constructor(e){super(e),this.data=(0,r.Kh)(l.default_config),l.config=this.data,this.watch()}init(e){Object.assign(this.data,e),this.cp=structuredClone((0,r.ux)(this.data))}watch(){(0,i.wB)(()=>this.data.map_perf,(e,t)=>{if(e){this.root instanceof a.EU&&this.root.check_show();const e=this.root.cubes.get_types_cube(o.u0.submap);for(let[t,n]of e)n.check_show()}else{this.root instanceof a.EU&&this.root.show_all();const e=this.root.cubes.get_types_cube(o.u0.submap);for(let[t,n]of e)n.show_all()}})}export(){return structuredClone((0,r.ux)(this.data))}static get meta(){return{type:o.Mu.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,input_quick_prefix:"/",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:o._A.point,map_linker_anchor_right:o._A.arrow,map_linker_line:"bezier2",map_linker_stroke:"black",map_linker_stroke_width:2,map_perf:!0}}}},3214:(e,t,n)=>{"use strict";n.d(t,{M:()=>i});var r=n(5976);class i extends r._{}},3408:(e,t,n)=>{"use strict";n.d(t,{Wu:()=>f,Eb:()=>p,w4:()=>h});var r=n(1556),i=n(7744),s=n(6996),o=n(4412),a=n(1717),l=n(7633),c=n(4089),d=n(3755);function u(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const h=new Map;function p(e){return(t,n)=>{let r=t[n];h.set(e,r)}}class f extends a.K{handlers=(0,l.Kh)(new Map);data;get meta(){return f.meta}constructor(e){super(e),this.data=(0,l.Kh)(f.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,o=e.key.toLowerCase(),a=document.activeElement;let l=!1;if(n===s.fv.edit&&a!==document.body){for(let[n,r]of h){let i=t.data[n];i.cursor&&t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),l=!0,r.bind(t)(e))}for(let[n,r]of t.handlers){let i=t.data[n];i.cursor&&t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),l=!0,r(e))}if(!l&&"tab"===o){l=!0;const{cursor:t,courier:n,history:s}=this,{cube_end:o,cube_start:a,offset_start:c,offset_end:d,has_selection:u,cube_selection:h}=t,p=n.get_recorder();if(!h||!o||!a)return;e.preventDefault(),u&&p.tell(h,i.VL.delete(h.id,"backward",a.id,o.id,c,d,!0));const f=a.text,m=f.slice(0,c)+"\t"+f.slice(c);p.tell(a,r.zl.reset(a.id,m,d,c+1)),s.record(p)}}})}listen_uncursor_hotkey(e){const t=this;document.documentElement.addEventListener("keydown",e=>{const n=t.stats.mode,r=document.activeElement,i=[s.tX.down,s.tX.left,s.tX.right,s.tX.up],o=e.key.toLowerCase();this.root;let a=!1;if(this.cursor.cube_end||r===document.body){for(let[n,r]of h){let i=t.data[n];i.cursor||t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),a=!0,r.bind(t)(e))}for(let[n,r]of t.handlers){let i=t.data[n];i.cursor||t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),a=!0,r(e))}}a||r!==document.body||n!==s.fv.edit||(" "===o?this.listen_map_space(e):"backspace"===o||"delete"===o?this.listen_map_delete(e):"enter"===o?this.listen_map_enter(e):"tab"===o?this.listen_map_tab(e):i.includes(o)&&this.listen_map_nav(e))})}listen_map_nav(e){const t=this.root,n=e.key.toLowerCase(),i=this.cubes.get_types_cube(s.u0.submap),o=[s.tX.down,s.tX.left,s.tX.right,s.tX.up];if(t instanceof r.EU&&t.get_nodes_selected().size>0)o.includes(n)&&t.move_select(n);else for(let[e,t]of i)t.move_select(n)}listen_map_delete(e){const{courier:t,history:n}=this,o=t.get_recorder();if(this.root instanceof r.EU){const e=[...this.root.get_nodes_selected()].map(e=>e.id);o.tell(this.root,i.yc.node_remove(this.root.id,e))}const a=this.cubes.get_types_cube(s.u0.submap);for(let[e,t]of a){const e=[...t.get_nodes_selected()].map(e=>e.id);o.tell(t,i.yc.node_remove(t.id,e))}n.record(o)}listen_map_enter(e){const{courier:t,history:n}=this,o=t.get_recorder();let a=!1;if(this.root instanceof r.EU){const t=this.root.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){a=!0;continue}let r=n.id;e.shiftKey&&(r=n.env.prev_node?.id||null);const s=i.Sv.append_child(t.id,r);o.tell(t,s)}}const l=this.cubes.get_types_cube(s.u0.submap);for(let[t,n]of l){const t=n.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){a=!0;continue}let r=n.id;e.shiftKey&&(r=n.env.prev_node?.id||null);const s=i.Sv.append_child(t.id,r);o.tell(t,s)}}a&&d.F.tips?.tip_warning("无法在没有布局上游的节点添加同级"),n.record(o)}listen_map_tab(e){e.preventDefault();const{courier:t,history:n}=this,o=t.get_recorder();if(this.root instanceof r.EU){const e=this.root.get_nodes_selected();for(let t of e){const e=i.Sv.append_child(t.id);o.tell(t,e)}}const a=this.cubes.get_types_cube(s.u0.submap);for(let[e,t]of a){const e=t.get_nodes_selected();for(let t of e){const e=i.Sv.append_child(t.id);o.tell(t,e)}}n.record(o)}listen_map_space(e){const t=this.root;if(e.preventDefault(),t instanceof r.EU){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}const n=t.cubes.get_types_cube(s.u0.submap);for(let[e,t]of n){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}}listen_cvx(e){let t=e;this.root instanceof r.EU&&(t=document.documentElement),t.addEventListener("paste",async e=>{const t=e.clipboardData,{cursor:n}=this,{cube_end:i}=n;if(i instanceof r.P6&&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:s}=this;t&&(this.root.scope_count_normal>0||s.has_selection||s.cube_end instanceof r.P6)&&(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 r.P6)&&(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((0,l.ux)(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 r=[s.tX.down,s.tX.end,s.tX.home,s.tX.left,s.tX.right,s.tX.up],i=e.key.toLocaleLowerCase();r.includes(i)&&this.event.emit_cursor_nav_before(e).some(e=>!1===e)||(i===s.tX.left?n.move_left():i===s.tX.right?n.move_right():i===s.tX.up?n.move_up():i===s.tX.down?n.move_down():i===s.tX.home?n.move_home():i===s.tX.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 r.P6&&(e.preventDefault(),e.key.toLocaleLowerCase()===s.tX.left?n.extend_left():e.key.toLocaleLowerCase()===s.tX.right?n.extend_right():e.key.toLocaleLowerCase()===s.tX.up?n.extend_up():e.key.toLocaleLowerCase()===s.tX.down?n.extend_down():e.key.toLocaleLowerCase()===s.tX.home?n.extend_home():e.key.toLocaleLowerCase()===s.tX.end&&n.extend_end())}text_break(e){const{courier:t,cursor:n,history:i,doc:s}=this;if(n.has_selection)return;e.preventDefault();const a=new o.vk(t),{cube_end:l,cube_start:c,cube_selection:d,offset_end:u,offset_start:h}=n;if(l){if(l instanceof r.P6){const e=l.text.slice(0,u)+"\n"+l.text.slice(u);a.tell(l,r.zl.reset(l.id,e,u,u+2))}i.record(a)}}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:s,doc:a}=this,{cube_end:l,cube_start:c,cube_selection:d,offset_end:u,offset_start:h}=s;if(!d||!l||!c)return;const p=new o.vk(t),f=c.id,m=l.id;s.has_selection&&p.tell(d,i.VL.delete(d.id,"backward",f,m,h,u,!0)),p.tell(c,r.zl.break(c.id,h)),n.record(p),this.event.emit_enter_after(e)}async break_root(e){const{cursor:t,courier:n,history:s}=this,{cube_end:o,offset_end:a}=t;if(!o)return;const l=o.find_upstream_target(e=>e instanceof r.HR);if(!l)return;const d=o.find_upstream_untill(l);if(!d)return;const u=[],h=d.index,p=l.children.slice(h);for(let e of p)u.push(e.export());const f=r.HR.get_default(u),m=n.get_recorder(),_=l.pcube;m.tell(_,i.VL.insert_child(_.id,[f],l.index+1)),m.tell(l,i.VL.delete_child(l.id,"backward",[h,l.child_count])),o instanceof r.P6&&(await(0,c.dY)(),o.set_cursor_in_head(a)),s.record(m)}text_partition(e){const{cursor:t,history:n,courier:s}=this,o=d.F.tips,{cube_selection:a,offset_end:l,offset_start:c}=t;if(!(a instanceof r.P6))return o?.tip_warning("选区必须在一个文本块内");const u=s.get_recorder(),h=a.id;u.tell(a,i.VL.partition(h,h,h,c,l)),n.record(u)}add_scope(e){this.root.add_scope()}underline(e){const{cursor:t,courier:n,history:r}=this,{cube_selection:s,cube_end:a,cube_start:l,offset_start:c,offset_end:d}=t,u=new o.vk(n);s&&l&&a&&(u.tell(s,i.VL.set_selection_css(s.id,{"text-decoration-line":"underline"},l.id,a.id,c,d,!0)),r.record(u))}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:s}=t;if(!s)return;const a=s.find_upstream_target(e=>e instanceof r.HR);if(!a)return;const l=a.pcube,c=new o.vk(this.courier),d=r.HR.get_default();c.tell(l,i.VL.insert_child(l.id,[d],a.index+1)),n.record(c)}prev_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:s}=t;if(!s)return;const a=s.find_upstream_target(e=>e instanceof r.HR);if(!a)return;const l=a.pcube,c=new o.vk(this.courier),d=r.HR.get_default();c.tell(l,i.VL.insert_child(l.id,[d],a.index)),n.record(c)}add_annotation(e){e.preventDefault();const t=d.F.tips,{cursor:n,courier:s,history:a}=this,{cube_selection:l,cube_start:c,cube_end:u,offset_end:h,offset_start:p}=n,f=new o.vk(s);if(!l||!c||!u)return t?.tip_warning("未发现光标或选区");const m=c.id,_=u.id,g=r.vV.get_default();if(n.has_selection)if(l instanceof r.P6)if(f.tell(l,i.VL.partition(l.id,m,_,p,h)),0===p){if(l.postil?.has_annotation)return t?.tip_warning("已添加批注"),f;f.tell(l,i.VL.postil_add(l.id,[g])),f.tell(l,i.UB.in_head(l.id,h))}else{const e=l.next_cube;if(e instanceof r.P6){if(e.postil?.has_annotation)return t?.tip_warning("已添加批注"),f;f.tell(e,i.VL.postil_add(e.id,[g])),f.tell(e,i.UB.in_head(e.id,h))}}else t?.tip_warning("选区跨越多个文本块");else u instanceof r.P6&&(f.merge(u.add_annotation()),f.tell(u,i.UB.in_head(u.id,h)));a.record(f)}fold_block(e){e.preventDefault();const{cursor:t}=this,{cube_end:n,offset_end:s}=t;if(!n)return;let o,a=n;for(;!o;){let e=a.pcube;if(e instanceof r.de||e instanceof r.HR)o=e;else if(e instanceof i.MR)return;a=e}if(o){const e=o.child_first,t=n.find_upstream_untill(o)===e,r=this.courier.get_recorder(),a=!o.attrs.fold,l=i.VL.set_attr(o.id,{fold:a});r.tell(o,l),t?r.tell(n,i.UB.in_head(n.id,s)):a&&e&&r.tell(e,i.UB.in_tail(e.id,0)),this.history.record(r)}}static get meta(){return{type:s.Mu.hotkeys,version:1}}static get default_hotkeys(){return{[s.ZS["fold-block"]]:{name:s.ZS["fold-block"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["z"],cursor:!0,group:s.ec.block},[s.ZS["text-partition"]]:{name:s.ZS["text-partition"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["x"],cursor:!0,group:s.ec.text},[s.ZS["text-add-annotation"]]:{name:s.ZS["text-add-annotation"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["a"],cursor:!0,group:s.ec.text},[s.ZS["scope-clear"]]:{name:s.ZS["scope-clear"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["c"],group:s.ec.scope},[s.ZS["clear-css"]]:{name:s.ZS["clear-css"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:s.ec.css},[s.ZS["root-add-prev"]]:{name:s.ZS["root-add-prev"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["root-add-next"]]:{name:s.ZS["root-add-next"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["text-align-left"]]:{name:s.ZS["text-align-left"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["l"],cursor:!0,group:s.ec.common},[s.ZS["text-align-center"]]:{name:s.ZS["text-align-center"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["e"],cursor:!0,group:s.ec.common},[s.ZS["text-align-right"]]:{name:s.ZS["text-align-right"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:s.ec.common},[s.ZS["break-text"]]:{name:s.ZS["break-text"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.text},[s.ZS["break-line"]]:{name:s.ZS["break-line"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.core},[s.ZS["break-root"]]:{name:s.ZS["break-root"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["cursor-nav"]]:{name:s.ZS["cursor-nav"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,cursor:!0,key:[s.tX.down,s.tX.left,s.tX.right,s.tX.up,s.tX.home,s.tX.end],group:s.ec.core},[s.ZS["cursor-nav-extend"]]:{name:s.ZS["cursor-nav-extend"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,cursor:!0,key:[s.tX.down,s.tX.left,s.tX.right,s.tX.up,s.tX.home,s.tX.end],group:s.ec.core},[s.ZS.undo]:{name:s.ZS.undo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["z"],cursor:!1,group:s.ec.common},[s.ZS.redo]:{name:s.ZS.redo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["y"],cursor:!1,group:s.ec.common},[s.ZS["indent-line"]]:{name:s.ZS["indent-line"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:s.ec.common},[s.ZS["unindent-line"]]:{name:s.ZS["unindent-line"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:s.ec.common},[s.ZS["text-bold"]]:{name:s.ZS["text-bold"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["b"],cursor:!0,group:s.ec.text},[s.ZS["scope-add"]]:{name:s.ZS["scope-add"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["s"],cursor:!1,group:s.ec.scope},[s.ZS["text-underline"]]:{name:s.ZS["text-underline"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["u"],cursor:!0,group:s.ec.text},[s.ZS["text-italic"]]:{name:s.ZS["text-italic"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["i"],cursor:!0,group:s.ec.text},[s.ZS["format-brush-copy"]]:{name:s.ZS["format-brush-copy"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["c"],cursor:!0,group:s.ec.common},[s.ZS["format-brush-apply"]]:{name:s.ZS["format-brush-apply"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["v"],cursor:!0,group:s.ec.common}}}}u([p(s.ZS["scope-clear"])],f.prototype,"clear_scope",null),u([p(s.ZS["clear-css"])],f.prototype,"clear_css",null),u([p(s.ZS["text-bold"])],f.prototype,"bold",null),u([p(s.ZS["unindent-line"])],f.prototype,"unindent_line",null),u([p(s.ZS["indent-line"])],f.prototype,"indent_line",null),u([p(s.ZS.undo)],f.prototype,"undo",null),u([p(s.ZS.redo)],f.prototype,"redo",null),u([p(s.ZS["cursor-nav"])],f.prototype,"cursor_navigation",null),u([p(s.ZS["cursor-nav-extend"])],f.prototype,"cursor_extend_navigation",null),u([p(s.ZS["break-text"])],f.prototype,"text_break",null),u([p(s.ZS["break-line"])],f.prototype,"break",null),u([p(s.ZS["break-root"])],f.prototype,"break_root",null),u([p(s.ZS["text-partition"])],f.prototype,"text_partition",null),u([p(s.ZS["scope-add"])],f.prototype,"add_scope",null),u([p(s.ZS["text-underline"])],f.prototype,"underline",null),u([p(s.ZS["format-brush-copy"])],f.prototype,"copy_format",null),u([p(s.ZS["format-brush-apply"])],f.prototype,"apply_format",null),u([p(s.ZS["text-italic"])],f.prototype,"italic",null),u([p(s.ZS["text-align-left"])],f.prototype,"align_left",null),u([p(s.ZS["text-align-center"])],f.prototype,"align_center",null),u([p(s.ZS["text-align-right"])],f.prototype,"align_right",null),u([p(s.ZS["root-add-next"])],f.prototype,"next_root",null),u([p(s.ZS["root-add-prev"])],f.prototype,"prev_root",null),u([p(s.ZS["text-add-annotation"])],f.prototype,"add_annotation",null),u([p(s.ZS["fold-block"])],f.prototype,"fold_block",null)},3513:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(7633),i=n(1556),s=n(4031),o=n(6996);class a extends s.K{_map=(0,r.Gc)({});_types=(0,r.Gc)(new Map);_count=(0,r.Gc)({});constructor(e){super(e)}get postils(){return this._types.get(o.u0.postil)||new Map}get meta(){return a.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,(0,r.Gc)(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(o.u0.submap);if(e)for(let[t,n]of e)n.clear_node_selected();this.root instanceof i.EU&&this.root.clear_node_selected()}static get meta(){return{type:o.Mu.cubes,version:1}}}},3676:(e,t,n)=>{"use strict";n.d(t,{T:()=>k});var r=n(4031),i=n(6996),s=n(7744),o=n(2547);class a extends r.K{_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,r=e.clientY,i=(n-this.scope_down.pos.x)/t.sx,s=(r-this.scope_down.pos.y)/t.sy;this.m=o.c.multiply(this.fig_matrix_origin,o.c.get_matrix_translate(i,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=s.yc.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 l extends r.K{_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,r=-Math.sign(n),i={x:e.clientX,y:e.clientY},s=r*t;this.map.scale_by_point(i,s,s),this.map.check_show_throttle()}dblclick(e){}contextmenu(e){}}class c extends r.K{_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=o.c.multiply(this.map.matrix2d,o.c.get_matrix_translate(t,0));this.map.reset_matrix(e)}else{const e=o.c.multiply(this.map.matrix2d,o.c.get_matrix_translate(0,t));this.map.reset_matrix(e)}this.map.check_show_throttle()}}dblclick(e){}contextmenu(e){}}var d=n(1556),u=n(1068);class h extends r.K{_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:r}=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(r),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=d.sf.line(this.down_point,n),this.count%this.rate!==0)return;this.count=1,this.map.clear_delete_line();const r={from:this.down_point,to:n};for(let e of this.view_cubes)if(e instanceof s.wP){let t=e.sample[0];for(let n of e.sample.slice(1)){const i={from:t,to:n};if(u.MathLine.check_intersection(i,r)){this.map.put_delete_selected(e);break}t=n}}else if(e instanceof d.R$){let t=e.sample[0];for(let n of e.sample.slice(1)){const i={from:t,to:n};if(u.MathLine.check_intersection(i,r)){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,r=t.get_recorder(),i=this.map.id,o=[],a=[],l=this.map.get_delete_selected();for(let e of l)e instanceof s.wP?o.push(e.id):e instanceof d.R$&&a.push(e.id);const c=s.yc.node_remove(i,o),u=s.yc.linker_remove(i,a);r.tell(this.map,c,u),n.record(r),this.reset()}cancel(e){this.reset()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class p extends r.K{_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:r}=t;if("fig"!==n.type)return;e.stopPropagation(),e.preventDefault();const{courier:i,history:o}=this,a=s.wP.get_default_node_pos(r,this.map),l=[d.gL.get_default(a)],c=s.yc.node_add(this.map.id,l),u=i.get_recorder();u.tell(this.map,c),o.record(u)}contextmenu(e){}}class f extends r.K{_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:r}=t,{type:i,res:s}=r;"fig"===i&&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),r=this.get_rect_area(this.point_down,n);if(this.map.placeholder.box_selector=r,this.count%this.rate!==0)return;this.count=1;const i={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(i);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 r=t.x-e.x,i=t.y-e.y,s=Math.sign(r)*n,o=Math.sign(i)*n,a=e,l=a.x+r,c=a.y,d=t,u=a.x,h=a.y+i;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 ${u+s}Q${u} ${h} ${u} ${h-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,r=e.y+e.height/2,i=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-i),a=Math.abs(r-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}}class m extends r.K{_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:r}=t,{type:i,res:s}=n;"node"!==i||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 _ extends r.K{_interaction;down_node;down_pos;matrix=new Map;matrix_translate=o.c.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:r,selected_nodes:i,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(r),i.has(this.down_node))for(let e of i)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},r=this.map.view_point_to_real(n),i=r.x-this.down_pos.x,s=r.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=o.c.get_matrix_translate(i,s);for(let[e,t]of this.matrix){if(!t)continue;const n=o.c.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,r=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 i=o.c.multiply(n,this.matrix_translate),a=s.Sv.layout_change(t.id,{matrix2d:i});r.tell(t,a)}n.record(r);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 g extends r.K{_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:r}=t;"node"===n.type&&(e.stopPropagation(),e.preventDefault(),n.res.editable=!0)}contextmenu(e){}}class b extends r.K{_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:r,res:i}=n;"fig"!==r&&"empty"!==r||(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){}}var v=n(3755);class y extends r.K{_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:r,selected_nodes:i}=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,i.has(this.down_node))for(let e of i)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:r}=t;this.map.placeholder.linker=[];const i=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"===r)for(let e of this.selected_nodes){const{from:t,to:r}=o.U.find_closest_points(e.sample,n.sample);this.map.placeholder.linker.push(d.sf.get_line(t,r,i))}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=o.U.find_closet_point(e.sample,n);this.map.placeholder.linker.push(d.sf.get_line(t,n,i))}}}up(e){if(!this.flow)return this.reset_status();e.preventDefault(),e.stopPropagation();const{courier:t,history:n}=this,r=this._interaction.get_map_selector(e),{res:i,type:a}=r;if("node"===a){if(i===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,i.id);if(this.map.get_linker(n))v.F.tips?.tip_warning("已存在连接线");else{const n=o.U.create_linker_info(this.map,t.id,i.id),r=s.yc.linker_add(this.map.id,[n]);e.tell(this.map,r)}}n.record(e)}else if("fig"===a){const{courier:t,history:n}=this,r=t.get_recorder(),i=s.wP.get_default_node_pos({x:e.clientX,y:e.clientY},this.map),a=d.gL.get_default(i),l=s.yc.node_add(this.map.id,[a]);r.tell(this.map,l);for(let e of this.selected_nodes){const t=this.map.get_linker_id(e.id,a.id);if(this.map.get_linker(t)){v.F.tips?.tip_warning("已存在连接线");continue}const n=o.U.create_linker_info(this.map,e.id,a.id),i=s.yc.linker_add(this.map.id,[n]);r.tell(this.map,i)}n.record(r)}this.reset_status()}leave(){}cancel(e){this.reset_status()}wheel(e){}dblclick(e,t){}contextmenu(e){e.preventDefault()}}var w=n(7633),x=n(5955);class k extends r.K{_map;interactions_pointer=[];interaction_keyboard=[];constructor(e){super(e.root),this._map=e,this.interactions_pointer.push(new a(this)),this.interactions_pointer.push(new l(this)),this.interactions_pointer.push(new c(this)),this.interactions_pointer.push(new g(this)),this.interactions_pointer.push(new b(this)),this.interactions_pointer.push(new p(this)),this.interactions_pointer.push(new y(this)),this.interactions_pointer.push(new _(this)),this.interactions_pointer.push(new f(this)),this.interactions_pointer.push(new h(this)),this.interactions_pointer.push(new m(this))}info_node_drag=(0,w.Kh)({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 x.I.check_mouse_key(e,t)}get_map_selector(e){let t=e.target;for(;t&&t!==document.body;){const e=t.dataset.type,n=t.id;if(n&&e){if(e===i.u0.node){const e=this.map.get_node(n);if(e)return{type:"node",res:e}}else if(e===i.u0.linker){const e=this.map.get_linker(n);if(e)return{type:"linker",res:e}}else if(e===i.u0.map||e===i.u0.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:r,type:i}=n;if("node"===i&&this.root.isdev){this.map.nodes_test[r.id]=r,console.log("------------------------------------节点信息");const t=r.bound;console.log("id",r.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:",r.pcube.real_point_to_fig(t.pos)),console.log("view_pos:",r.pcube.real_point_to_view(t.pos)),console.log("to_size",r.to.size),console.log("in_size",r.from.size),console.log("节点",r),this.check_mouse_key(e,"mid")&&r.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){e.preventDefault(),e.stopImmediatePropagation();for(let t of this.interactions_pointer)t.wheel(e)}contextmenu(e){for(let t of this.interactions_pointer)t.contextmenu(e)}}},3736:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var r=n(4031);class i extends r.K{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,r]of t.postils)r.show&&(e=!1,r.update_pos());e||this.check_float()})}}},3755:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});class r{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)}}},3803:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(6996);class i{static add(e,t,n){return{id:e,name:r.JC.add,data:t,pos:n}}static remove(e,t){return{id:e,name:r.JC.remove,range:t}}static indent(e,t){return{id:e,name:r.JC.indent,items:t}}}},3814:(e,t,n)=>{"use strict";n.d(t,{z:()=>o});var r=n(3755),i=n(1717),s=n(6996);class o extends i.K{_listener=new Map;_updating_status=!1;get meta(){return o.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 r=[];for(let e of n)r.push(e(...t));return r}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=r.F.tips,n=this._listener.get(s.dp["asset-save"]);n?(n.clear(),t?.tip_info("唯一事件-资源保存:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-save"],new Set([e]))}async emit_asset_save(e,t,n){const i=r.F.tips,o=this._listener.get(s.dp["asset-save"]);if(!o)return i?.tip_warning("未注册保存函数"),!1;const a=[...o][0];return!!a&&await a(e,t,n)}on_asset_download(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-download"]);n?(n.clear(),t?.tip_info("唯一事件-资源下载:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-download"],new Set([e]))}async emit_asset_download(e,t){const n=r.F.tips,i=this._listener.get(s.dp["asset-download"]);if(!i)return n?.tip_warning("未注册保存函数"),!1;const o=[...i][0];return!!o&&await o(e,t)}on_asset_copy(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-copy"]);n?(n.clear(),t?.tip_info("唯一事件-资源复制:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-copy"],new Set([e]))}async emit_asset_copy(e,t,n){const i=r.F.tips,o=this._listener.get(s.dp["asset-copy"]);if(!o)return i?.tip_warning("未注册保存函数"),!1;const a=[...o][0];return!!a&&await a(e,t,n)}emit_replace_id(e,t){const n=this._listener.get(s.dp["replace-id"]);if(!n)return!1;for(let r of n)r(e,t)}on_replace_id(e){const t=this._listener.get(s.dp["replace-id"]);t?t.add(e):this._listener.set(s.dp["replace-id"],new Set([e]))}emit_edit_before(e,t){const n=this._listener.get(s.dp["edit-before"]);if(!n)return!1;for(let r of n)r(e,t)}on_edit_before(e){const t=this._listener.get(s.dp["edit-before"]);t?t.add(e):this._listener.set(s.dp["edit-before"],new Set([e]))}emit_edit_after(e,t){const n=this._listener.get(s.dp["edit-after"]);if(!n)return!1;for(let r of n)r(e,t)}on_edit_after(e){const t=this._listener.get(s.dp["edit-after"]);t?t.add(e):this._listener.set(s.dp["edit-after"],new Set([e]))}emit_text_merge(e,t){const n=this._listener.get(s.dp["text-merge"]);if(!n)return!1;for(let r of n)r(e,t)}on_text_merge(e){const t=this._listener.get(s.dp["text-merge"]);t?t.add(e):this._listener.set(s.dp["text-merge"],new Set([e]))}on_esc(e){const t=this._listener.get(s.dp.esc);t?t.add(e):this._listener.set(s.dp.esc,new Set([e]))}emit_esc(){const e=this._listener.get(s.dp.esc);if(!e)return!1;for(let t of e)t()}on_selection_change(e){this.on(s.dp["selection-change"],e)}emit_selection_change(e){this.emit(s.dp["selection-change"],e)}emit_cursor_nav_before(e){return this.emit(s.dp["cursor-nav-before"],e)}on_cursor_nav_before(e){this.on(s.dp["cursor-nav-before"],e)}emit_cursor_nav_after(e){return this.emit(s.dp["cursor-nav-after"],e)}on_cursor_nav_after(e){this.on(s.dp["cursor-nav-after"],e)}on_enter_before(e){this.on(s.dp["enter-before"],e)}emit_enter_before(e){return this.emit(s.dp["enter-before"],e)}on_enter_after(e){this.on(s.dp["enter-after"],e)}emit_enter_after(e){return this.emit(s.dp["enter-after"],e)}on_show_cube_editor(e){this.on(s.dp["show-cube-editor"],e)}emit_show_cube_editor(e){return this.emit(s.dp["show-cube-editor"],e)}on_text_link_edit(e){this.on(s.dp["text-link-edit"],e)}emit_text_link_edit(e){return this.emit(s.dp["text-link-edit"],e)}on_doc_input_before(e){return this.on(s.dp["doc-input-before"],e)}emit_doc_input_before(e){return this.emit(s.dp["doc-input-before"],e)}on_doc_input_compositionend(e){return this.on(s.dp["doc-input-compositionend"],e)}emit_doc_input_compositionend(e){return this.emit(s.dp["doc-input-compositionend"],e)}on_status_update(e){return this.on(s.dp["status-update"],e)}emit_status_update(){this._updating_status||(this._updating_status=!0,Promise.resolve().then(()=>{const{root:e}=this,t={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};this.emit(s.dp["status-update"],t),this._updating_status=!1}))}on_node_status_click(e){return this.on(s.dp["node-status-clicked"],e)}emit_node_status_click(e,t){return this.emit(s.dp["node-status-clicked"],e,t)}on_fig_click(e){return this.on(s.dp["fig-click"],e)}emit_fig_click(e){return this.emit(s.dp["fig-click"],e)}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.event,version:1}}}},3972:(e,t,n)=>{"use strict";function r(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}n.d(t,{$3:()=>p,$H:()=>B,BH:()=>q,BX:()=>J,Bm:()=>w,C4:()=>Y,CE:()=>m,CP:()=>c,DY:()=>D,Gv:()=>x,J$:()=>Z,Kg:()=>y,MZ:()=>i,Mp:()=>l,NO:()=>a,Oj:()=>s,PT:()=>R,Qd:()=>T,Ro:()=>j,SU:()=>z,TF:()=>u,Tg:()=>E,Tn:()=>v,Tr:()=>$,We:()=>U,X$:()=>d,Y2:()=>Q,ZH:()=>O,Zf:()=>M,bB:()=>H,cy:()=>f,gd:()=>b,pD:()=>r,rU:()=>I,tE:()=>o,u3:()=>ee,vM:()=>_,v_:()=>ne,yI:()=>L,yL:()=>k,yQ:()=>V});const i={},s=[],o=()=>{},a=()=>!1,l=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith("onUpdate:"),d=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},h=Object.prototype.hasOwnProperty,p=(e,t)=>h.call(e,t),f=Array.isArray,m=e=>"[object Map]"===C(e),_=e=>"[object Set]"===C(e),g=e=>"[object Date]"===C(e),b=e=>"[object RegExp]"===C(e),v=e=>"function"==typeof e,y=e=>"string"==typeof e,w=e=>"symbol"==typeof e,x=e=>null!==e&&"object"==typeof e,k=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),S=Object.prototype.toString,C=e=>S.call(e),M=e=>C(e).slice(8,-1),T=e=>"[object Object]"===C(e),L=e=>y(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,z=r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),A=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-\w/g,R=A(e=>e.replace(P,e=>e.slice(1).toUpperCase())),N=/\B([A-Z])/g,E=A(e=>e.replace(N,"-$1").toLowerCase()),O=A(e=>e.charAt(0).toUpperCase()+e.slice(1)),I=A(e=>e?`on${O(e)}`:""),B=(e,t)=>!Object.is(e,t),D=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},V=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},H=e=>{const t=parseFloat(e);return isNaN(t)?e:t},j=e=>{const t=y(e)?Number(e):NaN;return isNaN(t)?e:t};let F;const U=()=>F||(F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{}),q=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function $(e){if(f(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=y(r)?W(r):$(r);if(i)for(const e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}const G=/;(?![^(]*\))/g,X=/:([^]+)/,K=/\/\*[^]*?\*\//g;function W(e){const t={};return e.replace(K,"").split(G).forEach(e=>{if(e){const n=e.split(X);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Y(e){let t="";if(y(e))t=e;else if(f(e))for(let n=0;n<e.length;n++){const r=Y(e[n]);r&&(t+=r+" ")}else if(x(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Z=r("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Q(e){return!!e||""===e}function J(e,t){if(e===t)return!0;let n=g(e),r=g(t);if(n||r)return!(!n||!r)&&e.getTime()===t.getTime();if(n=w(e),r=w(t),n||r)return e===t;if(n=f(e),r=f(t),n||r)return!(!n||!r)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=J(e[r],t[r]);return n}(e,t);if(n=x(e),r=x(t),n||r){if(!n||!r)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!J(e[n],t[n]))return!1}}return String(e)===String(t)}function ee(e,t){return e.findIndex(e=>J(e,t))}const te=e=>!(!e||!0!==e.__v_isRef),ne=e=>y(e)?e:null==e?"":f(e)||x(e)&&(e.toString===S||!v(e.toString))?te(e)?ne(e.value):JSON.stringify(e,re,2):String(e),re=(e,t)=>te(t)?re(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ie(t,r)+" =>"]=n,e),{})}:_(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ie(e))}:w(t)?ie(t):!x(t)||f(t)||T(t)?t:String(t),ie=(e,t="")=>{var n;return w(e)?`Symbol(${null!=(n=e.description)?n:t})`:e}},4031:(e,t,n)=>{"use strict";n.d(t,{K:()=>r.K});var r=n(1717)},4089:(e,t,n)=>{"use strict";n.d(t,{$u:()=>J,$y:()=>le,CE:()=>Tt,Df:()=>O,EW:()=>on,FK:()=>gt,Fv:()=>Bt,Gy:()=>A,K9:()=>We,Lk:()=>Nt,MZ:()=>E,OW:()=>N,Q3:()=>Dt,QP:()=>R,Wv:()=>Lt,bF:()=>Et,bo:()=>C,dY:()=>m,eW:()=>It,hi:()=>te,nI:()=>Gt,pI:()=>de,pM:()=>I,qL:()=>o,rk:()=>D,sV:()=>Z,uX:()=>kt,wB:()=>rt,xo:()=>ee});var r=n(7633),i=n(3972);function s(e,t,n,r){try{return r?e(...r):e()}catch(e){a(e,t,n)}}function o(e,t,n,r){if((0,i.Tn)(e)){const o=s(e,t,n,r);return o&&(0,i.yL)(o)&&o.catch(e=>{a(e,t,n)}),o}if((0,i.cy)(e)){const i=[];for(let s=0;s<e.length;s++)i.push(o(e[s],t,n,r));return i}}function a(e,t,n,o=!0){t&&t.vnode;const{errorHandler:a,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||i.MZ;if(t){let i=t.parent;const o=t.proxy,l=`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,o,l))return;i=i.parent}if(a)return(0,r.C4)(),s(a,null,10,[e,o,l]),void(0,r.bl)()}!function(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}(e,0,0,o,l)}const l=[];let c=-1;const d=[];let u=null,h=0;const p=Promise.resolve();let f=null;function m(e){const t=f||p;return e?t.then(this?e.bind(this):e):t}function _(e){if(!(1&e.flags)){const t=y(e),n=l[l.length-1];!n||!(2&e.flags)&&t>=y(n)?l.push(e):l.splice(function(e){let t=c+1,n=l.length;for(;t<n;){const r=t+n>>>1,i=l[r],s=y(i);s<e||s===e&&2&i.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,g()}}function g(){f||(f=p.then(w))}function b(e,t,n=c+1){for(;n<l.length;n++){const t=l[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;l.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function v(e){if(d.length){const e=[...new Set(d)].sort((e,t)=>y(e)-y(t));if(d.length=0,u)return void u.push(...e);for(u=e,h=0;h<u.length;h++){const e=u[h];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}u=null,h=0}}const y=e=>null==e.id?2&e.flags?-1:1/0:e.id;function w(e){i.tE;try{for(c=0;c<l.length;c++){const e=l[c];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),s(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;c<l.length;c++){const e=l[c];e&&(e.flags&=-2)}c=-1,l.length=0,v(),f=null,(l.length||d.length)&&w(e)}}let x=null,k=null;function S(e){const t=x;return x=e,k=e&&e.type.__scopeId||null,t}function C(e,t){if(null===x)return e;const n=sn(x),s=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[o,a,l,c=i.MZ]=t[e];o&&((0,i.Tn)(o)&&(o={mounted:o,updated:o}),o.deep&&(0,r.hV)(a),s.push({dir:o,instance:n,value:a,oldValue:void 0,arg:l,modifiers:c}))}return e}function M(e,t,n,i){const s=e.dirs,a=t&&t.dirs;for(let l=0;l<s.length;l++){const c=s[l];a&&(c.oldValue=a[l].value);let d=c.dir[i];d&&((0,r.C4)(),o(d,n,8,[e.el,c,e,t]),(0,r.bl)())}}const T=Symbol("_vte"),L=Symbol("_leaveCb"),z=Symbol("_enterCb");function A(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Z(()=>{e.isMounted=!0}),ee(()=>{e.isUnmounting=!0}),e}const P=[Function,Array],R={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:P,onEnter:P,onAfterEnter:P,onEnterCancelled:P,onBeforeLeave:P,onLeave:P,onAfterLeave:P,onLeaveCancelled:P,onBeforeAppear:P,onAppear:P,onAfterAppear:P,onAppearCancelled:P};function N(e,t,n,r,s){const{appear:a,mode:l,persisted:c=!1,onBeforeEnter:d,onEnter:u,onAfterEnter:h,onEnterCancelled:p,onBeforeLeave:f,onLeave:m,onAfterLeave:_,onLeaveCancelled:g,onBeforeAppear:b,onAppear:v,onAfterAppear:y,onAppearCancelled:w}=t,x=String(e.key),k=function(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}(n,e),S=(e,t)=>{e&&o(e,r,9,t)},C=(e,t)=>{const n=t[1];S(e,t),(0,i.cy)(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},M={mode:l,persisted:c,beforeEnter(t){let r=d;if(!n.isMounted){if(!a)return;r=b||d}t[L]&&t[L](!0);const i=k[x];i&&At(e,i)&&i.el[L]&&i.el[L](),S(r,[t])},enter(e){let t=u,r=h,i=p;if(!n.isMounted){if(!a)return;t=v||u,r=y||h,i=w||p}let s=!1;const o=e[z]=t=>{s||(s=!0,S(t?i:r,[e]),M.delayedLeave&&M.delayedLeave(),e[z]=void 0)};t?C(t,[e,o]):o()},leave(t,r){const i=String(e.key);if(t[z]&&t[z](!0),n.isUnmounting)return r();S(f,[t]);let s=!1;const o=t[L]=n=>{s||(s=!0,r(),S(n?g:_,[t]),t[L]=void 0,k[i]===e&&delete k[i])};k[i]=e,m?C(m,[t,o]):o()},clone(e){const i=N(e,t,n,r,s);return s&&s(i),i}};return M}function E(e,t){6&e.shapeFlag&&e.component?(e.transition=t,E(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 O(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=null==n?o.key:String(n)+String(null!=o.key?o.key:s);o.type===gt?(128&o.patchFlag&&i++,r=r.concat(O(o.children,t,a))):(t||o.type!==vt)&&r.push(null!=a?Ot(o,{key:a}):o)}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function I(e,t){return(0,i.Tn)(e)?(()=>(0,i.X$)({name:e.name},t,{setup:e}))():e}function B(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function D(e){const t=Gt(),n=(0,r.IJ)(null);if(t){const r=t.refs===i.MZ?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}const V=new WeakMap;function H(e,t,n,o,a=!1){if((0,i.cy)(e))return void e.forEach((e,r)=>H(e,t&&((0,i.cy)(t)?t[r]:t),n,o,a));if(F(o)&&!a)return void(512&o.shapeFlag&&o.type.__asyncResolved&&o.component.subTree.component&&H(e,t,n,o.component.subTree));const l=4&o.shapeFlag?sn(o.component):o.el,c=a?null:l,{i:d,r:u}=e,h=t&&t.r,p=d.refs===i.MZ?d.refs={}:d.refs,f=d.setupState,m=(0,r.ux)(f),_=f===i.MZ?i.NO:e=>(0,i.$3)(m,e);if(null!=h&&h!==u)if(j(t),(0,i.Kg)(h))p[h]=null,_(h)&&(f[h]=null);else if((0,r.i9)(h)){h.value=null;const e=t;e.k&&(p[e.k]=null)}if((0,i.Tn)(u))s(u,d,12,[c,p]);else{const t=(0,i.Kg)(u),s=(0,r.i9)(u);if(t||s){const r=()=>{if(e.f){const n=t?_(u)?f[u]:p[u]:u.value;if(a)(0,i.cy)(n)&&(0,i.TF)(n,l);else if((0,i.cy)(n))n.includes(l)||n.push(l);else if(t)p[u]=[l],_(u)&&(f[u]=p[u]);else{const t=[l];u.value=t,e.k&&(p[e.k]=t)}}else t?(p[u]=c,_(u)&&(f[u]=c)):s&&(u.value=c,e.k&&(p[e.k]=c))};if(c){const t=()=>{r(),V.delete(e)};t.id=-1,V.set(e,t),Ke(t,n)}else j(e),r()}}}function j(e){const t=V.get(e);t&&(t.flags|=8,V.delete(e))}(0,i.We)().requestIdleCallback,(0,i.We)().cancelIdleCallback;const F=e=>!!e.type.__asyncLoader,U=e=>e.type.__isKeepAlive;function q(e,t){G(e,"a",t)}function $(e,t){G(e,"da",t)}function G(e,t,n=$t){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(K(t,r,n),n){let e=n.parent;for(;e&&e.parent;)U(e.parent.vnode)&&X(r,t,n,e),e=e.parent}}function X(e,t,n,r){const s=K(t,e,r,!0);te(()=>{(0,i.TF)(r[t],s)},n)}function K(e,t,n=$t,i=!1){if(n){const s=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...i)=>{(0,r.C4)();const s=Wt(n),a=o(t,n,e,i);return s(),(0,r.bl)(),a});return i?s.unshift(a):s.push(a),a}}RegExp,RegExp;const W=e=>(t,n=$t)=>{en&&"sp"!==e||K(e,(...e)=>t(...e),n)},Y=W("bm"),Z=W("m"),Q=W("bu"),J=W("u"),ee=W("bum"),te=W("um"),ne=W("sp"),re=W("rtg"),ie=W("rtc");function se(e,t=$t){K("ec",e,t)}const oe="components",ae=Symbol.for("v-ndc");function le(e){return(0,i.Kg)(e)?function(e,t,n=!0,r=!1){const s=x||$t;if(s){const n=s.type;if(e===oe){const e=function(e,t=!0){return(0,i.Tn)(e)?e.displayName||e.name:e.name||t&&e.__name}(n,!1);if(e&&(e===t||e===(0,i.PT)(t)||e===(0,i.ZH)((0,i.PT)(t))))return n}const o=ce(s[e]||n[e],t)||ce(s.appContext[e],t);return!o&&r?n:o}}(oe,e,!1)||e:e||ae}function ce(e,t){return e&&(e[t]||e[(0,i.PT)(t)]||e[(0,i.ZH)((0,i.PT)(t))])}function de(e,t,n,s){let o;const a=n&&n[s],l=(0,i.cy)(e);if(l||(0,i.Kg)(e)){let n=!1,i=!1;l&&(0,r.g8)(e)&&(n=!(0,r.fE)(e),i=(0,r.Tm)(e),e=(0,r.qA)(e)),o=new Array(e.length);for(let s=0,l=e.length;s<l;s++)o[s]=t(n?i?(0,r.a1)((0,r.lJ)(e[s])):(0,r.lJ)(e[s]):e[s],s,void 0,a&&a[s])}else if("number"==typeof e){o=new Array(e);for(let n=0;n<e;n++)o[n]=t(n+1,n,void 0,a&&a[n])}else if((0,i.Gv)(e))if(e[Symbol.iterator])o=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{const n=Object.keys(e);o=new Array(n.length);for(let r=0,i=n.length;r<i;r++){const i=n[r];o[r]=t(e[i],i,r,a&&a[r])}}else o=[];return n&&(n[s]=o),o}const ue=e=>e?Zt(e)?sn(e):ue(e.parent):null,he=(0,i.X$)(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=>ue(e.parent),$root:e=>ue(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ve(e),$forceUpdate:e=>e.f||(e.f=()=>{_(e.update)}),$nextTick:e=>e.n||(e.n=m.bind(e.proxy)),$watch:e=>st.bind(e)}),pe=(e,t)=>e!==i.MZ&&!e.__isScriptSetup&&(0,i.$3)(e,t),fe={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:l,type:c,appContext:d}=e;let u;if("$"!==t[0]){const r=l[t];if(void 0!==r)switch(r){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(pe(s,t))return l[t]=1,s[t];if(o!==i.MZ&&(0,i.$3)(o,t))return l[t]=2,o[t];if((u=e.propsOptions[0])&&(0,i.$3)(u,t))return l[t]=3,a[t];if(n!==i.MZ&&(0,i.$3)(n,t))return l[t]=4,n[t];_e&&(l[t]=0)}}const h=he[t];let p,f;return h?("$attrs"===t&&(0,r.u4)(e.attrs,"get",""),h(e)):(p=c.__cssModules)&&(p=p[t])?p:n!==i.MZ&&(0,i.$3)(n,t)?(l[t]=4,n[t]):(f=d.config.globalProperties,(0,i.$3)(f,t)?f[t]:void 0)},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return pe(s,t)?(s[t]=n,!0):r!==i.MZ&&(0,i.$3)(r,t)?(r[t]=n,!0):!((0,i.$3)(e.props,t)||"$"===t[0]&&t.slice(1)in e||(o[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,propsOptions:o,type:a}},l){let c,d;return!!(n[l]||e!==i.MZ&&"$"!==l[0]&&(0,i.$3)(e,l)||pe(t,l)||(c=o[0])&&(0,i.$3)(c,l)||(0,i.$3)(r,l)||(0,i.$3)(he,l)||(0,i.$3)(s.config.globalProperties,l)||(d=a.__cssModules)&&d[l])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:(0,i.$3)(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function me(e){return(0,i.cy)(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let _e=!0;function ge(e,t,n){o((0,i.cy)(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function be(e,t,n,r){let s=r.includes(".")?ot(n,r):()=>n[r];if((0,i.Kg)(e)){const n=t[e];(0,i.Tn)(n)&&rt(s,n)}else if((0,i.Tn)(e))rt(s,e.bind(n));else if((0,i.Gv)(e))if((0,i.cy)(e))e.forEach(e=>be(e,t,n,r));else{const r=(0,i.Tn)(e.handler)?e.handler.bind(n):t[e.handler];(0,i.Tn)(r)&&rt(s,r,e)}}function ve(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,l=o.get(t);let c;return l?c=l:s.length||n||r?(c={},s.length&&s.forEach(e=>ye(c,e,a,!0)),ye(c,t,a)):c=t,(0,i.Gv)(t)&&o.set(t,c),c}function ye(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&ye(e,s,n,!0),i&&i.forEach(t=>ye(e,t,n,!0));for(const i in t)if(r&&"expose"===i);else{const r=we[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}const we={data:xe,props:Me,emits:Me,methods:Ce,computed:Ce,beforeCreate:Se,created:Se,beforeMount:Se,mounted:Se,beforeUpdate:Se,updated:Se,beforeDestroy:Se,beforeUnmount:Se,destroyed:Se,unmounted:Se,activated:Se,deactivated:Se,errorCaptured:Se,serverPrefetch:Se,components:Ce,directives:Ce,watch:function(e,t){if(!e)return t;if(!t)return e;const n=(0,i.X$)(Object.create(null),e);for(const r in t)n[r]=Se(e[r],t[r]);return n},provide:xe,inject:function(e,t){return Ce(ke(e),ke(t))}};function xe(e,t){return t?e?function(){return(0,i.X$)((0,i.Tn)(e)?e.call(this,this):e,(0,i.Tn)(t)?t.call(this,this):t)}:t:e}function ke(e){if((0,i.cy)(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Se(e,t){return e?[...new Set([].concat(e,t))]:t}function Ce(e,t){return e?(0,i.X$)(Object.create(null),e,t):t}function Me(e,t){return e?(0,i.cy)(e)&&(0,i.cy)(t)?[...new Set([...e,...t])]:(0,i.X$)(Object.create(null),me(e),me(null!=t?t:{})):t}function Te(){return{app:null,config:{isNativeTag:i.NO,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 Le=0;function ze(e,t){return function(n,r=null){(0,i.Tn)(n)||(n=(0,i.X$)({},n)),null==r||(0,i.Gv)(r)||(r=null);const s=Te(),a=new WeakSet,l=[];let c=!1;const d=s.app={_uid:Le++,_component:n,_props:r,_container:null,_context:s,_instance:null,version:an,get config(){return s.config},set config(e){},use:(e,...t)=>(a.has(e)||(e&&(0,i.Tn)(e.install)?(a.add(e),e.install(d,...t)):(0,i.Tn)(e)&&(a.add(e),e(d,...t))),d),mixin:e=>(s.mixins.includes(e)||s.mixins.push(e),d),component:(e,t)=>t?(s.components[e]=t,d):s.components[e],directive:(e,t)=>t?(s.directives[e]=t,d):s.directives[e],mount(i,o,a){if(!c){const l=d._ceVNode||Et(n,r);return l.appContext=s,!0===a?a="svg":!1===a&&(a=void 0),o&&t?t(l,i):e(l,i,a),c=!0,d._container=i,i.__vue_app__=d,sn(l.component)}},onUnmount(e){l.push(e)},unmount(){c&&(o(l,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide:(e,t)=>(s.provides[e]=t,d),runWithContext(e){const t=Ae;Ae=d;try{return e()}finally{Ae=t}}};return d}}let Ae=null;function Pe(e,t,n=!1){const r=Gt();if(r||Ae){let s=Ae?Ae._context.provides:r?null==r.parent||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&(0,i.Tn)(t)?t.call(r&&r.proxy):t}}const Re={},Ne=()=>Object.create(Re),Ee=e=>Object.getPrototypeOf(e)===Re;function Oe(e,t,n,s){const[o,a]=e.propsOptions;let l,c=!1;if(t)for(let r in t){if((0,i.SU)(r))continue;const d=t[r];let u;o&&(0,i.$3)(o,u=(0,i.PT)(r))?a&&a.includes(u)?(l||(l={}))[u]=d:n[u]=d:ut(e.emitsOptions,r)||r in s&&d===s[r]||(s[r]=d,c=!0)}if(a){const t=(0,r.ux)(n),s=l||i.MZ;for(let r=0;r<a.length;r++){const l=a[r];n[l]=Ie(o,t,l,s[l],e,!(0,i.$3)(s,l))}}return c}function Ie(e,t,n,r,s,o){const a=e[n];if(null!=a){const e=(0,i.$3)(a,"default");if(e&&void 0===r){const e=a.default;if(a.type!==Function&&!a.skipFactory&&(0,i.Tn)(e)){const{propsDefaults:i}=s;if(n in i)r=i[n];else{const o=Wt(s);r=i[n]=e.call(null,t),o()}}else r=e;s.ce&&s.ce._setProp(n,r)}a[0]&&(o&&!e?r=!1:!a[1]||""!==r&&r!==(0,i.Tg)(n)||(r=!0))}return r}const Be=new WeakMap;function De(e,t,n=!1){const r=n?Be:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,a={},l=[];let c=!1;if(!(0,i.Tn)(e)){const r=e=>{c=!0;const[n,r]=De(e,t,!0);(0,i.X$)(a,n),r&&l.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!o&&!c)return(0,i.Gv)(e)&&r.set(e,i.Oj),i.Oj;if((0,i.cy)(o))for(let e=0;e<o.length;e++){const t=(0,i.PT)(o[e]);Ve(t)&&(a[t]=i.MZ)}else if(o)for(const e in o){const t=(0,i.PT)(e);if(Ve(t)){const n=o[e],r=a[t]=(0,i.cy)(n)||(0,i.Tn)(n)?{type:n}:(0,i.X$)({},n),s=r.type;let c=!1,d=!0;if((0,i.cy)(s))for(let e=0;e<s.length;++e){const t=s[e],n=(0,i.Tn)(t)&&t.name;if("Boolean"===n){c=!0;break}"String"===n&&(d=!1)}else c=(0,i.Tn)(s)&&"Boolean"===s.name;r[0]=c,r[1]=d,(c||(0,i.$3)(r,"default"))&&l.push(t)}}const d=[a,l];return(0,i.Gv)(e)&&r.set(e,d),d}function Ve(e){return"$"!==e[0]&&!(0,i.SU)(e)}const He=e=>"_"===e||"_ctx"===e||"$stable"===e,je=e=>(0,i.cy)(e)?e.map(Vt):[Vt(e)],Fe=(e,t,n)=>{if(t._n)return t;const r=function(e,t=x){if(!t)return e;if(e._n)return e;const n=(...r)=>{n._d&&Ct(-1);const i=S(t);let s;try{s=e(...r)}finally{S(i),n._d&&Ct(1)}return s};return n._n=!0,n._c=!0,n._d=!0,n}((...e)=>je(t(...e)),n);return r._c=!1,r},Ue=(e,t,n)=>{const r=e._ctx;for(const n in e){if(He(n))continue;const s=e[n];if((0,i.Tn)(s))t[n]=Fe(0,s,r);else if(null!=s){const e=je(s);t[n]=()=>e}}},qe=(e,t)=>{const n=je(t);e.slots.default=()=>n},$e=(e,t,n)=>{for(const r in t)!n&&He(r)||(e[r]=t[r])},Ge=(e,t,n)=>{const r=e.slots=Ne();if(32&e.vnode.shapeFlag){const e=t._;e?($e(r,t,n),n&&(0,i.yQ)(r,"_",e,!0)):Ue(t,r)}else t&&qe(e,t)},Xe=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,a=i.MZ;if(32&r.shapeFlag){const e=t._;e?n&&1===e?o=!1:$e(s,t,n):(o=!t.$stable,Ue(t,s)),a=t}else t&&(qe(e,t),a={default:1});if(o)for(const e in s)He(e)||null!=a[e]||delete s[e]},Ke=function(e,t){t&&t.pendingBranch?(0,i.cy)(e)?t.effects.push(...e):t.effects.push(e):(n=e,(0,i.cy)(n)?d.push(...n):u&&-1===n.id?u.splice(h+1,0,n):1&n.flags||(d.push(n),n.flags|=1),g());var n};function We(e){return function(e,t){(0,i.We)().__VUE__=!0;const{insert:n,remove:o,patchProp:l,createElement:c,createText:d,createComment:u,setText:h,setElementText:p,parentNode:f,nextSibling:m,setScopeId:g=i.tE,insertStaticContent:y}=e,w=(e,t,n,r=null,i=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!At(e,t)&&(r=te(e),Y(e,i,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case bt:x(e,t,n,r);break;case vt:k(e,t,n,r);break;case yt:null==e&&S(t,n,r,o);break;case gt:I(e,t,n,r,i,s,o,a,l);break;default:1&u?z(e,t,n,r,i,s,o,a,l):6&u?D(e,t,n,r,i,s,o,a,l):(64&u||128&u)&&c.process(e,t,n,r,i,s,o,a,l,ie)}null!=d&&i?H(d,e&&e.ref,s,t||e,!t):null==d&&e&&null!=e.ref&&H(e.ref,null,s,e,!0)},x=(e,t,r,i)=>{if(null==e)n(t.el=d(t.children),r,i);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},k=(e,t,r,i)=>{null==e?n(t.el=u(t.children||""),r,i):t.el=e.el},S=(e,t,n,r)=>{[e.el,e.anchor]=y(e.children,t,n,r,e.el,e.anchor)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),o(e),e=n;o(t)},z=(e,t,n,r,i,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?A(t,n,r,i,s,o,a,l):N(e,t,i,s,o,a,l)},A=(e,t,r,s,o,a,d,u)=>{let h,f;const{props:m,shapeFlag:_,transition:g,dirs:b}=e;if(h=e.el=c(e.type,a,m&&m.is,m),8&_?p(h,e.children):16&_&&R(e.children,h,null,s,o,Ye(e,a),d,u),b&&M(e,null,s,"created"),P(h,e,e.scopeId,d,s),m){for(const e in m)"value"===e||(0,i.SU)(e)||l(h,e,null,m[e],a,s);"value"in m&&l(h,"value",null,m.value,a),(f=m.onVnodeBeforeMount)&&Ft(f,s,e)}b&&M(e,null,s,"beforeMount");const v=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(o,g);v&&g.beforeEnter(h),n(h,t,r),((f=m&&m.onVnodeMounted)||v||b)&&Ke(()=>{f&&Ft(f,s,e),v&&g.enter(h),b&&M(e,null,s,"mounted")},o)},P=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||_t(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=i.vnode;P(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},R=(e,t,n,r,i,s,o,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Ht(e[c]):Vt(e[c]);w(null,l,t,n,r,i,s,o,a)}},N=(e,t,n,r,s,o,a)=>{const c=t.el=e.el;let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const f=e.props||i.MZ,m=t.props||i.MZ;let _;if(n&&Ze(n,!1),(_=m.onVnodeBeforeUpdate)&&Ft(_,n,t,e),h&&M(t,e,n,"beforeUpdate"),n&&Ze(n,!0),(f.innerHTML&&null==m.innerHTML||f.textContent&&null==m.textContent)&&p(c,""),u?E(e.dynamicChildren,u,c,n,r,Ye(t,s),o):a||G(e,t,c,null,n,r,Ye(t,s),o,!1),d>0){if(16&d)O(c,f,m,n,s);else if(2&d&&f.class!==m.class&&l(c,"class",null,m.class,s),4&d&&l(c,"style",f.style,m.style,s),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const r=e[t],i=f[r],o=m[r];o===i&&"value"!==r||l(c,r,i,o,s,n)}}1&d&&e.children!==t.children&&p(c,t.children)}else a||null!=u||O(c,f,m,n,s);((_=m.onVnodeUpdated)||h)&&Ke(()=>{_&&Ft(_,n,t,e),h&&M(t,e,n,"updated")},r)},E=(e,t,n,r,i,s,o)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],d=l.el&&(l.type===gt||!At(l,c)||198&l.shapeFlag)?f(l.el):n;w(l,c,d,null,r,i,s,o,!0)}},O=(e,t,n,r,s)=>{if(t!==n){if(t!==i.MZ)for(const o in t)(0,i.SU)(o)||o in n||l(e,o,t[o],null,s,r);for(const o in n){if((0,i.SU)(o))continue;const a=n[o],c=t[o];a!==c&&"value"!==o&&l(e,o,c,a,s,r)}"value"in n&&l(e,"value",t.value,n.value,s)}},I=(e,t,r,i,s,o,a,l,c)=>{const u=t.el=e?e.el:d(""),h=t.anchor=e?e.anchor:d("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=t;m&&(l=l?l.concat(m):m),null==e?(n(u,r,i),n(h,r,i),R(t.children||[],r,h,s,o,a,l,c)):p>0&&64&p&&f&&e.dynamicChildren?(E(e.dynamicChildren,f,r,s,o,a,l),(null!=t.key||s&&t===s.subTree)&&Qe(e,t,!0)):G(e,t,r,h,s,o,a,l,c)},D=(e,t,n,r,i,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?i.ctx.activate(t,n,r,o,l):V(t,n,r,i,s,o,l):j(e,t,l)},V=(e,t,n,o,l,c,d)=>{const u=e.component=function(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Ut,a={uid:qt++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new r.yC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:De(s,o),emitsOptions:dt(s,o),emit:null,emitted:null,propsDefaults:i.MZ,inheritAttrs:s.inheritAttrs,ctx:i.MZ,data:i.MZ,props:i.MZ,attrs:i.MZ,slots:i.MZ,refs:i.MZ,setupState:i.MZ,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=lt.bind(null,a),e.ce&&e.ce(a),a}(e,o,l);if(U(e)&&(u.ctx.renderer=ie),function(e,t=!1,n=!1){t&&Kt(t);const{props:o,children:l}=e.vnode,c=Zt(e);!function(e,t,n,i=!1){const s={},o=Ne();e.propsDefaults=Object.create(null),Oe(e,t,s,o);for(const t in e.propsOptions[0])t in s||(s[t]=void 0);n?e.props=i?s:(0,r.Gc)(s):e.type.props?e.props=s:e.props=o,e.attrs=o}(e,o,c,t),Ge(e,l,n||t);const d=c?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,fe);const{setup:o}=n;if(o){(0,r.C4)();const n=e.setupContext=o.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,rn),slots:e.slots,emit:e.emit,expose:t}}(e):null,l=Wt(e),c=s(o,e,0,[e.props,n]),d=(0,i.yL)(c);if((0,r.bl)(),l(),!d&&!e.sp||F(e)||B(e),d){if(c.then(Yt,Yt),t)return c.then(n=>{tn(e,n,t)}).catch(t=>{a(t,e,0)});e.asyncDep=c}else tn(e,c,t)}else nn(e,t)}(e,t):void 0;t&&Kt(!1)}(u,!1,d),u.asyncDep){if(l&&l.registerDep(u,q,d),!e.el){const r=u.subTree=Et(vt);k(null,r,t,n),e.placeholder=r.el}}else q(u,e,t,n,l,c,d)},j=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:i,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!(!i&&!a||a&&a.$stable)||r!==o&&(r?!o||mt(r,o,c):!!o);if(1024&l)return!0;if(16&l)return r?mt(r,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]!==r[n]&&!ut(c,n))return!0}}return!1}(e,t,n)){if(r.asyncDep&&!r.asyncResolved)return void $(r,t,n);r.next=t,r.update()}else t.el=e.el,r.vnode=t},q=(e,t,n,s,o,a,l)=>{const c=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:d}=e;{const n=Je(e);if(n)return t&&(t.el=d.el,$(e,t,l)),void n.asyncDep.then(()=>{e.isUnmounted||c()})}let u,h=t;Ze(e,!1),t?(t.el=d.el,$(e,t,l)):t=d,n&&(0,i.DY)(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Ft(u,s,t,d),Ze(e,!0);const p=ht(e),m=e.subTree;e.subTree=p,w(m,p,f(m.el),te(m),e,o,a),t.el=p.el,null===h&&function({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),r&&Ke(r,o),(u=t.props&&t.props.onVnodeUpdated)&&Ke(()=>Ft(u,s,t,d),o)}else{let r;const{el:l,props:c}=t,{bm:d,m:u,parent:h,root:p,type:f}=e,m=F(t);if(Ze(e,!1),d&&(0,i.DY)(d),!m&&(r=c&&c.onVnodeBeforeMount)&&Ft(r,h,t),Ze(e,!0),l&&oe){const t=()=>{e.subTree=ht(e),oe(l,e.subTree,e,o,null)};m&&f.__asyncHydrate?f.__asyncHydrate(l,e,t):t()}else{p.ce&&!1!==p.ce._def.shadowRoot&&p.ce._injectChildStyle(f);const r=e.subTree=ht(e);w(null,r,n,s,e,o,a),t.el=r.el}if(u&&Ke(u,o),!m&&(r=c&&c.onVnodeMounted)){const e=t;Ke(()=>Ft(r,h,e),o)}(256&t.shapeFlag||h&&F(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&Ke(e.a,o),e.isMounted=!0,t=n=s=null}};e.scope.on();const d=e.effect=new r.X2(c);e.scope.off();const u=e.update=d.run.bind(d),h=e.job=d.runIfDirty.bind(d);h.i=e,h.id=e.uid,d.scheduler=()=>_(h),Ze(e,!0),u()},$=(e,t,n)=>{t.component=e;const s=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:l}}=e,c=(0,r.ux)(o),[d]=e.propsOptions;let u=!1;if(!(s||l>0)||16&l){let r;Oe(e,t,o,a)&&(u=!0);for(const s in c)t&&((0,i.$3)(t,s)||(r=(0,i.Tg)(s))!==s&&(0,i.$3)(t,r))||(d?!n||void 0===n[s]&&void 0===n[r]||(o[s]=Ie(d,c,s,void 0,e,!0)):delete o[s]);if(a!==c)for(const e in a)t&&(0,i.$3)(t,e)||(delete a[e],u=!0)}else if(8&l){const n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let s=n[r];if(ut(e.emitsOptions,s))continue;const l=t[s];if(d)if((0,i.$3)(a,s))l!==a[s]&&(a[s]=l,u=!0);else{const t=(0,i.PT)(s);o[t]=Ie(d,c,t,l,e,!1)}else l!==a[s]&&(a[s]=l,u=!0)}}u&&(0,r.hZ)(e.attrs,"set","")}(e,t.props,s,n),Xe(e,t.children,n),(0,r.C4)(),b(e),(0,r.bl)()},G=(e,t,n,r,i,s,o,a,l=!1)=>{const c=e&&e.children,d=e?e.shapeFlag:0,u=t.children,{patchFlag:h,shapeFlag:f}=t;if(h>0){if(128&h)return void K(c,u,n,r,i,s,o,a,l);if(256&h)return void X(c,u,n,r,i,s,o,a,l)}8&f?(16&d&&ee(c,i,s),u!==c&&p(n,u)):16&d?16&f?K(c,u,n,r,i,s,o,a,l):ee(c,i,s,!0):(8&d&&p(n,""),16&f&&R(u,n,r,i,s,o,a,l))},X=(e,t,n,r,s,o,a,l,c)=>{e=e||i.Oj,t=t||i.Oj;const d=e.length,u=t.length,h=Math.min(d,u);let p;for(p=0;p<h;p++){const r=t[p]=c?Ht(t[p]):Vt(t[p]);w(e[p],r,n,null,s,o,a,l,c)}d>u?ee(e,s,o,!0,!1,h):R(t,n,r,s,o,a,l,c,h)},K=(e,t,n,r,s,o,a,l,c)=>{let d=0;const u=t.length;let h=e.length-1,p=u-1;for(;d<=h&&d<=p;){const r=e[d],i=t[d]=c?Ht(t[d]):Vt(t[d]);if(!At(r,i))break;w(r,i,n,null,s,o,a,l,c),d++}for(;d<=h&&d<=p;){const r=e[h],i=t[p]=c?Ht(t[p]):Vt(t[p]);if(!At(r,i))break;w(r,i,n,null,s,o,a,l,c),h--,p--}if(d>h){if(d<=p){const e=p+1,i=e<u?t[e].el:r;for(;d<=p;)w(null,t[d]=c?Ht(t[d]):Vt(t[d]),n,i,s,o,a,l,c),d++}}else if(d>p)for(;d<=h;)Y(e[d],s,o,!0),d++;else{const f=d,m=d,_=new Map;for(d=m;d<=p;d++){const e=t[d]=c?Ht(t[d]):Vt(t[d]);null!=e.key&&_.set(e.key,d)}let g,b=0;const v=p-m+1;let y=!1,x=0;const k=new Array(v);for(d=0;d<v;d++)k[d]=0;for(d=f;d<=h;d++){const r=e[d];if(b>=v){Y(r,s,o,!0);continue}let i;if(null!=r.key)i=_.get(r.key);else for(g=m;g<=p;g++)if(0===k[g-m]&&At(r,t[g])){i=g;break}void 0===i?Y(r,s,o,!0):(k[i-m]=d+1,i>=x?x=i:y=!0,w(r,t[i],n,null,s,o,a,l,c),b++)}const S=y?function(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const l=e[r];if(0!==l){if(i=n[n.length-1],e[i]<l){t[r]=i,n.push(r);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[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}(k):i.Oj;for(g=S.length-1,d=v-1;d>=0;d--){const e=m+d,i=t[e],h=t[e+1],p=e+1<u?h.el||h.placeholder:r;0===k[d]?w(null,i,n,p,s,o,a,l,c):y&&(g<0||d!==S[g]?W(i,n,p,2):g--)}}},W=(e,t,r,i,s=null)=>{const{el:a,type:l,transition:c,children:d,shapeFlag:u}=e;if(6&u)W(e.component.subTree,t,r,i);else if(128&u)e.suspense.move(t,r,i);else if(64&u)l.move(e,t,r,ie);else if(l!==gt)if(l!==yt)if(2!==i&&1&u&&c)if(0===i)c.beforeEnter(a),n(a,t,r),Ke(()=>c.enter(a),s);else{const{leave:i,delayLeave:s,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?o(a):n(a,t,r)},u=()=>{a._isLeaving&&a[L](!0),i(a,()=>{d(),l&&l()})};s?s(a,d,u):u()}else n(a,t,r);else(({el:e,anchor:t},r,i)=>{let s;for(;e&&e!==t;)s=m(e),n(e,r,i),e=s;n(t,r,i)})(e,t,r);else{n(a,t,r);for(let e=0;e<d.length;e++)W(d[e],t,r,i);n(e.anchor,t,r)}},Y=(e,t,n,i=!1,s=!1)=>{const{type:o,props:a,ref:l,children:c,dynamicChildren:d,shapeFlag:u,patchFlag:h,dirs:p,cacheIndex:f}=e;if(-2===h&&(s=!1),null!=l&&((0,r.C4)(),H(l,null,n,e,!0),(0,r.bl)()),null!=f&&(t.renderCache[f]=void 0),256&u)return void t.ctx.deactivate(e);const m=1&u&&p,_=!F(e);let g;if(_&&(g=a&&a.onVnodeBeforeUnmount)&&Ft(g,t,e),6&u)J(e.component,n,i);else{if(128&u)return void e.suspense.unmount(n,i);m&&M(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,ie,i):d&&!d.hasOnce&&(o!==gt||h>0&&64&h)?ee(d,t,n,!1,!0):(o===gt&&384&h||!s&&16&u)&&ee(c,t,n),i&&Z(e)}(_&&(g=a&&a.onVnodeUnmounted)||m)&&Ke(()=>{g&&Ft(g,t,e),m&&M(e,null,t,"unmounted")},n)},Z=e=>{const{type:t,el:n,anchor:r,transition:i}=e;if(t===gt)return void Q(n,r);if(t===yt)return void C(e);const s=()=>{o(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){const{leave:t,delayLeave:r}=i,o=()=>t(n,s);r?r(e.el,s,o):o()}else s()},Q=(e,t)=>{let n;for(;e!==t;)n=m(e),o(e),e=n;o(t)},J=(e,t,n)=>{const{bum:r,scope:s,job:o,subTree:a,um:l,m:c,a:d}=e;et(c),et(d),r&&(0,i.DY)(r),s.stop(),o&&(o.flags|=8,Y(a,e,t,n)),l&&Ke(l,t),Ke(()=>{e.isUnmounted=!0},t)},ee=(e,t,n,r=!1,i=!1,s=0)=>{for(let o=s;o<e.length;o++)Y(e[o],t,n,r,i)},te=e=>{if(6&e.shapeFlag)return te(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=m(e.anchor||e.el),n=t&&t[T];return n?m(n):t};let ne=!1;const re=(e,t,n)=>{null==e?t._vnode&&Y(t._vnode,null,null,!0):w(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ne||(ne=!0,b(),v(),ne=!1)},ie={p:w,um:Y,m:W,r:Z,mt:V,mc:R,pc:G,pbc:E,n:te,o:e};let se,oe;return t&&([se,oe]=t(ie)),{render:re,hydrate:se,createApp:ze(re,se)}}(e)}function Ye({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 Ze({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Qe(e,t,n=!1){const r=e.children,s=t.children;if((0,i.cy)(r)&&(0,i.cy)(s))for(let e=0;e<r.length;e++){const t=r[e];let i=s[e];1&i.shapeFlag&&!i.dynamicChildren&&((i.patchFlag<=0||32===i.patchFlag)&&(i=s[e]=Ht(s[e]),i.el=t.el),n||-2===i.patchFlag||Qe(t,i)),i.type===bt&&-1!==i.patchFlag&&(i.el=t.el),i.type!==vt||i.el||(i.el=t.el)}}function Je(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Je(t)}function et(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const tt=Symbol.for("v-scx"),nt=()=>Pe(tt);function rt(e,t,n){return it(e,t,n)}function it(e,t,n=i.MZ){const{immediate:s,deep:a,flush:l,once:c}=n,d=(0,i.X$)({},n),u=t&&s||!t&&"post"!==l;let h;if(en)if("sync"===l){const e=nt();h=e.__watcherHandles||(e.__watcherHandles=[])}else if(!u){const e=()=>{};return e.stop=i.tE,e.resume=i.tE,e.pause=i.tE,e}const p=$t;d.call=(e,t,n)=>o(e,p,t,n);let f=!1;"post"===l?d.scheduler=e=>{Ke(e,p&&p.suspense)}:"sync"!==l&&(f=!0,d.scheduler=(e,t)=>{t?e():_(e)}),d.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};const m=(0,r.wB)(e,t,d);return en&&(h?h.push(m):u&&m()),m}function st(e,t,n){const r=this.proxy,s=(0,i.Kg)(e)?e.includes(".")?ot(r,e):()=>r[e]:e.bind(r,r);let o;(0,i.Tn)(t)?o=t:(o=t.handler,n=t);const a=Wt(this),l=it(s,o.bind(r),n);return a(),l}function ot(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 at=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${(0,i.PT)(t)}Modifiers`]||e[`${(0,i.Tg)(t)}Modifiers`];function lt(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||i.MZ;let s=n;const a=t.startsWith("update:"),l=a&&at(r,t.slice(7));let c;l&&(l.trim&&(s=n.map(e=>(0,i.Kg)(e)?e.trim():e)),l.number&&(s=n.map(i.bB)));let d=r[c=(0,i.rU)(t)]||r[c=(0,i.rU)((0,i.PT)(t))];!d&&a&&(d=r[c=(0,i.rU)((0,i.Tg)(t))]),d&&o(d,e,6,s);const u=r[c+"Once"];if(u){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,o(u,e,6,s)}}const ct=new WeakMap;function dt(e,t,n=!1){const r=n?ct:t.emitsCache,s=r.get(e);if(void 0!==s)return s;const o=e.emits;let a={},l=!1;if(!(0,i.Tn)(e)){const r=e=>{const n=dt(e,t,!0);n&&(l=!0,(0,i.X$)(a,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return o||l?((0,i.cy)(o)?o.forEach(e=>a[e]=null):(0,i.X$)(a,o),(0,i.Gv)(e)&&r.set(e,a),a):((0,i.Gv)(e)&&r.set(e,null),null)}function ut(e,t){return!(!e||!(0,i.Mp)(t))&&(t=t.slice(2).replace(/Once$/,""),(0,i.$3)(e,t[0].toLowerCase()+t.slice(1))||(0,i.$3)(e,(0,i.Tg)(t))||(0,i.$3)(e,t))}function ht(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:l,attrs:c,emit:d,render:u,renderCache:h,props:p,data:f,setupState:m,ctx:_,inheritAttrs:g}=e,b=S(e);let v,y;try{if(4&n.shapeFlag){const e=s||r,t=e;v=Vt(u.call(t,e,h,p,m,f,_)),y=c}else{const e=t;v=Vt(e.length>1?e(p,{attrs:c,slots:l,emit:d}):e(p,null)),y=t.props?c:pt(c)}}catch(t){wt.length=0,a(t,e,1),v=Et(vt)}let w=v;if(y&&!1!==g){const e=Object.keys(y),{shapeFlag:t}=w;e.length&&7&t&&(o&&e.some(i.CP)&&(y=ft(y,o)),w=Ot(w,y,!1,!0))}return n.dirs&&(w=Ot(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(n.dirs):n.dirs),n.transition&&E(w,n.transition),v=w,S(b),v}const pt=e=>{let t;for(const n in e)("class"===n||"style"===n||(0,i.Mp)(n))&&((t||(t={}))[n]=e[n]);return t},ft=(e,t)=>{const n={};for(const r in e)(0,i.CP)(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function mt(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(t[s]!==e[s]&&!ut(n,s))return!0}return!1}const _t=e=>e.__isSuspense;const gt=Symbol.for("v-fgt"),bt=Symbol.for("v-txt"),vt=Symbol.for("v-cmt"),yt=Symbol.for("v-stc"),wt=[];let xt=null;function kt(e=!1){wt.push(xt=e?null:[])}let St=1;function Ct(e,t=!1){St+=e,e<0&&xt&&t&&(xt.hasOnce=!0)}function Mt(e){return e.dynamicChildren=St>0?xt||i.Oj:null,wt.pop(),xt=wt[wt.length-1]||null,St>0&&xt&&xt.push(e),e}function Tt(e,t,n,r,i,s){return Mt(Nt(e,t,n,r,i,s,!0))}function Lt(e,t,n,r,i){return Mt(Et(e,t,n,r,i,!0))}function zt(e){return!!e&&!0===e.__v_isVNode}function At(e,t){return e.type===t.type&&e.key===t.key}const Pt=({key:e})=>null!=e?e:null,Rt=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?(0,i.Kg)(e)||(0,r.i9)(e)||(0,i.Tn)(e)?{i:x,r:e,k:t,f:!!n}:e:null);function Nt(e,t=null,n=null,r=0,s=null,o=(e===gt?0:1),a=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Pt(t),ref:t&&Rt(t),scopeId:k,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:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:x};return l?(jt(c,n),128&o&&e.normalize(c)):n&&(c.shapeFlag|=(0,i.Kg)(n)?8:16),St>0&&!a&&xt&&(c.patchFlag>0||6&o)&&32!==c.patchFlag&&xt.push(c),c}const Et=function(e,t=null,n=null,s=0,o=null,a=!1){if(e&&e!==ae||(e=vt),zt(e)){const r=Ot(e,t,!0);return n&&jt(r,n),St>0&&!a&&xt&&(6&r.shapeFlag?xt[xt.indexOf(e)]=r:xt.push(r)),r.patchFlag=-2,r}if(l=e,(0,i.Tn)(l)&&"__vccOpts"in l&&(e=e.__vccOpts),t){t=function(e){return e?(0,r.ju)(e)||Ee(e)?(0,i.X$)({},e):e:null}(t);let{class:e,style:n}=t;e&&!(0,i.Kg)(e)&&(t.class=(0,i.C4)(e)),(0,i.Gv)(n)&&((0,r.ju)(n)&&!(0,i.cy)(n)&&(n=(0,i.X$)({},n)),t.style=(0,i.Tr)(n))}var l;return Nt(e,t,n,s,o,(0,i.Kg)(e)?1:_t(e)?128:(e=>e.__isTeleport)(e)?64:(0,i.Gv)(e)?4:(0,i.Tn)(e)?2:0,a,!0)};function Ot(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:a,children:l,transition:c}=e,d=t?function(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)if("class"===e)t.class!==r.class&&(t.class=(0,i.C4)([t.class,r.class]));else if("style"===e)t.style=(0,i.Tr)([t.style,r.style]);else if((0,i.Mp)(e)){const n=t[e],s=r[e];!s||n===s||(0,i.cy)(n)&&n.includes(s)||(t[e]=n?[].concat(n,s):s)}else""!==e&&(t[e]=r[e])}return t}(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Pt(d),ref:t&&t.ref?n&&o?(0,i.cy)(o)?o.concat(Rt(t)):[o,Rt(t)]:Rt(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==gt?-1===a?16:16|a:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ot(e.ssContent),ssFallback:e.ssFallback&&Ot(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&E(u,c.clone(u)),u}function It(e=" ",t=0){return Et(bt,null,e,t)}function Bt(e,t){const n=Et(yt,null,e);return n.staticCount=t,n}function Dt(e="",t=!1){return t?(kt(),Lt(vt,null,e)):Et(vt,null,e)}function Vt(e){return null==e||"boolean"==typeof e?Et(vt):(0,i.cy)(e)?Et(gt,null,e.slice()):zt(e)?Ht(e):Et(bt,null,String(e))}function Ht(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ot(e)}function jt(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if((0,i.cy)(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),jt(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||Ee(t)?3===r&&x&&(1===x.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=x}}else(0,i.Tn)(t)?(t={default:t,_ctx:x},n=32):(t=String(t),64&r?(n=16,t=[It(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ft(e,t,n,r=null){o(e,t,7,[n,r])}const Ut=Te();let qt=0;let $t=null;const Gt=()=>$t||x;let Xt,Kt;{const e=(0,i.We)(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Xt=t("__VUE_INSTANCE_SETTERS__",e=>$t=e),Kt=t("__VUE_SSR_SETTERS__",e=>en=e)}const Wt=e=>{const t=$t;return Xt(e),e.scope.on(),()=>{e.scope.off(),Xt(t)}},Yt=()=>{$t&&$t.scope.off(),Xt(null)};function Zt(e){return 4&e.vnode.shapeFlag}let Qt,Jt,en=!1;function tn(e,t,n){(0,i.Tn)(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:(0,i.Gv)(t)&&(e.setupState=(0,r.Pr)(t)),nn(e,n)}function nn(e,t,n){const s=e.type;if(!e.render){if(!t&&Qt&&!s.render){const t=s.template||ve(e).template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:o,compilerOptions:a}=s,l=(0,i.X$)((0,i.X$)({isCustomElement:n,delimiters:o},r),a);s.render=Qt(t,l)}}e.render=s.render||i.tE,Jt&&Jt(e)}{const t=Wt(e);(0,r.C4)();try{!function(e){const t=ve(e),n=e.proxy,s=e.ctx;_e=!1,t.beforeCreate&&ge(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:l,watch:c,provide:d,inject:u,created:h,beforeMount:p,mounted:f,beforeUpdate:m,updated:_,activated:g,deactivated:b,beforeDestroy:v,beforeUnmount:y,destroyed:w,unmounted:x,render:k,renderTracked:S,renderTriggered:C,errorCaptured:M,serverPrefetch:T,expose:L,inheritAttrs:z,components:A,directives:P,filters:R}=t;if(u&&function(e,t){(0,i.cy)(e)&&(e=ke(e));for(const n in e){const s=e[n];let o;o=(0,i.Gv)(s)?"default"in s?Pe(s.from||n,s.default,!0):Pe(s.from||n):Pe(s),(0,r.i9)(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(u,s),l)for(const e in l){const t=l[e];(0,i.Tn)(t)&&(s[e]=t.bind(n))}if(o){const t=o.call(n,n);(0,i.Gv)(t)&&(e.data=(0,r.Kh)(t))}if(_e=!0,a)for(const e in a){const t=a[e],r=(0,i.Tn)(t)?t.bind(n,n):(0,i.Tn)(t.get)?t.get.bind(n,n):i.tE,o=!(0,i.Tn)(t)&&(0,i.Tn)(t.set)?t.set.bind(n):i.tE,l=on({get:r,set:o});Object.defineProperty(s,e,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e})}if(c)for(const e in c)be(c[e],s,n,e);if(d){const e=(0,i.Tn)(d)?d.call(n):d;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if($t){let n=$t.provides;const r=$t.parent&&$t.parent.provides;r===n&&(n=$t.provides=Object.create(r)),n[e]=t}}(t,e[t])})}function N(e,t){(0,i.cy)(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(h&&ge(h,e,"c"),N(Y,p),N(Z,f),N(Q,m),N(J,_),N(q,g),N($,b),N(se,M),N(ie,S),N(re,C),N(ee,y),N(te,x),N(ne,T),(0,i.cy)(L))if(L.length){const t=e.exposed||(e.exposed={});L.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===i.tE&&(e.render=k),null!=z&&(e.inheritAttrs=z),A&&(e.components=A),P&&(e.directives=P),T&&B(e)}(e)}finally{(0,r.bl)(),t()}}}const rn={get:(e,t)=>((0,r.u4)(e,"get",""),e[t])};function sn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy((0,r.Pr)((0,r.IG)(e.exposed)),{get:(t,n)=>n in t?t[n]:n in he?he[n](e):void 0,has:(e,t)=>t in e||t in he})):e.proxy}const on=(e,t)=>(0,r.EW)(e,t,en),an="3.5.21"},4412:(e,t,n)=>{"use strict";n.d(t,{PI:()=>u,C6:()=>d,vk:()=>h});var r=n(7633),i=n(4089),s=n(6996),o=n(1717),a=n(3755),l=n(4031),c=n(5955);class d extends l.K{_record;_resolve;_status=s.yn.pending;_p=Promise.resolve();_prev_tip_remove;get meta(){return d.meta}get status(){return this._status}constructor(e,t){const n=a.F.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,[s.yn.pending,s.yn.playing].includes(this.status)&&e()})}clear_message(){this._prev_tip_remove&&this._prev_tip_remove()}async play(){const e=a.F.tips;this.clear_message(),this.status!==s.yn.stop&&(this._status=s.yn.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 c.I.sleep(this.config.data.player_speed),await(0,i.dY)(),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(0,i.dY)(),this.history.record(t),await this.waiting()}this._status=s.yn.stop,this.clear_message(),this.stats.showing=!1,e?.tip_success("演示完毕",9e3)}pause(){const e=a.F.tips;this.clear_message(),this._status!==s.yn.stop&&(this._status=s.yn.pause,this.stats.showing=!1,this._prev_tip_remove=e?.tip_info("暂停演示,点此恢复",1/0,this.continue.bind(this)))}continue(){const e=a.F.tips;this.clear_message(),this._status!==s.yn.stop&&(this._resolve&&this._resolve(),this._status=s.yn.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:s.Mu.player,version:1}}}class u extends o.K{stack_undo=(0,r.Gc)([]);stack_redo=(0,r.Gc)([]);get meta(){return u.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=t.then(()=>{(0,i.dY)(()=>this.courier.pass(n))})}undo(){const e=a.F.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=a.F.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 d(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 r=new Blob([JSON.stringify(t)],{type:"text/plain"});n.href=URL.createObjectURL(r),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:s.Mu.history,version:1}}}class h{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((0,r.ux)(e)))}add_recover(e){e&&this.undo.unshift(e)}pass(e){let t=this.courier.pass(e);t instanceof h&&this.merge(t)}tick(e,t){(0,i.dY)(()=>{t?this.tell(t,e):this.courier.pass(e)})}tell(e,...t){const n=a.F.tips;if(this.courier.stats.mode===s.fv.read)return n?.tip_info("只读模式不可操作"),this;for(let n of t){if(!e||e.id!==n.id)return this;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)}return this}merge(e){return e instanceof h?(this.do.push(...structuredClone((0,r.ux)(e.stack_do))),this.undo.unshift(...structuredClone((0,r.ux)(e.stack_undo))),this):this}}},4709:(e,t,n)=>{"use strict";n.d(t,{w:()=>v});var r=n(7633),i=n(4089),s=n(1556),o=n(6996),a=n(2547),l=n(4412),c=n(5955),d=n(2819),u=n(9164),h=n(1068);class p{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:r}=e.config.data,i=e.bound,{pos_tree:s,size_bound:o}=i;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*r),c+=n.size_tree.height}}static left(e,t){const{map_node_hgap:n,map_node_vgap:r}=e.config.data,i=e.bound,{pos_tree:s,size_bound:o,size_tree:a}=i;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*r),d+=n.size_tree.height}}static down(e,t){const{map_node_hgap:n,map_node_vgap:r}=e.config.data,i=e.bound,{pos_tree:s,size_bound:o}=i;let a=s.x,l=s.y+r+o.height,c=0;for(let e=0;e<t.length;e++){const r=t[e].bound;r.update_pos_tree(a+c+e*n,l),c+=r.size_tree.width}}static up(e,t){const{map_node_hgap:n,map_node_vgap:r}=e.config.data,i=e.bound,{pos_tree:s,size_bound:o,size_tree:a}=i;let l=s.x,c=s.y+a.height-o.height-r,d=0;for(let e=0;e<t.length;e++){const r=t[e].bound;r.update_pos_tree(l+d+e*n,c-r.size_tree.height),d+=r.size_tree.width}}static time_right(e,t){const{map_node_hgap:n,map_node_vgap:r}=e.config.data,i=e.bound,{pos:s,size_bound:o}=i,{sum_tree_height:a,sum_tree_width:l,max_tree_height:c,max_tree_width:d,mw_rect:u,mh_rect:h}=e.bound.stat_downstream_nodes_size(t);let p=s.x+o.width+n,f=s.y+o.height/2,m=0;for(let e=0;e<t.length;e++){const r=t[e],i=r.bound,{size_bound:s,size_tree:o}=i,a=r.attrs.layout;"right"===a||"left"===a?i.update_pos_tree(p+m+e*n,f-o.height/2):"up"===a?i.update_pos_tree(p+m+e*n,f-(o.height-s.height/2)):i.update_pos_tree(p+m+e*n,f-s.height/2),m+=i.size_tree.width}}static time_down(e,t){const{map_node_vgap:n}=e.config.data,r=e.bound,{pos:i,size_bound:s}=r,{sum_tree_height:o,sum_tree_width:a,max_tree_height:l,max_tree_width:c,mw_rect:d,mh_rect:u}=e.bound.stat_downstream_nodes_size(t);Math.max(d.width,s.width);let h=i.x+s.width/2,p=i.y+s.height+n,f=0;for(let e=0;e<t.length;e++){const r=t[e],i=r.bound,s=r.attrs.layout,{size_bound:o,size_tree:a}=i;"left"===s?i.update_pos_tree(h-(a.width-o.width/2),p+f+e*n):"down"===s||"up"===s?i.update_pos_tree(h-a.width/2,p+f+e*n):i.update_pos_tree(h-o.width/2,p+f+e*n),f+=i.size_tree.height}}}var f=n(6094),m=n(1150),_=n(3214);class g{_node;_map;_bound;_env=(0,r.Kh)({upstream:void 0,downstream:[],layout:null});_all_downstream_nodes=(0,i.EW)(()=>this.get_layout_downstream_nodes());_siblings_info=(0,i.EW)(()=>this.get_siblings_info());_layout_line=(0,i.EW)(()=>{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[]});_folded_upstream=(0,i.EW)(()=>{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(){return[...this._layout_line.value]}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}=a.U.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 b{_node;_map;_in_view=(0,r.KR)(!0);_env;_bound;_wacher;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,Promise.resolve().then(()=>{this._wacher=(0,i.wB)(()=>this.show,()=>{this._map.set_graph_visible(this.node,this.show)})})}gc(){this._wacher&&this._wacher.stop()}check_show(){if(this.env.folded_upstream||!this.map.perf)return!1;const e=this.map.view_rect;h.MathRect.check_intersection(e,this.node.rect)?this.in_view=!0:this.in_view=!1}}class v extends _.M{_editable=(0,r.KR)(!1);_waiter=new Set;_layout_self_success=!1;_show=(0,r.KR)(!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=(0,r.Kh)({type:"rect",path:"",sample:[]});constructor(e,t){super(e,t),this.pcube=t,this._init_handler(),this._env=new g(this),this._checker=new b(this),this.bound=new s.yI(this,e.attrs.matrix2d||a.c.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=(0,i.EW)(()=>{if(this.is_layout_root||!this.env.upstream){const e={x:this.matrix2d.e,y:this.matrix2d.f};return a.U.offset_points(this.shape.sample,e)}return a.U.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,r=u.U.in_tail(n.id,0);t.tell(n,r),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:r,e:i,f:s}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return a.c.get_dom_string(this.matrix2d);{const i=this.bound.pos;return`matrix(${e.toFixed(1)},${t},${n},${r.toFixed(1)},${i.x.toFixed(1)},${i.y.toFixed(1)})`}}get matrix2d_real(){const{a:e,b:t,c:n,d:r,e:i,f:s}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return{...this.matrix2d};{const i=this.bound.pos;return{a:e,b:t,c:n,d:r,e:i.x,f:i.y}}}_init_handler(){this.set_cmd_handler(o.zS.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(o.zS.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(o.zS.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(o.zS.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(o.zS.cube_insert_child,this.on_insert_child.bind(this)),this.set_cmd_handler(o.s1.append_child,this.on_append_child.bind(this)),this.set_cmd_handler(o.s1.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 s.gv||t instanceof s.EU)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}move_to_center(){const e=this.pcube.get_view_center(),t=this.pcube.transform_point(e),n=this.bound.pos_center,r=this.pcube.real_point_to_fig(n),i=t.x-r.x,s=t.y-r.y,o=a.c.multiply(this.pcube.matrix2d,a.c.get_matrix_translate(i,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:r}=h.MathRect.move_rect_in_other(this.bound.rect,t),i=a.c.multiply(e.matrix2d,a.c.get_matrix_translate(n,r));e.reset_matrix(i),e.check_show()}check_in_fig_view(e=!1){const t=this.pcube.view_rect;return e?h.MathRect.can_contain(t,this.rect):h.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(p.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),this.is_layout_root&&this.pcube.has_layout&&(0,i.dY)(()=>this.pcube.check_show_line())}}layout_throttle=h.Notice.throttle(this.layout.bind(this),50);layout_self(e){const t=e.borderBoxSize[0];if(!t)return;const{blockSize:n,inlineSize:r}=t,i=this.bound.size;if(this.layout_self_success&&Math.abs(i.width-r)<this.mis&&Math.abs(i.height-n)<this.mis)return;this._layout_self_success=!0;const o={width:Math.ceil(r),height:Math.ceil(n)};this.bound.update_size(o.width,o.height),this.shape.path=s.AG.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=a.U.get_linker_id(e,t),r=this.pcube.get_linker(n);r&&(this.attrs.fold?r.show=!1:r.to_node?.show||this.show?r.show=!0:r.show=!1)}for(let t of this.from){const n=a.U.get_linker_id(t,e),r=this.pcube.get_linker(n);r&&(this.show||r.from_node?.show?r.show=!0:r.show=!1)}}get_sample(){if("rect"===this.shape.type){const e={x:0,y:0,...this.bound.size_bound},t=h.MathRect.get_rect_point;return[t(e,h._RectPosition.left_top),t(e,h._RectPosition.top_mid),t(e,h._RectPosition.right_top),t(e,h._RectPosition.right_mid),t(e,h._RectPosition.right_bottom),t(e,h._RectPosition.bottom_mid),t(e,h._RectPosition.left_bottom),t(e,h._RectPosition.left_mid),t(e,h._RectPosition.left_top)]}return a.U.svg_path_sample(this.shape.path,this.sample_count)}gc(){this.checker.gc(),this.base_gc()}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)i.push(e.export());return{children:r,data:i}}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=a.c.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 v&&t.break_link_node(this.id)}for(let e of this.to){const t=this.pcube.find_child_cube(e);t&&t instanceof v&&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,r=t.get_recorder();r.add_cmd(e);const i=this.export().info,s=c.I.build_cubes(n,this);return this.splice(0,this.child_count,...s),r.add_recover(d.V.reset(this.id,i)),r}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,o=this.find_child_cube(i);if(!o||o.index===s)return;const a=new l.vk(t);let c=0,u=o.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(u,1),this.splice(c,0,o),a.add_recover(d.V.reorder(this.id,o.id,u)),a}on_insert_child(e){const{courier:t}=this,n=t.get_recorder();n.add_cmd(e);const{pos:r,data:i}=e;if(0===i.length)return n;const a=[];for(let e of i)e.type===o.u0.box_root&&a.push(new s.HR(e,this));let l=this.get_valid_index(r);this.splice(l,0,...a);const c=a[a.length-1];return c&&n.tell(c,u.U.in_tail(c.id,0)),n.add_recover(d.V.delete_child(this.id,"backward",[l,l+a.length])),n}on_delete_cube(e){const{courier:t,pcube:n,pid:r}=this,{dir:i,range:o}=e,[a,l]=o,c=t.get_recorder();c.add_cmd(e);const h=this.children[a-1],p=this.children[l],f=l-a;if(a!==l){if(a<=0&&l>=this.child_count){this.child_first,c.tell(this,d.V.reset(this.id,[]));const e=d.V.insert_child(this.id,[s.HR.get_default()],0);return c.tell(this,e),c}{let e=this.splice(a,f);h&&"backward"===i||!p?c.tell(h,u.U.in_tail(h.id,0)):(p&&"forward"===i||!h)&&c.tell(p,u.U.in_head(p.id,0));const t=e.data;c.add_recover(d.V.insert_child(this.id,t,a))}return c}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r,pcube:i}=this,s=new l.vk(t),{data:o,end_id:a,start_id:c,offset_end:h,offset_start:p}=e,f=this.find_cube(c),m=this.find_cube(a),_=f?.find_upstream_untill(this),g=m?.find_upstream_untill(this);if(!_||!g)return s;if(m!==f||p!==h)if(_&&_===g)s.tell(_,d.V.delete(_.id,"backward",c,a,p,h)),s.tell(_,d.V.insert(_.id,o,c,a,p,h));else{s.tell(g,d.V.delete(g.id,"backward",null,a,"head",h)),s.tell(this,d.V.delete_child(this.id,"backward",[_.index+1,g.index])),s.tell(this,d.V.insert_child(this.id,e.data,_.index+1)),s.tell(_,d.V.delete(_.id,"backward",c,null,p,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,u.U.in_tail(t.id,0))}}else s.tell(m,d.V.insert(a,o,c,a,p,h));return s}on_layout_update(e){const{courier:t,history:n}=this,{attrs:i}=e,s=t.get_recorder(),o=structuredClone((0,r.ux)(this.data.attrs));let a=!1;s.add_cmd(e);const l=this.attrs.fold;for(let e in i){const t=i[e];t!==this.attrs[e]&&(this.attrs[e]=t,a=!0)}if("matrix2d"in i&&i.matrix2d){const e=i.matrix2d;this.reset_matrix(e)}"fold"in i&&l!==i.fold&&(this.bound.flow("downstream"),this.bound.flow("upstream")),a&&(this.is_layout_root?(this.env.flow(),this.layout_throttle()):this.env.layout_root?.layout_throttle());const c=f.S.layout_change(this.id,o);return s.add_recover(c),s}on_append_child(e){const{courier:t,history:n,pcube:r}=this,{previd:i}=e,{map_node_hgap:o,map_node_vgap:l}=this.config.data,c=t.get_recorder(),d=this.node_last.bound,u={x:d.pos.x,y:d.pos.y+d.size_bound.height+l},h=s.gL.get_default(u),p=m.y.node_add(r.id,[h]);c.tell(r,p);const f=a.U.create_linker_info(this.pcube,this.id,h.id),_=m.y.linker_add(r.id,[f]);c.tell(r,_);const g=r.get_node_to(this.id),b=g?.indexOf(h.id);if(g&&void 0!==b&&b>=0)if(null===i)g.splice(b,1),g.unshift(h.id);else if(i){const e=g.indexOf(i);e>=0&&(g.splice(b,1),g.splice(e+1,0,h.id))}return c}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,r=t.view_point_to_real(e),i=v.get_default_node_size(n);return{x:r.x-i.width/2,y:r.y-i.height/2}}}},4784:(e,t,n)=>{"use strict";n.d(t,{M:()=>C});var r=n(7633),i=n(1556),s=n(4412),o=n(346),a=n(6996),l=n(2189),c=n(5391),d=n(3736),u=n(3513),h=n(3408),p=n(2742),f=n(3814),m=n(8147),_=n(443),g=n(2935),b=n(2277),v=n(1701),y=n(8219),w=n(3755),x=n(2819),k=n(9164),S=n(5955);class C extends l.j{_scopes=(0,r.Gc)(new Set);_dom;_children=(0,r.Gc)([]);_courier;_history;_cursor;_config;_clipboard;_painter;_event;_stats;_hotkeys;_cubes;_listener;_isdev=!1;constructor(){super(),this._cubes=new u.h(this),this._hotkeys=new h.Wu(this),this._config=new g.B(this),this._cursor=new b.P(this),this._courier=new v.W(this),this._history=new s.PI(this),this._clipboard=new _.F(this),this._painter=new m.W(this),this._event=new f.z(this),this._stats=new p.I(this),this._listener=new d.t(this),Promise.resolve().then(()=>this._cubes.add_cube(this)),this.set_cmd_handler(a.zS.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(a.zS.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(a.zS.cube_insert_child,this.on_insert_cube.bind(this)),this.set_cmd_handler(a.zS.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(a.zS.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(a.zS.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(a.zS.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(a.zS.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(a.K9.cursor_in_tail,this.on_cursor_in_tail.bind(this)),y.o.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 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),r=[];for(let e of n){let t=e.export();r.push(t)}return r}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 c.R(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 C)return w.F.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 C)return w.F.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=[],r=e?this.sort_scope():this.scope;for(let e of r)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,r=new s.vk(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 i=n?.next_cube;if(i&&n.type===i.type)return i.merge("left");if(n)return r.tell(n,k.U.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 i=n?.prev_cube;if(i&&n.type===i.type)return n.merge("left");if(n)return r.tell(n,k.U.in_tail(n.id))}}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)i.push(e.export());return{children:r,data:i}}get_sdk_version(){return o.K.get_sdk_meta()}on_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=this.export().info,s=S.I.build_cubes(n,this);return this.splice(0,this.child_count,...s),r.add_recover(x.V.reset(this.id,i)),r}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:o}=e,a=this.find_child_cube(i);if(!a||a.index===o)return;const l=new s.vk(t);let c=0,d=a.index;return"tail"===o?c=this.child_count:"number"==typeof o&&(c=o),this.splice(d,1),this.splice(c,0,a),l.add_recover(x.V.reorder(this.id,a.id,d)),l}on_insert_cube(e){const{courier:t}=this,n=t.get_recorder();n.add_cmd(e);const{pos:r,data:s}=e;if(0===s.length)return n;const o=[];for(let e of s)e.type===a.u0.box_root&&o.push(new i.HR(e,this));let l=this.get_valid_index(r);this.splice(l,0,...o);const c=o[o.length-1];return c&&n.tell(c,k.U.in_tail(c.id,0)),n.add_recover(x.V.delete_child(this.id,"backward",[l,l+o.length])),n}on_delete_cube(e){const{courier:t,pcube:n,pid:r}=this,{dir:i,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],u=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,x.V.delete_child(this.id,i,[1,this.child_count])),e.is_empty||l.tell(e,x.V.reset(e.id,[])),l}{let e=this.splice(o,u);c&&"backward"===i||!d?l.tell(c,k.U.in_tail(c.id,0)):(d&&"forward"===i||!c)&&l.tell(d,k.U.in_head(d.id,0));const t=e.data;l.add_recover(x.V.insert_child(this.id,t,o))}return l}}on_cube_set_selection_css(e){const{cursor:t,courier:n,pcube:r,pid:i}=this,{css:o,start_id:a,end_id:l,offset_end:c,offset_start:d}=e,u=new s.vk(n);if(a!==l||c!==d){if(l&&!a){const e=this.find_cube(l),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(t,x.V.set_selection_css(t.id,o,null,l,"head",c)),u}if(a&&!l){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(t,x.V.set_selection_css(t.id,o,a,null,d,"tail")),u}if("tail"===c&&"head"===d){for(let e of this.children)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u}if(l&&a){const e=this.find_cube(a),t=this.find_cube(l),n=e?.find_upstream_untill(this),r=t?.find_upstream_untill(this);if(!n||!r)return;const i=this.children.slice(n.index+1,r.index);for(let e of i)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(n,x.V.set_selection_css(n.id,o,a,null,d,"tail")),u.tell(r,x.V.set_selection_css(r.id,o,null,l,"head",c)),u}}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r,pcube:i}=this,o=new s.vk(t),{data:a,end_id:l,start_id:c,offset_end:d,offset_start:u}=e,h=this.find_cube(c),p=this.find_cube(l),f=h?.find_upstream_untill(this),m=p?.find_upstream_untill(this);if(!f||!m)return o;if(p!==h||u!==d)if(f&&f===m)o.tell(f,x.V.delete(f.id,"backward",c,l,u,d)),o.tell(f,x.V.insert(f.id,a,c,l,u,d));else{o.tell(m,x.V.delete(m.id,"backward",null,l,"head",d)),o.tell(this,x.V.delete_child(this.id,"backward",[f.index+1,m.index])),o.tell(this,x.V.insert_child(this.id,e.data,f.index+1)),o.tell(f,x.V.delete(f.id,"backward",c,null,u,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&o.tell(e,k.U.in_tail(t.id,0))}}else o.tell(p,x.V.insert(l,a,c,l,u,d));return o}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:r,start_id:o,end_id:a,offset_end:l,offset_start:c,reserve:d}=e,u=new s.vk(t);if(!o&&a){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t||!e)return;return u.tell(this,x.V.delete_child(this.id,r,[0,t.index])),u.tell(t,x.V.delete(t.id,r,o,a,"head",l)),u}if(o&&!a){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t||!e)return;return u.tell(this,x.V.delete_child(this.id,r,[t.index+1,this.child_count])),u.tell(t,x.V.delete(t.id,r,o,a,c,l)),u}if("head"===c&&"tail"===l)return u.tell(this,x.V.reset(this.id,[])),u;if(o&&a){const e=this.find_cube(o),t=this.find_cube(a);if(!(e instanceof i.P6&&t instanceof i.P6))return;const n=e.find_upstream_untill(this),s=t.find_upstream_untill(this);if(!n||!s)return u;const d=n.index,h=s.index;if(o!==a||c!==l)if(n===s)u.tell(n,x.V.delete(n.id,r,o,a,c,l,!0));else{u.tell(s,x.V.delete(s.id,r,null,a,"head",l)),u.tell(this,x.V.delete_child(this.id,"backward",[d+1,h])),u.tell(n,x.V.delete(n.id,r,o,null,c,"tail",!0));let t=0;if("number"==typeof c&&(t=c),u.tell(n,x.V.merge(n.id,"right",o,t)),n.is_empty)u.tell(this,x.V.delete_child(this.id,"backward",[n.index,n.index+1]));else if(e instanceof i.P6){const n=e.pcube;u.tell(n,x.V.merge(n.id,"right",o,t))}}return u}}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,s=t.get_recorder();if(s.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone((0,r.ux)(this.attrs[e]))||null,null===t?delete this.attrs[e]:this.attrs[e]=t}return s.add_recover(x.V.set_attr(this.id,o)),s}on_cursor_in_tail(e){const{offset:t}=e,{courier:n}=this,r=this.child_last,i=new s.vk(n);if(r)return i.tell(r,k.U.in_tail(r.id,t)),i}}},5391:(e,t,n)=>{"use strict";n.d(t,{R:()=>u});var r=n(7633),i=n(1556),s=n(8606),o=n(6996),a=n(1068),l=n(5955),c=n(4031),d=n(7744);class u extends c.K{_id=(0,s.Ak)();scroll_offset=100;_freeze=(0,r.KR)(!1);get meta(){return u.meta}get id(){return this._id}pos=(0,r.Kh)({x:0,y:0,width:0,height:0});css=(0,r.Kh)({});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 i.$u&&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 d.MR)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 d.MR)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=a.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=[],r=[];for(let t of this.selection_line){const i=t.level,s=t.index;i===e&&(n.push(t),r.push(s))}return{cube:t,range:[Math.min(...r),Math.max(...r)+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(...l.I.get_flat_cube(n.cube));for(let e of t)e instanceof i.gK&&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:o.Mu.scope,version:1}}}},5856:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}},5857:(e,t,n)=>{"use strict";n.d(t,{zS:()=>s,K9:()=>o,kU:()=>a,s1:()=>l,Mu:()=>r,u0:()=>i});var r=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}({}),i=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}({}),s=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}({}),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}({})},5955:(e,t,n)=>{"use strict";n.d(t,{I:()=>d,J:()=>u});var r=n(8606),i=n(7744),s=n(1556),o=n(346),a=n(6996),l=n(4412),c=n(3755);class d{static get_id(){return(0,r.Ak)()}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)),r=new Set(Object.keys(t)),i=new Set([...n,...r]);if(n.size!==i.size||n.size!==r.size)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}static is_same_attrs(e,t){let n=new Set(Object.keys(e)),r=new Set(Object.keys(t)),i=new Set([...n,...r]);if(n.size!==i.size||n.size!==r.size)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}async locate(e,t,n=!0){const{courier:r,history:s}=e,o=e.find_cube(t),a=c.F.tips;if(o instanceof i._D&&o.top){const e=o.top;if(o.find_upstream_untill(e)!==e.child_first){const t=r.get_recorder();t.tell(e,i.VL.fold(e.id,!1)),s.record(t)}}const l=document.getElementById(t);if(!l)return a?.tip_error("未发现书签锚点");let d=l.style.backgroundColor;l.style.backgroundColor="var(--locate-anchor-bg)",setTimeout(()=>{"var(--locate-anchor-bg)"===l.style.backgroundColor&&(l.style.backgroundColor=d)},3e3),n&&l.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 r of e){if(!r)continue;let e=o.K.find_cube(r.type);if(e)n.push(new e(r,t));else{const e=new s.Qm(r,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 n=o.K.metas_cube;let r=[],i=[],l=[],c=[],d=null,u=-1,h=-1,p=e,f=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.type===a.u0.box_root){p=e.slice(0,t),f=e.slice(t+1),d=n,c.push(d);break}}for(let e=0;e<p.length;e++){const t=p[e];n.get(t.type)?.block&&(u<0?u=e:h=e)}if(u>=0&&h>=0){const e=p.slice(0,u),t=p.slice(h+1),o=[];let a=s.gK.get_default();a.info=[];for(let e of p.slice(u,h+1))n.get(e.type)?.block?(o.push(e),a.info.length>0&&(o.push(a),a=s.gK.get_default(),a.info=[])):a.info.push(e);r=e,i=o,l=t}else u>=0&&h<0?(r=p.slice(0,u),i=p.slice(u,u+1),l=p.slice(u+1)):(r=p,i=[],l=[]);if(d){let e=s.gK.get_default();e.info=[];for(let t of f)t.type===a.u0.box_root?(d=t,c.push(t)):n.get(t.type)?.block?(t.type===a.u0.box?d.info.push(...t.info):d.info.push(t),e.info.length>0&&d&&(d.info.push(e),e=s.gK.get_default())):e.info.push(t);e.info.length>0&&d&&d.info.push(e)}const m=[];if(r.length>0&&m.push(s.gK.get_default(r)),i.length>0&&m.push(...i),l.length>0&&m.push(s.gK.get_default(l)),c.length>0)if(t)for(let e of c)m.push(...e.info);else m.push(...c);return{head:r,body:i,tail:l,root:c,sort:m}}static find_line(e,t="first"){if(e instanceof s.gK)return e;const n=o.K.metas_cube.get(e.type);if(!n||!n.block)return;const r="first"===t?e.children:e.children.reverse();for(let e of r){let n=this.find_line(e,t);if(n)return n}}static filter_out_empty(e){return e.filter(e=>!s.P6.is_empty_text(e))}static get_flat_cube(e,t=!0){const n=e.children,r=[];if(t)for(let e of n)r.push(e),r.push(...this.get_flat_cube(e));else{r.push(...n);for(let e of r)r.push(...e.children)}return r}static replace_id(e,t,n={}){const r=[];for(let i of t){const t=o.K.find_cube(i.type);t&&t.replace_id&&r.push(t.replace_id(e,i,n))}return r}static insert_cubes(e,t){const{courier:n,history:r,cursor:s}=e,{cube_selection:o,cube_start:a,cube_end:c,offset_end:d,offset_start:u}=s;if(!o||!a||!c)return;const h=new l.vk(n);s.has_selection&&h.tell(o,i.VL.delete(o.id,"backward",a.id,c.id,u,d)),h.tell(a,i.VL.insert(a.id,t,a.id,a.id,u,u)),r.record(h)}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 u{ps;resolve;reject;constructor(){this.ps=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}},5976:(e,t,n)=>{"use strict";n.d(t,{_:()=>f});var r=n(7633),i=n(6996),s=n(2189),o=n(8219),a=n(5955),l=n(4412),c=n(2819),d=n(9164),u=n(1556),h=n(4784),p=n(4709);class f extends s.j{_children=(0,r.Gc)([]);_has_postil=(0,r.KR)(!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 u.gK&&(e+="\n");return this instanceof u.gK&&(e+="\n"),e}get top(){let e=this;for(;e;){if(e.pcube instanceof h.M)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 u.$u?this:this.pcube.host_postil}get host_node(){let e=this.pcube;for(;e&&e instanceof f;){if("map"===e.domain&&e instanceof p.w)return e;e=e.pcube}}get in_postil(){return this instanceof u.$u||this.pcube.in_postil}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 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 f)return t;e=e.pcube}}get next_cube_deep(){let e=this;for(;e;){let t=e.next_cube;if(t instanceof f)return t;e=e.pcube}}get index(){return this.pcube?this.pcube.find_child_index(this.id):0}_setup(){this.set_cmd_handler(i.zS.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.zS.cube_insert,this.on_insert.bind(this)),this.set_cmd_handler(i.zS.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.zS.cube_set_css,this.on_cube_set_css.bind(this)),this.set_cmd_handler(i.zS.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(i.zS.cube_delete_adjacent,this.on_cube_delete_adjacent.bind(this)),this.set_cmd_handler(i.zS.cube_postil_add,this.on_postil_add.bind(this)),this.set_cmd_handler(i.zS.cube_postil_remove,this.on_postil_remove.bind(this)),this.set_cmd_handler(i.K9.cursor_in_head,this.on_cursor_in_head.bind(this)),this.set_cmd_handler(i.K9.cursor_in_tail,this.on_cursor_in_tail.bind(this)),o.o.init_cmd_handler(this)}setup(e,t){let n;try{n=structuredClone((0,r.ux)(e))}catch(n){return new u.Qm(e,t,"克隆数据失败")}if(!n)return new u.Qm(e,t,"克隆数据为空");try{const i=this.update_data(n);if(!i.data)return new u.Qm(e,t,"升级后数据为空");if(!i.usable)return new u.Qm(e,t,"高版本数据,请升级软件");this.data=(0,r.Kh)(i.data),this._setup(),this.build_child(i.data),this.cubes.add_cube(this)}catch(n){return new u.Qm(e,t,"数据升级失败")}return this}create_child_block(e){const t=a.I.pick(e);return a.I.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((0,r.ux)(this.data));return this.postil&&(e.attrs.postil=this.postil.export()),e}copy(e,t){const n=this.children.slice(e,t),r=[];for(let e of n){let t=e.export();r.push(t)}return r}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof u.gv||t instanceof u.EU)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}delete_edge(e,t){const{courier:n}=this,r=new l.vk(n);if("backward"===t){const t=e.prev_cube_deep,n=t?.next_cube;let i=e.pcube;if(i.is_empty&&i instanceof f){const e=i.prev_cube_deep;return r.merge(i.remove_self()),e&&r.tell(e,d.U.in_tail(e.id)),r}if(t&&t.is_empty)return r.merge(t.remove_self()),n&&r.tell(n,d.U.in_head(n.id)),r;if(n&&t.type===n.type)return r.merge(n.merge("left"));if(t)return r.tell(t,d.U.in_tail(t.id))}else{const t=e.next_cube_deep,n=t?.prev_cube;let i=e.pcube;for(;i&&i!==this;){const e=i.next_cube_deep;if(i.is_empty&&i instanceof f)return r.merge(i.remove_self()),e&&r.tell(e,d.U.in_head(e.id)),r;i=i.pcube}if(t&&t.is_empty)return r.merge(t.remove_self()),n&&r.tell(n,d.U.in_tail(n.id)),r;if(n&&t.type===n.type)return r.merge(t.merge("left"));if(t)return r.tell(t,d.U.in_tail(t.id))}}remove_self(e="backward"){const{pcube:t,courier:n,index:r}=this,i=new l.vk(n);return i.tell(t,c.V.delete_child(t.id,e,[r,r+1])),i}merge(e){const{pcube:t,cursor:n,courier:r}=this,{cube_end:i,offset_end:s}=n;if(!i)return;const o=r.get_recorder();return o.tell(this,c.V.merge(this.id,e,i.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 f&&t.pcube===e)return t;t=t.pcube}}find_upstream_target(e){let t=this;for(;t instanceof f;)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:r,start_id:i,end_id:s,offset_end:o,offset_start:a,toggle:d,replace:u}=e,h=new l.vk(n);if(i!==s||o!==a){if(s&&!i){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)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(t,c.V.set_selection_css(t.id,r,null,s,"head",o,d,u)),h}if(i&&!s){const e=this.find_cube(i),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(t,c.V.set_selection_css(t.id,r,i,null,a,"tail",d,u)),h}if("tail"===o&&"head"===a){for(let e of this.children)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h}if(s&&i){const e=this.find_cube(i),t=this.find_cube(s),n=e?.find_upstream_untill(this),l=t?.find_upstream_untill(this);if(!n||!l)return;const p=this.children.slice(n.index+1,l.index);for(let e of p)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(n,c.V.set_selection_css(n.id,r,i,null,a,"tail",d,u)),n!==l&&h.tell(l,c.V.set_selection_css(l.id,r,null,s,"head",o,d,u)),h}}}on_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r}=this,i=new l.vk(t),{data:s,end_id:o,start_id:a,offset_end:u,offset_start:h}=e,p=this.find_cube(a),f=this.find_cube(o),m=p?.find_upstream_untill(this),_=f?.find_upstream_untill(this);if(!m||!_)return i;if(f!==p||h!==u)if(m&&m===_)i.tell(m,c.V.delete(m.id,"backward",a,o,h,u)),i.tell(m,c.V.insert(m.id,s,a,o,h,u));else{i.tell(_,c.V.delete(_.id,"backward",null,o,"head",u)),i.tell(this,c.V.delete_child(this.id,"backward",[m.index+1,_.index])),i.tell(this,c.V.insert_child(this.id,s,m.index+1)),i.tell(m,c.V.delete(m.id,"backward",a,null,h,"tail"));let e=s[s.length-1];const t=this.top.find_cube(e.id);t&&i.tell(t,d.U.in_tail(e.id,0))}else i.tell(f,c.V.insert(o,s,a,o,h,u));return i}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:r,start_id:i,end_id:s,offset_end:o,offset_start:a,reserve:d}=e,h=new l.vk(t);if(!i&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return h.tell(this,c.V.delete_child(this.id,r,[0,t.index],d)),h.tell(t,c.V.delete(t.id,r,i,s,"head",o,d)),h}if(i&&!s){const e=this.find_cube(i),t=e?.find_upstream_untill(this);if(!t||!e)return;return h.tell(this,c.V.delete_child(this.id,r,[t.index+1,this.child_count],d)),h.tell(t,c.V.delete(t.id,r,i,s,a,o,d)),h}if("head"===a&&"tail"===o){if(d){if(this.is_empty)return;h.tell(this,c.V.delete_child(this.id,r,[1,this.child_count]));const e=this.child_first;e.meta.block?h.tell(e,c.V.delete_child(e.id,r,[0,e.child_count],d)):e instanceof u.P6?h.tell(e,u.zl.reset(e.id,"",1,1)):h.tell(e,c.V.reset(e.id,[]))}else h.tell(this.pcube,c.V.delete_child(this.pid,"backward",[this.index,this.index+1]));return h}if(i&&s){const e=this.find_cube(i),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 h;const d=n.index,p=l.index;if(i!==s||a!==o)if(n===l)h.tell(n,c.V.delete(n.id,r,i,s,a,o,!0));else if(h.tell(l,c.V.delete(l.id,r,null,s,"head",o)),h.tell(this,c.V.delete_child(this.id,"backward",[d+1,p])),h.tell(n,c.V.delete(n.id,r,i,null,a,"tail",!0)),e instanceof u.P6){const t=e.get_valid_index(a);e.set_cursor_in_head(t)}return h}}on_cube_set_css(e){const{courier:t,cursor:n}=this,{css:i,toggle:s,replace:o}=e,a=t.get_recorder();if(a.add_cmd(e),o){const e=structuredClone((0,r.ux)(this.css));return this.data.css=i,a.add_recover(c.V.set_css(this.id,e,!1,!0)),a}if(0===Object.keys(i).length)return;let l=!0;const d=structuredClone((0,r.ux)(this.css)),u=structuredClone((0,r.ux)(this.css));for(let e in i){const t=i[e],n=this.css[e]||null;d[e]=n,null===t||s&&t===n?(l=!1,delete u[e]):t!==n&&(l=!1,u[e]=t)}return this.data.css=u,l?void 0:(a.add_recover(c.V.set_css(this.id,d)),a)}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,s=t.get_recorder();if(s.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone((0,r.ux)(this.attrs[e]))||null,null===t?delete this.data.attrs[e]:this.data.attrs[e]=t}return s.add_recover(c.V.set_attr(this.id,o)),s}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:r,index:i}=this,{from:s,from_id:o,offset:a}=e,u=new l.vk(t);if(this.meta.block){const e=this.child_first,t=this.child_last;this.is_empty&&u.tell(n,c.V.delete_child(r,"backward",[this.index,this.index+1])),"left"===s?u.tell(e,d.U.in_head(e.id,0,s)):u.tell(t,d.U.in_tail(t.id,0,s))}else u.tell(n,c.V.delete_child(r,"backward",[this.index,this.index+1]));return u}on_postil_add(e){const{courier:t}=this,{data:n}=e;if(this.postil){const e=new l.vk(t),r=this.postil;return e.tell(r,c.V.insert_child(r.id,n,r.child_count)),this.has_postil=!0,this.postil.show=!0,e}{const r=t.get_recorder();r.add_cmd(e);const i=u.$u.get_default(n),s=new u.$u(i,this);return this.postil=s,r.add_recover(c.V.postil_remove(this.id,[0,s.child_count])),this.postil.show=!0,this.has_postil=!0,r}}on_postil_remove(e){const{courier:t}=this,{range:n}=e,[r,i]=n,s=this.postil;if(!s)return;let o=r<0?0:r,a=i>s.child_count?s.child_count:i;if(o<=0&&a>=s.child_count){const n=t.get_recorder();n.add_cmd(e);const r=s.export();return n.add_recover(c.V.postil_add(this.id,r.info)),this.postil=null,this.has_postil=!1,s.gc(),n}{const e=new l.vk(t);return e.tell(s,c.V.delete_child(s.id,"backward",[o,a])),e}}on_cursor_in_head(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new l.vk(r);if(this.meta.block){const e=this.child_first;if(!e)return a;a.tell(e,d.U.in_head(e.id,t))}else if(this instanceof u.P6)this.set_cursor_in_head(t);else if("none"===n||"right"===n)if(i&&i instanceof u.P6)i.set_cursor_in_tail();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index))}else if("left"===n)if(o&&o instanceof u.P6)o.set_cursor_in_head();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index+1))}return a}on_cursor_in_tail(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new l.vk(r);if(this.meta.block){const e=this.child_last;if(!e)return a;a.tell(e,d.U.in_tail(e.id,t))}else if(this instanceof u.P6)this.set_cursor_in_tail(t);else if("none"===n||"left"===n)if(o&&o instanceof u.P6)o.set_cursor_in_head();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index+1))}else if("right"===n)if(i&&i instanceof u.P6)i.set_cursor_in_tail();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index))}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}get_valid_range(e){let[t,n]=e;return t<0&&(t=0),n>this.child_count&&(n=this.child_count),[t,n]}}},6094:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(6996);class i{static layout_change(e,t){return{id:e,name:r.s1.layout_update,attrs:t}}static append_child(e,t){return{id:e,name:r.s1.append_child,previd:t}}}},6853:(e,t,n)=>{"use strict";n.d(t,{R:()=>r});class r{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"}}}},6996:(e,t,n)=>{"use strict";n.d(t,{tK:()=>l,GW:()=>h,zS:()=>r.zS,K9:()=>r.K9,J8:()=>c,QI:()=>s,nY:()=>m,$f:()=>f,ZS:()=>k,ec:()=>S,SN:()=>M,_A:()=>g,Sd:()=>b,JC:()=>d,mM:()=>u,kU:()=>r.kU,L6:()=>o,tX:()=>C,s1:()=>r.s1,Mu:()=>r.Mu,u0:()=>r.u0,dp:()=>w,fv:()=>x,yn:()=>y,DI:()=>v,BS:()=>_,lm:()=>i,gS:()=>a,Ny:()=>p});var r=n(5857),i=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}({}),s=function(){return{}}(),o=function(e){return e.markers="markers",e.nodes="nodes",e.linkers="linkers",e.placeholder="placeholder",e}({}),a=function(e){return e.update="text-link:update",e}({}),l=function(e){return e.reset="cube-api:reset",e}({}),c=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}({}),d=function(e){return e.add="cube-list:add",e.remove="cube-list:remove",e.indent="cube-list:indent",e}({}),u=function(e){return e.add="cube-list-ordered:add",e.remove="cube-list-ordered:remove",e.indent="cube-list-ordered:indent",e}({}),h=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}({}),p=function(e){return e.add="cube-todo:add",e.remove="cube-todo:remove",e.indent="cube-todo:indent",e.status="cube-todo:status",e}({}),f=function(e){return e.h1="\\Huge ",e.h2="\\huge ",e.h3="\\Large ",e.h4="\\normalsize ",e.h5="\\small ",e.h6="\\tiny ",e}({}),m=function(e){return e.update="cube-fomula:update",e}({}),_=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}({}),g=function(e){return e.arrow="marker-arrow",e.point="marker-point",e.square="marker-square",e.rhomb="marker-rhomb",e}({}),b=function(e){return e.update="linker:update",e}({}),v=function(e){return e.reset_explanation="cube-rt:reset-explanation",e}({}),y=function(e){return e.pending="pending",e.playing="playing",e.pause="pause",e.stop="stop",e}({}),w=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["doc-input-before"]="note-event:doc-input-before",e["doc-input-compositionend"]="note-event:doc-input-compositionend",e["status-update"]="note-event:status-update",e["node-status-clicked"]="note-event:node-status-clicked",e["fig-click"]="note-event:fig-click",e}({}),x=function(e){return e.read="read",e.edit="edit",e.export="export",e}({}),k=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}({}),S=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}({}),C=function(e){return e.left="arrowleft",e.right="arrowright",e.up="arrowup",e.down="arrowdown",e.end="end",e.home="home",e}({}),M=function(e){return e.enter="Enter",e}({})},7633:(e,t,n)=>{"use strict";n.d(t,{C4:()=>k,EW:()=>Re,Gc:()=>he,IG:()=>ye,IJ:()=>Ce,KR:()=>Se,Kh:()=>ue,Pr:()=>Ae,R1:()=>Le,Tm:()=>_e,X2:()=>l,a1:()=>xe,bl:()=>S,fE:()=>ge,g8:()=>me,hV:()=>Be,hZ:()=>O,i9:()=>ke,ju:()=>be,lJ:()=>we,qA:()=>B,u4:()=>E,ux:()=>ve,wB:()=>Ie,yC:()=>o});var r=n(3972);let i,s;class o{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=i,!e&&i&&(this.index=(i.scopes||(i.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=i;try{return i=this,e()}finally{i=t}}}on(){1===++this._on&&(this.prevScope=i,i=this)}off(){this._on>0&&0===--this._on&&(i=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 a=new WeakSet;class l{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,i&&i.active&&i.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,a.has(this)&&(a.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||h(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,C(this),m(this);const e=s,t=w;s=this,w=!0;try{return this.fn()}finally{_(this),s=e,w=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)v(e);this.deps=this.depsTail=void 0,C(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?a.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){g(this)&&this.run()}get dirty(){return g(this)}}let c,d,u=0;function h(e,t=!1){if(e.flags|=8,t)return e.next=d,void(d=e);e.next=c,c=e}function p(){u++}function f(){if(--u>0)return;if(d){let e=d;for(d=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;c;){let t=c;for(c=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 m(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _(e){let t,n=e.depsTail,r=n;for(;r;){const e=r.prevDep;-1===r.version?(r===n&&(n=e),v(r),y(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function g(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(b(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function b(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===M)return;if(e.globalVersion=M,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!g(e)))return;e.flags|=2;const t=e.dep,n=s,i=w;s=e,w=!0;try{m(e);const n=e.fn(e._value);(0===t.version||(0,r.$H)(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{s=n,w=i,_(e),e.flags&=-3}}function v(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)v(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function y(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let w=!0;const x=[];function k(){x.push(w),w=!1}function S(){const e=x.pop();w=void 0===e||e}function C(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=s;s=void 0;try{t()}finally{s=e}}}let M=0;class T{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 L{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(!s||!w||s===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==s)t=this.activeLink=new T(s,this),s.deps?(t.prevDep=s.depsTail,s.depsTail.nextDep=t,s.depsTail=t):s.deps=s.depsTail=t,z(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=s.depsTail,t.nextDep=void 0,s.depsTail.nextDep=t,s.depsTail=t,s.deps===t&&(s.deps=e)}return t}trigger(e){this.version++,M++,this.notify(e)}notify(e){p();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{f()}}}function z(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)z(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const A=new WeakMap,P=Symbol(""),R=Symbol(""),N=Symbol("");function E(e,t,n){if(w&&s){let t=A.get(e);t||A.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new L),r.map=t,r.key=n),r.track()}}function O(e,t,n,i,s,o){const a=A.get(e);if(!a)return void M++;const l=e=>{e&&e.trigger()};if(p(),"clear"===t)a.forEach(l);else{const s=(0,r.cy)(e),o=s&&(0,r.yI)(n);if(s&&"length"===n){const e=Number(i);a.forEach((t,n)=>{("length"===n||n===N||!(0,r.Bm)(n)&&n>=e)&&l(t)})}else switch((void 0!==n||a.has(void 0))&&l(a.get(n)),o&&l(a.get(N)),t){case"add":s?o&&l(a.get("length")):(l(a.get(P)),(0,r.CE)(e)&&l(a.get(R)));break;case"delete":s||(l(a.get(P)),(0,r.CE)(e)&&l(a.get(R)));break;case"set":(0,r.CE)(e)&&l(a.get(P))}}f()}function I(e){const t=ve(e);return t===e?t:(E(t,0,N),ge(e)?t:t.map(we))}function B(e){return E(e=ve(e),0,N),e}const D={__proto__:null,[Symbol.iterator](){return V(this,Symbol.iterator,we)},concat(...e){return I(this).concat(...e.map(e=>(0,r.cy)(e)?I(e):e))},entries(){return V(this,"entries",e=>(e[1]=we(e[1]),e))},every(e,t){return j(this,"every",e,t,void 0,arguments)},filter(e,t){return j(this,"filter",e,t,e=>e.map(we),arguments)},find(e,t){return j(this,"find",e,t,we,arguments)},findIndex(e,t){return j(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return j(this,"findLast",e,t,we,arguments)},findLastIndex(e,t){return j(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return j(this,"forEach",e,t,void 0,arguments)},includes(...e){return U(this,"includes",e)},indexOf(...e){return U(this,"indexOf",e)},join(e){return I(this).join(e)},lastIndexOf(...e){return U(this,"lastIndexOf",e)},map(e,t){return j(this,"map",e,t,void 0,arguments)},pop(){return q(this,"pop")},push(...e){return q(this,"push",e)},reduce(e,...t){return F(this,"reduce",e,t)},reduceRight(e,...t){return F(this,"reduceRight",e,t)},shift(){return q(this,"shift")},some(e,t){return j(this,"some",e,t,void 0,arguments)},splice(...e){return q(this,"splice",e)},toReversed(){return I(this).toReversed()},toSorted(e){return I(this).toSorted(e)},toSpliced(...e){return I(this).toSpliced(...e)},unshift(...e){return q(this,"unshift",e)},values(){return V(this,"values",we)}};function V(e,t,n){const r=B(e),i=r[t]();return r===e||ge(e)||(i._next=i.next,i.next=()=>{const e=i._next();return e.value&&(e.value=n(e.value)),e}),i}const H=Array.prototype;function j(e,t,n,r,i,s){const o=B(e),a=o!==e&&!ge(e),l=o[t];if(l!==H[t]){const t=l.apply(e,s);return a?we(t):t}let c=n;o!==e&&(a?c=function(t,r){return n.call(this,we(t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));const d=l.call(o,c,r);return a&&i?i(d):d}function F(e,t,n,r){const i=B(e);let s=n;return i!==e&&(ge(e)?n.length>3&&(s=function(t,r,i){return n.call(this,t,r,i,e)}):s=function(t,r,i){return n.call(this,t,we(r),i,e)}),i[t](s,...r)}function U(e,t,n){const r=ve(e);E(r,0,N);const i=r[t](...n);return-1!==i&&!1!==i||!be(n[0])?i:(n[0]=ve(n[0]),r[t](...n))}function q(e,t,n=[]){k(),p();const r=ve(e)[t].apply(e,n);return f(),S(),r}const $=(0,r.pD)("__proto__,__v_isRef,__isVue"),G=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(r.Bm));function X(e){(0,r.Bm)(e)||(e=String(e));const t=ve(this);return E(t,0,e),t.hasOwnProperty(e)}class K{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,s=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return s;if("__v_raw"===t)return n===(i?s?de:ce:s?le:ae).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=(0,r.cy)(e);if(!i){let e;if(o&&(e=D[t]))return e;if("hasOwnProperty"===t)return X}const a=Reflect.get(e,t,ke(e)?e:n);return((0,r.Bm)(t)?G.has(t):$(t))?a:(i||E(e,0,t),s?a:ke(a)?o&&(0,r.yI)(t)?a:a.value:(0,r.Gv)(a)?i?pe(a):ue(a):a)}}class W extends K{constructor(e=!1){super(!1,e)}set(e,t,n,i){let s=e[t];if(!this._isShallow){const t=_e(s);if(ge(n)||_e(n)||(s=ve(s),n=ve(n)),!(0,r.cy)(e)&&ke(s)&&!ke(n))return t||(s.value=n),!0}const o=(0,r.cy)(e)&&(0,r.yI)(t)?Number(t)<e.length:(0,r.$3)(e,t),a=Reflect.set(e,t,n,ke(e)?e:i);return e===ve(i)&&(o?(0,r.$H)(n,s)&&O(e,"set",t,n):O(e,"add",t,n)),a}deleteProperty(e,t){const n=(0,r.$3)(e,t),i=(e[t],Reflect.deleteProperty(e,t));return i&&n&&O(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return(0,r.Bm)(t)&&G.has(t)||E(e,0,t),n}ownKeys(e){return E(e,0,(0,r.cy)(e)?"length":P),Reflect.ownKeys(e)}}class Y extends K{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Z=new W,Q=new Y,J=new W(!0),ee=e=>e,te=e=>Reflect.getPrototypeOf(e);function ne(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function re(e,t){const n=function(e,t){const n={get(n){const i=this.__v_raw,s=ve(i),o=ve(n);e||((0,r.$H)(n,o)&&E(s,0,n),E(s,0,o));const{has:a}=te(s),l=t?ee:e?xe:we;return a.call(s,n)?l(i.get(n)):a.call(s,o)?l(i.get(o)):void(i!==s&&i.get(n))},get size(){const t=this.__v_raw;return!e&&E(ve(t),0,P),t.size},has(t){const n=this.__v_raw,i=ve(n),s=ve(t);return e||((0,r.$H)(t,s)&&E(i,0,t),E(i,0,s)),t===s?n.has(t):n.has(t)||n.has(s)},forEach(n,r){const i=this,s=i.__v_raw,o=ve(s),a=t?ee:e?xe:we;return!e&&E(o,0,P),s.forEach((e,t)=>n.call(r,a(e),a(t),i))}};return(0,r.X$)(n,e?{add:ne("add"),set:ne("set"),delete:ne("delete"),clear:ne("clear")}:{add(e){t||ge(e)||_e(e)||(e=ve(e));const n=ve(this);return te(n).has.call(n,e)||(n.add(e),O(n,"add",e,e)),this},set(e,n){t||ge(n)||_e(n)||(n=ve(n));const i=ve(this),{has:s,get:o}=te(i);let a=s.call(i,e);a||(e=ve(e),a=s.call(i,e));const l=o.call(i,e);return i.set(e,n),a?(0,r.$H)(n,l)&&O(i,"set",e,n):O(i,"add",e,n),this},delete(e){const t=ve(this),{has:n,get:r}=te(t);let i=n.call(t,e);i||(e=ve(e),i=n.call(t,e)),r&&r.call(t,e);const s=t.delete(e);return i&&O(t,"delete",e,void 0),s},clear(){const e=ve(this),t=0!==e.size,n=e.clear();return t&&O(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const s=this.__v_raw,o=ve(s),a=(0,r.CE)(o),l="entries"===e||e===Symbol.iterator&&a,c="keys"===e&&a,d=s[e](...i),u=n?ee:t?xe:we;return!t&&E(o,0,c?R:P),{next(){const{value:e,done:t}=d.next();return t?{value:e,done:t}:{value:l?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}(e,t);return(t,i,s)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get((0,r.$3)(n,i)&&i in t?n:t,i,s)}const ie={get:re(!1,!1)},se={get:re(!1,!0)},oe={get:re(!0,!1)},ae=new WeakMap,le=new WeakMap,ce=new WeakMap,de=new WeakMap;function ue(e){return _e(e)?e:fe(e,!1,Z,ie,ae)}function he(e){return fe(e,!1,J,se,le)}function pe(e){return fe(e,!0,Q,oe,ce)}function fe(e,t,n,i,s){if(!(0,r.Gv)(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const o=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((0,r.Zf)(a));var a;if(0===o)return e;const l=s.get(e);if(l)return l;const c=new Proxy(e,2===o?i:n);return s.set(e,c),c}function me(e){return _e(e)?me(e.__v_raw):!(!e||!e.__v_isReactive)}function _e(e){return!(!e||!e.__v_isReadonly)}function ge(e){return!(!e||!e.__v_isShallow)}function be(e){return!!e&&!!e.__v_raw}function ve(e){const t=e&&e.__v_raw;return t?ve(t):e}function ye(e){return!(0,r.$3)(e,"__v_skip")&&Object.isExtensible(e)&&(0,r.yQ)(e,"__v_skip",!0),e}const we=e=>(0,r.Gv)(e)?ue(e):e,xe=e=>(0,r.Gv)(e)?pe(e):e;function ke(e){return!!e&&!0===e.__v_isRef}function Se(e){return Me(e,!1)}function Ce(e){return Me(e,!0)}function Me(e,t){return ke(e)?e:new Te(e,t)}class Te{constructor(e,t){this.dep=new L,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ve(e),this._value=t?e:we(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||ge(e)||_e(e);e=n?e:ve(e),(0,r.$H)(e,t)&&(this._rawValue=e,this._value=n?e:we(e),this.dep.trigger())}}function Le(e){return ke(e)?e.value:e}const ze={get:(e,t,n)=>"__v_raw"===t?e:Le(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return ke(i)&&!ke(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Ae(e){return me(e)?e:new Proxy(e,ze)}class Pe{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new L(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=M-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||s===this))return h(this,!0),!0}get value(){const e=this.dep.track();return b(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Re(e,t,n=!1){let i,s;return(0,r.Tn)(e)?i=e:(i=e.get,s=e.set),new Pe(i,s,n)}const Ne={},Ee=new WeakMap;let Oe;function Ie(e,t,n=r.MZ){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:d,call:u}=n,h=e=>o?e:ge(e)||!1===o||0===o?Be(e,1):Be(e);let p,f,m,_,g=!1,b=!1;if(ke(e)?(f=()=>e.value,g=ge(e)):me(e)?(f=()=>h(e),g=!0):(0,r.cy)(e)?(b=!0,g=e.some(e=>me(e)||ge(e)),f=()=>e.map(e=>ke(e)?e.value:me(e)?h(e):(0,r.Tn)(e)?u?u(e,2):e():void 0)):f=(0,r.Tn)(e)?t?u?()=>u(e,2):e:()=>{if(m){k();try{m()}finally{S()}}const t=Oe;Oe=p;try{return u?u(e,3,[_]):e(_)}finally{Oe=t}}:r.tE,t&&o){const e=f,t=!0===o?1/0:o;f=()=>Be(e(),t)}const v=i,y=()=>{p.stop(),v&&v.active&&(0,r.TF)(v.effects,p)};if(a&&t){const e=t;t=(...t)=>{e(...t),y()}}let w=b?new Array(e.length).fill(Ne):Ne;const x=e=>{if(1&p.flags&&(p.dirty||e))if(t){const e=p.run();if(o||g||(b?e.some((e,t)=>(0,r.$H)(e,w[t])):(0,r.$H)(e,w))){m&&m();const n=Oe;Oe=p;try{const n=[e,w===Ne?void 0:b&&w[0]===Ne?[]:w,_];w=e,u?u(t,3,n):t(...n)}finally{Oe=n}}}else p.run()};return d&&d(x),p=new l(f),p.scheduler=c?()=>c(x,!1):x,_=e=>function(e,t=!1,n=Oe){if(n){let t=Ee.get(n);t||Ee.set(n,t=[]),t.push(e)}}(e,!1,p),m=p.onStop=()=>{const e=Ee.get(p);if(e){if(u)u(e,4);else for(const t of e)t();Ee.delete(p)}},t?s?x(!0):w=p.run():c?c(x.bind(null,!0),!0):p.run(),y.pause=p.pause.bind(p),y.resume=p.resume.bind(p),y.stop=y,y}function Be(e,t=1/0,n){if(t<=0||!(0,r.Gv)(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,ke(e))Be(e.value,t,n);else if((0,r.cy)(e))for(let r=0;r<e.length;r++)Be(e[r],t,n);else if((0,r.vM)(e)||(0,r.CE)(e))e.forEach(e=>{Be(e,t,n)});else if((0,r.Qd)(e)){for(const r in e)Be(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Be(e[r],t,n)}return e}},7676:(e,t,n)=>{"use strict";n.d(t,{R:()=>r.R});var r=n(6853)},7744:(e,t,n)=>{"use strict";n.d(t,{MR:()=>s.M,MT:()=>a.M,Sv:()=>u.S,UB:()=>c.U,VL:()=>l.V,_D:()=>o._,j5:()=>i.j,wP:()=>r.w,yc:()=>d.y});var r=n(4709),i=n(2189),s=n(4784),o=n(5976),a=n(3214),l=n(2819),c=n(9164),d=n(1150),u=n(6094)},8147:(e,t,n)=>{"use strict";n.d(t,{W:()=>l});var r=n(7633),i=n(7744),s=n(4412),o=n(1717),a=n(6996);class l extends o.K{_format_brush=null;get meta(){return l.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:o,history:a,courier:l}=this,c=new s.vk(l);if(!e)return;const d=structuredClone((0,r.ux)(e));if(d["text-align"]){const t=e["text-align"];c.merge(this.text_align(t)),delete d["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 r of e.children.slice(...n.range))c.tell(r,i.VL.set_css(r.id,structuredClone(d),t))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:a}=o;if(!e||!n||!r)return;const l=i.VL.set_selection_css(e.id,d,n.id,r.id,s,a,t);c.tell(e,l)}a.record(c)}clear(){const{root:e,cursor:t,history:n,courier:r}=this,o=new s.vk(r),a={};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))o.tell(n,i.VL.set_css(n.id,structuredClone(a),!1,!0))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:l}=t;if(!e||!n||!r)return;const c=i.VL.set_selection_css(e.id,a,n.id,r.id,s,l,!1,!0);o.tell(e,c)}n.record(o)}text_align(e){const{root:t,cursor:n,history:r,courier:o}=this,a=new s.vk(o),l={"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))a.tell(n,i.VL.set_css(n.id,structuredClone(l)))}}else{const e=t.cursor.find_selection_lines();for(let t of e){const e=i.VL.set_css(t.id,structuredClone(l));a.tell(t,e)}}return a}indent(){const{root:e,cursor:t,history:n,courier:r,config:o}=this,a=new s.vk(r);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;a.tell(n,i.VL.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;a.tell(t,i.VL.set_attr(t.id,{indent:n}))}}n.record(a)}unindent(){const{root:e,cursor:t,history:n,courier:r}=this,o=new s.vk(r);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&&o.tell(e,i.VL.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&&o.tell(t,i.VL.set_attr(t.id,{indent:e-1}))}}n.record(o)}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((0,r.ux)(t.css))}else{const{cube_focus:e}=t;if(!e)return;this._format_brush=structuredClone((0,r.ux)(e.css))}}apply_format_brush(){const e=this._format_brush;if(!e)return;const{root:t,courier:n,history:r}=this,o=new s.vk(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=i.VL.set_css(n.id,e,!1,!0);o.tell(n,t)}}else{const{cube_selection:e,cube_end:t,cube_start:n,offset_start:r,offset_end:s}=this.cursor;if(!e||!t||!n)return;const a=i.VL.set_selection_css(e.id,this.format_brush,n.id,t.id,r,s,!1,!0);o.tell(e,a)}r.record(o)}static get meta(){return{type:a.Mu.painter,version:1}}}},8219:(e,t,n)=>{"use strict";n.d(t,{o:()=>i,H:()=>s});const r=new Map;class i{static get_cmd_handler(e,t){const n=r.get(e);return n?.get(t)}static set_cmd_handler(e,t,n){let i=r.get(e);i?i.set(t,n):(i=new Map,i.set(t,n),r.set(e,i))}static init_cmd_handler(e){const t=e.meta,n=r.get(t.type);if(n)for(let[t,r]of n)e.set_vip_cmd_handler(t,r.bind(e))}}function s(e){return(t,n)=>{const r=t[n];if(!r)return;const s=t.meta;i.set_cmd_handler(s.type,e,r)}}},8606:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>r});let r=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t}},8860:(e,t,n)=>{"use strict";n.d(t,{f:()=>y});var r=n(7744),i=n(6996),s=n(4089),o=n(3972),a=n(7633),l=n(4412);function c(e,t){return t.css.width?Number.parseInt(t.css.width.trim().slice(0,-2)):e.getBoundingClientRect().width}function d(e,t,n,r){e.stopPropagation(),e.preventDefault(),r.isdown=!0,r.dir=n,r.dom=t.dom;const i=e.currentTarget,s=i.parentElement?.parentElement;if(!s)return;r.x=e.clientX,r.width_origin=t.css.width;const o=c(s,t);r.width=o,r.width_result=o}var u=n(3755),h=n(122);const p=["id","data-type"],f={class:"tools-left"},m={class:"tools-right"},_=["src","loading"],g=(0,s.pM)({__name:"cube-img",props:{cube:{}},setup(e){const{root:t,stats:n}=e.cube,g={isdown:!1,ismove:!1,x:0,width:-1,dir:"left",width_origin:500},b=(0,a.Kh)({resize_origin_width:-1,resize_result:-1,resize_scroll:!1}),v=t.id,y=u.F.url,w=t=>d(t,e.cube,"left",g),x=t=>d(t,e.cube,"right",g),k=t=>function(e,t,n){if(!n.isdown||!n.dom)return;n.ismove=!0,e.preventDefault();const r="left"===n.dir?1:-1,i=e.clientX-n.x,s=Math.abs(n.width-i*r);t.data.css.width=s+"px",n.width_result=s}(t,e.cube,g),S=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:s}=t.root,o=new l.vk(i);o.tell(t,r.VL.set_css(t.id,{width:n.width_result+"px"})),s.record(o)}(0,e.cube,g),C=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:s}=t.root,o=new l.vk(i);o.tell(t,r.VL.set_css(t.id,{width:n.width_result+"px"})),s.record(o)}(0,e.cube,g);function M(t){const n=t.currentTarget.parentElement;Object.assign(n.style,e.cube.css),n.classList.add("cube-img-load-failed")}function T(t){if(!b.resize_scroll)return;const{deltaY:n}=t,r=t.currentTarget;if(!r)return;t.preventDefault(),t.stopPropagation();let i=c(r,e.cube)+10*Math.sign(n);e.cube.data.css.width=i+"px",b.resize_result=i}return(0,s.sV)(()=>{document.documentElement.addEventListener("pointermove",k),document.documentElement.addEventListener("pointerup",S),document.documentElement.addEventListener("pointercancel",C)}),(0,s.hi)(()=>{document.documentElement.removeEventListener("pointermove",k),document.documentElement.removeEventListener("pointerup",S),document.documentElement.removeEventListener("pointercancel",C)}),(l,d)=>((0,s.uX)(),(0,s.CE)("div",{class:(0,o.C4)(["cube-img",{"resize-scroll":b.resize_scroll}]),style:(0,o.Tr)(l.cube.css),id:l.cube.id,"data-type":(0,a.R1)(i.u0).img,onContextmenu:d[1]||(d[1]=e=>(0,a.R1)(h.uz)(e,l.cube)),onWheel:T},[(0,s.Lk)("div",f,[(0,s.Lk)("div",{class:"dragger",onPointerdown:w},null,32)]),(0,s.Lk)("div",m,[(0,s.Lk)("div",{class:"dragger",onPointerdown:x},null,32)]),(0,s.Lk)("img",{style:(0,o.Tr)(l.cube.css),src:t.isdev?e.cube.info:y?y(v,"image",e.cube.info):void 0,alt:"",onErrorOnce:M,onClick:d[0]||(d[0]=t=>function(t){const n=t.currentTarget;if(b.resize_scroll=!b.resize_scroll)b.resize_origin_width=c(n,e.cube);else{if(b.resize_origin_width<0||b.resize_result<0)return;const{courier:t,history:n}=e.cube.root;e.cube.data.css.width=b.resize_origin_width+"px";const i=t.get_recorder();i.tell(e.cube,r.VL.set_css(e.cube.id,{width:b.resize_result+"px"})),n.record(i)}}(t)),loading:(0,a.R1)(n).mode===(0,a.R1)(i.fv).export?"eager":"lazy"},null,44,_),(0,s.Q3)(' <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,p))}}),b=(0,n(5856).A)(g,[["__scopeId","data-v-14032bda"]]);var v=n(5955);class y extends r._D{_component=b;_children=[];get is_empty(){return 0===this.data.info.trim().length}get children(){return this._children}get meta(){return y.meta}get component(){return this._component}constructor(e,t){super(e,t);const n=this.setup(e,t),r=this.clipboard.pasted_from;return r&&this.event.emit_asset_copy(r.noteid,"image",e.info),n}build_child(){}update_data(e){const t=this.versions[this.meta.type];return t>this.meta.version?{data:e,usable:!1}:(1===t&&e.info.startsWith("image://")&&(e.info=e.info.slice(8)),{data:e,usable:!0})}float(e){const{courier:t}=this.root,n={float:"L"===e?"inline-start":"inline-end"},i=t.get_recorder(),s=r.VL.set_css(this.id,n,!0);return i.tell(this,s),i}clear_float(){const{courier:e}=this.root,t=e.get_recorder(),n=r.VL.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 y.replace_id(this.root,e,t)}static get meta(){return{type:i.u0.img,cubename:"图片",block:!1,version:2,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=v.I.get_id();return n[r]=i,t.id=i,t}static get_default(e="",t={},n={}){return{id:v.I.get_id(),type:i.u0.img,info:e,css:t,attrs:n}}}},8984:(e,t,n)=>{"use strict";n.d(t,{L$:()=>T,LU:()=>C,uz:()=>S});var r=n(7744),i=n(1742),s=n(1068),o=n(1556);var a=n(3755);function l(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row,d.col-1))return l?.tip_info("左侧已存在单元格");if(d.col-1<0)return l?.tip_info("左侧已达边界");{const t=r.get_recorder(),n={row:d.row,col:d.col-1,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_col_left(t.left))return l?.tip_info("左侧不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[0];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_col(e.id,d.col,i)),s.record(n)}}function c(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row,d.col+1))return l?.tip_info("右侧已存在单元格");if(d.col+1>=e.size[1])return l?.tip_info("右侧已达边界");{const t=r.get_recorder(),n={row:d.row,col:d.col+1,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_col_right(t.right))return l?.tip_info("右侧不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[0];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_col(e.id,d.col+d.colspan,i)),s.record(n)}}function d(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row-1,d.col))return l?.tip_info("上方已存在单元格");if(d.row-1<0)return l?.tip_info("上方已达边界");{const t=r.get_recorder(),n={row:d.row-1,col:d.col,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_row_top(t.top))return l?.tip_info("上方不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[1];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_row(e.id,d.row,i)),s.record(n)}}function u(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row+1,d.col))return l?.tip_info("下方已存在单元格");if(d.row+1>=e.size[0])return l?.tip_info("下方已达边界");{const t=r.get_recorder(),n={row:d.row+1,col:d.col,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_row_bottom(t.bottom))return l?.tip_info("下方不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[1];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_row(e.id,d.row+d.rowspan,i)),s.record(n)}}function h(e,t){const{cursor:n,courier:r,stats:i,history:s,id:l}=e,c=a.F.tips,{cube_end:d}=n,u=e.get_active_cell();if(!u)return c?.tip_info("未发现激活单元格");const h=r.get_recorder(),p=e.get_cell_area(u);h.tell(e,o.en.col_resize(l,[p.left,p.right],t)),s.record(h)}var p=n(1445);function f(e,t){const{courier:n,history:i}=e,s=n.get_recorder();s.tell(e,r.VL.set_attr(e.id,{column_count:t,column_width:null})),i.record(s)}function m(e,t){const{courier:n,history:i}=e,s=n.get_recorder();s.tell(e,r.VL.set_attr(e.id,{column_width:t,column_count:null})),i.record(s)}var _=n(3803),g=n(5955),b=n(6996);function v(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:o,cube_end:a}=r;if(!o||!a)return;const l=i.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});l.tell(n,_.o.indent(n.id,i)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});l.tell(n,_.o.indent(n.id,i)),s.record(l)}}function y(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:a,cube_end:l}=r;if(!a||!l)return;const c=i.get_recorder();if(t){const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});c.tell(n,o.LO.indent(n.id,i)),s.record(c)}else{const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});c.tell(n,o.LO.indent(n.id,i)),s.record(c)}}function w(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:a,cube_end:l}=r;if(!a||!l)return;const c=i.get_recorder();if(t){const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});c.tell(n,o.A6.indent(n.id,i)),s.record(c)}else{const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});c.tell(n,o.A6.indent(n.id,i)),s.record(c)}}var x=n(4412);function k(e,t="tail"){const{courier:n,history:r}=e,i=new x.vk(n),s=[o.XV.get_default(),o.XV.get_default()],a=o.ry.insert_row(e.id,t,[s]);i.tell(e,a),r.record(i)}async function S(e,t){e.preventDefault(),e.stopPropagation(),i.h_.cube=t,i.h_.point={x:e.clientX,y:e.clientY},i.h_.stack_pos.length=0,i.h_.stack_rect.length=0,i.h_.stack_menus.length=0,t instanceof o.p4?i.h_.menu=function(e){const t=[...T(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:r,history:i,id:s,active_tab:a}=e;if(!a)return;const l=r.get_recorder();l.tell(e,o.DW.change_lang(s,a.id,t)),i.record(l)}}))}}(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:r,history:i,id:s,active_tab:a}=e;if(!a)return;const l=r.get_recorder();l.tell(e,o.DW.change_theme(s,a.id,t)),i.record(l)}}))}}(e),click(e){}},{usable:!0,title:"添加代码块",icon:["iconfont","icon-add"],click(t){(0,i.NW)({文件名:""},t=>{const n=t["文件名"],r=n.lastIndexOf(".");let i="typescript";if(r>=0){const e=n.slice(r);i=o.UF[e]||i}const{code_theme:s}=e.config.data,a=e.create_tab(i,n,s),l=e.courier.get_recorder();l.tell(e,o.DW.add(e.id,a)),e.history.record(l)})},mouseenter(e){}},{usable:!0,title:"重命名",icon:["iconfont","icon-rename"],click(t){const n={文件名:e.active_tab?.name||""};(0,i.NW)(n,t=>{const n=e.active_tab;if(!n)return;const r=t["文件名"],i=e.courier.get_recorder();i.tell(e,o.DW.rename(e.id,n.id,r)),e.history.record(i)})},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 r=e.courier.get_recorder();r.tell(e,o.DW.update(e.id,n.id,"")),e.history.record(r)},mouseenter(e){}},{usable:!0,title:"删除代码",icon:["iconfont","icon-close"],click(t){const n=e.active_tab;if(!n)return;const r=e.courier.get_recorder();r.tell(e,o.DW.remove(e.id,n.id)),e.history.record(r)},mouseenter(e){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.Ku?i.h_.menu=function(e){const t=e.get_active_cell(),n=[...T(e),{usable:!0,title:e.title?"移除标题":"添加标题",icon:["iconfont","icon-a-Addheader2x"],has_submenu:!1,mouseenter(e){},click(t){const{history:n,courier:r,id:i}=e,s=r.get_recorder();if(e.title){const t=o.en.remove_title(i);s.tell(e,t)}else{const t=o.XV.get_default(),n=o.en.add_title(i,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,r=a.F.tips,i=e.copy_selection_table();if(!i)return a.F.tips?.tip_error("复制子表失败");const s=e.get_selection_text();n.set_clipboard_cubedata(s,[i]),r?.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:r}=e,i=a.F.tips,s=t.get_recorder(),l=e.get_selection_area();if(!l)return i?.tip_info("无选中单元格");s.tell(e,o.en.merge(n,l)),r.record(s)}(e)}},{usable:!!t,title:"扩大当前列宽",icon:["iconfont","icon-expand-horizontal-1--expand-resize-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){h(e,1)}},{usable:!!t,title:"缩小当前列宽",icon:["iconfont","icon-shrink-horizontal-1--resize-shrink-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){h(e,-1)}},{usable:!!t,title:"向左插入列",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇠",mouseenter(e){},click(t){l(e)}},{usable:!!t,title:"向右插入列",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇢",mouseenter(e){},click(t){c(e)}},{usable:!!t,title:"向上插入行",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + shift + ↑",mouseenter(e){},click(t){d(e)}},{usable:!!t,title:"向下插入行",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇣",mouseenter(e){},click(t){u(e)}},{usable:!!t,title:"向左插入单元格",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + ⇠",mouseenter(e){},click(t){l(e,!0)}},{usable:!!t,title:"向右插入单元格",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + ⇢",mouseenter(e){},click(t){c(e,!0)}},{usable:!!t,title:"向上插入单元格",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + ↑",mouseenter(e){},click(t){d(e,!0)}},{usable:!!t,title:"向下插入单元格",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + ⇣",mouseenter(e){},click(t){u(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:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(!e.check_orderly_row(d.row))return l?.tip_info("当前行不整齐");{const t=n.get_recorder();t.tell(e,o.en.remove_row(s,d.row)),i.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:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(!e.check_orderly_col(d.col))return l?.tip_info("当前列不整齐");{const t=n.get_recorder();t.tell(e,o.en.remove_col(s,d.col)),i.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:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");const u=n.get_recorder();u.tell(e,o.en.remove_cell(s,d.box.id)),i.record(u)}(e)}}];return{title:e.meta.cubename,active:[],menus:n}}(t):t instanceof o.HR?i.h_.menu=function(e){const t=[...T(e),{usable:!e.attrs.fold,title:"折叠",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){(0,p.yg)(e)}},{usable:!!e.attrs.fold,title:"展开",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){(0,p.yg)(e)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.mM?i.h_.menu=function(e){const t=[...T(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(),s=[o.XV.get_default()];i.tell(e,r.VL.insert_child(e.id,s,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(){m(e,120)}},{usable:!0,title:140,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,140)}},{usable:!0,title:160,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,160)}},{usable:!0,title:180,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,180)}},{usable:!0,title:200,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(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(){f(e,2)}},{usable:!0,title:3,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){f(e,3)}},{usable:!0,title:4,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){f(e,4)}},{usable:!0,title:5,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){f(e,5)}},{usable:!0,title:6,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){f(e,6)}}];return{title:"限定列数",active:[e.attrs.column_count],menus:t}}(e),click(){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.Kw?i.h_.menu=function(e){const t=[...T(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){v(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){v(e,!0)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.list_ordered;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.NQ?i.h_.menu=function(e){const t=[...T(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){y(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){y(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.list;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.k9?i.h_.menu=function(e){const t=[...T(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){w(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){w(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.list;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.list_ordered;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.fC?i.h_.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 a.F.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)&&a.F.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 o.RQ&&(i.h_.menu=function(e){const t=[...T(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 r=n.find_upstream_untill(e);r instanceof o.XV&&k(e,Math.floor(r.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 r=n.find_upstream_untill(e);r instanceof o.XV&&k(e,Math.floor(r.index/2))}}];return{title:e.meta.cubename,active:[],menus:t}}(t))}function C(e,t,n,r=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 i={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(s.MathRect.can_include(i,t)){const i=n.y+t.height-e.height;return{x:n.x+n.width+r,y:i<0?n.y:n.y-i}}{const i=n.y+t.height-e.height;return{x:n.x-t.width-r,y:i<0?n.y:n.y-i}}}function M(e,t){const{courier:n,history:i}=e,s=n.get_recorder(),a=e.pcube;if("A"===t)if(e instanceof o.HR){const t=o.HR.get_default();s.tell(a,r.VL.insert_child(a.id,[t],e.index+1))}else{const t=o.gK.get_default(),n=r.VL.insert_child(a.id,[t],e.index+1);s.tell(a,n)}else if("B"===t&&e)if(e instanceof o.HR){const t=o.HR.get_default();s.tell(a,r.VL.insert_child(a.id,[t],e.index))}else{const t=o.gK.get_default(),n=r.VL.insert_child(a.id,[t],e.index);s.tell(a,n)}i.record(s)}function T(e,t=!1){const n=[{usable:!0,title:"向前插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){M(e,"B")}},{usable:!0,title:"向后插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){M(e,"A")}}],r={usable:!0,title:"全屏",icon:["iconfont","icon-square"],has_submenu:!1,mouseenter(e){},click(t){e.dom?.requestFullscreen()}};return t&&n.push(r),n}},9164:(e,t,n)=>{"use strict";n.d(t,{U:()=>i});var r=n(6996);class i{static in_head(e,t=0,n="none"){return{id:e,name:r.K9.cursor_in_head,offset:t,from:n}}static in_tail(e,t=0,n="none"){return{id:e,name:r.K9.cursor_in_tail,offset:t,from:n}}}}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return n[e](s,s.exports,i),s.exports}i.m=n,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>"chunk/"+e+"-"+i.h()+".js",i.miniCssF=e=>{},i.h=()=>"140ecdca17488a71c4a8",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="deepsky:",i.l=(n,r,s,o)=>{if(e[n])e[n].push(r);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+s){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",i.nc&&a.setAttribute("nonce",i.nc),a.setAttribute("data-webpack",t+s),a.src=n),e[n]=[r];var h=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);var i=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach(e=>e(r)),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.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 r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={3057:0};i.f.j=(t,n)=>{var r=i.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var s=new Promise((n,i)=>r=e[t]=[n,i]);n.push(r[2]=s);var o=i.p+i.u(t),a=new Error;i.l(o,n=>{if(i.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){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,r[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,s,[o,a,l]=n,c=0;if(o.some(t=>0!==e[t])){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);l&&l(i)}for(t&&t(n);c<o.length;c++)s=o[c],i.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";i.r(s),i.d(s,{BoundBox:()=>r.yI,CodeLanguageMap:()=>r.UF,CommandApi:()=>r.ev,CommandBoxFolder:()=>r.$6,CommandBoxRoot:()=>r.LU,CommandCode:()=>r.DW,CommandCube:()=>o.VL,CommandCursor:()=>o.UB,CommandDetailList:()=>r.ry,CommandFomula:()=>r.OA,CommandLinker:()=>r.PL,CommandListOrdered:()=>r.LO,CommandMap:()=>o.yc,CommandNode:()=>o.Sv,CommandRt:()=>r.fl,CommandTable:()=>r.en,CommandText:()=>r.zl,CommandTextLink:()=>r.ZU,CommandTodo:()=>r.A6,CubeAnnotation:()=>r.vV,CubeApi:()=>r.c9,CubeBase:()=>o.j5,CubeBox:()=>r.XV,CubeBoxColumns:()=>r.mM,CubeBoxFolder:()=>r.de,CubeBoxRoot:()=>r.HR,CubeChild:()=>o._D,CubeCode:()=>r.p4,CubeDetailList:()=>r.RQ,CubeDoc:()=>r.oY,CubeFomula:()=>r.qH,CubeHandler:()=>a.o,CubeImg:()=>r.fC,CubeLine:()=>r.gK,CubeLinker:()=>r.R$,CubeList:()=>r.Kw,CubeListOrdered:()=>r.NQ,CubeLost:()=>r.Qm,CubeMap:()=>r.EU,CubeNode:()=>r.gL,CubePostil:()=>r.$u,CubeRoot:()=>o.MR,CubeRt:()=>r.at,CubeSubMap:()=>r.gv,CubeTable:()=>r.Ku,CubeText:()=>r.P6,CubeTextLink:()=>r.ju,CubeTip:()=>r.LZ,CubeTodo:()=>r.k9,LinkerLine:()=>r.sf,LinkerPoint:()=>r.e8,MapBase:()=>o.MT,MapInteraction:()=>C.T,MapNodeBase:()=>o.wP,MapTools:()=>S.U,Matrix2D:()=>S.c,NodeObserver:()=>r.Nj,NodeShape:()=>r.AG,NoteApi:()=>x.F,NoteBase:()=>l.K,NoteClipBoard:()=>c.F,NoteCourier:()=>d.W,NoteCubes:()=>f.h,NoteCursor:()=>u.P,NoteEvent:()=>p.z,NoteHistory:()=>m.PI,NoteHotkeys:()=>_.Wu,NoteIcons:()=>h.R,NoteListener:()=>v.t,NoteManager:()=>g.K,NotePainter:()=>b.W,NotePlayer:()=>m.C6,NoteScope:()=>y.R,NoteStats:()=>w.I,NoteTools:()=>k.I,Recorder:()=>m.vk,Waiter:()=>k.J,_ApiCommandNames:()=>n.tK,_CodeCommandNames:()=>n.GW,_CubeCommandName:()=>n.zS,_CursorCommandName:()=>n.K9,_DetaiListCommandName:()=>n.J8,_DocCommandName:()=>n.QI,_FomulaCommandNames:()=>n.nY,_FomulaSize:()=>n.$f,_HotKeys:()=>n.ZS,_HotKeysGroup:()=>n.ec,_Keys:()=>n.SN,_LinkerAnchor:()=>n._A,_LinkerCommandNames:()=>n.Sd,_ListCommandNames:()=>n.JC,_ListOrderedCommandNames:()=>n.mM,_MapCommandName:()=>n.kU,_MapGroup:()=>n.L6,_NavigationKey:()=>n.tX,_NodeCommandName:()=>n.s1,_NoteCores:()=>n.Mu,_NoteCubeTypes:()=>n.u0,_NoteEvents:()=>n.dp,_NoteMode:()=>n.fv,_PlayStatus:()=>n.yn,_RtCommandNames:()=>n.DI,_TableCommandNames:()=>n.BS,_TextCommandName:()=>n.lm,_TextLinkCommandNames:()=>n.gS,_TodoCommandNames:()=>n.Ny,cmd:()=>a.H,key:()=>_.Eb,keymap:()=>_.w4,node_observer:()=>r.iO});var e=i(1068),t={};for(const n in e)"default"!==n&&(t[n]=()=>e[n]);i.d(s,t);var n=i(6996),r=i(1556),o=i(7744),a=i(8219),l=i(4031),c=i(443),d=i(1701),u=i(2277),h=i(7676),p=i(3814),f=i(3513),m=i(4412),_=i(3408),g=i(346),b=i(8147),v=i(3736),y=i(5391),w=i(2742),x=i(3755),k=i(5955),S=i(2547),C=i(3676)})(),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={122:(e,t,n)=>{"use strict";n.d(t,{uz:()=>r.uz}),n(1742);var r=n(8984)},346:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(1556);class i{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={[r.oY.meta.type]:r.oY.meta.version};for(const[t,n]of this._cubes)e[t]=n.meta.version;return e}static get_sdk_meta(){return{version:"1.83.7",time_publish:1766830696116}}static register_cube_core(){i.register_cube(r.P6),i.register_cube(r.gK),i.register_cube(r.fC),i.register_cube(r.$u),i.register_cube(r.ju),i.register_cube(r.vV),i.register_cube(r.HR),i.register_cube(r.Kw),i.register_cube(r.NQ),i.register_cube(r.k9),i.register_cube(r.LZ),i.register_cube(r.RQ),i.register_cube(r.Ku),i.register_cube(r.qH),i.register_cube(r.p4),i.register_cube(r.c9),i.register_cube(r.XV),i.register_cube(r.de),i.register_cube(r.gL),i.register_cube(r.R$),i.register_cube(r.mM),i.register_cube(r.gv),i.register_cube(r.at)}}},443:(e,t,n)=>{"use strict";n.d(t,{F:()=>h});var r=n(1556),i=n(7744),s=n(8860),o=n(1717),a=n(4412),l=n(6996),c=n(5955),d=n(3755),u=n(4089);class h extends o.K{_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 h.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:n}=this;if(n.has_selection){this._copy_data=n.find_inline_data();let r=n.get_selection_text();const i={noteid:t.id,cubedata:this._copy_data},s=JSON.stringify(i);return e.setData("application/json",s),e.setData("text/plain",r),!0}{const{cube_end:r}=n;if(!r)return!1;const i=[r.export()];this._copy_data=i;let s="";for(let e of this._copy_data)e.type===l.u0.text&&(s+=e.info);const o={noteid:t.id,cubedata:i},a=JSON.stringify(o);return e.setData("application/json",a),e.setData("text/plain",s),!0}}async copy_scope(e){const t=d.F.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 r=[];let i="";for(let e of n){for(let t of e.cube.children.slice(...e.range))i+=t.text;r.push(...e.cube.copy(...e.range))}this._copy_data=r;const s={noteid:this.root.id,cubedata:this._copy_data},o=JSON.stringify(s);return e.setData("application/json",o),e.setData("text/plain",i),!0}set_clipboard_cubedata(e,t){const n={noteid:this.root.id,cubedata:t},r=JSON.stringify(n),i=(new TextEncoder).encode(r),s=JSON.stringify([...i]),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,r=e.items,i=n.get_recorder();let s=[];i.merge(this.delete()),await(0,u.dY)();for(let e=0;e<r.length;e++){const t=r[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);i.merge(t)}return i}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,i.merge(this.paste_cubes(t.cubedata)),i}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),r=(new TextDecoder).decode(n),s=JSON.parse(r);let o=!1;try{if(s&&s.cubedata&&s.noteid)return this._paste_stack.push(s),o=!0,i.merge(this.paste_cubes(s.cubedata)),i}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 i?.merge(),i.merge(this.paste_cubes(e)),i}return i}get_cubedata_from_text(e){const t=e.replace("\r","").split("\n"),n=[];if(1===t.length){const e=r.P6.get_default(t[0]);n.push(e)}else for(let e of t){if(!e.trim())continue;const t=r.gK.get_default_by_string(e);n.push(t)}return n}paste_cubes(e){if(0===e.length)return;const{courier:t,history:n,cursor:r}=this,s=new a.vk(t),{cube_selection:o,cube_end:l,cube_start:d,offset_start:u,offset_end:h}=r;if(!o||!l||!d)return;r.has_selection&&s.tell(o,i.VL.delete(o.id,"backward",d.id,l.id,u,h,!0));const p=c.I.replace_id(this.root,e);return s.tell(d,i.VL.insert(d.id,p,d.id,d.id,u,u)),s}async paste_img(e){const{courier:t,history:n,cursor:r}=this,o=new a.vk(t),{cube_selection:l,cube_end:c,cube_start:d,offset_start:u,offset_end:h}=r;if(!l||!c||!d)return;const p=s.f.get_default();if(this.root.isdev)p.info=URL.createObjectURL(e),o.tell(c,i.VL.insert(c.id,[p],d.id,c.id,u,h));else{const t=p.id+".png",n=t;await this.event.emit_asset_save("image",t,e),p.info=n,o.tell(c,i.VL.insert(c.id,[p],d.id,c.id,u,h))}return o}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,r=new a.vk(e),{cube_end:s,cube_start:o,cube_selection:l,offset_start:c,offset_end:d}=t;if(!l||!s||!o)return;const u=o.id,h=s.id,p=l.id,f=i.VL.delete(p,"backward",u,h,c,d);return r.tell(l,f),r}delete_scope(){const e=d.F.tips,{root:t,courier:n,history:r,cursor:i}=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 a.vk(n),o=this._root.get_scope_cubes(),l=new Map;for(let e of o){let t=l.get(e.cube);t?t.push(e.range):l.set(e.cube,[e.range])}const c=new Set;for(let[e,t]of l){const n=e.children;for(let e of t){const t=n.slice(e[0],e[1]);for(let e of t)c.add(e)}for(let e of c)s.merge(e.remove_self())}return this.root.clear_scope(),s}cut(e){const{root:t,courier:n,cursor:r}=this;t.scope_count_normal>0?this.cut_scope(e):this.cut_selection(e)}cut_scope(e){const{root:t,courier:n,history:r,cursor:i}=this,s=d.F.tips;if(0===t.scope.size)return s?.tip_info("无块选区"),!1;if(0===t.scope_count_normal)return s?.tip_info("无常规块选区"),!1;const o=new a.vk(n),c=this._root.get_scope_cubes(),u=new Map;for(let e of c){let t=u.get(e.cube);t?t.push(e.range):u.set(e.cube,[e.range])}const h=[];for(let[e,t]of u){const n=new Set;e.children;for(let r of t){const t=e.children.slice(r[0],r[1]);for(let e of t)n.add(e);h.push(...e.copy(...r))}for(let e of n)o.merge(e.remove_self())}this._copy_data=h;let p="";for(let e of this._copy_data)e.type===l.u0.text&&(p+=e.info);const f={noteid:this.root.id,cubedata:h},m=JSON.stringify(f);e.setData("text/plain",p),e.setData("application/json",m),this.root.clear_scope(),r.record(o)}cut_selection(e){const{courier:t,cursor:n,history:r}=this,s=new a.vk(t),{cube_end:o,cube_start:c,cube_selection:d,offset_start:u,offset_end:h}=n;if(d&&o&&c)if(n.has_selection){this._copy_data=n.find_inline_data();let t="";for(let e of this._copy_data)e.type===l.u0.text&&(t+=e.info);const a={noteid:this.root.id,cubedata:this._copy_data},p=JSON.stringify(a);e.setData("text/plain",t),e.setData("application/json",p);const f=c.id,m=o.id,_=d.id,g=i.VL.delete(_,"backward",f,m,u,h);s.tell(d,g),r.record(s)}else{const t=o.export();this._copy_data=[t];let n="";for(let e of this._copy_data)e.type===l.u0.text&&(n+=e.info);const a={noteid:this.root.id,cubedata:this._copy_data},c=JSON.stringify(a);e.setData("text/plain",n),e.setData("application/json",c);const d=o.pcube,u=o.index,h=i.VL.delete_child(d.id,"backward",[u,u+1]);s.tell(d,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 r of t)await e.getType(r).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:l.Mu.clipboard,version:1}}}},1068:e=>{var t;self,t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},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:()=>u,DateTime:()=>c,DomAnimation:()=>d,DragDiff:()=>m,DragList:()=>p,Iteration:()=>a,MathBase:()=>_,MathLine:()=>y,MathPoint:()=>b,MathPolygon:()=>v,MathRect:()=>g,Notice:()=>o,_RectPosition:()=>s});var n,r,i,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 r=Symbol();return this.scope[e]=r,t(()=>r===this.scope[e],...n)}}static throttle(e,t=100){let n;return function(...r){n||(n=setTimeout(()=>{e(...r),n=void 0},t))}}static debounce(e,t=100){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}}i={},(r="scope")in(n=o)?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i;class a{static*zip(...e){let t=e.map(e=>Array.isArray(e)?e:[e]),n=t.map(e=>e.length),r=Math.min(...n);for(let e=0;e<r;e++){let n=[];for(let r=0;r<t.length;r++)n.push(t[r][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(),r=t.getDay(),i=new Date(t.getFullYear(),t.getMonth(),n-r),s=new Date(t.getFullYear(),t.getMonth(),n+(6-r));return`${this.get_date_string(i)}:${this.get_date_string(s)}`}static get_week_days(e){const t=[];let n;n=e||new Date;const r=n.getFullYear(),i=n.getMonth(),s=n.getDate(),o=n.getDay(),a=new Date(r,i,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 r=t;const i=()=>{if(Math.abs(r)>2){let t=r/10;r-=t,"vertical"===n?e.scrollTop+=t:e.scrollLeft+=t,requestAnimationFrame(i)}"vertical"===n?e.scrollTop+=r:e.scrollLeft+=r};i()}}class u{static swap(e,t,n){const r=e[t],i=e[n];e[t]=i,e[n]=r}}function h(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],r=n.getAttribute(this.attr);r&&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(r),t.add(r),this.map.has(r)||this.register(n),this.map.set(r,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 r=this.sum_translate(this.order.slice(0,e));"horizental"===this.dir?n.style.transform=`translateX(${r}px)`:n.style.transform=`translateY(${r}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),r=this.drag_id;if(!n||!r||n===r)return;const i=this.order.indexOf(n),s=this.order.indexOf(r);i<0||s<0||("swap"===this.effect?u.swap(this.order,i,s):(this.order.splice(s,1),this.order.splice(i,0,r)),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),r=this.drag_id;if(!n||!r||n===r)return;const i=this.order.indexOf(n),s=this.order.indexOf(r);i<0||s<0||("swap"===this.effect?u.swap(this.order,i,s):(this.order.splice(s,1),this.order.splice(i,0,r)),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,r,i=!0){h(this,"container",void 0),h(this,"drag_id",void 0),h(this,"dir","vertical"),h(this,"effect",void 0),h(this,"attr",void 0),h(this,"realtime",!0),h(this,"order_origin",[]),h(this,"order",[]),h(this,"css_var_point_events","--drag-item-point-event"),h(this,"map",new Map),h(this,"callback",new Set),h(this,"callback_start",new Set),h(this,"callback_end",new Set),h(this,"scale_h",1),h(this,"scale_v",1),h(this,"_func_start",void 0),h(this,"_func_over",void 0),h(this,"_func_enter",void 0),h(this,"_func_end",void 0),h(this,"_callback_start",void 0),this.container=e,this.dir=t,this.attr=n,this.realtime=i,this.effect=r,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:r,width:i,height:o}=e,a=r+o,l=n+i,c=n+i/2,d=r+o/2;if(t===s.left_bottom)return{x:n,y:a};if(t===s.left_top)return{x:n,y:r};if(t===s.left_mid)return{x:n,y:d};if(t===s.right_top)return{x:l,y:r};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:r};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 r=e.x===t.x||e.x===t.x+t.width,i=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||r)&&(o||i):s&&o}static get_point_in_rects(e,t,n=!0){const r=[];for(let i of t)this.is_point_in_rect(e,i,n)&&r.push(i);return r}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,r=5){const i={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 i=t.width+n.x-e.width,s=n.y+n.height+r;return{x:i<0?n.x:n.x-i,y:s}}if(g.can_include(i,t)){const i=t.width+n.x-e.width,s=n.y-t.height-r;return{x:i<0?n.x:n.x-i,y:s}}if(g.can_include(o,t)){const i=n.y+t.height-e.height;return{x:n.x-t.width-r,y:i<0?n.y:n.y-i}}if(g.can_include(a,t)){const i=n.y+t.height-e.height;return{x:n.x+n.width+r,y:i<0?n.y:n.y-i}}if(g.can_include(e,t)){const r=e.y+e.height-t.height;let i=n.x;return a.width>=t.width?i=n.x+n.width:o.width>=t.width&&(i=n.x-t.width),{x:i,y:r}}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,r=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?r=t.y-e.y:e.y+e.height>t.y+t.height&&(r=t.y+t.height-(e.y+e.height)),{dx:n,dy:r}}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,r=e.y+e.height/2,i=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-i),a=Math.abs(r-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,r=t.y,i=t.x+t.width,s=t.y+t.height;let o=e.x,a=e.y;return o<n&&(o=n),o>i&&(o=i),a<r&&(a=r),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,r=t.y+t.height/2,i=t.width/2,s=t.height/2,o=Math.abs(n-e.x),a=Math.abs(r-e.y);return o<=i&&a>s?a-s:a<=s&&o>i?o-i:Math.sqrt(Math.pow(o-i,2)+Math.pow(a-s,2))}static distance_with(e,t){const n=this.get_point_center(e),r=this.get_point_center(t),i=Math.abs(n.x-r.x),s=Math.abs(n.y-r.y),o=(e.width+t.width)/2,a=(e.height+t.height)/2;if(i<=o&&s<=a)return 0;if(i>o&&s<=a)return i-o;if(i<=o&&s>a)return s-a;{let e=Math.pow(i-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,r=Number.POSITIVE_INFINITY;for(let i of t){let t=this.point_distance_with_rect(e,i);t<r&&(r=t,n=i)}return n}static get_shadow_point_horizental(e,t){let n=t.x,r=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:r}}static merge(...e){const t=e[0];let n=t.x,r=t.x+t.width,i=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>r&&(r=e+a),o<i&&(i=o),o+l>s&&(s=o+l)}return{x:n,y:i,width:r-n,height:s-i}}}class b{static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],r=this.path.getTotalLength()/t;for(let e=0;e<t;e++){const t=e*r,i=this.path.getPointAtLength(t);n.push({x:i.x,y:i.y})}return n}static get_line_k(e,t,n=100){const r=t.y-e.y,i=t.x-e.x;return 0===i?Number.POSITIVE_INFINITY:r/i}static distance(e,t){const n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}static find_closet_point(e,t){let n=1/0,r=e[0];const{x:i,y:s}=t;for(let t of e){let e=Math.pow(i-t.x,2)+Math.pow(s-t.y,2);e<n&&(n=e,r=t)}return r}static offset_points(e,t){const n=[],{x:r,y:i}=t;for(let t of e)n.push({x:t.x+r,y:t.y+i});return n}static find_closest_points(e,t){let n=1/0,r=e[0],i=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,r=o,i=s)}}return{from:r,to:i}}}!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 v{static polygon_center(e){let t=0,n=0,r=0;const i=e.length;for(let s=0;s<i;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%i],d=o*c-l*a;r+=d,t+=(o+l)*d,n+=(a+c)*d}return r*=.5,t/=6*r,n/=6*r,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const{x:i,y:s}=e[r],{x:o,y:a}=e[(r+1)%n];t+=i*a-o*s}return t/2}}class y{static check_intersection(e,t){const{from:n,to:r}=e,{from:i,to:s}=t;let o,a;if(o=n.x===r.x?Number.POSITIVE_INFINITY:(r.y-n.y)/(r.x-n.x),a=i.x===s.x?Number.POSITIVE_INFINITY:(s.y-i.y)/(s.x-i.x),o===a)return!1;const l=Math.min(n.x,r.x),c=Math.max(n.x,r.x),d=Math.min(n.y,r.y),u=Math.max(n.y,r.y),h=Math.min(i.x,s.x),p=Math.max(i.x,s.x),f=Math.min(i.y,s.y),m=Math.max(i.y,s.y);if(o===Number.POSITIVE_INFINITY){const e=n.x,t=a*(e-i.x)+i.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=f&&t<=m}if(a===Number.POSITIVE_INFINITY){const e=i.x,t=(r.y-n.y)/(r.x-n.x)*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=f&&t<=m}{const e=(i.y-n.y+o*n.x-a*i.x)/(o-a),t=o*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=f&&t<=m}}}return t})(),e.exports=t()},1150:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});var r=n(6996);class i{static node_add(e,t){return{id:e,name:r.kU.node_add,data:t}}static node_remove(e,t){return{id:e,name:r.kU.node_remove,data:t}}static linker_add(e,t){return{id:e,name:r.kU.linker_add,data:t}}static linker_remove(e,t){return{id:e,name:r.kU.linker_remove,data:t}}static update_attr(e,t){return{id:e,name:r.kU.update_attrs,data:t}}}},1445:(e,t,n)=>{"use strict";n.d(t,{AG:()=>f,KS:()=>v,M3:()=>_,_V:()=>g,bQ:()=>d,dw:()=>u,gV:()=>h,kE:()=>y,o:()=>m,pn:()=>p,yg:()=>b});var r=n(4412),i=n(7744);let s,o,a=!1,l=null,c=null;function d(e,t){if(e.stopPropagation(),!a)return void e.preventDefault();const n=e.currentTarget;n instanceof HTMLElement&&(l=n,s=t,document.body.style.setProperty("--box-root-pointer-events","none"))}function u(e,t){if(!a||!s)return;e.stopPropagation();const n=e.currentTarget;n instanceof HTMLElement&&t!==s&&(n!==c&&c?.classList.remove("drag-enter"),c=n,o=t,c.classList.add("drag-enter"))}function h(e,t){e.stopPropagation(),c&&c.classList.remove("drag-enter")}function p(e,t){e.preventDefault(),e.stopPropagation(),c&&c.classList.add("drag-enter")}function f(e,t){a&&(e.preventDefault(),e.stopPropagation(),s&&o&&l&&c&&s!==o&&(l.style["view-transition-name"]=s.id,document.startViewTransition(()=>{if(!(s&&o&&l&&c))return;const{courier:e,history:n}=t,a=new r.vk(e),d=l.getBoundingClientRect(),u=o.index,h=s.export(),p=o.pcube;s.pcube===p?a.tell(s.pcube,i.VL.reorder(s.pid,s.id,o.index)):(a.merge(s.remove_self()),a.tell(p,i.VL.insert_child(p.id,[h],u))),n.record(a);const f=c.getBoundingClientRect(),m=f.x-d.x,_=f.y-d.y;document.body.style.setProperty("--x",m+"px"),document.body.style.setProperty("--y",_+"px")}),a=!1))}function m(e,t){c&&c.classList.remove("drag-enter"),l&&l.classList.remove("drag-enter"),a=!1}function _(e,t){const n=e.target;n instanceof HTMLElement&&"cube-box-root-dragger"===n.dataset.tag&&(a=!0,e.stopPropagation())}function g(e,t){const{stats:n}=t.root,r=t.index+1;n.active_root_index=r}function b(e){const{courier:t,history:n,id:r,cubes:s}=e,o=t.get_recorder();o.tell(e,i.VL.fold(r,!e.attrs.fold)),n.record(o);for(let t of Object.values(s.postils))t.pcube?.top===e&&t.visible(!1);const a=e.child_first.id;if(!a)return;const l=document.getElementById(a);l?.scrollIntoView({block:"nearest",behavior:"smooth"})}function v(e,t){b(t)}function y(e,t){e.preventDefault();const{root:n,stats:r}=t;r.anchor_root_id===t.id?r.anchor_root_id="":n.stats.anchor_root_id=t.id}},1556:(e,t,n)=>{"use strict";n.d(t,{yI:()=>Nn,UF:()=>Xa,ev:()=>Bn,$6:()=>Lt,LU:()=>ft,DW:()=>kr,ry:()=>Yn,OA:()=>Yh,PL:()=>tn,LO:()=>_r,fl:()=>Sp,en:()=>Qh,zl:()=>$,ZU:()=>D,A6:()=>rr,vV:()=>R,c9:()=>Kn,XV:()=>xt,mM:()=>kp,de:()=>Tt,HR:()=>pt,p4:()=>Za,RQ:()=>nr,oY:()=>mt,qH:()=>Zh,fC:()=>i.f,gK:()=>gt,R$:()=>xn,Kw:()=>mr,NQ:()=>xr,Qm:()=>b,EU:()=>In,gL:()=>Rn,$u:()=>q,at:()=>Tp,gv:()=>wn,Ku:()=>pp,P6:()=>X,ju:()=>V,LZ:()=>bp,k9:()=>cr,sf:()=>Jt,e8:()=>en,Nj:()=>kn,AG:()=>En,iO:()=>Sn});var r={};n.r(r),n.d(r,{boolean:()=>ts,booleanish:()=>ns,commaOrSpaceSeparated:()=>as,commaSeparated:()=>os,number:()=>is,overloadedBoolean:()=>rs,spaceSeparated:()=>ss});var i=n(8860),s=n(8606),o=n(7744),a=n(6996),l=n(7633),c=n(4089),d=n(3972);const u=["id","data-type"],h={class:"lost-info"},p=(0,c.pM)({__name:"cube-lost",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-lost",id:e.cube.id,"data-type":(0,l.R1)(a.u0).lost},[t[2]||(t[2]=(0,c.Lk)("div",{class:"lost-title"},"异常方块",-1)),(0,c.Lk)("div",h,[t[0]||(t[0]=(0,c.Lk)("div",null,"方块类型: ",-1)),(0,c.Lk)("div",null,(0,d.v_)(e.cube.cube_name),1),t[1]||(t[1]=(0,c.Lk)("div",null,"异常原因: ",-1)),(0,c.Lk)("div",null,(0,d.v_)(e.cube.msg),1)])],8,u))});var f=n(5856);const m=(0,f.A)(p,[["__scopeId","data-v-2525a8c9"]]);var _=n(4412),g=n(5955);class b extends o._D{_msg=(0,l.KR)("");get msg(){return this._msg.value}set msg(e){this._msg.value=e}_component=m;get component(){return this._component}get meta(){return b.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}gc(){}replace_id(e,t={}){return b.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,r=new _.vk(t);return n&&r.tell(n,o.UB.in_head(n.id,0)),r}on_cursor_in_tail(e){const{courier:t,prev_cube:n}=this,r=new _.vk(t);return n&&r.tell(n,o.UB.in_head(n.id,0)),r}static get_default(e){return{id:(0,s.Ak)(),type:a.u0.lost,info:e,css:{},attrs:{}}}static get meta(){return{cubename:"异常方块",type:a.u0.lost,block:!1,version:1,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}const v=["id","data-type"],y=(0,c.pM)({__name:"cube-text",props:{cube:{}},setup(e){function t(){const t=e.cube.postil;t&&t.visible(!t.show)}return(e,n)=>((0,c.uX)(),(0,c.CE)("span",{class:(0,d.C4)(["cube-text",{"text-mark":e.cube.has_postil}]),style:(0,d.Tr)(e.cube.css),onClick:t,id:e.cube.id,"data-type":(0,l.R1)(a.u0).text},(0,d.v_)(e.cube.text),15,v))}}),w=(0,f.A)(y,[["__scopeId","data-v-54fe1fb2"]]);var x=n(5857),k=n(8219);const S=(0,c.pM)({__name:"cube-view",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.Wv)((0,c.$y)(e.cube.component),{cube:(0,l.IG)(e.cube)},null,8,["cube"]))});var C=n(6853);const M=["id","data-type"],T={class:"iconbox"},L=(0,c.pM)({__name:"cube-annotation",props:{cube:{}},setup(e){const t=(0,l.Kh)({fold:!1});function n(){const{courier:t,history:n}=e.cube.root,r=e.cube.pcube,i=e.cube.index,s=new _.vk(t);s.tell(r,o.VL.delete_child(r.id,"backward",[i,i+1])),n.record(s)}function r(){t.fold=!t.fold}return(e,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-annotation",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).annotation},[(0,c.Lk)("div",T,[(0,c.Lk)("div",{class:(0,d.C4)(["iconfont",(0,l.R1)(C.R).icons.fold,t.fold?"annotation-icon-active":""]),onClick:r,title:"折叠批注块"},null,2),(0,c.Lk)("div",{class:"iconfont icon-Delete",onClick:n,title:"删除批注块"})]),t.fold?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("div",{key:0,class:(0,d.C4)(["annotation-contents",{"annotation-fold":t.fold}])},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e,class:"annotation-box"},null,8,["cube"]))),128))],2))],12,M))}}),z=(0,f.A)(L,[["__scopeId","data-v-b157e116"]]);var A=n(346);function P(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class R extends o._D{_component=z;constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get component(){return this._component}get meta(){return R.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=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return R.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return this.is_empty?s.tell(i,o.VL.delete_child(n,a,[r,r+1])):s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],f=this.children[h],m=h-u;let _=this.splice(c,m);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):f&&s.tell(f,o.UB.in_head(f.id,0)):"forward"===a&&(f?s.tell(f,o.UB.in_head(f.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}static get meta(){return{cubename:"批注",type:x.u0.annotation,block:!0,version:1,show:!1}}static get_default(e={},t={}){const n={id:(0,s.Ak)(),type:x.u0.text,info:"",attrs:{},css:{}},r={id:(0,s.Ak)(),type:x.u0.line,info:[n],attrs:{},css:{}},i={id:(0,s.Ak)(),type:x.u0.box,info:[r],attrs:{},css:{}};return{id:(0,s.Ak)(),type:x.u0.annotation,info:[i],css:e,attrs:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;let s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}P([(0,k.H)(a.zS.cube_insert_child)],R.prototype,"on_insert_child",null),P([(0,k.H)(a.zS.cube_delete_child)],R.prototype,"on_delete_child",null),P([(0,k.H)(a.zS.cube_reset)],R.prototype,"on_reset",null);var N=n(1068);const E=["id","data-type"],O={class:"title"},I=(0,c.pM)({__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 n(){e.cube.event.emit_text_link_edit(e.cube)}function r(){const{courier:t,history:n}=e.cube.root,{pcube:r,index:i}=e.cube,s=new _.vk(t);s.tell(r,o.VL.delete_child(r.id,"backward",[i,i+1])),n.record(s)}return(e,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-link",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).link},[(0,c.Lk)("div",O,(0,d.v_)(e.cube.data.info.title),1),(0,c.Lk)("div",{class:"link",onClick:t},(0,d.v_)(e.cube.data.info.url),1),(0,c.Lk)("div",{class:"iconbox"},[(0,c.Lk)("div",{class:"iconfont icon-rename",onClick:n}),(0,c.Lk)("div",{class:"iconfont icon-Delete",onClick:r})])],12,E))}}),B=(0,f.A)(I,[["__scopeId","data-v-2946c9fa"]]);class D{static update(e,t,n){return{id:e,name:a.gS.update,title:t,url:n}}}class V extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return B}get meta(){return V.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 V.replace_id(this.root,e,t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}on_update_info(e){const{courier:t,cursor:n}=this,{url:r,title:i}=e,s=t.get_recorder();s.add_cmd(e);const o=this.info.title,a=this.info.url;return this.info.url=r,this.info.title=i,s.add_recover(D.update(this.id,o,a)),s}static get meta(){return{cubename:"文本链接",type:a.u0.link,block:!0,show:!1,version:1}}static get_default(e,t,n={},r={}){return{id:(0,s.Ak)(),type:a.u0.link,info:{url:e,title:t},css:n,attrs:r}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.gS.update)],V.prototype,"on_update_info",null);const H=["id","data-type"],j=(0,c.pM)({__name:"cube-postil",props:{cube:{}},setup(e){const t=(0,c.EW)(()=>e.cube.children.filter(e=>e instanceof V)),n=(0,c.EW)(()=>e.cube.children.filter(e=>!(e instanceof V))),r=(0,c.EW)(()=>({...e.cube.css}));function i(){e.cube.visible(!1)}function s(){const{courier:t,history:n}=e.cube.root,r=e.cube.pcube,i=new _.vk(t);i.tell(r,o.VL.postil_remove(r.id,[0,e.cube.child_count])),n.record(i)}function u(e){e.preventDefault(),e.stopPropagation();const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const{deltaY:n}=e;n>0?N.DomAnimation.scroll_element(t,20,"vertical"):N.DomAnimation.scroll_element(t,-20,"vertical")}return(e,o)=>e.cube.show?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"cube-postil",style:(0,d.Tr)(r.value),id:e.cube.id,"data-type":(0,l.R1)(a.u0).postil},[(0,c.Lk)("div",{class:"iconbox"},[(0,c.Lk)("div",{class:"iconfont icon-Delete delete",title:"清空",onClick:s}),(0,c.Lk)("div",{class:"iconfont icon-close close",title:"关闭",onClick:i})]),(0,c.Lk)("div",{class:"mark-contents",onWheel:u},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.value,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(n.value,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],32)],12,H)):(0,c.Q3)("v-if",!0)}}),F=(0,f.A)(j,[["__scopeId","data-v-7ca0a800"]]);function U(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class q extends o._D{_handler_update_pos;_handler_corrent;_timer_corrent;_show=(0,l.KR)(!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 R)return!0;return!1}get meta(){return q.meta}get component(){return F}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}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 q.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],f=this.children[h],m=h-u;let _=this.splice(c,m);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):f&&s.tell(f,o.UB.in_head(f.id,0)):"forward"===a&&(f?s.tell(f,o.UB.in_head(f.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}visible(e){if(e){const{courier:e,child_last:t}=this;this.update_pos(),this.show=!0,(0,c.dY)(()=>{const n=e.get_recorder();n.tell(t,o.UB.in_tail(t.id,0)),this.history.record(n)})}else this.show=!1}update_pos(e=!0){(0,c.dY)(()=>{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},r=N.MathRect.move_rect_to_other(n,t,e,5);this.data.css.left=`${r.x}px`,this.data.css.top=`${r.y}px`})}static get_default(e=[],t={}){return{id:(0,s.Ak)(),type:a.u0.postil,info:e,attrs:{},css:t}}static get meta(){return{cubename:"标注内容",type:a.u0.postil,show:!1,version:1,block:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}U([(0,k.H)(a.zS.cube_insert_child)],q.prototype,"on_insert_child",null),U([(0,k.H)(a.zS.cube_delete_child)],q.prototype,"on_delete_child",null),U([(0,k.H)(a.zS.cube_reset)],q.prototype,"on_reset",null);class ${static reset(e,t,n,r){return{id:e,name:a.lm.text_reset,info:t,cursor_after:r,cursor_before:n}}static break(e,t){return{id:e,name:a.lm.text_break,offset:t}}}function G(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class X extends o._D{_component=w;get attrs(){return this.data.attrs}get component(){return this._component}get meta(){return X.meta}get is_empty(){return X.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 gt)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 q(t,this))}gc(){super.base_gc(),this.root.stats.update_count_word(-this.len)}replace_id(e,t={}){return X.replace_id(this.root,e,t)}find_child_cube(e){}export(){return this.base_export()}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}merge_text(e){const{courier:t}=this,n=t.get_recorder(),r=this.prev_cube,i=this.next_cube,s=r instanceof X,a=i instanceof X;if(s&&a){const t=o.VL.merge(this.id,"both",this.id,e);n.tell(this,t)}else if(s){const t=o.VL.merge(this.id,"left",this.id,e);n.tell(this,t)}else if(a){const t=o.VL.merge(this.id,"right",this.id,e);n.tell(this,t)}return n}on_partition(e){const{courier:t,cursor:n,pcube:r}=this,{start_id:i,end_id:s,offset_end:a,offset_start:c}=e,d=this.get_valid_index(c),u=this.get_valid_index(a),h=new _.vk(t),p=this.text.slice(0,d),f=this.text.slice(d,u),m=this.text.slice(u);if(f){const e=X.get_default(f,structuredClone((0,l.ux)(this.css)));if(p){if(p){if(h.tell(this,$.reset(this.id,p,p.length,p.length)),m){const e=X.get_default(m,structuredClone((0,l.ux)(this.css)));h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}}else if(h.tell(this,$.reset(this.id,f,f.length,f.length)),m){const e=X.get_default(m,structuredClone((0,l.ux)(this.css)));h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}return h}if(0===d){const e=X.get_default();h.tell(r,o.VL.insert_child(r.id,[e],this.index))}else if(d===this.len){const e=X.get_default();h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}else if(d>0&&d<this.len){const e=X.get_default(m,structuredClone((0,l.ux)(this.css)));return h.tell(r,o.VL.insert_child(r.id,[e],this.index+1)),h.tell(this,$.reset(this.id,p,p.length,p.length)),h}return h}on_cube_merge(e){const{courier:t,prev_cube:n,pcube:r,next_cube:i,pid:s,index:a}=this,{method:l,offset:c,cubeid:d}=e;let u=this.get_valid_index(c);const h=new _.vk(t);if("left"===l&&n instanceof X&&this.can_merge_with(n)){const e=n.id;h.tell(r,o.VL.delete_child(s,"forward",[a-1,a])),h.tell(this,$.reset(this.id,n.text+this.text,u,u+n.len)),this.event.emit_text_merge(e,this.id)}else if("right"===l&&i instanceof X&&this.can_merge_with(i)){const e=i.id;h.tell(r,o.VL.delete_child(s,"backward",[a+1,a+2])),h.tell(this,$.reset(this.id,this.text+i.text,u,u)),this.event.emit_text_merge(e,this.id)}else if("both"===l)if(n instanceof X&&i instanceof X&&this.can_merge_with(n)&&this.can_merge_with(i)){const e=n.len+u,t=n.id,s=i.id;h.tell(r,o.VL.delete_child(this.pid,"backward",[this.index-1,this.index])),h.tell(r,o.VL.delete_child(this.pid,"backward",[this.index+1,this.index+2])),h.tell(this,$.reset(this.id,n.text+this.text+i.text,u,e)),this.event.emit_text_merge(t,this.id),this.event.emit_text_merge(s,this.id)}else if(n instanceof X&&this.can_merge_with(n)){const e=n.id;h.tell(r,o.VL.delete_child(s,"forward",[a-1,a])),h.tell(this,$.reset(this.id,n.text+this.text,u,u+n.len)),this.event.emit_text_merge(e,this.id)}else if(i instanceof X&&this.can_merge_with(i)){const e=i.id;h.tell(r,o.VL.delete_child(s,"backward",[a+1,a+2])),h.tell(this,$.reset(this.id,this.text+i.text,u,u)),this.event.emit_text_merge(e,this.id)}return h}on_cube_insert(e){const{data:t,start_id:n,end_id:r,offset_end:i,offset_start:s}=e,{courier:a,pid:c,pcube:d}=this,u=new _.vk(a);this.cursor.has_selection;let h=s,p=i;if(h<0&&(h=0),p>this.text.length&&(p=this.text.length),i!==s){const e=o.VL.delete(this.id,"backward",this.id,this.id,s,i,!0);u.tell(this,e)}const f=g.I.pick(t),m=this.text.slice(0,h),b=this.text.slice(p);if(f.head.length>0)if(m)if(m&&b){u.tell(this,$.reset(this.id,m,m.length,m.length));const e=X.get_default(b,structuredClone((0,l.ux)(this.css)),structuredClone((0,l.ux)(this.attrs)));u.tell(d,o.VL.insert_child(c,[e],this.index+1)),u.tell(d,o.VL.insert_child(c,f.head,this.index+1))}else b||u.tell(d,o.VL.insert_child(c,f.head,this.index+1));else u.tell(d,o.VL.insert_child(c,f.head,this.index));const v=[...f.body];if(f.tail.length>0&&v.push(gt.get_default(f.tail)),f.root.length>0)for(let e of f.root)v.push(...e.info);if(v.length>0){if(0===f.head.length&&i>0&&i<this.len){u.tell(this,$.reset(this.id,m,m.length,m.length));const e=X.get_default(b,structuredClone((0,l.ux)(this.css)),structuredClone((0,l.ux)(this.attrs)));u.tell(d,o.VL.insert_child(c,[e],this.index+1))}u.tell(d,o.VL.insert_child(this.pid,v,this.index+f.head.length+1))}return u}on_cube_delete(e){const{courier:t,index:n,pcube:r,pid:i}=this,{dir:s,start_id:a,end_id:l,offset_start:c,offset_end:d,reserve:u}=e,h=new _.vk(t),p=this.get_valid_index(c),f=this.get_valid_index(d),m=p!==f||"head"===c||"tail"===d;if(0===p&&f===this.len)return u?h.tell(this,$.reset(this.id,"",this.len,1)):h.tell(r,o.VL.delete_child(i,"backward",[n,n+1])),h;const g=this.text.slice(0,p),b=this.text.slice(f);if(m)h.tell(this,$.reset(this.id,g+b,f,p));else{const e=p;if("backward"===s)if(0===e||0===X.drop_zero_width_space(this.text,p).pos)if(this.pcube.is_empty&&this.pcube instanceof o._D)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,o.VL.delete_adjacent(e.id,"right",this.id,0))}else if(this.is_empty)h.tell(r,o.VL.delete_child(i,"backward",[n,n+1]));else{const e=this.find_text_deleted(p,"left");h.tell(this,$.reset(this.id,e.text,g.length,e.pos)),e.text&&h.tell(this,o.VL.merge(this.id,"both",this.id,g.length-1))}else if("forward"===s)if(e===this.len||e===X.drop_zero_width_space(this.text,p).len)if(this.pcube.is_empty&&this.pcube instanceof o._D)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,o.VL.delete_adjacent(e.id,"left",this.id,this.len))}else if(this.is_empty)h.tell(r,o.VL.delete_child(i,"forward",[n,n+1]));else{const t=this.find_text_deleted(e,"right");h.tell(this,$.reset(this.id,t.text,g.length,g.length)),h.tell(this,o.VL.merge(this.id,"both",this.id,g.length))}}return h}on_text_reset(e){const{courier:t,pid:n,index:r,pcube:i,len:s}=this,{info:a,cursor_after:l,cursor_before:c}=e,d=t.get_recorder();d.add_cmd(e);let u=this.text;!a&&this.is_empty;const h=X.drop_zero_intelligence(a,l);return this.data.info=h.text,this.root.stats.update_count_word(h.len-s),d.tell(this,o.UB.in_head(this.id,h.pos)),d.add_recover($.reset(this.id,u,h.pos,c)),d}on_cube_set_selection_css(e){const{courier:t,pid:n,pcube:r}=this,{css:i,start_id:s,end_id:a,offset_start:c,offset_end:d,toggle:u,replace:h}=e;if(0===Object.keys(i).length&&!h)return;const p=new _.vk(t),f=this.get_valid_index(c),m=this.get_valid_index(d),g=X.drop_zero_width_space(this.text.slice(0,f),0).text,b=X.drop_zero_width_space(this.text.slice(f,m),0).text,v=X.drop_zero_width_space(this.text.slice(m),0).text;if(0===f&&m===this.len||f===m&&s===a)p.tell(this,o.VL.set_css(this.id,i,u,h)),p.tell(this,o.VL.merge(this.id,"both",this.id,m));else if(0===f&&b){const e=structuredClone((0,l.ux)(this.css));if(p.tell(this,$.reset(this.id,b,m,m)),p.tell(this,o.VL.set_css(this.id,i,u,h)),v){const t=X.get_default(v,e);p.tell(r,o.VL.insert_child(n,[t],this.index+1));const i=r.find_cube(t.id);i&&p.tell(i,o.VL.merge(t.id,"both",t.id,0))}p.tell(this,o.UB.in_tail(this.id,0)),p.tell(this,o.VL.merge(this.id,"left",this.id,this.len))}else if(f>0){if(g&&(p.tell(this,$.reset(this.id,g,f,f)),p.tell(this,o.VL.merge(this.id,"left",this.id,m))),v){const e=X.get_default(v,structuredClone((0,l.ux)(this.css))),t=[e];p.tell(r,o.VL.insert_child(n,t,this.index+1));const i=r.find_cube(e.id);i&&p.tell(i,o.VL.merge(i.id,"right",i.id,0))}if(b){const e=X.get_default(b,structuredClone((0,l.ux)(this.css)));p.tell(r,o.VL.insert_child(n,[e],this.index+1));const t=r.find_cube(e.id);t&&(p.tell(t,o.VL.set_css(e.id,i,u,h)),p.tell(t,o.VL.merge(e.id,"both",e.id,g.length+f)))}}return p}on_cube_break(e){const{courier:t,cursor:n,pcube:r,pid:i,index:s}=this,a=r.pcube;if(!a)return;const{offset:l}=e;let c=s+1;const d=new _.vk(t),u=this.text[l-1],h=this.text[l];let p=l,f=!1;if(u){const e=u.charCodeAt(0);55296<=e&&e<=56319&&(f=!0)}if(h&&!f){const e=h.charCodeAt(0);56320<=e&&e<=57343&&(f=!0)}f&&(p+=1),d.tell(this,o.VL.partition(this.id,this.id,this.id,p,p));const m=[];for(let e of r.children.slice(c))m.push(e.export());d.tell(r,o.VL.delete_child(r.id,"backward",[c,r.child_count]));const g=gt.get_default(m),b=this.line;b&&b.inherit_line([g]),d.tell(a,o.VL.insert_child(a.id,[g],r.index+1));const v=r.next_cube;return v?.id===g.id&&d.tell(v,o.UB.in_head(v.id,0,void 0)),d}on_cube_delete_adjacent(e){const{courier:t,pcube:n}=this,{from:r,from_id:i,offset:s}=e,a=new _.vk(t);if("left"===r)if(this.is_empty)a.merge(this.remove_self());else{const e=this.prev_cube_deep;e?.meta.block?a.tell(this,o.UB.in_head(this.id,0)):a.tell(this,o.VL.delete(this.id,"forward",this.id,this.id,0,0))}else if(this.is_empty)a.merge(this.remove_self());else{const e=this.next_cube_deep;e?.meta.block?a.tell(this,o.UB.in_tail(this.id,0)):a.tell(this,o.VL.delete(this.id,"backward",this.id,this.id,this.len,this.len))}return a}add_link(e,t){const{cursor:n,courier:r}=this,i=r.get_recorder(),s=V.get_default(t,e);return i.tell(this,o.VL.postil_add(this.id,[s])),i}add_annotation(e){const t=this.courier.get_recorder(),n=e||R.get_default();return t.tell(this,o.VL.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);(0,c.dY)(()=>{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);(0,c.dY)(()=>{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 r=e;if(e<0&&(r=0),e>n.length&&(r=n.length),"left"===t){let e=r-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=r+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),r=this.text.slice(0,n),i=this.text.slice(e),s=r[r.length-1];if(s){const t=s.charCodeAt(0);55296<=t&&t<=56319&&(r=r.slice(0,-1),e-=1)}return{text:r+i,pos:n}}{let n=this.find_text_nav_pos(e,t),r=this.text.slice(0,e),i=this.text.slice(n),s=i[0];if(s){const e=s.charCodeAt(0);56320<=e&&e<=57343&&(i=i.slice(1))}return{text:r+i,pos:e}}}is_text_remain(e,t){if(0===this.len)return!1;const[n,r]=t;if(n===r)return"backward"===e?0!==this.find_text_nav_pos(n,"left")||this.find_text_nav_pos(r-1,"right")!==this.len:this.find_text_nav_pos(n,"right")!==this.len||0!==this.find_text_nav_pos(n,"left");{if(0===n&&r===this.len)return!1;const e=this.find_text_nav_pos(n+1,"left"),t=this.find_text_nav_pos(r-1,"right");return e>0||t<this.len}}drop_zero_width_space(e){return X.drop_zero_width_space(this.text,e)}can_merge_with(e){const t=g.I.is_same_style(this.css,e.css)||0===Object.keys(e.css).length,n=g.I.is_same_attrs(this.attrs,e.attrs),r=!this.postil&&!e.postil;return t&&n&&r}static drop_zero_width_space(e,t){let n="",r=t;r<0&&(r=0),r>e.length&&(r=e.length);const i=e.slice(0,r),s=e.slice(r);if(i){for(let e of i)""!==e&&(n+=e);r=n.length}if(s)for(let e of s)""!==e&&(n+=e);return{text:n,pos:r,get len(){return this.text.length}}}static drop_zero_intelligence(e,t){let n="",r=t;r<0&&(r=0),r>e.length&&(r=e.length);const i=e.slice(0,r),s=e.slice(r);if(i){for(let e=0;e<i.length;e++){let t=i[e],r=i[e-1];""===t&&"\n"!==r||(n+=t)}r=n.length}if(s)for(let e=0;e<s.length;e++){let t=s[e],r=s[e-1];""===t&&"\n"!==r||(n+=t)}return n||(n="",r=1),{text:n,pos:r,get len(){return this.text.length}}}static is_empty_text(e){if(e.type!==x.u0.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:x.u0.text,cubename:"文本",block:!1,show:!1}}static get_default(e="",t={},n={}){const r=e||"";return{id:(0,s.Ak)(),type:x.u0.text,info:r,css:structuredClone((0,l.ux)(t)),attrs:structuredClone((0,l.ux)(n))}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,e.event.emit_replace_id(r,i),t}}G([(0,k.H)(a.zS.cube_partition)],X.prototype,"on_partition",null),G([(0,k.H)(a.zS.cube_merge)],X.prototype,"on_cube_merge",null),G([(0,k.H)(a.zS.cube_insert)],X.prototype,"on_cube_insert",null),G([(0,k.H)(a.zS.cube_delete)],X.prototype,"on_cube_delete",null),G([(0,k.H)(a.lm.text_reset)],X.prototype,"on_text_reset",null),G([(0,k.H)(a.zS.cube_set_selection_css)],X.prototype,"on_cube_set_selection_css",null),G([(0,k.H)(a.lm.text_break)],X.prototype,"on_cube_break",null),G([(0,k.H)(a.zS.cube_delete_adjacent)],X.prototype,"on_cube_delete_adjacent",null);const K=["id","data-type","contenteditable"],W=(0,c.pM)({__name:"cube-line",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["cube-line",{"line-first-letter-lower":e.cube.attrs.first_letter_lower}]),id:e.cube.id,"data-type":(0,l.R1)(a.u0).line,style:(0,d.Tr)(e.cube.css),contenteditable:e.cube.editable,spellcheck:"false"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],14,K))}),Y=(0,f.A)(W,[["__scopeId","data-v-f72cf81e"]]);let Z;const Q="undefined"!=typeof window&&window.trustedTypes;if(Q)try{Z=Q.createPolicy("vue",{createHTML:e=>e})}catch(e){}const J=Z?e=>Z.createHTML(e):e=>e,ee="undefined"!=typeof document?document:null,te=ee&&ee.createElement("template"),ne={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i="svg"===t?ee.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?ee.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?ee.createElement(e,{is:n}):ee.createElement(e);return"select"===e&&r&&null!=r.multiple&&i.setAttribute("multiple",r.multiple),i},createText:e=>ee.createTextNode(e),createComment:e=>ee.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ee.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,s){const o=n?n.previousSibling:t.lastChild;if(i&&(i===s||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==s&&(i=i.nextSibling););else{te.innerHTML=J("svg"===r?`<svg>${e}</svg>`:"mathml"===r?`<math>${e}</math>`:e);const i=te.content;if("svg"===r||"mathml"===r){const e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},re=Symbol("_vtc");Boolean;c.QP;const ie=Symbol("_vod"),se=Symbol("_vsh"),oe=Symbol(""),ae=/(?:^|;)\s*display\s*:/,le=/\s*!important$/;function ce(e,t,n){if((0,d.cy)(n))n.forEach(n=>ce(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=function(e,t){const n=ue[t];if(n)return n;let r=(0,d.PT)(t);if("filter"!==r&&r in e)return ue[t]=r;r=(0,d.ZH)(r);for(let n=0;n<de.length;n++){const i=de[n]+r;if(i in e)return ue[t]=i}return t}(e,t);le.test(n)?e.setProperty((0,d.Tg)(r),n.replace(le,""),"important"):e[r]=n}}const de=["Webkit","Moz","ms"],ue={},he="http://www.w3.org/1999/xlink";function pe(e,t,n,r,i,s=(0,d.J$)(t)){r&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(he,t.slice(6,t.length)):e.setAttributeNS(he,t,n):null==n||s&&!(0,d.Y2)(n)?e.removeAttribute(t):e.setAttribute(t,s?"":(0,d.Bm)(n)?String(n):n)}function fe(e,t,n,r,i){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?J(n):n));const s=e.tagName;if("value"===t&&"PROGRESS"!==s&&!s.includes("-")){const r="OPTION"===s?e.getAttribute("value")||"":e.value,i=null==n?"checkbox"===e.type?"on":"":String(n);return r===i&&"_value"in e||(e.value=i),null==n&&e.removeAttribute(t),void(e._value=n)}let o=!1;if(""===n||null==n){const r=typeof e[t];"boolean"===r?n=(0,d.Y2)(n):null==n&&"string"===r?(n="",o=!0):"number"===r&&(n=0,o=!0)}try{e[t]=n}catch(e){}o&&e.removeAttribute(i||t)}function me(e,t,n,r){e.addEventListener(t,n,r)}const _e=Symbol("_vei");const ge=/(?:Once|Passive|Capture)$/;let be=0;const ve=Promise.resolve(),ye=()=>be||(ve.then(()=>be=0),be=Date.now()),we=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 xe=e=>{const t=e.props["onUpdate:modelValue"]||!1;return(0,d.cy)(t)?e=>(0,d.DY)(t,e):t};function ke(e){e.target.composing=!0}function Se(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ce=Symbol("_assign"),Me={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[Ce]=xe(i);const s=r||i.props&&"number"===i.props.type;me(e,t?"change":"input",t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),s&&(r=(0,d.bB)(r)),e[Ce](r)}),n&&me(e,"change",()=>{e.value=e.value.trim()}),t||(me(e,"compositionstart",ke),me(e,"compositionend",Se),me(e,"change",Se))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[Ce]=xe(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:(0,d.bB)(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(r&&t===n)return;if(i&&e.value.trim()===a)return}e.value=a}}},Te=(0,d.X$)({patchProp:(e,t,n,r,i,s)=>{const o="svg"===i;"class"===t?function(e,t,n){const r=e[re];r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,o):"style"===t?function(e,t,n){const r=e.style,i=(0,d.Kg)(n);let s=!1;if(n&&!i){if(t)if((0,d.Kg)(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&ce(r,t,"")}else for(const e in t)null==n[e]&&ce(r,e,"");for(const e in n)"display"===e&&(s=!0),ce(r,e,n[e])}else if(i){if(t!==n){const e=r[oe];e&&(n+=";"+e),r.cssText=n,s=ae.test(n)}}else t&&e.removeAttribute("style");ie in e&&(e[ie]=s?r.display:"",e[se]&&(r.display="none"))}(e,n,r):(0,d.Mp)(t)?(0,d.CP)(t)||function(e,t,n,r,i=null){const s=e[_e]||(e[_e]={}),o=s[t];if(r&&o)o.value=r;else{const[n,a]=function(e){let t;if(ge.test(e)){let n;for(t={};n=e.match(ge);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):(0,d.Tg)(e.slice(2)),t]}(t);if(r){const o=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();(0,c.qL)(function(e,t){if((0,d.cy)(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=ye(),n}(r,i);me(e,n,o,a)}else o&&(function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,o,a),s[t]=void 0)}}(e,t,0,r,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,r){if(r)return"innerHTML"===t||"textContent"===t||!!(t in e&&we(t)&&(0,d.Tn)(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(!we(t)||!(0,d.Kg)(n))&&t in e}(e,t,r,o))?(fe(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||pe(e,t,r,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&(0,d.Kg)(r)?("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),pe(e,t,r,o)):fe(e,(0,d.PT)(t),r,0,t)}},ne);let Le;const ze=(...e)=>{const t=(Le||(Le=(0,c.K9)(Te))).createApp(...e),{mount:n}=t;return t.mount=e=>{const r=function(e){if((0,d.Kg)(e))return document.querySelector(e);return e}(e);if(!r)return;const i=t._component;(0,d.Tn)(i)||i.render||i.template||(i.template=r.innerHTML),1===r.nodeType&&(r.textContent="");const s=n(r,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t};function Ae(e,t){if(t.freeze)return;e.preventDefault(),e.stopPropagation();const{doc:n,stats:r}=t,{deltaY:i,currentTarget:s}=e,o=t.config.data.revert_scope;i>0&&!o?t.expand("down"):t.expand("up")}const Pe={class:"iconbox"},Re=(0,c.pM)({__name:"note-scope",props:{selection:{}},setup(e){const t=(0,c.EW)(()=>{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=(0,c.EW)(()=>{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 r(){e.selection.freeze=!e.selection.freeze}function i(t,n,r){t.stopPropagation();const{root:i}=e.selection,s=new _.vk(i.courier),a=n.get_scope_info(),l=a.cube.children[a.range[0]],c=a.cube.children[a.range[1]-1];if("A"===r&&c)if(c instanceof pt){const e=pt.get_default();s.tell(a.cube,o.VL.insert_child(a.cube.id,[e],c.index+1))}else{const e=gt.get_default(),t=o.VL.insert_child(a.cube.id,[e],c.index+1);s.tell(a.cube,t)}else if("B"===r&&l)if(l instanceof pt){const e=pt.get_default();s.tell(a.cube,o.VL.insert_child(a.cube.id,[e],l.index))}else{const e=gt.get_default(),t=o.VL.insert_child(a.cube.id,[e],l.index);s.tell(a.cube,t)}i.history.record(s)}function s(t){t.preventDefault(),t.stopPropagation(),e.selection.remove()}return(e,o)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["doc-scope",{freeze:e.selection.freeze}]),style:(0,d.Tr)(e.selection.css),onWheel:o[3]||(o[3]=t=>(0,l.R1)(Ae)(t,e.selection)),onClick:r,onContextmenu:s},[(0,c.Lk)("div",Pe,[(0,c.Lk)("div",{class:"iconfont icon-a-copy",style:(0,d.Tr)(n.value),title:"在上方插入行",onClick:o[0]||(o[0]=t=>i(t,e.selection,"A"))},null,4),(0,c.Lk)("div",{class:"iconfont icon-force_vortex-copy",title:"取消选区",style:(0,d.Tr)(t.value),onClick:o[1]||(o[1]=()=>e.selection.remove())},null,4),(0,c.Lk)("div",{class:"iconfont icon-B-copy",style:(0,d.Tr)(n.value),title:"在上方插入行",onClick:o[2]||(o[2]=t=>i(t,e.selection,"B"))},null,4)])],38))}}),Ne=(0,f.A)(Re,[["__scopeId","data-v-bdec0da6"]]);var Ee=n(4031);class Oe extends Ee.K{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_doc_input_before(e).some(e=>"stop"===e))return;e.preventDefault();const{courier:t,cursor:n,history:r}=this,i=e.data,{cube_end:s,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n;if(!l||!s||!a)return;const u=a.id,h=s.id,p=l.id;if("insertText"===e.inputType){if(!(l instanceof X&&i)){const e=t.get_recorder(),n=X.get_default(i||""),s=o.VL.insert(p,[n],u,h,c,d);return e.tell(l,s),r.record(e)}{const e=t.get_recorder();this.ins(e,this.root,i,l,c,d),r.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 i=o.VL.delete(p,t,u,h,c,d);return n.tell(l,i),r.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){}compositionend(e){const{courier:t,cursor:n,history:r,stats:i,event:s}=this.root;if(n.has_selection)return;if(!i.in_composition_mode)return;const{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n,u=e.data,h=new _.vk(t);if(l&&o&&a){if(l instanceof X){const e=l.text,t=d-u.length,n=`${e.slice(0,t)}${u}${e.slice(t)}`,r=$.reset(l.id,n,t,d);h.tell(l,r)}else console.error("编辑目标无法在内存结构中找到,此问题多由于未将子cube计算到children属性");i.in_composition_mode=!1,r.record(h),s.emit_doc_input_compositionend(e)}}clear_selection_text(){const{cursor:e,courier:t,history:n}=this;if(!e.has_selection)return;const{cube_end:r,cube_start:i,cube_selection:s,offset_start:a,offset_end:l}=e;if(!s||!r||!i)return;const c=new _.vk(t);c.tell(s,o.VL.delete(s.id,"backward",i.id,r.id,a,l)),n.record(c)}ins(e,t,n,r,i,s){const{courier:a,history:l}=t,c=r.text,d=c.slice(0,i)+n+c.slice(s),u=i+n.length,h=$.reset(r.id,d,i,u);e.tell(r,h);const p=o.VL.merge(r.id,"both",r.id,u);return e.tell(r,p),e}click_selection_text(e){if(!this.down_caret||!e.shiftKey)return;const{offset_end:t,node_end:n}=this.cursor,{offset:r,offsetNode:i}=this.down_caret;n instanceof Text&&i instanceof Text&&Promise.resolve().then(()=>{this.cursor.set_selection_between(n,t,i,r)})}drag_selection_text(e){if(!this.has_down||!this.down_caret||!g.I.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 Ie extends Oe{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:r}=t,i=e.dataTransfer;if(!i)return;const s=new DOMParser,o=i.getData("text/plain"),a=i.getData("text/html"),l=i.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:r}=this.cursor;if(!(r instanceof X))return;this.ins(e,this._root,o,r,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:r}=this.root,i=this.root.child_last;if(i&&i.is_empty){let e=i;for(;e;){if(e instanceof X){e.line?.dom?.focus(),e.set_cursor_in_tail();break}e=e.child_last}}else{const e=new _.vk(t),n=pt.get_default();e.tell(this.root,o.VL.insert_child(this.root.id,[n],this.root.child_count)),r.record(e)}}}class Be extends Oe{}var De=n(1742),Ve=n(8984);const He={class:"dialog-form"},je={class:"form-grid"},Fe={class:"label"},Ue=["onUpdate:modelValue"],qe=(0,c.pM)({__name:"menu-dialog",setup(e){const t=(0,l.KR)();function n(){const e=t.value;e&&(De.Bz.open=!1,e.close())}function r(){n(),De.Bz.submit(De.Bz.data)}return(0,c.wB)(()=>De.Bz.open,()=>{const e=t.value;e&&(De.Bz.open?e.showModal():e.close())}),(e,i)=>((0,c.uX)(),(0,c.CE)("dialog",{class:"menu-dialog",ref_key:"root",ref:t,onClose:n},[(0,c.Lk)("div",He,[(0,c.Lk)("div",{class:"close-corner",onClick:n}),(0,c.Lk)("div",je,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(Object.keys((0,l.R1)(De.Bz).data),e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e},[(0,c.Lk)("div",Fe,(0,d.v_)(e),1),(0,c.bo)((0,c.Lk)("input",{type:"text",autofocus:"","onUpdate:modelValue":t=>(0,l.R1)(De.Bz).data[e]=t},null,8,Ue),[[Me,(0,l.R1)(De.Bz).data[e]]])],64))),128))]),(0,c.Lk)("div",{class:"dialog-submit",onClick:r},"确认")])],544))}}),$e=(0,f.A)(qe,[["__scopeId","data-v-13d4fd0e"]]),Ge={class:"menu-title iconfont icon-sp"},Xe=["onPointerdown","onMouseenter"],Ke={class:"item-shortcut"},We={key:0,class:"iconfont icon-arrow-right"},Ye={class:"menu-title iconfont icon-sp"},Ze=["onPointerdown","onMouseenter"],Qe={class:"item-shortcut"},Je={key:0,class:"iconfont icon-arrow-right"},et=(0,c.pM)({__name:"note-menu",props:{root:{}},setup(e){const t=(0,l.KR)(),n=(0,l.KR)([]);function r(e,t=!1){t?(De.h_.stack_menus.length=e,De.h_.stack_rect.length=e,De.h_.menu=void 0):(De.h_.stack_menus.length=e,De.h_.stack_rect.length=e)}function i(e,t,n){if(r(t),!n.has_submenu)return;const i=e.currentTarget;De.h_.stack_rect.push(i.getBoundingClientRect());const s=n.mouseenter(e);De.h_.stack_menus.push(s)}function s(e,t){r(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(0,c.wB)(()=>De.h_.point,async()=>{const e=t.value;if(!e)return;await(0,c.dY)(),De.h_.stack_pos.length=0;const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},r=e.getBoundingClientRect(),i={x:De.h_.point.x,y:De.h_.point.y,width:0,height:0},s=N.MathRect.move_rect_to_other(n,r,i);De.h_.css={left:s.x+"px",top:s.y+"px"}}),(0,c.wB)(De.h_.stack_menus,async()=>{await(0,c.dY)();const e=n.value;if(!e)return;De.h_.stack_pos.length=0;const t={x:0,y:0,width:window.innerWidth,height:window.innerHeight};for(let n=0;n<De.h_.stack_menus.length;n++){const r=De.h_.stack_rect[n],i=e[n].getBoundingClientRect(),s=(0,Ve.LU)(t,i,r);De.h_.stack_pos.push({left:s.x+"px",top:s.y+"px"})}}),(0,c.sV)(()=>{document.documentElement.addEventListener("pointerdown",e=>{const n=t.value;if(!n)return;const r=e.target;r&&!n.contains(r)&&(De.h_.menu=void 0,De.h_.stack_menus.length=0,De.h_.stack_pos.length=0,De.h_.stack_rect.length=0)},{capture:!0})}),(e,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"note-menus",style:(0,d.Tr)((0,l.R1)(De.h_).css),ref_key:"dom",ref:t,onWheel:a},[(0,c.Q3)(" 弹窗 "),(0,c.bF)($e),(0,c.Q3)(" 主菜单列表 "),(0,l.R1)(De.h_).menu?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"menu-list",ref_key:"ms",ref:n},[(0,c.Lk)("div",Ge,(0,d.v_)((0,l.R1)(De.h_).menu.title),1),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(De.h_).menu.menus,e=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["menu-item",{"active-item":(0,l.R1)(De.h_).menu.active.includes(e.title)}]),style:(0,d.Tr)(o(e)),key:e.title,onPointerdown:t=>s(t,e),onMouseenter:t=>i(t,0,e)},[(0,c.Lk)("div",{class:(0,d.C4)(["item-title",e.icon])},(0,d.v_)(e.title),3),(0,c.Lk)("div",Ke,(0,d.v_)(e.shortcut),1),e.has_submenu?((0,c.uX)(),(0,c.CE)("div",We)):(0,c.Q3)("v-if",!0)],46,Xe))),128))],512)):(0,c.Q3)("v-if",!0),(0,c.Q3)(" 子菜单列表 "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(De.h_).stack_menus,(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"submenu-list",ref_for:!0,ref_key:"ms",ref:n,style:(0,d.Tr)((0,l.R1)(De.h_).stack_pos[t])},[(0,c.Lk)("div",Ye,(0,d.v_)(e.title),1),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.menus,n=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["menu-item",{"active-item":e.active.includes(n.title)}]),style:(0,d.Tr)(o(n)),key:n.title,onPointerdown:e=>s(e,n),onMouseenter:e=>i(e,t+1,n)},[(0,c.Lk)("div",{class:(0,d.C4)(["item-title",n.icon])},(0,d.v_)(n.title),3),(0,c.Lk)("div",Qe,(0,d.v_)(n.shortcut),1),n.has_submenu?((0,c.uX)(),(0,c.CE)("div",Je)):(0,c.Q3)("v-if",!0)],46,Ze))),128))],4))),256))],36))}}),tt=(0,f.A)(et,[["__scopeId","data-v-355daac8"]]),nt=["id","data-type"],rt={class:"doc-postils"},it=(0,c.pM)({__name:"cube-doc",props:{cube:{}},setup(e){const t=e.cube,{config:n}=e.cube,r=new Ie(t),i=e=>r.pointerdown(e),s=e=>r.pointermove(e),o=e=>r.pointerup(e),u=e=>r.pointercancel(e),h=e=>r.handler_click_foot(e),p=e=>r.compositionstart(e),f=e=>r.compositionupdate(e),m=e=>r.compositionend(e),_=e=>r.beforeinput(e),g=e=>r.dragover(e),b=e=>r.dragenter(e),v=e=>r.dragleave(e),y=e=>r.drop(e);return(0,c.sV)(()=>{document.documentElement.addEventListener("pointerup",o),document.documentElement.addEventListener("pointermove",s),document.documentElement.addEventListener("pointercancel",u)}),(e,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-doc",id:(0,l.R1)(t).id,"data-type":(0,l.R1)(a.u0).doc,style:(0,d.Tr)((0,l.R1)(n).css_vars),onDragover:g,onDragenter:b,onDragleave:v,onDrop:y},[(0,c.Lk)("div",{class:"note",onPointerdown:i,onCompositionstart:p,onCompositionupdate:f,onCompositionend:m,onBeforeinput:_},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)((0,c.$y)(e.component),{key:e.id,cube:e,id:e.id},null,8,["cube","id"]))),128)),(0,c.Q3)(" doc-cubes "),(0,c.Lk)("div",rt,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).cubes.postils,([e,t])=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t},null,8,["cube"]))),128))]),(0,c.Q3)(" footer "),(0,c.Lk)("div",{class:"cube-doc-footer",onPointerdown:h},null,32)],32),(0,c.Q3)(" scope selection "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).scope,e=>((0,c.uX)(),(0,c.Wv)(Ne,{key:e.id,selection:(0,l.IG)(e)},null,8,["selection"]))),128)),(0,c.Q3)(" menus "),(0,c.bF)(tt,{root:e.cube},null,8,["root"])],44,nt))}}),st=(0,f.A)(it,[["__scopeId","data-v-728e5342"]]);var ot=n(1445),at=n(122);const lt=["id","data-type"],ct={class:"cube-box-root-content"},dt=(0,c.pM)({__name:"cube-box-root",props:{cube:{}},setup(e){const t=e.cube,{stats:n}=e.cube,r=(0,c.EW)(()=>({opacity:(e.cube.child_count+10)/60})),i=e=>(0,ot.bQ)(e,t),s=e=>(0,ot.dw)(e,t),o=e=>(0,ot.AG)(e,t),u=e=>(0,ot.o)(e,t),h=e=>(0,ot.pn)(e,t),p=e=>(0,ot.gV)(e,t),f=e=>(0,ot.M3)(e,t),m=e=>(0,ot._V)(e,t);function _(e){const{stats:t}=e;return{"anchor-root":t.anchor_root_id===e.id,"fold-root":e.attrs.fold}}return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box-root",style:(0,d.Tr)((0,l.R1)(t).css),draggable:"true",id:e.cube.id,"data-type":(0,l.R1)(a.u0).box_root,onContextmenu:n[2]||(n[2]=t=>(0,l.R1)(at.uz)(t,e.cube)),onFocusin:m,onDragstart:i,onDragenter:s,onDrop:o,onDragend:u,onDragover:h,onDragleave:p,onPointerdown:f},[(0,c.Lk)("div",{class:(0,d.C4)(["cube-dragger",_(e.cube)]),style:(0,d.Tr)(r.value),onClick:n[0]||(n[0]=t=>(0,l.R1)(ot.KS)(t,e.cube)),onContextmenu:n[1]||(n[1]=t=>(0,l.R1)(ot.kE)(t,e.cube)),"data-tag":"cube-box-root-dragger"},null,38),(0,c.Lk)("div",ct,[e.cube.attrs.fold?((0,c.uX)(),(0,c.Wv)(S,{key:0,cube:e.cube.child_first},null,8,["cube"])):((0,c.uX)(!0),(0,c.CE)(c.FK,{key:1},(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:(0,l.IG)(e)},null,8,["cube"]))),128))])],44,lt))}}),ut=(0,f.A)(dt,[["__scopeId","data-v-76631106"]]);function ht(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class pt extends o._D{_component=ut;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 this._component}get meta(){return pt.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof gt&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return pt.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:r,from_id:i}=e,s=new _.vk(t);return"left"===n?this.prev_cube_deep instanceof pt?s.tell(this,o.VL.merge(this.id,"left",i,r)):s.tell(this,o.UB.in_head(this.id,0)):"right"===n&&(this.next_cube_deep instanceof pt?s.merge(this.on(o.VL.merge(this.id,"right",i,r))):s.tell(this,o.UB.in_tail(this.id,0))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof pt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof pt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof pt&&r instanceof pt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof pt&&!(r instanceof pt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof pt)&&r instanceof pt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_cube_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){const e=this.children[0];if(1===this.child_count&&e instanceof X&&e.is_empty)return;const t=this.export().info,n=new gt(gt.get_default(),this);this.splice(0,this.child_count,n),r.add_recover(o.VL.reset(this.id,t)),r.tell(n,o.UB.in_tail(n.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;let s=this.get_valid_index(n);const a=g.I.pick(r,!0),l=g.I.build_cubes(a.sort,this);this.splice(s,0,...l),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+l.length]));const c=l[l.length-1],d=this.children[s+1];return c?i.tell(c,o.UB.in_tail(c.id,0)):i.tell(d,o.UB.in_head(d.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count&&!l){if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));return c}{const e=this.children[h-1],t=this.children[p],n=p-h;let r=this.splice(d,n);c.add_recover(o.VL.insert_child(this.id,r.data,d)),"backward"===s?e?c.tell(e,o.UB.in_tail(e.id,0)):t&&c.tell(t,o.UB.in_head(t.id,0)):"forward"===s&&(t?c.tell(t,o.UB.in_head(t.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}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=>!X.is_empty_text(e))}static get meta(){return{type:a.u0.box_root,cubename:"根级块",version:1,block:!0,show:!1}}static get_default(e=[],t={},n={fold:!1}){const r=0===e.length?[gt.get_default()]:e;return{id:g.I.get_id(),type:a.u0.box_root,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}ht([(0,k.H)(a.zS.cube_delete_adjacent)],pt.prototype,"on_cube_delete_adjacent",null),ht([(0,k.H)(a.zS.cube_merge)],pt.prototype,"on_merge",null),ht([(0,k.H)(a.zS.cube_reorder)],pt.prototype,"on_cube_reorder",null),ht([(0,k.H)(a.zS.cube_reset)],pt.prototype,"on_cube_reset",null),ht([(0,k.H)(a.zS.cube_insert_child)],pt.prototype,"on_insert_child",null),ht([(0,k.H)(a.zS.cube_delete_child)],pt.prototype,"on_delete_child",null);class ft{}class mt extends o.MR{_app;data;constructor(e){super();const t=this.update_data(e).data;this.data=(0,l.Kh)(t),this.build_child(t),k.o.init_cmd_handler(this),A.K.add_doc(this),this._app=ze(st,{cube:this})}get domain(){return"doc"}get app(){return this._app}get component(){return st}get meta(){return mt.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=g.I.build_cubes(e.info,this);return this._children.push(...t),t}gc(){}export(){const e=(0,l.ux)(this.data);e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return e.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return mt.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:a.u0.doc,cubename:"文档",version:1,block:!0,show:!1}}static get_default(){return pt.get_default(),{id:(0,s.Ak)(),type:a.u0.doc,versions:A.K.export_versions(),info:[],css:{},attrs:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}function _t(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class gt extends o._D{_component=Y;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 gt.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 X)return e}get child_last_text(){for(let e of[...this._children].reverse())if(e instanceof X)return e}get next_line(){let e=this.next_cube_deep;for(;e;){if(e instanceof mt)return;let t=g.I.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 mt)return;let t=g.I.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 r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return gt.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 r=n.attrs.indent||0;n.attrs.indent=e+r-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:r,index:i,pid:s,pcube:a}=this,{method:l,cubeid:c,offset:d}=e,u=new _.vk(t);if("left"===l&&n instanceof gt){const e=this.export().info,t=g.I.filter_out_empty(e);u.tell(n,o.VL.insert_child(n.id,t,"tail")),u.tell(a,o.VL.delete_child(this.pid,"forward",[i,i+1]));const r=n.find_child_cube(c);r&&u.tell(r,o.UB.in_head(c,d))}else if("right"===l&&r instanceof gt){const e=r.export().info,t=g.I.filter_out_empty(e);u.tell(this,o.VL.insert_child(this.id,t,"tail")),u.tell(a,o.VL.delete_child(s,"backward",[i+1,i+2]));const n=this.find_child_cube(c);n&&u.tell(n,o.UB.in_head(c,d))}else if("both"===l)if(n instanceof gt&&r instanceof gt){const e=g.I.filter_out_empty(this.export().info),t=g.I.filter_out_empty(r.export().info);u.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),u.tell(a,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_child_cube(c);i&&u.tell(i,o.UB.in_head(c,d))}else if(n instanceof gt&&!(r instanceof gt)){const e=g.I.filter_out_empty(this.export().info);u.tell(n,o.VL.insert_child(n.id,e,"tail")),u.tell(a,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_child_cube(c);t&&u.tell(t,o.UB.in_head(c,d))}else if(!(n instanceof gt)&&r instanceof gt){const e=g.I.filter_out_empty(r.export().info);u.tell(this,o.VL.insert_child(this.id,e,"tail")),u.tell(a,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_child_cube(c);t&&u.tell(t,o.UB.in_head(c,d))}return u}on_cube_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){if(this.is_empty)return;const e=this.export().info,t=new X(X.get_default(),this);this.splice(0,this.child_count,t),r.add_recover(o.VL.reset(this.id,e)),r.tell(t,o.UB.in_tail(t.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t,pid:n,pcube:r}=this,{pos:i,data:s}=e,a=new _.vk(t);if(0===s.length)return a;let l=this.get_valid_index(i);const c=g.I.pick(s);if(c.head.length>0){a.add_cmd(e);const t=g.I.build_cubes(s,this),n=t[t.length-1];this.splice(l,0,...t),a.add_recover(o.VL.delete_child(this.id,"backward",[l,l+t.length])),n&&a.tell(n,o.UB.in_tail(n.id,0))}const d=[...c.body];if(c.tail.length>0&&d.push(gt.get_default(c.tail)),c.root.length>0)for(let e of c.root)d.push(...e.info);if(d.length>0)if(this.inherit_line(d),this.is_empty)a.tell(r,o.VL.insert_child(n,d,this.index)),a.tell(r,o.VL.delete_child(n,"backward",[this.index,this.index+1]));else{const e=this.get_valid_index(l+c.head.length);if(e<this.child_count){const t=this._children.slice(e);if(t.length>0){const i=t.map(e=>e.export()),s=gt.get_default(i);this.inherit_line([s]),a.tell(this,o.VL.delete_child(this.id,"backward",[e,this.child_count])),a.tell(r,o.VL.insert_child(n,[s],this.index+1))}}a.tell(r,o.VL.insert_child(n,d,this.index+1))}return a}on_delete_child(e){const{dir:t,range:n,reserve:r}=e,{courier:i,pid:s,index:a,pcube:l}=this,c=i.get_recorder();c.add_cmd(e);const[d,u]=n;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count)if(r){if(this.is_empty)return;const e=this.child_first;e instanceof X?(c.tell(this,o.VL.delete_child(this.id,t,[1,this.child_count])),c.tell(e,$.reset(e.id,"",1,1))):c.tell(this,o.VL.reset(this.id,[]))}else this.is_empty?c.tell(l,o.VL.delete_child(s,t,[a,a+1])):c.tell(this,o.VL.reset(this.id,[]));else{const e=this.children[h-1],n=this.children[p],r=p-h;if(h>=this.child_count||r<=0)return;let i=this.splice(h,r);c.add_recover(o.VL.insert_child(this.id,i.data,d)),"backward"===t?e?c.tell(e,o.UB.in_tail(e.id,0)):n&&c.tell(n,o.UB.in_head(n.id,0)):"forward"===t&&(n?c.tell(n,o.UB.in_head(n.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}on_cube_delete_adjacent(e){const{courier:t,pid:n,prev_cube:r,next_cube:i,pcube:s}=this,{from:a,from_id:l,offset:c}=e,d=new _.vk(t);return"left"===a?this.prev_cube_deep instanceof gt?d.tell(this,o.VL.merge(this.id,"left",l,c)):d.tell(this,o.UB.in_head(this.id,0,void 0)):"right"===a&&(this.next_cube_deep instanceof gt?d.tell(this,o.VL.merge(this.id,"right",l,c)):d.tell(this,o.UB.in_tail(this.id,0,void 0))),d}static filter_out_empty(e){return e.filter(e=>!X.is_empty_text(e))}static get meta(){return{version:1,type:a.u0.line,cubename:"行",block:!0,show:!1}}static get_default(e=[],t={},n={}){const r=0===e.length?[X.get_default()]:e;return{id:(0,s.Ak)(),type:a.u0.line,info:r,css:t,attrs:n}}static get_default_by_string(e="",t={},n={}){const r=[X.get_default(e||"")];return{id:(0,s.Ak)(),type:a.u0.line,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}_t([(0,k.H)(a.zS.cube_merge)],gt.prototype,"on_cube_merge",null),_t([(0,k.H)(a.zS.cube_reset)],gt.prototype,"on_cube_reset",null),_t([(0,k.H)(a.zS.cube_insert_child)],gt.prototype,"on_insert_child",null),_t([(0,k.H)(a.zS.cube_delete_child)],gt.prototype,"on_delete_child",null),_t([(0,k.H)(a.zS.cube_delete_adjacent)],gt.prototype,"on_cube_delete_adjacent",null);const bt=["id","data-type"],vt=(0,c.pM)({__name:"cube-box",props:{cube:{}},setup(e){function t(t){if(t.target===t.currentTarget){t.stopPropagation();const{courier:n,history:r}=e.cube,i=n.get_recorder(),s=o.UB.in_tail(e.cube.id,0,"none");i.tell(e.cube,s),r.record(i)}}return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(x.u0).box,onPointerup:t},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],44,bt))}}),yt=(0,f.A)(vt,[["__scopeId","data-v-29b5ba30"]]);function wt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class xt extends o._D{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(0,l.IG)(yt)}get attrs(){return this.data.attrs}get meta(){return xt.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}gc(){super.base_gc()}replace_id(e,t={}){return xt.replace_id(this.root,e,t)}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof xt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_child_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof xt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof xt&&r instanceof xt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof xt&&!(r instanceof xt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof xt)&&r instanceof xt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_box_order(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count)if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));else{const e=this.children[h-1],t=this.children[p],n=p-h;if(h>=this.child_count||n<=0)return;let r=this.splice(h,n);c.add_recover(o.VL.insert_child(this.id,r.data,d)),"backward"===s?e?c.tell(e,o.UB.in_tail(e.id,0)):t&&c.tell(t,o.UB.in_head(t.id,0)):"forward"===s&&(t?c.tell(t,o.UB.in_head(t.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}on_box_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){if(this.is_empty)return;const e=this.export().info,t=new gt(gt.get_default(),this);this.splice(0,this.child_count,t),r.add_recover(o.VL.reset(this.id,e)),r.tell(t,o.UB.in_tail(t.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:r}=this,{from:i,from_id:s,offset:a}=e,l=new _.vk(t);if("left"===i)if(this.prev_cube_deep instanceof xt)l.tell(this,o.VL.merge(this.id,"left",s,a));else{const e=this.export().info,t=this.child_first.id;l.tell(n,o.VL.insert_child(r,e,this.index)),l.merge(this.remove_self());const c=n.find_cube(t);c&&l.tell(c,o.VL.delete_adjacent(t,i,s,a))}else if("right"===i)if(this.next_cube_deep instanceof xt)l.merge(this.on(o.VL.merge(this.id,"right",s,a)));else{const e=this.export().info,t=this.child_first.id;l.tell(n,o.VL.insert_child(r,e,this.index)),l.merge(this.remove_self());const c=n.find_cube(t);c&&l.tell(c,o.VL.delete_adjacent(t,i,s,a))}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 get meta(){return{type:a.u0.box,cubename:"块",version:1,block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=[];return 0===e.length?r.push(gt.get_default()):r.push(...g.I.pick(e).sort),{id:g.I.get_id(),type:a.u0.box,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}wt([(0,k.H)(a.zS.cube_merge)],xt.prototype,"on_merge",null),wt([(0,k.H)(a.zS.cube_reorder)],xt.prototype,"on_box_order",null),wt([(0,k.H)(a.zS.cube_insert_child)],xt.prototype,"on_insert_child",null),wt([(0,k.H)(a.zS.cube_delete_child)],xt.prototype,"on_delete_child",null),wt([(0,k.H)(a.zS.cube_reset)],xt.prototype,"on_box_reset",null),wt([(0,k.H)(a.zS.cube_delete_adjacent)],xt.prototype,"on_cube_delete_adjacent",null);const kt=["id","data-type"],St=(0,c.pM)({__name:"cube-box-folder",props:{cube:{}},setup(e){const t=e.cube,{stats:n}=e.cube;return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["cube-box-folder",{"cube-box-folder-active":e.cube.attrs.fold}]),id:e.cube.id,style:(0,d.Tr)((0,l.R1)(t).css),"data-type":(0,l.R1)(a.u0).box_folder},[e.cube.attrs.fold?((0,c.uX)(),(0,c.Wv)(S,{key:0,cube:e.cube.child_first},null,8,["cube"])):((0,c.uX)(!0),(0,c.CE)(c.FK,{key:1},(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:(0,l.IG)(e)},null,8,["cube"]))),128)),(0,c.Lk)("div",{class:(0,d.C4)(["folder-tag",{"folder-tag-active":e.cube.attrs.fold}]),onClick:n[0]||(n[0]=t=>function(e,t){const{courier:n,history:r,cubes:i,id:s,pcube:a}=t,l=n.get_recorder();l.tell(t,o.VL.fold(s,!t.attrs.fold)),r.record(l);for(let e of Object.values(i.postils))e.find_upstream_untill(a)===t&&e.visible(!1);const c=t.child_first.id;if(!c)return;const d=document.getElementById(c);d?.scrollIntoView({block:"nearest",behavior:"smooth"})}(0,e.cube))},null,2)],14,kt))}}),Ct=(0,f.A)(St,[["__scopeId","data-v-e4ce51da"]]);function Mt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Tt extends o._D{_component=Ct;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 this._component}get meta(){return Tt.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof gt&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t){return Tt.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:r,from_id:i}=e,s=new _.vk(t);return"left"===n?this.prev_cube_deep instanceof Tt?s.tell(this,o.VL.merge(this.id,"left",i,r)):s.tell(this,o.UB.in_head(this.id,0)):"right"===n&&(this.next_cube_deep instanceof Tt?s.merge(this.on(o.VL.merge(this.id,"right",i,r))):s.tell(this,o.UB.in_tail(this.id,0))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof Tt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof Tt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof Tt&&r instanceof Tt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof Tt&&!(r instanceof Tt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof Tt)&&r instanceof Tt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_cube_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){const e=this.children[0];if(1===this.child_count&&e instanceof X&&e.is_empty)return;const t=this.export().info,n=new gt(gt.get_default(),this);this.splice(0,this.child_count,n),r.add_recover(o.VL.reset(this.id,t)),r.tell(n,o.UB.in_tail(n.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=a[a.length-1],c=this.children[s+1];return l?i.tell(l,o.UB.in_tail(l.id,0)):i.tell(c,o.UB.in_head(c.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(h>=p)return;if(h<=0&&p>=this.child_count){if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));return c}const f=this.children[h-1],m=this.children[p],_=p-h;let g=this.splice(d,_);return c.add_recover(o.VL.insert_child(this.id,g.data,d)),"backward"===s?f?c.tell(f,o.UB.in_tail(f.id,0)):m&&c.tell(m,o.UB.in_head(m.id,0)):"forward"===s&&(m?c.tell(m,o.UB.in_head(m.id,0)):f&&c.tell(f,o.UB.in_tail(f.id,0))),c}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=>!X.is_empty_text(e))}static get meta(){return{type:a.u0.box_folder,cubename:"折叠块",version:1,block:!0,show:!0}}static get_default(e=[],t={},n={fold:!1}){const r=0===e.length?[gt.get_default()]:e;return{id:g.I.get_id(),type:a.u0.box_folder,info:r,css:t,attrs:n}}static replace_id(e,t,n){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}Mt([(0,k.H)(a.zS.cube_delete_adjacent)],Tt.prototype,"on_cube_delete_adjacent",null),Mt([(0,k.H)(a.zS.cube_merge)],Tt.prototype,"on_merge",null),Mt([(0,k.H)(a.zS.cube_reorder)],Tt.prototype,"on_cube_reorder",null),Mt([(0,k.H)(a.zS.cube_reset)],Tt.prototype,"on_cube_reset",null),Mt([(0,k.H)(a.zS.cube_insert_child)],Tt.prototype,"on_insert_child",null),Mt([(0,k.H)(a.zS.cube_delete_child)],Tt.prototype,"on_delete_child",null);class Lt{}const zt=["d","id","data-type","stroke-width","stroke","marker-start","marker-end"],At=(0,c.pM)({__name:"cube-linker",props:{cube:{}},setup:e=>(t,n)=>((0,c.uX)(),(0,c.CE)("path",{d:t.cube.path,id:t.cube.id,class:(0,d.C4)(["cube-linker",{"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}]),style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).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,zt))}),Pt=(0,f.A)(At,[["__scopeId","data-v-c8a5049e"]]),Rt=["cx","cy"],Nt=(0,c.pM)({__name:"op-node-drag",props:{interaction:{}},setup(e){const{info_node_drag:t}=e.interaction;return(e,n)=>((0,c.uX)(),(0,c.CE)(c.FK,null,[(0,l.R1)(t).show?((0,c.uX)(),(0,c.CE)("circle",{key:0,cx:(0,l.R1)(t).x,cy:(0,l.R1)(t).y,r:"20",stroke:"black","stroke-width":"2","stroke-dasharray":"4 4",fill:"none"},null,8,Rt)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <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))}}),Et={class:"map-status"},Ot={class:"map-scale"},It={class:"map-nodes"},Bt=(0,c.pM)({__name:"map-status",props:{cube:{}},setup(e){const t=e.cube,n=(0,c.EW)(()=>e.cube.cubes.get_types_cube(a.u0.node));function r(e){const n=t.dom_rect,r={x:n.x+n.width/2,y:n.y+n.height/2};t.scale_by_point(r,e,e)}return(t,i)=>((0,c.uX)(),(0,c.CE)("div",Et,[(0,c.Lk)("div",Ot,[(0,c.Lk)("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:i[0]||(i[0]=e=>r(-.1))}),(0,c.Lk)("span",null,(0,d.v_)((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),(0,c.Lk)("span",{class:"iconfont icon-add",onClick:i[1]||(i[1]=e=>r(.1))})]),(0,c.Lk)("div",It,[(0,c.Lk)("span",null,"节点 : "+(0,d.v_)(n.value.size),1)])]))}}),Dt=(0,f.A)(Bt,[["__scopeId","data-v-0d43440f"]]),Vt=new g.J,Ht=["id","data-type"],jt=["transform"],Ft=["data-group"],Ut=["data-group"],qt=["data-group"],$t=["data-group"],Gt=["d"],Xt=["d","stroke-width","stroke","marker-start","marker-end"],Kt=["d"],Wt={class:"doc-postils"},Yt=(0,c.pM)({__name:"cube-map",props:{cube:{}},setup(e){const t=e.cube,{placeholder:n,config:r}=e.cube,i=r.data,s=new Be(t),o=(0,l.KR)(),u=new ResizeObserver(e=>{t.get_view_rect(),Vt.resolve()});(0,c.sV)(()=>{const t=o.value;t&&u.observe(t),window.addEventListener("resize",t=>{e.cube.check_show_throttle()})});const h=e=>s.pointerdown(e),p=e=>s.pointermove(e),f=e=>s.pointerup(e),m=e=>s.pointercancel(e),_=e=>s.compositionstart(e),g=e=>s.compositionupdate(e),b=e=>s.compositionend(e),v=e=>s.beforeinput(e);return(0,c.sV)(()=>{document.documentElement.addEventListener("pointerup",f),document.documentElement.addEventListener("pointermove",p),document.documentElement.addEventListener("pointercancel",m)}),(e,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-map",id:e.cube.id,"data-type":(0,l.R1)(a.u0).map},[(0,c.Lk)("div",{class:"note",onPointerdown:h,onCompositionstart:_,onCompositionupdate:g,onCompositionend:b,onBeforeinput:v},[((0,c.uX)(),(0,c.CE)("svg",{ref_key:"svg",ref:o,style:(0,d.Tr)((0,l.R1)(r).css_vars)},[(0,c.Lk)("g",{transform:(0,l.R1)(t).matrix2d_dom_string},[(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).markers,class:"group-defs"},[...s[0]||(s[0]=[(0,c.Fv)('<defs data-v-f5f318f6>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-f5f318f6><path d="M 0 0 L 6 3 L 0 6 z" data-v-f5f318f6></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-f5f318f6><circle cx="3" cy="3" r="3" data-v-f5f318f6></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-f5f318f6><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-f5f318f6></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-f5f318f6><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-f5f318f6></rect></marker></defs>',1)])],8,Ft),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).linkers,class:"group-linkers"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).get_linkers_view(),e=>((0,c.uX)(),(0,c.Wv)(Pt,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Ut),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).nodes,class:"group-nodes"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_nodes_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,qt),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).placeholder,class:"group-placeholder"},[(0,l.R1)(n).box_selector?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-box-selector",d:(0,l.R1)(n).box_selector},null,8,Gt)):(0,c.Q3)("v-if",!0),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(n).linker,e=>((0,c.uX)(),(0,c.CE)(c.FK,null,[e?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":(0,l.R1)(i).map_linker_stroke_width,stroke:(0,l.R1)(i).map_linker_stroke,"marker-start":`url(#${(0,l.R1)(i).map_linker_anchor_left})`,"marker-end":`url(#${(0,l.R1)(i).map_linker_anchor_right})`},null,8,Xt)):(0,c.Q3)("v-if",!0)],64))),256)),(0,l.R1)(n).line_delete?((0,c.uX)(),(0,c.CE)("path",{key:1,class:"placeholder-line-delete",d:(0,l.R1)(n).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,Kt)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <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> '),(0,c.bF)(Nt,{interaction:e.cube.interaction},null,8,["interaction"])],8,$t),(0,c.Q3)(" --------------------------------------------------------以下是测试信息----------------------------------------------------------- "),(0,c.Q3)(" ------------------节点信息---------------------- "),(0,c.Q3)(' <template v-for="node of cube.nodes_test" v-if="cube.isdev"> '),(0,c.Q3)(" 采样点 "),(0,c.Q3)(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of node.sample"></circle> '),(0,c.Q3)(" 中心点 "),(0,c.Q3)(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),(0,c.Q3)(" 左上角 "),(0,c.Q3)(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),(0,c.Q3)(" 边界框 "),(0,c.Q3)(' <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> '),(0,c.Q3)(" 树边界框 "),(0,c.Q3)(' <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> '),(0,c.Q3)(" </template> "),(0,c.Q3)(" ------------------连线信息---------------------- "),(0,c.Q3)(' <template v-if="cube.root.isdev" v-for="linker of Object.values(cube.linkers)"> '),(0,c.Q3)(" 采样点 "),(0,c.Q3)(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of linker.sample"></circle> '),(0,c.Q3)(" 中心点 "),(0,c.Q3)(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),(0,c.Q3)(" 左上角 "),(0,c.Q3)(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),(0,c.Q3)(" 边界框 "),(0,c.Q3)(' <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> '),(0,c.Q3)(" 树边界框 "),(0,c.Q3)(' <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> '),(0,c.Q3)(" </template> "),(0,c.Q3)(" ------------------意图区域---------------------- "),(0,c.Q3)(' <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,jt)],4)),(0,c.Q3)(" doc-cubes "),(0,c.Lk)("div",Wt,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).cubes.postils,([e,t])=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t},null,8,["cube"]))),128))])],32),(0,c.Q3)(" scope selection "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).scope,e=>((0,c.uX)(),(0,c.Wv)(Ne,{key:e.id,selection:(0,l.IG)(e)},null,8,["selection"]))),128)),(0,c.Q3)(" map status "),(0,c.bF)(Dt,{cube:e.cube},null,8,["cube"]),(0,c.Q3)(" menus "),(0,c.bF)(tt,{root:e.cube},null,8,["root"])],8,Ht))}}),Zt=(0,f.A)(Yt,[["__scopeId","data-v-f5f318f6"]]);var Qt=n(2547);class Jt{static draw(e){const{type:t,from:n,to:r}=e;return"line"===t?this.line(n,r):"bezier2"===t?this.bezier2(n,r):"polyline"===t?this.polyline(n,r):"polyline2"===t?this.polyline2(n,r):"polyline3"===t?this.polyline3(n,r):"wave"===t?this.wave(n,r):this.bezier2(n,r)}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,r=n,i=e.y,s=n,o=t.y;return`M${e.x.toFixed(1)} ${e.y.toFixed(1)} C${r} ${i} ${s} ${o} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static polyline(e,t,n=4){const r=(e.x+t.x)/2,i=e,s=t,o=r,a=i.y,l=r,c=s.y,d=Math.sign(e.x-t.x),u=Math.sign(t.y-e.y),h=Math.sign(e.y-t.y),p=Math.sign(t.x-e.x);return`M${i.x} ${i.y} H ${o+d*n} Q ${o} ${a} ${o} ${a+u*n} V ${c+h*n} Q${l} ${c} ${l+p*n} ${c} H ${s.x}`}static polyline2(e,t,n=4){const r=e,i=t,s=(e.x+t.x)/2,o=r.y;return`M${r.x} ${r.y} L${s} ${o} L ${i.x} ${i.y}`}static polyline3(e,t,n=4){const r=(e.x+t.x)/2,i=e,s=t,o=(i.y,r),a=s.y;return`M${i.x} ${i.y} L${o} ${a} L ${s.x} ${s.y}`}static wave(e,t,n=2,r=8){const i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s),a=Math.atan2(s,i),l=r??o/10;let c=`M ${e.x} ${e.y}`;const d=20*n;for(let t=0;t<=d;t++){const r=t/d,o=e.x+i*r,u=e.y+s*r,h=l*Math.sin(r*n*Math.PI*2),p=o+-Math.sin(a)*h,f=u+Math.cos(a)*h;if(0===t)c+=` M ${p} ${f}`;else{const r=(t-1)/d,o=l*Math.sin(r*n*Math.PI*2),u=-Math.sin(a)*o,h=Math.cos(a)*o,m=e.x+i*r+u,_=e.y+s*r+h;c+=` C ${m+(p-m)/3} ${_+(f-_)/3}, ${p-(p-m)/3} ${f-(f-_)/3}, ${p} ${f}`}}return c}}class en{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?N.MathRect.get_rect_point(n,N._RectPosition.right_mid):"left"===t?N.MathRect.get_rect_point(n,N._RectPosition.left_mid):"down"===t?N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid):"up"===t?N.MathRect.get_rect_point(n,N._RectPosition.top_mid):"time-down"===t?N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid):"time-right"===t?N.MathRect.get_rect_point(n,N._RectPosition.right_mid):void 0}static time_down(e,t){const n=t.env.prev_node||e,r={...n.bound.pos,...n.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(r,N._RectPosition.bottom_mid),to:N.MathRect.get_rect_point(i,N._RectPosition.top_mid)}}static time_right(e,t){const n=t.env.prev_node||e,r={...n.bound.pos,...n.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(r,N._RectPosition.right_mid),to:N.MathRect.get_rect_point(i,N._RectPosition.left_mid)}}static up(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.top_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.bottom_mid)}}static right(e,t){const n=e.bound.rect,r=t.bound.rect;return{from:N.MathRect.get_rect_point(n,N._RectPosition.right_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.left_mid)}}static left(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.left_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.right_mid)}}static down(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.top_mid)}}static free_to_any(e,t){const n=e.sample,r=t.sample;if(0!==n.length&&0!==r.length)return Qt.U.find_closest_points(n,r)}}class tn{static update(e,t){return{id:e,name:a.Sd.update,attrs:t}}}var nn=n(2935),rn=n(3214),sn=n(3676);const on={class:"map-status"},an=(0,c.pM)({__name:"submap-status",props:{cube:{}},setup(e){function t(t){const n=e.cube.dom_rect,r={x:n.x+n.width/2,y:n.y+n.height/2};e.cube.scale_by_point(r,t,t)}return(n,r)=>((0,c.uX)(),(0,c.CE)("div",on,[(0,c.Lk)("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:r[0]||(r[0]=e=>t(-.1))}),(0,c.Lk)("span",null,(0,d.v_)((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),(0,c.Lk)("span",{class:"iconfont icon-add",onClick:r[1]||(r[1]=e=>t(.1))})]))}}),ln=(0,f.A)(an,[["__scopeId","data-v-cb09d654"]]),cn=["id","data-type"],dn=["transform"],un=["data-group"],hn=["data-group"],pn=["data-group"],fn=["data-group"],mn=["d"],_n=["d","stroke-width","stroke","marker-start","marker-end"],gn=["d"],bn=(0,c.pM)({__name:"cube-submap",props:{cube:{}},setup(e){const{placeholder:t}=e.cube,n=e.cube.config.data,r=(0,l.KR)(),i=(0,l.KR)(),s=new ResizeObserver(t=>{e.cube.get_view_rect()}),u=(0,l.KR)();let h;function p(){e.cube.dom_svg_rect}return(0,c.sV)(()=>{const t=i.value;t&&s.observe(t);const n=r.value;n&&e.cube.interaction.register(n);const a=u.value;if(!a)return;h=new N.DragDiff(a);let l=e.cube.attrs.width,c=e.cube.attrs.height,d=l,p=c;h.register_down(()=>{l=e.cube.attrs.width,c=e.cube.attrs.height}),h.register_move((e,t)=>{d=Math.round(e+l),p=Math.round(t+c),n.style.width=d+"px",n.style.height=p+"px"}),h.register_up((t,n)=>{if(l===d&&c===p)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+l),s=Math.round(n+c);r.tell(e.cube,o.VL.resize(e.cube.id,i,s)),e.cube.history.record(r),e.cube.check_show()}),h.register_cancel(()=>{e.cube.attrs.width=l,e.cube.attrs.height=c})}),(0,c.hi)(()=>{h?.off()}),(e,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-submap",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).submap,ref_key:"box",ref:r,onClick:p},[((0,c.uX)(),(0,c.CE)("svg",{ref_key:"svg",ref:i},[(0,c.Lk)("g",{transform:e.cube.matrix2d_dom_string},[(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).markers,class:"group-defs"},[...s[0]||(s[0]=[(0,c.Fv)('<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,un),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).linkers,class:"group-linkers"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_linkers_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,hn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).nodes,class:"group-nodes"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_nodes_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,pn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).placeholder,class:"group-placeholder"},[(0,l.R1)(t).box_selector?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-box-selector",d:(0,l.R1)(t).box_selector},null,8,mn)):(0,c.Q3)("v-if",!0),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).linker,e=>((0,c.uX)(),(0,c.CE)(c.FK,null,[e?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":(0,l.R1)(n).map_linker_stroke_width,stroke:(0,l.R1)(n).map_linker_stroke,"marker-start":`url(#${(0,l.R1)(n).map_linker_anchor_left})`,"marker-end":`url(#${(0,l.R1)(n).map_linker_anchor_right})`},null,8,_n)):(0,c.Q3)("v-if",!0)],64))),256)),(0,l.R1)(t).line_delete?((0,c.uX)(),(0,c.CE)("path",{key:1,class:"placeholder-line-delete",d:(0,l.R1)(t).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,gn)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <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> '),(0,c.bF)(Nt,{interaction:e.cube.interaction},null,8,["interaction"])],8,fn)],8,dn)],512)),(0,c.bF)(ln,{cube:e.cube},null,8,["cube"]),(0,c.Lk)("div",{class:"submap-dragger",ref_key:"dragger",ref:u},null,512)],12,cn))}}),vn=(0,f.A)(bn,[["__scopeId","data-v-b228a034"]]);function yn(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class wn extends o._D{_interaction;_has_layout=!1;_display_success=!1;data;nodes_test=(0,l.Gc)({});matrix2d=(0,l.Kh)(Qt.c.get_default());nodes=(0,l.Gc)({});node_from=(0,l.Kh)({});node_to=(0,l.Kh)({});node_editing=(0,l.Gc)(new Set);linkers=(0,l.Gc)({});nodes_selected=(0,l.Gc)(new Set);line_delete_selected=(0,l.Gc)(new Set);view_nodes=(0,l.Gc)(new Set);view_linkers=(0,l.Gc)(new Set);_view_rect=(0,l.Kh)({x:0,y:0,width:0,height:0});placeholder=(0,l.Kh)({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e,t){return super(e,t),this._interaction=new sn.T(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 Qt.c.get_dom_string(this.matrix2d)}get interaction(){return this._interaction}get domain(){return"doc"}get meta(){return wn.meta}get component(){return vn}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,r=Math.max(n.left,0),i=Math.min(n.right,t),s={x:r,y:Math.max(0,n.top)},o={x:i,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,u={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,u),u}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))N.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))N.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 o.wP?(this.nodes[t.id]=t,this.view_nodes.add(t)):t instanceof xn&&(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 r=n.bound.rect;N.MathRect.check_intersection(e,r)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof o.wP?this.view_nodes.add(e):e instanceof xn&&this.view_linkers.add(e):e instanceof o.wP?this.view_nodes.delete(e):e instanceof xn&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof o.wP?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof xn&&(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===a.tX.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===a.tX.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.x+n.width>r.x+r.width)&&(e=t)}return e}if(e===a.tX.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y+n.height>r.y+r.height)&&(e=t)}return e}if(e===a.tX.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y<r.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let r=e,i=1/0;if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}return r}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();this.perf&&this.check_show_line()}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(),(0,c.dY)(()=>this.check_show_line()))}check_show_line(){if(this.perf){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}}check_show_node(){if(this.perf)for(let e of Object.values(this.nodes))e.check_show()}layout_throttle=N.Notice.throttle(this.layout.bind(this),70);check_show_throttle=N.Notice.throttle(this.check_show.bind(this),100);check_show_line_throttle=N.Notice.throttle(this.check_show_line.bind(this),100);check_show_node_throttle=N.Notice.throttle(this.check_show_node.bind(this),100);async build_child(e){const{nodes:t,linkers:n}=e.info,r=g.I.build_cubes(t,this);for(let e of r)this.nodes[e.id]=e,this.view_nodes=(0,l.Gc)(new Set(r));await this.wait_nodes_render(r),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 r=new xn(e,this);this.linkers[r.id]=r,this.perf||this.view_linkers.add(r)}}update_data(e){return{usable:!0,data:e}}export(){const e=wn.get_default();e.id=this.id,e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs));const t=[],n=[];e.info={nodes:t,linkers:n,node_from:structuredClone((0,l.ux)(this.node_from)),node_to:structuredClone((0,l.ux)(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:r,history:i}=this,s=r.get_recorder();s.add_cmd(e);const a=g.I.build_cubes(t,this);this.pick(...a);const l=t.map(e=>e.id);return s.add_recover(o.yc.node_remove(this.id,l)),Promise.resolve().then(async()=>{const e=this.find_layout_root(a);for(let t of e)t.layout_throttle();this.config.data.map_perf&&this.check_show_line_throttle()}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=new Set;for(let e of t){const t=this.get_node(e);if(!t)continue;a.push(t.export());const n=t.env.layout_root;n&&n!==t&&l.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,o.yc.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,o.yc.linker_remove(this.id,[n]))}this.remove_node(t)}s.add_recover(o.yc.node_add(this.id,a));for(let e of l)e.layout_throttle();return this.config.data.map_perf&&this.check_show_line_throttle(),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this,s=n.get_recorder();s.add_cmd(e);let a=Promise.resolve();const l=[],c=new Set,d=[];for(let e of t){const{index_to:t,index_from:n,linker:r}=e,i=new xn(r,this),s=i.from_node,o=i.to_node;if(!s||!o)continue;this.pick(i);let a=this.node_from[i.to_id],u=this.node_to[i.from_id];if(a?a.indexOf(i.from_id)<0&&a.splice(n,0,i.from_id):this.node_from[i.to_id]=[i.from_id],u?u.indexOf(i.to_id)<0&&u.splice(t,0,i.to_id):this.node_to[i.from_id]=[i.to_id],d.unshift(i.id),!o.env.is_captive){const{has_root:e,line:t}=Qt.U.find_line_to_layout_root(o);l.push(o.wait_layout_self()),t[1]&&c.add(t[1])}}const u=new Set;for(let e of c){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&u.add(t)}return s.add_recover(o.yc.linker_remove(this.id,d)),a.then(async()=>{await Promise.all(l);for(let e of u)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=[];for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=this.get_node(t.from_id);n&&l.push(n);const r=this.node_to[t.from_id],i=this.node_from[t.to_id];if(r&&i){const e=r.indexOf(t.to_id),n=i.indexOf(t.from_id);r.splice(e,1),i.splice(n,1),a.unshift({linker:t.export(),index_to:e,index_from:n})}this.remove_linker(t)}const c=this.find_layout_root(l);for(let e of c)e.layout_throttle();return this.config.data.map_perf&&this.check_show_line_throttle(),s.add_recover(o.yc.linker_add(this.id,a)),s}get_linker_id(e,t){return e+"-"+t}replace_id(e,t={}){return wn.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e)}translate(e,t){const n=Qt.c.multiply(this.matrix2d,Qt.c.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:r,map_scale_min:i}=this.config.data,s=this.matrix2d.a+t;if(s>r||s<i)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=Qt.c.multiply(this.matrix2d,Qt.c.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:r}=this.get_upstream_sum_scale();let{x:i,y:s}=e;return{x:(i-t.x)/n,y:(s-t.y)/r}}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:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+r*l+s,y:n*a+i*l+o}}untransform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-r*l)/t,y:(l-o-n*a)/i}}static get meta(){return{type:a.u0.submap,cubename:"子图",version:1,block:!0,show:!0}}static get_default(e=400,t=200){return{id:g.I.get_id(),type:a.u0.submap,info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{width:e,height:t}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info.nodes,n),g.I.replace_id(e,t.info.linkers,n),t}}yn([(0,k.H)(a.kU.node_add)],wn.prototype,"on_node_add",null),yn([(0,k.H)(a.kU.node_remove)],wn.prototype,"on_node_remove",null),yn([(0,k.H)(a.kU.linker_add)],wn.prototype,"on_linker_add",null),yn([(0,k.H)(a.kU.linker_remove)],wn.prototype,"on_linker_remove",null);class xn extends rn.M{_point_from={x:0,y:0};_point_to={x:0,y:0};_show=!1;pcube;sample=(0,l.Gc)([]);_path=(0,c.EW)(()=>this.layout_self());constructor(e,t){return super(e,t),this.pcube=t,this.setup(e,t)}_from_node=(0,c.EW)(()=>this.pcube.get_node(this.from_id));_to_node=(0,c.EW)(()=>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||a._A.point}get anchor_right(){return this.attrs.anchor_right||a._A.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 Pt}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){return{usable:!0,data:e}}get meta(){return xn.meta}get domain(){return"map"}get id(){return Qt.U.get_linker_id(this.from_id,this.to_id)}get path(){return this._path.value}replace_id(e,t={}){return xn.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,r=en.find(e,t);if(r){this._point_from=r.from,this._point_to=r.to;const e=Jt.draw({type:n,...r});return this.sample=Qt.U.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),r=this.pcube.get_node_from(t.id),i=n?.indexOf(t.id)||-1,s=r?.indexOf(e.id)||-1;return{linker:this.export(),index_from:s,index_to:i}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof wn||t instanceof Zt)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}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:r}=e,i=t.get_recorder();i.add_cmd(e);const s=structuredClone((0,l.ux)(this.data.attrs));Object.assign(this.attrs,r);const o=tn.update(this.id,s);return i.add_recover(o),i}get_link_right(){const e=this.from_node?.bound.get_bound_rect_point(N._RectPosition.right_mid),t=this.to_node?.bound.get_bound_rect_point(N._RectPosition.left_mid),n=this.attrs.type;return e&&t?"line"===n?Jt.line(e,t):"bezier2"===n?Jt.bezier2(e,t):Jt.line(e,t):""}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,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:a.u0.linker,block:!1,version:1,show:!1}}static get_default(e,t,n){const{map_linker_anchor_left:r,map_linker_anchor_right:i,map_linker_line:s,map_linker_stroke:o,map_linker_stroke_width:l}=nn.B.config;return{id:Qt.U.get_linker_id(e,t),type:a.u0.linker,info:{},attrs:{from:e,to:t,type:n||s,anchor_left:r,anchor_right:i,stroke:o,stroke_width:l},css:{}}}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.Sd.update)],xn.prototype,"on_linker_update",null);class kn{_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,r=this._nodes[n];r&&e.isConnected&&r.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 Sn=new kn,Cn=["id","data-type","transform","data-editing"],Mn=["d"],Tn=["x","y","width","height"],Ln=["data-id"],zn={class:"node-status"},An=(0,c.pM)({__name:"cube-node",props:{cube:{}},setup(e){const{bound:t,shape:n}=e.cube,r=(0,l.KR)(),{map_node_padding:i}=e.cube.config.data;(0,c.sV)(()=>{const t=r.value;t&&Sn.register(t,e.cube)}),(0,c.xo)(()=>{const e=r.value;e&&Sn.unregister(e)});const s=(0,c.EW)(()=>({"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 u(t,n){e.cube.event.emit_node_status_click(t,{node:e.cube,click:n})}function h(t=!0){const{courier:n,history:r}=e.cube,i=n.get_recorder(),s=o.Sv.layout_change(e.cube.id,{fold:t});i.tell(e.cube,s),r.record(i)}return(e,i)=>((0,c.uX)(),(0,c.CE)("g",{id:e.cube.id,"data-type":(0,l.R1)(a.u0).node,class:(0,d.C4)(["cube-node",s.value]),transform:e.cube.matrix2d_dom_string,"data-editing":e.cube.editable},[(0,c.Lk)("path",{d:(0,l.R1)(n).path,ref:"p",style:(0,d.Tr)({fill:e.cube.attrs.fill})},null,12,Mn),((0,c.uX)(),(0,c.CE)("foreignObject",{x:(0,l.R1)(t).pos_cbox.x,y:(0,l.R1)(t).pos_cbox.y,width:(0,l.R1)(t).size.width,height:(0,l.R1)(t).size.height,style:(0,d.Tr)(e.cube.css)},[(0,c.Lk)("div",{class:"cube-node-box",ref_key:"box",ref:r,"data-id":e.cube.id},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128)),(0,c.Q3)(" node statusbar "),(0,c.Lk)("div",zn,[e.cube.is_layout_root?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"iconfont icon-system-mind-map-filled",onClick:i[0]||(i[0]=e=>u(e,"root"))})):(0,c.Q3)("v-if",!0),e.cube.attrs.layout?((0,c.uX)(),(0,c.CE)("div",{key:1,class:(0,d.C4)(e.cube.icons[e.cube.attrs.layout]),onClick:i[1]||(i[1]=e=>u(e,"layout"))},null,2)):(0,c.Q3)("v-if",!0),e.cube.env.upstream&&e.cube.env.downstream.length>0?((0,c.uX)(),(0,c.CE)(c.FK,{key:2},[e.cube.attrs.fold?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"status-fold",onClick:i[2]||(i[2]=e=>h(!1))},(0,d.v_)(e.cube.env.downstream_nodes.length),1)):((0,c.uX)(),(0,c.CE)("div",{key:1,class:"iconfont icon-minus2",onClick:i[3]||(i[3]=e=>h(!0))}))],64)):(0,c.Q3)("v-if",!0)])],8,Ln)],12,Tn))],10,Cn))}}),Pn=(0,f.A)(An,[["__scopeId","data-v-138cbca0"]]);class Rn extends o.wP{constructor(e,t){return super(e,t),this.setup(e,t)}get domain(){return"map"}get meta(){return Rn.meta}get component(){return Pn}build_child(e){this._children.push(...g.I.build_cubes(e.info,this))}update_data(e){return e.attrs.matrix&&(e.attrs.matrix2d=e.attrs.matrix,delete e.attrs.matrix),{usable:!0,data:e}}gc(){this.base_gc()}export(){const e=this.base_export();e.info=[],e.attrs=structuredClone((0,l.ux)(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 Rn.replace_id(this.root,e,t)}static get meta(){return{cubename:"图形节点",type:a.u0.node,block:!0,version:1,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info,n),t}static get_default(e,t="rect"){return{id:g.I.get_id(),type:a.u0.node,info:[pt.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:{}}}a(e=!0,t="left",n=!1){const{courier:r}=this,i=r.get_recorder(),s=o.Sv.layout_change(this.id,{root:e,layout:t,fold:n});i.tell(this,s),this.history.record(i),this.env.layout_root?.layout()}}class Nn{_node;_size=(0,l.Kh)(o.wP.get_default_node_size());_size_bound=(0,l.Kh)(o.wP.get_default_node_size());_size_tree=(0,l.Kh)(o.wP.get_default_node_size());_pos_cbox=(0,l.Kh)({x:nn.B.default_config.map_node_padding,y:nn.B.default_config.map_node_padding});_pos;_pos_tree;_layout_pos_tree;constructor(e,t){this._node=e,this._pos=(0,l.Kh)({x:t.e,y:t.f}),this._pos_tree=(0,l.Kh)({x:t.e,y:t.f}),this._layout_pos_tree=(0,l.Kh)({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 r=0,i=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,u={x:0,y:0,width:0,height:0},h={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,e.width>=r&&(r=e.width,u=n),e.height>=i&&(i=e.height,h=n),n.width>=c&&(c=n.width,l=n),n.height>=d&&(d=n.height,a=n)}return{max_tree_height:i,max_tree_width:r,sum_tree_height:s+(e.length-1)*n,sum_tree_width:o+(e.length-1)*t,max_height_node:a,max_width_node:l,mw_rect:u,mh_rect:h}}update_pos_cbox(){const e=this.node.attrs.shape,{width:t,height:n}=this.size_bound,{map_node_padding:r}=this.node.config.data,i=t/2,s=n/2;"circle"===e?(this._pos_cbox.x=i-this.size.width/2,this._pos_cbox.y=s-this.size.height/2):(this._pos_cbox.x=r,this._pos_cbox.y=r)}update_pos(){const e=this.size_tree,t=this.size_bound,n=this.pos_tree,r=this.node.env.layout_type,i=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=i,this._pos.y=s;else if(this.env.folded_self)this._pos.x=n.x,this._pos.y=n.y;else if("right"===r)this._pos.x=n.x,this._pos.y=n.y-t.height/2+e.height/2;else if("left"===r)this._pos.x=n.x+e.width-t.width,this._pos.y=n.y+e.height/2-t.height/2;else if("down"===r)this._pos.x=n.x+e.width/2-t.width/2,this._pos.y=n.y;else if("up"===r)this._pos.x=n.x+e.width/2-t.width/2,this._pos.y=n.y+e.height-t.height;else if("time-right"===r){const{sum_tree_height:e,sum_tree_width:r,max_tree_height:i,max_tree_width:s,mw_rect:a,mh_rect:l}=this.stat_downstream_nodes_size(o),c=Math.max(l.height,t.height)/2;this._pos.x=n.x,this._pos.y=n.y+c-t.height/2}else if("time-down"===r){const{sum_tree_height:e,sum_tree_width:r,max_tree_height:i,max_tree_width:s,mw_rect:a,mh_rect: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,r=this.matrix2d.e,i=this.matrix2d.f;if(t){if(this.node.attrs.fold)this._layout_pos_tree.x=r,this._layout_pos_tree.y=i;else if("right"===t)this._layout_pos_tree.x=r,this._layout_pos_tree.y=i+n.height/2-e.height/2;else if("left"===t)this._layout_pos_tree.x=r+n.width-e.width,this._layout_pos_tree.y=i+n.height/2-e.height/2;else if("down"===t)this._layout_pos_tree.x=r+n.width/2-e.width/2,this._layout_pos_tree.y=i;else if("up"===t)this._layout_pos_tree.x=r+n.width/2-e.width/2,this._layout_pos_tree.y=i+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,mw_rect:c,mh_rect:d,max_height_node:u,max_width_node:h}=this.stat_downstream_nodes_size(e);this._layout_pos_tree.x=r,this._layout_pos_tree.y=i-Math.max(t,u.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,mw_rect:c,mh_rect:d,max_height_node:u,max_width_node:h}=this.stat_downstream_nodes_size(e);this._layout_pos_tree.x=r+t-Math.max(h.width/2,t),this._layout_pos_tree.y=i}}else this._layout_pos_tree.x=r,this._layout_pos_tree.y=i}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:r}=this.config.data,i=this.size_bound,{sum_tree_height:s,sum_tree_width:o,max_tree_height:a,max_tree_width:l,mw_rect:c,mh_rect:d,max_height_node:u,max_width_node:h}=this.stat_downstream_nodes_size(e);if("left"===t)this._size_tree.width=i.width+n+l,this._size_tree.height=Math.max(i.height,s);else if("right"===t)this._size_tree.width=i.width+n+l,this._size_tree.height=Math.max(i.height,s);else if("down"===t)this._size_tree.width=Math.max(i.width,o),this._size_tree.height=i.height+r+a;else if("up"===t)this._size_tree.width=Math.max(i.width,o),this._size_tree.height=i.height+r+a;else if("time-right"===t){const e=d.height/2,t=u.height/2,r=i.height/2;this._size_tree.width=i.width+n+o,this._size_tree.height=Math.max(r,t)+Math.max(a-e,r,t)}else if("time-down"===t){const e=i.width/2,t=c.width/2,n=h.width/2;this._size_tree.width=Math.max(e,n)+Math.max(e,l-t),this._size_tree.height=i.height+r+s}else Object.assign(this._size_tree,i)}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);else if("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 N.MathRect.get_rect_point(t,e)}}class En{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:r,height:i}=e.bound.size,s=r+2*t,o=r+2*t,a=i+2*t,l=i+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,r=Math.sqrt(t*t+n*n)/2;return`M${r} 0 A ${r} ${r} 0 1 0 ${r} ${2*r}A${r} ${r} 0 1 0 ${r} 0`}}function On(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class In extends o.MR{_app;_interaction;_has_layout=(0,l.KR)(!1);data;nodes_test=(0,l.Gc)({});nodes=(0,l.Gc)({});node_from=(0,l.Kh)({});node_to=(0,l.Kh)({});node_editing=(0,l.Gc)(new Set);linkers=(0,l.Gc)({});nodes_selected=(0,l.Gc)(new Set);line_delete_selected=(0,l.Gc)(new Set);view_nodes=(0,l.Gc)(new Set);view_linkers=(0,l.Gc)(new Set);_view_rect=(0,l.Kh)({x:0,y:0,width:0,height:0});placeholder=(0,l.Kh)({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e){super();const t=this.update_data(e).data;this.data=(0,l.Kh)(t),this.node_to=this.data.info.node_to||{},this.node_from=this.data.info.node_from||{},this._interaction=new sn.T(this),this.build_child(t),k.o.init_cmd_handler(this),A.K.add_map(this),this._app=ze(Zt,{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 Qt.c.get_dom_string(this.matrix2d)}get domain(){return"map"}get app(){return this._app}get component(){return Zt}get meta(){return In.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,r=Math.max(n.left,0),i=Math.min(n.right,t),s={x:r,y:Math.max(0,n.top)},o={x:i,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,u={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,u),u}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))N.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))N.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===a.tX.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===a.tX.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.x+n.width>r.x+r.width)&&(e=t)}return e}if(e===a.tX.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y+n.height>r.y+r.height)&&(e=t)}return e}if(e===a.tX.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y<r.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let r=e,i=1/0;if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.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=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}return r}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 Qt.U.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 o.wP?(this.nodes[t.id]=(0,l.IG)(t),this.view_nodes.add(t)):t instanceof xn&&(this.linkers[t.id]=(0,l.IG)(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 r=n.bound.rect;N.MathRect.check_intersection(e,r)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof o.wP?this.view_nodes.add(e):e instanceof xn&&this.view_linkers.add(e):e instanceof o.wP?this.view_nodes.delete(e):e instanceof xn&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof o.wP?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof xn&&(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 r;if(t&&n){const i=t.indexOf(e.to_id),s=n.indexOf(e.from_id);t.splice(i,1),n.splice(s,1),r={linker:e.export(),index_to:i,index_from:s}}return delete this.linkers[e.id],this.view_linkers.delete(e),e.gc(),r}async build_child(e){const{nodes:t,linkers:n}=e.info;console.time("🍋build-nodes");const r=[];for(let e of t){let t=new Rn(e,this);r.push(t),this.nodes[t.id]=(0,l.IG)(t),this.view_nodes.add(t)}console.timeEnd("🍋build-nodes");for(let e of n){const{from:t,to:n}=e.attrs,r=this.get_node(e.attrs.from),i=this.get_node(e.attrs.to);if(!r||!i){const e=this.node_to[t],r=e.indexOf(n);e.splice(r,0);const i=this.node_from[n],s=i.indexOf(t);i.splice(s,1);continue}const s=new xn(e,this);this.linkers[s.id]=(0,l.IG)(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")}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"),this.perf&&this.check_show_line()}check_show(){this.perf&&(console.time("🍋动态显示检查"),this.check_show_node(),console.timeEnd("🍋动态显示检查"),(0,c.dY)(()=>this.check_show_line()))}check_show_line(){if(this.perf){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}}check_show_node(){if(this.perf)for(let e of Object.values(this.nodes))e.check_show()}layout_throttle=N.Notice.throttle(this.layout.bind(this),50);check_show_throttle=N.Notice.throttle(this.check_show.bind(this),50);check_show_line_throttle=N.Notice.throttle(this.check_show_line.bind(this),50);check_show_node_throttle=N.Notice.throttle(this.check_show_node.bind(this),50);gc(){}export(){const e=In.get_default();e.id=this.id,e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.attrs.matrix2d={...this.matrix2d};const t=[],n=[];e.info={nodes:t,linkers:n,node_from:(0,l.ux)(this.node_from),node_to:(0,l.ux)(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){return e.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}async render(e){this._dom=e,this.app.mount(e),console.time("🍋wait-svg & nodes"),await Promise.all([Vt.ps,Qt.U.wait_nodes_render([...this.view_nodes])]),console.timeEnd("🍋wait-svg & nodes"),await g.I.sleep(100),this.init_boundbox(),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:r,history:i}=this,s=r.get_recorder();s.add_cmd(e);const a=g.I.build_cubes(t,this);this.pick(...a);const l=t.map(e=>e.id);return s.add_recover(o.yc.node_remove(this.id,l)),Promise.resolve().then(async()=>{await Qt.U.wait_nodes_render(a);const e=this.find_layout_root(a);for(let t of e)t.layout_throttle()}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=[],c=new Set,d=[];for(let e of t){const t=this.get_node(e);if(t){l.push(t);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&d.push(t)}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&d.push(n)}}}for(let e of l){a.push(e.export());const t=e.env.layout_root;t&&t!==e&&c.add(e.env.layout_root),this.remove_node(e)}return s.tell(this,o.yc.linker_remove(this.id,d)),s.add_recover(o.yc.node_add(this.id,a)),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this,s=n.get_recorder();if(0===t.length)return;s.add_cmd(e);const a=[];let l=Promise.resolve();const c=[],d=new Set;for(let e of t){const{index_to:t,index_from:n,linker:r}=e,i=new xn(r,this),s=i.from_node,o=i.to_node;if(!s||!o)continue;this.pick(i);let l=this.node_from[i.to_id],u=this.node_to[i.from_id];if(l?l.indexOf(i.from_id)<0&&l.splice(n,0,i.from_id):this.node_from[i.to_id]=[i.from_id],u?u.indexOf(i.to_id)<0&&u.splice(t,0,i.to_id):this.node_to[i.from_id]=[i.to_id],a.unshift(i.id),!o.env.is_captive){const{has_root:e,line:t}=Qt.U.find_line_to_layout_root(o);c.push(o.wait_layout_self()),t[1]&&d.add(t[1])}}const u=new Set;for(let e of d){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&u.add(t)}return s.add_recover(o.yc.linker_remove(this.id,a)),l.then(async()=>{await Promise.all(c);for(let e of u)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=new Set,c=new Set;for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=t.from_node,r=t.to_node;n&&l.add(n),r&&c.add(r);const i=this.remove_linker(t);i&&a.unshift(i)}if(0===a.length)return;for(let e of l)e.env.flow(),e.bound.flow("upstream");const d=new Set;for(let e of c){if(e.is_layout_root)continue;const{has_root:t,line:n}=Qt.U.find_line_to_layout_root(e),r=n[1];t&&r?c.has(r)||d.add(r):e.env.clear()}for(let e of d)e.env.flow(),e.bound.flow("downstream"),e.bound.flow("upstream");const u=new Set;for(let e of[...l,...d]){const t=e.env?.layout_root;t&&u.add(t)}for(let e of u)e.layout_throttle();return s.add_recover(o.yc.linker_add(this.id,a)),s}on_update_attrs(e){const{courier:t,history:n}=this,{data:r}=e,i=t.get_recorder();return i.add_cmd(e),"matrix2d"in r&&r.matrix2d&&(i.add_recover(o.yc.update_attr(this.id,{matrix2d:{...this.matrix2d}})),this.reset_matrix(r.matrix2d)),i}get_linker_id(e,t){return Qt.U.get_linker_id(e,t)}replace_id(e,t={}){return In.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=Qt.c.multiply(this.matrix2d,Qt.c.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:r,map_scale_min:i}=this.config.data,s=this.matrix2d.a+t;if(s>r||s<i)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,u=Qt.c.multiply(this.matrix2d,Qt.c.get_matrix_translate(c,d));this.reset_matrix(u)}get_upstream_sum_scale(){return{sx:1,sy:1}}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:r}=this.get_upstream_sum_scale();let{x:i,y:s}=e;return{x:(i-t.x)/n,y:(s-t.y)/r}}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:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+r*l+s,y:n*a+i*l+o}}untransform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-r*l)/t,y:(l-o-n*a)/i}}static get meta(){return{type:a.u0.map,cubename:"图形笔记",version:1,block:!0,show:!1}}static get_default(){return{id:g.I.get_id(),type:a.u0.map,versions:A.K.export_versions(),info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{matrix2d:Qt.c.get_default()}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info.nodes,n),g.I.replace_id(e,t.info.linkers,n),t}}On([(0,k.H)(a.kU.node_add)],In.prototype,"on_node_add",null),On([(0,k.H)(a.kU.node_remove)],In.prototype,"on_node_remove",null),On([(0,k.H)(a.kU.linker_add)],In.prototype,"on_linker_add",null),On([(0,k.H)(a.kU.linker_remove)],In.prototype,"on_linker_remove",null),On([(0,k.H)(a.kU.update_attrs)],In.prototype,"on_update_attrs",null);class Bn{static reset(e,t,n){return{id:e,name:a.tK.reset,args:t,funcs:n}}}let Dn="";function Vn(e,t){if(Dn===t.funcname.text)return;Dn=t.funcname.text;const{funcname:n,args:r,funcs:i,courier:s,history:o}=t,a=new _.vk(s),l=new Set,c=new Set;for(let e of n.children){if(!(e instanceof gt))continue;const t=e.text.trim();if(!t||""===t)continue;const n=Hn(t);for(let e of n.args)l.add(e);c.add(n.name)}const d=[],u=[],h=[...l],p=[...c];if(h.length===r.length)for(let e=0;e<r.length;e++)d.push({name:h[e],desc:r[e].desc.export()});else for(let e of h){const t=r.find(t=>t.name===e);if(t)d.push({name:e,desc:t.desc.export()});else{const t=gt.get_default(),n=gt.get_default();d.push({name:e,desc:xt.get_default([t,n])})}}if(p.length===i.length)for(let e=0;e<i.length;e++)u.push({name:p[e],desc:i[e].desc.export()});else for(let e of p){const t=i.find(t=>t.name===e);if(t)u.push({name:e,desc:t.desc.export()});else{const t=gt.get_default(),n=gt.get_default();u.push({name:e,desc:xt.get_default([t,n])})}}a.tell(t,Bn.reset(t.id,d,u)),o.record(a)}function Hn(e){const t=e.replace("...",""),n=t.indexOf("("),r=t.indexOf(")"),i=t.indexOf("."),s={name:"",args:[]};if(s.name=i<0&&n>0?t.slice(0,n):i>0&&n>0?t.slice(i+1,n):t.slice(i+1),n<0||r<0)return s.name=t,s;const o=t.slice(n+1,r);for(let e of o.split(",")){let t=e.trim();t&&s.args.push(t)}return s}const jn=["id","data-type"],Fn={class:"cube-api-content"},Un={class:"api-description"},qn={class:"arg-name"},$n={class:"func-name"},Gn=(0,c.pM)({__name:"cube-api",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-api",id:e.cube.id,"data-type":(0,l.R1)(a.u0).api,style:(0,d.Tr)(e.cube.css),ref:"root"},[(0,c.Lk)("div",Fn,[(0,c.Lk)("div",{class:"header",onKeyup:t[0]||(t[0]=t=>(0,l.R1)(Vn)(t,e.cube))},[(0,c.bF)(S,{cube:e.cube.funcname},null,8,["cube"])],32),(0,c.Lk)("div",Un,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.args,e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e.desc.id},[(0,c.Lk)("div",qn,(0,d.v_)(e.name),1),(0,c.bF)(S,{class:"arg-desc",cube:e.desc},null,8,["cube"]),(0,c.Q3)(' <component class=\'arg-desc\' :is="item.component" :cube="item" :id="item.id"></component> ')],64))),128)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.funcs,e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e.desc.id},[(0,c.Lk)("div",$n,(0,d.v_)(e.name),1),(0,c.bF)(S,{class:"func-desc",cube:e.desc},null,8,["cube"]),(0,c.Q3)(' <component class=\'func-desc\' :is="item.component" :cube="item" :id="item.id"></component> ')],64))),128))])])],12,jn))}),Xn=(0,f.A)(Gn,[["__scopeId","data-v-4fff7da0"]]);class Kn extends o._D{_component=Xn;funcname;args=(0,l.Gc)([]);funcs=(0,l.Gc)([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return this._component}get children(){const e=this.args.map(e=>e.desc),t=this.funcs.map(e=>e.desc);return[this.funcname,...e,...t]}get meta(){return Kn.meta}get is_empty(){return 1===this.funcname.child_count&&this.funcname.child_first.is_empty}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return Kn.replace_id(this.root,e,t)}build_child(e){this.funcname=new xt(e.info.names,this),this.build_desc(this.info.args,this.info.funcs)}gc(){super.base_gc()}export(){const e=this.base_export();return e.info.names=this.funcname.export(),e.info.args=this.get_args_data(),e.info.funcs=this.get_funcs_data(),e}build_desc(e,t){for(let e of this.args)e.desc.gc();for(let e of this.funcs)e.desc.gc();this.args.length=0,this.funcs.length=0;for(let t of e){const e={name:t.name,desc:new xt(t.desc,this)};this.args.push(e)}for(let e of t){const t={name:e.name,desc:new xt(e.desc,this)};this.funcs.push(t)}}get_args_data(){const e=[];for(let t of this.args){const n={name:t.name,desc:t.desc.export()};e.push(n)}return e}get_funcs_data(){const e=[];for(let t of this.funcs){const n={name:t.name,desc:t.desc.export()};e.push(n)}return e}reset_api(e){const{courier:t,history:n}=this,{args:r,funcs:i}=e,s=t.get_recorder();s.add_cmd(e);const o=structuredClone(this.get_args_data()),a=structuredClone(this.get_funcs_data());return this.build_desc(r,i),s.add_recover(Bn.reset(this.id,o,a)),s}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}static get meta(){return{type:a.u0.api,version:1,cubename:"Api",block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=[];for(let t of e)r.push(gt.get_default_by_string(t));return{id:(0,s.Ak)(),type:a.u0.api,info:{names:xt.get_default(r),args:[],funcs:[]},css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i,t.info.names=xt.replace_id(e,t.info.names,n);for(let r of t.info.args)r.desc=xt.replace_id(e,r.desc,n);for(let r of t.info.funcs)r.desc=xt.replace_id(e,r.desc,n);return t}}function Wn(e,t="tail"){const{courier:n,history:r}=e,i=new _.vk(n),s=[xt.get_default(),xt.get_default()],o=Yn.insert_row(e.id,t,[s]);i.tell(e,o),r.record(i)}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.tK.reset)],Kn.prototype,"reset_api",null);class Yn{static insert_row(e,t,n){return{id:e,name:a.J8.insert_row,pos:t,rows:n}}static remove_row(e,t,n=!1){return{id:e,name:a.J8.remove_row,range:t,reserve:n}}static change_width_col1(e,t){return{id:e,width:t,name:a.J8.change_width_col1}}}const Zn=["id","data-type"],Qn=(0,c.pM)({__name:"cube-detail-list",props:{cube:{}},setup(e){const t=e.cube.root,n=(0,c.rk)("root"),r=(0,l.KR)();(0,c.sV)(()=>{const i=r.value,s=n.value;if(!i)return;const o=new N.DragDiff(i);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,r)=>{if(t.stats.is_read_mode)return;if(a===l)return;const i=e.cube.courier.get_recorder(),s=Math.round(n+a);i.tell(e.cube,Yn.change_width_col1(e.cube.id,s)),e.cube.history.record(i)}),o.register_cancel(()=>{e.cube.attrs.width=a,i.style.left=a-2+"px"})});const i=(0,c.EW)(()=>({...e.cube.css,"--width-col1":e.cube.attrs.width_col1+"px"}));return(t,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-detail-list",id:t.cube.id,"data-type":(0,l.R1)(a.u0).detail_list,ref_key:"root",ref:n,style:(0,d.Tr)(i.value),onContextmenu:s[1]||(s[1]=e=>(0,l.R1)(at.uz)(e,t.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.children,t=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t,onKeydown:n=>function(t,n){t.ctrlKey&&!t.shiftKey&&"Enter"===t.key?(t.stopPropagation(),Wn(e.cube,Math.floor(n.index/2)+1)):t.ctrlKey&&t.shiftKey&&"Enter"===t.key&&(t.stopPropagation(),Wn(e.cube,Math.floor(n.index/2)))}(n,t)},null,8,["cube","onKeydown"]))),128)),(0,c.Lk)("div",{class:"adder-wrap",onClick:s[0]||(s[0]=()=>(0,l.R1)(Wn)(t.cube))},[...s[2]||(s[2]=[(0,c.Lk)("div",{class:"adder"},null,-1)])]),(0,c.Lk)("div",{class:"adjuster",ref_key:"adjuster",ref:r},null,512)],44,Zn))}}),Jn=(0,f.A)(Qn,[["__scopeId","data-v-6b68d605"]]),er=[function(e,t){return t>=2||e.attrs.width_col1||(e.attrs.width_col1=150),e}];function tr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class nr extends o._D{rows;_component=Jn;constructor(e,t){return super(e,t),this.rows=(0,l.Gc)([]),this.setup(e,t)}get component(){return this._component}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 nr.meta}update_data(e){return function(e,t){const n=t[nr.meta.type];return n>nr.meta.version?{data:e,usable:!1}:{data:er.reduce((e,t)=>t(e,n),e),usable:!0}}(e,this.root.versions)}build_child(e){for(let t of e.info){const e=new xt(t[0],this),n=new xt(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),r=Math.floor((t-1)/2),i=nr.get_default();i.info=[];for(let e=n;e<=r;e++){const t=this.rows[e];if(!t)continue;const n=[t[0].export(),t[1].export()];i.info.push(n)}return 0===i.info.length?[]:[i]}gc(){super.base_gc()}export(){const e=this.base_export();e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.info=[];for(let[t,n]of this.rows){const r=t.export(),i=n.export();e.info.push([r,i])}return e}replace_id(e,t={}){return nr.replace_id(this.root,e,t)}splice_rows(e,t,...n){const r=this.rows.splice(e,t,...n);for(let[e,t]of r)e.gc(),t.gc();return r}check_delete_edge(e){return 0==e.index%2&&!!e.is_empty}insert_row(e){const{courier:t}=this,{pos:n,rows:r}=e,i=t.get_recorder();i.add_cmd(e);const s=[];for(let[e,t]of r)s.push([new xt(e,this),new xt(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)),i.add_recover(Yn.remove_row(this.id,o)),i}remove_row(e){const{courier:t,cursor:n}=this,{range:r,reserve:i}=e,s=new _.vk(t);let[a,l]=r;if(a<0&&(a=0),l>this.row_count&&(l=this.row_count),0===a&&l>=this.row_count)if(i){if(this.is_empty)return;s.tell(this,Yn.remove_row(this.id,[1,this.child_count]));const e=this.child_first,t=e.next_cube;t&&s.tell(t,o.VL.delete_child(t.id,"backward",[0,t.child_count],!0)),e&&s.tell(e,o.VL.delete_child(e.id,"backward",[0,e.child_count],!0))}else s.merge(this.remove_self());else{const e=this.rows[a-1]?.[1],t=this.rows[l+1]?.[1],n=this.splice_rows(a,l-a),r=[];for(let[e,t]of n)r.push([e.export(),t.export()]);s.add_recover(Yn.insert_row(this.id,a,r)),e?s.tell(e,o.UB.in_tail(e.id,0,void 0)):t&&s.tell(t,o.UB.in_head(t.id,0,void 0))}return s}change_width_col1(e){const{width:t}=e,{courier:n,id:r}=this,i=n.get_recorder();i.add_cmd(e);const s=this.attrs.width_col1;return this.attrs.width_col1=t,this.dom?.style.setProperty("--width-col1",t+"px"),i.add_recover(Yn.change_width_col1(r,s)),i}delete_cube(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o,reserve:a}=e,[l,c]=o,d=Math.floor(l/2),u=Math.floor((c-1)/2),h=(this.children[l],Yn.remove_row(this.id,[d,u+1],a));return this.remove_row(h)}static get meta(){return{type:x.u0.detail_list,version:2,cubename:"清单",block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=0===e.length?[[xt.get_default(),xt.get_default()]]:e;return{id:(0,s.Ak)(),type:x.u0.detail_list,info:r,css:t,attrs:{width_col1:150}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info)s.push([xt.replace_id(e,r[0],n),xt.replace_id(e,r[1],n)]);return t.info=s,t}}tr([(0,k.H)(a.J8.insert_row)],nr.prototype,"insert_row",null),tr([(0,k.H)(a.J8.remove_row)],nr.prototype,"remove_row",null),tr([(0,k.H)(a.J8.change_width_col1)],nr.prototype,"change_width_col1",null),tr([(0,k.H)(a.zS.cube_delete_child)],nr.prototype,"delete_cube",null);class rr{static add(e,t,n){return{id:e,name:a.Ny.add,data:t,pos:n}}static remove(e,t){return{id:e,name:a.Ny.remove,range:t}}static indent(e,t){return{id:e,name:a.Ny.indent,items:t}}static status(e,t,n){return{id:e,name:a.Ny.status,index:t,done:n}}}const ir=["id","data-type"],sr=["onClick"],or=(0,c.pM)({__name:"cube-todo",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:n}=t;return(t,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-todo",id:t.cube.id,style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).todo,onContextmenu:r[0]||(r[0]=e=>(0,l.R1)(at.uz)(e,t.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.items,(r,i)=>((0,c.uX)(),(0,c.CE)("div",{key:r.data.id,class:"todoitem",style:(0,d.Tr)({"margin-left":r.indent*(0,l.R1)(n).data.line_indent+"px"})},[(0,c.Lk)("div",{class:(0,d.C4)(["todoitem-status",{active:r.done}]),onClick:()=>function(t,n){const r=rr.status(e.cube.id,n,!t.done),i=e.cube.courier.get_recorder();i.tell(e.cube,r),e.cube.history.record(i)}(r,i)},null,10,sr),(0,c.bF)(S,{class:"todoitem-box",cube:r.data,onKeydown:e=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{indent:a}=n,l=n.data;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(a);n.tell(t,rr.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(a);n.tell(t,rr.add(t.id,[o],r)),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:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,rr.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!1}];a.tell(t,rr.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,rr.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!0}];a.tell(t,rr.indent(t.id,e)),s.record(a)}}}(e,t.cube,r,i)},null,8,["cube","onKeydown"])],4))),128))],44,ir))}}),ar=(0,f.A)(or,[["__scopeId","data-v-33222767"]]);function lr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class cr extends o._D{_component=ar;items=(0,l.Kh)([]);get component(){return this._component}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return cr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new xt(t.data,this),n={done:t.done,indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=this.base_export();e.info=[];for(let t of this.items)e.info.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 r=this.items.slice(e,t);for(let e of r)n.info.push({done:e.done,indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({done:e.done,indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return cr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new xt(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:xt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new xt(e.data,this);let n={done:e.done,indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(rr.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(s<=0&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(rr.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_todoitem(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];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),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(rr.indent(this.id,i)),r}update_status(e){const{courier:t}=this,{index:n,done:r}=e,i=t.get_recorder();i.add_cmd(e);const s=this.items[n];if(s)return s.done=r,i.add_recover(rr.status(this.id,n,!r)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=rr.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=xt.get_default();return{id:(0,s.Ak)(),type:a.u0.todo,info:[{done:!1,indent:0,data:e}],attrs:{},css:{}}}static get_todo_item(e,t=!1){const n=g.I.pick(e).sort;return{done:t,indent:0,data:xt.get_default(n)}}static get meta(){return{cubename:"待办列表",type:a.u0.todo,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=xt.replace_id(e,r.data,n);return t}}lr([(0,k.H)(a.Ny.add)],cr.prototype,"add_item",null),lr([(0,k.H)(a.Ny.remove)],cr.prototype,"remove_item",null),lr([(0,k.H)(a.Ny.indent)],cr.prototype,"indent_todoitem",null),lr([(0,k.H)(a.Ny.status)],cr.prototype,"update_status",null),lr([(0,k.H)(a.zS.cube_delete_child)],cr.prototype,"on_delete_child",null);var dr=n(3803);const ur=["id","data-type"],hr=(0,c.pM)({__name:"cube-list",props:{cube:{}},setup(e){const{config:t}=e.cube;return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-list",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).list,onContextmenu:n[0]||(n[0]=t=>(0,l.R1)(at.uz)(t,e.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.items,(r,i)=>((0,c.uX)(),(0,c.CE)("div",{key:r.data.id,class:"listitem",style:(0,d.Tr)({"margin-left":r.indent*(0,l.R1)(t).data.line_indent+"px"})},[n[1]||(n[1]=(0,c.Lk)("div",{class:"listitem-symbol"},null,-1)),(0,c.bF)(S,{class:"listitem-box",cube:r.data,onKeydown:t=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,dr.o.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,dr.o.add(t.id,[o],r)),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:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,dr.o.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,dr.o.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,dr.o.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,dr.o.indent(t.id,e)),s.record(a)}}}(t,e.cube,r,i)},null,8,["cube","onKeydown"])],4))),128))],44,ur))}}),pr=(0,f.A)(hr,[["__scopeId","data-v-4c4b9f9c"]]);function fr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class mr extends o._D{_component=pr;items=(0,l.Kh)([]);get component(){return this._component}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return mr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new xt(t.data,this),n={indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=this.base_export();e.info=[];for(let t of this.items)e.info.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 r=this.items.slice(e,t);for(let e of r)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return mr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new xt(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:xt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new xt(e.data,this);let n={indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(dr.o.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(0===s&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(dr.o.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_item(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];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),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(dr.o.indent(this.id,i)),r}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=dr.o.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=xt.get_default();return{id:(0,s.Ak)(),type:a.u0.list,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:xt.get_default(g.I.pick(e).sort)}}static get meta(){return{cubename:"列表",type:a.u0.list,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=xt.replace_id(e,r.data,n);return t}}fr([(0,k.H)(a.JC.add)],mr.prototype,"add_item",null),fr([(0,k.H)(a.JC.remove)],mr.prototype,"remove_item",null),fr([(0,k.H)(a.JC.indent)],mr.prototype,"indent_item",null),fr([(0,k.H)(a.zS.cube_delete_child)],mr.prototype,"on_delete_child",null);class _r{static add(e,t,n){return{id:e,name:a.mM.add,data:t,pos:n}}static remove(e,t){return{id:e,name:a.mM.remove,range:t}}static indent(e,t){return{id:e,name:a.mM.indent,items:t}}}const gr=["id","data-type"],br={class:"listitem-symbol"},vr=(0,c.pM)({__name:"cube-list-ordered",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:n}=t;return(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-list-ordered",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).list_ordered,onContextmenu:t[0]||(t[0]=t=>(0,l.R1)(at.uz)(t,e.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.items,(t,r)=>((0,c.uX)(),(0,c.CE)("div",{key:t.data.id,class:"listitem",style:(0,d.Tr)({"margin-left":t.indent*(0,l.R1)(n).data.line_indent+"px"})},[(0,c.Lk)("div",br,(0,d.v_)(r+1),1),(0,c.bF)(S,{class:"listitem-box",cube:t.data,onKeydown:n=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,_r.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,_r.add(t.id,[o],r)),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:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,_r.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,_r.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,_r.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,_r.indent(t.id,e)),s.record(a)}}}(n,e.cube,t,r)},null,8,["cube","onKeydown"])],4))),128))],44,gr))}}),yr=(0,f.A)(vr,[["__scopeId","data-v-743fd90a"]]);function wr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class xr extends o._D{items=(0,l.Kh)([]);get component(){return yr}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return xr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new xt(t.data,this),n={indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}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}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const r=this.items.slice(e,t);for(let e of r)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return xr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new xt(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:xt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new xt(e.data,this);let n={indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(_r.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(0===s&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(_r.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_item(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];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),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(_r.indent(this.id,i)),r}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=_r.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=xt.get_default();return{id:g.I.get_id(),type:a.u0.list_ordered,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:xt.get_default(g.I.pick(e).sort)}}static get meta(){return{cubename:"有序列表",type:a.u0.list_ordered,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=xt.replace_id(e,r.data,n);return t}}wr([(0,k.H)(a.mM.add)],xr.prototype,"add_item",null),wr([(0,k.H)(a.mM.remove)],xr.prototype,"remove_item",null),wr([(0,k.H)(a.mM.indent)],xr.prototype,"indent_item",null),wr([(0,k.H)(a.zS.cube_delete_child)],xr.prototype,"on_delete_child",null);class kr{static update(e,t,n){return{id:e,name:a.GW.code_update,code:n,tabid:t}}static add(e,t,n=!0){return{id:e,name:a.GW.code_add,item:(0,l.ux)(t),focus:n}}static remove(e,t){return{id:e,name:a.GW.code_remove,tabid:t}}static rename(e,t,n){return{id:e,name:a.GW.code_rename,tabid:t,filename:n}}static change_lang(e,t,n){return{id:e,name:a.GW.change_lang,tabid:t,lang:n}}static change_active(e,t){return{id:e,name:a.GW.change_active,tabid:t}}static change_theme(e,t,n){return{id:e,tabid:t,theme:n,name:a.GW.change_theme}}}const Sr=[{id:"abap",name:"ABAP",import:()=>n.e(8617).then(n.bind(n,8617))},{id:"actionscript-3",name:"ActionScript",import:()=>n.e(3516).then(n.bind(n,3516))},{id:"ada",name:"Ada",import:()=>n.e(7561).then(n.bind(n,7561))},{id:"angular-html",name:"Angular HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(535)]).then(n.bind(n,535))},{id:"angular-ts",name:"Angular TypeScript",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7611),n.e(535),n.e(4886)]).then(n.bind(n,4886))},{id:"apache",name:"Apache Conf",import:()=>n.e(7625).then(n.bind(n,7625))},{id:"apex",name:"Apex",import:()=>n.e(9819).then(n.bind(n,9819))},{id:"apl",name:"APL",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(7504)]).then(n.bind(n,7504))},{id:"applescript",name:"AppleScript",import:()=>n.e(2108).then(n.bind(n,2108))},{id:"ara",name:"Ara",import:()=>n.e(5611).then(n.bind(n,5611))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>n.e(4354).then(n.bind(n,4354))},{id:"asm",name:"Assembly",import:()=>n.e(6324).then(n.bind(n,6324))},{id:"astro",name:"Astro",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4714),n.e(6940),n.e(4408)]).then(n.bind(n,4408))},{id:"awk",name:"AWK",import:()=>n.e(4862).then(n.bind(n,4862))},{id:"ballerina",name:"Ballerina",import:()=>n.e(5141).then(n.bind(n,5141))},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>n.e(2068).then(n.bind(n,2068))},{id:"beancount",name:"Beancount",import:()=>n.e(5026).then(n.bind(n,5026))},{id:"berry",name:"Berry",aliases:["be"],import:()=>n.e(8753).then(n.bind(n,8753))},{id:"bibtex",name:"BibTeX",import:()=>n.e(4009).then(n.bind(n,4009))},{id:"bicep",name:"Bicep",import:()=>n.e(7688).then(n.bind(n,7688))},{id:"blade",name:"Blade",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(5283)]).then(n.bind(n,5283))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>n.e(5314).then(n.bind(n,5314))},{id:"c",name:"C",import:()=>n.e(5814).then(n.bind(n,5814))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>n.e(5728).then(n.bind(n,5728))},{id:"cairo",name:"Cairo",import:()=>Promise.all([n.e(2473),n.e(8237)]).then(n.bind(n,8237))},{id:"clarity",name:"Clarity",import:()=>n.e(6677).then(n.bind(n,6677))},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>n.e(7681).then(n.bind(n,7681))},{id:"cmake",name:"CMake",import:()=>n.e(5936).then(n.bind(n,5936))},{id:"cobol",name:"COBOL",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(780)]).then(n.bind(n,780))},{id:"codeowners",name:"CODEOWNERS",import:()=>n.e(9096).then(n.bind(n,9096))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>n.e(6283).then(n.bind(n,6283))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>Promise.all([n.e(7258),n.e(6563)]).then(n.bind(n,6563))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>n.e(489).then(n.bind(n,489))},{id:"coq",name:"Coq",import:()=>n.e(8418).then(n.bind(n,8418))},{id:"cpp",name:"C++",aliases:["c++"],import:()=>Promise.all([n.e(1230),n.e(5814),n.e(4914)]).then(n.bind(n,4914))},{id:"crystal",name:"Crystal",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1230),n.e(5814),n.e(3894),n.e(3403)]).then(n.bind(n,3403))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>n.e(2354).then(n.bind(n,2354))},{id:"css",name:"CSS",import:()=>n.e(1708).then(n.bind(n,1708))},{id:"csv",name:"CSV",import:()=>n.e(8849).then(n.bind(n,1230))},{id:"cue",name:"CUE",import:()=>n.e(172).then(n.bind(n,172))},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>n.e(9806).then(n.bind(n,9806))},{id:"d",name:"D",import:()=>n.e(5177).then(n.bind(n,5177))},{id:"dart",name:"Dart",import:()=>n.e(9728).then(n.bind(n,9728))},{id:"dax",name:"DAX",import:()=>n.e(874).then(n.bind(n,874))},{id:"desktop",name:"Desktop",import:()=>n.e(6173).then(n.bind(n,6173))},{id:"diff",name:"Diff",import:()=>n.e(7670).then(n.bind(n,7670))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>n.e(415).then(n.bind(n,415))},{id:"dotenv",name:"dotEnv",import:()=>n.e(2173).then(n.bind(n,2173))},{id:"dream-maker",name:"Dream Maker",import:()=>n.e(3227).then(n.bind(n,3227))},{id:"edge",name:"Edge",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(3052)]).then(n.bind(n,3052))},{id:"elixir",name:"Elixir",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(3330)]).then(n.bind(n,3330))},{id:"elm",name:"Elm",import:()=>Promise.all([n.e(5814),n.e(9641)]).then(n.bind(n,9641))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>n.e(2505).then(n.bind(n,2505))},{id:"erb",name:"ERB",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(4007),n.e(9524)]).then(n.bind(n,9524))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>Promise.all([n.e(7900),n.e(2266)]).then(n.bind(n,2266))},{id:"fennel",name:"Fennel",import:()=>n.e(1631).then(n.bind(n,1631))},{id:"fish",name:"Fish",import:()=>n.e(9661).then(n.bind(n,9661))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>n.e(9077).then(n.bind(n,9077))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>Promise.all([n.e(8553),n.e(7549)]).then(n.bind(n,7549))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>n.e(8553).then(n.bind(n,8553))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>Promise.all([n.e(7900),n.e(9689)]).then(n.bind(n,9689))},{id:"gdresource",name:"GDResource",import:()=>n.e(7434).then(n.bind(n,7434))},{id:"gdscript",name:"GDScript",import:()=>n.e(4311).then(n.bind(n,4311))},{id:"gdshader",name:"GDShader",import:()=>n.e(6405).then(n.bind(n,6405))},{id:"genie",name:"Genie",import:()=>n.e(9017).then(n.bind(n,9017))},{id:"gherkin",name:"Gherkin",import:()=>n.e(4451).then(n.bind(n,4451))},{id:"git-commit",name:"Git Commit Message",import:()=>n.e(2861).then(n.bind(n,2861))},{id:"git-rebase",name:"Git Rebase Message",import:()=>Promise.all([n.e(3894),n.e(638)]).then(n.bind(n,638))},{id:"gleam",name:"Gleam",import:()=>n.e(8201).then(n.bind(n,8201))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(8700)]).then(n.bind(n,8700))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(5050)]).then(n.bind(n,5050))},{id:"glsl",name:"GLSL",import:()=>Promise.all([n.e(5814),n.e(2723)]).then(n.bind(n,2723))},{id:"gnuplot",name:"Gnuplot",import:()=>n.e(396).then(n.bind(n,396))},{id:"go",name:"Go",import:()=>n.e(3941).then(n.bind(n,3941))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>Promise.all([n.e(7258),n.e(4714),n.e(6940),n.e(6262),n.e(3170)]).then(n.bind(n,3170))},{id:"groovy",name:"Groovy",import:()=>n.e(1037).then(n.bind(n,1037))},{id:"hack",name:"Hack",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1230),n.e(6356)]).then(n.bind(n,6356))},{id:"haml",name:"Ruby Haml",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(3949)]).then(n.bind(n,3949))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1655)]).then(n.bind(n,1655))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>n.e(9045).then(n.bind(n,9045))},{id:"haxe",name:"Haxe",import:()=>n.e(8107).then(n.bind(n,8107))},{id:"hcl",name:"HashiCorp HCL",import:()=>n.e(6124).then(n.bind(n,6124))},{id:"hjson",name:"Hjson",import:()=>n.e(5203).then(n.bind(n,5203))},{id:"hlsl",name:"HLSL",import:()=>n.e(4598).then(n.bind(n,4598))},{id:"html",name:"HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940)]).then(n.bind(n,4940))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(914)]).then(n.bind(n,914))},{id:"http",name:"HTTP",import:()=>Promise.all([n.e(7258),n.e(4714),n.e(6967),n.e(3894),n.e(6940),n.e(6262),n.e(3170),n.e(5119)]).then(n.bind(n,5119))},{id:"hxml",name:"HXML",import:()=>n.e(8320).then(n.bind(n,8320))},{id:"hy",name:"Hy",import:()=>n.e(7470).then(n.bind(n,7470))},{id:"imba",name:"Imba",import:()=>n.e(3702).then(n.bind(n,3702))},{id:"ini",name:"INI",aliases:["properties"],import:()=>n.e(6343).then(n.bind(n,6343))},{id:"java",name:"Java",import:()=>n.e(6967).then(n.bind(n,6967))},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>n.e(7258).then(n.bind(n,7258))},{id:"jinja",name:"Jinja",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(3837)]).then(n.bind(n,3837))},{id:"jison",name:"Jison",import:()=>Promise.all([n.e(7258),n.e(5536)]).then(n.bind(n,5536))},{id:"json",name:"JSON",import:()=>n.e(5709).then(n.bind(n,5709))},{id:"json5",name:"JSON5",import:()=>n.e(6010).then(n.bind(n,6010))},{id:"jsonc",name:"JSON with Comments",import:()=>n.e(212).then(n.bind(n,212))},{id:"jsonl",name:"JSON Lines",import:()=>n.e(4843).then(n.bind(n,4843))},{id:"jsonnet",name:"Jsonnet",import:()=>n.e(4962).then(n.bind(n,4962))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>n.e(7922).then(n.bind(n,7922))},{id:"jsx",name:"JSX",import:()=>n.e(6262).then(n.bind(n,6262))},{id:"julia",name:"Julia",aliases:["jl"],import:()=>Promise.all([n.e(7258),n.e(1230),n.e(5814),n.e(4914),n.e(2473),n.e(9983),n.e(9910)]).then(n.bind(n,9910))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>n.e(2660).then(n.bind(n,2660))},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>n.e(6297).then(n.bind(n,6297))},{id:"latex",name:"LaTeX",import:()=>Promise.all([n.e(9983),n.e(7817)]).then(n.bind(n,7817))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>n.e(8003).then(n.bind(n,8003))},{id:"less",name:"Less",import:()=>n.e(6964).then(n.bind(n,6964))},{id:"liquid",name:"Liquid",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(327)]).then(n.bind(n,327))},{id:"llvm",name:"LLVM IR",import:()=>n.e(3972).then(n.bind(n,1591))},{id:"log",name:"Log file",import:()=>n.e(3247).then(n.bind(n,3247))},{id:"logo",name:"Logo",import:()=>n.e(9730).then(n.bind(n,9730))},{id:"lua",name:"Lua",import:()=>Promise.all([n.e(5814),n.e(4199)]).then(n.bind(n,4199))},{id:"luau",name:"Luau",import:()=>n.e(5744).then(n.bind(n,5744))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>n.e(1757).then(n.bind(n,1757))},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>n.e(7900).then(n.bind(n,7900))},{id:"marko",name:"Marko",import:()=>Promise.all([n.e(1708),n.e(4714),n.e(7611),n.e(6964),n.e(9175)]).then(n.bind(n,9175))},{id:"matlab",name:"MATLAB",import:()=>n.e(2492).then(n.bind(n,2492))},{id:"mdc",name:"MDC",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7900),n.e(2215)]).then(n.bind(n,2215))},{id:"mdx",name:"MDX",import:()=>n.e(4452).then(n.bind(n,4452))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>n.e(2860).then(n.bind(n,2860))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>n.e(8499).then(n.bind(n,8499))},{id:"mojo",name:"Mojo",import:()=>n.e(9526).then(n.bind(n,9526))},{id:"move",name:"Move",import:()=>n.e(9104).then(n.bind(n,9104))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>n.e(6239).then(n.bind(n,6239))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>n.e(9876).then(n.bind(n,9876))},{id:"nginx",name:"Nginx",import:()=>Promise.all([n.e(5814),n.e(697)]).then(n.bind(n,697))},{id:"nim",name:"Nim",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(5814),n.e(7900),n.e(4697)]).then(n.bind(n,4697))},{id:"nix",name:"Nix",import:()=>n.e(8212).then(n.bind(n,8212))},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>n.e(7374).then(n.bind(n,7374))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>n.e(7148).then(n.bind(n,7148))},{id:"objective-cpp",name:"Objective-C++",import:()=>n.e(9788).then(n.bind(n,9788))},{id:"ocaml",name:"OCaml",import:()=>n.e(9057).then(n.bind(n,9057))},{id:"pascal",name:"Pascal",import:()=>n.e(9079).then(n.bind(n,9079))},{id:"perl",name:"Perl",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(9984)]).then(n.bind(n,9984))},{id:"php",name:"PHP",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(7765),n.e(7966)]).then(n.bind(n,7765))},{id:"plsql",name:"PL/SQL",import:()=>n.e(8389).then(n.bind(n,8389))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>n.e(4520).then(n.bind(n,4520))},{id:"polar",name:"Polar",import:()=>n.e(9845).then(n.bind(n,9845))},{id:"postcss",name:"PostCSS",import:()=>n.e(9270).then(n.bind(n,9270))},{id:"powerquery",name:"PowerQuery",import:()=>n.e(454).then(n.bind(n,454))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>n.e(1476).then(n.bind(n,1476))},{id:"prisma",name:"Prisma",import:()=>n.e(5731).then(n.bind(n,5731))},{id:"prolog",name:"Prolog",import:()=>n.e(9206).then(n.bind(n,9206))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>n.e(5891).then(n.bind(n,5891))},{id:"pug",name:"Pug",aliases:["jade"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6757)]).then(n.bind(n,6757))},{id:"puppet",name:"Puppet",import:()=>n.e(3593).then(n.bind(n,3593))},{id:"purescript",name:"PureScript",import:()=>n.e(9904).then(n.bind(n,9904))},{id:"python",name:"Python",aliases:["py"],import:()=>n.e(2473).then(n.bind(n,2473))},{id:"qml",name:"QML",import:()=>Promise.all([n.e(7258),n.e(1803)]).then(n.bind(n,1803))},{id:"qmldir",name:"QML Directory",import:()=>n.e(4292).then(n.bind(n,4292))},{id:"qss",name:"Qt Style Sheets",import:()=>n.e(402).then(n.bind(n,402))},{id:"r",name:"R",import:()=>n.e(9983).then(n.bind(n,9983))},{id:"racket",name:"Racket",import:()=>n.e(9281).then(n.bind(n,9281))},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>n.e(9780).then(n.bind(n,9780))},{id:"razor",name:"ASP.NET Razor",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(2354),n.e(245)]).then(n.bind(n,245))},{id:"reg",name:"Windows Registry Script",import:()=>n.e(5827).then(n.bind(n,5827))},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>n.e(3124).then(n.bind(n,3124))},{id:"rel",name:"Rel",import:()=>n.e(3043).then(n.bind(n,5424))},{id:"riscv",name:"RISC-V",import:()=>n.e(8684).then(n.bind(n,8684))},{id:"rst",name:"reStructuredText",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(2473),n.e(4007),n.e(8234)]).then(n.bind(n,8234))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(4007)]).then(n.bind(n,4007))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>n.e(7145).then(n.bind(n,7145))},{id:"sas",name:"SAS",import:()=>Promise.all([n.e(1230),n.e(9478)]).then(n.bind(n,9478))},{id:"sass",name:"Sass",import:()=>n.e(8709).then(n.bind(n,8709))},{id:"scala",name:"Scala",import:()=>n.e(3947).then(n.bind(n,3947))},{id:"scheme",name:"Scheme",import:()=>n.e(9982).then(n.bind(n,9982))},{id:"scss",name:"SCSS",import:()=>Promise.all([n.e(1708),n.e(7611)]).then(n.bind(n,7611))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>n.e(1624).then(n.bind(n,1624))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>n.e(8249).then(n.bind(n,8249))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>n.e(3894).then(n.bind(n,3894))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>Promise.all([n.e(3894),n.e(9965)]).then(n.bind(n,9965))},{id:"smalltalk",name:"Smalltalk",import:()=>n.e(1066).then(n.bind(n,1066))},{id:"solidity",name:"Solidity",import:()=>n.e(4780).then(n.bind(n,4780))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7642)]).then(n.bind(n,7642))},{id:"sparql",name:"SPARQL",import:()=>n.e(4108).then(n.bind(n,4108))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>n.e(6514).then(n.bind(n,6514))},{id:"sql",name:"SQL",import:()=>n.e(1230).then(n.bind(n,8849))},{id:"ssh-config",name:"SSH Config",import:()=>n.e(3874).then(n.bind(n,3874))},{id:"stata",name:"Stata",import:()=>Promise.all([n.e(1230),n.e(542)]).then(n.bind(n,542))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>n.e(41).then(n.bind(n,41))},{id:"svelte",name:"Svelte",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4714),n.e(3454)]).then(n.bind(n,3454))},{id:"swift",name:"Swift",import:()=>n.e(8436).then(n.bind(n,8436))},{id:"system-verilog",name:"SystemVerilog",import:()=>n.e(6577).then(n.bind(n,6577))},{id:"systemd",name:"Systemd Units",import:()=>n.e(16).then(n.bind(n,16))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>n.e(4660).then(n.bind(n,4660))},{id:"tasl",name:"Tasl",import:()=>n.e(1839).then(n.bind(n,1839))},{id:"tcl",name:"Tcl",import:()=>n.e(7328).then(n.bind(n,7328))},{id:"templ",name:"Templ",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(3941),n.e(7095)]).then(n.bind(n,7095))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>n.e(4385).then(n.bind(n,4385))},{id:"tex",name:"TeX",import:()=>Promise.all([n.e(9983),n.e(9198)]).then(n.bind(n,9198))},{id:"toml",name:"TOML",import:()=>n.e(5363).then(n.bind(n,5363))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(9556)]).then(n.bind(n,9556))},{id:"tsv",name:"TSV",import:()=>n.e(6045).then(n.bind(n,8426))},{id:"tsx",name:"TSX",import:()=>n.e(6940).then(n.bind(n,6940))},{id:"turtle",name:"Turtle",import:()=>n.e(4877).then(n.bind(n,4877))},{id:"twig",name:"Twig",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(2473),n.e(7611),n.e(4007),n.e(7765),n.e(4236)]).then(n.bind(n,4236))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>n.e(4714).then(n.bind(n,4714))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>n.e(794).then(n.bind(n,794))},{id:"typst",name:"Typst",aliases:["typ"],import:()=>n.e(8711).then(n.bind(n,8711))},{id:"v",name:"V",import:()=>n.e(5443).then(n.bind(n,5443))},{id:"vala",name:"Vala",import:()=>n.e(7141).then(n.bind(n,7141))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>n.e(8235).then(n.bind(n,8235))},{id:"verilog",name:"Verilog",import:()=>n.e(4283).then(n.bind(n,4283))},{id:"vhdl",name:"VHDL",import:()=>n.e(5521).then(n.bind(n,5521))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>n.e(7567).then(n.bind(n,7567))},{id:"vue",name:"Vue",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(1432)]).then(n.bind(n,1432))},{id:"vue-html",name:"Vue HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(1432),n.e(7789)]).then(n.bind(n,7789))},{id:"vue-vine",name:"Vue Vine",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(7611),n.e(6964),n.e(1432),n.e(41),n.e(5954)]).then(n.bind(n,5954))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>n.e(845).then(n.bind(n,845))},{id:"wasm",name:"WebAssembly",import:()=>n.e(7615).then(n.bind(n,7615))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>n.e(8393).then(n.bind(n,8393))},{id:"wgsl",name:"WGSL",import:()=>n.e(5884).then(n.bind(n,5884))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>n.e(2062).then(n.bind(n,2062))},{id:"wit",name:"WebAssembly Interface Types",import:()=>n.e(6957).then(n.bind(n,6957))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>n.e(5589).then(n.bind(n,5589))},{id:"xml",name:"XML",import:()=>Promise.all([n.e(6967),n.e(5585)]).then(n.bind(n,7966))},{id:"xsl",name:"XSL",import:()=>Promise.all([n.e(6967),n.e(5628)]).then(n.bind(n,5628))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>n.e(4546).then(n.bind(n,4546))},{id:"zenscript",name:"ZenScript",import:()=>n.e(5099).then(n.bind(n,5099))},{id:"zig",name:"Zig",import:()=>n.e(3279).then(n.bind(n,3279))}],Cr=Object.fromEntries(Sr.map(e=>[e.id,e.import])),Mr=Object.fromEntries(Sr.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Tr={...Cr,...Mr},Lr=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>n.e(2691).then(n.bind(n,2691))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>n.e(7768).then(n.bind(n,7768))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>n.e(7927).then(n.bind(n,7927))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>n.e(1216).then(n.bind(n,1216))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>n.e(7788).then(n.bind(n,7788))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>n.e(2071).then(n.bind(n,2071))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>n.e(9692).then(n.bind(n,9692))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>n.e(3032).then(n.bind(n,3032))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>n.e(8485).then(n.bind(n,8485))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>n.e(284).then(n.bind(n,284))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>n.e(1545).then(n.bind(n,1545))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>n.e(6083).then(n.bind(n,6083))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>n.e(5647).then(n.bind(n,5647))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>n.e(9179).then(n.bind(n,9179))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>n.e(9976).then(n.bind(n,9976))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>n.e(9831).then(n.bind(n,9831))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>n.e(9809).then(n.bind(n,9809))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>n.e(9681).then(n.bind(n,9681))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>n.e(1425).then(n.bind(n,1425))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>n.e(6865).then(n.bind(n,6865))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>n.e(7824).then(n.bind(n,7824))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>n.e(3646).then(n.bind(n,3646))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>n.e(2419).then(n.bind(n,2419))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>n.e(9225).then(n.bind(n,9225))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>n.e(4112).then(n.bind(n,4112))},{id:"houston",displayName:"Houston",type:"dark",import:()=>n.e(8931).then(n.bind(n,8931))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>n.e(2184).then(n.bind(n,2184))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>n.e(2142).then(n.bind(n,2142))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>n.e(5638).then(n.bind(n,5638))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>n.e(7831).then(n.bind(n,7831))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>n.e(8426).then(n.bind(n,6045))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>n.e(3492).then(n.bind(n,3492))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>n.e(3720).then(n.bind(n,3720))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>n.e(9294).then(n.bind(n,9294))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>n.e(4081).then(n.bind(n,4081))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>n.e(1729).then(n.bind(n,1729))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>n.e(4614).then(n.bind(n,4614))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>n.e(2934).then(n.bind(n,2934))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>n.e(2535).then(n.bind(n,2535))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>n.e(4214).then(n.bind(n,4214))},{id:"nord",displayName:"Nord",type:"dark",import:()=>n.e(4552).then(n.bind(n,4552))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>n.e(6736).then(n.bind(n,6736))},{id:"one-light",displayName:"One Light",type:"light",import:()=>n.e(3906).then(n.bind(n,3906))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>n.e(4445).then(n.bind(n,4445))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>n.e(4465).then(n.bind(n,4465))},{id:"red",displayName:"Red",type:"dark",import:()=>n.e(6980).then(n.bind(n,6980))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>n.e(753).then(n.bind(n,753))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>n.e(5424).then(n.bind(n,3043))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>n.e(8093).then(n.bind(n,8093))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>n.e(4838).then(n.bind(n,4838))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>n.e(5601).then(n.bind(n,5601))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>n.e(1857).then(n.bind(n,1857))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>n.e(7217).then(n.bind(n,7217))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>n.e(1931).then(n.bind(n,1931))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>n.e(321).then(n.bind(n,321))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>n.e(5034).then(n.bind(n,5034))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>n.e(224).then(n.bind(n,224))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>n.e(5542).then(n.bind(n,5542))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>n.e(6517).then(n.bind(n,6517))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>n.e(5143).then(n.bind(n,5143))}],zr=Object.fromEntries(Lr.map(e=>[e.id,e.import]));class Ar extends Error{constructor(e){super(e),this.name="ShikiError"}}function Pr(e){return Array.isArray(e)?function(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Pr(e[n]);return t}(e):e instanceof RegExp?e:"object"==typeof e?function(e){let t={};for(let n in e)t[n]=Pr(e[n]);return t}(e):e}function Rr(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Nr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t===e.length-1?Nr(e.substring(0,e.length-1)):e.substr(1+~t)}var Er=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Or=class{static hasCaptures(e){return null!==e&&(Er.lastIndex=0,Er.test(e))}static replaceCaptures(e,t,n){return e.replace(Er,(e,r,i,s)=>{let o=n[parseInt(r||i,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 Ir(e,t){return e<t?-1:e>t?1:0}function Br(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Ir(e[r],t[r]);if(0!==n)return n}return 0}return n-r}function Dr(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 Vr(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Hr=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}},jr=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=[],r=0;for(let e=0,i=t.length;e<i;e++){let i,s=t[e];if(!s.settings)continue;if("string"==typeof s.scope){let e=s.scope;e=e.replace(/^[,]+/,""),e=e.replace(/[,]+$/,""),i=e.split(",")}else i=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&&Dr(s.settings.foreground)&&(a=s.settings.foreground);let l=null;"string"==typeof s.settings.background&&Dr(s.settings.background)&&(l=s.settings.background);for(let t=0,s=i.length;t<s;t++){let s=i[t].trim().split(" "),c=s[s.length-1],d=null;s.length>1&&(d=s.slice(0,s.length-1),d.reverse()),n[r++]=new $r(c,d,e,o,a,l)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{let n=Ir(e.scope,t.scope);return 0!==n?n:(n=Br(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(r=t.foreground),null!==t.background&&(i=t.background)}let s=new Xr(t),o=new qr(n,s.getId(r),s.getId(i)),a=new Yr(new Wr(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 jr(s,o,a)}(e,t)}_cachedMatchRoot=new Hr(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 r=t[n],i=!1;if(">"===r){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Ur(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}(e.parent,t.parentScopes));return n?new qr(n.fontStyle,n.foreground,n.background):null}},Fr=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(const r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);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 Ur(e,t){return t===e||e.startsWith(t)&&"."===e[t.length]}var qr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}},$r=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},Gr=(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))(Gr||{}),Xr=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)}},Kr=Object.freeze([]),Wr=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Kr,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r)}},Yr=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,r=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[r]&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){const i=t.parentScopes[r].length-e.parentScopes[n].length;if(0!==i)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,r=t.indexOf(".");if(-1===r?(e=t,n=""):(e=t.substring(0,r),n=t.substring(r+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,r,i,s,o){if(""===n)return void this._doInsertHere(t,r,i,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(),Wr.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,l,r,i,s,o)}_doInsertHere(e,t,n,r,i){if(null!==t){for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let o=this._rulesWithParentScopes[s];if(0===Br(o.parentScopes,t))return void o.acceptOverwrite(e,n,r,i)}-1===n&&(n=this._mainRule.fontStyle),0===r&&(r=this._mainRule.foreground),0===i&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Wr(e,t,n,r,i))}else this._mainRule.acceptOverwrite(e,n,r,i)}},Zr=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){const n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),s=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,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,r,i,s,o,a){let l=e.getLanguageId(t),c=e.getTokenType(t),d=e.containsBalancedBrackets(t)?1:0,u=e.getFontStyle(t),h=e.getForeground(t),p=e.getBackground(t);return 0!==n&&(l=n),8!==r&&(c=r),null!==i&&(d=i?1:0),-1!==s&&(u=s),0!==o&&(h=o),0!==a&&(p=a),(l|c<<8|d<<10|u<<11|h<<15|p<<24)>>>0}};function Qr(e){return e}function Jr(e,t){const n=[],r=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}(e);let i=r.next();for(;null!==i;){let e=0;if(2===i.length&&":"===i.charAt(1)){switch(i.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),","!==i)break;i=r.next()}return n;function s(){if("-"===i){i=r.next();const e=s();return t=>!!e&&!e(t)}if("("===i){i=r.next();const e=function(){const e=[];let t=o();for(;t&&(e.push(t),"|"===i||","===i);){do{i=r.next()}while("|"===i||","===i);t=o()}return t=>e.some(e=>e(t))}();return")"===i&&(i=r.next()),e}if(ei(i)){const e=[];do{e.push(i),i=r.next()}while(ei(i));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 ei(e){return!!e&&!!e.match(/[\w\.:]+/)}function ti(e){"function"==typeof e.dispose&&e.dispose()}var ni=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ri=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ii=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))}},si=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new ni(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new ii;for(const n of e)oi(n,this.initialScopeName,this.repo,t);for(const e of t.references)if(e instanceof ni){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 oi(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof ni?li({baseGrammar:s,selfGrammar:i},r):ai(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const e of o)r.add(new ni(e))}function ai(e,t,n){t.repository&&t.repository[e]&&ci([t.repository[e]],t,n)}function li(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ci(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ci(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ci(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const e=r.repository?Rr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&ci(r.patterns,{...t,repository:e},n);const i=r.include;if(!i)continue;const s=mi(i);switch(s.kind){case 0:li({...t,selfGrammar:t.baseGrammar},n);break;case 1:li(t,n);break;case 2:ai(s.ruleName,{...t,repository:e},n);break;case 3:case 4:const r=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){const i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};4===s.kind?ai(s.ruleName,i,n):li(i,n)}else 4===s.kind?n.add(new ri(s.scopeName,s.ruleName)):n.add(new ni(s.scopeName))}}}var di=class{kind=0},ui=class{kind=1},hi=class{constructor(e){this.ruleName=e}kind=2},pi=class{constructor(e){this.scopeName=e}kind=3},fi=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function mi(e){if("$base"===e)return new di;if("$self"===e)return new ui;const t=e.indexOf("#");if(-1===t)return new pi(e);if(0===t)return new hi(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new fi(n,r)}}var _i=/\\(\d+)/,gi=/\\(\d+)/g;Symbol("RuleId");var bi=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Or.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Or.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Nr(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?Or.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?Or.replaceCaptures(this._contentName,e,t):this._contentName}},vi=class extends bi{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},yi=class extends bi{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ci(r,this.id),this.captures=i,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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Mi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},wi=class extends bi{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Mi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},xi=class extends bi{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,s,o,a,l,c){super(e,t,n,r),this._begin=new Ci(i,this.id),this.beginCaptures=s,this._end=new Ci(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,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Mi;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}},ki=class extends bi{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,s,o,a,l){super(e,t,n,r),this._begin=new Ci(i,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Ci(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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Mi;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,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Mi,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},Si=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new vi(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new yi(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(void 0===t.begin){t.repository&&(r=Rr({},r,t.repository));let i=t.patterns;return void 0===i&&t.include&&(i=[{include:t.include}]),new wi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new ki(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new xi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];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++)i[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,r)),i[o]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,a)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const o=t[s];let a=-1;if(o.include){const t=mi(o.include);switch(t.kind){case 0:case 1:a=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(a=e.getCompiledRuleId(i,n,r));break;case 3:case 4:const s=t.scopeName,l=4===t.kind?t.ruleName:null,c=n.getExternalGrammar(s,r);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,r);if(-1!==a){const e=n.getRule(a);let t=!1;if((e instanceof wi||e instanceof xi||e instanceof ki)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ci=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,r=[],i=!1;for(let s=0;s<t;s++)if("\\"===e.charAt(s)&&s+1<t){const t=e.charAt(s+1);"z"===t?(r.push(e.substring(n,s)),r.push("$(?!\\n)(?<!\\n)"),n=s+2):"A"!==t&&"G"!==t||(i=!0),s++}this.hasAnchor=i,0===n?this.source=e:(r.push(e.substring(n,t)),this.source=r.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=_i.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 gi.lastIndex=0,this.source.replace(gi,(e,t)=>Vr(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,r,i=[],s=[],o=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),i[e]=n,s[e]=n,o[e]=n,a[e]=n,"\\"===n&&e+1<t&&(r=this.source.charAt(e+1),"A"===r?(i[e+1]="",s[e+1]="",o[e+1]="A",a[e+1]="A"):"G"===r?(i[e+1]="",s[e+1]="G",o[e+1]="",a[e+1]="G"):(i[e+1]=r,s[e+1]=r,o[e+1]=r,a[e+1]=r),e++);return{A0_G0:i.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}},Mi=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 Ti(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 r=this._items.map(e=>e.resolveAnchors(t,n));return new Ti(e,r,this._items.map(e=>e.ruleId))}},Ti=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 r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Li=class{constructor(e,t){this.languageId=e,this.tokenType=t}},zi=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Li(e,8),this._embeddedLanguagesMatcher=new Ai(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 Li(0,0);_getBasicScopeAttributes=new Hr(e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new Li(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/},Ai=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])=>Vr(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}},Pi=("undefined"!=typeof process&&process.env.VSCODE_TEXTMATE_DEBUG,class{constructor(e,t){this.stack=e,this.stoppedEarly=t}});function Ri(e,t,n,r,i,s,o,a){const l=t.content.length;let c=!1,d=-1;if(o){const o=function(e,t,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let t=i;t;t=t.pop()){const n=t.getRule(e);n instanceof ki&&a.push({rule:n,stack:t})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:a,findOptions:c}=Ei(l.rule,e,l.stack.endRule,n,r===o),d=a.findNextMatchSync(t,r,c);if(!d){i=l.stack.pop();break}if(-2!==d.ruleId){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),Oi(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>r&&(r=d.captureIndices[0].end,n=!1))}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}(e,t,n,r,i,s);i=o.stack,r=o.linePos,n=o.isFirstLine,d=o.anchorPosition}const u=Date.now();for(;!c;){if(0!==a&&Date.now()-u>a)return new Pi(i,!0);h()}return new Pi(i,!1);function h(){const o=function(e,t,n,r,i,s){const o=function(e,t,n,r,i,s){const o=i.getRule(e),{ruleScanner:a,findOptions:l}=Ni(o,e,i.endRule,n,r===s),c=a.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}(e,t,n,r,i,s),a=e.getInjections();if(0===a.length)return o;const l=function(e,t,n,r,i,s,o){let a,l=Number.MAX_VALUE,c=null,d=0;const u=s.contentNameScopesList.getScopeNames();for(let s=0,h=e.length;s<h;s++){const h=e[s];if(!h.matcher(u))continue;const p=t.getRule(h.ruleId),{ruleScanner:f,findOptions:m}=Ni(p,t,null,r,i===o),_=f.findNextMatchSync(n,i,m);if(!_)continue;const g=_.captureIndices[0].start;if(!(g>=l)&&(l=g,c=_.captureIndices,a=_.ruleId,d=h.priority,l===i))break}return c?{priorityMatch:-1===d,captureIndices:c,matchedRuleId:a}:null}(a,e,t,n,r,i,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,r,i,d);if(!o)return s.produce(i,l),void(c=!0);const a=o.captureIndices,u=o.matchedRuleId,h=!!(a&&a.length>0)&&a[0].end>r;if(-1===u){const o=i.getRule(e);s.produce(i,a[0].start),i=i.withContentNameScopesList(i.nameScopesList),Oi(e,t,n,i,s,o.endCaptures,a),s.produce(i,a[0].end);const u=i;if(i=i.parent,d=u.getAnchorPos(),!h&&u.getEnterPos()===r)return i=u,s.produce(i,l),void(c=!0)}else{const o=e.getRule(u);s.produce(i,a[0].start);const p=i,f=o.getName(t.content,a),m=i.contentNameScopesList.pushAttributed(f,e);if(i=i.push(u,r,d,a[0].end===l,null,m,m),o instanceof xi){const r=o;Oi(e,t,n,i,s,r.beginCaptures,a),s.produce(i,a[0].end),d=a[0].end;const u=r.getContentName(t.content,a),f=m.pushAttributed(u,e);if(i=i.withContentNameScopesList(f),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(i))return i=i.pop(),s.produce(i,l),void(c=!0)}else if(o instanceof ki){const r=o;Oi(e,t,n,i,s,r.beginCaptures,a),s.produce(i,a[0].end),d=a[0].end;const u=r.getContentName(t.content,a),f=m.pushAttributed(u,e);if(i=i.withContentNameScopesList(f),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(i))return i=i.pop(),s.produce(i,l),void(c=!0)}else if(Oi(e,t,n,i,s,o.captures,a),s.produce(i,a[0].end),i=i.pop(),!h)return i=i.safePop(),s.produce(i,l),void(c=!0)}a[0].end>r&&(r=a[0].end,n=!1)}}function Ni(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Ei(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Oi(e,t,n,r,i,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 u=o[t];if(0===u.length)continue;if(u.start>d)break;for(;c.length>0&&c[c.length-1].endPos<=u.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,u.start):i.produce(r,u.start),l.retokenizeCapturedWithRuleId){const t=l.getName(a,o),s=r.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(a,o),d=s.pushAttributed(c,e),h=r.push(l.retokenizeCapturedWithRuleId,u.start,-1,!1,null,s,d),p=e.createOnigString(a.substring(0,u.end));Ri(e,p,n&&0===u.start,u.start,h,i,!1,0),ti(p);continue}const h=l.getName(a,o);if(null!==h){const t=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(h,e);c.push(new Ii(t,u.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Ii=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Bi(e,t,n,r,i){const s=Jr(t,Di),o=Si.getCompiledRuleId(n,r,i.repository);for(const n of s)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Di(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Vi(t[r],e))return n=r+1,!0;return!1})}function Vi(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 Hi=class{constructor(e,t,n,r,i,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new zi(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ji(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const e of Object.keys(i)){const t=Jr(e,Di);for(const n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[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 r=n.injections;if(r)for(let t in r)Bi(e,t,r[t],this,n);const i=this._grammarRepository.injections(t);i&&i.forEach(t=>{const n=this.getExternalGrammar(t);if(n){const t=n.injectionSelector;t&&Bi(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]=ji(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){let i;if(-1===this._rootId&&(this._rootId=Si.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==Ui.NULL)i=!1,t.reset();else{i=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Zr.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?Fi.createRootAndLookUpScopeName(s,r,this):Fi.createRoot("unknown",r),t=new Ui(null,this._rootId,-1,-1,!1,null,o,o)}e+="\n";const s=this.createOnigString(e),o=s.content.length,a=new $i(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Ri(this,s,i,0,t,a,!0,r);return ti(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function ji(e,t){return(e=Pr(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 Fi=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const t of n)i=Fr.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Fr(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new Fr(null,t),o=r.themeProvider.themeMatch(s),a=e.mergeAttributes(n,i,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 r=-1,i=0,s=0;return null!==n&&(r=n.fontStyle,i=n.foregroundId,s=n.backgroundId),Zr.set(e,t.languageId,t.tokenType,null,r,i,s)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=e.mergeAttributes(t.tokenAttributes,i,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}},Ui=class e{constructor(e,t,n,r,i,s,o,a){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_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)&&Fi.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,r,i,s,o,a){return new e(this,t,n,r,i,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 r=Fi.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Fi.fromExtension(r,n.contentNameScopesList))}},qi=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):Jr(e,Di).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Jr(e,Di).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}},$i=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,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,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!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=Zr.set(n,0,Qr(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}return r&&(n=Zr.set(n,0,8,r,-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}},Gi=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,r,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,function(e,t,n,r,i,s,o,a){return new Hi(e,t,n,r,i,s,o,a)}(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Xi=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Gi(jr.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(jr.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 qi(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){const s=new si(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(e=>this._loadSingleGrammar(e.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_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,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Ki=Ui.NULL;const Wi=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Yi{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Zi(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Yi(n,r,t)}function Qi(e){return e.toLowerCase()}Yi.prototype.normal={},Yi.prototype.property={},Yi.prototype.space=void 0;class Ji{constructor(e,t){this.attribute=t,this.property=e}}Ji.prototype.attribute="",Ji.prototype.booleanish=!1,Ji.prototype.boolean=!1,Ji.prototype.commaOrSpaceSeparated=!1,Ji.prototype.commaSeparated=!1,Ji.prototype.defined=!1,Ji.prototype.mustUseProperty=!1,Ji.prototype.number=!1,Ji.prototype.overloadedBoolean=!1,Ji.prototype.property="",Ji.prototype.spaceSeparated=!1,Ji.prototype.space=void 0;let es=0;const ts=ls(),ns=ls(),rs=ls(),is=ls(),ss=ls(),os=ls(),as=ls();function ls(){return 2**++es}const cs=Object.keys(r);class ds extends Ji{constructor(e,t,n,i){let s=-1;if(super(e,t),us(this,"space",i),"number"==typeof n)for(;++s<cs.length;){const e=cs[s];us(this,cs[s],(n&r[e])===r[e])}}}function us(e,t,n){n&&(e[t]=n)}function hs(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new ds(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Qi(r)]=r,n[Qi(s.attribute)]=r}return new Yi(t,n,e.space)}ds.prototype.defined=!0;const ps=hs({properties:{ariaActiveDescendant:null,ariaAtomic:ns,ariaAutoComplete:null,ariaBusy:ns,ariaChecked:ns,ariaColCount:is,ariaColIndex:is,ariaColSpan:is,ariaControls:ss,ariaCurrent:null,ariaDescribedBy:ss,ariaDetails:null,ariaDisabled:ns,ariaDropEffect:ss,ariaErrorMessage:null,ariaExpanded:ns,ariaFlowTo:ss,ariaGrabbed:ns,ariaHasPopup:null,ariaHidden:ns,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ss,ariaLevel:is,ariaLive:null,ariaModal:ns,ariaMultiLine:ns,ariaMultiSelectable:ns,ariaOrientation:null,ariaOwns:ss,ariaPlaceholder:null,ariaPosInSet:is,ariaPressed:ns,ariaReadOnly:ns,ariaRelevant:null,ariaRequired:ns,ariaRoleDescription:ss,ariaRowCount:is,ariaRowIndex:is,ariaRowSpan:is,ariaSelected:ns,ariaSetSize:is,ariaSort:null,ariaValueMax:is,ariaValueMin:is,ariaValueNow:is,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function fs(e,t){return t in e?e[t]:t}function ms(e,t){return fs(e,t.toLowerCase())}const _s=hs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:os,acceptCharset:ss,accessKey:ss,action:null,allow:null,allowFullScreen:ts,allowPaymentRequest:ts,allowUserMedia:ts,alt:null,as:null,async:ts,autoCapitalize:null,autoComplete:ss,autoFocus:ts,autoPlay:ts,blocking:ss,capture:null,charSet:null,checked:ts,cite:null,className:ss,cols:is,colSpan:null,content:null,contentEditable:ns,controls:ts,controlsList:ss,coords:is|os,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ts,defer:ts,dir:null,dirName:null,disabled:ts,download:rs,draggable:ns,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ts,formTarget:null,headers:ss,height:is,hidden:rs,high:is,href:null,hrefLang:null,htmlFor:ss,httpEquiv:ss,id:null,imageSizes:null,imageSrcSet:null,inert:ts,inputMode:null,integrity:null,is:null,isMap:ts,itemId:null,itemProp:ss,itemRef:ss,itemScope:ts,itemType:ss,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ts,low:is,manifest:null,max:null,maxLength:is,media:null,method:null,min:null,minLength:is,multiple:ts,muted:ts,name:null,nonce:null,noModule:ts,noValidate:ts,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:ts,optimum:is,pattern:null,ping:ss,placeholder:null,playsInline:ts,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ts,referrerPolicy:null,rel:ss,required:ts,reversed:ts,rows:is,rowSpan:is,sandbox:ss,scope:null,scoped:ts,seamless:ts,selected:ts,shadowRootClonable:ts,shadowRootDelegatesFocus:ts,shadowRootMode:null,shape:null,size:is,sizes:null,slot:null,span:is,spellCheck:ns,src:null,srcDoc:null,srcLang:null,srcSet:null,start:is,step:null,style:null,tabIndex:is,target:null,title:null,translate:null,type:null,typeMustMatch:ts,useMap:null,value:ns,width:is,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ss,axis:null,background:null,bgColor:null,border:is,borderColor:null,bottomMargin:is,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ts,declare:ts,event:null,face:null,frame:null,frameBorder:null,hSpace:is,leftMargin:is,link:null,longDesc:null,lowSrc:null,marginHeight:is,marginWidth:is,noResize:ts,noHref:ts,noShade:ts,noWrap:ts,object:null,profile:null,prompt:null,rev:null,rightMargin:is,rules:null,scheme:null,scrolling:ns,standby:null,summary:null,text:null,topMargin:is,valueType:null,version:null,vAlign:null,vLink:null,vSpace:is,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ts,disableRemotePlayback:ts,prefix:null,property:null,results:is,security:null,unselectable:null},space:"html",transform:ms}),gs=hs({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:as,accentHeight:is,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:is,amplitude:is,arabicForm:null,ascent:is,attributeName:null,attributeType:null,azimuth:is,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:is,by:null,calcMode:null,capHeight:is,className:ss,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:is,diffuseConstant:is,direction:null,display:null,dur:null,divisor:is,dominantBaseline:null,download:ts,dx:null,dy:null,edgeMode:null,editable:null,elevation:is,enableBackground:null,end:null,event:null,exponent:is,externalResourcesRequired:null,fill:null,fillOpacity:is,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:os,g2:os,glyphName:os,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:is,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:is,horizOriginX:is,horizOriginY:is,id:null,ideographic:is,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:is,k:is,k1:is,k2:is,k3:is,k4:is,kernelMatrix:as,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:is,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:is,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:is,overlineThickness:is,paintOrder:null,panose1:null,path:null,pathLength:is,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ss,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:is,pointsAtY:is,pointsAtZ:is,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:as,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:as,rev:as,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:as,requiredFeatures:as,requiredFonts:as,requiredFormats:as,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:is,specularExponent:is,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:is,strikethroughThickness:is,string:null,stroke:null,strokeDashArray:as,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:is,strokeOpacity:is,strokeWidth:null,style:null,surfaceScale:is,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:as,tabIndex:is,tableValues:null,target:null,targetX:is,targetY:is,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:as,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:is,underlineThickness:is,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:is,values:null,vAlphabetic:is,vMathematical:is,vectorEffect:null,vHanging:is,vIdeographic:is,version:null,vertAdvY:is,vertOriginX:is,vertOriginY:is,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:is,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fs}),bs=hs({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()}),vs=hs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ms}),ys=hs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),ws=Zi([ps,_s,bs,vs,ys],"html"),xs=Zi([ps,gs,bs,vs,ys],"svg"),ks={}.hasOwnProperty,Ss=/["&'<>`]/g,Cs=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ms=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ts=/[|\\{}()[\]^$+*?.]/g,Ls=new WeakMap;const zs=/[\dA-Fa-f]/,As=/\d/,Ps=["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"],Rs={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:"€"},Ns=["cent","copy","divide","gt","lt","not","para","times"],Es={}.hasOwnProperty,Os={};let Is;for(Is in Rs)Es.call(Rs,Is)&&(Os[Rs[Is]]=Is);const Bs=/[^\dA-Za-z]/;function Ds(e,t,n){let r,i=function(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!zs.test(String.fromCharCode(t))?r:r+";"}(e,t,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(r=function(e,t,n,r){const i=String.fromCharCode(e);if(Es.call(Os,i)){const e=Os[i],s="&"+e;return n&&Ps.includes(e)&&!Ns.includes(e)&&(!r||t&&61!==t&&Bs.test(String.fromCharCode(t)))?s:s+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const r=function(e,t,n){const r="&#"+String(e);return n&&t&&!As.test(String.fromCharCode(t))?r:r+";"}(e,t,n.omitOptionalSemicolons);r.length<i.length&&(i=r)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function Vs(e,t){return function(e,t){return e=e.replace(t.subset?function(e){let t=Ls.get(e);return t||(t=function(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Ts,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),Ls.set(e,t)),t}(t.subset):Ss,n),t.subset||t.escapeOnly?e:e.replace(Cs,function(e,n,r){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}).replace(Ms,n);function n(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}(e,Object.assign({format:Ds},t))}const Hs=/^>|^->|<!--|-->|--!>|<!-$/g,js=[">"],Fs=["<",">"];function Us(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}function qs(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const $s=/[A-Z]/g,Gs=/-[a-z]/g,Xs=/^data[-\w.:]+$/i;function Ks(e){return"-"+e.toLowerCase()}function Ws(e){return e.charAt(1).toUpperCase()}function Ys(e){return e.join(" ").trim()}const Zs=/[ \t\n\f\r]/g;function Qs(e){return"object"==typeof e?"text"===e.type&&Js(e.value):Js(e)}function Js(e){return""===e.replace(Zs,"")}const eo=ro(1),to=ro(-1),no=[];function ro(e){return function(t,n,r){const i=t?t.children:no;let s=(n||0)+e,o=i[s];if(!r)for(;o&&Qs(o);)s+=e,o=i[s];return o}}const io={}.hasOwnProperty;function so(e){return function(t,n,r){return io.call(e,t.tagName)&&e[t.tagName](t,n,r)}}const oo=so({body:function(e,t,n){const r=eo(n,t);return!r||"comment"!==r.type},caption:ao,colgroup:ao,dd:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName)},dt:function(e,t,n){const r=eo(n,t);return Boolean(r&&"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName))},head:ao,html:function(e,t,n){const r=eo(n,t);return!r||"comment"!==r.type},li:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&"li"===r.tagName},optgroup:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&"optgroup"===r.tagName},option:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("option"===r.tagName||"optgroup"===r.tagName)},p:function(e,t,n){const r=eo(n,t);return r?"element"===r.type&&("address"===r.tagName||"article"===r.tagName||"aside"===r.tagName||"blockquote"===r.tagName||"details"===r.tagName||"div"===r.tagName||"dl"===r.tagName||"fieldset"===r.tagName||"figcaption"===r.tagName||"figure"===r.tagName||"footer"===r.tagName||"form"===r.tagName||"h1"===r.tagName||"h2"===r.tagName||"h3"===r.tagName||"h4"===r.tagName||"h5"===r.tagName||"h6"===r.tagName||"header"===r.tagName||"hgroup"===r.tagName||"hr"===r.tagName||"main"===r.tagName||"menu"===r.tagName||"nav"===r.tagName||"ol"===r.tagName||"p"===r.tagName||"pre"===r.tagName||"section"===r.tagName||"table"===r.tagName||"ul"===r.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:lo,rt:lo,tbody:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName)},td:co,tfoot:function(e,t,n){return!eo(n,t)},th:co,thead:function(e,t,n){const r=eo(n,t);return Boolean(r&&"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName))},tr:function(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&"tr"===r.tagName}});function ao(e,t,n){const r=eo(n,t,!0);return!r||"comment"!==r.type&&!("text"===r.type&&Qs(r.value.charAt(0)))}function lo(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("rp"===r.tagName||"rt"===r.tagName)}function co(e,t,n){const r=eo(n,t);return!r||"element"===r.type&&("td"===r.tagName||"th"===r.tagName)}const uo=so({body:function(e){const t=eo(e,-1,!0);return!(t&&("comment"===t.type||"text"===t.type&&Qs(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 r=to(n,t),i=eo(e,-1,!0);return!(n&&r&&"element"===r.type&&"colgroup"===r.tagName&&oo(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"col"===i.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=eo(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){const r=to(n,t),i=eo(e,-1);return(!n||!r||"element"!==r.type||"thead"!==r.tagName&&"tbody"!==r.tagName||!oo(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"tr"===i.tagName)}}),ho={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 po(e,t,n){const r=function(e,t){const n=Qi(t);let r=t,i=Ji;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Xs.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Gs,Ws);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Gs.test(e)){let n=e.replace($s,Ks);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=ds}return new i(r,t)}(e.schema,t),i=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,s=e.settings.allowDangerousCharacters?0:1;let o,a=e.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=Vs(r.attribute,Object.assign({},e.settings.characterReferences,{subset:ho.name[i][s]}));return!0===n?l:(n=Array.isArray(n)?(r.commaSeparated?qs:Ys)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n?l:(e.settings.preferUnquoted&&(o=Vs(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ho.unquoted[i][s]}))),o!==n&&(e.settings.quoteSmart&&Us(n,a)>Us(n,e.alternative)&&(a=e.alternative),o=a+Vs(n,Object.assign({},e.settings.characterReferences,{subset:("'"===a?ho.single:ho.double)[i][s],attribute:!0}))+a),l+(o?"="+o:o)))}const fo=["<","&"];function mo(e,t,n,r){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?Vs(e.value,Object.assign({},r.settings.characterReferences,{subset:fo})):e.value}const _o=function(e,t){const n=t||{};function r(t,...n){let i=r.invalid;const s=r.handlers;if(t&&ks.call(t,e)){const n=String(t[e]);i=ks.call(s,n)?s[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}("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,r){return r.settings.bogusComments?"<?"+Vs(e.value,Object.assign({},r.settings.characterReferences,{subset:js}))+">":"\x3c!--"+e.value.replace(Hs,function(e){return Vs(e,Object.assign({},r.settings.characterReferences,{subset:Fs}))})+"--\x3e"},doctype:function(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,r){const i=r.schema,s="svg"!==i.space&&r.settings.omitOptionalTags;let o="svg"===i.space?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;"html"===i.space&&"svg"===e.tagName&&(r.schema=xs);const c=function(e,t){const n=[];let r,i=-1;if(t)for(r in t)if(null!==t[r]&&void 0!==t[r]){const i=po(e,r,t[r]);i&&n.push(i)}for(;++i<n.length;){const t=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&'"'!==t&&"'"!==t&&(n[i]+=" ")}return n.join("")}(r,e.properties),d=r.all("html"===i.space&&"template"===e.tagName?e.content:e);return r.schema=i,d&&(o=!1),!c&&s&&uo(e,t,n)||(a.push("<",e.tagName,c?" "+c:""),o&&("svg"===i.space||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&a.push(" "),a.push("/")),a.push(">")),a.push(d),o||s&&oo(e,t,n)||a.push("</"+e.tagName+">"),a.join("")},raw:function(e,t,n,r){return r.settings.allowDangerousHtml?e.value:mo(e,0,n,r)},root:function(e,t,n,r){return r.all(e)},text:mo}}),go={},bo={},vo=[];function yo(e,t,n){return _o(e,t,n,this)}function wo(e){const t=[],n=e&&e.children||vo;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function xo(e,t){const n="string"==typeof e?{}:{...e.colorReplacements},r="string"==typeof e?e:e.name;for(const[e,i]of Object.entries(t?.colorReplacements||{}))"string"==typeof i?n[e]=i:e===r&&Object.assign(n,i);return n}function ko(e,t){return e&&t?.[e?.toLowerCase()]||e}async function So(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function Co(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Mo(e){return"ansi"===e||Co(e)}function To(e){return"none"===e}function Lo(e){return To(e)}function zo(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 Ao(e,t=!1){const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let e=0;e<n.length;e+=2){const s=t?n[e]+(n[e+1]||""):n[e];i.push([s,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}const Po="light-dark()",Ro=["color","background-color"];function No(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Gr.Italic&&(t["font-style"]="italic"),e.fontStyle&Gr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Gr.Underline&&n.push("underline"),e.fontStyle&Gr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Eo(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}const Oo=new WeakMap;function Io(e,t){Oo.set(e,t)}function Bo(e){return Oo.get(e)}class Do{_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 Do(Object.fromEntries((n=t,Array.isArray(n)?n:[n]).map(e=>[e,Ki])),e);var n}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return function(e){const t=[],n=new Set;return function e(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&e(r.parent)}(e),t}(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Vo(){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 Ar(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}{const t=r.lines[e.line];if(void 0===t)throw new Ar(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Ar(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}};const r=function(e){const t=Ao(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 r=n,i=0;for(const e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}},posToIndex:function(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}}}(t.source),i=(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 Ar(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const t=e[r],i=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(i||s||o||a){if(i&&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 Ar(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}(i),e.set(t.meta,{decorations:i,converter:r,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 r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}(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),r=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(r.length!==n.converter.lines.length)throw new Ar(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){const s=r[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+=Ho(s.children[e]),-1===l&&a.length===t&&(l=e+1),-1===c&&a.length===n&&(c=e+1);if(-1===l)throw new Ar(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(-1===c)throw new Ar(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);const d=s.children.slice(l,c);if(i.alwaysWrap||d.length!==s.children.length)if(i.alwaysWrap||1!==d.length||"element"!==d[0].type){const e={type:"element",tagName:"span",properties:{},children:d};o(e,i,"wrapper"),s.children.splice(l,d.length,e)}else o(d[0],i,"token");else o(s,i,"line")}function s(e,t){r[e]=o(r[e],t,"line")}function o(e,t,n){const r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&zo(e,t.properties.class),i(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)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,Number.POSITIVE_INFINITY,e);for(let r=t.line+1;r<n.line;r++)a.unshift(()=>s(r,e));i(n.line,0,n.character,e)}}a.forEach(e=>e())}}}function Ho(e){return"text"===e.type?e.value:"element"===e.type?e.children.map(Ho).join(""):""}const jo=[Vo()];function Fo(e){const t=function(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...jo]}var Uo=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],qo={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function $o(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 Go(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 Xo(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(0===r)t.push({type:"resetAll"});else if(r<=9)qo[r]&&t.push({type:"setDecoration",value:qo[r]});else if(r<=29){const e=qo[r-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Uo[r-30]}});else if(38===r){const n=Go(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===r)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Uo[r-40]}});else if(48===r){const n=Go(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===r?t.push({type:"resetBackgroundColor"}):53===r?t.push({type:"setDecoration",value:"overline"}):55===r?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Uo[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Uo[r-100+8]}})}return t}var Ko={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 Wo(e=Ko){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 r;return{value:function(e){switch(e.type){case"named":return t(e.name);case"rgb":return n(e.rgb);case"table":return i=e.index,function(){if(r)return r;r=[];for(let e=0;e<Uo.length;e++)r.push(t(Uo[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let s=0;s<6;s++)r.push(n([e[t],e[i],e[s]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}()[i]}var i}}}function Yo(e,t,n={}){const{lang:r="text",theme:i=e.getLoadedThemes()[0]}=n;if(Co(r)||To(i))return Ao(t).map(e=>[{content:e[0],offset:e[1]}]);const{theme:s,colorMap:o}=e.setTheme(i);if("ansi"===r)return function(e,t,n){const r=xo(e,n),i=Ao(t),s=Wo(Object.fromEntries(Uo.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(r){const i=[];let s=0;do{const o=$o(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const r=Xo(o.sequence);for(const i of r)"resetAll"===i.type?(e=null,t=null,n.clear()):"resetForegroundColor"===i.type?e=null:"resetBackgroundColor"===i.type?t=null:"resetDecoration"===i.type&&n.delete(i.value);for(const i of r)"setForegroundColor"===i.type?e=i.value:"setBackgroundColor"===i.type?t=i.value:"setDecoration"===i.type&&n.add(i.value)}s=o.position}while(s<r.length);return i}}}();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has("reverse")?(i=n.background?s.value(n.background):e.bg,o=n.foreground?s.value(n.foreground):e.fg):(i=n.foreground?s.value(n.foreground):e.fg,o=n.background?s.value(n.background):void 0),i=ko(i,r),o=ko(o,r),n.decorations.has("dim")&&(i=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}(i));let a=Gr.None;return n.decorations.has("bold")&&(a|=Gr.Bold),n.decorations.has("italic")&&(a|=Gr.Italic),n.decorations.has("underline")&&(a|=Gr.Underline),n.decorations.has("strikethrough")&&(a|=Gr.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:a}}))}(s,t,n);const a=e.getLanguage(r);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Ar(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Ar(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return function(e,t,n,r,i){const s=Zo(e,t,n,r,i),o=new Do(Zo(e,t,n,r,i).stateStack,t.name,n.name);return Io(s.tokens,o),s.tokens}(t,a,s,o,n)}function Zo(e,t,n,r,i){const s=xo(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=Ao(e);let c=i.grammarState?function(e,t){if(!(e instanceof Do))throw new Ar("Invalid grammar state");return e.getInternalStack(t)}(i.grammarState,n.name)??Ki:null!=i.grammarContextCode?Zo(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ki,d=[];const u=[];for(let e=0,h=l.length;e<h;e++){const[h,p]=l[e];if(""===h){d=[],u.push([]);continue}if(o>0&&h.length>=o){d=[],u.push([{content:h,offset:p,color:"",fontStyle:0}]);continue}let f,m,_;i.includeExplanation&&(f=t.tokenizeLine(h,c,a),m=f.tokens,_=0);const g=t.tokenizeLine2(h,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]:h.length;if(t===o)continue;const a=g.tokens[2*e+1],l=ko(r[Zr.getForeground(a)],s),c=Zr.getFontStyle(a),u={content:h.substring(t,o),offset:p+t,color:l,fontStyle:c};if(i.includeExplanation){const e=[];if("scopeName"!==i.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(/ /))})}u.explanation=[];let r=0;for(;t+r<o;){const t=m[_],n=h.substring(t.startIndex,t.endIndex);r+=n.length,u.explanation.push({content:n,scopes:"scopeName"===i.includeExplanation?Qo(t.scopes):Jo(e,t.scopes)}),_+=1}}d.push(u)}u.push(d),d=[],c=g.ruleStack}return{tokens:u,stateStack:c}}function Qo(e){return e.map(e=>({scopeName:e}))}function Jo(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];n[r]={scopeName:i,themeMatches:na(e,i,t.slice(0,r))}}return n}function ea(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function ta(e,t,n){if(!ea(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)ea(e[r],n[i])&&(r-=1),i-=1;return-1===r}function na(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const e of i)if(ta(e,t,n)){r.push(s);break}return r}function ra(e,t,n){const r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{const i=Yo(e,t,{...n,theme:r.theme});return{tokens:i,state:Bo(i),theme:"string"==typeof r.theme?r.theme:r.theme.name}}),s=function(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(e=>e[r]),s=t.map(()=>[]);t.forEach((e,t)=>e.push(s[t]));const o=i.map(()=>0),a=i.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]=i[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}(...i.map(e=>e.tokens)),o=s[0].map((e,t)=>e.map((e,i)=>{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][i];o.variants[r[n].color]=c}),o})),a=i[0].state?new Do(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return a&&Io(o,a),o}function ia(e,t,n){let r,i,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:u="css-vars"}=n,h=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===h.length)throw new Ar("`themes` option must not be empty");const p=ra(e,t,n);if(l=Bo(p),c&&Po!==c&&!h.find(e=>e.color===c))throw new Ar(`\`themes\` option must contain the defaultColor key \`${c}\``);const f=h.map(t=>e.getTheme(t.theme)),m=h.map(e=>e.color);s=p.map(e=>e.map(e=>function(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>No(e.variants[t])),a=new Set(o.flatMap(e=>Object.keys(e))),l={},c=(e,r)=>{const i="color"===r?"":"background-color"===r?"-bg":`-${r}`;return n+t[e]+("color"===r?"":i)};return o.forEach((e,n)=>{for(const s of a){const a=e[s]||"inherit";if(0===n&&r&&Ro.includes(s))if(r===Po&&o.length>1){const e=t.findIndex(e=>"light"===e),r=t.findIndex(e=>"dark"===e);if(-1===e||-1===r)throw new Ar('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=o[e][s]||"inherit",u=o[r][s]||"inherit";l[s]=`light-dark(${d}, ${u})`,"css-vars"===i&&(l[c(n,s)]=a)}else l[s]=a;else"css-vars"===i&&(l[c(n,s)]=a)}}),s.htmlStyle=l,s}(e,m,d,c,u))),l&&Io(s,l);const _=h.map(e=>xo(e.theme,n));i=sa(h,f,_,d,c,"fg",u),r=sa(h,f,_,d,c,"bg",u),o=`shiki-themes ${f.map(e=>e.name).join(" ")}`,a=c?void 0:[i,r].join(";")}else{if(!("theme"in n))throw new Ar("Invalid options, either `theme` or `themes` must be provided");{const a=xo(n.theme,n);s=Yo(e,t,n);const c=e.getTheme(n.theme);r=ko(c.bg,a),i=ko(c.fg,a),o=c.name,l=Bo(s)}}return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function sa(e,t,n,r,i,s,o){return e.map((a,l)=>{const c=ko(t[l][s],n[l])||"inherit",d=`${r+a.color}${"bg"===s?"-bg":""}:${c}`;if(0===l&&i){if(i===Po&&e.length>1){const r=e.findIndex(e=>"light"===e.color),i=e.findIndex(e=>"dark"===e.color);if(-1===r||-1===i)throw new Ar('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${ko(t[r][s],n[r])||"inherit"}, ${ko(t[i][s],n[i])||"inherit"});${d}`}return c}return"css-vars"===o?d:null}).filter(e=>!!e).join(";")}function oa(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>oa(e,t,n),codeToTokens:(t,n)=>ia(e,t,n)}){let i=t;for(const e of Fo(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:d}=ia(e,i,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;!0===u?s=function(e){return e.map(e=>{const t=[];let n="",r=0;return e.forEach((i,s)=>{const o=!(i.fontStyle&&(i.fontStyle&Gr.Underline||i.fontStyle&Gr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[s+1]?(r||(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=0,n=""):t.push(i)}),t})}(s):"never"===u&&(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,r,i]=t;if(!n&&!i)return e;const s=[{...e,offset:e.offset+n.length,content:r}];return n&&s.unshift({content:n,offset:e.offset}),i&&s.push({content:i,offset:e.offset+n.length+r.length}),s}))}(s)),h&&(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],r=Eo(e.htmlStyle||No(e)),i=Eo(n.htmlStyle||No(n)),s=e.fontStyle&&(e.fontStyle&Gr.Underline||e.fontStyle&Gr.Strikethrough),o=n.fontStyle&&(n.fontStyle&Gr.Underline||n.fontStyle&Gr.Strikethrough);s||o||r!==i?t.push({...n}):e.content+=n.content}return t})}(s));const p={...r,get source(){return i}};for(const e of Fo(n))s=e.tokens?.call(p,s)||s;return function(e,t,n,r=Bo(e)){const i=Fo(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 u=[],h={...n,structure:a,addClassToHast:zo,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 u}};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:[]},r=0;for(const s of e){let e={type:"element",tagName:"span",properties:{...s.htmlAttrs},children:[{type:"text",value:s.content}]};const l=Eo(s.htmlStyle||No(s));l&&(e.properties.style=l);for(const o of i)e=o?.span?.call(h,e,t+1,r,n,s)||e;"inline"===a?o.children.push(e):"classic"===a&&n.children.push(e),r+=s.content.length}if("classic"===a){for(const e of i)n=e?.line?.call(h,n,t+1)||n;u.push(n),s.push(n)}}),"classic"===a){for(const e of i)d=e?.code?.call(h,d)||d;c.children.push(d);for(const e of i)c=e?.pre?.call(h,c)||c;o.children.push(c)}let p=o;for(const e of i)p=e?.root?.call(h,p)||p;return r&&Io(p,r),p}(s,{...n,fg:o,bg:a,themeName:l,rootStyle:c},p,d)}function aa(e,t,n){const r={meta:{},options:n,codeToHast:(t,n)=>oa(e,t,n),codeToTokens:(t,n)=>ia(e,t,n)};let i=function(e,t){const n=t||go,r=n.quote||'"',i='"'===r?"'":'"';if('"'!==r&&"'"!==r)throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:yo,all:wo,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||Wi,characterReferences:n.characterReferences||bo,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?xs:ws,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}(oa(e,t,n,r));for(const e of Fo(n))i=e.postprocess?.call(r,i,n)||i;return i}const la="__shiki_resolved";function ca(e){if(e?.[la])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:r}=t;if(!n||!r){const e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r="light"===t.type?"#333333":"#bbbbbb"),n||(n="light"===t.type?"#fffffe":"#1e1e1e"),t.fg=r,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 i=0;const s=new Map;function o(e){if(s.has(e))return s.get(e);i+=1;const n=`#${i.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("#"),r=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!r)return e;const i={...e,settings:{...e.settings}};if(n){const n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){const n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});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,la,{enumerable:!1,writable:!1,value:!0}),t}async function da(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Mo(e)).map(async e=>await So(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function ua(e){return(await Promise.all(e.map(async e=>Lo(e)?null:ca(await So(e))))).filter(e=>!!e)}class ha extends Error{constructor(e){super(e),this.name="ShikiError"}}class pa extends Xi{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,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=ca(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=jr.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 ha(`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 r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),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 ha(`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 fa{_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 r=t.slice(0,e).join(".");n=[...n,...this._injections.get(r)||[]]}return n}}let ma=0;async function _a(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,r]=await Promise.all([ua(e.themes||[]),da(e.langs||[]),e.engine]);return function(e){ma+=1,!1!==e.warnings&&ma>=10&&ma%10==0&&console.warn(`[Shiki] ${ma} 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 ha("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ca),i=new fa(e.engine,n),s=new pa(i,r,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 ha(`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 ha("Shiki instance has been disposed")}function u(){t||(t=!0,s.dispose(),ma-=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 ha(`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 da(e))},loadLanguageSync:l,loadTheme:async function(...e){return d(),c(await ua(e))},loadThemeSync:c,dispose:u,[Symbol.dispose]:u}}({...e,themes:t,langs:n,engine:r})}async function ga(e){const t=await _a(e);return{getLastGrammarState:(...e)=>function(...e){if(2===e.length)return Bo(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(Co(i)||To(s))throw new Ar("Plain language does not have grammar state");if("ansi"===i)throw new Ar("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(i);return new Do(Zo(n,l,o,a,r).stateStack,l.name,o.name)}(t,...e),codeToTokensBase:(e,n)=>Yo(t,e,n),codeToTokensWithThemes:(e,n)=>ra(t,e,n),codeToTokens:(e,n)=>ia(t,e,n),codeToHast:(e,n)=>oa(t,e,n),codeToHtml:(e,n)=>aa(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function ba(e){const t=e.langs,n=e.themes,r=e.engine;return async function(e){function i(n){if("string"==typeof n){if(Mo(n))return[];n=e.langAlias?.[n]||n;const r=t[n];if(!r)throw new Ar(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function s(e){if(Lo(e))return"none";if("string"==typeof e){const t=n[e];if(!t)throw new Ar(`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=>i(e)),l=await ga({engine:e.engine??r(),...e,themes:o,langs:a});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(i)),loadTheme:(...e)=>l.loadTheme(...e.map(s)),getBundledLanguages:()=>t,getBundledThemes:()=>n}}}function va(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 r(e,r){const i=await n({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)}),s=await(t?.guessEmbeddedLanguages?.(e,r.lang,i));return s&&await i.loadLanguage(...s),i}return{getSingletonHighlighter:e=>n(e),codeToHtml:async(e,t)=>(await r(e,t)).codeToHtml(e,t),codeToHast:async(e,t)=>(await r(e,t)).codeToHast(e,t),codeToTokens:async(e,t)=>(await r(e,t)).codeToTokens(e,t),codeToTokensBase:async(e,t)=>(await r(e,t)).codeToTokensBase(e,t),codeToTokensWithThemes:async(e,t)=>(await r(e,t)).codeToTokensWithThemes(e,t),getLastGrammarState:async(e,t)=>(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}class ya extends Error{constructor(e){super(e),this.name="ShikiError"}}function wa(){return"undefined"!=typeof performance?performance.now():Date.now()}const xa=(e,t)=>e+(t-e%t)%t;var ka=Object.defineProperty,Sa=(e,t,n)=>((e,t,n)=>t in e?ka(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let Ca=null;class Ma{constructor(e){Sa(this,"utf16Length"),Sa(this,"utf8Length"),Sa(this,"utf16Value"),Sa(this,"utf8Value"),Sa(this,"utf16OffsetToUtf8"),Sa(this,"utf8OffsetToUtf16");const t=e.length,n=Ma._utf8ByteLength(e),r=n!==t,i=r?new Uint32Array(t+1):null;r&&(i[t]=n);const s=r?new Uint32Array(n+1):null;r&&(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)}r&&(i[n]=a,d&&(i[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=i,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){const i=e.charCodeAt(n);let s=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(s=65536+(i-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 Ta=class e{constructor(t){if(Sa(this,"id",++e.LAST_ID),Sa(this,"_onigBinding"),Sa(this,"content"),Sa(this,"utf16Length"),Sa(this,"utf8Length"),Sa(this,"utf16OffsetToUtf8"),Sa(this,"utf8OffsetToUtf16"),Sa(this,"ptr"),!Ca)throw new ya("Must invoke loadWasm first.");this._onigBinding=Ca,this.content=t;const n=new Ma(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=Ca.omalloc(1e4)),e._sharedPtrInUse=!0,Ca.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Ca)}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)}};Sa(Ta,"LAST_ID",0),Sa(Ta,"_sharedPtr",0),Sa(Ta,"_sharedPtrInUse",!1);let La,za=Ta;class Aa{constructor(e){if(Sa(this,"_onigBinding"),Sa(this,"_ptr"),!Ca)throw new ya("Must invoke loadWasm first.");const t=[],n=[];for(let r=0,i=e.length;r<i;r++){const i=new Ma(e[r]);t[r]=i.createString(Ca),n[r]=i.utf8Length}const r=Ca.omalloc(4*e.length);Ca.HEAPU32.set(t,r/4);const i=Ca.omalloc(4*e.length);Ca.HEAPU32.set(n,i/4);const s=Ca.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Ca.ofree(t[n]);Ca.ofree(i),Ca.ofree(r),0===s&&function(e){throw new ya(e.UTF8ToString(e.getLastOnigError()))}(Ca),this._onigBinding=Ca,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if("number"==typeof n&&(r=n),"string"==typeof e){e=new za(e);const n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){const i=this._onigBinding,s=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(0===s)return null;const o=i.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++]),r=e.convertUtf8OffsetToUtf16(o[a++]);d[t]={start:n,end:r,length:r-n}}return{index:l,captureIndices:d}}}function Pa(e){return La||(La=async function(){Ca=await async function(e){let t,n;const r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function s(e){try{return t.grow(e-n.byteLength+65535>>>16),i(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 r=t+n;let i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&o)return o.decode(e.subarray(t,i));let s="";for(;t<i;){let n=e[t++];if(!(128&n)){s+=String.fromCharCode(n);continue}const r=63&e[t++];if(192==(224&n)){s+=String.fromCharCode((31&n)<<6|r);continue}const i=63&e[t++];if(n=224==(240&n)?(15&n)<<12|r<<6|i:(7&n)<<18|r<<12|i<<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}(r.HEAPU8,e,t):""}const l={emscripten_get_now:wa,emscripten_memcpy_big:function(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){const t=r.HEAPU8.length,n=2147483648;if((e>>>=0)>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),s(Math.min(n,xa(Math.max(e,i),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,i(t.buffer),Object.assign(r,s),r.UTF8ToString=a}(),r}(async t=>{let n=e;var r;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(r=n,e=>WebAssembly.instantiateStreaming(r,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 Ra(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await Ra(n.default)(t))):n=await n.default(t),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}(),La)}function Ra(e){return t=>WebAssembly.instantiate(e,t)}const Na=ba({langs:Tr,themes:zr,engine:()=>async function(e){return e&&await Pa(e),{createScanner:e=>new Aa(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new za(e)}}(n.e(4709).then(n.bind(n,7090)))}),{codeToHtml:Ea,codeToHast:Oa,codeToTokens:Ia,codeToTokensBase:Ba,codeToTokensWithThemes:Da,getSingletonHighlighter:Va,getLastGrammarState:Ha}=va(Na,{guessEmbeddedLanguages:function(e,t,n){const r=new Set;for(const t of e.matchAll(/lang=["']([\w-]+)["']/g))r.add(t[1]);for(const t of e.matchAll(/(?:```|~~~)([\w-]+)/g))r.add(t[1]);for(const t of e.matchAll(/\\begin\{([\w-]+)\}/g))r.add(t[1]);if(!n)return Array.from(r);const i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}}),ja=["id","data-type"],Fa=["data-id","onClick"],Ua=["innerHTML"],qa=["disabled"],$a=(0,c.pM)({__name:"cube-code",props:{cube:{}},setup(e){const{root:t}=e.cube,{stats:n}=t,r=(0,l.KR)(),i=(0,l.KR)(),s=(0,l.KR)(),u=(0,l.KR)();function h(e){if(!e._draglist)return;const t=e._draglist.init();return e.items.length>0&&t<=0?requestAnimationFrame(()=>h(e)):void 0}function p(){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 f(){const t=r.value,n=s.value;t&&n&&(e.cube._draglist=new N.DragList(t,"horizental","data-id","insert"),p(),e.cube._draglist.register_start(p),h(e.cube))}let m;(0,c.wB)(()=>[e.cube.active_tab_id,e.cube.active_tab?.code],()=>{const t=e.cube.active_tab,n=u.value;t&&n&&(n.value=t.code)},{immediate:!0}),(0,c.wB)(()=>[e.cube.code_html],()=>{const t=e.cube.active_tab,n=u.value,r=n?.previousElementSibling;if(!t||!n||!r)return;const i=n.parentElement;(0,c.dY)(()=>{const t=r.nextElementSibling,n=r.firstElementChild;if(t&&n){if(i){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"}})}),(0,c.sV)(()=>{f(),function(){const t=s.value,n=u.value;if(!t)return;n&&(n.value=e.cube.active_tab?.code||"");const r=i.value;if(!r)return;m=new N.DragDiff(r);let a=e.cube.attrs.width,l=e.cube.attrs.height,c=a,d=l;m.register_down(()=>{a=e.cube.attrs.width,l=e.cube.attrs.height}),m.register_move((e,n)=>{c=Math.round(e+a),d=Math.round(n+l),t.style.width=c+"px",t.style.height=d+"px"}),m.register_up((t,n)=>{if(a===c&&l===d)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+a),s=Math.round(n+l);r.tell(e.cube,o.VL.resize(e.cube.id,i,s)),e.cube.history.record(r)}),m.register_cancel(()=>{e.cube.attrs.width=a,e.cube.attrs.height=l})}()}),(0,c.hi)(()=>{m?.off()});const _=(0,c.EW)(()=>({"caret-color":e.cube.attrs.caret}));function g(e){e.stopPropagation()}function b(t){const n=t.previousElementSibling;if(t.parentElement,!n)return;const r=t.value,{id:i,courier:s,history:a}=e.cube,l=e.cube.tabbar_height,d=e.cube.max_height_auto,u=s.get_recorder(),h=kr.update(i,e.cube.active_tab_id,r);u.tell(e.cube,h),(0,c.dY)(()=>{const n=t.scrollHeight+l,r=Math.min(d,n),s=o.VL.set_attr(i,{height:r});u.tell(e.cube,s),a.record(u)})}function v(e){const t=e.currentTarget;t.value,b(t)}function y(e){const{hotkeys:n,clipboard:r,history:i}=t,s=e.key.toLowerCase();if([n.data[a.ZS["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=r.delete_scope();return void(t&&i.record(t))}const o=e.currentTarget;if("tab"===s){e.preventDefault(),e.stopPropagation();let t=o.value;const n=o.selectionStart,r=o.selectionEnd;t=t.slice(0,n)+"\t"+t.slice(r),o.value=t,o.selectionStart=n+1,o.selectionEnd=n+1,b(o)}}function w(e){e.preventDefault();const t=e.currentTarget;t.scrollTop=0,t.scrollLeft=0}function x(e,t=50){e.stopPropagation();const n=e.currentTarget;e.deltaY>0?N.DomAnimation.scroll_element(n,t,"horizental"):N.DomAnimation.scroll_element(n,-t,"horizental")}function k(e){const t=e.currentTarget,n=t.firstElementChild,r=t.lastElementChild;if(!n||!r)return;const i=e.shiftKey,{scrollLeft:s,scrollTop:o,scrollWidth:a,scrollHeight:l}=t,c=t.getBoundingClientRect();e.deltaY>0?i?s+c.width<a&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,20,"horizental")):o+c.height<l&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,20,"vertical")):i?s>0&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,-20,"horizental")):o>0&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,-20,"vertical"))}function S(t){(0,at.uz)(t,e.cube)}return(t,o)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-code",id:t.cube.id,"data-type":(0,l.R1)(a.u0).code,ref_key:"code",ref:s,style:(0,d.Tr)(t.cube.css),onPointerdown:g,onBeforeinput:g,onCompositionstart:g,onContextmenu:S},[(0,c.Lk)("div",{class:"code-tabbar",onWheel:x},[(0,c.Lk)("div",{class:"code-tabs-box",ref_key:"tabsbox",ref:r},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.items,n=>((0,c.uX)(),(0,c.CE)("div",{class:"code-tab","data-id":n.id,key:n.id,onClick:()=>function(t){const{courier:n,history:r}=e.cube,i=n.get_recorder();i.tell(e.cube,kr.change_active(e.cube.id,t.id)),r.record(i)}(n)},[(0,c.Lk)("div",{class:(0,d.C4)(["code-tab-name",{"code-active-tab":n.id===t.cube.active_tab_id}])},(0,d.v_)(n.name),3)],8,Fa))),128))],512)],32),(0,c.Lk)("div",{class:"code-box",onWheel:k},[(0,c.Lk)("div",{class:"code-box-inner",style:(0,d.Tr)({background:t.cube.attrs.codebg})},[(0,c.Lk)("span",{class:"code-highlight",onWheel:o[0]||(o[0]=e=>e.preventDefault()),innerHTML:t.cube.code_html},null,40,Ua),(0,c.Lk)("textarea",{disabled:(0,l.R1)(n).is_read_mode,ref_key:"textarea",ref:u,style:(0,d.Tr)(_.value),onKeyup:w,onKeydown:y,autocapitalize:"false",autocomplete:"false",autocorrect:"false",spellcheck:"false",onInput:v},null,44,qa)],4)],32),(0,c.Lk)("div",{class:"code-dragger",ref_key:"code_dragger",ref:i},null,512)],44,ja))}}),Ga=(0,f.A)($a,[["__scopeId","data-v-0e024c7c"]]),Xa={".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"};var Ka=n(3755);function Wa(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const Ya="dracula";class Za extends o._D{_code_html=(0,l.KR)("");static _langs=[...Object.keys(Tr)];static _themes=[...Object.keys(zr)];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 40}get max_height_auto(){return 600}get langs(){return[...Za._langs]}get themes(){return[...Za._themes]}_draglist;get component(){return Ga}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,r=this.attrs.height;return{...this.data.css,"margin-left":t>0?t*e+"px":"0px",width:n+"px",height:r+"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){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}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 Ea(e.code,{lang:e.lang,theme:e.theme,cssVariablePrefix:"--shiki-"})}get meta(){return Za.meta}create_tab(e,t,n=Ya){return{id:g.I.get_id(),name:t,lang:e,code:"",theme:n||Ya}}replace_id(e,t={}){return Za.replace_id(this.root,e,t)}copy_code(){const e=this.active_tab;if(!e)return Ka.F.tips?.tip_error("当前没有激活的代码块tab");const t=e.code,n=new Blob([t],{type:"text/plain"}),r=new ClipboardItem({[n.type]:n});this.clipboard.set_clipboard_data(r).then(e=>{Ka.F.tips?.tip_info("复制代码成功👏")})}change_lang(e){const{tabid:t,lang:n}=e,{courier:r,id:i}=this,s=r.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.lang;return o.lang=n,s.add_recover(kr.change_lang(i,t,a)),this.update_active_code_html(),s}change_theme(e){const{tabid:t,theme:n}=e,{courier:r,id:i}=this,s=r.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.theme;return o.theme=n,s.add_recover(kr.change_theme(i,t,a)),this.update_active_code_html(),s}code_update(e){const{tabid:t,code:n}=e,{courier:r,id:i}=this,s=r.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(kr.update(i,t,a)),this.update_active_code_html(),s}code_add(e){const{item:t,focus:n}=e,{courier:r,id:i}=this,s=r.get_recorder();return s.add_cmd(e),this.info.tabs.push(t),s.add_recover(kr.remove(i,t.id)),this.update_active_code_html(),n&&s.tell(this,kr.change_active(i,t.id)),(0,c.dY)(()=>{this._draglist?.init()}),s}code_remove(e){const{tabid:t}=e,{courier:n,id:r}=this,i=n.get_recorder();i.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),i.add_recover(kr.add(r,s)),a&&(this.active_tab_id=a.id),this.update_active_code_html(),(0,c.dY)(()=>{this._draglist?.init()}),i}code_rename(e){const{tabid:t,filename:n}=e,{courier:r,id:i}=this,s=r.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(kr.rename(i,t,a)),s}change_active(e){const{tabid:t}=e,{courier:n,id:r}=this,i=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,i.add_recover(kr.change_active(r,o)),this.update_active_code_html(),i}on_cursor_in_tail(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new _.vk(r),l=(this.meta,this.dom?.querySelector("textarea"));return l?.focus(),a}on_cursor_in_head(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new _.vk(r),l=(this.meta,this.dom?.querySelector("textarea"));return l?.focus(),a}static get meta(){return{cubename:"代码块",type:a.u0.code,block:!0,version:1,show:!0}}static get_default(){return{id:g.I.get_id(),type:a.u0.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 n={name:`code${this.get_format_from_lang(e)}`,id:g.I.get_id(),code:t,lang:e,theme:"andromeeda"};return{id:g.I.get_id(),type:a.u0.code,info:{tabs:[n],active_tab_id:n.id},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}static get_format_from_lang(e){for(let t in Xa)if(Xa[t]===e)return t;return""}static get_lang_from_format(e){return Xa[e]}}Wa([(0,k.H)(a.GW.change_lang)],Za.prototype,"change_lang",null),Wa([(0,k.H)(a.GW.change_theme)],Za.prototype,"change_theme",null),Wa([(0,k.H)(a.GW.code_update)],Za.prototype,"code_update",null),Wa([(0,k.H)(a.GW.code_add)],Za.prototype,"code_add",null),Wa([(0,k.H)(a.GW.code_remove)],Za.prototype,"code_remove",null),Wa([(0,k.H)(a.GW.code_rename)],Za.prototype,"code_rename",null),Wa([(0,k.H)(a.GW.change_active)],Za.prototype,"change_active",null),Wa([(0,k.H)(a.K9.cursor_in_tail)],Za.prototype,"on_cursor_in_tail",null),Wa([(0,k.H)(a.K9.cursor_in_head)],Za.prototype,"on_cursor_in_head",null);const Qa=["id","data-type","innerHTML"],Ja=(0,c.pM)({__name:"cube-fomula",props:{cube:{}},setup(e){const{stats:t,event:n}=e.cube.root;function r(){n.emit_show_cube_editor(e.cube)}const i=(0,c.EW)(()=>{let t={...e.cube.css};return e.cube.attrs.block&&(t.display="block",t["text-align"]="center"),t});return(e,t)=>((0,c.uX)(),(0,c.CE)("span",{class:"cube-fomula",onClick:r,id:e.cube.id,"data-type":(0,l.R1)(a.u0).fomula,style:(0,d.Tr)(i.value),innerHTML:e.cube.mathml},null,12,Qa))}}),el=(0,f.A)(Ja,[["__scopeId","data-v-b85f3e3c"]]);class tl{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 tl(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class nl{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 nl(t,tl.range(this,e))}}class rl{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,r,i="KaTeX parse error: "+e,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;n=s.start,r=s.end,n===o.length?i+=" at end of input: ":i+=" at position "+(n+1)+": ";var a=o.slice(n,r).replace(/[^]/g,"$&̲");i+=(n>15?"…"+o.slice(n-15,n):o.slice(0,n))+a+(r+15<o.length?o.slice(r,r+15)+"…":o.slice(r))}var l=new Error(i);return l.name="ParseError",l.__proto__=rl.prototype,l.position=n,null!=n&&null!=r&&(l.length=r-n),l.rawMessage=e,l}}rl.prototype.__proto__=Error.prototype;var il=/([A-Z])/g,sl={"&":"&",">":">","<":"<",'"':""","'":"'"},ol=/[&><"']/g,al=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},ll=function(e,t){return-1!==e.indexOf(t)},cl=function(e,t){return void 0===e?t:e},dl=function(e){return String(e).replace(ol,e=>sl[e])},ul=function(e){return e.replace(il,"-$1").toLowerCase()},hl=al,pl=function(e){var t=al(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},fl=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"},ml={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 _l(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 gl{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||{},ml)if(ml.hasOwnProperty(t)){var n=ml[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:_l(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new rl("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"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 '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r||!0!==r&&"error"!==r&&("warn"===r?("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 '"+r+"': "+t+" ["+e+"]"),1)))}isTrusted(e){if(e.url&&!e.protocol){var t=fl(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 bl{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 vl[yl[this.id]]}sub(){return vl[wl[this.id]]}fracNum(){return vl[xl[this.id]]}fracDen(){return vl[kl[this.id]]}cramp(){return vl[Sl[this.id]]}text(){return vl[Cl[this.id]]}isTight(){return this.size>=2}}var vl=[new bl(0,0,!1),new bl(1,0,!0),new bl(2,1,!1),new bl(3,1,!0),new bl(4,2,!1),new bl(5,2,!0),new bl(6,3,!1),new bl(7,3,!0)],yl=[4,5,4,5,6,7,6,7],wl=[5,5,5,5,7,7,7,7],xl=[2,3,4,5,6,7,6,7],kl=[3,3,5,5,7,7,7,7],Sl=[1,1,3,3,5,5,7,7],Cl=[0,1,2,3,2,3,2,3],Ml={DISPLAY:vl[0],TEXT:vl[2],SCRIPT:vl[4],SCRIPTSCRIPT:vl[6]},Tl=[{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]]}],Ll=[];function zl(e){for(var t=0;t<Ll.length;t+=2)if(e>=Ll[t]&&e<=Ll[t+1])return!0;return!1}Tl.forEach(e=>e.blocks.forEach(e=>Ll.push(...e)));var Al={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 Pl{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 ll(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 Rl={"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]}},Nl={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]},El={Å:"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 Ol(e,t,n){if(!Rl[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Rl[t][r];if(!i&&e[0]in El&&(r=El[e[0]].charCodeAt(0),i=Rl[t][r]),i||"text"!==n||zl(r)&&(i=Rl[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Il={},Bl=[[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]],Dl=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Vl=function(e,t){return t.size<2?e:Bl[e-1][t.size-1]};class Hl{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||Hl.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=Dl[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 Hl(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Vl(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:Dl[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Vl(Hl.BASESIZE,e);return this.size===t&&this.textSize===Hl.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!==Hl.BASESIZE?["sizing","reset-size"+this.size,"size"+Hl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!Il[t=e>=5?0:e>=3?1:2]){var n=Il[t]={cssEmPerMu:Nl.quad[t]/18};for(var r in Nl)Nl.hasOwnProperty(r)&&(n[r]=Nl[r][t])}return Il[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Hl.BASESIZE=6;var jl={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},Fl={ex:!0,em:!0,mu:!0},Ul=function(e){return"string"!=typeof e&&(e=e.unit),e in jl||e in Fl||"ex"===e},ql=function(e,t){var n;if(e.unit in jl)n=jl[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new rl("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},$l=function(e){return+e.toFixed(4)+"em"},Gl=function(e){return e.filter(e=>e).join(" ")},Xl=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 r=t.getColor();r&&(this.style.color=r)}},Kl=function(e){var t=document.createElement(e);for(var n in t.className=Gl(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},Wl=/[\s"'>/=\x00-\x1f]/,Yl=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+dl(Gl(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=ul(r)+":"+this.style[r]+";");for(var i in n&&(t+=' style="'+dl(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(i)){if(Wl.test(i))throw new rl("Invalid attribute name '"+i+"'");t+=" "+i+'="'+dl(this.attributes[i])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+"</"+e+">"};class Zl{constructor(e,t,n,r){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,Xl.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ll(this.classes,e)}toNode(){return Kl.call(this,"span")}toMarkup(){return Yl.call(this,"span")}}class Ql{constructor(e,t,n,r){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,Xl.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ll(this.classes,e)}toNode(){return Kl.call(this,"a")}toMarkup(){return Yl.call(this,"a")}}class Jl{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 ll(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="'+dl(this.src)+'" alt="'+dl(this.alt)+'"',t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=ul(n)+":"+this.style[n]+";");return t&&(e+=' style="'+dl(t)+'"'),e+"'/>"}}var ec={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class tc{constructor(e,t,n,r,i,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=r||0,this.skew=i||0,this.width=s||0,this.classes=o||[],this.style=a||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Tl.length;t++)for(var n=Tl[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ec[this.text])}hasClass(e){return ll(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=$l(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Gl(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+=dl(Gl(this.classes)),t+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=ul(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+dl(n)+'"');var i=dl(this.text);return e?(t+=">",t+=i,t+="</span>"):i}}class nc{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+'="'+dl(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class rc{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",Al[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+dl(this.alternate)+'"/>':'<path d="'+dl(Al[this.pathName])+'"/>'}}class ic{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+'="'+dl(this.attributes[t])+'"');return e+"/>"}}function sc(e){if(e instanceof tc)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var oc={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ac={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},lc={math:{},text:{}};function cc(e,t,n,r,i,s){lc[e][i]={font:t,group:n,replace:r},s&&r&&(lc[e][r]=lc[e][i])}var dc="math",uc="text",hc="main",pc="ams",fc="accent-token",mc="bin",_c="close",gc="inner",bc="mathord",vc="op-token",yc="open",wc="punct",xc="rel",kc="spacing",Sc="textord";cc(dc,hc,xc,"≡","\\equiv",!0),cc(dc,hc,xc,"≺","\\prec",!0),cc(dc,hc,xc,"≻","\\succ",!0),cc(dc,hc,xc,"∼","\\sim",!0),cc(dc,hc,xc,"⊥","\\perp"),cc(dc,hc,xc,"⪯","\\preceq",!0),cc(dc,hc,xc,"⪰","\\succeq",!0),cc(dc,hc,xc,"≃","\\simeq",!0),cc(dc,hc,xc,"∣","\\mid",!0),cc(dc,hc,xc,"≪","\\ll",!0),cc(dc,hc,xc,"≫","\\gg",!0),cc(dc,hc,xc,"≍","\\asymp",!0),cc(dc,hc,xc,"∥","\\parallel"),cc(dc,hc,xc,"⋈","\\bowtie",!0),cc(dc,hc,xc,"⌣","\\smile",!0),cc(dc,hc,xc,"⊑","\\sqsubseteq",!0),cc(dc,hc,xc,"⊒","\\sqsupseteq",!0),cc(dc,hc,xc,"≐","\\doteq",!0),cc(dc,hc,xc,"⌢","\\frown",!0),cc(dc,hc,xc,"∋","\\ni",!0),cc(dc,hc,xc,"∝","\\propto",!0),cc(dc,hc,xc,"⊢","\\vdash",!0),cc(dc,hc,xc,"⊣","\\dashv",!0),cc(dc,hc,xc,"∋","\\owns"),cc(dc,hc,wc,".","\\ldotp"),cc(dc,hc,wc,"⋅","\\cdotp"),cc(dc,hc,Sc,"#","\\#"),cc(uc,hc,Sc,"#","\\#"),cc(dc,hc,Sc,"&","\\&"),cc(uc,hc,Sc,"&","\\&"),cc(dc,hc,Sc,"ℵ","\\aleph",!0),cc(dc,hc,Sc,"∀","\\forall",!0),cc(dc,hc,Sc,"ℏ","\\hbar",!0),cc(dc,hc,Sc,"∃","\\exists",!0),cc(dc,hc,Sc,"∇","\\nabla",!0),cc(dc,hc,Sc,"♭","\\flat",!0),cc(dc,hc,Sc,"ℓ","\\ell",!0),cc(dc,hc,Sc,"♮","\\natural",!0),cc(dc,hc,Sc,"♣","\\clubsuit",!0),cc(dc,hc,Sc,"℘","\\wp",!0),cc(dc,hc,Sc,"♯","\\sharp",!0),cc(dc,hc,Sc,"♢","\\diamondsuit",!0),cc(dc,hc,Sc,"ℜ","\\Re",!0),cc(dc,hc,Sc,"♡","\\heartsuit",!0),cc(dc,hc,Sc,"ℑ","\\Im",!0),cc(dc,hc,Sc,"♠","\\spadesuit",!0),cc(dc,hc,Sc,"§","\\S",!0),cc(uc,hc,Sc,"§","\\S"),cc(dc,hc,Sc,"¶","\\P",!0),cc(uc,hc,Sc,"¶","\\P"),cc(dc,hc,Sc,"†","\\dag"),cc(uc,hc,Sc,"†","\\dag"),cc(uc,hc,Sc,"†","\\textdagger"),cc(dc,hc,Sc,"‡","\\ddag"),cc(uc,hc,Sc,"‡","\\ddag"),cc(uc,hc,Sc,"‡","\\textdaggerdbl"),cc(dc,hc,_c,"⎱","\\rmoustache",!0),cc(dc,hc,yc,"⎰","\\lmoustache",!0),cc(dc,hc,_c,"⟯","\\rgroup",!0),cc(dc,hc,yc,"⟮","\\lgroup",!0),cc(dc,hc,mc,"∓","\\mp",!0),cc(dc,hc,mc,"⊖","\\ominus",!0),cc(dc,hc,mc,"⊎","\\uplus",!0),cc(dc,hc,mc,"⊓","\\sqcap",!0),cc(dc,hc,mc,"∗","\\ast"),cc(dc,hc,mc,"⊔","\\sqcup",!0),cc(dc,hc,mc,"◯","\\bigcirc",!0),cc(dc,hc,mc,"∙","\\bullet",!0),cc(dc,hc,mc,"‡","\\ddagger"),cc(dc,hc,mc,"≀","\\wr",!0),cc(dc,hc,mc,"⨿","\\amalg"),cc(dc,hc,mc,"&","\\And"),cc(dc,hc,xc,"⟵","\\longleftarrow",!0),cc(dc,hc,xc,"⇐","\\Leftarrow",!0),cc(dc,hc,xc,"⟸","\\Longleftarrow",!0),cc(dc,hc,xc,"⟶","\\longrightarrow",!0),cc(dc,hc,xc,"⇒","\\Rightarrow",!0),cc(dc,hc,xc,"⟹","\\Longrightarrow",!0),cc(dc,hc,xc,"↔","\\leftrightarrow",!0),cc(dc,hc,xc,"⟷","\\longleftrightarrow",!0),cc(dc,hc,xc,"⇔","\\Leftrightarrow",!0),cc(dc,hc,xc,"⟺","\\Longleftrightarrow",!0),cc(dc,hc,xc,"↦","\\mapsto",!0),cc(dc,hc,xc,"⟼","\\longmapsto",!0),cc(dc,hc,xc,"↗","\\nearrow",!0),cc(dc,hc,xc,"↩","\\hookleftarrow",!0),cc(dc,hc,xc,"↪","\\hookrightarrow",!0),cc(dc,hc,xc,"↘","\\searrow",!0),cc(dc,hc,xc,"↼","\\leftharpoonup",!0),cc(dc,hc,xc,"⇀","\\rightharpoonup",!0),cc(dc,hc,xc,"↙","\\swarrow",!0),cc(dc,hc,xc,"↽","\\leftharpoondown",!0),cc(dc,hc,xc,"⇁","\\rightharpoondown",!0),cc(dc,hc,xc,"↖","\\nwarrow",!0),cc(dc,hc,xc,"⇌","\\rightleftharpoons",!0),cc(dc,pc,xc,"≮","\\nless",!0),cc(dc,pc,xc,"","\\@nleqslant"),cc(dc,pc,xc,"","\\@nleqq"),cc(dc,pc,xc,"⪇","\\lneq",!0),cc(dc,pc,xc,"≨","\\lneqq",!0),cc(dc,pc,xc,"","\\@lvertneqq"),cc(dc,pc,xc,"⋦","\\lnsim",!0),cc(dc,pc,xc,"⪉","\\lnapprox",!0),cc(dc,pc,xc,"⊀","\\nprec",!0),cc(dc,pc,xc,"⋠","\\npreceq",!0),cc(dc,pc,xc,"⋨","\\precnsim",!0),cc(dc,pc,xc,"⪹","\\precnapprox",!0),cc(dc,pc,xc,"≁","\\nsim",!0),cc(dc,pc,xc,"","\\@nshortmid"),cc(dc,pc,xc,"∤","\\nmid",!0),cc(dc,pc,xc,"⊬","\\nvdash",!0),cc(dc,pc,xc,"⊭","\\nvDash",!0),cc(dc,pc,xc,"⋪","\\ntriangleleft"),cc(dc,pc,xc,"⋬","\\ntrianglelefteq",!0),cc(dc,pc,xc,"⊊","\\subsetneq",!0),cc(dc,pc,xc,"","\\@varsubsetneq"),cc(dc,pc,xc,"⫋","\\subsetneqq",!0),cc(dc,pc,xc,"","\\@varsubsetneqq"),cc(dc,pc,xc,"≯","\\ngtr",!0),cc(dc,pc,xc,"","\\@ngeqslant"),cc(dc,pc,xc,"","\\@ngeqq"),cc(dc,pc,xc,"⪈","\\gneq",!0),cc(dc,pc,xc,"≩","\\gneqq",!0),cc(dc,pc,xc,"","\\@gvertneqq"),cc(dc,pc,xc,"⋧","\\gnsim",!0),cc(dc,pc,xc,"⪊","\\gnapprox",!0),cc(dc,pc,xc,"⊁","\\nsucc",!0),cc(dc,pc,xc,"⋡","\\nsucceq",!0),cc(dc,pc,xc,"⋩","\\succnsim",!0),cc(dc,pc,xc,"⪺","\\succnapprox",!0),cc(dc,pc,xc,"≆","\\ncong",!0),cc(dc,pc,xc,"","\\@nshortparallel"),cc(dc,pc,xc,"∦","\\nparallel",!0),cc(dc,pc,xc,"⊯","\\nVDash",!0),cc(dc,pc,xc,"⋫","\\ntriangleright"),cc(dc,pc,xc,"⋭","\\ntrianglerighteq",!0),cc(dc,pc,xc,"","\\@nsupseteqq"),cc(dc,pc,xc,"⊋","\\supsetneq",!0),cc(dc,pc,xc,"","\\@varsupsetneq"),cc(dc,pc,xc,"⫌","\\supsetneqq",!0),cc(dc,pc,xc,"","\\@varsupsetneqq"),cc(dc,pc,xc,"⊮","\\nVdash",!0),cc(dc,pc,xc,"⪵","\\precneqq",!0),cc(dc,pc,xc,"⪶","\\succneqq",!0),cc(dc,pc,xc,"","\\@nsubseteqq"),cc(dc,pc,mc,"⊴","\\unlhd"),cc(dc,pc,mc,"⊵","\\unrhd"),cc(dc,pc,xc,"↚","\\nleftarrow",!0),cc(dc,pc,xc,"↛","\\nrightarrow",!0),cc(dc,pc,xc,"⇍","\\nLeftarrow",!0),cc(dc,pc,xc,"⇏","\\nRightarrow",!0),cc(dc,pc,xc,"↮","\\nleftrightarrow",!0),cc(dc,pc,xc,"⇎","\\nLeftrightarrow",!0),cc(dc,pc,xc,"△","\\vartriangle"),cc(dc,pc,Sc,"ℏ","\\hslash"),cc(dc,pc,Sc,"▽","\\triangledown"),cc(dc,pc,Sc,"◊","\\lozenge"),cc(dc,pc,Sc,"Ⓢ","\\circledS"),cc(dc,pc,Sc,"®","\\circledR"),cc(uc,pc,Sc,"®","\\circledR"),cc(dc,pc,Sc,"∡","\\measuredangle",!0),cc(dc,pc,Sc,"∄","\\nexists"),cc(dc,pc,Sc,"℧","\\mho"),cc(dc,pc,Sc,"Ⅎ","\\Finv",!0),cc(dc,pc,Sc,"⅁","\\Game",!0),cc(dc,pc,Sc,"‵","\\backprime"),cc(dc,pc,Sc,"▲","\\blacktriangle"),cc(dc,pc,Sc,"▼","\\blacktriangledown"),cc(dc,pc,Sc,"■","\\blacksquare"),cc(dc,pc,Sc,"⧫","\\blacklozenge"),cc(dc,pc,Sc,"★","\\bigstar"),cc(dc,pc,Sc,"∢","\\sphericalangle",!0),cc(dc,pc,Sc,"∁","\\complement",!0),cc(dc,pc,Sc,"ð","\\eth",!0),cc(uc,hc,Sc,"ð","ð"),cc(dc,pc,Sc,"╱","\\diagup"),cc(dc,pc,Sc,"╲","\\diagdown"),cc(dc,pc,Sc,"□","\\square"),cc(dc,pc,Sc,"□","\\Box"),cc(dc,pc,Sc,"◊","\\Diamond"),cc(dc,pc,Sc,"¥","\\yen",!0),cc(uc,pc,Sc,"¥","\\yen",!0),cc(dc,pc,Sc,"✓","\\checkmark",!0),cc(uc,pc,Sc,"✓","\\checkmark"),cc(dc,pc,Sc,"ℶ","\\beth",!0),cc(dc,pc,Sc,"ℸ","\\daleth",!0),cc(dc,pc,Sc,"ℷ","\\gimel",!0),cc(dc,pc,Sc,"ϝ","\\digamma",!0),cc(dc,pc,Sc,"ϰ","\\varkappa"),cc(dc,pc,yc,"┌","\\@ulcorner",!0),cc(dc,pc,_c,"┐","\\@urcorner",!0),cc(dc,pc,yc,"└","\\@llcorner",!0),cc(dc,pc,_c,"┘","\\@lrcorner",!0),cc(dc,pc,xc,"≦","\\leqq",!0),cc(dc,pc,xc,"⩽","\\leqslant",!0),cc(dc,pc,xc,"⪕","\\eqslantless",!0),cc(dc,pc,xc,"≲","\\lesssim",!0),cc(dc,pc,xc,"⪅","\\lessapprox",!0),cc(dc,pc,xc,"≊","\\approxeq",!0),cc(dc,pc,mc,"⋖","\\lessdot"),cc(dc,pc,xc,"⋘","\\lll",!0),cc(dc,pc,xc,"≶","\\lessgtr",!0),cc(dc,pc,xc,"⋚","\\lesseqgtr",!0),cc(dc,pc,xc,"⪋","\\lesseqqgtr",!0),cc(dc,pc,xc,"≑","\\doteqdot"),cc(dc,pc,xc,"≓","\\risingdotseq",!0),cc(dc,pc,xc,"≒","\\fallingdotseq",!0),cc(dc,pc,xc,"∽","\\backsim",!0),cc(dc,pc,xc,"⋍","\\backsimeq",!0),cc(dc,pc,xc,"⫅","\\subseteqq",!0),cc(dc,pc,xc,"⋐","\\Subset",!0),cc(dc,pc,xc,"⊏","\\sqsubset",!0),cc(dc,pc,xc,"≼","\\preccurlyeq",!0),cc(dc,pc,xc,"⋞","\\curlyeqprec",!0),cc(dc,pc,xc,"≾","\\precsim",!0),cc(dc,pc,xc,"⪷","\\precapprox",!0),cc(dc,pc,xc,"⊲","\\vartriangleleft"),cc(dc,pc,xc,"⊴","\\trianglelefteq"),cc(dc,pc,xc,"⊨","\\vDash",!0),cc(dc,pc,xc,"⊪","\\Vvdash",!0),cc(dc,pc,xc,"⌣","\\smallsmile"),cc(dc,pc,xc,"⌢","\\smallfrown"),cc(dc,pc,xc,"≏","\\bumpeq",!0),cc(dc,pc,xc,"≎","\\Bumpeq",!0),cc(dc,pc,xc,"≧","\\geqq",!0),cc(dc,pc,xc,"⩾","\\geqslant",!0),cc(dc,pc,xc,"⪖","\\eqslantgtr",!0),cc(dc,pc,xc,"≳","\\gtrsim",!0),cc(dc,pc,xc,"⪆","\\gtrapprox",!0),cc(dc,pc,mc,"⋗","\\gtrdot"),cc(dc,pc,xc,"⋙","\\ggg",!0),cc(dc,pc,xc,"≷","\\gtrless",!0),cc(dc,pc,xc,"⋛","\\gtreqless",!0),cc(dc,pc,xc,"⪌","\\gtreqqless",!0),cc(dc,pc,xc,"≖","\\eqcirc",!0),cc(dc,pc,xc,"≗","\\circeq",!0),cc(dc,pc,xc,"≜","\\triangleq",!0),cc(dc,pc,xc,"∼","\\thicksim"),cc(dc,pc,xc,"≈","\\thickapprox"),cc(dc,pc,xc,"⫆","\\supseteqq",!0),cc(dc,pc,xc,"⋑","\\Supset",!0),cc(dc,pc,xc,"⊐","\\sqsupset",!0),cc(dc,pc,xc,"≽","\\succcurlyeq",!0),cc(dc,pc,xc,"⋟","\\curlyeqsucc",!0),cc(dc,pc,xc,"≿","\\succsim",!0),cc(dc,pc,xc,"⪸","\\succapprox",!0),cc(dc,pc,xc,"⊳","\\vartriangleright"),cc(dc,pc,xc,"⊵","\\trianglerighteq"),cc(dc,pc,xc,"⊩","\\Vdash",!0),cc(dc,pc,xc,"∣","\\shortmid"),cc(dc,pc,xc,"∥","\\shortparallel"),cc(dc,pc,xc,"≬","\\between",!0),cc(dc,pc,xc,"⋔","\\pitchfork",!0),cc(dc,pc,xc,"∝","\\varpropto"),cc(dc,pc,xc,"◀","\\blacktriangleleft"),cc(dc,pc,xc,"∴","\\therefore",!0),cc(dc,pc,xc,"∍","\\backepsilon"),cc(dc,pc,xc,"▶","\\blacktriangleright"),cc(dc,pc,xc,"∵","\\because",!0),cc(dc,pc,xc,"⋘","\\llless"),cc(dc,pc,xc,"⋙","\\gggtr"),cc(dc,pc,mc,"⊲","\\lhd"),cc(dc,pc,mc,"⊳","\\rhd"),cc(dc,pc,xc,"≂","\\eqsim",!0),cc(dc,hc,xc,"⋈","\\Join"),cc(dc,pc,xc,"≑","\\Doteq",!0),cc(dc,pc,mc,"∔","\\dotplus",!0),cc(dc,pc,mc,"∖","\\smallsetminus"),cc(dc,pc,mc,"⋒","\\Cap",!0),cc(dc,pc,mc,"⋓","\\Cup",!0),cc(dc,pc,mc,"⩞","\\doublebarwedge",!0),cc(dc,pc,mc,"⊟","\\boxminus",!0),cc(dc,pc,mc,"⊞","\\boxplus",!0),cc(dc,pc,mc,"⋇","\\divideontimes",!0),cc(dc,pc,mc,"⋉","\\ltimes",!0),cc(dc,pc,mc,"⋊","\\rtimes",!0),cc(dc,pc,mc,"⋋","\\leftthreetimes",!0),cc(dc,pc,mc,"⋌","\\rightthreetimes",!0),cc(dc,pc,mc,"⋏","\\curlywedge",!0),cc(dc,pc,mc,"⋎","\\curlyvee",!0),cc(dc,pc,mc,"⊝","\\circleddash",!0),cc(dc,pc,mc,"⊛","\\circledast",!0),cc(dc,pc,mc,"⋅","\\centerdot"),cc(dc,pc,mc,"⊺","\\intercal",!0),cc(dc,pc,mc,"⋒","\\doublecap"),cc(dc,pc,mc,"⋓","\\doublecup"),cc(dc,pc,mc,"⊠","\\boxtimes",!0),cc(dc,pc,xc,"⇢","\\dashrightarrow",!0),cc(dc,pc,xc,"⇠","\\dashleftarrow",!0),cc(dc,pc,xc,"⇇","\\leftleftarrows",!0),cc(dc,pc,xc,"⇆","\\leftrightarrows",!0),cc(dc,pc,xc,"⇚","\\Lleftarrow",!0),cc(dc,pc,xc,"↞","\\twoheadleftarrow",!0),cc(dc,pc,xc,"↢","\\leftarrowtail",!0),cc(dc,pc,xc,"↫","\\looparrowleft",!0),cc(dc,pc,xc,"⇋","\\leftrightharpoons",!0),cc(dc,pc,xc,"↶","\\curvearrowleft",!0),cc(dc,pc,xc,"↺","\\circlearrowleft",!0),cc(dc,pc,xc,"↰","\\Lsh",!0),cc(dc,pc,xc,"⇈","\\upuparrows",!0),cc(dc,pc,xc,"↿","\\upharpoonleft",!0),cc(dc,pc,xc,"⇃","\\downharpoonleft",!0),cc(dc,hc,xc,"⊶","\\origof",!0),cc(dc,hc,xc,"⊷","\\imageof",!0),cc(dc,pc,xc,"⊸","\\multimap",!0),cc(dc,pc,xc,"↭","\\leftrightsquigarrow",!0),cc(dc,pc,xc,"⇉","\\rightrightarrows",!0),cc(dc,pc,xc,"⇄","\\rightleftarrows",!0),cc(dc,pc,xc,"↠","\\twoheadrightarrow",!0),cc(dc,pc,xc,"↣","\\rightarrowtail",!0),cc(dc,pc,xc,"↬","\\looparrowright",!0),cc(dc,pc,xc,"↷","\\curvearrowright",!0),cc(dc,pc,xc,"↻","\\circlearrowright",!0),cc(dc,pc,xc,"↱","\\Rsh",!0),cc(dc,pc,xc,"⇊","\\downdownarrows",!0),cc(dc,pc,xc,"↾","\\upharpoonright",!0),cc(dc,pc,xc,"⇂","\\downharpoonright",!0),cc(dc,pc,xc,"⇝","\\rightsquigarrow",!0),cc(dc,pc,xc,"⇝","\\leadsto"),cc(dc,pc,xc,"⇛","\\Rrightarrow",!0),cc(dc,pc,xc,"↾","\\restriction"),cc(dc,hc,Sc,"‘","`"),cc(dc,hc,Sc,"$","\\$"),cc(uc,hc,Sc,"$","\\$"),cc(uc,hc,Sc,"$","\\textdollar"),cc(dc,hc,Sc,"%","\\%"),cc(uc,hc,Sc,"%","\\%"),cc(dc,hc,Sc,"_","\\_"),cc(uc,hc,Sc,"_","\\_"),cc(uc,hc,Sc,"_","\\textunderscore"),cc(dc,hc,Sc,"∠","\\angle",!0),cc(dc,hc,Sc,"∞","\\infty",!0),cc(dc,hc,Sc,"′","\\prime"),cc(dc,hc,Sc,"△","\\triangle"),cc(dc,hc,Sc,"Γ","\\Gamma",!0),cc(dc,hc,Sc,"Δ","\\Delta",!0),cc(dc,hc,Sc,"Θ","\\Theta",!0),cc(dc,hc,Sc,"Λ","\\Lambda",!0),cc(dc,hc,Sc,"Ξ","\\Xi",!0),cc(dc,hc,Sc,"Π","\\Pi",!0),cc(dc,hc,Sc,"Σ","\\Sigma",!0),cc(dc,hc,Sc,"Υ","\\Upsilon",!0),cc(dc,hc,Sc,"Φ","\\Phi",!0),cc(dc,hc,Sc,"Ψ","\\Psi",!0),cc(dc,hc,Sc,"Ω","\\Omega",!0),cc(dc,hc,Sc,"A","Α"),cc(dc,hc,Sc,"B","Β"),cc(dc,hc,Sc,"E","Ε"),cc(dc,hc,Sc,"Z","Ζ"),cc(dc,hc,Sc,"H","Η"),cc(dc,hc,Sc,"I","Ι"),cc(dc,hc,Sc,"K","Κ"),cc(dc,hc,Sc,"M","Μ"),cc(dc,hc,Sc,"N","Ν"),cc(dc,hc,Sc,"O","Ο"),cc(dc,hc,Sc,"P","Ρ"),cc(dc,hc,Sc,"T","Τ"),cc(dc,hc,Sc,"X","Χ"),cc(dc,hc,Sc,"¬","\\neg",!0),cc(dc,hc,Sc,"¬","\\lnot"),cc(dc,hc,Sc,"⊤","\\top"),cc(dc,hc,Sc,"⊥","\\bot"),cc(dc,hc,Sc,"∅","\\emptyset"),cc(dc,pc,Sc,"∅","\\varnothing"),cc(dc,hc,bc,"α","\\alpha",!0),cc(dc,hc,bc,"β","\\beta",!0),cc(dc,hc,bc,"γ","\\gamma",!0),cc(dc,hc,bc,"δ","\\delta",!0),cc(dc,hc,bc,"ϵ","\\epsilon",!0),cc(dc,hc,bc,"ζ","\\zeta",!0),cc(dc,hc,bc,"η","\\eta",!0),cc(dc,hc,bc,"θ","\\theta",!0),cc(dc,hc,bc,"ι","\\iota",!0),cc(dc,hc,bc,"κ","\\kappa",!0),cc(dc,hc,bc,"λ","\\lambda",!0),cc(dc,hc,bc,"μ","\\mu",!0),cc(dc,hc,bc,"ν","\\nu",!0),cc(dc,hc,bc,"ξ","\\xi",!0),cc(dc,hc,bc,"ο","\\omicron",!0),cc(dc,hc,bc,"π","\\pi",!0),cc(dc,hc,bc,"ρ","\\rho",!0),cc(dc,hc,bc,"σ","\\sigma",!0),cc(dc,hc,bc,"τ","\\tau",!0),cc(dc,hc,bc,"υ","\\upsilon",!0),cc(dc,hc,bc,"ϕ","\\phi",!0),cc(dc,hc,bc,"χ","\\chi",!0),cc(dc,hc,bc,"ψ","\\psi",!0),cc(dc,hc,bc,"ω","\\omega",!0),cc(dc,hc,bc,"ε","\\varepsilon",!0),cc(dc,hc,bc,"ϑ","\\vartheta",!0),cc(dc,hc,bc,"ϖ","\\varpi",!0),cc(dc,hc,bc,"ϱ","\\varrho",!0),cc(dc,hc,bc,"ς","\\varsigma",!0),cc(dc,hc,bc,"φ","\\varphi",!0),cc(dc,hc,mc,"∗","*",!0),cc(dc,hc,mc,"+","+"),cc(dc,hc,mc,"−","-",!0),cc(dc,hc,mc,"⋅","\\cdot",!0),cc(dc,hc,mc,"∘","\\circ",!0),cc(dc,hc,mc,"÷","\\div",!0),cc(dc,hc,mc,"±","\\pm",!0),cc(dc,hc,mc,"×","\\times",!0),cc(dc,hc,mc,"∩","\\cap",!0),cc(dc,hc,mc,"∪","\\cup",!0),cc(dc,hc,mc,"∖","\\setminus",!0),cc(dc,hc,mc,"∧","\\land"),cc(dc,hc,mc,"∨","\\lor"),cc(dc,hc,mc,"∧","\\wedge",!0),cc(dc,hc,mc,"∨","\\vee",!0),cc(dc,hc,Sc,"√","\\surd"),cc(dc,hc,yc,"⟨","\\langle",!0),cc(dc,hc,yc,"∣","\\lvert"),cc(dc,hc,yc,"∥","\\lVert"),cc(dc,hc,_c,"?","?"),cc(dc,hc,_c,"!","!"),cc(dc,hc,_c,"⟩","\\rangle",!0),cc(dc,hc,_c,"∣","\\rvert"),cc(dc,hc,_c,"∥","\\rVert"),cc(dc,hc,xc,"=","="),cc(dc,hc,xc,":",":"),cc(dc,hc,xc,"≈","\\approx",!0),cc(dc,hc,xc,"≅","\\cong",!0),cc(dc,hc,xc,"≥","\\ge"),cc(dc,hc,xc,"≥","\\geq",!0),cc(dc,hc,xc,"←","\\gets"),cc(dc,hc,xc,">","\\gt",!0),cc(dc,hc,xc,"∈","\\in",!0),cc(dc,hc,xc,"","\\@not"),cc(dc,hc,xc,"⊂","\\subset",!0),cc(dc,hc,xc,"⊃","\\supset",!0),cc(dc,hc,xc,"⊆","\\subseteq",!0),cc(dc,hc,xc,"⊇","\\supseteq",!0),cc(dc,pc,xc,"⊈","\\nsubseteq",!0),cc(dc,pc,xc,"⊉","\\nsupseteq",!0),cc(dc,hc,xc,"⊨","\\models"),cc(dc,hc,xc,"←","\\leftarrow",!0),cc(dc,hc,xc,"≤","\\le"),cc(dc,hc,xc,"≤","\\leq",!0),cc(dc,hc,xc,"<","\\lt",!0),cc(dc,hc,xc,"→","\\rightarrow",!0),cc(dc,hc,xc,"→","\\to"),cc(dc,pc,xc,"≱","\\ngeq",!0),cc(dc,pc,xc,"≰","\\nleq",!0),cc(dc,hc,kc," ","\\ "),cc(dc,hc,kc," ","\\space"),cc(dc,hc,kc," ","\\nobreakspace"),cc(uc,hc,kc," ","\\ "),cc(uc,hc,kc," "," "),cc(uc,hc,kc," ","\\space"),cc(uc,hc,kc," ","\\nobreakspace"),cc(dc,hc,kc,null,"\\nobreak"),cc(dc,hc,kc,null,"\\allowbreak"),cc(dc,hc,wc,",",","),cc(dc,hc,wc,";",";"),cc(dc,pc,mc,"⊼","\\barwedge",!0),cc(dc,pc,mc,"⊻","\\veebar",!0),cc(dc,hc,mc,"⊙","\\odot",!0),cc(dc,hc,mc,"⊕","\\oplus",!0),cc(dc,hc,mc,"⊗","\\otimes",!0),cc(dc,hc,Sc,"∂","\\partial",!0),cc(dc,hc,mc,"⊘","\\oslash",!0),cc(dc,pc,mc,"⊚","\\circledcirc",!0),cc(dc,pc,mc,"⊡","\\boxdot",!0),cc(dc,hc,mc,"△","\\bigtriangleup"),cc(dc,hc,mc,"▽","\\bigtriangledown"),cc(dc,hc,mc,"†","\\dagger"),cc(dc,hc,mc,"⋄","\\diamond"),cc(dc,hc,mc,"⋆","\\star"),cc(dc,hc,mc,"◃","\\triangleleft"),cc(dc,hc,mc,"▹","\\triangleright"),cc(dc,hc,yc,"{","\\{"),cc(uc,hc,Sc,"{","\\{"),cc(uc,hc,Sc,"{","\\textbraceleft"),cc(dc,hc,_c,"}","\\}"),cc(uc,hc,Sc,"}","\\}"),cc(uc,hc,Sc,"}","\\textbraceright"),cc(dc,hc,yc,"{","\\lbrace"),cc(dc,hc,_c,"}","\\rbrace"),cc(dc,hc,yc,"[","\\lbrack",!0),cc(uc,hc,Sc,"[","\\lbrack",!0),cc(dc,hc,_c,"]","\\rbrack",!0),cc(uc,hc,Sc,"]","\\rbrack",!0),cc(dc,hc,yc,"(","\\lparen",!0),cc(dc,hc,_c,")","\\rparen",!0),cc(uc,hc,Sc,"<","\\textless",!0),cc(uc,hc,Sc,">","\\textgreater",!0),cc(dc,hc,yc,"⌊","\\lfloor",!0),cc(dc,hc,_c,"⌋","\\rfloor",!0),cc(dc,hc,yc,"⌈","\\lceil",!0),cc(dc,hc,_c,"⌉","\\rceil",!0),cc(dc,hc,Sc,"\\","\\backslash"),cc(dc,hc,Sc,"∣","|"),cc(dc,hc,Sc,"∣","\\vert"),cc(uc,hc,Sc,"|","\\textbar",!0),cc(dc,hc,Sc,"∥","\\|"),cc(dc,hc,Sc,"∥","\\Vert"),cc(uc,hc,Sc,"∥","\\textbardbl"),cc(uc,hc,Sc,"~","\\textasciitilde"),cc(uc,hc,Sc,"\\","\\textbackslash"),cc(uc,hc,Sc,"^","\\textasciicircum"),cc(dc,hc,xc,"↑","\\uparrow",!0),cc(dc,hc,xc,"⇑","\\Uparrow",!0),cc(dc,hc,xc,"↓","\\downarrow",!0),cc(dc,hc,xc,"⇓","\\Downarrow",!0),cc(dc,hc,xc,"↕","\\updownarrow",!0),cc(dc,hc,xc,"⇕","\\Updownarrow",!0),cc(dc,hc,vc,"∐","\\coprod"),cc(dc,hc,vc,"⋁","\\bigvee"),cc(dc,hc,vc,"⋀","\\bigwedge"),cc(dc,hc,vc,"⨄","\\biguplus"),cc(dc,hc,vc,"⋂","\\bigcap"),cc(dc,hc,vc,"⋃","\\bigcup"),cc(dc,hc,vc,"∫","\\int"),cc(dc,hc,vc,"∫","\\intop"),cc(dc,hc,vc,"∬","\\iint"),cc(dc,hc,vc,"∭","\\iiint"),cc(dc,hc,vc,"∏","\\prod"),cc(dc,hc,vc,"∑","\\sum"),cc(dc,hc,vc,"⨂","\\bigotimes"),cc(dc,hc,vc,"⨁","\\bigoplus"),cc(dc,hc,vc,"⨀","\\bigodot"),cc(dc,hc,vc,"∮","\\oint"),cc(dc,hc,vc,"∯","\\oiint"),cc(dc,hc,vc,"∰","\\oiiint"),cc(dc,hc,vc,"⨆","\\bigsqcup"),cc(dc,hc,vc,"∫","\\smallint"),cc(uc,hc,gc,"…","\\textellipsis"),cc(dc,hc,gc,"…","\\mathellipsis"),cc(uc,hc,gc,"…","\\ldots",!0),cc(dc,hc,gc,"…","\\ldots",!0),cc(dc,hc,gc,"⋯","\\@cdots",!0),cc(dc,hc,gc,"⋱","\\ddots",!0),cc(dc,hc,Sc,"⋮","\\varvdots"),cc(uc,hc,Sc,"⋮","\\varvdots"),cc(dc,hc,fc,"ˊ","\\acute"),cc(dc,hc,fc,"ˋ","\\grave"),cc(dc,hc,fc,"¨","\\ddot"),cc(dc,hc,fc,"~","\\tilde"),cc(dc,hc,fc,"ˉ","\\bar"),cc(dc,hc,fc,"˘","\\breve"),cc(dc,hc,fc,"ˇ","\\check"),cc(dc,hc,fc,"^","\\hat"),cc(dc,hc,fc,"⃗","\\vec"),cc(dc,hc,fc,"˙","\\dot"),cc(dc,hc,fc,"˚","\\mathring"),cc(dc,hc,bc,"","\\@imath"),cc(dc,hc,bc,"","\\@jmath"),cc(dc,hc,Sc,"ı","ı"),cc(dc,hc,Sc,"ȷ","ȷ"),cc(uc,hc,Sc,"ı","\\i",!0),cc(uc,hc,Sc,"ȷ","\\j",!0),cc(uc,hc,Sc,"ß","\\ss",!0),cc(uc,hc,Sc,"æ","\\ae",!0),cc(uc,hc,Sc,"œ","\\oe",!0),cc(uc,hc,Sc,"ø","\\o",!0),cc(uc,hc,Sc,"Æ","\\AE",!0),cc(uc,hc,Sc,"Œ","\\OE",!0),cc(uc,hc,Sc,"Ø","\\O",!0),cc(uc,hc,fc,"ˊ","\\'"),cc(uc,hc,fc,"ˋ","\\`"),cc(uc,hc,fc,"ˆ","\\^"),cc(uc,hc,fc,"˜","\\~"),cc(uc,hc,fc,"ˉ","\\="),cc(uc,hc,fc,"˘","\\u"),cc(uc,hc,fc,"˙","\\."),cc(uc,hc,fc,"¸","\\c"),cc(uc,hc,fc,"˚","\\r"),cc(uc,hc,fc,"ˇ","\\v"),cc(uc,hc,fc,"¨",'\\"'),cc(uc,hc,fc,"˝","\\H"),cc(uc,hc,fc,"◯","\\textcircled");var Cc={"--":!0,"---":!0,"``":!0,"''":!0};cc(uc,hc,Sc,"–","--",!0),cc(uc,hc,Sc,"–","\\textendash"),cc(uc,hc,Sc,"—","---",!0),cc(uc,hc,Sc,"—","\\textemdash"),cc(uc,hc,Sc,"‘","`",!0),cc(uc,hc,Sc,"‘","\\textquoteleft"),cc(uc,hc,Sc,"’","'",!0),cc(uc,hc,Sc,"’","\\textquoteright"),cc(uc,hc,Sc,"“","``",!0),cc(uc,hc,Sc,"“","\\textquotedblleft"),cc(uc,hc,Sc,"”","''",!0),cc(uc,hc,Sc,"”","\\textquotedblright"),cc(dc,hc,Sc,"°","\\degree",!0),cc(uc,hc,Sc,"°","\\degree"),cc(uc,hc,Sc,"°","\\textdegree",!0),cc(dc,hc,Sc,"£","\\pounds"),cc(dc,hc,Sc,"£","\\mathsterling",!0),cc(uc,hc,Sc,"£","\\pounds"),cc(uc,hc,Sc,"£","\\textsterling",!0),cc(dc,pc,Sc,"✠","\\maltese"),cc(uc,pc,Sc,"✠","\\maltese");for(var Mc=0;Mc<14;Mc++){var Tc='0123456789/@."'.charAt(Mc);cc(dc,hc,Sc,Tc,Tc)}for(var Lc=0;Lc<25;Lc++){var zc='0123456789!@*()-=+";:?/.,'.charAt(Lc);cc(uc,hc,Sc,zc,zc)}for(var Ac="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Pc=0;Pc<52;Pc++){var Rc=Ac.charAt(Pc);cc(dc,hc,bc,Rc,Rc),cc(uc,hc,Sc,Rc,Rc)}cc(dc,pc,Sc,"C","ℂ"),cc(uc,pc,Sc,"C","ℂ"),cc(dc,pc,Sc,"H","ℍ"),cc(uc,pc,Sc,"H","ℍ"),cc(dc,pc,Sc,"N","ℕ"),cc(uc,pc,Sc,"N","ℕ"),cc(dc,pc,Sc,"P","ℙ"),cc(uc,pc,Sc,"P","ℙ"),cc(dc,pc,Sc,"Q","ℚ"),cc(uc,pc,Sc,"Q","ℚ"),cc(dc,pc,Sc,"R","ℝ"),cc(uc,pc,Sc,"R","ℝ"),cc(dc,pc,Sc,"Z","ℤ"),cc(uc,pc,Sc,"Z","ℤ"),cc(dc,hc,bc,"h","ℎ"),cc(uc,hc,bc,"h","ℎ");for(var Nc="",Ec=0;Ec<52;Ec++){var Oc=Ac.charAt(Ec);cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56320+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56372+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56424+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56580+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56684+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56736+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56788+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56840+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56944+Ec)),cc(uc,hc,Sc,Oc,Nc),Ec<26&&(cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56632+Ec)),cc(uc,hc,Sc,Oc,Nc),cc(dc,hc,bc,Oc,Nc=String.fromCharCode(55349,56476+Ec)),cc(uc,hc,Sc,Oc,Nc))}cc(dc,hc,bc,"k",Nc=String.fromCharCode(55349,56668)),cc(uc,hc,Sc,"k",Nc);for(var Ic=0;Ic<10;Ic++){var Bc=Ic.toString();cc(dc,hc,bc,Bc,Nc=String.fromCharCode(55349,57294+Ic)),cc(uc,hc,Sc,Bc,Nc),cc(dc,hc,bc,Bc,Nc=String.fromCharCode(55349,57314+Ic)),cc(uc,hc,Sc,Bc,Nc),cc(dc,hc,bc,Bc,Nc=String.fromCharCode(55349,57324+Ic)),cc(uc,hc,Sc,Bc,Nc),cc(dc,hc,bc,Bc,Nc=String.fromCharCode(55349,57334+Ic)),cc(uc,hc,Sc,Bc,Nc)}for(var Dc=0;Dc<3;Dc++){var Vc="ÐÞþ".charAt(Dc);cc(dc,hc,bc,Vc,Vc),cc(uc,hc,Sc,Vc,Vc)}var Hc=[["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"]],jc=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Fc=function(e,t,n){return lc[n][e]&&lc[n][e].replace&&(e=lc[n][e].replace),{value:e,metrics:Ol(e,t,n)}},Uc=function(e,t,n,r,i){var s,o=Fc(e,t,n),a=o.metrics;if(e=o.value,a){var l=a.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),s=new tc(e,a.height,a.depth,l,a.skew,a.width,i)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),s=new tc(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push("mtight");var c=r.getColor();c&&(s.style.color=c)}return s},qc=(e,t)=>{if(Gl(e.classes)!==Gl(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 r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},$c=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var s=e.children[i];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>r&&(r=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Gc=function(e,t,n,r){var i=new Zl(e,t,n,r);return $c(i),i},Xc=(e,t,n,r)=>new Zl(e,t,n,r),Kc=function(e){var t=new Pl(e);return $c(t),t},Wc=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},Yc={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"}},Zc={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Qc={fontMap:Yc,makeSymbol:Uc,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&Fc(e,"Main-Bold",t).metrics?Uc(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===lc[t][e].font?Uc(e,"Main-Regular",t,n,r):Uc(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:Gc,makeSvgSpan:Xc,makeLineSpan:function(e,t,n){var r=Gc([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=$l(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var i=new Ql(e,t,n,r);return $c(i),i},makeFragment:Kc,wrapFragment:function(e,t){return e instanceof Pl?Gc([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,s=1;s<t.length;s++){var o=-t[s].shift-i-t[s].elem.depth,a=o-(t[s-1].elem.height+t[s-1].elem.depth);i+=o,n.push({type:"kern",size:a}),n.push(t[s])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),i=0,s=0;s<n.length;s++){var o=n[s];if("elem"===o.type){var a=o.elem;i=Math.max(i,a.maxFontSize,a.height)}}i+=2;var l=Gc(["pstrut"],[]);l.style.height=$l(i);for(var c=[],d=r,u=r,h=r,p=0;p<n.length;p++){var f=n[p];if("kern"===f.type)h+=f.size;else{var m=f.elem,_=f.wrapperClasses||[],g=f.wrapperStyle||{},b=Gc(_,[l,m],void 0,g);b.style.top=$l(-i-h-m.depth),f.marginLeft&&(b.style.marginLeft=f.marginLeft),f.marginRight&&(b.style.marginRight=f.marginRight),c.push(b),h+=m.height+m.depth}d=Math.min(d,h),u=Math.max(u,h)}var v,y=Gc(["vlist"],c);if(y.style.height=$l(u),d<0){var w=Gc([],[]),x=Gc(["vlist"],[w]);x.style.height=$l(-d);var k=Gc(["vlist-s"],[new tc("")]);v=[Gc(["vlist-r"],[y,k]),Gc(["vlist-r"],[x])]}else v=[Gc(["vlist-r"],[y])];var S=Gc(["vlist-t"],v);return 2===v.length&&S.classes.push("vlist-t2"),S.height=u,S.depth=-d,S},makeOrd:function(e,t,n){var r=e.mode,i=e.text,s=["mord"],o="math"===r||"text"===r&&t.font,a=o?t.font:t.fontFamily,l="",c="";if(55349===i.charCodeAt(0)&&([l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,r="math"===t?0:1;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return[Hc[i][2],Hc[i][r]]}if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return[jc[s][2],jc[s][r]]}if(120485===n||120486===n)return[Hc[0][2],Hc[0][r]];if(120486<n&&n<120782)return["",""];throw new rl("Unsupported character: "+e)}(i,r)),l.length>0)return Uc(i,l,r,t,s.concat(c));if(a){var d,u;if("boldsymbol"===a){var h=function(e,t,n,r,i){return"textord"!==i&&Fc(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(i,r,0,0,n);d=h.fontName,u=[h.fontClass]}else o?(d=Yc[a].fontName,u=[a]):(d=Wc(a,t.fontWeight,t.fontShape),u=[a,t.fontWeight,t.fontShape]);if(Fc(i,d,r).metrics)return Uc(i,d,r,t,s.concat(u));if(Cc.hasOwnProperty(i)&&"Typewriter"===d.slice(0,10)){for(var p=[],f=0;f<i.length;f++)p.push(Uc(i[f],d,r,t,s.concat(u)));return Kc(p)}}if("mathord"===n)return Uc(i,"Math-Italic",r,t,s.concat(["mathnormal"]));if("textord"===n){var m=lc[r][i]&&lc[r][i].font;if("ams"===m){var _=Wc("amsrm",t.fontWeight,t.fontShape);return Uc(i,_,r,t,s.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==m&&m){var g=Wc(m,t.fontWeight,t.fontShape);return Uc(i,g,r,t,s.concat(g,t.fontWeight,t.fontShape))}var b=Wc("textrm",t.fontWeight,t.fontShape);return Uc(i,b,r,t,s.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=Gc(["mspace"],[],t),r=ql(e,t);return n.style.marginRight=$l(r),n},staticSvg:function(e,t){var[n,r,i]=Zc[e],s=new rc(n),o=new nc([s],{width:$l(r),height:$l(i),style:"width:"+$l(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),a=Xc(["overlay"],[o],t);return a.height=i,a.style.height=$l(i),a.style.width=$l(r),a},svgData:Zc,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof tc&&r instanceof tc&&qc(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e}},Jc={number:3,unit:"mu"},ed={number:4,unit:"mu"},td={number:5,unit:"mu"},nd={mord:{mop:Jc,mbin:ed,mrel:td,minner:Jc},mop:{mord:Jc,mop:Jc,mrel:td,minner:Jc},mbin:{mord:ed,mop:ed,mopen:ed,minner:ed},mrel:{mord:td,mop:td,mopen:td,minner:td},mopen:{},mclose:{mop:Jc,mbin:ed,mrel:td,minner:Jc},mpunct:{mord:Jc,mop:Jc,mrel:td,mopen:Jc,mclose:Jc,mpunct:Jc,minner:Jc},minner:{mord:Jc,mop:Jc,mbin:ed,mrel:td,mopen:Jc,mpunct:Jc,minner:Jc}},rd={mord:{mop:Jc},mop:{mord:Jc,mop:Jc},mbin:{},mrel:{},mopen:{},mclose:{mop:Jc},mpunct:{},minner:{mop:Jc}},id={},sd={},od={};function ad(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)id[n[l]]=a;t&&(s&&(sd[t]=s),o&&(od[t]=o))}function ld(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;ad({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var cd=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},dd=function(e){return"ordgroup"===e.type?e.body:[e]},ud=Qc.makeSpan,hd=["leftmost","mbin","mopen","mrel","mop","mpunct"],pd=["rightmost","mrel","mclose","mpunct"],fd={display:Ml.DISPLAY,text:Ml.TEXT,script:Ml.SCRIPT,scriptscript:Ml.SCRIPTSCRIPT},md={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},_d=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var i=[],s=0;s<e.length;s++){var o=xd(e[s],t);if(o instanceof Pl){var a=o.children;i.push(...a)}else i.push(o)}if(Qc.tryCombineChars(i),!n)return i;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(fd[c.style]))}var d=ud([r[0]||"leftmost"],[],t),u=ud([r[1]||"rightmost"],[],t),h="root"===n;return gd(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&ll(pd,r)?t.classes[0]="mord":"mbin"===r&&ll(hd,n)&&(e.classes[0]="mord")},{node:d},u,h),gd(i,(e,t)=>{var n=yd(t),r=yd(e),i=n&&r?e.hasClass("mtight")?rd[n][r]:nd[n][r]:null;if(i)return Qc.makeGlue(i,l)},{node:d},u,h),i},gd=function e(t,n,r,i,s){i&&t.push(i);for(var o=0;o<t.length;o++){var a=t[o],l=bd(a);if(l)e(l.children,n,r,null,s);else{var c=!a.hasClass("mspace");if(c){var d=n(a,r.node);d&&(r.insertAfter?r.insertAfter(d):(t.unshift(d),o++))}c?r.node=a:s&&a.hasClass("newline")&&(r.node=ud(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),o++})(o)}}i&&t.pop()},bd=function(e){return e instanceof Pl||e instanceof Ql||e instanceof Zl&&e.hasClass("enclosing")?e:null},vd=function e(t,n){var r=bd(t);if(r){var i=r.children;if(i.length){if("right"===n)return e(i[i.length-1],"right");if("left"===n)return e(i[0],"left")}}return t},yd=function(e,t){return e?(t&&(e=vd(e,t)),md[e.classes[0]]||null):null},wd=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return ud(t.concat(n))},xd=function(e,t,n){if(!e)return ud();if(sd[e.type]){var r=sd[e.type](e,t);if(n&&t.size!==n.size){r=ud(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new rl("Got group of unknown type: '"+e.type+"'")};function kd(e,t){var n=ud(["base"],e,t),r=ud(["strut"]);return r.style.height=$l(n.height+n.depth),n.depth&&(r.style.verticalAlign=$l(-n.depth)),n.children.unshift(r),n}function Sd(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,i=_d(e,t,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var s,o=[],a=[],l=0;l<i.length;l++)if(a.push(i[l]),i[l].hasClass("mbin")||i[l].hasClass("mrel")||i[l].hasClass("allowbreak")){for(var c=!1;l<i.length-1&&i[l+1].hasClass("mspace")&&!i[l+1].hasClass("newline");)l++,a.push(i[l]),i[l].hasClass("nobreak")&&(c=!0);c||(o.push(kd(a,t)),a=[])}else i[l].hasClass("newline")&&(a.pop(),a.length>0&&(o.push(kd(a,t)),a=[]),o.push(i[l]));a.length>0&&o.push(kd(a,t)),n?((s=kd(_d(n,t,!0))).classes=["tag"],o.push(s)):r&&o.push(r);var d=ud(["katex-html"],o);if(d.setAttribute("aria-hidden","true"),s){var u=s.children[0];u.style.height=$l(d.height+d.depth),d.depth&&(u.style.verticalAlign=$l(-d.depth))}return d}function Cd(e){return new Pl(e)}class Md{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=Gl(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Td&&this.children[n+1]instanceof Td){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Td;)r+=this.children[++n].toText();e.appendChild(new Td(r).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+=dl(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+dl(Gl(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 Td{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return dl(this.toText())}toText(){return this.text}}var Ld={MathNode:Md,TextNode:Td,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",$l(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+$l(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:Cd},zd=function(e,t,n){return!lc[t][e]||!lc[t][e].replace||55349===e.charCodeAt(0)||Cc.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=lc[t][e].replace),new Ld.TextNode(e)},Ad=function(e){return 1===e.length?e[0]:new Ld.MathNode("mrow",e)},Pd=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 r=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 i=e.text;return ll(["\\imath","\\jmath"],i)?null:(lc[r][i]&&lc[r][i].replace&&(i=lc[r][i].replace),Ol(i,Qc.fontMap[n].fontName,r)?Qc.fontMap[n].variant:null)};function Rd(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof Td&&"."===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 Td&&","===n.text}return!1}var Nd=function(e,t,n){if(1===e.length){var r=Od(e[0],t);return n&&r instanceof Md&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,s=[],o=0;o<e.length;o++){var a=Od(e[o],t);if(a instanceof Md&&i instanceof Md){if("mtext"===a.type&&"mtext"===i.type&&a.getAttribute("mathvariant")===i.getAttribute("mathvariant")){i.children.push(...a.children);continue}if("mn"===a.type&&"mn"===i.type){i.children.push(...a.children);continue}if(Rd(a)&&"mn"===i.type){i.children.push(...a.children);continue}if("mn"===a.type&&Rd(i))a.children=[...i.children,...a.children],s.pop();else if(("msup"===a.type||"msub"===a.type)&&a.children.length>=1&&("mn"===i.type||Rd(i))){var l=a.children[0];l instanceof Md&&"mn"===l.type&&(l.children=[...i.children,...l.children],s.pop())}else if("mi"===i.type&&1===i.children.length){var c=i.children[0];if(c instanceof Td&&"̸"===c.text&&("mo"===a.type||"mi"===a.type||"mn"===a.type)){var d=a.children[0];d instanceof Td&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(a),i=a}return s},Ed=function(e,t,n){return Ad(Nd(e,t,n))},Od=function(e,t){if(!e)return new Ld.MathNode("mrow");if(od[e.type])return od[e.type](e,t);throw new rl("Got group of unknown type: '"+e.type+"'")};function Id(e,t,n,r,i){var s,o=Nd(e,n);s=1===o.length&&o[0]instanceof Md&&ll(["mrow","mtable"],o[0].type)?o[0]:new Ld.MathNode("mrow",o);var a=new Ld.MathNode("annotation",[new Ld.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new Ld.MathNode("semantics",[s,a]),c=new Ld.MathNode("math",[l]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block"),Qc.makeSpan([i?"katex":"katex-mathml"],[c])}var Bd={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":"="},Dd={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]},Vd=function(e){var t=new Ld.MathNode("mo",[new Ld.TextNode(Bd[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Hd=function(e,t){var{span:n,minWidth:r,height:i}=function(){var n=4e5,r=e.label.slice(1);if(ll(["widehat","widecheck","widetilde","utilde"],r)){var i,s,o,a="ordgroup"===(p=e.base).type?p.body.length:1;if(a>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,o=.42,s=r+"4"):(i=312,n=2340,o=.34,s="tilde4");else{var l=[1,1,2,2,3,3][a];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],o=[0,.24,.3,.3,.36,.42][l],s=r+l):(n=[0,600,1033,2339,2340][l],i=[0,260,286,306,312][l],o=[0,.26,.286,.3,.306,.34][l],s="tilde"+l)}var c=new rc(s),d=new nc([c],{width:"100%",height:$l(o),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:Qc.makeSvgSpan([],[d],t),minWidth:0,height:o}}var u,h,p,f=[],m=Dd[r],[_,g,b]=m,v=b/1e3,y=_.length;if(1===y)u=["hide-tail"],h=[m[3]];else if(2===y)u=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{if(3!==y)throw new Error("Correct katexImagesData or update code here to support\n "+y+" children.");u=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<y;w++){var x=new rc(_[w]),k=new nc([x],{width:"400em",height:$l(v),viewBox:"0 0 "+n+" "+b,preserveAspectRatio:h[w]+" slice"}),S=Qc.makeSvgSpan([u[w]],[k],t);if(1===y)return{span:S,minWidth:g,height:v};S.style.height=$l(v),f.push(S)}return{span:Qc.makeSpan(["stretchy"],f,t),minWidth:g,height:v}}();return n.height=i,n.style.height=$l(i),r>0&&(n.style.minWidth=$l(r)),n};function jd(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 Fd(e){var t=Ud(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 Ud(e){return e&&("atom"===e.type||ac.hasOwnProperty(e.type))?e:null}var qd=(e,t)=>{var n,r,i;e&&"supsub"===e.type?(n=(r=jd(e.base,"accent")).base,e.base=n,i=function(e){if(e instanceof Zl)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(xd(e,t)),e.base=r):n=(r=jd(e,"accent")).base;var s=xd(n,t.havingCrampedStyle()),o=0;if(r.isShifty&&pl(n)){var a=hl(n);o=sc(xd(a,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,d=c?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(r.isStretchy)l=Hd(r,t),l=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+$l(2*o)+")",marginLeft:$l(2*o)}:void 0}]},t);else{var u,h;"\\vec"===r.label?(u=Qc.staticSvg("vec",t),h=Qc.svgData.vec[1]):((u=sc(u=Qc.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,h=u.width,c&&(d+=u.depth)),l=Qc.makeSpan(["accent-body"],[u]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),d=s.height);var f=o;p||(f-=h/2),l.style.left=$l(f),"\\textcircled"===r.label&&(l.style.top=".2em"),l=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:l}]},t)}var m=Qc.makeSpan(["mord","accent"],[l],t);return i?(i.children[0]=m,i.height=Math.max(m.height,i.height),i.classes[0]="mord",i):m},$d=(e,t)=>{var n=e.isStretchy?Vd(e.label):new Ld.MathNode("mo",[zd(e.label,e.mode)]),r=new Ld.MathNode("mover",[Od(e.base,t),n]);return r.setAttribute("accent","true"),r},Gd=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ad({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=cd(t[0]),r=!Gd.test(e.funcName),i=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:qd,mathmlBuilder:$d}),ad({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],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:qd,mathmlBuilder:$d}),ad({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=xd(e.base,t),r=Hd(e,t),i="\\utilde"===e.label?.12:0,s=Qc.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},t);return Qc.makeSpan(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{var n=Vd(e.label),r=new Ld.MathNode("munder",[Od(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Xd=e=>{var t=new Ld.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ad({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:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,i=t.havingStyle(r.sup()),s=Qc.wrapFragment(xd(e.body,i,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";s.classes.push(o+"-arrow-pad"),e.below&&(i=t.havingStyle(r.sub()),(n=Qc.wrapFragment(xd(e.below,i,t),t)).classes.push(o+"-arrow-pad"));var a,l=Hd(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 u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;a=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:u}]},t)}else a=Qc.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"),Qc.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var n,r=Vd(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var i=Xd(Od(e.body,t));if(e.below){var s=Xd(Od(e.below,t));n=new Ld.MathNode("munderover",[r,s,i])}else n=new Ld.MathNode("mover",[r,i])}else if(e.below){var o=Xd(Od(e.below,t));n=new Ld.MathNode("munder",[r,o])}else n=Xd(),n=new Ld.MathNode("mover",[r,n]);return n}});var Kd=Qc.makeSpan;function Wd(e,t){var n=_d(e.body,t,!0);return Kd([e.mclass],n,t)}function Yd(e,t){var n,r=Nd(e.body,t);return"minner"===e.mclass?n=new Ld.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new Ld.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new Ld.MathNode("mo",r),"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}ad({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:dd(i),isCharacterBox:pl(i)}},htmlBuilder:Wd,mathmlBuilder:Yd});var Zd=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};ad({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Zd(t[0]),body:dd(t[1]),isCharacterBox:pl(t[1])}}}),ad({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:i}=e,s=t[1],o=t[0];n="\\stackrel"!==i?Zd(s):"mrel";var a={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:dd(s)},l={type:"supsub",mode:o.mode,base:a,sup:"\\underset"===i?null:o,sub:"\\underset"===i?o:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:pl(l)}},htmlBuilder:Wd,mathmlBuilder:Yd}),ad({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Zd(t[0]),body:dd(t[0])}},htmlBuilder(e,t){var n=_d(e.body,t,!0),r=Qc.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Nd(e.body,t),r=new Ld.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Qd={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Jd=()=>({type:"styling",body:[],mode:"math",style:"display"}),eu=e=>"textord"===e.type&&"@"===e.text,tu=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function nu(e,t,n){var r=Qd[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:r,mode:"math",family:"rel"},s={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[i],[]),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"}}}ad({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Qc.wrapFragment(xd(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=$l(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Ld.MathNode("mrow",[Od(e.label,t)]);return(n=new Ld.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new Ld.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),ad({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=Qc.wrapFragment(xd(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new Ld.MathNode("mrow",[Od(e.fragment,t)])}),ad({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=jd(t[0],"ordgroup").body,i="",s=0;s<r.length;s++)i+=jd(r[s],"textord").text;var o,a=parseInt(i);if(isNaN(a))throw new rl("\\@char has non-numeric argument "+i);if(a<0||a>=1114111)throw new rl("\\@char with invalid code point "+i);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 ru=(e,t)=>{var n=_d(e.body,t.withColor(e.color),!1);return Qc.makeFragment(n)},iu=(e,t)=>{var n=Nd(e.body,t.withColor(e.color)),r=new Ld.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};ad({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=jd(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:dd(i)}},htmlBuilder:ru,mathmlBuilder:iu}),ad({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=jd(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:s}},htmlBuilder:ru,mathmlBuilder:iu}),ad({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:i&&jd(i,"size").value}},htmlBuilder(e,t){var n=Qc.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=$l(ql(e.size,t)))),n},mathmlBuilder(e,t){var n=new Ld.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",$l(ql(e.size,t)))),n}});var su={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ou=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new rl("Expected a control sequence",e);return t},au=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};ad({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(su[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=su[r.text]),jd(t.parseFunction(),"internal");throw new rl("Invalid token after macro prefix",r)}}),ad({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new rl("Expected a control sequence",r);for(var s,o=0,a=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){s=t.gullet.future(),a[o].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new rl('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==o+1)throw new rl('Argument number "'+r.text+'" out of order');o++,a.push([])}else{if("EOF"===r.text)throw new rl("Expected a macro definition");a[o].push(r.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(i,{tokens:l,numArgs:o,delimiters:a},n===su[n]),{type:"internal",mode:t.mode}}}),ad({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=ou(t.gullet.popToken());t.gullet.consumeSpaces();var i=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return au(t,r,i,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),ad({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=ou(t.gullet.popToken()),i=t.gullet.popToken(),s=t.gullet.popToken();return au(t,r,s,"\\\\globalfuture"===n),t.gullet.pushToken(s),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var lu=function(e,t,n){var r=Ol(lc.math[e]&&lc.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},cu=function(e,t,n,r){var i=n.havingBaseStyle(t),s=Qc.makeSpan(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=i.sizeMultiplier,s},du=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=$l(i),e.height-=i,e.depth+=i},uu=function(e,t,n,r,i,s){var o=function(e,t,n,r){return Qc.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,i,r),a=cu(Qc.makeSpan(["delimsizing","size"+t],[o],r),Ml.TEXT,r,s);return n&&du(a,r,Ml.TEXT),a},hu=function(e,t,n){return{type:"elem",elem:Qc.makeSpan(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[Qc.makeSpan([],[Qc.makeSymbol(e,t,n)])])}},pu=function(e,t,n){var r=Rl["Size4-Regular"][e.charCodeAt(0)]?Rl["Size4-Regular"][e.charCodeAt(0)][4]:Rl["Size1-Regular"][e.charCodeAt(0)][4],i=new rc("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 nc([i],{width:$l(r),height:$l(t),style:"width:"+$l(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=Qc.makeSvgSpan([],[s],n);return o.height=t,o.style.height=$l(t),o.style.width=$l(r),{type:"elem",elem:o}},fu={type:"kern",size:-.008},mu=["|","\\lvert","\\rvert","\\vert"],_u=["\\|","\\lVert","\\rVert","\\Vert"],gu=function(e,t,n,r,i,s){var o,a,l,c,d="",u=0;o=l=c=e,a=null;var h="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"):ll(mu,e)?(l="∣",d="vert",u=333):ll(_u,e)?(l="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(o="⎧",a="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",a="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=lu(o,h,i),f=p.height+p.depth,m=lu(l,h,i),_=m.height+m.depth,g=lu(c,h,i),b=g.height+g.depth,v=0,y=1;if(null!==a){var w=lu(a,h,i);v=w.height+w.depth,y=2}var x=f+b+v,k=x+Math.max(0,Math.ceil((t-x)/(y*_)))*y*_,S=r.fontMetrics().axisHeight;n&&(S*=r.sizeMultiplier);var C=k/2-S,M=[];if(d.length>0){var T=k-f-b,L=Math.round(1e3*k),z=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*T)),A=new rc(d,z),P=(u/1e3).toFixed(3)+"em",R=(L/1e3).toFixed(3)+"em",N=new nc([A],{width:P,height:R,viewBox:"0 0 "+u+" "+L}),E=Qc.makeSvgSpan([],[N],r);E.height=L/1e3,E.style.width=P,E.style.height=R,M.push({type:"elem",elem:E})}else{if(M.push(hu(c,h,i)),M.push(fu),null===a){var O=k-f-b+.016;M.push(pu(l,O,r))}else{var I=(k-f-b-v)/2+.016;M.push(pu(l,I,r)),M.push(fu),M.push(hu(a,h,i)),M.push(fu),M.push(pu(l,I,r))}M.push(fu),M.push(hu(o,h,i))}var B=r.havingBaseStyle(Ml.TEXT),D=Qc.makeVList({positionType:"bottom",positionData:C,children:M},B);return cu(Qc.makeSpan(["delimsizing","mult"],[D],B),Ml.TEXT,r,s)},bu=.08,vu=function(e,t,n,r,i){var s=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=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":r=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":r=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":r=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":r=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":r=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 r}(e,r,n),o=new rc(e,s),a=new nc([o],{width:"400em",height:$l(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Qc.makeSvgSpan(["hide-tail"],[a],i)},yu=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],wu=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],xu=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ku=[0,1.2,1.8,2.4,3],Su=[{type:"small",style:Ml.SCRIPTSCRIPT},{type:"small",style:Ml.SCRIPT},{type:"small",style:Ml.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Cu=[{type:"small",style:Ml.SCRIPTSCRIPT},{type:"small",style:Ml.SCRIPT},{type:"small",style:Ml.TEXT},{type:"stack"}],Mu=[{type:"small",style:Ml.SCRIPTSCRIPT},{type:"small",style:Ml.SCRIPT},{type:"small",style:Ml.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Tu=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.")},Lu=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length&&"stack"!==n[i].type;i++){var s=lu(e,Tu(n[i]),"math"),o=s.height+s.depth;if("small"===n[i].type&&(o*=r.havingBaseStyle(n[i].style).sizeMultiplier),o>t)return n[i]}return n[n.length-1]},zu=function(e,t,n,r,i,s){var o;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),o=ll(xu,e)?Su:ll(yu,e)?Mu:Cu;var a=Lu(e,t,o,r);return"small"===a.type?function(e,t,n,r,i,s){var o=Qc.makeSymbol(e,"Main-Regular",i,r),a=cu(o,t,r,s);return n&&du(a,r,t),a}(e,a.style,n,r,i,s):"large"===a.type?uu(e,a.size,n,r,i,s):gu(e,t,n,r,i,s)},Au={sqrtImage:function(e,t){var n,r,i=t.havingBaseSizing(),s=Lu("\\surd",e*i.sizeMultiplier,Mu,i),o=i.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=vu("sqrtMain",l=(1+a+bu)/o,d=1e3+1e3*a+80,a,t)).style.minWidth="0.853em",r=.833/o):"large"===s.type?(d=1080*ku[s.size],c=(ku[s.size]+a)/o,l=(ku[s.size]+a+bu)/o,(n=vu("sqrtSize"+s.size,l,d,a,t)).style.minWidth="1.02em",r=1/o):(l=e+a+bu,c=e+a,d=Math.floor(1e3*e+a)+80,(n=vu("sqrtTall",l,d,a,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=$l(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*o}},sizedDelim:function(e,t,n,r,i){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),ll(yu,e)||ll(xu,e))return uu(e,t,!1,n,r,i);if(ll(wu,e))return gu(e,ku[t],!1,n,r,i);throw new rl("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:ku,customSizedDelim:zu,leftRightDelim:function(e,t,n,r,i,s){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,a=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o),c=Math.max(l/500*901,2*l-a);return zu(e,c,!0,r,i,s)}},Pu={"\\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}},Ru=["(","\\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 Nu(e,t){var n=Ud(e);if(n&&ll(Ru,n.text))return n;throw new rl(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Eu(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ad({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=Nu(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Pu[e.funcName].size,mclass:Pu[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Qc.makeSpan([e.mclass]):Au.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(zd(e.delim,e.mode));var n=new Ld.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=$l(Au.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),ad({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 rl("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Nu(t[0],e).text,color:n}}}),ad({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Nu(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=jd(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{Eu(e);for(var n,r,i=_d(e.body,t,!0,["mopen","mclose"]),s=0,o=0,a=!1,l=0;l<i.length;l++)i[l].isMiddle?a=!0:(s=Math.max(i[l].height,s),o=Math.max(i[l].depth,o));if(s*=t.sizeMultiplier,o*=t.sizeMultiplier,n="."===e.left?wd(t,["mopen"]):Au.leftRightDelim(e.left,s,o,t,e.mode,["mopen"]),i.unshift(n),a)for(var c=1;c<i.length;c++){var d=i[c].isMiddle;d&&(i[c]=Au.leftRightDelim(d.delim,s,o,d.options,e.mode,[]))}if("."===e.right)r=wd(t,["mclose"]);else{var u=e.rightColor?t.withColor(e.rightColor):t;r=Au.leftRightDelim(e.right,s,o,u,e.mode,["mclose"])}return i.push(r),Qc.makeSpan(["minner"],i,t)},mathmlBuilder:(e,t)=>{Eu(e);var n=Nd(e.body,t);if("."!==e.left){var r=new Ld.MathNode("mo",[zd(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var i=new Ld.MathNode("mo",[zd(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return Ad(n)}}),ad({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Nu(t[0],e);if(!e.parser.leftrightDepth)throw new rl("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=wd(t,[]);else{n=Au.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?zd("|","text"):zd(e.delim,e.mode),r=new Ld.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Ou=(e,t)=>{var n,r,i,s=Qc.wrapFragment(xd(e.body,t),t),o=e.label.slice(1),a=t.sizeMultiplier,l=0,c=pl(e.body);if("sout"===o)(n=Qc.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,l=-.5*t.fontMetrics().xHeight;else if("phase"===o){var d=ql({number:.6,unit:"pt"},t),u=ql({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=s.height+s.depth+d+u;s.style.paddingLeft=$l(h/2+d);var p=Math.floor(1e3*h*a),f="M400000 "+(r=p)+" H0 L"+r/2+" 0 l65 45 L145 "+(r-80)+" H400000z",m=new nc([new rc("phase",f)],{width:"400em",height:$l(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});(n=Qc.makeSvgSpan(["hide-tail"],[m],t)).style.height=$l(h),l=s.depth+d+u}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,r,i){var s,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(s=Qc.makeSpan(["stretchy",t],[],i),"fbox"===t){var a=i.color&&i.getColor();a&&(s.style.borderColor=a)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new ic({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new ic({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new nc(l,{width:"100%",height:$l(o)});s=Qc.makeSvgSpan([],[c],i)}return s.height=o,s.style.height=$l(o),s}(s,o,_,g,t),/fbox|boxed|fcolorbox/.test(o)?(n.style.borderStyle="solid",n.style.borderWidth=$l(b)):"angl"===o&&.049!==b&&(n.style.borderTopWidth=$l(b),n.style.borderRightWidth=$l(b)),l=s.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)i=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:l},{type:"elem",elem:s,shift:0}]},t);else{var v=/cancel|phase/.test(o)?["svg-align"]:[];i=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:n,shift:l,wrapperClasses:v}]},t)}return/cancel/.test(o)&&(i.height=s.height,i.depth=s.depth),/cancel/.test(o)&&!c?Qc.makeSpan(["mord","cancel-lap"],[i],t):Qc.makeSpan(["mord"],[i],t)},Iu=(e,t)=>{var n=0,r=new Ld.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Od(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ad({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=jd(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:Ou,mathmlBuilder:Iu}),ad({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=jd(t[0],"color-token").color,o=jd(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:Ou,mathmlBuilder:Iu}),ad({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]}}}),ad({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Ou,mathmlBuilder:Iu}),ad({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 Bu={};function Du(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)Bu[n[l]]=a;s&&(sd[t]=s),o&&(od[t]=o)}var Vu={};function Hu(e,t){Vu[e]=t}function ju(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 Fu=e=>{if(!e.parser.settings.displayMode)throw new rl("{"+e.envName+"} can be used only in display mode.")};function Uu(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function qu(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=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 rl("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var f=[],m=[f],_=[],g=[],b=null!=l?[]:void 0;function v(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function y(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new nl("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(v(),g.push(ju(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(u&&f.length===u){if(c||a)throw new rl("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){y(),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 rl("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),y(),g.push(ju(e)),f=[],m.push(f),v()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:i,arraystretch:o,body:m,cols:s,rowGaps:_,hskipBeforeAndAfter:r,hLinesBeforeRow:g,colSeparationType:a,tags:b,leqno:h}}function $u(e){return"d"===e.slice(0,1)?"display":"text"}var Gu=function(e,t){var n,r,i=e.body.length,s=e.hLinesBeforeRow,o=0,a=new Array(i),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(Ml.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?ql({number:3,unit:"ex"},t):12*d,p=3*d,f=e.arraystretch*h,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 v=e.body[n],y=m,w=_;o<v.length&&(o=v.length);var x=new Array(v.length);for(r=0;r<v.length;++r){var k=xd(v[r],t);w<k.depth&&(w=k.depth),y<k.height&&(y=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=ql(S,t))>0&&(w<(C+=_)&&(w=C),C=0),e.addJot&&(w+=p),x.height=y,x.depth=w,g+=y,x.pos=g,g+=w+C,a[n]=x,b(s[n+1])}var M,T,L=g/2+t.fontMetrics().axisHeight,z=e.cols||[],A=[],P=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var R=a[n],N=R.pos-L,E=e.tags[n],O=void 0;(O=!0===E?Qc.makeSpan(["eqn-num"],[],t):Qc.makeSpan([],!1===E?[]:_d(E,t,!0),t)).depth=R.depth,O.height=R.height,P.push({type:"elem",elem:O,shift:N})}for(r=0,T=0;r<o||T<z.length;++r,++T){for(var I=z[T]||{},B=!0;"separator"===I.type;){if(B||((M=Qc.makeSpan(["arraycolsep"],[])).style.width=$l(t.fontMetrics().doubleRuleSep),A.push(M)),"|"!==I.separator&&":"!==I.separator)throw new rl("Invalid separator type: "+I.separator);var D="|"===I.separator?"solid":"dashed",V=Qc.makeSpan(["vertical-separator"],[],t);V.style.height=$l(g),V.style.borderRightWidth=$l(c),V.style.borderRightStyle=D,V.style.margin="0 "+$l(-c/2);var H=g-L;H&&(V.style.verticalAlign=$l(-H)),A.push(V),I=z[++T]||{},B=!1}if(!(r>=o)){var j=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(j=cl(I.pregap,u))&&((M=Qc.makeSpan(["arraycolsep"],[])).style.width=$l(j),A.push(M));var F=[];for(n=0;n<i;++n){var U=a[n],q=U[r];if(q){var $=U.pos-L;q.depth=U.depth,q.height=U.height,F.push({type:"elem",elem:q,shift:$})}}F=Qc.makeVList({positionType:"individualShift",children:F},t),F=Qc.makeSpan(["col-align-"+(I.align||"c")],[F]),A.push(F),(r<o-1||e.hskipBeforeAndAfter)&&0!==(j=cl(I.postgap,u))&&((M=Qc.makeSpan(["arraycolsep"],[])).style.width=$l(j),A.push(M))}}if(a=Qc.makeSpan(["mtable"],A),l.length>0){for(var G=Qc.makeLineSpan("hline",t,c),X=Qc.makeLineSpan("hdashline",t,c),K=[{type:"elem",elem:a,shift:0}];l.length>0;){var W=l.pop(),Y=W.pos-L;W.isDashed?K.push({type:"elem",elem:X,shift:Y}):K.push({type:"elem",elem:G,shift:Y})}a=Qc.makeVList({positionType:"individualShift",children:K},t)}if(0===P.length)return Qc.makeSpan(["mord"],[a],t);var Z=Qc.makeVList({positionType:"individualShift",children:P},t);return Z=Qc.makeSpan(["tag"],[Z],t),Qc.makeFragment([a,Z])},Xu={c:"center ",l:"left ",r:"right "},Ku=function(e,t){for(var n=[],r=new Ld.MathNode("mtd",[],["mtr-glue"]),i=new Ld.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 Ld.MathNode("mtd",[Od(o[l],t)]));e.tags&&e.tags[s]&&(a.unshift(r),a.push(r),e.leqno?a.unshift(i):a.push(i)),n.push(new Ld.MathNode("mtr",a))}var c=new Ld.MathNode("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",$l(d));var u="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,f="",m=!1,_=0,g=p.length;"separator"===p[0].type&&(u+="top ",_=1),"separator"===p[p.length-1].type&&(u+="bottom ",g-=1);for(var b=_;b<g;b++)"align"===p[b].type?(h+=Xu[p[b].align],m&&(f+="none "),m=!0):"separator"===p[b].type&&m&&(f+="|"===p[b].separator?"solid ":"dashed ",m=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(f)&&c.setAttribute("columnlines",f.trim())}if("align"===e.colSeparationType){for(var v=e.cols||[],y="",w=1;w<v.length;w++)y+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",y.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;u+=k[0].length>0?"left ":"",u+=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()),""!==u&&(c=new Ld.MathNode("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new Ld.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},Wu=function(e,t){-1===e.envName.indexOf("ed")&&Fu(e);var n,r=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s="split"===e.envName,o=qu(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:Uu(e.envName),emptySingleRow:!0,colSeparationType:i,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+=jd(t[0].body[d],"textord").text;n=Number(c),a=2*n}var u=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var r=jd(e[t],"styling");jd(r.body[0],"ordgroup").body.unshift(l)}if(u)a<e.length&&(a=e.length);else{var i=e.length/2;if(n<i)throw new rl("Too many math in a row: expected "+n+", but got "+i,e[0])}});for(var h=0;h<a;++h){var p="r",f=0;h%2==1?p="l":h>0&&u&&(f=1),r[h]={type:"align",align:p,pregap:f,postgap:0}}return o.colSeparationType=u?"align":"alignat",o};Du({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Ud(t[0])?[t[0]]:jd(t[0],"ordgroup").body).map(function(e){var t=Fd(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 rl("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return qu(e.parser,r,$u(e.envName))},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({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",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,-1==="lcr".indexOf(n))throw new rl("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var s=qu(e.parser,r,$u(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:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=qu(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Ud(t[0])?[t[0]]:jd(t[0],"ordgroup").body).map(function(e){var t=Fd(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new rl("Unknown column alignment: "+t,e)});if(n.length>1)throw new rl("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=qu(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new rl("{subarray} can contain only one column");return r},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=qu(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},$u(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:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Wu,htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){ll(["gather","gather*"],e.envName)&&Fu(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Uu(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return qu(e.parser,t,"display")},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Wu,htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Fu(e);var t={autoTag:Uu(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return qu(e.parser,t,"display")},htmlBuilder:Gu,mathmlBuilder:Ku}),Du({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Fu(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 rl("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],i=[r],s=0;s<t.length;s++){for(var o=t[s],a=Jd(),l=0;l<o.length;l++)if(eu(o[l])){r.push(a);var c=Fd(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 rl('Expected one of "<>AV=|." after @',o[l]);for(var u=0;u<2;u++){for(var h=!0,p=l+1;p<o.length;p++){if(tu(o[p],c)){h=!1,l=p;break}if(eu(o[p]))throw new rl("Missing a "+c+" character to complete a CD arrow.",o[p]);d[u].body.push(o[p])}if(h)throw new rl("Missing a "+c+" character to complete a CD arrow.",o[l])}}var f={type:"styling",body:[nu(c,d,e)],mode:"math",style:"display"};r.push(f),a=Jd()}else a.body.push(o[l]);s%2==0?r.push(a):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}(e.parser)),htmlBuilder:Gu,mathmlBuilder:Ku}),Hu("\\nonumber","\\gdef\\@eqnsw{0}"),Hu("\\notag","\\nonumber"),ad({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new rl(e.funcName+" valid only within array environment")}});var Yu=Bu;ad({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if("ordgroup"!==i.type)throw new rl("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=jd(i.body[o],"textord").text;if("\\begin"===r){if(!Yu.hasOwnProperty(s))throw new rl("No such environment: "+s,i);var a=Yu[s],{args:l,optArgs:c}=n.parseArguments("\\begin{"+s+"}",a),d={mode:n.mode,envName:s,parser:n},u=a.handler(d,l,c);n.expect("\\end",!1);var h=n.nextToken,p=jd(n.parseFunction(),"environment");if(p.name!==s)throw new rl("Mismatch: \\begin{"+s+"} matched by \\end{"+p.name+"}",h);return u}return{type:"environment",mode:n.mode,name:s,nameGroup:i}}});var Zu=(e,t)=>{var n=e.font,r=t.withFont(n);return xd(e.body,r)},Qu=(e,t)=>{var n=e.font,r=t.withFont(n);return Od(e.body,r)},Ju={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};ad({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:r}=e,i=cd(t[0]),s=r;return s in Ju&&(s=Ju[s]),{type:"font",mode:n.mode,font:s.slice(1),body:i}},htmlBuilder:Zu,mathmlBuilder:Qu}),ad({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=pl(r);return{type:"mclass",mode:n.mode,mclass:Zd(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}}),ad({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:s}=n,o=n.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:Zu,mathmlBuilder:Qu});var eh=(e,t)=>{var n=t;return"display"===e?n=n.id>=Ml.SCRIPT.id?n.text():Ml.DISPLAY:"text"===e&&n.size===Ml.DISPLAY.size?n=Ml.TEXT:"script"===e?n=Ml.SCRIPT:"scriptscript"===e&&(n=Ml.SCRIPTSCRIPT),n},th=(e,t)=>{var n,r=eh(e.size,t.style),i=r.fracNum(),s=r.fracDen();n=t.havingStyle(i);var o=xd(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,u,h,p,f,m,_,g,b,v=xd(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=ql(e.barSize,t),c=Qc.makeLineSpan("frac-line",t,d)):c=Qc.makeLineSpan("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),r.size===Ml.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,p=d>0?3*u:7*u,f=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,p=u):(h=t.fontMetrics().num3,p=3*u),f=t.fontMetrics().denom2),c){var y=t.fontMetrics().axisHeight;h-o.depth-(y+.5*d)<p&&(h+=p-(h-o.depth-(y+.5*d))),y-.5*d-(v.height-f)<p&&(f+=p-(y-.5*d-(v.height-f))),m=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:v,shift:f},{type:"elem",elem:c,shift:-(y-.5*d)},{type:"elem",elem:o,shift:-h}]},t)}else{var w=h-o.depth-(v.height-f);w<p&&(h+=.5*(p-w),f+=.5*(p-w)),m=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:v,shift:f},{type:"elem",elem:o,shift:-h}]},t)}return n=t.havingStyle(r),m.height*=n.sizeMultiplier/t.sizeMultiplier,m.depth*=n.sizeMultiplier/t.sizeMultiplier,_=r.size===Ml.DISPLAY.size?t.fontMetrics().delim1:r.size===Ml.SCRIPTSCRIPT.size?t.havingStyle(Ml.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,g=null==e.leftDelim?wd(t,["mopen"]):Au.customSizedDelim(e.leftDelim,_,!0,t.havingStyle(r),e.mode,["mopen"]),b=e.continued?Qc.makeSpan([]):null==e.rightDelim?wd(t,["mclose"]):Au.customSizedDelim(e.rightDelim,_,!0,t.havingStyle(r),e.mode,["mclose"]),Qc.makeSpan(["mord"].concat(n.sizingClasses(t)),[g,Qc.makeSpan(["mfrac"],[m]),b],t)},nh=(e,t)=>{var n=new Ld.MathNode("mfrac",[Od(e.numer,t),Od(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=ql(e.barSize,t);n.setAttribute("linethickness",$l(r))}}else n.setAttribute("linethickness","0px");var i=eh(e.size,t.style);if(i.size!==t.style.size){n=new Ld.MathNode("mstyle",[n]);var s=i.size===Ml.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 Ld.MathNode("mo",[new Ld.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(n),null!=e.rightDelim){var l=new Ld.MathNode("mo",[new Ld.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Ad(o)}return n};ad({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:i}=e,s=t[0],o=t[1],a=null,l=null,c="auto";switch(i){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(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:s,denom:o,hasBarLine:n,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:th,mathmlBuilder:nh}),ad({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),ad({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:i}=e;switch(r){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:i}}});var rh=["display","text","script","scriptscript"],ih=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};ad({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,i=t[4],s=t[5],o=cd(t[0]),a="atom"===o.type&&"open"===o.family?ih(o.text):null,l=cd(t[1]),c="atom"===l.type&&"close"===l.family?ih(l.text):null,d=jd(t[2],"size"),u=null;n=!!d.isBlank||(u=d.value).number>0;var h="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var f=jd(p.body[0],"textord");h=rh[Number(f.text)]}}else p=jd(p,"textord"),h=rh[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:n,barSize:u,leftDelim:a,rightDelim:c,size:h}},htmlBuilder:th,mathmlBuilder:nh}),ad({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:jd(t[0],"size").value,token:i}}}),ad({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(jd(t[1],"infix").size),o=t[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:th,mathmlBuilder:nh});var sh=(e,t)=>{var n,r,i=t.style;"supsub"===e.type?(n=e.sup?xd(e.sup,t.havingStyle(i.sup()),t):xd(e.sub,t.havingStyle(i.sub()),t),r=jd(e.base,"horizBrace")):r=jd(e,"horizBrace");var s,o=xd(r.base,t.havingBaseStyle(Ml.DISPLAY)),a=Hd(r,t);if(r.isOver?(s=Qc.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=Qc.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=Qc.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t);s=r.isOver?Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Qc.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 Qc.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t)};ad({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:sh,mathmlBuilder:(e,t)=>{var n=Vd(e.label);return new Ld.MathNode(e.isOver?"mover":"munder",[Od(e.base,t),n])}}),ad({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=jd(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:dd(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=_d(e.body,t,!1);return Qc.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Ed(e.body,t);return n instanceof Md||(n=new Md("mrow",[n])),n.setAttribute("href",e.href),n}}),ad({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=jd(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<r.length;s++){var o=r[s];"~"===o&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:dd(a)}}}),ad({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:dd(t[0])}},htmlBuilder(e,t){var n=_d(e.body,t,!1);return Qc.makeFragment(n)},mathmlBuilder:(e,t)=>new Ld.MathNode("mrow",Nd(e.body,t))}),ad({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:i,token:s}=e,o=jd(t[0],"raw").string,a=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){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 u=c[d].split("=");if(2!==u.length)throw new rl("Error parsing key-value for \\htmlData");l["data-"+u[0].trim()]=u[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:dd(a)}:r.formatUnsupportedCmd(i)},htmlBuilder:(e,t)=>{var n=_d(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Qc.makeSpan(r,n,t);for(var s in e.attributes)"class"!==s&&e.attributes.hasOwnProperty(s)&&i.setAttribute(s,e.attributes[s]);return i},mathmlBuilder:(e,t)=>Ed(e.body,t)}),ad({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:dd(t[0]),mathml:dd(t[1])}},htmlBuilder:(e,t)=>{var n=_d(e.html,t,!1);return Qc.makeFragment(n)},mathmlBuilder:(e,t)=>Ed(e.mathml,t)});var oh=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 rl("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Ul(n))throw new rl("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ad({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(n[0])for(var l=jd(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":a=u;break;case"width":i=oh(u);break;case"height":s=oh(u);break;case"totalheight":o=oh(u);break;default:throw new rl("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=jd(t[0],"url").url;return""===a&&(a=(a=(a=h).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:a,width:i,height:s,totalheight:o,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=ql(e.height,t),r=0;e.totalheight.number>0&&(r=ql(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=ql(e.width,t));var s={height:$l(n+r)};i>0&&(s.width=$l(i)),r>0&&(s.verticalAlign=$l(-r));var o=new Jl(e.src,e.alt,s);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Ld.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=ql(e.height,t),i=0;if(e.totalheight.number>0&&(i=ql(e.totalheight,t)-r,n.setAttribute("valign",$l(-i))),n.setAttribute("height",$l(r+i)),e.width.number>0){var s=ql(e.width,t);n.setAttribute("width",$l(s))}return n.setAttribute("src",e.src),n}}),ad({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=jd(t[0],"size");if(n.settings.strict){var s="m"===r[1],o="mu"===i.value.unit;s?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:(e,t)=>Qc.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=ql(e.dimension,t);return new Ld.SpaceNode(n)}}),ad({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=Qc.makeSpan([],[xd(e.body,t)]),n=Qc.makeSpan(["inner"],[n],t)):n=Qc.makeSpan(["inner"],[xd(e.body,t)]);var r=Qc.makeSpan(["fix"],[]),i=Qc.makeSpan([e.alignment],[n,r],t),s=Qc.makeSpan(["strut"]);return s.style.height=$l(i.height+i.depth),i.depth&&(s.style.verticalAlign=$l(-i.depth)),i.children.unshift(s),i=Qc.makeSpan(["thinbox"],[i],t),Qc.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Ld.MathNode("mpadded",[Od(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),ad({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var s="\\("===n?"\\)":"$",o=r.parseExpression(!1,s);return r.expect(s),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:o}}}),ad({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new rl("Mismatched "+e.funcName)}});var ah=(e,t)=>{switch(t.style.size){case Ml.DISPLAY.size:return e.display;case Ml.TEXT.size:return e.text;case Ml.SCRIPT.size:return e.script;case Ml.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ad({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:dd(t[0]),text:dd(t[1]),script:dd(t[2]),scriptscript:dd(t[3])}},htmlBuilder:(e,t)=>{var n=ah(e,t),r=_d(n,t,!1);return Qc.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=ah(e,t);return Ed(n,t)}});var lh=(e,t,n,r,i,s,o)=>{e=Qc.makeSpan([],[e]);var a,l,c,d=n&&pl(n);if(t){var u=xd(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var h=xd(n,r.havingStyle(i.sub()),r);a={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&a){var p=r.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+o;c=Qc.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:$l(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:$l(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(a){var f=e.height-o;c=Qc.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:$l(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var m=e.depth+o;c=Qc.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:$l(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var _=[c];if(a&&0!==s&&!d){var g=Qc.makeSpan(["mspace"],[],r);g.style.marginRight=$l(s),_.unshift(g)}return Qc.makeSpan(["mop","op-limits"],_,r)},ch=["\\smallint"],dh=(e,t)=>{var n,r,i,s=!1;"supsub"===e.type?(n=e.sup,r=e.sub,i=jd(e.base,"op"),s=!0):i=jd(e,"op");var o,a=t.style,l=!1;if(a.size===Ml.DISPLAY.size&&i.symbol&&!ll(ch,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",d="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(d=i.name.slice(1),i.name="oiint"===d?"\\iint":"\\iiint"),o=Qc.makeSymbol(i.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d.length>0){var u=o.italic,h=Qc.staticSvg(d+"Size"+(l?"2":"1"),t);o=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},t),i.name="\\"+d,o.classes.unshift("mop"),o.italic=u}}else if(i.body){var p=_d(i.body,t,!0);1===p.length&&p[0]instanceof tc?(o=p[0]).classes[0]="mop":o=Qc.makeSpan(["mop"],p,t)}else{for(var f=[],m=1;m<i.name.length;m++)f.push(Qc.mathsym(i.name[m],i.mode,t));o=Qc.makeSpan(["mop"],f,t)}var _=0,g=0;return(o instanceof tc||"\\oiint"===i.name||"\\oiiint"===i.name)&&!i.suppressBaseShift&&(_=(o.height-o.depth)/2-t.fontMetrics().axisHeight,g=o.italic),s?lh(o,n,r,t,a,g,_):(_&&(o.style.position="relative",o.style.top=$l(_)),o)},uh=(e,t)=>{var n;if(e.symbol)n=new Md("mo",[zd(e.name,e.mode)]),ll(ch,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Md("mo",Nd(e.body,t));else{n=new Md("mi",[new Td(e.name.slice(1))]);var r=new Md("mo",[zd("","text")]);n=e.parentIsSupSub?new Md("mrow",[n,r]):Cd([n,r])}return n},hh={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ad({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:r}=e,i=r;return 1===i.length&&(i=hh[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:dh,mathmlBuilder:uh}),ad({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:dd(r)}},htmlBuilder:dh,mathmlBuilder:uh});var ph={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ad({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:dh,mathmlBuilder:uh}),ad({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:dh,mathmlBuilder:uh}),ad({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=ph[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:dh,mathmlBuilder:uh});var fh=(e,t)=>{var n,r,i,s,o=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,i=jd(e.base,"operatorname"),o=!0):i=jd(e,"operatorname"),i.body.length>0){for(var a=i.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=_d(a,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof tc&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=Qc.makeSpan(["mop"],l,t)}else s=Qc.makeSpan(["mop"],[],t);return o?lh(s,n,r,t,t.style,0,0):s};function mh(e,t,n){for(var r=_d(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,s=0;s<r.length;s++){var o=r[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(r[s].classes,t.sizingClasses(n)):r[s].classes[o+1]==="reset-size"+t.size&&(r[s].classes[o+1]="reset-size"+n.size),r[s].height*=i,r[s].depth*=i}return Qc.makeFragment(r)}ad({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:dd(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:fh,mathmlBuilder:(e,t)=>{for(var n=Nd(e.body,t.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var s=n[i];if(s instanceof Ld.SpaceNode);else if(s instanceof Ld.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 Ld.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var a=n.map(e=>e.toText()).join("");n=[new Ld.TextNode(a)]}var l=new Ld.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new Ld.MathNode("mo",[zd("","text")]);return e.parentIsSupSub?new Ld.MathNode("mrow",[l,c]):Ld.newDocumentFragment([l,c])}}),Hu("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),ld({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Qc.makeFragment(_d(e.body,t,!1)):Qc.makeSpan(["mord"],_d(e.body,t,!0),t),mathmlBuilder:(e,t)=>Ed(e.body,t,!0)}),ad({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=xd(e.body,t.havingCrampedStyle()),r=Qc.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,s=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},t);return Qc.makeSpan(["mord","overline"],[s],t)},mathmlBuilder(e,t){var n=new Ld.MathNode("mo",[new Ld.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Ld.MathNode("mover",[Od(e.body,t),n]);return r.setAttribute("accent","true"),r}}),ad({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:dd(r)}},htmlBuilder:(e,t)=>{var n=_d(e.body,t.withPhantom(),!1);return Qc.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Nd(e.body,t);return new Ld.MathNode("mphantom",n)}}),ad({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Qc.makeSpan([],[xd(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Qc.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Nd(dd(e.body),t),r=new Ld.MathNode("mphantom",n),i=new Ld.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),ad({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Qc.makeSpan(["inner"],[xd(e.body,t.withPhantom())]),r=Qc.makeSpan(["fix"],[]);return Qc.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Nd(dd(e.body),t),r=new Ld.MathNode("mphantom",n),i=new Ld.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}}),ad({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=jd(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=xd(e.body,t),r=ql(e.dy,t);return Qc.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Ld.MathNode("mpadded",[Od(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),ad({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),ad({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],s=jd(t[0],"size"),o=jd(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&jd(i,"size").value,width:s.value,height:o.value}},htmlBuilder(e,t){var n=Qc.makeSpan(["mord","rule"],[],t),r=ql(e.width,t),i=ql(e.height,t),s=e.shift?ql(e.shift,t):0;return n.style.borderRightWidth=$l(r),n.style.borderTopWidth=$l(i),n.style.bottom=$l(s),n.width=r,n.height=i+s,n.depth=-s,n.maxFontSize=1.125*i*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=ql(e.width,t),r=ql(e.height,t),i=e.shift?ql(e.shift,t):0,s=t.color&&t.getColor()||"black",o=new Ld.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",$l(n)),o.setAttribute("height",$l(r));var a=new Ld.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",$l(i)):(a.setAttribute("height",$l(i)),a.setAttribute("depth",$l(-i))),a.setAttribute("voffset",$l(i)),a}});var _h=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];ad({type:"sizing",names:_h,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:_h.indexOf(r)+1,body:s}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return mh(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Nd(e.body,n),i=new Ld.MathNode("mstyle",r);return i.setAttribute("mathsize",$l(n.sizeMultiplier)),i}}),ad({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,s=!1,o=n[0]&&jd(n[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l)if("t"===(a=o.body[l].text))i=!0;else{if("b"!==a){i=!1,s=!1;break}s=!0}else i=!0,s=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:i,smashDepth:s}},htmlBuilder:(e,t)=>{var n=Qc.makeSpan([],[xd(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].depth=0;var s=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Qc.makeSpan(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Ld.MathNode("mpadded",[Od(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),ad({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],s=t[0];return{type:"sqrt",mode:r.mode,body:s,index:i}},htmlBuilder(e,t){var n=xd(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Qc.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Ml.TEXT.id&&(i=t.fontMetrics().xHeight);var s=r+i/4,o=n.height+n.depth+s+r,{span:a,ruleWidth:l,advanceWidth:c}=Au.sqrtImage(o,t),d=a.height-l;d>n.height+n.depth+s&&(s=(s+d-n.height-n.depth)/2);var u=a.height-n.height-s-l;n.style.paddingLeft=$l(c);var h=Qc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(Ml.SCRIPTSCRIPT),f=xd(e.index,p,t),m=.6*(h.height-h.depth),_=Qc.makeVList({positionType:"shift",positionData:-m,children:[{type:"elem",elem:f}]},t),g=Qc.makeSpan(["root"],[_]);return Qc.makeSpan(["mord","sqrt"],[g,h],t)}return Qc.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Ld.MathNode("mroot",[Od(n,t),Od(r,t)]):new Ld.MathNode("msqrt",[Od(n,t)])}});var gh={display:Ml.DISPLAY,text:Ml.TEXT,script:Ml.SCRIPT,scriptscript:Ml.SCRIPTSCRIPT};ad({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(e,t){var n=gh[e.style],r=t.havingStyle(n).withFont("");return mh(e.body,r,t)},mathmlBuilder(e,t){var n=gh[e.style],r=t.havingStyle(n),i=Nd(e.body,r),s=new Ld.MathNode("mstyle",i),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}}),ld({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Ml.DISPLAY.size||n.alwaysHandleSupSub)?dh:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Ml.DISPLAY.size||n.limits)?fh:null:"accent"===n.type?pl(n.base)?qd:null:"horizBrace"===n.type&&!e.sub===n.isOver?sh:null:null}(e,t);if(n)return n(e,t);var r,i,s,{base:o,sup:a,sub:l}=e,c=xd(o,t),d=t.fontMetrics(),u=0,h=0,p=o&&pl(o);if(a){var f=t.havingStyle(t.style.sup());r=xd(a,f,t),p||(u=c.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(l){var m=t.havingStyle(t.style.sub());i=xd(l,m,t),p||(h=c.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}s=t.style===Ml.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var _,g=t.sizeMultiplier,b=$l(.5/d.ptPerEm/g),v=null;if(i){var y=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof tc||y)&&(v=$l(-c.italic))}if(r&&i){u=Math.max(u,s,r.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var w=4*d.defaultRuleThickness;if(u-r.depth-(i.height-h)<w){h=w-(u-r.depth)+i.height;var x=.8*d.xHeight-(u-r.depth);x>0&&(u+=x,h-=x)}_=Qc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h,marginRight:b,marginLeft:v},{type:"elem",elem:r,shift:-u,marginRight:b}]},t)}else if(i){h=Math.max(h,d.sub1,i.height-.8*d.xHeight),_=Qc.makeVList({positionType:"shift",positionData:h,children:[{type:"elem",elem:i,marginLeft:v,marginRight:b}]},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,s,r.depth+.25*d.xHeight),_=Qc.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:b}]},t)}var k=yd(c,"right")||"mord";return Qc.makeSpan([k],[c,Qc.makeSpan(["msupsub"],[_])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var i,s=[Od(e.base,t)];if(e.sub&&s.push(Od(e.sub,t)),e.sup&&s.push(Od(e.sup,t)),r)i=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;i=o&&"op"===o.type&&o.limits&&t.style===Ml.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===Ml.DISPLAY||o.limits)?"munderover":"msubsup"}else{var a=e.base;i=a&&"op"===a.type&&a.limits&&(t.style===Ml.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===Ml.DISPLAY)?"munder":"msub"}else{var l=e.base;i=l&&"op"===l.type&&l.limits&&(t.style===Ml.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Ml.DISPLAY)?"mover":"msup"}return new Ld.MathNode(i,s)}}),ld({type:"atom",htmlBuilder:(e,t)=>Qc.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new Ld.MathNode("mo",[zd(e.text,e.mode)]);if("bin"===e.family){var r=Pd(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var bh={mi:"italic",mn:"normal",mtext:"normal"};ld({type:"mathord",htmlBuilder:(e,t)=>Qc.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new Ld.MathNode("mi",[zd(e.text,e.mode,t)]),r=Pd(e,t)||"italic";return r!==bh[n.type]&&n.setAttribute("mathvariant",r),n}}),ld({type:"textord",htmlBuilder:(e,t)=>Qc.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=zd(e.text,e.mode,t),i=Pd(e,t)||"normal";return n="text"===e.mode?new Ld.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new Ld.MathNode("mn",[r]):"\\prime"===e.text?new Ld.MathNode("mo",[r]):new Ld.MathNode("mi",[r]),i!==bh[n.type]&&n.setAttribute("mathvariant",i),n}});var vh={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},yh={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ld({type:"spacing",htmlBuilder(e,t){if(yh.hasOwnProperty(e.text)){var n=yh[e.text].className||"";if("text"===e.mode){var r=Qc.makeOrd(e,t,"textord");return r.classes.push(n),r}return Qc.makeSpan(["mspace",n],[Qc.mathsym(e.text,e.mode,t)],t)}if(vh.hasOwnProperty(e.text))return Qc.makeSpan(["mspace",vh[e.text]],[],t);throw new rl('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!yh.hasOwnProperty(e.text)){if(vh.hasOwnProperty(e.text))return new Ld.MathNode("mspace");throw new rl('Unknown type of space "'+e.text+'"')}return new Ld.MathNode("mtext",[new Ld.TextNode(" ")])}});var wh=()=>{var e=new Ld.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};ld({type:"tag",mathmlBuilder(e,t){var n=new Ld.MathNode("mtable",[new Ld.MathNode("mtr",[wh(),new Ld.MathNode("mtd",[Ed(e.body,t)]),wh(),new Ld.MathNode("mtd",[Ed(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var xh={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},kh={"\\textbf":"textbf","\\textmd":"textmd"},Sh={"\\textit":"textit","\\textup":"textup"},Ch=(e,t)=>{var n=e.font;return n?xh[n]?t.withTextFontFamily(xh[n]):kh[n]?t.withTextFontWeight(kh[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(Sh[n]):t};ad({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:r}=e,i=t[0];return{type:"text",mode:n.mode,body:dd(i),font:r}},htmlBuilder(e,t){var n=Ch(e,t),r=_d(e.body,n,!0);return Qc.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Ch(e,t);return Ed(e.body,n)}}),ad({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=xd(e.body,t),r=Qc.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,s=Qc.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},t);return Qc.makeSpan(["mord","underline"],[s],t)},mathmlBuilder(e,t){var n=new Ld.MathNode("mo",[new Ld.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Ld.MathNode("munder",[Od(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),ad({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=xd(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return Qc.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new Ld.MathNode("mpadded",[Od(e.body,t)],["vcenter"])}),ad({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new rl("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Mh(e),r=[],i=t.havingStyle(t.style.text()),s=0;s<n.length;s++){var o=n[s];"~"===o&&(o="\\textasciitilde"),r.push(Qc.makeSymbol(o,"Typewriter-Regular",e.mode,i,["mord","texttt"]))}return Qc.makeSpan(["mord","text"].concat(i.sizingClasses(t)),Qc.tryCombineChars(r),i)},mathmlBuilder(e,t){var n=new Ld.TextNode(Mh(e)),r=new Ld.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Mh=e=>e.body.replace(/ /g,e.star?"␣":" "),Th=id,Lh="[ \r\n\t]",zh="(\\\\[a-zA-Z@]+)"+Lh+"*",Ah="[̀-ͯ]",Ph=new RegExp(Ah+"+$"),Rh="("+Lh+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+Ah+"*|[\ud800-\udbff][\udc00-\udfff]"+Ah+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+zh+"|\\\\[^\ud800-\udfff])";class Nh{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(Rh,"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 nl("EOF",new tl(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new rl("Unexpected character: '"+e[t]+"'",new nl(e[t],new tl(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(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=i+1,this.lex()}return new nl(r,new tl(this,t,this.tokenRegex.lastIndex))}}class Eh{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 rl("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 r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var Oh=Vu;Hu("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Hu("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Hu("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Hu("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Hu("\\@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}}),Hu("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Hu("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Ih={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};Hu("\\char",function(e){var t,n=e.popToken(),r="";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])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new rl("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=Ih[n.text])||r>=t)throw new rl("Invalid base-"+t+" digit "+n.text);for(var i;null!=(i=Ih[e.future().text])&&i<t;)r*=t,r+=i,e.popToken()}return"\\@char{"+r+"}"});var Bh=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(1!==i.length)throw new rl("\\newcommand's first argument must be a macro name");var s=i[0].text,o=e.isDefined(s);if(o&&!t)throw new rl("\\newcommand{"+s+"} attempting to redefine "+s+"; use \\renewcommand");if(!o&&!n)throw new rl("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(1===(i=e.consumeArg().tokens).length&&"["===i[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 rl("Invalid number of arguments: "+l);a=parseInt(l),i=e.consumeArg().tokens}return o&&r||e.macros.set(s,{tokens:i,numArgs:a}),""};Hu("\\newcommand",e=>Bh(e,!1,!0,!1)),Hu("\\renewcommand",e=>Bh(e,!0,!1,!1)),Hu("\\providecommand",e=>Bh(e,!0,!0,!0)),Hu("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Hu("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Hu("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Th[n],lc.math[n],lc.text[n]),""}),Hu("\\bgroup","{"),Hu("\\egroup","}"),Hu("~","\\nobreakspace"),Hu("\\lq","`"),Hu("\\rq","'"),Hu("\\aa","\\r a"),Hu("\\AA","\\r A"),Hu("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Hu("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Hu("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Hu("ℬ","\\mathscr{B}"),Hu("ℰ","\\mathscr{E}"),Hu("ℱ","\\mathscr{F}"),Hu("ℋ","\\mathscr{H}"),Hu("ℐ","\\mathscr{I}"),Hu("ℒ","\\mathscr{L}"),Hu("ℳ","\\mathscr{M}"),Hu("ℛ","\\mathscr{R}"),Hu("ℭ","\\mathfrak{C}"),Hu("ℌ","\\mathfrak{H}"),Hu("ℨ","\\mathfrak{Z}"),Hu("\\Bbbk","\\Bbb{k}"),Hu("·","\\cdotp"),Hu("\\llap","\\mathllap{\\textrm{#1}}"),Hu("\\rlap","\\mathrlap{\\textrm{#1}}"),Hu("\\clap","\\mathclap{\\textrm{#1}}"),Hu("\\mathstrut","\\vphantom{(}"),Hu("\\underbar","\\underline{\\text{#1}}"),Hu("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Hu("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Hu("\\ne","\\neq"),Hu("≠","\\neq"),Hu("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Hu("∉","\\notin"),Hu("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Hu("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Hu("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Hu("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Hu("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Hu("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Hu("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Hu("⟂","\\perp"),Hu("‼","\\mathclose{!\\mkern-0.8mu!}"),Hu("∌","\\notni"),Hu("⌜","\\ulcorner"),Hu("⌝","\\urcorner"),Hu("⌞","\\llcorner"),Hu("⌟","\\lrcorner"),Hu("©","\\copyright"),Hu("®","\\textregistered"),Hu("️","\\textregistered"),Hu("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Hu("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Hu("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Hu("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Hu("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Hu("⋮","\\vdots"),Hu("\\varGamma","\\mathit{\\Gamma}"),Hu("\\varDelta","\\mathit{\\Delta}"),Hu("\\varTheta","\\mathit{\\Theta}"),Hu("\\varLambda","\\mathit{\\Lambda}"),Hu("\\varXi","\\mathit{\\Xi}"),Hu("\\varPi","\\mathit{\\Pi}"),Hu("\\varSigma","\\mathit{\\Sigma}"),Hu("\\varUpsilon","\\mathit{\\Upsilon}"),Hu("\\varPhi","\\mathit{\\Phi}"),Hu("\\varPsi","\\mathit{\\Psi}"),Hu("\\varOmega","\\mathit{\\Omega}"),Hu("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Hu("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Hu("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Hu("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Hu("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Hu("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Hu("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Hu("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Dh={",":"\\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"};Hu("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Dh?t=Dh[n]:("\\not"===n.slice(0,4)||n in lc.math&&ll(["bin","rel"],lc.math[n].group))&&(t="\\dotsb"),t});var Vh={")":!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};Hu("\\dotso",function(e){return e.future().text in Vh?"\\ldots\\,":"\\ldots"}),Hu("\\dotsc",function(e){var t=e.future().text;return t in Vh&&","!==t?"\\ldots\\,":"\\ldots"}),Hu("\\cdots",function(e){return e.future().text in Vh?"\\@cdots\\,":"\\@cdots"}),Hu("\\dotsb","\\cdots"),Hu("\\dotsm","\\cdots"),Hu("\\dotsi","\\!\\cdots"),Hu("\\dotsx","\\ldots\\,"),Hu("\\DOTSI","\\relax"),Hu("\\DOTSB","\\relax"),Hu("\\DOTSX","\\relax"),Hu("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Hu("\\,","\\tmspace+{3mu}{.1667em}"),Hu("\\thinspace","\\,"),Hu("\\>","\\mskip{4mu}"),Hu("\\:","\\tmspace+{4mu}{.2222em}"),Hu("\\medspace","\\:"),Hu("\\;","\\tmspace+{5mu}{.2777em}"),Hu("\\thickspace","\\;"),Hu("\\!","\\tmspace-{3mu}{.1667em}"),Hu("\\negthinspace","\\!"),Hu("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Hu("\\negthickspace","\\tmspace-{5mu}{.277em}"),Hu("\\enspace","\\kern.5em "),Hu("\\enskip","\\hskip.5em\\relax"),Hu("\\quad","\\hskip1em\\relax"),Hu("\\qquad","\\hskip2em\\relax"),Hu("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Hu("\\tag@paren","\\tag@literal{({#1})}"),Hu("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new rl("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Hu("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Hu("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Hu("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Hu("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Hu("\\newline","\\\\\\relax"),Hu("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Hh=$l(Rl["Main-Regular"]["T".charCodeAt(0)][1]-.7*Rl["Main-Regular"]["A".charCodeAt(0)][1]);Hu("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Hh+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Hu("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Hh+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Hu("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Hu("\\@hspace","\\hskip #1\\relax"),Hu("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Hu("\\ordinarycolon",":"),Hu("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Hu("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Hu("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Hu("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Hu("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Hu("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Hu("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Hu("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Hu("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Hu("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Hu("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Hu("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Hu("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Hu("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Hu("∷","\\dblcolon"),Hu("∹","\\eqcolon"),Hu("≔","\\coloneqq"),Hu("≕","\\eqqcolon"),Hu("⩴","\\Coloneqq"),Hu("\\ratio","\\vcentcolon"),Hu("\\coloncolon","\\dblcolon"),Hu("\\colonequals","\\coloneqq"),Hu("\\coloncolonequals","\\Coloneqq"),Hu("\\equalscolon","\\eqqcolon"),Hu("\\equalscoloncolon","\\Eqqcolon"),Hu("\\colonminus","\\coloneq"),Hu("\\coloncolonminus","\\Coloneq"),Hu("\\minuscolon","\\eqcolon"),Hu("\\minuscoloncolon","\\Eqcolon"),Hu("\\coloncolonapprox","\\Colonapprox"),Hu("\\coloncolonsim","\\Colonsim"),Hu("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Hu("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Hu("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Hu("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Hu("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Hu("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Hu("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Hu("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Hu("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Hu("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Hu("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Hu("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Hu("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Hu("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Hu("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Hu("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Hu("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Hu("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Hu("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Hu("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Hu("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Hu("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Hu("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Hu("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Hu("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Hu("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Hu("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Hu("\\imath","\\html@mathml{\\@imath}{ı}"),Hu("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Hu("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Hu("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Hu("⟦","\\llbracket"),Hu("⟧","\\rrbracket"),Hu("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Hu("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Hu("⦃","\\lBrace"),Hu("⦄","\\rBrace"),Hu("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Hu("⦵","\\minuso"),Hu("\\darr","\\downarrow"),Hu("\\dArr","\\Downarrow"),Hu("\\Darr","\\Downarrow"),Hu("\\lang","\\langle"),Hu("\\rang","\\rangle"),Hu("\\uarr","\\uparrow"),Hu("\\uArr","\\Uparrow"),Hu("\\Uarr","\\Uparrow"),Hu("\\N","\\mathbb{N}"),Hu("\\R","\\mathbb{R}"),Hu("\\Z","\\mathbb{Z}"),Hu("\\alef","\\aleph"),Hu("\\alefsym","\\aleph"),Hu("\\Alpha","\\mathrm{A}"),Hu("\\Beta","\\mathrm{B}"),Hu("\\bull","\\bullet"),Hu("\\Chi","\\mathrm{X}"),Hu("\\clubs","\\clubsuit"),Hu("\\cnums","\\mathbb{C}"),Hu("\\Complex","\\mathbb{C}"),Hu("\\Dagger","\\ddagger"),Hu("\\diamonds","\\diamondsuit"),Hu("\\empty","\\emptyset"),Hu("\\Epsilon","\\mathrm{E}"),Hu("\\Eta","\\mathrm{H}"),Hu("\\exist","\\exists"),Hu("\\harr","\\leftrightarrow"),Hu("\\hArr","\\Leftrightarrow"),Hu("\\Harr","\\Leftrightarrow"),Hu("\\hearts","\\heartsuit"),Hu("\\image","\\Im"),Hu("\\infin","\\infty"),Hu("\\Iota","\\mathrm{I}"),Hu("\\isin","\\in"),Hu("\\Kappa","\\mathrm{K}"),Hu("\\larr","\\leftarrow"),Hu("\\lArr","\\Leftarrow"),Hu("\\Larr","\\Leftarrow"),Hu("\\lrarr","\\leftrightarrow"),Hu("\\lrArr","\\Leftrightarrow"),Hu("\\Lrarr","\\Leftrightarrow"),Hu("\\Mu","\\mathrm{M}"),Hu("\\natnums","\\mathbb{N}"),Hu("\\Nu","\\mathrm{N}"),Hu("\\Omicron","\\mathrm{O}"),Hu("\\plusmn","\\pm"),Hu("\\rarr","\\rightarrow"),Hu("\\rArr","\\Rightarrow"),Hu("\\Rarr","\\Rightarrow"),Hu("\\real","\\Re"),Hu("\\reals","\\mathbb{R}"),Hu("\\Reals","\\mathbb{R}"),Hu("\\Rho","\\mathrm{P}"),Hu("\\sdot","\\cdot"),Hu("\\sect","\\S"),Hu("\\spades","\\spadesuit"),Hu("\\sub","\\subset"),Hu("\\sube","\\subseteq"),Hu("\\supe","\\supseteq"),Hu("\\Tau","\\mathrm{T}"),Hu("\\thetasym","\\vartheta"),Hu("\\weierp","\\wp"),Hu("\\Zeta","\\mathrm{Z}"),Hu("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Hu("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Hu("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Hu("\\bra","\\mathinner{\\langle{#1}|}"),Hu("\\ket","\\mathinner{|{#1}\\rangle}"),Hu("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Hu("\\Bra","\\left\\langle#1\\right|"),Hu("\\Ket","\\left|#1\\right\\rangle");var jh=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=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),i.length&&n.macros.set("\\|",a));var s=t;return!t&&i.length&&"|"===n.future().text&&(n.popToken(),s=!0),{tokens:s?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.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}};Hu("\\bra@ket",jh(!1)),Hu("\\bra@set",jh(!0)),Hu("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Hu("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Hu("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Hu("\\angln","{\\angl n}"),Hu("\\blue","\\textcolor{##6495ed}{#1}"),Hu("\\orange","\\textcolor{##ffa500}{#1}"),Hu("\\pink","\\textcolor{##ff00af}{#1}"),Hu("\\red","\\textcolor{##df0030}{#1}"),Hu("\\green","\\textcolor{##28ae7b}{#1}"),Hu("\\gray","\\textcolor{gray}{#1}"),Hu("\\purple","\\textcolor{##9d38bd}{#1}"),Hu("\\blueA","\\textcolor{##ccfaff}{#1}"),Hu("\\blueB","\\textcolor{##80f6ff}{#1}"),Hu("\\blueC","\\textcolor{##63d9ea}{#1}"),Hu("\\blueD","\\textcolor{##11accd}{#1}"),Hu("\\blueE","\\textcolor{##0c7f99}{#1}"),Hu("\\tealA","\\textcolor{##94fff5}{#1}"),Hu("\\tealB","\\textcolor{##26edd5}{#1}"),Hu("\\tealC","\\textcolor{##01d1c1}{#1}"),Hu("\\tealD","\\textcolor{##01a995}{#1}"),Hu("\\tealE","\\textcolor{##208170}{#1}"),Hu("\\greenA","\\textcolor{##b6ffb0}{#1}"),Hu("\\greenB","\\textcolor{##8af281}{#1}"),Hu("\\greenC","\\textcolor{##74cf70}{#1}"),Hu("\\greenD","\\textcolor{##1fab54}{#1}"),Hu("\\greenE","\\textcolor{##0d923f}{#1}"),Hu("\\goldA","\\textcolor{##ffd0a9}{#1}"),Hu("\\goldB","\\textcolor{##ffbb71}{#1}"),Hu("\\goldC","\\textcolor{##ff9c39}{#1}"),Hu("\\goldD","\\textcolor{##e07d10}{#1}"),Hu("\\goldE","\\textcolor{##a75a05}{#1}"),Hu("\\redA","\\textcolor{##fca9a9}{#1}"),Hu("\\redB","\\textcolor{##ff8482}{#1}"),Hu("\\redC","\\textcolor{##f9685d}{#1}"),Hu("\\redD","\\textcolor{##e84d39}{#1}"),Hu("\\redE","\\textcolor{##bc2612}{#1}"),Hu("\\maroonA","\\textcolor{##ffbde0}{#1}"),Hu("\\maroonB","\\textcolor{##ff92c6}{#1}"),Hu("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Hu("\\maroonD","\\textcolor{##ca337c}{#1}"),Hu("\\maroonE","\\textcolor{##9e034e}{#1}"),Hu("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Hu("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Hu("\\purpleC","\\textcolor{##aa87ff}{#1}"),Hu("\\purpleD","\\textcolor{##7854ab}{#1}"),Hu("\\purpleE","\\textcolor{##543b78}{#1}"),Hu("\\mintA","\\textcolor{##f5f9e8}{#1}"),Hu("\\mintB","\\textcolor{##edf2df}{#1}"),Hu("\\mintC","\\textcolor{##e0e5cc}{#1}"),Hu("\\grayA","\\textcolor{##f6f7f7}{#1}"),Hu("\\grayB","\\textcolor{##f0f1f2}{#1}"),Hu("\\grayC","\\textcolor{##e3e5e6}{#1}"),Hu("\\grayD","\\textcolor{##d6d8da}{#1}"),Hu("\\grayE","\\textcolor{##babec2}{#1}"),Hu("\\grayF","\\textcolor{##888d93}{#1}"),Hu("\\grayG","\\textcolor{##626569}{#1}"),Hu("\\grayH","\\textcolor{##3b3e40}{#1}"),Hu("\\grayI","\\textcolor{##21242c}{#1}"),Hu("\\kaBlue","\\textcolor{##314453}{#1}"),Hu("\\kaGreen","\\textcolor{##71B307}{#1}");var Fh={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Uh{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 Eh(Oh,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Nh(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,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new nl("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,i=this.future(),s=0,o=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++s;else if("}"===r.text){if(-1===--s)throw new rl("Extra }",r)}else if("EOF"===r.text)throw new rl("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",r);if(e&&n)if((0===s||1===s&&"{"===e[o])&&r.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==s||n);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new rl("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new rl("Use of the macro doesn't match its definition",i)}}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 rl("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new rl("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,s=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var o=(i=i.slice()).length-1;o>=0;--o){var a=i[o];if("#"===a.text){if(0===o)throw new rl("Incomplete placeholder at end of macro body",a);if("#"===(a=i[--o]).text)i.splice(o+1,1);else{if(!/^[1-9]$/.test(a.text))throw new rl("Not a valid argument number",a);i.splice(o,2,...s[+a.text-1])}}}return this.pushTokens(i),i.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 nl(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 r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}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 r="function"==typeof t?t(this):t;if("string"==typeof r){var i=0;if(-1!==r.indexOf("#"))for(var s=r.replace(/##/g,"");-1!==s.indexOf("#"+(i+1));)++i;for(var o=new Nh(r,this.settings),a=[],l=o.lex();"EOF"!==l.text;)a.push(l),l=o.lex();return a.reverse(),{tokens:a,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Th.hasOwnProperty(e)||lc.math.hasOwnProperty(e)||lc.text.hasOwnProperty(e)||Fh.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Th.hasOwnProperty(e)&&!Th[e].primitive}}var qh=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,$h=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",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),Gh={"́":{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"}},Xh={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Kh{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 Uh(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 rl("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 nl("}")),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 r=this.fetch();if(-1!==Kh.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&Th[r.text]&&Th[r.text].infix)break;var i=this.parseAtom(t);if(!i)break;"internal"!==i.type&&n.push(i)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++)if("infix"===e[r].type){if(-1!==n)throw new rl("only one infix operator per group",e[r].token);n=r,t=e[r].replaceWith}if(-1!==n&&t){var i,s,o=e.slice(0,n),a=e.slice(n+1);return i=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,[i,e[n],s],[]):this.callFunction(t,[i,s],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do{var i;t=this.parseGroup(e)}while("internal"===(null==(i=t)?void 0:i.type));if(!t)throw new rl("Expected group after '"+r+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("internal"===(null==r?void 0:r.type))return r;if("text"===this.mode)return r;for(;;){this.consumeSpaces();var i=this.fetch();if("\\limits"===i.text||"\\nolimits"===i.text){if(r&&"op"===r.type){var s="\\limits"===i.text;r.limits=s,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new rl("Limit controls must follow a math operator",i);r.alwaysHandleSupSub&&(r.limits="\\limits"===i.text)}this.consume()}else if("^"===i.text){if(t)throw new rl("Double superscript",i);t=this.handleSupSubscript("superscript")}else if("_"===i.text){if(n)throw new rl("Double subscript",i);n=this.handleSupSubscript("subscript")}else if("'"===i.text){if(t)throw new rl("Double superscript",i);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(!$h[i.text])break;var l=qh.test(i.text),c=[];for(c.push(new nl($h[i.text])),this.consume();;){var d=this.fetch().text;if(!$h[d])break;if(qh.test(d)!==l)break;c.unshift(new nl($h[d])),this.consume()}var u=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:u}:t={type:"ordgroup",mode:"math",body:u}}}return t||n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,i=Th[r];if(!i)return null;if(this.consume(),t&&"atom"!==t&&!i.allowedInArgument)throw new rl("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!i.allowedInText)throw new rl("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===i.allowedInMath)throw new rl("Can't use function '"+r+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,s,o,n,e)}callFunction(e,t,n,r,i){var s={funcName:e,parser:this,token:r,breakOnTokenText:i},o=Th[e];if(o&&o.handler)return o.handler(s,t,n);throw new rl("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],i=[],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==i[0])&&(o="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",o,a);if(a)i.push(l);else{if(null==l)throw new rl("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:i}}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 r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var i=this.parseStringGroup("raw",n);return null!=i?{type:"raw",mode:"text",string:i.text}:null;case"primitive":if(n)throw new rl("A primitive argument cannot be optional");var s=this.parseGroup(e);if(null==s)throw new rl("Expected group as "+e,this.fetch());return s;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new rl("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 r,i="";"EOF"!==(r=this.fetch()).text;)i+=r.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,t){for(var n,r=this.fetch(),i=r,s="";"EOF"!==(n=this.fetch()).text&&e.test(s+n.text);)s+=(i=n).text,this.consume();if(""===s)throw new rl("Invalid "+t+": '"+r.text+"'",r);return r.range(i,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 rl("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}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 r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new rl("Invalid size: '"+t.text+"'",t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!Ul(i))throw new rl("Invalid unit: '"+i.unit+"'",t);return{type:"size",mode:this.mode,value:i,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 r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),s}parseGroup(e,t){var n,r=this.fetch(),i=r.text;if("{"===i||"\\begingroup"===i){this.consume();var s="{"===i?"}":"\\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:tl.range(r,a),body:o,semisimple:"\\begingroup"===i||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===i[0]&&!Fh.hasOwnProperty(i)){if(this.settings.throwOnError)throw new rl("Undefined control sequence: "+i,r);n=this.formatUnsupportedCmd(i),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],i=r.text;"-"===i&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:tl.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:tl.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==i&&"`"!==i||e[n+1].text!==i||(e.splice(n,2,{type:"textord",mode:"text",loc:tl.range(r,e[n+1]),text:i+i}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new rl("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Xh.hasOwnProperty(t[0])&&!lc[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=Xh[t[0]]+t.slice(1));var i,s=Ph.exec(t);if(s&&("i"===(t=t.substring(0,s.index))?t="ı":"j"===t&&(t="ȷ")),lc[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=lc[this.mode][t].group,l=tl.range(e);if(oc.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};i=o}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(zl(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)),i={type:"textord",mode:"text",loc:tl.range(e),text:t}}if(this.consume(),s)for(var d=0;d<s[0].length;d++){var u=s[0][d];if(!Gh[u])throw new rl("Unknown accent ' "+u+"'",e);var h=Gh[u][this.mode]||Gh[u].text;if(!h)throw new rl("Accent "+u+" unsupported in "+this.mode+" mode",e);i={type:"accent",mode:this.mode,loc:tl.range(e),label:h,isStretchy:!1,isShifty:!0,base:i}}return i}}Kh.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 Wh=function(e,t){var n=new gl(t);try{return function(e,t,n){var r,i=function(e){return new Hl({style:e.displayMode?Ml.DISPLAY:Ml.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})}(n);if("mathml"===n.output)return Id(e,t,i,n.displayMode,!0);if("html"===n.output){var s=Sd(e,i);r=Qc.makeSpan(["katex"],[s])}else{var o=Id(e,t,i,n.displayMode,!1),a=Sd(e,i);r=Qc.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=Qc.makeSpan(n,[e])}return e}(r,n)}(function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Kh(e,t);delete n.gullet.macros.current["\\df@tag"];var r=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 rl("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new nl("\\df@tag")])}]}return r}(e,n),e,n)}catch(t){return function(e,t,n){if(n.throwOnError||!(e instanceof rl))throw e;var r=Qc.makeSpan(["katex-error"],[new tc(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r}(t,e,n)}};class Yh{static update(e,t,n,r=!1){return{id:e,name:a.nY.update,size:n,latex:t,block:r}}}class Zh extends o._D{_mathml=(0,l.KR)("");constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return el}get mathml(){const e=this.attrs.size+this.info;return Zh.render(e,{displayMode:this.attrs.block})}get attrs(){return this.data.attrs}get meta(){return Zh.meta}build_child(e){}export(){return this.base_export()}gc(){super.base_gc()}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return Zh.replace_id(this.root,e,t)}update(e){const{latex:t,block:n,size:r}=e,{courier:i,id:s}=this,o=i.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=r,o.add_recover(Yh.update(s,a,c,l)),o}static render(e,t={}){const n={...t,throwOnError:!1,output:"html"};try{return function(e,t){return Wh(e,t).toMarkup()}(e,{...n})}catch(e){return""}}static get meta(){return{cubename:"公式",type:a.u0.fomula,block:!1,version:1,show:!0}}static get_default(e="",t={},n={}){return{id:g.I.get_id(),type:a.u0.fomula,info:e,attrs:{block:!1,size:a.$f.h4,...n},css:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.nY.update)],Zh.prototype,"update",null);class Qh{static add_title(e,t){return{id:e,name:a.BS.add_title,data:t}}static remove_title(e){return{id:e,name:a.BS.remove_title}}static add_cell(e,t){return{id:e,name:a.BS.add_cell,data:t}}static remove_cell(e,t){return{id:e,name:a.BS.remove_cell,cid:t}}static add_row(e,t,n){return{id:e,name:a.BS.add_row,index:t,rows:n}}static remove_row(e,t){return{id:e,name:a.BS.remove_row,index:t}}static add_col(e,t,n){return{id:e,name:a.BS.add_col,index:t,cols:n}}static remove_col(e,t){return{id:e,name:a.BS.remove_col,index:t}}static moveto(e,t,n){return{id:e,name:a.BS.moveto,tid:t,cells:n}}static merge(e,t){return{id:e,name:a.BS.merge,area:t}}static update_cell_area(e,t,n){return{id:e,name:a.BS.update_area,tid:t,area:n}}static add_grid_col(e,t,n){return{id:e,name:a.BS.add_grid_col,index:t,width:n}}static remove_grid_col(e,t){return{id:e,name:a.BS.remove_grid_col,index:t}}static col_resize(e,t,n){return{id:e,name:a.BS.col_resize,cols:t,step:n}}}function Jh(e,t){const{hotkeys:n,courier:r,id:i,history:s}=t,o=Ka.F.tips;if(n.validate_hotkeys(e))return;if(!e.ctrlKey)return;e.stopPropagation();const l=e.key.toLowerCase(),c=e.shiftKey,d=t.get_active_cell();if(!d)return o?.tip_info("未发现激活单元格");if(l===a.tX.up)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_row_top(e.top))return o?.tip_info("上方不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[1];e++)i.push(xt.get_default());n.tell(t,Qh.add_row(t.id,d.row,i)),s.record(n)}else{if(t.get_cell(d.row-1,d.col))return o?.tip_info("上方已存在单元格");if(d.row-1<0)return o?.tip_info("上方已达边界");{const e=r.get_recorder(),n={row:d.row-1,col:d.col,rowspan:1,colspan:1,data:xt.get_default()};e.tell(t,Qh.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.down)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_row_bottom(e.bottom))return o?.tip_info("下方不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[1];e++)i.push(xt.get_default());n.tell(t,Qh.add_row(t.id,d.row+d.rowspan,i)),s.record(n)}else{if(t.get_cell(d.row+1,d.col))return o?.tip_info("下方已存在单元格");if(d.row+1>=t.size[0])return o?.tip_info("下方已达边界");{const e=r.get_recorder(),n={row:d.row+1,col:d.col,rowspan:1,colspan:1,data:xt.get_default()};e.tell(t,Qh.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.left)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_col_left(e.left))return o?.tip_info("左侧不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[0];e++)i.push(xt.get_default());n.tell(t,Qh.add_col(t.id,d.col,i)),s.record(n)}else{if(t.get_cell(d.row,d.col-1))return o?.tip_info("左侧已存在单元格");if(d.col-1<0)return o?.tip_info("左侧已达边界");{const e=r.get_recorder(),n={row:d.row,col:d.col-1,rowspan:1,colspan:1,data:xt.get_default()};e.tell(t,Qh.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.right)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_col_right(e.right))return o?.tip_info("右侧不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[0];e++)i.push(xt.get_default());n.tell(t,Qh.add_col(t.id,d.col+d.colspan,i)),s.record(n)}else{if(t.get_cell(d.row,d.col+1))return o?.tip_info("右侧已存在单元格");if(d.col+1>=t.size[1])return o?.tip_info("右侧已达边界");{const e=r.get_recorder(),n={row:d.row,col:d.col+1,rowspan:1,colspan:1,data:xt.get_default()};e.tell(t,Qh.add_cell(t.id,n)),s.record(e)}}}const ep={drag_cell:void 0,hover:void 0};function tp(e,t){const n=e.currentTarget;n.parentElement?.style.setProperty("--drag-pointer-events","none"),e.stopPropagation(),ep.drag_cell=t}function np(e,t){if(ep.drag_cell===t)return;const n=e.currentTarget;n.classList.add("cube-cell-selection"),ep.hover=n}function rp(e,t){e.currentTarget.classList.remove("cube-cell-selection")}function ip(e,t){const{drag_cell:n,hover:r}=ep,{pcube:i,courier:s,history:o}=t.box;if(!n)return;const a=e.currentTarget;a.parentElement?.style.setProperty("--drag-pointer-events","auto"),r&&r.classList.remove("cube-cell-selection");const l=s.get_recorder();l.tell(i,Qh.moveto(i.id,t.box.id,[n.box.id])),o.record(l)}const sp={anchor:void 0,hover:void 0,down_point:void 0,has_down:!1,has_move:!1};function op(e,t){const{root:n,cursor:r}=t;if(e.ctrlKey)e.stopPropagation();else{g.I.check_mouse_key(e,"left")&&t.clear_selection();const n=e.target;if(!(n instanceof Node))return;const r=t.find_dom_cube(n),i=r?.find_upstream_untill(t);if(!i)return;const s=t.cells.find(e=>e.box===i);if(!s)return;sp.down_point={x:e.clientX,y:e.clientY},sp.has_down=!0,sp.anchor=s}}function ap(e,t){const{cursor:n}=t,{down_point:r,has_down:i,anchor:s,has_move:o}=sp;if(!r)return;if(sp.has_move=Math.sqrt((e.clientX-r.x)**2+(e.clientY-r.y)**2)>5,!i||!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 u={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)},h=t.get_rectarea_cell(u);t.clear_selection();for(let e of h.cells)e.selection=!0;h.cells.length>1&&e.stopPropagation()}function lp(e,t){const{cursor:n}=t;sp.has_down=!1,sp.anchor=void 0}const cp=["id","data-type"],dp=(0,c.pM)({__name:"cube-table",props:{cube:{}},setup(e){const t=(0,c.rk)("dragger"),n=(0,c.rk)("box");function r(e){return{"grid-row":`${e.row+1}/span ${e.rowspan}`,"grid-column":`${e.col+1}/span ${e.colspan}`}}function i(e){return{"cube-cell-selection":e.selection}}const s=(0,c.EW)(()=>({"grid-template-columns":e.cube.cols.map(e=>e>0?e+"fr":"1fr").join(" ")}));return(0,c.sV)(()=>{const r=t.value,i=n.value;if(!r||!i)return;let s=e.cube.data.attrs.width,a=s;const l=new N.DragDiff(r);l.register_down(()=>{s=e.cube.data.attrs.width}),l.register_move((t,n)=>{s+t<e.cube.min_width||(a=s+t,i.style.width=a+"px")}),l.register_up((t,n)=>{if(a===s)return;const{courier:r,history:i}=e.cube,l=r.get_recorder();l.tell(e.cube,o.VL.resize(e.cube.id,a)),i.record(l)}),l.register_cancel(()=>{i.style.width=s+"px"})}),(e,o)=>((0,c.uX)(),(0,c.CE)("div",{ref_key:"box",ref:n,class:"cube-table",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).table,onPointerdown:o[0]||(o[0]=t=>(0,l.R1)(op)(t,e.cube)),onPointermove:o[1]||(o[1]=t=>(0,l.R1)(ap)(t,e.cube)),onPointerup:o[2]||(o[2]=t=>(0,l.R1)(lp)(t,e.cube)),onPointercancel:o[3]||(o[3]=t=>(0,l.R1)(lp)(t,e.cube)),onKeyup:o[4]||(o[4]=t=>(0,l.R1)(Jh)(t,e.cube)),onContextmenu:o[5]||(o[5]=t=>(0,l.R1)(at.uz)(t,e.cube))},[e.cube.title?((0,c.uX)(),(0,c.Wv)(S,{key:0,class:"cube-table-title",cube:(0,l.IG)(e.cube.title)},null,8,["cube"])):(0,c.Q3)("v-if",!0),(0,c.Lk)("div",{class:"cube-table-container",style:(0,d.Tr)(s.value)},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.cells,(e,t)=>((0,c.uX)(),(0,c.Wv)(S,{key:e.box.id,cube:(0,l.IG)(e.box),style:(0,d.Tr)(r(e)),class:(0,d.C4)(i(e)),draggable:"true",onDragstart:t=>(0,l.R1)(tp)(t,e),onDragenter:t=>(0,l.R1)(np)(t,e),onDragleave:t=>(0,l.R1)(rp)(t,e),onDrop:t=>(0,l.R1)(ip)(t,e)},null,8,["cube","style","class","onDragstart","onDragenter","onDragleave","onDrop"]))),128))],4),(0,c.Lk)("div",{class:"cube-table-dragger",ref_key:"dragger",ref:t},null,512)],44,cp))}}),up=(0,f.A)(dp,[["__scopeId","data-v-47068d72"]]);function hp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class pp extends o._D{cells=(0,l.Kh)([]);_title=(0,l.KR)(void 0);get title(){return this._title.value}set title(e){this._title.value=e}get component(){return up}get meta(){return pp.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=(0,l.IG)(new xt(e.info.title,this)));for(let t of e.info.cells){const e=new xt(t.data,this),n={row:t.row,col:t.col,rowspan:t.rowspan,colspan:t.colspan,box:(0,l.IG)(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){return{usable:!0,data:e}}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 pp.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 r=1===new Set(n.map(e=>e.right)).size,i=1===new Set(n.map(e=>e.left)).size;return r&&i}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 r=1===new Set(n.map(e=>e.bottom)).size,i=1===new Set(n.map(e=>e.top)).size;return r&&i}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 r=e>=n.row&&e<n.row+n.rowspan,i=t>=n.col&&t<n.col+n.colspan;if(r&&i)return n}}get_rectarea_cell(e){let t=!1;for(;!t;){const{left:n,right:r,top:i,bottom:s}=e;for(let o of this.cells){let{row:a,rowspan:l,col:c,colspan:d}=o,u=a,h=a+l-1,p=c,f=c+d-1;if(n>=p&&n<=f||n<=p&&f<=r||r>=p&&r<=f){if(u<i&&h>=i){e.top=a;break}if(u<=s&&h>s){e.bottom=a+l-1;break}}if(i>=u&&i<=h||i<u&&s>=h||s>=u&&s<=h){if(p<n&&f>=n){e.left=c;break}if(p<=r&&f>r){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:r,col:i,rowspan:s,colspan:o}=t;i>=e.left&&i+o-1<=e.right&&r>=e.top&&r+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 r of n){const n=this.get_cell_area(r);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 r=[];for(let e of t)r.push({row:e.row-n.top,col:e.col-n.left,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()});const i=pp.get_default_by_data(e,r);return i.attrs=structuredClone((0,l.ux)(this.attrs)),i}add_title(e){const{data:t}=e,{courier:n,cursor:r,id:i}=this,s=n.get_recorder();s.add_cmd(e);const o=new xt(t,this);return this.title=(0,l.IG)(o),s.add_recover(Qh.remove_title(i)),s}remove_title(e){const{id:t,courier:n,cursor:r}=this;if(!this.title)return;const i=this.title.export(),s=n.get_recorder();return s.add_cmd(e),this.title=void 0,s.add_recover(Qh.add_title(t,i)),s}add_cell(e){const{id:t,courier:n,cursor:r}=this,{data:i}=e;this.clear_selection();const s=n.get_recorder();s.add_cmd(e);const o={row:i.row,col:i.col,rowspan:i.rowspan,colspan:i.colspan,box:(0,l.IG)(new xt(i.data,this)),selection:!1};return this.cells.push(o),s.add_recover(Qh.remove_cell(t,o.box.id)),s}remove_cell(e){const{id:t,courier:n,cursor:r}=this,{cid:i}=e,s=n.get_recorder();s.add_cmd(e);const o=this.cells.findIndex(e=>e.box.id===i),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(Qh.add_cell(t,l)),s}add_row(e){const{courier:t,cursor:n,id:r}=this,{index:i,rows:s}=e,o=t.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:i,col:e,rowspan:1,colspan:1,data:t})}this.size[0]++;for(let e of this.cells)e.row<i||o.tell(this,Qh.update_cell_area(r,e.box.id,{row:e.row+1,col:e.col,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,Qh.add_cell(r,e));return o}remove_row(e){const{id:t,courier:n,cursor:r}=this,{index:i}=e,s=this.get_rows(i),o=n.get_recorder();for(let e of s)o.tell(this,Qh.remove_cell(t,e.box.id));return this.size[0]--,o}add_col(e){const{id:t,cursor:n,courier:r}=this,{index:i,cols:s}=e,o=r.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:e,col:i,rowspan:1,colspan:1,data:t})}o.tell(this,Qh.add_grid_col(t,i,2));for(let e of this.cells)e.col<i||o.tell(this,Qh.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,Qh.add_cell(t,e));return o}remove_col(e){const{id:t,cursor:n,courier:r}=this,{index:i}=e;if(!this.check_orderly_col(i))return Ka.F.tips?.tip_info("目标列不整齐");let s;for(let e=0;e<=this.size[0]&&(s||(s=this.get_cell(e,i),!s));e++);if(!s)return;const o=r.get_recorder();for(let e=s.col;e<s.col+s.colspan;e++)o.tell(this,Qh.remove_grid_col(t,e));const a=this.get_cols(i);for(let e of a)o.tell(this,Qh.remove_cell(t,e.box.id));for(let e of this.cells){if(e.col<i)continue;const n={row:e.row,col:e.col-1,rowspan:e.rowspan,colspan:e.colspan};o.tell(this,Qh.update_cell_area(t,e.box.id,n))}return o}moveto(e){const{id:t,courier:n,cursor:r}=this,{tid:i,cells:s}=e,a=n.get_recorder(),l=this.cells.find(e=>e.box.id===i);if(!l)return;const c=l.box,d=this.cells_sorted.filter(e=>e.box.id!==i&&s.includes(e.box.id));for(let e of d){const n=e.box.export();a.tell(this,Qh.remove_cell(t,e.box.id)),a.tell(c,o.VL.insert_child(c.id,n.info,c.child_count))}return a}update_area(e){const{id:t,courier:n,cursor:r}=this,{tid:i,area:s}=e,o=n.get_recorder(),a=this.cells.find(e=>e.box.id===i);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(Qh.update_cell_area(t,i,l)),o}merge_cell(e){const{id:t,cursor:n,courier:r}=this,{area:i}=e,s=r.get_recorder(),o=this.get_rectarea_cell(i);let a=o.cells[0];if(!a)return;const l={row:i.top,col:i.left,rowspan:i.bottom-i.top+1,colspan:i.right-i.left+1},c=a.box.id;return s.tell(this,Qh.update_cell_area(t,c,l)),s.tell(this,Qh.moveto(t,c,o.cells.map(e=>e.box.id))),s}add_grid_col(e){const{id:t,courier:n,cursor:r}=this,{index:i,width:s}=e,o=n.get_recorder();return o.add_cmd(e),this.cols.splice(i,0,s),this.size[1]++,o.add_recover(Qh.remove_grid_col(t,i)),o}remove_grid_col(e){const{id:t,courier:n,cursor:r}=this,{index:i}=e,s=n.get_recorder(),o=this.cols.splice(i,1);if(0!==o.length)return this.size[1]--,s.add_recover(Qh.add_grid_col(t,i,o[0])),s}col_resize(e){const{id:t,courier:n,cursor:r}=this,{cols:i,step:s}=e,o=n.get_recorder();o.add_cmd(e);let a=!1;for(let e=i[0];e<=i[1];e++){let t=this.cols[e]+s;t<=0||(a=!0,this.cols[e]=t)}if(a)return o.add_recover(Qh.col_resize(t,i,-s)),o}delete_child(e){const{dir:t,range:n,reserve:r}=e,{courier:i,cursor:s,history:a}=this,l=i.get_recorder();let[c,d]=this.get_valid_range(n);if(0===c&&d>=this.child_count)if(r){if(this.is_empty)return;const e=this.child_first;l.tell(this,o.VL.delete_child(this.id,"backward",[1,this.child_count],r)),l.tell(e,o.VL.delete_child(e.id,"backward",[0,e.child_count],r))}else l.merge(this.remove_self());else{let e=[];for(let t=c;t<d;t++){let n=this.children[t];e.push(n.id)}for(let t of e)l.tell(this,Qh.remove_cell(this.id,t))}return l}static get meta(){return{cubename:"表格",type:a.u0.table,block:!0,version:1,show:!0}}static get_default(e=3,t=3){const n=[],r=[];r.length=t,r.fill(2);for(let r=0;r<e;r++)for(let e=0;e<t;e++){const t={row:r,col:e,rowspan:1,colspan:1,data:xt.get_default()};n.push(t)}return{id:g.I.get_id(),type:a.u0.table,info:{size:[e,t],cols:r,cells:n},attrs:{width:500},css:{}}}static get_default_by_data(e,t){const[n,r]=e,i=[];return i.length=r,i.fill(2),{id:g.I.get_id(),type:a.u0.table,info:{size:[n,r],cols:i,cells:t},attrs:{width:500},css:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i,t.info.title&&(t.info.title=xt.replace_id(e,t.info.title,n));for(let r of t.info.cells)r.data=xt.replace_id(e,r.data,n);return t}}hp([(0,k.H)(a.BS.add_title)],pp.prototype,"add_title",null),hp([(0,k.H)(a.BS.remove_title)],pp.prototype,"remove_title",null),hp([(0,k.H)(a.BS.add_cell)],pp.prototype,"add_cell",null),hp([(0,k.H)(a.BS.remove_cell)],pp.prototype,"remove_cell",null),hp([(0,k.H)(a.BS.add_row)],pp.prototype,"add_row",null),hp([(0,k.H)(a.BS.remove_row)],pp.prototype,"remove_row",null),hp([(0,k.H)(a.BS.add_col)],pp.prototype,"add_col",null),hp([(0,k.H)(a.BS.remove_col)],pp.prototype,"remove_col",null),hp([(0,k.H)(a.BS.moveto)],pp.prototype,"moveto",null),hp([(0,k.H)(a.BS.update_area)],pp.prototype,"update_area",null),hp([(0,k.H)(a.BS.merge)],pp.prototype,"merge_cell",null),hp([(0,k.H)(a.BS.add_grid_col)],pp.prototype,"add_grid_col",null),hp([(0,k.H)(a.BS.remove_grid_col)],pp.prototype,"remove_grid_col",null),hp([(0,k.H)(a.BS.col_resize)],pp.prototype,"col_resize",null),hp([(0,k.H)(a.zS.cube_delete_child)],pp.prototype,"delete_child",null);const fp=["id","data-type"],mp=(0,c.pM)({__name:"cube-tip",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-tip",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).tip},[(0,c.bF)(S,{cube:e.cube.box},null,8,["cube"])],12,fp))}),_p=(0,f.A)(mp,[["__scopeId","data-v-433bbb71"]]);function gp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class bp extends o._D{_component=_p;get component(){return this._component}get children(){return[this.box]}box;constructor(e,t){return super(e,t),this.setup(e,t)}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return bp.replace_id(this.root,e,t)}build_child(e){this.box=new xt(e.info,this)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}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:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return this.is_empty?s.tell(i,o.VL.delete_child(n,a,[r,r+1])):s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],f=this.children[h],m=h-u;let _=this.splice(c,m);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):f&&s.tell(f,o.UB.in_head(f.id,0)):"forward"===a&&(f?s.tell(f,o.UB.in_head(f.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}get meta(){return bp.meta}static get meta(){return{cubename:"提示",type:a.u0.tip,block:!0,version:1,show:!0}}static get_default(e,t={},n={}){return{id:g.I.get_id(),type:a.u0.tip,info:xt.get_default(e),attrs:n,css:t}}static get_default_by_string(e,t={},n={}){const r=gt.get_default_by_string(e),i=xt.get_default([r]);return{id:g.I.get_id(),type:a.u0.tip,info:i,attrs:n,css:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t.info=xt.replace_id(e,t.info,n),t}}gp([(0,k.H)(a.zS.cube_insert_child)],bp.prototype,"on_insert_child",null),gp([(0,k.H)(a.zS.cube_delete_child)],bp.prototype,"on_delete_child",null),gp([(0,k.H)(a.zS.cube_reset)],bp.prototype,"on_reset",null);const vp=["id","data-type"],yp=(0,c.pM)({__name:"cube-box-columns",props:{cube:{}},setup(e){const t=(0,l.KR)(),n=(0,l.KR)();let r;return(0,l.Kh)({open:!1}),(0,c.sV)(()=>{const i=t.value;if(!i)return;const s=n.value;if(!s)return;r=new N.DragDiff(s);let a=e.cube.attrs.width,l=e.cube.attrs.height,c=a,d=l;r.register_down(()=>{a=e.cube.attrs.width,l=e.cube.attrs.height}),r.register_move((t,n)=>{c=Math.round(t+a),c<e.cube.min_width&&(c=e.cube.min_width),i.style.width=c+"px",i.style.height=d+"px"}),r.register_up((t,n)=>{if(a===c&&l===d)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+a);r.tell(e.cube,o.VL.resize(e.cube.id,i)),e.cube.history.record(r)}),r.register_cancel(()=>{e.cube.attrs.width=a,e.cube.attrs.height=l})}),(0,c.hi)(()=>{r?.off()}),(r,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box-columns",ref_key:"box",ref:t,style:(0,d.Tr)(r.cube.css),id:r.cube.id,"data-type":(0,l.R1)(a.u0).box_columns,onContextmenu:i[0]||(i[0]=e=>(0,l.R1)(at.uz)(e,r.cube))},[(0,c.Lk)("div",{class:"box-columns-content",style:(0,d.Tr)(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"}:{})},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(r.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],4),(0,c.Lk)("div",{class:"box-columns-dragger",ref_key:"dragger",ref:n},null,512)],44,vp))}}),wp=(0,f.A)(yp,[["__scopeId","data-v-84430922"]]);function xp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class kp extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return wp}get css(){const{width:e}=this.data.attrs;return{...super.css,width:e+"px"}}get attrs(){return this.data.attrs}get meta(){return kp.meta}get min_width(){return 200}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return{data:e,usable:!0}}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 kp.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t,history:n}=this,{data:r}=e,i=t.get_recorder();i.add_cmd(e);const s=g.I.build_cubes(e.data,this),a=this.child_count;return this._children.push(...s),i.add_recover(o.VL.delete_child(this.id,"backward",[a,this.child_count])),i}on_delete_child(e){const{courier:t,history:n}=this,{dir:r,range:i,reserve:s}=e,a=t.get_recorder(),l=this.get_valid_index(i[0]),c=this.get_valid_index(i[1]),d=[],u=this._children.splice(l,c-l);for(let e of u)d.push(e.export());return a.add_recover(o.VL.insert_child(this.id,d,l)),a}static replace_id(e,t,n){const r=t.id,i=n[r]||g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info,n),t}static get_default(){const e=xt.get_default(),t=xt.get_default(),n=xt.get_default();return{id:g.I.get_id(),type:a.u0.box_columns,info:[e,t,n],attrs:{width:400,column_count:3},css:{}}}static get meta(){return{cubename:"多列容器",type:a.u0.box_columns,block:!0,version:1,show:!0}}}xp([(0,k.H)(a.zS.cube_insert_child)],kp.prototype,"on_insert_child",null),xp([(0,k.H)(a.zS.cube_delete_child)],kp.prototype,"on_delete_child",null);class Sp{static reset(e,t){return{id:e,name:a.DI.reset_explanation,explanation:t}}}const Cp=["id","data-type"],Mp=(0,c.pM)({__name:"cube-rt",props:{cube:{}},setup(e){const{event:t}=e.cube;function n(){t.emit_show_cube_editor(e.cube)}return(t,r)=>((0,c.uX)(),(0,c.CE)("ruby",{class:"cube-rt",id:t.cube.id,style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).rt,onClick:n},[(0,c.eW)((0,d.v_)(t.cube.info.text)+" ",1),(0,c.Lk)("rt",{style:(0,d.Tr)({"font-size":`max(calc(0.6 * ${e.cube.css["font-size"]||"16px"}),${Tp.min_size}px)`})},(0,d.v_)(t.cube.info.explanation),5),r[0]||(r[0]=(0,c.eW)(" ",-1))],12,Cp))}});class Tp extends o._D{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 Mp}get meta(){return Tp.meta}build_child(e){}update_data(e){return{usable:!0,data:e}}export(){return this.base_export()}gc(){this.base_gc()}replace_id(e,t){return Tp.replace_id(this.root,e,t)}reset_explanation(e){const{explanation:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=this.info.explanation;this.info.explanation=t;const s=Sp.reset(this.id,i);return r.add_recover(s),r}static get meta(){return{cubename:"标注文本",type:a.u0.rt,block:!1,version:1,show:!1}}static get_default(e="",t="",n={}){return{id:g.I.get_id(),type:a.u0.rt,info:{text:e,explanation:t},attrs:{},css:n}}static replace_id(e,t,n){const r=t.id;return t.id=n[r]||g.I.get_id(),n[r]=t.id,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.DI.reset_explanation)],Tp.prototype,"reset_explanation",null)},1701:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(4089),i=n(4412),s=n(6996),o=n(1717);class a extends o.K{command_group_do=[];command_group_undo=[];get meta(){return a.meta}execute_command_group(e){if(this.stats.mode===s.fv.read)return;const t=(e,n,i)=>{n<i.length&&(0,r.dY)(()=>{this.pass(e),t(i[n+1],n+1,i)})};t(e[0],0,e)}constructor(e){super(e)}get_recorder(){return new i.vk(this)}pass(e){if(this.stats.mode===s.fv.read)return;const t=e,n=e.id,r=this.root.find_cube(n);if(!r)return void console.error("未发现cube:",n);console.log("🟨",r,r.type,t);const o=new i.vk(this);let a=r.on(t);return a instanceof i.vk&&o.merge(a),o}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.courier,version:1}}}},1717:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(1556);class i{_root;get root(){return this._root}get doc(){const e=this.root;if(e instanceof r.oY)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}}},1742:(e,t,n)=>{"use strict";n.d(t,{Bz:()=>s,NW:()=>o,h_:()=>i});var r=n(7633);const i=(0,r.Kh)({point:{x:0,y:0},css:{},cube:void 0,menu:void 0,stack_pos:[],stack_menus:[],stack_rect:[]}),s=(0,r.Kh)({open:!1,data:{},submit(){}});function o(e,t){s.open=!0,s.submit=t,s.data=e}},2189:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});class r{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)}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")}}},2277:(e,t,n)=>{"use strict";n.d(t,{P:()=>u});var r=n(1068),i=n(1556),s=n(7744),o=n(5955),a=n(6996),l=n(4412),c=n(1717),d=n(4089);class u extends c.K{selection;cursor_step=20;scroll_distance=50;safa_distance=20;get meta(){return u.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,r=this.get_node_cube(n,t);return r instanceof s._D?r:void 0}get cube_end(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.endContainer,r=this.get_node_cube(n,t);return r instanceof s._D?r: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 s._D?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 s._D?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 s="up"===e?t.prev_line:t.next_line;const o=t.clientRect;let a=s?.clientRect;for(;s&&a&&o&&(a.left>=o.right||a.right<=o.left);){let t="up"===e?s.prev_line:s.next_line;if(!t)break;s=t,a=t.clientRect}if(!s)return;const l=[],c=new Map;for(let e of s.children)if(e instanceof i.P6){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++)l.push(t[n]),c.set(t[n],e)}const d="up"===e?r.MathRect.get_rect_point(n.left,r._RectPosition.left_mid):r.MathRect.get_rect_point(n.left,r._RectPosition.right_mid),u=r.MathRect.get_nearest_rect(d,l);if(!u)return;const h=r.MathRect.get_shadow_point_horizental(d,u),p=document.caretPositionFromPoint(h.x,h.y);if(p&&p.offsetNode instanceof Text)this.set_cursor(p.offsetNode,p.offset);else if(p&&!(p.offsetNode instanceof Text)){const e=c.get(u);if(!e)return;e.set_cursor_in_tail()}}locate_current_line(e,t,n){const s=[],o=[],a=new Map;for(let e of t.children)if(e instanceof i.P6){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++){const r=t[n];s.push(r),a.set(r,e)}}if(1===s.length)return!1;if("up"===e){const e=n.left.top;for(let t of s)t.bottom<=e&&o.push(t)}else if("down"===e){const e=n.right.bottom;for(let t of s)t.y>=e&&o.push(t)}if(o.length>0){const t="down"===e?{x:n.right.x,y:n.right.y}:{x:n.left.x,y:n.left.y},i=r.MathRect.get_nearest_rect(t,o);if(!i)return!1;const s=r.MathRect.get_shadow_point_horizental(t,i),l=document.caretPositionFromPoint(s.x,s.y);if(l&&l.offsetNode instanceof Text)return this.set_cursor(l.offsetNode,l.offset),!0;{const e=a.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 i.P6&&n instanceof i.P6))return;const r="up"===e?t.line:n.line,s=this.get_selection_edge_position();r&&s&&(this.locate_current_line(e,r,s)||this.locate_next_line(e,r,s))}move_left(){if(!this.range)return;const{cube_start:e,offset_start:t,offset_end:n,node_end:r}=this,{doc:o,courier:a}=this,c=new l.vk(a);if(e instanceof i.P6){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&&c.tell(t,s.UB.in_tail(t.id,0))}else{const n=e.find_text_nav_pos(t,"left");r&&this.set_cursor(r,n)}else{const t=e.prev_cube_deep;if(t){const n=e.meta.block||t.meta.block?0:1;c.tell(t,s.UB.in_tail(t.id,n,"right"))}}}}move_right(){if(!this.range)return;const{cube_end:e,offset_start:t,offset_end:n,node_end:r}=this,{doc:o,courier:a}=this,c=new l.vk(a);if(e instanceof i.P6){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&&c.tell(t,s.UB.in_head(t.id,0))}else{const t=e.find_text_nav_pos(n,"right");r&&this.set_cursor(r,t)}else{const t=e.next_cube_deep;if(t){const n=e.meta.block||t.meta.block?0:1;c.tell(t,s.UB.in_head(t.id,n,"left"))}}}}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:s}=this.range;if(!e)return;this.set_cursor(this.range.endContainer,this.range.endOffset);const a=this.range.getClientRects();if(0===a.length)return;const l=r.MathRect.get_rect_point(a[a.length-1],r._RectPosition.center);let c=o.I.get_client_rects(e.id);if(!c)return;let d=c.length,u=c[0],h=c[c.length-1],p=h;if(d>1){for(let e=0;e<d;e++){const t=c[e];if(r.MathRect.is_point_in_rect(l,t)){p=t;break}}if(p!==h)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid)}let f=e.next_cube;if(!f)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid);for(c=o.I.get_client_rects(f.id);c;){if(d=c.length,u=c[0],u.x<p.right)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid);if(d>1)return this.locate_cursor_on_rect(u,r._RectPosition.right_mid);if(f=f?.next_cube,!f)return this.locate_cursor_on_rect(u,r._RectPosition.right_mid);c=o.I.get_client_rects(f.id)}}move_home(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:s}=this.range;if(this.set_cursor(this.range.startContainer,this.range.startOffset),!e)return;const a=this.range.getClientRects();if(0===a.length)return;const l=r.MathRect.get_rect_point(a[a.length-1],r._RectPosition.center);let c=o.I.get_client_rects(e.id);if(!c)return;let d=c.length,u=c[0],h=c[c.length-1],p=u;if(d>1){for(let e=0;e<d;e++){const t=c[e];if(r.MathRect.is_point_in_rect(l,t)){p=t;break}}if(p!==u)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid)}let f=e.prev_cube;if(!f)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid);for(c=o.I.get_client_rects(f.id);c;){if(d=c.length,h=c[c.length-1],h.right>p.left)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid);if(d>1)return this.locate_cursor_on_rect(h,r._RectPosition.left_mid);if(f=f?.prev_cube,!f)return this.locate_cursor_on_rect(h,r._RectPosition.left_mid);c=o.I.get_client_rects(f.id)}}extend_left(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,u=o||n,h="number"==typeof a?a:r;this.set_cursor(u,h),this.move_left(),(0,d.dY)(()=>{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:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,u=o||n,h="number"==typeof a?a:r;this.set_cursor(u,h),this.move_right(),(0,d.dY)(()=>{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:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_up();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_down(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_down();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_home(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_home();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_end(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_end();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,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 r=[];for(;n;){if(n.id){let e;if(r.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 i.P6?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=r.MathRect.get_rect_point(e,t);const i=document.caretPositionFromPoint(n.x,n.y),s=window.getSelection();if(i&&s&&i.offsetNode instanceof Text)return s.setPosition(i.offsetNode,i.offset)}locate_cursor_by_coor(e,t){const{courier:n,history:r,root:i}=this,o=document.caretPositionFromPoint(e,t),a=o?.offsetNode,c=new l.vk(n);if(a){if(a instanceof Text)o.offsetNode instanceof Text&&(a.parentElement?.parentElement?.focus(),this.set_cursor(o.offsetNode,o.offset));else{const e=i.cursor.get_node_cube(a,i);if(e?.in_postil)return;const t=e?.pcube;if(!e||!t)return;const n=e.meta;e.next_cube,n.block||c.tell(e,s.UB.in_head(e.id,0,"left"))}r.record(c)}}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;r.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;r.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,r){this.selection.setBaseAndExtent(e,t,n,r)}get_selection_text(e=!0){const{cube_end:t,cube_start:n,offset_start:r,offset_end:s}=this;let o="";if(e&&!this.has_selection&&n instanceof i.P6)return n.text;if(this.cube_selection instanceof i.P6)return this.cube_selection.text.slice(r,s);{let e=!1,a=!1;const l=this.find_inline_cube();for(let c of l){for(let l of c){if(a)break;e||l!==n||(e=!0,l instanceof i.P6&&(o+=l.text.slice(r))),a||l!==t||(a=!0,l instanceof i.P6&&(o+=l.text.slice(0,s))),e&&!a&&l instanceof i.P6&&l!==n&&l!==t&&(o+=l.text)}o+="\n"}}return o}find_cube_by_coor(e){const{x:t,y:n}=e,r=document.elementFromPoint(t,n);if(r)return this.get_node_cube(r,this.root)}find_selection_lines(){const e=[],{cube_selection:t,cube_start:n,cube_end:r}=this;if(t instanceof i.P6){let e=t.line;if(e)return[e]}else{if(t instanceof i.gK)return[t];if(n instanceof i.P6&&r instanceof i.P6){const t=n.line,i=r.line;if(t&&i){let n=t;for(;n&&(e.push(n),n!==i);)n=n.next_line}}}return e}find_inline_cube(){const e=[],{cube_start:t,cube_end:n,offset_start:r,offset_end:s}=this;if(!t||!n)return e;if(!(t instanceof i.P6&&n instanceof i.P6))return e;const o=this.find_selection_lines();if(0===o.length)return[];const a=o[0],l=o[o.length-1],c=t.index,d=n.index;if(1===o.length){const t=[];for(let e of a.children.slice(c,d+1))t.push(e);e.push(t)}else{let t=[];for(let e of a.children.slice(c))t.push(e);e.push(t),t=[];for(let n of o.slice(1,-1)){for(let e of n.children)t.push(e);e.push(t),t=[]}for(let e of l.children.slice(0,d+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],r=t[t.length-1],s=n[0],o=r[r.length-1],{cube_start:a,cube_end:l,offset_start:c,offset_end:d}=this;if(!a||!l)return e;if(a===l){const t=a.export();t.info=t.info.slice(c,d),e.push(t)}else if(n===r){if(a instanceof i.P6&&a===s){const t=a.export();t.info=t.info.slice(c),e.push(t)}for(let t of n.slice(1,-1))e.push(t.export());if(l instanceof i.P6&&l===o){const t=l.export();t.info=t.info.slice(0,d),e.push(t)}}else{if(a instanceof i.P6&&a===s){const t=a.export();t.info=t.info.slice(c),e.push(t)}e.push(...n.slice(1).map(e=>e.export()));for(let n of t.slice(1,-1)){const t=i.gK.get_default(n.map(e=>e.export()));e.push(t)}const u=i.gK.get_default(r.slice(0,-1).map(e=>e.export()));if(l instanceof i.P6&&l===o){const e=l.export();e.info=e.info.slice(0,d),u.info.push(e)}e.push(u)}return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:a.Mu.cursor,version:1}}}},2547:(e,t,n)=>{"use strict";n.d(t,{U:()=>s,c:()=>r});class r{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,r,i,s){return{a:e,b:t,c:n,d:r,e:i,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 r=this.get_matrix_translate(t,n);return this.multiply(e,r)}static get_dom_string(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=e;return`matrix(${t.toFixed(1)},${n},${r},${i.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}}}var i=n(1556);class s{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=[],r=this.path.getTotalLength()/t;for(let e=0;e<=t;e++){const t=e*r,i=this.path.getPointAtLength(t);n.push({x:i.x,y:i.y})}return n}static get_line_k(e,t){const n=t.y-e.y,r=t.x-e.x;return 0===r?Number.POSITIVE_INFINITY:n/r}static find_closet_point(e,t){let n=1/0,r=e[0];const{x:i,y:s}=t;for(let t of e){let e=(i-t.x)**2+(s-t.y)**2;e<n&&(n=e,r=t)}return r}static offset_points(e,t){const n=[],{x:r,y:i}=t;for(let t of e)n.push({x:t.x+r,y:t.y+i});return n}static find_closest_points(e,t){let n=1/0,r=e[0],i=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,r=o,i=s)}}return{from:r,to:i}}static polygonCentroid(e){let t=0,n=0,r=0;const i=e.length;for(let s=0;s<i;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%i],d=o*c-l*a;r+=d,t+=(o+l)*d,n+=(a+c)*d}return r*=.5,t/=6*r,n/=6*r,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const{x:i,y:s}=e[r],{x:o,y:a}=e[(r+1)%n];t+=i*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 r=e.pcube.get_node(n);if(r){if(r.is_layout_root)return{has_root:!0,line:[e,r]};{const n=this.find_line_to_layout_root(r,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 r=e.get_node(t),s=e.get_node(n),o=r?.to.size||0,a=s?.from.size||0;return{linker:i.R$.get_default(t,n),index_from:a,index_to:o}}}},2742:(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var r=n(7633),i=n(4031),s=n(6996),o=n(1556);class a extends i.K{_count_word=(0,r.KR)(0);_active_root_index=(0,r.KR)(0);_anchor_root_id=(0,r.KR)("");_mode=(0,r.KR)(s.fv.read);_view=(0,r.KR)("doc");_in_composition_mode=(0,r.KR)(!1);_in_recording=(0,r.KR)(!1);_showing=(0,r.KR)(!1);view_point=(0,r.Kh)({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{[s.fv.edit]:"编辑模式",[s.fv.read]:"阅读模式",[s.fv.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===s.fv.read}get is_edit_mode(){return this._mode.value===s.fv.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 o.oY?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 a.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:s.Mu.stats,version:1}}}},2819:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});var r=n(6996);class i{static insert_child(e,t,n){return{id:e,name:r.zS.cube_insert_child,data:t,pos:n}}static delete_child(e,t,n,i=!1){return{id:e,name:r.zS.cube_delete_child,dir:t,range:n,reserve:i}}static insert(e,t,n,i,s,o){return{id:e,name:r.zS.cube_insert,data:t,start_id:n,end_id:i,offset_end:o,offset_start:s}}static delete(e,t,n,i,s,o,a=!1){return{id:e,name:r.zS.cube_delete,dir:t,start_id:n,end_id:i,offset_start:s,offset_end:o,reserve:a}}static delete_adjacent(e,t,n,i){return{id:e,name:r.zS.cube_delete_adjacent,from:t,offset:i,from_id:n}}static set_selection_css(e,t,n,i,s,o,a=!1,l=!1){return{id:e,name:r.zS.cube_set_selection_css,css:t,start_id:n,end_id:i,offset_start:s,offset_end:o,toggle:a,replace:l}}static set_css(e,t,n=!1,i=!1){return{id:e,name:r.zS.cube_set_css,css:t,toggle:n,replace:i}}static partition(e,t,n,i,s){return{name:r.zS.cube_partition,id:e,start_id:t,end_id:n,offset_start:i,offset_end:s}}static reorder(e,t,n){return{id:e,name:r.zS.cube_reorder,cubeid:t,index:n}}static reset(e,t){return{id:e,name:r.zS.cube_reset,data:t}}static merge(e,t,n,i){return{id:e,name:r.zS.cube_merge,method:t,cubeid:n,offset:i}}static postil_add(e,t=[]){return{name:r.zS.cube_postil_add,id:e,data:t}}static postil_remove(e,t){return{name:r.zS.cube_postil_remove,id:e,range:t}}static set_attr(e,t){return{id:e,name:r.zS.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})}}},2935:(e,t,n)=>{"use strict";n.d(t,{B:()=>l});var r=n(7633),i=n(4089),s=n(4031),o=n(6996),a=n(1556);class l extends s.K{static config;cp=l.default_config;data;get meta(){return l.meta}get css_vars(){const e=this.data;return{"--text-transition":e.text_transition?"0.5s":"none","--text-family":`${e.text_family}`,"--node-max-width":`${e.map_node_max_width}px`}}constructor(e){super(e),this.data=(0,r.Kh)(l.default_config),l.config=this.data,this.watch()}init(e){Object.assign(this.data,e),this.cp=structuredClone((0,r.ux)(this.data))}watch(){(0,i.wB)(()=>this.data.map_perf,(e,t)=>{if(e){this.root instanceof a.EU&&this.root.check_show();const e=this.root.cubes.get_types_cube(o.u0.submap);for(let[t,n]of e)n.check_show()}else{this.root instanceof a.EU&&this.root.show_all();const e=this.root.cubes.get_types_cube(o.u0.submap);for(let[t,n]of e)n.show_all()}})}export(){return structuredClone((0,r.ux)(this.data))}static get meta(){return{type:o.Mu.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,input_quick_prefix:"/",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:o._A.point,map_linker_anchor_right:o._A.arrow,map_linker_line:"bezier2",map_linker_stroke:"black",map_linker_stroke_width:2,map_perf:!0}}}},3214:(e,t,n)=>{"use strict";n.d(t,{M:()=>i});var r=n(5976);class i extends r._{}},3408:(e,t,n)=>{"use strict";n.d(t,{Wu:()=>f,Eb:()=>p,w4:()=>h});var r=n(1556),i=n(7744),s=n(6996),o=n(4412),a=n(1717),l=n(7633),c=n(4089),d=n(3755);function u(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const h=new Map;function p(e){return(t,n)=>{let r=t[n];h.set(e,r)}}class f extends a.K{handlers=(0,l.Kh)(new Map);data;get meta(){return f.meta}constructor(e){super(e),this.data=(0,l.Kh)(f.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,o=e.key.toLowerCase(),a=document.activeElement;let l=!1;if(n===s.fv.edit&&a!==document.body){for(let[n,r]of h){let i=t.data[n];i.cursor&&t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),l=!0,r.bind(t)(e))}for(let[n,r]of t.handlers){let i=t.data[n];i.cursor&&t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),l=!0,r(e))}if(!l&&"tab"===o){l=!0;const{cursor:t,courier:n,history:s}=this,{cube_end:o,cube_start:a,offset_start:c,offset_end:d,has_selection:u,cube_selection:h}=t,p=n.get_recorder();if(!h||!o||!a)return;e.preventDefault(),u&&p.tell(h,i.VL.delete(h.id,"backward",a.id,o.id,c,d,!0));const f=a.text,m=f.slice(0,c)+"\t"+f.slice(c);p.tell(a,r.zl.reset(a.id,m,d,c+1)),s.record(p)}}})}listen_uncursor_hotkey(e){const t=this;document.documentElement.addEventListener("keydown",e=>{const n=t.stats.mode,r=document.activeElement,i=[s.tX.down,s.tX.left,s.tX.right,s.tX.up],o=e.key.toLowerCase();this.root;let a=!1;if(this.cursor.cube_end||r===document.body){for(let[n,r]of h){let i=t.data[n];i.cursor||t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),a=!0,r.bind(t)(e))}for(let[n,r]of t.handlers){let i=t.data[n];i.cursor||t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),a=!0,r(e))}}a||r!==document.body||n!==s.fv.edit||(" "===o?this.listen_map_space(e):"backspace"===o||"delete"===o?this.listen_map_delete(e):"enter"===o?this.listen_map_enter(e):"tab"===o?this.listen_map_tab(e):i.includes(o)&&this.listen_map_nav(e))})}listen_map_nav(e){const t=this.root,n=e.key.toLowerCase(),i=this.cubes.get_types_cube(s.u0.submap),o=[s.tX.down,s.tX.left,s.tX.right,s.tX.up];if(t instanceof r.EU&&t.get_nodes_selected().size>0)o.includes(n)&&t.move_select(n);else for(let[e,t]of i)t.move_select(n)}listen_map_delete(e){const{courier:t,history:n}=this,o=t.get_recorder();if(this.root instanceof r.EU){const e=[...this.root.get_nodes_selected()].map(e=>e.id);o.tell(this.root,i.yc.node_remove(this.root.id,e))}const a=this.cubes.get_types_cube(s.u0.submap);for(let[e,t]of a){const e=[...t.get_nodes_selected()].map(e=>e.id);o.tell(t,i.yc.node_remove(t.id,e))}n.record(o)}listen_map_enter(e){const{courier:t,history:n}=this,o=t.get_recorder();let a=!1;if(this.root instanceof r.EU){const t=this.root.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){a=!0;continue}let r=n.id;e.shiftKey&&(r=n.env.prev_node?.id||null);const s=i.Sv.append_child(t.id,r);o.tell(t,s)}}const l=this.cubes.get_types_cube(s.u0.submap);for(let[t,n]of l){const t=n.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){a=!0;continue}let r=n.id;e.shiftKey&&(r=n.env.prev_node?.id||null);const s=i.Sv.append_child(t.id,r);o.tell(t,s)}}a&&d.F.tips?.tip_warning("无法在没有布局上游的节点添加同级"),n.record(o)}listen_map_tab(e){e.preventDefault();const{courier:t,history:n}=this,o=t.get_recorder();if(this.root instanceof r.EU){const e=this.root.get_nodes_selected();for(let t of e){const e=i.Sv.append_child(t.id);o.tell(t,e)}}const a=this.cubes.get_types_cube(s.u0.submap);for(let[e,t]of a){const e=t.get_nodes_selected();for(let t of e){const e=i.Sv.append_child(t.id);o.tell(t,e)}}n.record(o)}listen_map_space(e){const t=this.root;if(e.preventDefault(),t instanceof r.EU){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}const n=t.cubes.get_types_cube(s.u0.submap);for(let[e,t]of n){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}}listen_cvx(e){let t=e;this.root instanceof r.EU&&(t=document.documentElement),t.addEventListener("paste",async e=>{const t=e.clipboardData,{cursor:n}=this,{cube_end:i}=n;if(i instanceof r.P6&&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:s}=this;t&&(this.root.scope_count_normal>0||s.has_selection||s.cube_end instanceof r.P6)&&(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 r.P6)&&(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((0,l.ux)(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 r=[s.tX.down,s.tX.end,s.tX.home,s.tX.left,s.tX.right,s.tX.up],i=e.key.toLocaleLowerCase();r.includes(i)&&this.event.emit_cursor_nav_before(e).some(e=>!1===e)||(i===s.tX.left?n.move_left():i===s.tX.right?n.move_right():i===s.tX.up?n.move_up():i===s.tX.down?n.move_down():i===s.tX.home?n.move_home():i===s.tX.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 r.P6&&(e.preventDefault(),e.key.toLocaleLowerCase()===s.tX.left?n.extend_left():e.key.toLocaleLowerCase()===s.tX.right?n.extend_right():e.key.toLocaleLowerCase()===s.tX.up?n.extend_up():e.key.toLocaleLowerCase()===s.tX.down?n.extend_down():e.key.toLocaleLowerCase()===s.tX.home?n.extend_home():e.key.toLocaleLowerCase()===s.tX.end&&n.extend_end())}text_break(e){const{courier:t,cursor:n,history:i,doc:s}=this;if(n.has_selection)return;e.preventDefault();const a=new o.vk(t),{cube_end:l,cube_start:c,cube_selection:d,offset_end:u,offset_start:h}=n;if(l){if(l instanceof r.P6){const e=l.text.slice(0,u)+"\n"+l.text.slice(u);a.tell(l,r.zl.reset(l.id,e,u,u+2))}i.record(a)}}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:s,doc:a}=this,{cube_end:l,cube_start:c,cube_selection:d,offset_end:u,offset_start:h}=s;if(!d||!l||!c)return;const p=new o.vk(t),f=c.id,m=l.id;s.has_selection&&p.tell(d,i.VL.delete(d.id,"backward",f,m,h,u,!0)),p.tell(c,r.zl.break(c.id,h)),n.record(p),this.event.emit_enter_after(e)}async break_root(e){const{cursor:t,courier:n,history:s}=this,{cube_end:o,offset_end:a}=t;if(!o)return;const l=o.find_upstream_target(e=>e instanceof r.HR);if(!l)return;const d=o.find_upstream_untill(l);if(!d)return;const u=[],h=d.index,p=l.children.slice(h);for(let e of p)u.push(e.export());const f=r.HR.get_default(u),m=n.get_recorder(),_=l.pcube;m.tell(_,i.VL.insert_child(_.id,[f],l.index+1)),m.tell(l,i.VL.delete_child(l.id,"backward",[h,l.child_count])),o instanceof r.P6&&(await(0,c.dY)(),o.set_cursor_in_head(a)),s.record(m)}text_partition(e){const{cursor:t,history:n,courier:s}=this,o=d.F.tips,{cube_selection:a,offset_end:l,offset_start:c}=t;if(!(a instanceof r.P6))return o?.tip_warning("选区必须在一个文本块内");const u=s.get_recorder(),h=a.id;u.tell(a,i.VL.partition(h,h,h,c,l)),n.record(u)}add_scope(e){this.root.add_scope()}underline(e){const{cursor:t,courier:n,history:r}=this,{cube_selection:s,cube_end:a,cube_start:l,offset_start:c,offset_end:d}=t,u=new o.vk(n);s&&l&&a&&(u.tell(s,i.VL.set_selection_css(s.id,{"text-decoration-line":"underline"},l.id,a.id,c,d,!0)),r.record(u))}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:s}=t;if(!s)return;const a=s.find_upstream_target(e=>e instanceof r.HR);if(!a)return;const l=a.pcube,c=new o.vk(this.courier),d=r.HR.get_default();c.tell(l,i.VL.insert_child(l.id,[d],a.index+1)),n.record(c)}prev_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:s}=t;if(!s)return;const a=s.find_upstream_target(e=>e instanceof r.HR);if(!a)return;const l=a.pcube,c=new o.vk(this.courier),d=r.HR.get_default();c.tell(l,i.VL.insert_child(l.id,[d],a.index)),n.record(c)}add_annotation(e){e.preventDefault();const t=d.F.tips,{cursor:n,courier:s,history:a}=this,{cube_selection:l,cube_start:c,cube_end:u,offset_end:h,offset_start:p}=n,f=new o.vk(s);if(!l||!c||!u)return t?.tip_warning("未发现光标或选区");const m=c.id,_=u.id,g=r.vV.get_default();if(n.has_selection)if(l instanceof r.P6)if(f.tell(l,i.VL.partition(l.id,m,_,p,h)),0===p){if(l.postil?.has_annotation)return t?.tip_warning("已添加批注"),f;f.tell(l,i.VL.postil_add(l.id,[g])),f.tell(l,i.UB.in_head(l.id,h))}else{const e=l.next_cube;if(e instanceof r.P6){if(e.postil?.has_annotation)return t?.tip_warning("已添加批注"),f;f.tell(e,i.VL.postil_add(e.id,[g])),f.tell(e,i.UB.in_head(e.id,h))}}else t?.tip_warning("选区跨越多个文本块");else u instanceof r.P6&&(f.merge(u.add_annotation()),f.tell(u,i.UB.in_head(u.id,h)));a.record(f)}fold_block(e){e.preventDefault();const{cursor:t}=this,{cube_end:n,offset_end:s}=t;if(!n)return;let o,a=n;for(;!o;){let e=a.pcube;if(e instanceof r.de||e instanceof r.HR)o=e;else if(e instanceof i.MR)return;a=e}if(o){const e=o.child_first,t=n.find_upstream_untill(o)===e,r=this.courier.get_recorder(),a=!o.attrs.fold,l=i.VL.set_attr(o.id,{fold:a});r.tell(o,l),t?r.tell(n,i.UB.in_head(n.id,s)):a&&e&&r.tell(e,i.UB.in_tail(e.id,0)),this.history.record(r)}}static get meta(){return{type:s.Mu.hotkeys,version:1}}static get default_hotkeys(){return{[s.ZS["fold-block"]]:{name:s.ZS["fold-block"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["z"],cursor:!0,group:s.ec.block},[s.ZS["text-partition"]]:{name:s.ZS["text-partition"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["x"],cursor:!0,group:s.ec.text},[s.ZS["text-add-annotation"]]:{name:s.ZS["text-add-annotation"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["a"],cursor:!0,group:s.ec.text},[s.ZS["scope-clear"]]:{name:s.ZS["scope-clear"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["c"],group:s.ec.scope},[s.ZS["clear-css"]]:{name:s.ZS["clear-css"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:s.ec.css},[s.ZS["root-add-prev"]]:{name:s.ZS["root-add-prev"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["root-add-next"]]:{name:s.ZS["root-add-next"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["text-align-left"]]:{name:s.ZS["text-align-left"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["l"],cursor:!0,group:s.ec.common},[s.ZS["text-align-center"]]:{name:s.ZS["text-align-center"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["e"],cursor:!0,group:s.ec.common},[s.ZS["text-align-right"]]:{name:s.ZS["text-align-right"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:s.ec.common},[s.ZS["break-text"]]:{name:s.ZS["break-text"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.text},[s.ZS["break-line"]]:{name:s.ZS["break-line"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.core},[s.ZS["break-root"]]:{name:s.ZS["break-root"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["cursor-nav"]]:{name:s.ZS["cursor-nav"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,cursor:!0,key:[s.tX.down,s.tX.left,s.tX.right,s.tX.up,s.tX.home,s.tX.end],group:s.ec.core},[s.ZS["cursor-nav-extend"]]:{name:s.ZS["cursor-nav-extend"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,cursor:!0,key:[s.tX.down,s.tX.left,s.tX.right,s.tX.up,s.tX.home,s.tX.end],group:s.ec.core},[s.ZS.undo]:{name:s.ZS.undo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["z"],cursor:!1,group:s.ec.common},[s.ZS.redo]:{name:s.ZS.redo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["y"],cursor:!1,group:s.ec.common},[s.ZS["indent-line"]]:{name:s.ZS["indent-line"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:s.ec.common},[s.ZS["unindent-line"]]:{name:s.ZS["unindent-line"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:s.ec.common},[s.ZS["text-bold"]]:{name:s.ZS["text-bold"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["b"],cursor:!0,group:s.ec.text},[s.ZS["scope-add"]]:{name:s.ZS["scope-add"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["s"],cursor:!1,group:s.ec.scope},[s.ZS["text-underline"]]:{name:s.ZS["text-underline"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["u"],cursor:!0,group:s.ec.text},[s.ZS["text-italic"]]:{name:s.ZS["text-italic"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["i"],cursor:!0,group:s.ec.text},[s.ZS["format-brush-copy"]]:{name:s.ZS["format-brush-copy"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["c"],cursor:!0,group:s.ec.common},[s.ZS["format-brush-apply"]]:{name:s.ZS["format-brush-apply"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["v"],cursor:!0,group:s.ec.common}}}}u([p(s.ZS["scope-clear"])],f.prototype,"clear_scope",null),u([p(s.ZS["clear-css"])],f.prototype,"clear_css",null),u([p(s.ZS["text-bold"])],f.prototype,"bold",null),u([p(s.ZS["unindent-line"])],f.prototype,"unindent_line",null),u([p(s.ZS["indent-line"])],f.prototype,"indent_line",null),u([p(s.ZS.undo)],f.prototype,"undo",null),u([p(s.ZS.redo)],f.prototype,"redo",null),u([p(s.ZS["cursor-nav"])],f.prototype,"cursor_navigation",null),u([p(s.ZS["cursor-nav-extend"])],f.prototype,"cursor_extend_navigation",null),u([p(s.ZS["break-text"])],f.prototype,"text_break",null),u([p(s.ZS["break-line"])],f.prototype,"break",null),u([p(s.ZS["break-root"])],f.prototype,"break_root",null),u([p(s.ZS["text-partition"])],f.prototype,"text_partition",null),u([p(s.ZS["scope-add"])],f.prototype,"add_scope",null),u([p(s.ZS["text-underline"])],f.prototype,"underline",null),u([p(s.ZS["format-brush-copy"])],f.prototype,"copy_format",null),u([p(s.ZS["format-brush-apply"])],f.prototype,"apply_format",null),u([p(s.ZS["text-italic"])],f.prototype,"italic",null),u([p(s.ZS["text-align-left"])],f.prototype,"align_left",null),u([p(s.ZS["text-align-center"])],f.prototype,"align_center",null),u([p(s.ZS["text-align-right"])],f.prototype,"align_right",null),u([p(s.ZS["root-add-next"])],f.prototype,"next_root",null),u([p(s.ZS["root-add-prev"])],f.prototype,"prev_root",null),u([p(s.ZS["text-add-annotation"])],f.prototype,"add_annotation",null),u([p(s.ZS["fold-block"])],f.prototype,"fold_block",null)},3513:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(7633),i=n(1556),s=n(4031),o=n(6996);class a extends s.K{_map=(0,r.Gc)({});_types=(0,r.Gc)(new Map);_count=(0,r.Gc)({});constructor(e){super(e)}get postils(){return this._types.get(o.u0.postil)||new Map}get meta(){return a.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,(0,r.Gc)(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(o.u0.submap);if(e)for(let[t,n]of e)n.clear_node_selected();this.root instanceof i.EU&&this.root.clear_node_selected()}static get meta(){return{type:o.Mu.cubes,version:1}}}},3676:(e,t,n)=>{"use strict";n.d(t,{T:()=>k});var r=n(4031),i=n(6996),s=n(7744),o=n(2547);class a extends r.K{_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,r=e.clientY,i=(n-this.scope_down.pos.x)/t.sx,s=(r-this.scope_down.pos.y)/t.sy;this.m=o.c.multiply(this.fig_matrix_origin,o.c.get_matrix_translate(i,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=s.yc.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 l extends r.K{_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,r=-Math.sign(n),i={x:e.clientX,y:e.clientY},s=r*t;this.map.scale_by_point(i,s,s),this.map.check_show_throttle()}dblclick(e){}contextmenu(e){}}class c extends r.K{_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=o.c.multiply(this.map.matrix2d,o.c.get_matrix_translate(t,0));this.map.reset_matrix(e)}else{const e=o.c.multiply(this.map.matrix2d,o.c.get_matrix_translate(0,t));this.map.reset_matrix(e)}this.map.check_show_throttle()}}dblclick(e){}contextmenu(e){}}var d=n(1556),u=n(1068);class h extends r.K{_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:r}=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(r),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=d.sf.line(this.down_point,n),this.count%this.rate!==0)return;this.count=1,this.map.clear_delete_line();const r={from:this.down_point,to:n};for(let e of this.view_cubes)if(e instanceof s.wP){let t=e.sample[0];for(let n of e.sample.slice(1)){const i={from:t,to:n};if(u.MathLine.check_intersection(i,r)){this.map.put_delete_selected(e);break}t=n}}else if(e instanceof d.R$){let t=e.sample[0];for(let n of e.sample.slice(1)){const i={from:t,to:n};if(u.MathLine.check_intersection(i,r)){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,r=t.get_recorder(),i=this.map.id,o=[],a=[],l=this.map.get_delete_selected();for(let e of l)e instanceof s.wP?o.push(e.id):e instanceof d.R$&&a.push(e.id);const c=s.yc.node_remove(i,o),u=s.yc.linker_remove(i,a);r.tell(this.map,c,u),n.record(r),this.reset()}cancel(e){this.reset()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class p extends r.K{_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:r}=t;if("fig"!==n.type)return;e.stopPropagation(),e.preventDefault();const{courier:i,history:o}=this,a=s.wP.get_default_node_pos(r,this.map),l=[d.gL.get_default(a)],c=s.yc.node_add(this.map.id,l),u=i.get_recorder();u.tell(this.map,c),o.record(u)}contextmenu(e){}}class f extends r.K{_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:r}=t,{type:i,res:s}=r;"fig"===i&&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),r=this.get_rect_area(this.point_down,n);if(this.map.placeholder.box_selector=r,this.count%this.rate!==0)return;this.count=1;const i={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(i);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 r=t.x-e.x,i=t.y-e.y,s=Math.sign(r)*n,o=Math.sign(i)*n,a=e,l=a.x+r,c=a.y,d=t,u=a.x,h=a.y+i;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 ${u+s}Q${u} ${h} ${u} ${h-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,r=e.y+e.height/2,i=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-i),a=Math.abs(r-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}}class m extends r.K{_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:r}=t,{type:i,res:s}=n;"node"!==i||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 _ extends r.K{_interaction;down_node;down_pos;matrix=new Map;matrix_translate=o.c.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:r,selected_nodes:i,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(r),i.has(this.down_node))for(let e of i)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},r=this.map.view_point_to_real(n),i=r.x-this.down_pos.x,s=r.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=o.c.get_matrix_translate(i,s);for(let[e,t]of this.matrix){if(!t)continue;const n=o.c.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,r=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 i=o.c.multiply(n,this.matrix_translate),a=s.Sv.layout_change(t.id,{matrix2d:i});r.tell(t,a)}n.record(r);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 g extends r.K{_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:r}=t;"node"===n.type&&(e.stopPropagation(),e.preventDefault(),n.res.editable=!0)}contextmenu(e){}}class b extends r.K{_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:r,res:i}=n;"fig"!==r&&"empty"!==r||(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){}}var v=n(3755);class y extends r.K{_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:r,selected_nodes:i}=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,i.has(this.down_node))for(let e of i)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:r}=t;this.map.placeholder.linker=[];const i=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"===r)for(let e of this.selected_nodes){const{from:t,to:r}=o.U.find_closest_points(e.sample,n.sample);this.map.placeholder.linker.push(d.sf.get_line(t,r,i))}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=o.U.find_closet_point(e.sample,n);this.map.placeholder.linker.push(d.sf.get_line(t,n,i))}}}up(e){if(!this.flow)return this.reset_status();e.preventDefault(),e.stopPropagation();const{courier:t,history:n}=this,r=this._interaction.get_map_selector(e),{res:i,type:a}=r;if("node"===a){if(i===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,i.id);if(this.map.get_linker(n))v.F.tips?.tip_warning("已存在连接线");else{const n=o.U.create_linker_info(this.map,t.id,i.id),r=s.yc.linker_add(this.map.id,[n]);e.tell(this.map,r)}}n.record(e)}else if("fig"===a){const{courier:t,history:n}=this,r=t.get_recorder(),i=s.wP.get_default_node_pos({x:e.clientX,y:e.clientY},this.map),a=d.gL.get_default(i),l=s.yc.node_add(this.map.id,[a]);r.tell(this.map,l);for(let e of this.selected_nodes){const t=this.map.get_linker_id(e.id,a.id);if(this.map.get_linker(t)){v.F.tips?.tip_warning("已存在连接线");continue}const n=o.U.create_linker_info(this.map,e.id,a.id),i=s.yc.linker_add(this.map.id,[n]);r.tell(this.map,i)}n.record(r)}this.reset_status()}leave(){}cancel(e){this.reset_status()}wheel(e){}dblclick(e,t){}contextmenu(e){e.preventDefault()}}var w=n(7633),x=n(5955);class k extends r.K{_map;interactions_pointer=[];interaction_keyboard=[];constructor(e){super(e.root),this._map=e,this.interactions_pointer.push(new a(this)),this.interactions_pointer.push(new l(this)),this.interactions_pointer.push(new c(this)),this.interactions_pointer.push(new g(this)),this.interactions_pointer.push(new b(this)),this.interactions_pointer.push(new p(this)),this.interactions_pointer.push(new y(this)),this.interactions_pointer.push(new _(this)),this.interactions_pointer.push(new f(this)),this.interactions_pointer.push(new h(this)),this.interactions_pointer.push(new m(this))}info_node_drag=(0,w.Kh)({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 x.I.check_mouse_key(e,t)}get_map_selector(e){let t=e.target;for(;t&&t!==document.body;){const e=t.dataset.type,n=t.id;if(n&&e){if(e===i.u0.node){const e=this.map.get_node(n);if(e)return{type:"node",res:e}}else if(e===i.u0.linker){const e=this.map.get_linker(n);if(e)return{type:"linker",res:e}}else if(e===i.u0.map||e===i.u0.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:r,type:i}=n;if("node"===i&&this.root.isdev){this.map.nodes_test[r.id]=r,console.log("------------------------------------节点信息");const t=r.bound;console.log("id",r.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:",r.pcube.real_point_to_fig(t.pos)),console.log("view_pos:",r.pcube.real_point_to_view(t.pos)),console.log("to_size",r.to.size),console.log("in_size",r.from.size),console.log("节点",r),this.check_mouse_key(e,"mid")&&r.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){e.preventDefault(),e.stopImmediatePropagation();for(let t of this.interactions_pointer)t.wheel(e)}contextmenu(e){for(let t of this.interactions_pointer)t.contextmenu(e)}}},3736:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var r=n(4031);class i extends r.K{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,r]of t.postils)r.show&&(e=!1,r.update_pos());e||this.check_float()})}}},3755:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});class r{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)}}},3803:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(6996);class i{static add(e,t,n){return{id:e,name:r.JC.add,data:t,pos:n}}static remove(e,t){return{id:e,name:r.JC.remove,range:t}}static indent(e,t){return{id:e,name:r.JC.indent,items:t}}}},3814:(e,t,n)=>{"use strict";n.d(t,{z:()=>o});var r=n(3755),i=n(1717),s=n(6996);class o extends i.K{_listener=new Map;_updating_status=!1;get meta(){return o.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 r=[];for(let e of n)r.push(e(...t));return r}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=r.F.tips,n=this._listener.get(s.dp["asset-save"]);n?(n.clear(),t?.tip_info("唯一事件-资源保存:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-save"],new Set([e]))}async emit_asset_save(e,t,n){const i=r.F.tips,o=this._listener.get(s.dp["asset-save"]);if(!o)return i?.tip_warning("未注册保存函数"),!1;const a=[...o][0];return!!a&&await a(e,t,n)}on_asset_download(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-download"]);n?(n.clear(),t?.tip_info("唯一事件-资源下载:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-download"],new Set([e]))}async emit_asset_download(e,t){const n=r.F.tips,i=this._listener.get(s.dp["asset-download"]);if(!i)return n?.tip_warning("未注册保存函数"),!1;const o=[...i][0];return!!o&&await o(e,t)}on_asset_copy(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-copy"]);n?(n.clear(),t?.tip_info("唯一事件-资源复制:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-copy"],new Set([e]))}async emit_asset_copy(e,t,n){const i=r.F.tips,o=this._listener.get(s.dp["asset-copy"]);if(!o)return i?.tip_warning("未注册保存函数"),!1;const a=[...o][0];return!!a&&await a(e,t,n)}emit_replace_id(e,t){const n=this._listener.get(s.dp["replace-id"]);if(!n)return!1;for(let r of n)r(e,t)}on_replace_id(e){const t=this._listener.get(s.dp["replace-id"]);t?t.add(e):this._listener.set(s.dp["replace-id"],new Set([e]))}emit_edit_before(e,t){const n=this._listener.get(s.dp["edit-before"]);if(!n)return!1;for(let r of n)r(e,t)}on_edit_before(e){const t=this._listener.get(s.dp["edit-before"]);t?t.add(e):this._listener.set(s.dp["edit-before"],new Set([e]))}emit_edit_after(e,t){const n=this._listener.get(s.dp["edit-after"]);if(!n)return!1;for(let r of n)r(e,t)}on_edit_after(e){const t=this._listener.get(s.dp["edit-after"]);t?t.add(e):this._listener.set(s.dp["edit-after"],new Set([e]))}emit_text_merge(e,t){const n=this._listener.get(s.dp["text-merge"]);if(!n)return!1;for(let r of n)r(e,t)}on_text_merge(e){const t=this._listener.get(s.dp["text-merge"]);t?t.add(e):this._listener.set(s.dp["text-merge"],new Set([e]))}on_esc(e){const t=this._listener.get(s.dp.esc);t?t.add(e):this._listener.set(s.dp.esc,new Set([e]))}emit_esc(){const e=this._listener.get(s.dp.esc);if(!e)return!1;for(let t of e)t()}on_selection_change(e){this.on(s.dp["selection-change"],e)}emit_selection_change(e){this.emit(s.dp["selection-change"],e)}emit_cursor_nav_before(e){return this.emit(s.dp["cursor-nav-before"],e)}on_cursor_nav_before(e){this.on(s.dp["cursor-nav-before"],e)}emit_cursor_nav_after(e){return this.emit(s.dp["cursor-nav-after"],e)}on_cursor_nav_after(e){this.on(s.dp["cursor-nav-after"],e)}on_enter_before(e){this.on(s.dp["enter-before"],e)}emit_enter_before(e){return this.emit(s.dp["enter-before"],e)}on_enter_after(e){this.on(s.dp["enter-after"],e)}emit_enter_after(e){return this.emit(s.dp["enter-after"],e)}on_show_cube_editor(e){this.on(s.dp["show-cube-editor"],e)}emit_show_cube_editor(e){return this.emit(s.dp["show-cube-editor"],e)}on_text_link_edit(e){this.on(s.dp["text-link-edit"],e)}emit_text_link_edit(e){return this.emit(s.dp["text-link-edit"],e)}on_doc_input_before(e){return this.on(s.dp["doc-input-before"],e)}emit_doc_input_before(e){return this.emit(s.dp["doc-input-before"],e)}on_doc_input_compositionend(e){return this.on(s.dp["doc-input-compositionend"],e)}emit_doc_input_compositionend(e){return this.emit(s.dp["doc-input-compositionend"],e)}on_status_update(e){return this.on(s.dp["status-update"],e)}emit_status_update(){this._updating_status||(this._updating_status=!0,Promise.resolve().then(()=>{const{root:e}=this,t={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};this.emit(s.dp["status-update"],t),this._updating_status=!1}))}on_node_status_click(e){return this.on(s.dp["node-status-clicked"],e)}emit_node_status_click(e,t){return this.emit(s.dp["node-status-clicked"],e,t)}on_fig_click(e){return this.on(s.dp["fig-click"],e)}emit_fig_click(e){return this.emit(s.dp["fig-click"],e)}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.event,version:1}}}},3972:(e,t,n)=>{"use strict";function r(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}n.d(t,{$3:()=>p,$H:()=>B,BH:()=>q,BX:()=>J,Bm:()=>w,C4:()=>Y,CE:()=>m,CP:()=>c,DY:()=>D,Gv:()=>x,J$:()=>Z,Kg:()=>y,MZ:()=>i,Mp:()=>l,NO:()=>a,Oj:()=>s,PT:()=>R,Qd:()=>T,Ro:()=>j,SU:()=>z,TF:()=>u,Tg:()=>E,Tn:()=>v,Tr:()=>$,We:()=>U,X$:()=>d,Y2:()=>Q,ZH:()=>O,Zf:()=>M,bB:()=>H,cy:()=>f,gd:()=>b,pD:()=>r,rU:()=>I,tE:()=>o,u3:()=>ee,vM:()=>_,v_:()=>ne,yI:()=>L,yL:()=>k,yQ:()=>V});const i={},s=[],o=()=>{},a=()=>!1,l=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith("onUpdate:"),d=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},h=Object.prototype.hasOwnProperty,p=(e,t)=>h.call(e,t),f=Array.isArray,m=e=>"[object Map]"===C(e),_=e=>"[object Set]"===C(e),g=e=>"[object Date]"===C(e),b=e=>"[object RegExp]"===C(e),v=e=>"function"==typeof e,y=e=>"string"==typeof e,w=e=>"symbol"==typeof e,x=e=>null!==e&&"object"==typeof e,k=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),S=Object.prototype.toString,C=e=>S.call(e),M=e=>C(e).slice(8,-1),T=e=>"[object Object]"===C(e),L=e=>y(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,z=r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),A=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-\w/g,R=A(e=>e.replace(P,e=>e.slice(1).toUpperCase())),N=/\B([A-Z])/g,E=A(e=>e.replace(N,"-$1").toLowerCase()),O=A(e=>e.charAt(0).toUpperCase()+e.slice(1)),I=A(e=>e?`on${O(e)}`:""),B=(e,t)=>!Object.is(e,t),D=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},V=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},H=e=>{const t=parseFloat(e);return isNaN(t)?e:t},j=e=>{const t=y(e)?Number(e):NaN;return isNaN(t)?e:t};let F;const U=()=>F||(F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{}),q=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function $(e){if(f(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=y(r)?W(r):$(r);if(i)for(const e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}const G=/;(?![^(]*\))/g,X=/:([^]+)/,K=/\/\*[^]*?\*\//g;function W(e){const t={};return e.replace(K,"").split(G).forEach(e=>{if(e){const n=e.split(X);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Y(e){let t="";if(y(e))t=e;else if(f(e))for(let n=0;n<e.length;n++){const r=Y(e[n]);r&&(t+=r+" ")}else if(x(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Z=r("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Q(e){return!!e||""===e}function J(e,t){if(e===t)return!0;let n=g(e),r=g(t);if(n||r)return!(!n||!r)&&e.getTime()===t.getTime();if(n=w(e),r=w(t),n||r)return e===t;if(n=f(e),r=f(t),n||r)return!(!n||!r)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=J(e[r],t[r]);return n}(e,t);if(n=x(e),r=x(t),n||r){if(!n||!r)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!J(e[n],t[n]))return!1}}return String(e)===String(t)}function ee(e,t){return e.findIndex(e=>J(e,t))}const te=e=>!(!e||!0!==e.__v_isRef),ne=e=>y(e)?e:null==e?"":f(e)||x(e)&&(e.toString===S||!v(e.toString))?te(e)?ne(e.value):JSON.stringify(e,re,2):String(e),re=(e,t)=>te(t)?re(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ie(t,r)+" =>"]=n,e),{})}:_(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ie(e))}:w(t)?ie(t):!x(t)||f(t)||T(t)?t:String(t),ie=(e,t="")=>{var n;return w(e)?`Symbol(${null!=(n=e.description)?n:t})`:e}},4031:(e,t,n)=>{"use strict";n.d(t,{K:()=>r.K});var r=n(1717)},4089:(e,t,n)=>{"use strict";n.d(t,{$u:()=>J,$y:()=>le,CE:()=>Tt,Df:()=>O,EW:()=>on,FK:()=>gt,Fv:()=>Bt,Gy:()=>A,K9:()=>We,Lk:()=>Nt,MZ:()=>E,OW:()=>N,Q3:()=>Dt,QP:()=>R,Wv:()=>Lt,bF:()=>Et,bo:()=>C,dY:()=>m,eW:()=>It,hi:()=>te,nI:()=>Gt,pI:()=>de,pM:()=>I,qL:()=>o,rk:()=>D,sV:()=>Z,uX:()=>kt,wB:()=>rt,xo:()=>ee});var r=n(7633),i=n(3972);function s(e,t,n,r){try{return r?e(...r):e()}catch(e){a(e,t,n)}}function o(e,t,n,r){if((0,i.Tn)(e)){const o=s(e,t,n,r);return o&&(0,i.yL)(o)&&o.catch(e=>{a(e,t,n)}),o}if((0,i.cy)(e)){const i=[];for(let s=0;s<e.length;s++)i.push(o(e[s],t,n,r));return i}}function a(e,t,n,o=!0){t&&t.vnode;const{errorHandler:a,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||i.MZ;if(t){let i=t.parent;const o=t.proxy,l=`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,o,l))return;i=i.parent}if(a)return(0,r.C4)(),s(a,null,10,[e,o,l]),void(0,r.bl)()}!function(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}(e,0,0,o,l)}const l=[];let c=-1;const d=[];let u=null,h=0;const p=Promise.resolve();let f=null;function m(e){const t=f||p;return e?t.then(this?e.bind(this):e):t}function _(e){if(!(1&e.flags)){const t=y(e),n=l[l.length-1];!n||!(2&e.flags)&&t>=y(n)?l.push(e):l.splice(function(e){let t=c+1,n=l.length;for(;t<n;){const r=t+n>>>1,i=l[r],s=y(i);s<e||s===e&&2&i.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,g()}}function g(){f||(f=p.then(w))}function b(e,t,n=c+1){for(;n<l.length;n++){const t=l[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;l.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function v(e){if(d.length){const e=[...new Set(d)].sort((e,t)=>y(e)-y(t));if(d.length=0,u)return void u.push(...e);for(u=e,h=0;h<u.length;h++){const e=u[h];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}u=null,h=0}}const y=e=>null==e.id?2&e.flags?-1:1/0:e.id;function w(e){i.tE;try{for(c=0;c<l.length;c++){const e=l[c];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),s(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;c<l.length;c++){const e=l[c];e&&(e.flags&=-2)}c=-1,l.length=0,v(),f=null,(l.length||d.length)&&w(e)}}let x=null,k=null;function S(e){const t=x;return x=e,k=e&&e.type.__scopeId||null,t}function C(e,t){if(null===x)return e;const n=sn(x),s=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[o,a,l,c=i.MZ]=t[e];o&&((0,i.Tn)(o)&&(o={mounted:o,updated:o}),o.deep&&(0,r.hV)(a),s.push({dir:o,instance:n,value:a,oldValue:void 0,arg:l,modifiers:c}))}return e}function M(e,t,n,i){const s=e.dirs,a=t&&t.dirs;for(let l=0;l<s.length;l++){const c=s[l];a&&(c.oldValue=a[l].value);let d=c.dir[i];d&&((0,r.C4)(),o(d,n,8,[e.el,c,e,t]),(0,r.bl)())}}const T=Symbol("_vte"),L=Symbol("_leaveCb"),z=Symbol("_enterCb");function A(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Z(()=>{e.isMounted=!0}),ee(()=>{e.isUnmounting=!0}),e}const P=[Function,Array],R={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:P,onEnter:P,onAfterEnter:P,onEnterCancelled:P,onBeforeLeave:P,onLeave:P,onAfterLeave:P,onLeaveCancelled:P,onBeforeAppear:P,onAppear:P,onAfterAppear:P,onAppearCancelled:P};function N(e,t,n,r,s){const{appear:a,mode:l,persisted:c=!1,onBeforeEnter:d,onEnter:u,onAfterEnter:h,onEnterCancelled:p,onBeforeLeave:f,onLeave:m,onAfterLeave:_,onLeaveCancelled:g,onBeforeAppear:b,onAppear:v,onAfterAppear:y,onAppearCancelled:w}=t,x=String(e.key),k=function(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}(n,e),S=(e,t)=>{e&&o(e,r,9,t)},C=(e,t)=>{const n=t[1];S(e,t),(0,i.cy)(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},M={mode:l,persisted:c,beforeEnter(t){let r=d;if(!n.isMounted){if(!a)return;r=b||d}t[L]&&t[L](!0);const i=k[x];i&&At(e,i)&&i.el[L]&&i.el[L](),S(r,[t])},enter(e){let t=u,r=h,i=p;if(!n.isMounted){if(!a)return;t=v||u,r=y||h,i=w||p}let s=!1;const o=e[z]=t=>{s||(s=!0,S(t?i:r,[e]),M.delayedLeave&&M.delayedLeave(),e[z]=void 0)};t?C(t,[e,o]):o()},leave(t,r){const i=String(e.key);if(t[z]&&t[z](!0),n.isUnmounting)return r();S(f,[t]);let s=!1;const o=t[L]=n=>{s||(s=!0,r(),S(n?g:_,[t]),t[L]=void 0,k[i]===e&&delete k[i])};k[i]=e,m?C(m,[t,o]):o()},clone(e){const i=N(e,t,n,r,s);return s&&s(i),i}};return M}function E(e,t){6&e.shapeFlag&&e.component?(e.transition=t,E(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 O(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=null==n?o.key:String(n)+String(null!=o.key?o.key:s);o.type===gt?(128&o.patchFlag&&i++,r=r.concat(O(o.children,t,a))):(t||o.type!==vt)&&r.push(null!=a?Ot(o,{key:a}):o)}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function I(e,t){return(0,i.Tn)(e)?(()=>(0,i.X$)({name:e.name},t,{setup:e}))():e}function B(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function D(e){const t=Gt(),n=(0,r.IJ)(null);if(t){const r=t.refs===i.MZ?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}const V=new WeakMap;function H(e,t,n,o,a=!1){if((0,i.cy)(e))return void e.forEach((e,r)=>H(e,t&&((0,i.cy)(t)?t[r]:t),n,o,a));if(F(o)&&!a)return void(512&o.shapeFlag&&o.type.__asyncResolved&&o.component.subTree.component&&H(e,t,n,o.component.subTree));const l=4&o.shapeFlag?sn(o.component):o.el,c=a?null:l,{i:d,r:u}=e,h=t&&t.r,p=d.refs===i.MZ?d.refs={}:d.refs,f=d.setupState,m=(0,r.ux)(f),_=f===i.MZ?i.NO:e=>(0,i.$3)(m,e);if(null!=h&&h!==u)if(j(t),(0,i.Kg)(h))p[h]=null,_(h)&&(f[h]=null);else if((0,r.i9)(h)){h.value=null;const e=t;e.k&&(p[e.k]=null)}if((0,i.Tn)(u))s(u,d,12,[c,p]);else{const t=(0,i.Kg)(u),s=(0,r.i9)(u);if(t||s){const r=()=>{if(e.f){const n=t?_(u)?f[u]:p[u]:u.value;if(a)(0,i.cy)(n)&&(0,i.TF)(n,l);else if((0,i.cy)(n))n.includes(l)||n.push(l);else if(t)p[u]=[l],_(u)&&(f[u]=p[u]);else{const t=[l];u.value=t,e.k&&(p[e.k]=t)}}else t?(p[u]=c,_(u)&&(f[u]=c)):s&&(u.value=c,e.k&&(p[e.k]=c))};if(c){const t=()=>{r(),V.delete(e)};t.id=-1,V.set(e,t),Ke(t,n)}else j(e),r()}}}function j(e){const t=V.get(e);t&&(t.flags|=8,V.delete(e))}(0,i.We)().requestIdleCallback,(0,i.We)().cancelIdleCallback;const F=e=>!!e.type.__asyncLoader,U=e=>e.type.__isKeepAlive;function q(e,t){G(e,"a",t)}function $(e,t){G(e,"da",t)}function G(e,t,n=$t){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(K(t,r,n),n){let e=n.parent;for(;e&&e.parent;)U(e.parent.vnode)&&X(r,t,n,e),e=e.parent}}function X(e,t,n,r){const s=K(t,e,r,!0);te(()=>{(0,i.TF)(r[t],s)},n)}function K(e,t,n=$t,i=!1){if(n){const s=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...i)=>{(0,r.C4)();const s=Wt(n),a=o(t,n,e,i);return s(),(0,r.bl)(),a});return i?s.unshift(a):s.push(a),a}}RegExp,RegExp;const W=e=>(t,n=$t)=>{en&&"sp"!==e||K(e,(...e)=>t(...e),n)},Y=W("bm"),Z=W("m"),Q=W("bu"),J=W("u"),ee=W("bum"),te=W("um"),ne=W("sp"),re=W("rtg"),ie=W("rtc");function se(e,t=$t){K("ec",e,t)}const oe="components",ae=Symbol.for("v-ndc");function le(e){return(0,i.Kg)(e)?function(e,t,n=!0,r=!1){const s=x||$t;if(s){const n=s.type;if(e===oe){const e=function(e,t=!0){return(0,i.Tn)(e)?e.displayName||e.name:e.name||t&&e.__name}(n,!1);if(e&&(e===t||e===(0,i.PT)(t)||e===(0,i.ZH)((0,i.PT)(t))))return n}const o=ce(s[e]||n[e],t)||ce(s.appContext[e],t);return!o&&r?n:o}}(oe,e,!1)||e:e||ae}function ce(e,t){return e&&(e[t]||e[(0,i.PT)(t)]||e[(0,i.ZH)((0,i.PT)(t))])}function de(e,t,n,s){let o;const a=n&&n[s],l=(0,i.cy)(e);if(l||(0,i.Kg)(e)){let n=!1,i=!1;l&&(0,r.g8)(e)&&(n=!(0,r.fE)(e),i=(0,r.Tm)(e),e=(0,r.qA)(e)),o=new Array(e.length);for(let s=0,l=e.length;s<l;s++)o[s]=t(n?i?(0,r.a1)((0,r.lJ)(e[s])):(0,r.lJ)(e[s]):e[s],s,void 0,a&&a[s])}else if("number"==typeof e){o=new Array(e);for(let n=0;n<e;n++)o[n]=t(n+1,n,void 0,a&&a[n])}else if((0,i.Gv)(e))if(e[Symbol.iterator])o=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{const n=Object.keys(e);o=new Array(n.length);for(let r=0,i=n.length;r<i;r++){const i=n[r];o[r]=t(e[i],i,r,a&&a[r])}}else o=[];return n&&(n[s]=o),o}const ue=e=>e?Zt(e)?sn(e):ue(e.parent):null,he=(0,i.X$)(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=>ue(e.parent),$root:e=>ue(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ve(e),$forceUpdate:e=>e.f||(e.f=()=>{_(e.update)}),$nextTick:e=>e.n||(e.n=m.bind(e.proxy)),$watch:e=>st.bind(e)}),pe=(e,t)=>e!==i.MZ&&!e.__isScriptSetup&&(0,i.$3)(e,t),fe={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:l,type:c,appContext:d}=e;let u;if("$"!==t[0]){const r=l[t];if(void 0!==r)switch(r){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(pe(s,t))return l[t]=1,s[t];if(o!==i.MZ&&(0,i.$3)(o,t))return l[t]=2,o[t];if((u=e.propsOptions[0])&&(0,i.$3)(u,t))return l[t]=3,a[t];if(n!==i.MZ&&(0,i.$3)(n,t))return l[t]=4,n[t];_e&&(l[t]=0)}}const h=he[t];let p,f;return h?("$attrs"===t&&(0,r.u4)(e.attrs,"get",""),h(e)):(p=c.__cssModules)&&(p=p[t])?p:n!==i.MZ&&(0,i.$3)(n,t)?(l[t]=4,n[t]):(f=d.config.globalProperties,(0,i.$3)(f,t)?f[t]:void 0)},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return pe(s,t)?(s[t]=n,!0):r!==i.MZ&&(0,i.$3)(r,t)?(r[t]=n,!0):!((0,i.$3)(e.props,t)||"$"===t[0]&&t.slice(1)in e||(o[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,propsOptions:o,type:a}},l){let c,d;return!!(n[l]||e!==i.MZ&&"$"!==l[0]&&(0,i.$3)(e,l)||pe(t,l)||(c=o[0])&&(0,i.$3)(c,l)||(0,i.$3)(r,l)||(0,i.$3)(he,l)||(0,i.$3)(s.config.globalProperties,l)||(d=a.__cssModules)&&d[l])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:(0,i.$3)(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function me(e){return(0,i.cy)(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let _e=!0;function ge(e,t,n){o((0,i.cy)(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function be(e,t,n,r){let s=r.includes(".")?ot(n,r):()=>n[r];if((0,i.Kg)(e)){const n=t[e];(0,i.Tn)(n)&&rt(s,n)}else if((0,i.Tn)(e))rt(s,e.bind(n));else if((0,i.Gv)(e))if((0,i.cy)(e))e.forEach(e=>be(e,t,n,r));else{const r=(0,i.Tn)(e.handler)?e.handler.bind(n):t[e.handler];(0,i.Tn)(r)&&rt(s,r,e)}}function ve(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,l=o.get(t);let c;return l?c=l:s.length||n||r?(c={},s.length&&s.forEach(e=>ye(c,e,a,!0)),ye(c,t,a)):c=t,(0,i.Gv)(t)&&o.set(t,c),c}function ye(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&ye(e,s,n,!0),i&&i.forEach(t=>ye(e,t,n,!0));for(const i in t)if(r&&"expose"===i);else{const r=we[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}const we={data:xe,props:Me,emits:Me,methods:Ce,computed:Ce,beforeCreate:Se,created:Se,beforeMount:Se,mounted:Se,beforeUpdate:Se,updated:Se,beforeDestroy:Se,beforeUnmount:Se,destroyed:Se,unmounted:Se,activated:Se,deactivated:Se,errorCaptured:Se,serverPrefetch:Se,components:Ce,directives:Ce,watch:function(e,t){if(!e)return t;if(!t)return e;const n=(0,i.X$)(Object.create(null),e);for(const r in t)n[r]=Se(e[r],t[r]);return n},provide:xe,inject:function(e,t){return Ce(ke(e),ke(t))}};function xe(e,t){return t?e?function(){return(0,i.X$)((0,i.Tn)(e)?e.call(this,this):e,(0,i.Tn)(t)?t.call(this,this):t)}:t:e}function ke(e){if((0,i.cy)(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Se(e,t){return e?[...new Set([].concat(e,t))]:t}function Ce(e,t){return e?(0,i.X$)(Object.create(null),e,t):t}function Me(e,t){return e?(0,i.cy)(e)&&(0,i.cy)(t)?[...new Set([...e,...t])]:(0,i.X$)(Object.create(null),me(e),me(null!=t?t:{})):t}function Te(){return{app:null,config:{isNativeTag:i.NO,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 Le=0;function ze(e,t){return function(n,r=null){(0,i.Tn)(n)||(n=(0,i.X$)({},n)),null==r||(0,i.Gv)(r)||(r=null);const s=Te(),a=new WeakSet,l=[];let c=!1;const d=s.app={_uid:Le++,_component:n,_props:r,_container:null,_context:s,_instance:null,version:an,get config(){return s.config},set config(e){},use:(e,...t)=>(a.has(e)||(e&&(0,i.Tn)(e.install)?(a.add(e),e.install(d,...t)):(0,i.Tn)(e)&&(a.add(e),e(d,...t))),d),mixin:e=>(s.mixins.includes(e)||s.mixins.push(e),d),component:(e,t)=>t?(s.components[e]=t,d):s.components[e],directive:(e,t)=>t?(s.directives[e]=t,d):s.directives[e],mount(i,o,a){if(!c){const l=d._ceVNode||Et(n,r);return l.appContext=s,!0===a?a="svg":!1===a&&(a=void 0),o&&t?t(l,i):e(l,i,a),c=!0,d._container=i,i.__vue_app__=d,sn(l.component)}},onUnmount(e){l.push(e)},unmount(){c&&(o(l,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide:(e,t)=>(s.provides[e]=t,d),runWithContext(e){const t=Ae;Ae=d;try{return e()}finally{Ae=t}}};return d}}let Ae=null;function Pe(e,t,n=!1){const r=Gt();if(r||Ae){let s=Ae?Ae._context.provides:r?null==r.parent||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&(0,i.Tn)(t)?t.call(r&&r.proxy):t}}const Re={},Ne=()=>Object.create(Re),Ee=e=>Object.getPrototypeOf(e)===Re;function Oe(e,t,n,s){const[o,a]=e.propsOptions;let l,c=!1;if(t)for(let r in t){if((0,i.SU)(r))continue;const d=t[r];let u;o&&(0,i.$3)(o,u=(0,i.PT)(r))?a&&a.includes(u)?(l||(l={}))[u]=d:n[u]=d:ut(e.emitsOptions,r)||r in s&&d===s[r]||(s[r]=d,c=!0)}if(a){const t=(0,r.ux)(n),s=l||i.MZ;for(let r=0;r<a.length;r++){const l=a[r];n[l]=Ie(o,t,l,s[l],e,!(0,i.$3)(s,l))}}return c}function Ie(e,t,n,r,s,o){const a=e[n];if(null!=a){const e=(0,i.$3)(a,"default");if(e&&void 0===r){const e=a.default;if(a.type!==Function&&!a.skipFactory&&(0,i.Tn)(e)){const{propsDefaults:i}=s;if(n in i)r=i[n];else{const o=Wt(s);r=i[n]=e.call(null,t),o()}}else r=e;s.ce&&s.ce._setProp(n,r)}a[0]&&(o&&!e?r=!1:!a[1]||""!==r&&r!==(0,i.Tg)(n)||(r=!0))}return r}const Be=new WeakMap;function De(e,t,n=!1){const r=n?Be:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,a={},l=[];let c=!1;if(!(0,i.Tn)(e)){const r=e=>{c=!0;const[n,r]=De(e,t,!0);(0,i.X$)(a,n),r&&l.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!o&&!c)return(0,i.Gv)(e)&&r.set(e,i.Oj),i.Oj;if((0,i.cy)(o))for(let e=0;e<o.length;e++){const t=(0,i.PT)(o[e]);Ve(t)&&(a[t]=i.MZ)}else if(o)for(const e in o){const t=(0,i.PT)(e);if(Ve(t)){const n=o[e],r=a[t]=(0,i.cy)(n)||(0,i.Tn)(n)?{type:n}:(0,i.X$)({},n),s=r.type;let c=!1,d=!0;if((0,i.cy)(s))for(let e=0;e<s.length;++e){const t=s[e],n=(0,i.Tn)(t)&&t.name;if("Boolean"===n){c=!0;break}"String"===n&&(d=!1)}else c=(0,i.Tn)(s)&&"Boolean"===s.name;r[0]=c,r[1]=d,(c||(0,i.$3)(r,"default"))&&l.push(t)}}const d=[a,l];return(0,i.Gv)(e)&&r.set(e,d),d}function Ve(e){return"$"!==e[0]&&!(0,i.SU)(e)}const He=e=>"_"===e||"_ctx"===e||"$stable"===e,je=e=>(0,i.cy)(e)?e.map(Vt):[Vt(e)],Fe=(e,t,n)=>{if(t._n)return t;const r=function(e,t=x){if(!t)return e;if(e._n)return e;const n=(...r)=>{n._d&&Ct(-1);const i=S(t);let s;try{s=e(...r)}finally{S(i),n._d&&Ct(1)}return s};return n._n=!0,n._c=!0,n._d=!0,n}((...e)=>je(t(...e)),n);return r._c=!1,r},Ue=(e,t,n)=>{const r=e._ctx;for(const n in e){if(He(n))continue;const s=e[n];if((0,i.Tn)(s))t[n]=Fe(0,s,r);else if(null!=s){const e=je(s);t[n]=()=>e}}},qe=(e,t)=>{const n=je(t);e.slots.default=()=>n},$e=(e,t,n)=>{for(const r in t)!n&&He(r)||(e[r]=t[r])},Ge=(e,t,n)=>{const r=e.slots=Ne();if(32&e.vnode.shapeFlag){const e=t._;e?($e(r,t,n),n&&(0,i.yQ)(r,"_",e,!0)):Ue(t,r)}else t&&qe(e,t)},Xe=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,a=i.MZ;if(32&r.shapeFlag){const e=t._;e?n&&1===e?o=!1:$e(s,t,n):(o=!t.$stable,Ue(t,s)),a=t}else t&&(qe(e,t),a={default:1});if(o)for(const e in s)He(e)||null!=a[e]||delete s[e]},Ke=function(e,t){t&&t.pendingBranch?(0,i.cy)(e)?t.effects.push(...e):t.effects.push(e):(n=e,(0,i.cy)(n)?d.push(...n):u&&-1===n.id?u.splice(h+1,0,n):1&n.flags||(d.push(n),n.flags|=1),g());var n};function We(e){return function(e,t){(0,i.We)().__VUE__=!0;const{insert:n,remove:o,patchProp:l,createElement:c,createText:d,createComment:u,setText:h,setElementText:p,parentNode:f,nextSibling:m,setScopeId:g=i.tE,insertStaticContent:y}=e,w=(e,t,n,r=null,i=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!At(e,t)&&(r=te(e),Y(e,i,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case bt:x(e,t,n,r);break;case vt:k(e,t,n,r);break;case yt:null==e&&S(t,n,r,o);break;case gt:I(e,t,n,r,i,s,o,a,l);break;default:1&u?z(e,t,n,r,i,s,o,a,l):6&u?D(e,t,n,r,i,s,o,a,l):(64&u||128&u)&&c.process(e,t,n,r,i,s,o,a,l,ie)}null!=d&&i?H(d,e&&e.ref,s,t||e,!t):null==d&&e&&null!=e.ref&&H(e.ref,null,s,e,!0)},x=(e,t,r,i)=>{if(null==e)n(t.el=d(t.children),r,i);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},k=(e,t,r,i)=>{null==e?n(t.el=u(t.children||""),r,i):t.el=e.el},S=(e,t,n,r)=>{[e.el,e.anchor]=y(e.children,t,n,r,e.el,e.anchor)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),o(e),e=n;o(t)},z=(e,t,n,r,i,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?A(t,n,r,i,s,o,a,l):N(e,t,i,s,o,a,l)},A=(e,t,r,s,o,a,d,u)=>{let h,f;const{props:m,shapeFlag:_,transition:g,dirs:b}=e;if(h=e.el=c(e.type,a,m&&m.is,m),8&_?p(h,e.children):16&_&&R(e.children,h,null,s,o,Ye(e,a),d,u),b&&M(e,null,s,"created"),P(h,e,e.scopeId,d,s),m){for(const e in m)"value"===e||(0,i.SU)(e)||l(h,e,null,m[e],a,s);"value"in m&&l(h,"value",null,m.value,a),(f=m.onVnodeBeforeMount)&&Ft(f,s,e)}b&&M(e,null,s,"beforeMount");const v=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(o,g);v&&g.beforeEnter(h),n(h,t,r),((f=m&&m.onVnodeMounted)||v||b)&&Ke(()=>{f&&Ft(f,s,e),v&&g.enter(h),b&&M(e,null,s,"mounted")},o)},P=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||_t(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=i.vnode;P(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},R=(e,t,n,r,i,s,o,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Ht(e[c]):Vt(e[c]);w(null,l,t,n,r,i,s,o,a)}},N=(e,t,n,r,s,o,a)=>{const c=t.el=e.el;let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const f=e.props||i.MZ,m=t.props||i.MZ;let _;if(n&&Ze(n,!1),(_=m.onVnodeBeforeUpdate)&&Ft(_,n,t,e),h&&M(t,e,n,"beforeUpdate"),n&&Ze(n,!0),(f.innerHTML&&null==m.innerHTML||f.textContent&&null==m.textContent)&&p(c,""),u?E(e.dynamicChildren,u,c,n,r,Ye(t,s),o):a||G(e,t,c,null,n,r,Ye(t,s),o,!1),d>0){if(16&d)O(c,f,m,n,s);else if(2&d&&f.class!==m.class&&l(c,"class",null,m.class,s),4&d&&l(c,"style",f.style,m.style,s),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const r=e[t],i=f[r],o=m[r];o===i&&"value"!==r||l(c,r,i,o,s,n)}}1&d&&e.children!==t.children&&p(c,t.children)}else a||null!=u||O(c,f,m,n,s);((_=m.onVnodeUpdated)||h)&&Ke(()=>{_&&Ft(_,n,t,e),h&&M(t,e,n,"updated")},r)},E=(e,t,n,r,i,s,o)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],d=l.el&&(l.type===gt||!At(l,c)||198&l.shapeFlag)?f(l.el):n;w(l,c,d,null,r,i,s,o,!0)}},O=(e,t,n,r,s)=>{if(t!==n){if(t!==i.MZ)for(const o in t)(0,i.SU)(o)||o in n||l(e,o,t[o],null,s,r);for(const o in n){if((0,i.SU)(o))continue;const a=n[o],c=t[o];a!==c&&"value"!==o&&l(e,o,c,a,s,r)}"value"in n&&l(e,"value",t.value,n.value,s)}},I=(e,t,r,i,s,o,a,l,c)=>{const u=t.el=e?e.el:d(""),h=t.anchor=e?e.anchor:d("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=t;m&&(l=l?l.concat(m):m),null==e?(n(u,r,i),n(h,r,i),R(t.children||[],r,h,s,o,a,l,c)):p>0&&64&p&&f&&e.dynamicChildren?(E(e.dynamicChildren,f,r,s,o,a,l),(null!=t.key||s&&t===s.subTree)&&Qe(e,t,!0)):G(e,t,r,h,s,o,a,l,c)},D=(e,t,n,r,i,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?i.ctx.activate(t,n,r,o,l):V(t,n,r,i,s,o,l):j(e,t,l)},V=(e,t,n,o,l,c,d)=>{const u=e.component=function(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Ut,a={uid:qt++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new r.yC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:De(s,o),emitsOptions:dt(s,o),emit:null,emitted:null,propsDefaults:i.MZ,inheritAttrs:s.inheritAttrs,ctx:i.MZ,data:i.MZ,props:i.MZ,attrs:i.MZ,slots:i.MZ,refs:i.MZ,setupState:i.MZ,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=lt.bind(null,a),e.ce&&e.ce(a),a}(e,o,l);if(U(e)&&(u.ctx.renderer=ie),function(e,t=!1,n=!1){t&&Kt(t);const{props:o,children:l}=e.vnode,c=Zt(e);!function(e,t,n,i=!1){const s={},o=Ne();e.propsDefaults=Object.create(null),Oe(e,t,s,o);for(const t in e.propsOptions[0])t in s||(s[t]=void 0);n?e.props=i?s:(0,r.Gc)(s):e.type.props?e.props=s:e.props=o,e.attrs=o}(e,o,c,t),Ge(e,l,n||t);const d=c?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,fe);const{setup:o}=n;if(o){(0,r.C4)();const n=e.setupContext=o.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,rn),slots:e.slots,emit:e.emit,expose:t}}(e):null,l=Wt(e),c=s(o,e,0,[e.props,n]),d=(0,i.yL)(c);if((0,r.bl)(),l(),!d&&!e.sp||F(e)||B(e),d){if(c.then(Yt,Yt),t)return c.then(n=>{tn(e,n,t)}).catch(t=>{a(t,e,0)});e.asyncDep=c}else tn(e,c,t)}else nn(e,t)}(e,t):void 0;t&&Kt(!1)}(u,!1,d),u.asyncDep){if(l&&l.registerDep(u,q,d),!e.el){const r=u.subTree=Et(vt);k(null,r,t,n),e.placeholder=r.el}}else q(u,e,t,n,l,c,d)},j=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:i,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!(!i&&!a||a&&a.$stable)||r!==o&&(r?!o||mt(r,o,c):!!o);if(1024&l)return!0;if(16&l)return r?mt(r,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]!==r[n]&&!ut(c,n))return!0}}return!1}(e,t,n)){if(r.asyncDep&&!r.asyncResolved)return void $(r,t,n);r.next=t,r.update()}else t.el=e.el,r.vnode=t},q=(e,t,n,s,o,a,l)=>{const c=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:d}=e;{const n=Je(e);if(n)return t&&(t.el=d.el,$(e,t,l)),void n.asyncDep.then(()=>{e.isUnmounted||c()})}let u,h=t;Ze(e,!1),t?(t.el=d.el,$(e,t,l)):t=d,n&&(0,i.DY)(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Ft(u,s,t,d),Ze(e,!0);const p=ht(e),m=e.subTree;e.subTree=p,w(m,p,f(m.el),te(m),e,o,a),t.el=p.el,null===h&&function({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),r&&Ke(r,o),(u=t.props&&t.props.onVnodeUpdated)&&Ke(()=>Ft(u,s,t,d),o)}else{let r;const{el:l,props:c}=t,{bm:d,m:u,parent:h,root:p,type:f}=e,m=F(t);if(Ze(e,!1),d&&(0,i.DY)(d),!m&&(r=c&&c.onVnodeBeforeMount)&&Ft(r,h,t),Ze(e,!0),l&&oe){const t=()=>{e.subTree=ht(e),oe(l,e.subTree,e,o,null)};m&&f.__asyncHydrate?f.__asyncHydrate(l,e,t):t()}else{p.ce&&!1!==p.ce._def.shadowRoot&&p.ce._injectChildStyle(f);const r=e.subTree=ht(e);w(null,r,n,s,e,o,a),t.el=r.el}if(u&&Ke(u,o),!m&&(r=c&&c.onVnodeMounted)){const e=t;Ke(()=>Ft(r,h,e),o)}(256&t.shapeFlag||h&&F(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&Ke(e.a,o),e.isMounted=!0,t=n=s=null}};e.scope.on();const d=e.effect=new r.X2(c);e.scope.off();const u=e.update=d.run.bind(d),h=e.job=d.runIfDirty.bind(d);h.i=e,h.id=e.uid,d.scheduler=()=>_(h),Ze(e,!0),u()},$=(e,t,n)=>{t.component=e;const s=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:l}}=e,c=(0,r.ux)(o),[d]=e.propsOptions;let u=!1;if(!(s||l>0)||16&l){let r;Oe(e,t,o,a)&&(u=!0);for(const s in c)t&&((0,i.$3)(t,s)||(r=(0,i.Tg)(s))!==s&&(0,i.$3)(t,r))||(d?!n||void 0===n[s]&&void 0===n[r]||(o[s]=Ie(d,c,s,void 0,e,!0)):delete o[s]);if(a!==c)for(const e in a)t&&(0,i.$3)(t,e)||(delete a[e],u=!0)}else if(8&l){const n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let s=n[r];if(ut(e.emitsOptions,s))continue;const l=t[s];if(d)if((0,i.$3)(a,s))l!==a[s]&&(a[s]=l,u=!0);else{const t=(0,i.PT)(s);o[t]=Ie(d,c,t,l,e,!1)}else l!==a[s]&&(a[s]=l,u=!0)}}u&&(0,r.hZ)(e.attrs,"set","")}(e,t.props,s,n),Xe(e,t.children,n),(0,r.C4)(),b(e),(0,r.bl)()},G=(e,t,n,r,i,s,o,a,l=!1)=>{const c=e&&e.children,d=e?e.shapeFlag:0,u=t.children,{patchFlag:h,shapeFlag:f}=t;if(h>0){if(128&h)return void K(c,u,n,r,i,s,o,a,l);if(256&h)return void X(c,u,n,r,i,s,o,a,l)}8&f?(16&d&&ee(c,i,s),u!==c&&p(n,u)):16&d?16&f?K(c,u,n,r,i,s,o,a,l):ee(c,i,s,!0):(8&d&&p(n,""),16&f&&R(u,n,r,i,s,o,a,l))},X=(e,t,n,r,s,o,a,l,c)=>{e=e||i.Oj,t=t||i.Oj;const d=e.length,u=t.length,h=Math.min(d,u);let p;for(p=0;p<h;p++){const r=t[p]=c?Ht(t[p]):Vt(t[p]);w(e[p],r,n,null,s,o,a,l,c)}d>u?ee(e,s,o,!0,!1,h):R(t,n,r,s,o,a,l,c,h)},K=(e,t,n,r,s,o,a,l,c)=>{let d=0;const u=t.length;let h=e.length-1,p=u-1;for(;d<=h&&d<=p;){const r=e[d],i=t[d]=c?Ht(t[d]):Vt(t[d]);if(!At(r,i))break;w(r,i,n,null,s,o,a,l,c),d++}for(;d<=h&&d<=p;){const r=e[h],i=t[p]=c?Ht(t[p]):Vt(t[p]);if(!At(r,i))break;w(r,i,n,null,s,o,a,l,c),h--,p--}if(d>h){if(d<=p){const e=p+1,i=e<u?t[e].el:r;for(;d<=p;)w(null,t[d]=c?Ht(t[d]):Vt(t[d]),n,i,s,o,a,l,c),d++}}else if(d>p)for(;d<=h;)Y(e[d],s,o,!0),d++;else{const f=d,m=d,_=new Map;for(d=m;d<=p;d++){const e=t[d]=c?Ht(t[d]):Vt(t[d]);null!=e.key&&_.set(e.key,d)}let g,b=0;const v=p-m+1;let y=!1,x=0;const k=new Array(v);for(d=0;d<v;d++)k[d]=0;for(d=f;d<=h;d++){const r=e[d];if(b>=v){Y(r,s,o,!0);continue}let i;if(null!=r.key)i=_.get(r.key);else for(g=m;g<=p;g++)if(0===k[g-m]&&At(r,t[g])){i=g;break}void 0===i?Y(r,s,o,!0):(k[i-m]=d+1,i>=x?x=i:y=!0,w(r,t[i],n,null,s,o,a,l,c),b++)}const S=y?function(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const l=e[r];if(0!==l){if(i=n[n.length-1],e[i]<l){t[r]=i,n.push(r);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[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}(k):i.Oj;for(g=S.length-1,d=v-1;d>=0;d--){const e=m+d,i=t[e],h=t[e+1],p=e+1<u?h.el||h.placeholder:r;0===k[d]?w(null,i,n,p,s,o,a,l,c):y&&(g<0||d!==S[g]?W(i,n,p,2):g--)}}},W=(e,t,r,i,s=null)=>{const{el:a,type:l,transition:c,children:d,shapeFlag:u}=e;if(6&u)W(e.component.subTree,t,r,i);else if(128&u)e.suspense.move(t,r,i);else if(64&u)l.move(e,t,r,ie);else if(l!==gt)if(l!==yt)if(2!==i&&1&u&&c)if(0===i)c.beforeEnter(a),n(a,t,r),Ke(()=>c.enter(a),s);else{const{leave:i,delayLeave:s,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?o(a):n(a,t,r)},u=()=>{a._isLeaving&&a[L](!0),i(a,()=>{d(),l&&l()})};s?s(a,d,u):u()}else n(a,t,r);else(({el:e,anchor:t},r,i)=>{let s;for(;e&&e!==t;)s=m(e),n(e,r,i),e=s;n(t,r,i)})(e,t,r);else{n(a,t,r);for(let e=0;e<d.length;e++)W(d[e],t,r,i);n(e.anchor,t,r)}},Y=(e,t,n,i=!1,s=!1)=>{const{type:o,props:a,ref:l,children:c,dynamicChildren:d,shapeFlag:u,patchFlag:h,dirs:p,cacheIndex:f}=e;if(-2===h&&(s=!1),null!=l&&((0,r.C4)(),H(l,null,n,e,!0),(0,r.bl)()),null!=f&&(t.renderCache[f]=void 0),256&u)return void t.ctx.deactivate(e);const m=1&u&&p,_=!F(e);let g;if(_&&(g=a&&a.onVnodeBeforeUnmount)&&Ft(g,t,e),6&u)J(e.component,n,i);else{if(128&u)return void e.suspense.unmount(n,i);m&&M(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,ie,i):d&&!d.hasOnce&&(o!==gt||h>0&&64&h)?ee(d,t,n,!1,!0):(o===gt&&384&h||!s&&16&u)&&ee(c,t,n),i&&Z(e)}(_&&(g=a&&a.onVnodeUnmounted)||m)&&Ke(()=>{g&&Ft(g,t,e),m&&M(e,null,t,"unmounted")},n)},Z=e=>{const{type:t,el:n,anchor:r,transition:i}=e;if(t===gt)return void Q(n,r);if(t===yt)return void C(e);const s=()=>{o(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){const{leave:t,delayLeave:r}=i,o=()=>t(n,s);r?r(e.el,s,o):o()}else s()},Q=(e,t)=>{let n;for(;e!==t;)n=m(e),o(e),e=n;o(t)},J=(e,t,n)=>{const{bum:r,scope:s,job:o,subTree:a,um:l,m:c,a:d}=e;et(c),et(d),r&&(0,i.DY)(r),s.stop(),o&&(o.flags|=8,Y(a,e,t,n)),l&&Ke(l,t),Ke(()=>{e.isUnmounted=!0},t)},ee=(e,t,n,r=!1,i=!1,s=0)=>{for(let o=s;o<e.length;o++)Y(e[o],t,n,r,i)},te=e=>{if(6&e.shapeFlag)return te(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=m(e.anchor||e.el),n=t&&t[T];return n?m(n):t};let ne=!1;const re=(e,t,n)=>{null==e?t._vnode&&Y(t._vnode,null,null,!0):w(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ne||(ne=!0,b(),v(),ne=!1)},ie={p:w,um:Y,m:W,r:Z,mt:V,mc:R,pc:G,pbc:E,n:te,o:e};let se,oe;return t&&([se,oe]=t(ie)),{render:re,hydrate:se,createApp:ze(re,se)}}(e)}function Ye({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 Ze({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Qe(e,t,n=!1){const r=e.children,s=t.children;if((0,i.cy)(r)&&(0,i.cy)(s))for(let e=0;e<r.length;e++){const t=r[e];let i=s[e];1&i.shapeFlag&&!i.dynamicChildren&&((i.patchFlag<=0||32===i.patchFlag)&&(i=s[e]=Ht(s[e]),i.el=t.el),n||-2===i.patchFlag||Qe(t,i)),i.type===bt&&-1!==i.patchFlag&&(i.el=t.el),i.type!==vt||i.el||(i.el=t.el)}}function Je(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Je(t)}function et(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const tt=Symbol.for("v-scx"),nt=()=>Pe(tt);function rt(e,t,n){return it(e,t,n)}function it(e,t,n=i.MZ){const{immediate:s,deep:a,flush:l,once:c}=n,d=(0,i.X$)({},n),u=t&&s||!t&&"post"!==l;let h;if(en)if("sync"===l){const e=nt();h=e.__watcherHandles||(e.__watcherHandles=[])}else if(!u){const e=()=>{};return e.stop=i.tE,e.resume=i.tE,e.pause=i.tE,e}const p=$t;d.call=(e,t,n)=>o(e,p,t,n);let f=!1;"post"===l?d.scheduler=e=>{Ke(e,p&&p.suspense)}:"sync"!==l&&(f=!0,d.scheduler=(e,t)=>{t?e():_(e)}),d.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};const m=(0,r.wB)(e,t,d);return en&&(h?h.push(m):u&&m()),m}function st(e,t,n){const r=this.proxy,s=(0,i.Kg)(e)?e.includes(".")?ot(r,e):()=>r[e]:e.bind(r,r);let o;(0,i.Tn)(t)?o=t:(o=t.handler,n=t);const a=Wt(this),l=it(s,o.bind(r),n);return a(),l}function ot(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 at=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${(0,i.PT)(t)}Modifiers`]||e[`${(0,i.Tg)(t)}Modifiers`];function lt(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||i.MZ;let s=n;const a=t.startsWith("update:"),l=a&&at(r,t.slice(7));let c;l&&(l.trim&&(s=n.map(e=>(0,i.Kg)(e)?e.trim():e)),l.number&&(s=n.map(i.bB)));let d=r[c=(0,i.rU)(t)]||r[c=(0,i.rU)((0,i.PT)(t))];!d&&a&&(d=r[c=(0,i.rU)((0,i.Tg)(t))]),d&&o(d,e,6,s);const u=r[c+"Once"];if(u){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,o(u,e,6,s)}}const ct=new WeakMap;function dt(e,t,n=!1){const r=n?ct:t.emitsCache,s=r.get(e);if(void 0!==s)return s;const o=e.emits;let a={},l=!1;if(!(0,i.Tn)(e)){const r=e=>{const n=dt(e,t,!0);n&&(l=!0,(0,i.X$)(a,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return o||l?((0,i.cy)(o)?o.forEach(e=>a[e]=null):(0,i.X$)(a,o),(0,i.Gv)(e)&&r.set(e,a),a):((0,i.Gv)(e)&&r.set(e,null),null)}function ut(e,t){return!(!e||!(0,i.Mp)(t))&&(t=t.slice(2).replace(/Once$/,""),(0,i.$3)(e,t[0].toLowerCase()+t.slice(1))||(0,i.$3)(e,(0,i.Tg)(t))||(0,i.$3)(e,t))}function ht(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:l,attrs:c,emit:d,render:u,renderCache:h,props:p,data:f,setupState:m,ctx:_,inheritAttrs:g}=e,b=S(e);let v,y;try{if(4&n.shapeFlag){const e=s||r,t=e;v=Vt(u.call(t,e,h,p,m,f,_)),y=c}else{const e=t;v=Vt(e.length>1?e(p,{attrs:c,slots:l,emit:d}):e(p,null)),y=t.props?c:pt(c)}}catch(t){wt.length=0,a(t,e,1),v=Et(vt)}let w=v;if(y&&!1!==g){const e=Object.keys(y),{shapeFlag:t}=w;e.length&&7&t&&(o&&e.some(i.CP)&&(y=ft(y,o)),w=Ot(w,y,!1,!0))}return n.dirs&&(w=Ot(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(n.dirs):n.dirs),n.transition&&E(w,n.transition),v=w,S(b),v}const pt=e=>{let t;for(const n in e)("class"===n||"style"===n||(0,i.Mp)(n))&&((t||(t={}))[n]=e[n]);return t},ft=(e,t)=>{const n={};for(const r in e)(0,i.CP)(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function mt(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(t[s]!==e[s]&&!ut(n,s))return!0}return!1}const _t=e=>e.__isSuspense;const gt=Symbol.for("v-fgt"),bt=Symbol.for("v-txt"),vt=Symbol.for("v-cmt"),yt=Symbol.for("v-stc"),wt=[];let xt=null;function kt(e=!1){wt.push(xt=e?null:[])}let St=1;function Ct(e,t=!1){St+=e,e<0&&xt&&t&&(xt.hasOnce=!0)}function Mt(e){return e.dynamicChildren=St>0?xt||i.Oj:null,wt.pop(),xt=wt[wt.length-1]||null,St>0&&xt&&xt.push(e),e}function Tt(e,t,n,r,i,s){return Mt(Nt(e,t,n,r,i,s,!0))}function Lt(e,t,n,r,i){return Mt(Et(e,t,n,r,i,!0))}function zt(e){return!!e&&!0===e.__v_isVNode}function At(e,t){return e.type===t.type&&e.key===t.key}const Pt=({key:e})=>null!=e?e:null,Rt=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?(0,i.Kg)(e)||(0,r.i9)(e)||(0,i.Tn)(e)?{i:x,r:e,k:t,f:!!n}:e:null);function Nt(e,t=null,n=null,r=0,s=null,o=(e===gt?0:1),a=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Pt(t),ref:t&&Rt(t),scopeId:k,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:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:x};return l?(jt(c,n),128&o&&e.normalize(c)):n&&(c.shapeFlag|=(0,i.Kg)(n)?8:16),St>0&&!a&&xt&&(c.patchFlag>0||6&o)&&32!==c.patchFlag&&xt.push(c),c}const Et=function(e,t=null,n=null,s=0,o=null,a=!1){if(e&&e!==ae||(e=vt),zt(e)){const r=Ot(e,t,!0);return n&&jt(r,n),St>0&&!a&&xt&&(6&r.shapeFlag?xt[xt.indexOf(e)]=r:xt.push(r)),r.patchFlag=-2,r}if(l=e,(0,i.Tn)(l)&&"__vccOpts"in l&&(e=e.__vccOpts),t){t=function(e){return e?(0,r.ju)(e)||Ee(e)?(0,i.X$)({},e):e:null}(t);let{class:e,style:n}=t;e&&!(0,i.Kg)(e)&&(t.class=(0,i.C4)(e)),(0,i.Gv)(n)&&((0,r.ju)(n)&&!(0,i.cy)(n)&&(n=(0,i.X$)({},n)),t.style=(0,i.Tr)(n))}var l;return Nt(e,t,n,s,o,(0,i.Kg)(e)?1:_t(e)?128:(e=>e.__isTeleport)(e)?64:(0,i.Gv)(e)?4:(0,i.Tn)(e)?2:0,a,!0)};function Ot(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:a,children:l,transition:c}=e,d=t?function(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)if("class"===e)t.class!==r.class&&(t.class=(0,i.C4)([t.class,r.class]));else if("style"===e)t.style=(0,i.Tr)([t.style,r.style]);else if((0,i.Mp)(e)){const n=t[e],s=r[e];!s||n===s||(0,i.cy)(n)&&n.includes(s)||(t[e]=n?[].concat(n,s):s)}else""!==e&&(t[e]=r[e])}return t}(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Pt(d),ref:t&&t.ref?n&&o?(0,i.cy)(o)?o.concat(Rt(t)):[o,Rt(t)]:Rt(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==gt?-1===a?16:16|a:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ot(e.ssContent),ssFallback:e.ssFallback&&Ot(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&E(u,c.clone(u)),u}function It(e=" ",t=0){return Et(bt,null,e,t)}function Bt(e,t){const n=Et(yt,null,e);return n.staticCount=t,n}function Dt(e="",t=!1){return t?(kt(),Lt(vt,null,e)):Et(vt,null,e)}function Vt(e){return null==e||"boolean"==typeof e?Et(vt):(0,i.cy)(e)?Et(gt,null,e.slice()):zt(e)?Ht(e):Et(bt,null,String(e))}function Ht(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ot(e)}function jt(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if((0,i.cy)(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),jt(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||Ee(t)?3===r&&x&&(1===x.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=x}}else(0,i.Tn)(t)?(t={default:t,_ctx:x},n=32):(t=String(t),64&r?(n=16,t=[It(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ft(e,t,n,r=null){o(e,t,7,[n,r])}const Ut=Te();let qt=0;let $t=null;const Gt=()=>$t||x;let Xt,Kt;{const e=(0,i.We)(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Xt=t("__VUE_INSTANCE_SETTERS__",e=>$t=e),Kt=t("__VUE_SSR_SETTERS__",e=>en=e)}const Wt=e=>{const t=$t;return Xt(e),e.scope.on(),()=>{e.scope.off(),Xt(t)}},Yt=()=>{$t&&$t.scope.off(),Xt(null)};function Zt(e){return 4&e.vnode.shapeFlag}let Qt,Jt,en=!1;function tn(e,t,n){(0,i.Tn)(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:(0,i.Gv)(t)&&(e.setupState=(0,r.Pr)(t)),nn(e,n)}function nn(e,t,n){const s=e.type;if(!e.render){if(!t&&Qt&&!s.render){const t=s.template||ve(e).template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:o,compilerOptions:a}=s,l=(0,i.X$)((0,i.X$)({isCustomElement:n,delimiters:o},r),a);s.render=Qt(t,l)}}e.render=s.render||i.tE,Jt&&Jt(e)}{const t=Wt(e);(0,r.C4)();try{!function(e){const t=ve(e),n=e.proxy,s=e.ctx;_e=!1,t.beforeCreate&&ge(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:l,watch:c,provide:d,inject:u,created:h,beforeMount:p,mounted:f,beforeUpdate:m,updated:_,activated:g,deactivated:b,beforeDestroy:v,beforeUnmount:y,destroyed:w,unmounted:x,render:k,renderTracked:S,renderTriggered:C,errorCaptured:M,serverPrefetch:T,expose:L,inheritAttrs:z,components:A,directives:P,filters:R}=t;if(u&&function(e,t){(0,i.cy)(e)&&(e=ke(e));for(const n in e){const s=e[n];let o;o=(0,i.Gv)(s)?"default"in s?Pe(s.from||n,s.default,!0):Pe(s.from||n):Pe(s),(0,r.i9)(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(u,s),l)for(const e in l){const t=l[e];(0,i.Tn)(t)&&(s[e]=t.bind(n))}if(o){const t=o.call(n,n);(0,i.Gv)(t)&&(e.data=(0,r.Kh)(t))}if(_e=!0,a)for(const e in a){const t=a[e],r=(0,i.Tn)(t)?t.bind(n,n):(0,i.Tn)(t.get)?t.get.bind(n,n):i.tE,o=!(0,i.Tn)(t)&&(0,i.Tn)(t.set)?t.set.bind(n):i.tE,l=on({get:r,set:o});Object.defineProperty(s,e,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e})}if(c)for(const e in c)be(c[e],s,n,e);if(d){const e=(0,i.Tn)(d)?d.call(n):d;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if($t){let n=$t.provides;const r=$t.parent&&$t.parent.provides;r===n&&(n=$t.provides=Object.create(r)),n[e]=t}}(t,e[t])})}function N(e,t){(0,i.cy)(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(h&&ge(h,e,"c"),N(Y,p),N(Z,f),N(Q,m),N(J,_),N(q,g),N($,b),N(se,M),N(ie,S),N(re,C),N(ee,y),N(te,x),N(ne,T),(0,i.cy)(L))if(L.length){const t=e.exposed||(e.exposed={});L.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===i.tE&&(e.render=k),null!=z&&(e.inheritAttrs=z),A&&(e.components=A),P&&(e.directives=P),T&&B(e)}(e)}finally{(0,r.bl)(),t()}}}const rn={get:(e,t)=>((0,r.u4)(e,"get",""),e[t])};function sn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy((0,r.Pr)((0,r.IG)(e.exposed)),{get:(t,n)=>n in t?t[n]:n in he?he[n](e):void 0,has:(e,t)=>t in e||t in he})):e.proxy}const on=(e,t)=>(0,r.EW)(e,t,en),an="3.5.21"},4412:(e,t,n)=>{"use strict";n.d(t,{PI:()=>u,C6:()=>d,vk:()=>h});var r=n(7633),i=n(4089),s=n(6996),o=n(1717),a=n(3755),l=n(4031),c=n(5955);class d extends l.K{_record;_resolve;_status=s.yn.pending;_p=Promise.resolve();_prev_tip_remove;get meta(){return d.meta}get status(){return this._status}constructor(e,t){const n=a.F.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,[s.yn.pending,s.yn.playing].includes(this.status)&&e()})}clear_message(){this._prev_tip_remove&&this._prev_tip_remove()}async play(){const e=a.F.tips;this.clear_message(),this.status!==s.yn.stop&&(this._status=s.yn.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 c.I.sleep(this.config.data.player_speed),await(0,i.dY)(),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(0,i.dY)(),this.history.record(t),await this.waiting()}this._status=s.yn.stop,this.clear_message(),this.stats.showing=!1,e?.tip_success("演示完毕",9e3)}pause(){const e=a.F.tips;this.clear_message(),this._status!==s.yn.stop&&(this._status=s.yn.pause,this.stats.showing=!1,this._prev_tip_remove=e?.tip_info("暂停演示,点此恢复",1/0,this.continue.bind(this)))}continue(){const e=a.F.tips;this.clear_message(),this._status!==s.yn.stop&&(this._resolve&&this._resolve(),this._status=s.yn.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:s.Mu.player,version:1}}}class u extends o.K{stack_undo=(0,r.Gc)([]);stack_redo=(0,r.Gc)([]);get meta(){return u.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=t.then(()=>{(0,i.dY)(()=>this.courier.pass(n))})}undo(){const e=a.F.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=a.F.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 d(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 r=new Blob([JSON.stringify(t)],{type:"text/plain"});n.href=URL.createObjectURL(r),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:s.Mu.history,version:1}}}class h{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((0,r.ux)(e)))}add_recover(e){e&&this.undo.unshift(e)}pass(e){let t=this.courier.pass(e);t instanceof h&&this.merge(t)}tick(e,t){(0,i.dY)(()=>{t?this.tell(t,e):this.courier.pass(e)})}tell(e,...t){const n=a.F.tips;if(this.courier.stats.mode===s.fv.read)return n?.tip_info("只读模式不可操作"),this;for(let n of t){if(!e||e.id!==n.id)return this;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)}return this}merge(e){return e instanceof h?(this.do.push(...structuredClone((0,r.ux)(e.stack_do))),this.undo.unshift(...structuredClone((0,r.ux)(e.stack_undo))),this):this}}},4709:(e,t,n)=>{"use strict";n.d(t,{w:()=>v});var r=n(7633),i=n(4089),s=n(1556),o=n(6996),a=n(2547),l=n(4412),c=n(5955),d=n(2819),u=n(9164),h=n(1068);class p{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:r}=e.config.data,i=e.bound,{pos_tree:s,size_bound:o}=i;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*r),c+=n.size_tree.height}}static left(e,t){const{map_node_hgap:n,map_node_vgap:r}=e.config.data,i=e.bound,{pos_tree:s,size_bound:o,size_tree:a}=i;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*r),d+=n.size_tree.height}}static down(e,t){const{map_node_hgap:n,map_node_vgap:r}=e.config.data,i=e.bound,{pos_tree:s,size_bound:o}=i;let a=s.x,l=s.y+r+o.height,c=0;for(let e=0;e<t.length;e++){const r=t[e].bound;r.update_pos_tree(a+c+e*n,l),c+=r.size_tree.width}}static up(e,t){const{map_node_hgap:n,map_node_vgap:r}=e.config.data,i=e.bound,{pos_tree:s,size_bound:o,size_tree:a}=i;let l=s.x,c=s.y+a.height-o.height-r,d=0;for(let e=0;e<t.length;e++){const r=t[e].bound;r.update_pos_tree(l+d+e*n,c-r.size_tree.height),d+=r.size_tree.width}}static time_right(e,t){const{map_node_hgap:n,map_node_vgap:r}=e.config.data,i=e.bound,{pos:s,size_bound:o}=i,{sum_tree_height:a,sum_tree_width:l,max_tree_height:c,max_tree_width:d,mw_rect:u,mh_rect:h}=e.bound.stat_downstream_nodes_size(t);let p=s.x+o.width+n,f=s.y+o.height/2,m=0;for(let e=0;e<t.length;e++){const r=t[e],i=r.bound,{size_bound:s,size_tree:o}=i,a=r.attrs.layout;"right"===a||"left"===a?i.update_pos_tree(p+m+e*n,f-o.height/2):"up"===a?i.update_pos_tree(p+m+e*n,f-(o.height-s.height/2)):i.update_pos_tree(p+m+e*n,f-s.height/2),m+=i.size_tree.width}}static time_down(e,t){const{map_node_vgap:n}=e.config.data,r=e.bound,{pos:i,size_bound:s}=r,{sum_tree_height:o,sum_tree_width:a,max_tree_height:l,max_tree_width:c,mw_rect:d,mh_rect:u}=e.bound.stat_downstream_nodes_size(t);Math.max(d.width,s.width);let h=i.x+s.width/2,p=i.y+s.height+n,f=0;for(let e=0;e<t.length;e++){const r=t[e],i=r.bound,s=r.attrs.layout,{size_bound:o,size_tree:a}=i;"left"===s?i.update_pos_tree(h-(a.width-o.width/2),p+f+e*n):"down"===s||"up"===s?i.update_pos_tree(h-a.width/2,p+f+e*n):i.update_pos_tree(h-o.width/2,p+f+e*n),f+=i.size_tree.height}}}var f=n(6094),m=n(1150),_=n(3214);class g{_node;_map;_bound;_env=(0,r.Kh)({upstream:void 0,downstream:[],layout:null});_all_downstream_nodes=(0,i.EW)(()=>this.get_layout_downstream_nodes());_siblings_info=(0,i.EW)(()=>this.get_siblings_info());_layout_line=(0,i.EW)(()=>{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[]});_folded_upstream=(0,i.EW)(()=>{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(){return[...this._layout_line.value]}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}=a.U.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 b{_node;_map;_in_view=(0,r.KR)(!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=(0,i.wB)(()=>this.show,(e,t)=>{this._map.set_graph_visible(this.node,e),this.node.check_show_line()},{immediate:!0}),this._watcher_line=(0,i.wB)(()=>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;h.MathRect.check_intersection(e,this.node.rect)?this.in_view=!0:this.in_view=!1}}class v extends _.M{_editable=(0,r.KR)(!1);_waiter=new Set;_layout_self_success=!1;_show=(0,r.KR)(!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=(0,r.Kh)({type:"rect",path:"",sample:[]});constructor(e,t){super(e,t),this.pcube=t,this._init_handler(),this._env=new g(this),this._checker=new b(this),this.bound=new s.yI(this,e.attrs.matrix2d||a.c.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=(0,i.EW)(()=>{if(this.is_layout_root||!this.env.upstream){const e={x:this.matrix2d.e,y:this.matrix2d.f};return a.U.offset_points(this.shape.sample,e)}return a.U.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,r=u.U.in_tail(n.id,0);t.tell(n,r),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:r,e:i,f:s}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return a.c.get_dom_string(this.matrix2d);{const i=this.bound.pos;return`matrix(${e.toFixed(1)},${t},${n},${r.toFixed(1)},${i.x.toFixed(1)},${i.y.toFixed(1)})`}}get matrix2d_real(){const{a:e,b:t,c:n,d:r,e:i,f:s}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return{...this.matrix2d};{const i=this.bound.pos;return{a:e,b:t,c:n,d:r,e:i.x,f:i.y}}}_init_handler(){this.set_cmd_handler(o.zS.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(o.zS.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(o.zS.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(o.zS.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(o.zS.cube_insert_child,this.on_insert_child.bind(this)),this.set_cmd_handler(o.s1.append_child,this.on_append_child.bind(this)),this.set_cmd_handler(o.s1.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 s.gv||t instanceof s.EU)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}move_to_center(){const e=this.pcube.get_view_center(),t=this.pcube.transform_point(e),n=this.bound.pos_center,r=this.pcube.real_point_to_fig(n),i=t.x-r.x,s=t.y-r.y,o=a.c.multiply(this.pcube.matrix2d,a.c.get_matrix_translate(i,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:r}=h.MathRect.move_rect_in_other(this.bound.rect,t),i=a.c.multiply(e.matrix2d,a.c.get_matrix_translate(n,r));e.reset_matrix(i),e.check_show()}check_in_fig_view(e=!1){const t=this.pcube.view_rect;return e?h.MathRect.can_contain(t,this.rect):h.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(p.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=h.Notice.throttle(this.layout.bind(this),50);layout_self(e){const t=e.borderBoxSize[0];if(!t)return;const{blockSize:n,inlineSize:r}=t,i=this.bound.size;if(this.layout_self_success&&Math.abs(i.width-r)<this.mis&&Math.abs(i.height-n)<this.mis)return;this._layout_self_success=!0;const o={width:Math.ceil(r),height:Math.ceil(n)};this.bound.update_size(o.width,o.height),this.shape.path=s.AG.get_shaple(this),this.shape.sample=this.get_sample(),!this.env.upstream&&this.pcube.perf&&this.check_show(),this.checker.start_watcher();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=a.U.get_linker_id(e,t),r=this.pcube.get_linker(n);r&&(this.attrs.fold?r.show=!1:r.to_node?.show||this.show?r.show=!0:r.show=!1)}for(let t of this.from){const n=a.U.get_linker_id(t,e),r=this.pcube.get_linker(n);r&&(this.show||r.from_node?.show?r.show=!0:r.show=!1)}}get_sample(){if("rect"===this.shape.type){const e={x:0,y:0,...this.bound.size_bound},t=h.MathRect.get_rect_point;return[t(e,h._RectPosition.left_top),t(e,h._RectPosition.top_mid),t(e,h._RectPosition.right_top),t(e,h._RectPosition.right_mid),t(e,h._RectPosition.right_bottom),t(e,h._RectPosition.bottom_mid),t(e,h._RectPosition.left_bottom),t(e,h._RectPosition.left_mid),t(e,h._RectPosition.left_top)]}return a.U.svg_path_sample(this.shape.path,this.sample_count)}gc(){this.checker.gc(),this.base_gc()}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)i.push(e.export());return{children:r,data:i}}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=a.c.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 v&&t.break_link_node(this.id)}for(let e of this.to){const t=this.pcube.find_child_cube(e);t&&t instanceof v&&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,r=t.get_recorder();r.add_cmd(e);const i=this.export().info,s=c.I.build_cubes(n,this);return this.splice(0,this.child_count,...s),r.add_recover(d.V.reset(this.id,i)),r}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,o=this.find_child_cube(i);if(!o||o.index===s)return;const a=new l.vk(t);let c=0,u=o.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(u,1),this.splice(c,0,o),a.add_recover(d.V.reorder(this.id,o.id,u)),a}on_insert_child(e){const{courier:t}=this,n=t.get_recorder();n.add_cmd(e);const{pos:r,data:i}=e;if(0===i.length)return n;const a=[];for(let e of i)e.type===o.u0.box_root&&a.push(new s.HR(e,this));let l=this.get_valid_index(r);this.splice(l,0,...a);const c=a[a.length-1];return c&&n.tell(c,u.U.in_tail(c.id,0)),n.add_recover(d.V.delete_child(this.id,"backward",[l,l+a.length])),n}on_delete_cube(e){const{courier:t,pcube:n,pid:r}=this,{dir:i,range:o}=e,[a,l]=o,c=t.get_recorder();c.add_cmd(e);const h=this.children[a-1],p=this.children[l],f=l-a;if(a!==l){if(a<=0&&l>=this.child_count){this.child_first,c.tell(this,d.V.reset(this.id,[]));const e=d.V.insert_child(this.id,[s.HR.get_default()],0);return c.tell(this,e),c}{let e=this.splice(a,f);h&&"backward"===i||!p?c.tell(h,u.U.in_tail(h.id,0)):(p&&"forward"===i||!h)&&c.tell(p,u.U.in_head(p.id,0));const t=e.data;c.add_recover(d.V.insert_child(this.id,t,a))}return c}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r,pcube:i}=this,s=new l.vk(t),{data:o,end_id:a,start_id:c,offset_end:h,offset_start:p}=e,f=this.find_cube(c),m=this.find_cube(a),_=f?.find_upstream_untill(this),g=m?.find_upstream_untill(this);if(!_||!g)return s;if(m!==f||p!==h)if(_&&_===g)s.tell(_,d.V.delete(_.id,"backward",c,a,p,h)),s.tell(_,d.V.insert(_.id,o,c,a,p,h));else{s.tell(g,d.V.delete(g.id,"backward",null,a,"head",h)),s.tell(this,d.V.delete_child(this.id,"backward",[_.index+1,g.index])),s.tell(this,d.V.insert_child(this.id,e.data,_.index+1)),s.tell(_,d.V.delete(_.id,"backward",c,null,p,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,u.U.in_tail(t.id,0))}}else s.tell(m,d.V.insert(a,o,c,a,p,h));return s}on_layout_update(e){const{courier:t,history:n}=this,{attrs:i}=e,s=t.get_recorder(),o=structuredClone((0,r.ux)(this.data.attrs));let a=!1;s.add_cmd(e);const l=this.attrs.fold;for(let e in i){const t=i[e];t!==this.attrs[e]&&(this.attrs[e]=t,a=!0)}if("matrix2d"in i&&i.matrix2d){const e=i.matrix2d;this.reset_matrix(e)}"fold"in i&&l!==i.fold&&(this.bound.flow("downstream"),this.bound.flow("upstream")),a&&(this.is_layout_root?(this.env.flow(),this.layout_throttle()):this.env.layout_root?.layout_throttle());const c=f.S.layout_change(this.id,o);return s.add_recover(c),s}on_append_child(e){const{courier:t,history:n,pcube:r}=this,{previd:i}=e,{map_node_hgap:o,map_node_vgap:l}=this.config.data,c=t.get_recorder(),d=this.node_last.bound,u={x:d.pos.x,y:d.pos.y+d.size_bound.height+l},h=s.gL.get_default(u),p=m.y.node_add(r.id,[h]);c.tell(r,p);const f=a.U.create_linker_info(this.pcube,this.id,h.id),_=m.y.linker_add(r.id,[f]);c.tell(r,_);const g=r.get_node_to(this.id),b=g?.indexOf(h.id);if(g&&void 0!==b&&b>=0)if(null===i)g.splice(b,1),g.unshift(h.id);else if(i){const e=g.indexOf(i);e>=0&&(g.splice(b,1),g.splice(e+1,0,h.id))}return c}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,r=t.view_point_to_real(e),i=v.get_default_node_size(n);return{x:r.x-i.width/2,y:r.y-i.height/2}}}},4784:(e,t,n)=>{"use strict";n.d(t,{M:()=>C});var r=n(7633),i=n(1556),s=n(4412),o=n(346),a=n(6996),l=n(2189),c=n(5391),d=n(3736),u=n(3513),h=n(3408),p=n(2742),f=n(3814),m=n(8147),_=n(443),g=n(2935),b=n(2277),v=n(1701),y=n(8219),w=n(3755),x=n(2819),k=n(9164),S=n(5955);class C extends l.j{_scopes=(0,r.Gc)(new Set);_dom;_children=(0,r.Gc)([]);_courier;_history;_cursor;_config;_clipboard;_painter;_event;_stats;_hotkeys;_cubes;_listener;_isdev=!1;constructor(){super(),this._cubes=new u.h(this),this._hotkeys=new h.Wu(this),this._config=new g.B(this),this._cursor=new b.P(this),this._courier=new v.W(this),this._history=new s.PI(this),this._clipboard=new _.F(this),this._painter=new m.W(this),this._event=new f.z(this),this._stats=new p.I(this),this._listener=new d.t(this),Promise.resolve().then(()=>this._cubes.add_cube(this)),this.set_cmd_handler(a.zS.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(a.zS.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(a.zS.cube_insert_child,this.on_insert_cube.bind(this)),this.set_cmd_handler(a.zS.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(a.zS.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(a.zS.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(a.zS.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(a.zS.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(a.K9.cursor_in_tail,this.on_cursor_in_tail.bind(this)),y.o.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 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),r=[];for(let e of n){let t=e.export();r.push(t)}return r}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 c.R(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 C)return w.F.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 C)return w.F.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=[],r=e?this.sort_scope():this.scope;for(let e of r)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,r=new s.vk(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 i=n?.next_cube;if(i&&n.type===i.type)return i.merge("left");if(n)return r.tell(n,k.U.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 i=n?.prev_cube;if(i&&n.type===i.type)return n.merge("left");if(n)return r.tell(n,k.U.in_tail(n.id))}}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)i.push(e.export());return{children:r,data:i}}get_sdk_version(){return o.K.get_sdk_meta()}on_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=this.export().info,s=S.I.build_cubes(n,this);return this.splice(0,this.child_count,...s),r.add_recover(x.V.reset(this.id,i)),r}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:o}=e,a=this.find_child_cube(i);if(!a||a.index===o)return;const l=new s.vk(t);let c=0,d=a.index;return"tail"===o?c=this.child_count:"number"==typeof o&&(c=o),this.splice(d,1),this.splice(c,0,a),l.add_recover(x.V.reorder(this.id,a.id,d)),l}on_insert_cube(e){const{courier:t}=this,n=t.get_recorder();n.add_cmd(e);const{pos:r,data:s}=e;if(0===s.length)return n;const o=[];for(let e of s)e.type===a.u0.box_root&&o.push(new i.HR(e,this));let l=this.get_valid_index(r);this.splice(l,0,...o);const c=o[o.length-1];return c&&n.tell(c,k.U.in_tail(c.id,0)),n.add_recover(x.V.delete_child(this.id,"backward",[l,l+o.length])),n}on_delete_cube(e){const{courier:t,pcube:n,pid:r}=this,{dir:i,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],u=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,x.V.delete_child(this.id,i,[1,this.child_count])),e.is_empty||l.tell(e,x.V.reset(e.id,[])),l}{let e=this.splice(o,u);c&&"backward"===i||!d?l.tell(c,k.U.in_tail(c.id,0)):(d&&"forward"===i||!c)&&l.tell(d,k.U.in_head(d.id,0));const t=e.data;l.add_recover(x.V.insert_child(this.id,t,o))}return l}}on_cube_set_selection_css(e){const{cursor:t,courier:n,pcube:r,pid:i}=this,{css:o,start_id:a,end_id:l,offset_end:c,offset_start:d}=e,u=new s.vk(n);if(a!==l||c!==d){if(l&&!a){const e=this.find_cube(l),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(t,x.V.set_selection_css(t.id,o,null,l,"head",c)),u}if(a&&!l){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(t,x.V.set_selection_css(t.id,o,a,null,d,"tail")),u}if("tail"===c&&"head"===d){for(let e of this.children)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u}if(l&&a){const e=this.find_cube(a),t=this.find_cube(l),n=e?.find_upstream_untill(this),r=t?.find_upstream_untill(this);if(!n||!r)return;const i=this.children.slice(n.index+1,r.index);for(let e of i)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(n,x.V.set_selection_css(n.id,o,a,null,d,"tail")),u.tell(r,x.V.set_selection_css(r.id,o,null,l,"head",c)),u}}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r,pcube:i}=this,o=new s.vk(t),{data:a,end_id:l,start_id:c,offset_end:d,offset_start:u}=e,h=this.find_cube(c),p=this.find_cube(l),f=h?.find_upstream_untill(this),m=p?.find_upstream_untill(this);if(!f||!m)return o;if(p!==h||u!==d)if(f&&f===m)o.tell(f,x.V.delete(f.id,"backward",c,l,u,d)),o.tell(f,x.V.insert(f.id,a,c,l,u,d));else{o.tell(m,x.V.delete(m.id,"backward",null,l,"head",d)),o.tell(this,x.V.delete_child(this.id,"backward",[f.index+1,m.index])),o.tell(this,x.V.insert_child(this.id,e.data,f.index+1)),o.tell(f,x.V.delete(f.id,"backward",c,null,u,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&o.tell(e,k.U.in_tail(t.id,0))}}else o.tell(p,x.V.insert(l,a,c,l,u,d));return o}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:r,start_id:o,end_id:a,offset_end:l,offset_start:c,reserve:d}=e,u=new s.vk(t);if(!o&&a){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t||!e)return;return u.tell(this,x.V.delete_child(this.id,r,[0,t.index])),u.tell(t,x.V.delete(t.id,r,o,a,"head",l)),u}if(o&&!a){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t||!e)return;return u.tell(this,x.V.delete_child(this.id,r,[t.index+1,this.child_count])),u.tell(t,x.V.delete(t.id,r,o,a,c,l)),u}if("head"===c&&"tail"===l)return u.tell(this,x.V.reset(this.id,[])),u;if(o&&a){const e=this.find_cube(o),t=this.find_cube(a);if(!(e instanceof i.P6&&t instanceof i.P6))return;const n=e.find_upstream_untill(this),s=t.find_upstream_untill(this);if(!n||!s)return u;const d=n.index,h=s.index;if(o!==a||c!==l)if(n===s)u.tell(n,x.V.delete(n.id,r,o,a,c,l,!0));else{u.tell(s,x.V.delete(s.id,r,null,a,"head",l)),u.tell(this,x.V.delete_child(this.id,"backward",[d+1,h])),u.tell(n,x.V.delete(n.id,r,o,null,c,"tail",!0));let t=0;if("number"==typeof c&&(t=c),u.tell(n,x.V.merge(n.id,"right",o,t)),n.is_empty)u.tell(this,x.V.delete_child(this.id,"backward",[n.index,n.index+1]));else if(e instanceof i.P6){const n=e.pcube;u.tell(n,x.V.merge(n.id,"right",o,t))}}return u}}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,s=t.get_recorder();if(s.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone((0,r.ux)(this.attrs[e]))||null,null===t?delete this.attrs[e]:this.attrs[e]=t}return s.add_recover(x.V.set_attr(this.id,o)),s}on_cursor_in_tail(e){const{offset:t}=e,{courier:n}=this,r=this.child_last,i=new s.vk(n);if(r)return i.tell(r,k.U.in_tail(r.id,t)),i}}},5391:(e,t,n)=>{"use strict";n.d(t,{R:()=>u});var r=n(7633),i=n(1556),s=n(8606),o=n(6996),a=n(1068),l=n(5955),c=n(4031),d=n(7744);class u extends c.K{_id=(0,s.Ak)();scroll_offset=100;_freeze=(0,r.KR)(!1);get meta(){return u.meta}get id(){return this._id}pos=(0,r.Kh)({x:0,y:0,width:0,height:0});css=(0,r.Kh)({});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 i.$u&&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 d.MR)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 d.MR)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=a.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=[],r=[];for(let t of this.selection_line){const i=t.level,s=t.index;i===e&&(n.push(t),r.push(s))}return{cube:t,range:[Math.min(...r),Math.max(...r)+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(...l.I.get_flat_cube(n.cube));for(let e of t)e instanceof i.gK&&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:o.Mu.scope,version:1}}}},5856:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}},5857:(e,t,n)=>{"use strict";n.d(t,{zS:()=>s,K9:()=>o,kU:()=>a,s1:()=>l,Mu:()=>r,u0:()=>i});var r=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}({}),i=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}({}),s=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}({}),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}({})},5955:(e,t,n)=>{"use strict";n.d(t,{I:()=>d,J:()=>u});var r=n(8606),i=n(7744),s=n(1556),o=n(346),a=n(6996),l=n(4412),c=n(3755);class d{static get_id(){return(0,r.Ak)()}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)),r=new Set(Object.keys(t)),i=new Set([...n,...r]);if(n.size!==i.size||n.size!==r.size)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}static is_same_attrs(e,t){let n=new Set(Object.keys(e)),r=new Set(Object.keys(t)),i=new Set([...n,...r]);if(n.size!==i.size||n.size!==r.size)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}async locate(e,t,n=!0){const{courier:r,history:s}=e,o=e.find_cube(t),a=c.F.tips;if(o instanceof i._D&&o.top){const e=o.top;if(o.find_upstream_untill(e)!==e.child_first){const t=r.get_recorder();t.tell(e,i.VL.fold(e.id,!1)),s.record(t)}}const l=document.getElementById(t);if(!l)return a?.tip_error("未发现书签锚点");let d=l.style.backgroundColor;l.style.backgroundColor="var(--locate-anchor-bg)",setTimeout(()=>{"var(--locate-anchor-bg)"===l.style.backgroundColor&&(l.style.backgroundColor=d)},3e3),n&&l.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 r of e){if(!r)continue;let e=o.K.find_cube(r.type);if(e)n.push(new e(r,t));else{const e=new s.Qm(r,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 n=o.K.metas_cube;let r=[],i=[],l=[],c=[],d=null,u=-1,h=-1,p=e,f=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.type===a.u0.box_root){p=e.slice(0,t),f=e.slice(t+1),d=n,c.push(d);break}}for(let e=0;e<p.length;e++){const t=p[e];n.get(t.type)?.block&&(u<0?u=e:h=e)}if(u>=0&&h>=0){const e=p.slice(0,u),t=p.slice(h+1),o=[];let a=s.gK.get_default();a.info=[];for(let e of p.slice(u,h+1))n.get(e.type)?.block?(o.push(e),a.info.length>0&&(o.push(a),a=s.gK.get_default(),a.info=[])):a.info.push(e);r=e,i=o,l=t}else u>=0&&h<0?(r=p.slice(0,u),i=p.slice(u,u+1),l=p.slice(u+1)):(r=p,i=[],l=[]);if(d){let e=s.gK.get_default();e.info=[];for(let t of f)t.type===a.u0.box_root?(d=t,c.push(t)):n.get(t.type)?.block?(t.type===a.u0.box?d.info.push(...t.info):d.info.push(t),e.info.length>0&&d&&(d.info.push(e),e=s.gK.get_default())):e.info.push(t);e.info.length>0&&d&&d.info.push(e)}const m=[];if(r.length>0&&m.push(s.gK.get_default(r)),i.length>0&&m.push(...i),l.length>0&&m.push(s.gK.get_default(l)),c.length>0)if(t)for(let e of c)m.push(...e.info);else m.push(...c);return{head:r,body:i,tail:l,root:c,sort:m}}static find_line(e,t="first"){if(e instanceof s.gK)return e;const n=o.K.metas_cube.get(e.type);if(!n||!n.block)return;const r="first"===t?e.children:e.children.reverse();for(let e of r){let n=this.find_line(e,t);if(n)return n}}static filter_out_empty(e){return e.filter(e=>!s.P6.is_empty_text(e))}static get_flat_cube(e,t=!0){const n=e.children,r=[];if(t)for(let e of n)r.push(e),r.push(...this.get_flat_cube(e));else{r.push(...n);for(let e of r)r.push(...e.children)}return r}static replace_id(e,t,n={}){const r=[];for(let i of t){const t=o.K.find_cube(i.type);t&&t.replace_id&&r.push(t.replace_id(e,i,n))}return r}static insert_cubes(e,t){const{courier:n,history:r,cursor:s}=e,{cube_selection:o,cube_start:a,cube_end:c,offset_end:d,offset_start:u}=s;if(!o||!a||!c)return;const h=new l.vk(n);s.has_selection&&h.tell(o,i.VL.delete(o.id,"backward",a.id,c.id,u,d)),h.tell(a,i.VL.insert(a.id,t,a.id,a.id,u,u)),r.record(h)}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 u{ps;resolve;reject;constructor(){this.ps=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}},5976:(e,t,n)=>{"use strict";n.d(t,{_:()=>f});var r=n(7633),i=n(6996),s=n(2189),o=n(8219),a=n(5955),l=n(4412),c=n(2819),d=n(9164),u=n(1556),h=n(4784),p=n(4709);class f extends s.j{_children=(0,r.Gc)([]);_has_postil=(0,r.KR)(!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 u.gK&&(e+="\n");return this instanceof u.gK&&(e+="\n"),e}get top(){let e=this;for(;e;){if(e.pcube instanceof h.M)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 u.$u?this:this.pcube.host_postil}get host_node(){let e=this.pcube;for(;e&&e instanceof f;){if("map"===e.domain&&e instanceof p.w)return e;e=e.pcube}}get in_postil(){return this instanceof u.$u||this.pcube.in_postil}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 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 f)return t;e=e.pcube}}get next_cube_deep(){let e=this;for(;e;){let t=e.next_cube;if(t instanceof f)return t;e=e.pcube}}get index(){return this.pcube?this.pcube.find_child_index(this.id):0}_setup(){this.set_cmd_handler(i.zS.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.zS.cube_insert,this.on_insert.bind(this)),this.set_cmd_handler(i.zS.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.zS.cube_set_css,this.on_cube_set_css.bind(this)),this.set_cmd_handler(i.zS.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(i.zS.cube_delete_adjacent,this.on_cube_delete_adjacent.bind(this)),this.set_cmd_handler(i.zS.cube_postil_add,this.on_postil_add.bind(this)),this.set_cmd_handler(i.zS.cube_postil_remove,this.on_postil_remove.bind(this)),this.set_cmd_handler(i.K9.cursor_in_head,this.on_cursor_in_head.bind(this)),this.set_cmd_handler(i.K9.cursor_in_tail,this.on_cursor_in_tail.bind(this)),o.o.init_cmd_handler(this)}setup(e,t){let n;try{n=structuredClone((0,r.ux)(e))}catch(n){return new u.Qm(e,t,"克隆数据失败")}if(!n)return new u.Qm(e,t,"克隆数据为空");try{const i=this.update_data(n);if(!i.data)return new u.Qm(e,t,"升级后数据为空");if(!i.usable)return new u.Qm(e,t,"高版本数据,请升级软件");this.data=(0,r.Kh)(i.data),this._setup(),this.build_child(i.data),this.cubes.add_cube(this)}catch(n){return new u.Qm(e,t,"数据升级失败")}return this}create_child_block(e){const t=a.I.pick(e);return a.I.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((0,r.ux)(this.data));return this.postil&&(e.attrs.postil=this.postil.export()),e}copy(e,t){const n=this.children.slice(e,t),r=[];for(let e of n){let t=e.export();r.push(t)}return r}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof u.gv||t instanceof u.EU)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}delete_edge(e,t){const{courier:n}=this,r=new l.vk(n);if("backward"===t){const t=e.prev_cube_deep,n=t?.next_cube;let i=e.pcube;if(i.is_empty&&i instanceof f){const e=i.prev_cube_deep;return r.merge(i.remove_self()),e&&r.tell(e,d.U.in_tail(e.id)),r}if(t&&t.is_empty)return r.merge(t.remove_self()),n&&r.tell(n,d.U.in_head(n.id)),r;if(n&&t.type===n.type)return r.merge(n.merge("left"));if(t)return r.tell(t,d.U.in_tail(t.id))}else{const t=e.next_cube_deep,n=t?.prev_cube;let i=e.pcube;for(;i&&i!==this;){const e=i.next_cube_deep;if(i.is_empty&&i instanceof f)return r.merge(i.remove_self()),e&&r.tell(e,d.U.in_head(e.id)),r;i=i.pcube}if(t&&t.is_empty)return r.merge(t.remove_self()),n&&r.tell(n,d.U.in_tail(n.id)),r;if(n&&t.type===n.type)return r.merge(t.merge("left"));if(t)return r.tell(t,d.U.in_tail(t.id))}}remove_self(e="backward"){const{pcube:t,courier:n,index:r}=this,i=new l.vk(n);return i.tell(t,c.V.delete_child(t.id,e,[r,r+1])),i}merge(e){const{pcube:t,cursor:n,courier:r}=this,{cube_end:i,offset_end:s}=n;if(!i)return;const o=r.get_recorder();return o.tell(this,c.V.merge(this.id,e,i.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 f&&t.pcube===e)return t;t=t.pcube}}find_upstream_target(e){let t=this;for(;t instanceof f;)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:r,start_id:i,end_id:s,offset_end:o,offset_start:a,toggle:d,replace:u}=e,h=new l.vk(n);if(i!==s||o!==a){if(s&&!i){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)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(t,c.V.set_selection_css(t.id,r,null,s,"head",o,d,u)),h}if(i&&!s){const e=this.find_cube(i),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(t,c.V.set_selection_css(t.id,r,i,null,a,"tail",d,u)),h}if("tail"===o&&"head"===a){for(let e of this.children)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h}if(s&&i){const e=this.find_cube(i),t=this.find_cube(s),n=e?.find_upstream_untill(this),l=t?.find_upstream_untill(this);if(!n||!l)return;const p=this.children.slice(n.index+1,l.index);for(let e of p)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(n,c.V.set_selection_css(n.id,r,i,null,a,"tail",d,u)),n!==l&&h.tell(l,c.V.set_selection_css(l.id,r,null,s,"head",o,d,u)),h}}}on_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r}=this,i=new l.vk(t),{data:s,end_id:o,start_id:a,offset_end:u,offset_start:h}=e,p=this.find_cube(a),f=this.find_cube(o),m=p?.find_upstream_untill(this),_=f?.find_upstream_untill(this);if(!m||!_)return i;if(f!==p||h!==u)if(m&&m===_)i.tell(m,c.V.delete(m.id,"backward",a,o,h,u)),i.tell(m,c.V.insert(m.id,s,a,o,h,u));else{i.tell(_,c.V.delete(_.id,"backward",null,o,"head",u)),i.tell(this,c.V.delete_child(this.id,"backward",[m.index+1,_.index])),i.tell(this,c.V.insert_child(this.id,s,m.index+1)),i.tell(m,c.V.delete(m.id,"backward",a,null,h,"tail"));let e=s[s.length-1];const t=this.top.find_cube(e.id);t&&i.tell(t,d.U.in_tail(e.id,0))}else i.tell(f,c.V.insert(o,s,a,o,h,u));return i}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:r,start_id:i,end_id:s,offset_end:o,offset_start:a,reserve:d}=e,h=new l.vk(t);if(!i&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return h.tell(this,c.V.delete_child(this.id,r,[0,t.index],d)),h.tell(t,c.V.delete(t.id,r,i,s,"head",o,d)),h}if(i&&!s){const e=this.find_cube(i),t=e?.find_upstream_untill(this);if(!t||!e)return;return h.tell(this,c.V.delete_child(this.id,r,[t.index+1,this.child_count],d)),h.tell(t,c.V.delete(t.id,r,i,s,a,o,d)),h}if("head"===a&&"tail"===o){if(d){if(this.is_empty)return;h.tell(this,c.V.delete_child(this.id,r,[1,this.child_count]));const e=this.child_first;e.meta.block?h.tell(e,c.V.delete_child(e.id,r,[0,e.child_count],d)):e instanceof u.P6?h.tell(e,u.zl.reset(e.id,"",1,1)):h.tell(e,c.V.reset(e.id,[]))}else h.tell(this.pcube,c.V.delete_child(this.pid,"backward",[this.index,this.index+1]));return h}if(i&&s){const e=this.find_cube(i),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 h;const d=n.index,p=l.index;if(i!==s||a!==o)if(n===l)h.tell(n,c.V.delete(n.id,r,i,s,a,o,!0));else if(h.tell(l,c.V.delete(l.id,r,null,s,"head",o)),h.tell(this,c.V.delete_child(this.id,"backward",[d+1,p])),h.tell(n,c.V.delete(n.id,r,i,null,a,"tail",!0)),e instanceof u.P6){const t=e.get_valid_index(a);e.set_cursor_in_head(t)}return h}}on_cube_set_css(e){const{courier:t,cursor:n}=this,{css:i,toggle:s,replace:o}=e,a=t.get_recorder();if(a.add_cmd(e),o){const e=structuredClone((0,r.ux)(this.css));return this.data.css=i,a.add_recover(c.V.set_css(this.id,e,!1,!0)),a}if(0===Object.keys(i).length)return;let l=!0;const d=structuredClone((0,r.ux)(this.css)),u=structuredClone((0,r.ux)(this.css));for(let e in i){const t=i[e],n=this.css[e]||null;d[e]=n,null===t||s&&t===n?(l=!1,delete u[e]):t!==n&&(l=!1,u[e]=t)}return this.data.css=u,l?void 0:(a.add_recover(c.V.set_css(this.id,d)),a)}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,s=t.get_recorder();if(s.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone((0,r.ux)(this.attrs[e]))||null,null===t?delete this.data.attrs[e]:this.data.attrs[e]=t}return s.add_recover(c.V.set_attr(this.id,o)),s}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:r,index:i}=this,{from:s,from_id:o,offset:a}=e,u=new l.vk(t);if(this.meta.block){const e=this.child_first,t=this.child_last;this.is_empty&&u.tell(n,c.V.delete_child(r,"backward",[this.index,this.index+1])),"left"===s?u.tell(e,d.U.in_head(e.id,0,s)):u.tell(t,d.U.in_tail(t.id,0,s))}else u.tell(n,c.V.delete_child(r,"backward",[this.index,this.index+1]));return u}on_postil_add(e){const{courier:t}=this,{data:n}=e;if(this.postil){const e=new l.vk(t),r=this.postil;return e.tell(r,c.V.insert_child(r.id,n,r.child_count)),this.has_postil=!0,this.postil.show=!0,e}{const r=t.get_recorder();r.add_cmd(e);const i=u.$u.get_default(n),s=new u.$u(i,this);return this.postil=s,r.add_recover(c.V.postil_remove(this.id,[0,s.child_count])),this.postil.show=!0,this.has_postil=!0,r}}on_postil_remove(e){const{courier:t}=this,{range:n}=e,[r,i]=n,s=this.postil;if(!s)return;let o=r<0?0:r,a=i>s.child_count?s.child_count:i;if(o<=0&&a>=s.child_count){const n=t.get_recorder();n.add_cmd(e);const r=s.export();return n.add_recover(c.V.postil_add(this.id,r.info)),this.postil=null,this.has_postil=!1,s.gc(),n}{const e=new l.vk(t);return e.tell(s,c.V.delete_child(s.id,"backward",[o,a])),e}}on_cursor_in_head(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new l.vk(r);if(this.meta.block){const e=this.child_first;if(!e)return a;a.tell(e,d.U.in_head(e.id,t))}else if(this instanceof u.P6)this.set_cursor_in_head(t);else if("none"===n||"right"===n)if(i&&i instanceof u.P6)i.set_cursor_in_tail();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index))}else if("left"===n)if(o&&o instanceof u.P6)o.set_cursor_in_head();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index+1))}return a}on_cursor_in_tail(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new l.vk(r);if(this.meta.block){const e=this.child_last;if(!e)return a;a.tell(e,d.U.in_tail(e.id,t))}else if(this instanceof u.P6)this.set_cursor_in_tail(t);else if("none"===n||"left"===n)if(o&&o instanceof u.P6)o.set_cursor_in_head();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index+1))}else if("right"===n)if(i&&i instanceof u.P6)i.set_cursor_in_tail();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index))}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}get_valid_range(e){let[t,n]=e;return t<0&&(t=0),n>this.child_count&&(n=this.child_count),[t,n]}}},6094:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(6996);class i{static layout_change(e,t){return{id:e,name:r.s1.layout_update,attrs:t}}static append_child(e,t){return{id:e,name:r.s1.append_child,previd:t}}}},6853:(e,t,n)=>{"use strict";n.d(t,{R:()=>r});class r{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"}}}},6996:(e,t,n)=>{"use strict";n.d(t,{tK:()=>l,GW:()=>h,zS:()=>r.zS,K9:()=>r.K9,J8:()=>c,QI:()=>s,nY:()=>m,$f:()=>f,ZS:()=>k,ec:()=>S,SN:()=>M,_A:()=>g,Sd:()=>b,JC:()=>d,mM:()=>u,kU:()=>r.kU,L6:()=>o,tX:()=>C,s1:()=>r.s1,Mu:()=>r.Mu,u0:()=>r.u0,dp:()=>w,fv:()=>x,yn:()=>y,DI:()=>v,BS:()=>_,lm:()=>i,gS:()=>a,Ny:()=>p});var r=n(5857),i=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}({}),s=function(){return{}}(),o=function(e){return e.markers="markers",e.nodes="nodes",e.linkers="linkers",e.placeholder="placeholder",e}({}),a=function(e){return e.update="text-link:update",e}({}),l=function(e){return e.reset="cube-api:reset",e}({}),c=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}({}),d=function(e){return e.add="cube-list:add",e.remove="cube-list:remove",e.indent="cube-list:indent",e}({}),u=function(e){return e.add="cube-list-ordered:add",e.remove="cube-list-ordered:remove",e.indent="cube-list-ordered:indent",e}({}),h=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}({}),p=function(e){return e.add="cube-todo:add",e.remove="cube-todo:remove",e.indent="cube-todo:indent",e.status="cube-todo:status",e}({}),f=function(e){return e.h1="\\Huge ",e.h2="\\huge ",e.h3="\\Large ",e.h4="\\normalsize ",e.h5="\\small ",e.h6="\\tiny ",e}({}),m=function(e){return e.update="cube-fomula:update",e}({}),_=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}({}),g=function(e){return e.arrow="marker-arrow",e.point="marker-point",e.square="marker-square",e.rhomb="marker-rhomb",e}({}),b=function(e){return e.update="linker:update",e}({}),v=function(e){return e.reset_explanation="cube-rt:reset-explanation",e}({}),y=function(e){return e.pending="pending",e.playing="playing",e.pause="pause",e.stop="stop",e}({}),w=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["doc-input-before"]="note-event:doc-input-before",e["doc-input-compositionend"]="note-event:doc-input-compositionend",e["status-update"]="note-event:status-update",e["node-status-clicked"]="note-event:node-status-clicked",e["fig-click"]="note-event:fig-click",e}({}),x=function(e){return e.read="read",e.edit="edit",e.export="export",e}({}),k=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}({}),S=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}({}),C=function(e){return e.left="arrowleft",e.right="arrowright",e.up="arrowup",e.down="arrowdown",e.end="end",e.home="home",e}({}),M=function(e){return e.enter="Enter",e}({})},7633:(e,t,n)=>{"use strict";n.d(t,{C4:()=>k,EW:()=>Re,Gc:()=>he,IG:()=>ye,IJ:()=>Ce,KR:()=>Se,Kh:()=>ue,Pr:()=>Ae,R1:()=>Le,Tm:()=>_e,X2:()=>l,a1:()=>xe,bl:()=>S,fE:()=>ge,g8:()=>me,hV:()=>Be,hZ:()=>O,i9:()=>ke,ju:()=>be,lJ:()=>we,qA:()=>B,u4:()=>E,ux:()=>ve,wB:()=>Ie,yC:()=>o});var r=n(3972);let i,s;class o{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=i,!e&&i&&(this.index=(i.scopes||(i.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=i;try{return i=this,e()}finally{i=t}}}on(){1===++this._on&&(this.prevScope=i,i=this)}off(){this._on>0&&0===--this._on&&(i=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 a=new WeakSet;class l{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,i&&i.active&&i.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,a.has(this)&&(a.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||h(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,C(this),m(this);const e=s,t=w;s=this,w=!0;try{return this.fn()}finally{_(this),s=e,w=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)v(e);this.deps=this.depsTail=void 0,C(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?a.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){g(this)&&this.run()}get dirty(){return g(this)}}let c,d,u=0;function h(e,t=!1){if(e.flags|=8,t)return e.next=d,void(d=e);e.next=c,c=e}function p(){u++}function f(){if(--u>0)return;if(d){let e=d;for(d=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;c;){let t=c;for(c=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 m(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _(e){let t,n=e.depsTail,r=n;for(;r;){const e=r.prevDep;-1===r.version?(r===n&&(n=e),v(r),y(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function g(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(b(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function b(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===M)return;if(e.globalVersion=M,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!g(e)))return;e.flags|=2;const t=e.dep,n=s,i=w;s=e,w=!0;try{m(e);const n=e.fn(e._value);(0===t.version||(0,r.$H)(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{s=n,w=i,_(e),e.flags&=-3}}function v(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)v(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function y(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let w=!0;const x=[];function k(){x.push(w),w=!1}function S(){const e=x.pop();w=void 0===e||e}function C(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=s;s=void 0;try{t()}finally{s=e}}}let M=0;class T{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 L{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(!s||!w||s===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==s)t=this.activeLink=new T(s,this),s.deps?(t.prevDep=s.depsTail,s.depsTail.nextDep=t,s.depsTail=t):s.deps=s.depsTail=t,z(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=s.depsTail,t.nextDep=void 0,s.depsTail.nextDep=t,s.depsTail=t,s.deps===t&&(s.deps=e)}return t}trigger(e){this.version++,M++,this.notify(e)}notify(e){p();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{f()}}}function z(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)z(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const A=new WeakMap,P=Symbol(""),R=Symbol(""),N=Symbol("");function E(e,t,n){if(w&&s){let t=A.get(e);t||A.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new L),r.map=t,r.key=n),r.track()}}function O(e,t,n,i,s,o){const a=A.get(e);if(!a)return void M++;const l=e=>{e&&e.trigger()};if(p(),"clear"===t)a.forEach(l);else{const s=(0,r.cy)(e),o=s&&(0,r.yI)(n);if(s&&"length"===n){const e=Number(i);a.forEach((t,n)=>{("length"===n||n===N||!(0,r.Bm)(n)&&n>=e)&&l(t)})}else switch((void 0!==n||a.has(void 0))&&l(a.get(n)),o&&l(a.get(N)),t){case"add":s?o&&l(a.get("length")):(l(a.get(P)),(0,r.CE)(e)&&l(a.get(R)));break;case"delete":s||(l(a.get(P)),(0,r.CE)(e)&&l(a.get(R)));break;case"set":(0,r.CE)(e)&&l(a.get(P))}}f()}function I(e){const t=ve(e);return t===e?t:(E(t,0,N),ge(e)?t:t.map(we))}function B(e){return E(e=ve(e),0,N),e}const D={__proto__:null,[Symbol.iterator](){return V(this,Symbol.iterator,we)},concat(...e){return I(this).concat(...e.map(e=>(0,r.cy)(e)?I(e):e))},entries(){return V(this,"entries",e=>(e[1]=we(e[1]),e))},every(e,t){return j(this,"every",e,t,void 0,arguments)},filter(e,t){return j(this,"filter",e,t,e=>e.map(we),arguments)},find(e,t){return j(this,"find",e,t,we,arguments)},findIndex(e,t){return j(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return j(this,"findLast",e,t,we,arguments)},findLastIndex(e,t){return j(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return j(this,"forEach",e,t,void 0,arguments)},includes(...e){return U(this,"includes",e)},indexOf(...e){return U(this,"indexOf",e)},join(e){return I(this).join(e)},lastIndexOf(...e){return U(this,"lastIndexOf",e)},map(e,t){return j(this,"map",e,t,void 0,arguments)},pop(){return q(this,"pop")},push(...e){return q(this,"push",e)},reduce(e,...t){return F(this,"reduce",e,t)},reduceRight(e,...t){return F(this,"reduceRight",e,t)},shift(){return q(this,"shift")},some(e,t){return j(this,"some",e,t,void 0,arguments)},splice(...e){return q(this,"splice",e)},toReversed(){return I(this).toReversed()},toSorted(e){return I(this).toSorted(e)},toSpliced(...e){return I(this).toSpliced(...e)},unshift(...e){return q(this,"unshift",e)},values(){return V(this,"values",we)}};function V(e,t,n){const r=B(e),i=r[t]();return r===e||ge(e)||(i._next=i.next,i.next=()=>{const e=i._next();return e.value&&(e.value=n(e.value)),e}),i}const H=Array.prototype;function j(e,t,n,r,i,s){const o=B(e),a=o!==e&&!ge(e),l=o[t];if(l!==H[t]){const t=l.apply(e,s);return a?we(t):t}let c=n;o!==e&&(a?c=function(t,r){return n.call(this,we(t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));const d=l.call(o,c,r);return a&&i?i(d):d}function F(e,t,n,r){const i=B(e);let s=n;return i!==e&&(ge(e)?n.length>3&&(s=function(t,r,i){return n.call(this,t,r,i,e)}):s=function(t,r,i){return n.call(this,t,we(r),i,e)}),i[t](s,...r)}function U(e,t,n){const r=ve(e);E(r,0,N);const i=r[t](...n);return-1!==i&&!1!==i||!be(n[0])?i:(n[0]=ve(n[0]),r[t](...n))}function q(e,t,n=[]){k(),p();const r=ve(e)[t].apply(e,n);return f(),S(),r}const $=(0,r.pD)("__proto__,__v_isRef,__isVue"),G=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(r.Bm));function X(e){(0,r.Bm)(e)||(e=String(e));const t=ve(this);return E(t,0,e),t.hasOwnProperty(e)}class K{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,s=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return s;if("__v_raw"===t)return n===(i?s?de:ce:s?le:ae).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=(0,r.cy)(e);if(!i){let e;if(o&&(e=D[t]))return e;if("hasOwnProperty"===t)return X}const a=Reflect.get(e,t,ke(e)?e:n);return((0,r.Bm)(t)?G.has(t):$(t))?a:(i||E(e,0,t),s?a:ke(a)?o&&(0,r.yI)(t)?a:a.value:(0,r.Gv)(a)?i?pe(a):ue(a):a)}}class W extends K{constructor(e=!1){super(!1,e)}set(e,t,n,i){let s=e[t];if(!this._isShallow){const t=_e(s);if(ge(n)||_e(n)||(s=ve(s),n=ve(n)),!(0,r.cy)(e)&&ke(s)&&!ke(n))return t||(s.value=n),!0}const o=(0,r.cy)(e)&&(0,r.yI)(t)?Number(t)<e.length:(0,r.$3)(e,t),a=Reflect.set(e,t,n,ke(e)?e:i);return e===ve(i)&&(o?(0,r.$H)(n,s)&&O(e,"set",t,n):O(e,"add",t,n)),a}deleteProperty(e,t){const n=(0,r.$3)(e,t),i=(e[t],Reflect.deleteProperty(e,t));return i&&n&&O(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return(0,r.Bm)(t)&&G.has(t)||E(e,0,t),n}ownKeys(e){return E(e,0,(0,r.cy)(e)?"length":P),Reflect.ownKeys(e)}}class Y extends K{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Z=new W,Q=new Y,J=new W(!0),ee=e=>e,te=e=>Reflect.getPrototypeOf(e);function ne(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function re(e,t){const n=function(e,t){const n={get(n){const i=this.__v_raw,s=ve(i),o=ve(n);e||((0,r.$H)(n,o)&&E(s,0,n),E(s,0,o));const{has:a}=te(s),l=t?ee:e?xe:we;return a.call(s,n)?l(i.get(n)):a.call(s,o)?l(i.get(o)):void(i!==s&&i.get(n))},get size(){const t=this.__v_raw;return!e&&E(ve(t),0,P),t.size},has(t){const n=this.__v_raw,i=ve(n),s=ve(t);return e||((0,r.$H)(t,s)&&E(i,0,t),E(i,0,s)),t===s?n.has(t):n.has(t)||n.has(s)},forEach(n,r){const i=this,s=i.__v_raw,o=ve(s),a=t?ee:e?xe:we;return!e&&E(o,0,P),s.forEach((e,t)=>n.call(r,a(e),a(t),i))}};return(0,r.X$)(n,e?{add:ne("add"),set:ne("set"),delete:ne("delete"),clear:ne("clear")}:{add(e){t||ge(e)||_e(e)||(e=ve(e));const n=ve(this);return te(n).has.call(n,e)||(n.add(e),O(n,"add",e,e)),this},set(e,n){t||ge(n)||_e(n)||(n=ve(n));const i=ve(this),{has:s,get:o}=te(i);let a=s.call(i,e);a||(e=ve(e),a=s.call(i,e));const l=o.call(i,e);return i.set(e,n),a?(0,r.$H)(n,l)&&O(i,"set",e,n):O(i,"add",e,n),this},delete(e){const t=ve(this),{has:n,get:r}=te(t);let i=n.call(t,e);i||(e=ve(e),i=n.call(t,e)),r&&r.call(t,e);const s=t.delete(e);return i&&O(t,"delete",e,void 0),s},clear(){const e=ve(this),t=0!==e.size,n=e.clear();return t&&O(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const s=this.__v_raw,o=ve(s),a=(0,r.CE)(o),l="entries"===e||e===Symbol.iterator&&a,c="keys"===e&&a,d=s[e](...i),u=n?ee:t?xe:we;return!t&&E(o,0,c?R:P),{next(){const{value:e,done:t}=d.next();return t?{value:e,done:t}:{value:l?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}(e,t);return(t,i,s)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get((0,r.$3)(n,i)&&i in t?n:t,i,s)}const ie={get:re(!1,!1)},se={get:re(!1,!0)},oe={get:re(!0,!1)},ae=new WeakMap,le=new WeakMap,ce=new WeakMap,de=new WeakMap;function ue(e){return _e(e)?e:fe(e,!1,Z,ie,ae)}function he(e){return fe(e,!1,J,se,le)}function pe(e){return fe(e,!0,Q,oe,ce)}function fe(e,t,n,i,s){if(!(0,r.Gv)(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const o=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((0,r.Zf)(a));var a;if(0===o)return e;const l=s.get(e);if(l)return l;const c=new Proxy(e,2===o?i:n);return s.set(e,c),c}function me(e){return _e(e)?me(e.__v_raw):!(!e||!e.__v_isReactive)}function _e(e){return!(!e||!e.__v_isReadonly)}function ge(e){return!(!e||!e.__v_isShallow)}function be(e){return!!e&&!!e.__v_raw}function ve(e){const t=e&&e.__v_raw;return t?ve(t):e}function ye(e){return!(0,r.$3)(e,"__v_skip")&&Object.isExtensible(e)&&(0,r.yQ)(e,"__v_skip",!0),e}const we=e=>(0,r.Gv)(e)?ue(e):e,xe=e=>(0,r.Gv)(e)?pe(e):e;function ke(e){return!!e&&!0===e.__v_isRef}function Se(e){return Me(e,!1)}function Ce(e){return Me(e,!0)}function Me(e,t){return ke(e)?e:new Te(e,t)}class Te{constructor(e,t){this.dep=new L,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ve(e),this._value=t?e:we(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||ge(e)||_e(e);e=n?e:ve(e),(0,r.$H)(e,t)&&(this._rawValue=e,this._value=n?e:we(e),this.dep.trigger())}}function Le(e){return ke(e)?e.value:e}const ze={get:(e,t,n)=>"__v_raw"===t?e:Le(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return ke(i)&&!ke(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Ae(e){return me(e)?e:new Proxy(e,ze)}class Pe{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new L(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=M-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||s===this))return h(this,!0),!0}get value(){const e=this.dep.track();return b(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Re(e,t,n=!1){let i,s;return(0,r.Tn)(e)?i=e:(i=e.get,s=e.set),new Pe(i,s,n)}const Ne={},Ee=new WeakMap;let Oe;function Ie(e,t,n=r.MZ){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:d,call:u}=n,h=e=>o?e:ge(e)||!1===o||0===o?Be(e,1):Be(e);let p,f,m,_,g=!1,b=!1;if(ke(e)?(f=()=>e.value,g=ge(e)):me(e)?(f=()=>h(e),g=!0):(0,r.cy)(e)?(b=!0,g=e.some(e=>me(e)||ge(e)),f=()=>e.map(e=>ke(e)?e.value:me(e)?h(e):(0,r.Tn)(e)?u?u(e,2):e():void 0)):f=(0,r.Tn)(e)?t?u?()=>u(e,2):e:()=>{if(m){k();try{m()}finally{S()}}const t=Oe;Oe=p;try{return u?u(e,3,[_]):e(_)}finally{Oe=t}}:r.tE,t&&o){const e=f,t=!0===o?1/0:o;f=()=>Be(e(),t)}const v=i,y=()=>{p.stop(),v&&v.active&&(0,r.TF)(v.effects,p)};if(a&&t){const e=t;t=(...t)=>{e(...t),y()}}let w=b?new Array(e.length).fill(Ne):Ne;const x=e=>{if(1&p.flags&&(p.dirty||e))if(t){const e=p.run();if(o||g||(b?e.some((e,t)=>(0,r.$H)(e,w[t])):(0,r.$H)(e,w))){m&&m();const n=Oe;Oe=p;try{const n=[e,w===Ne?void 0:b&&w[0]===Ne?[]:w,_];w=e,u?u(t,3,n):t(...n)}finally{Oe=n}}}else p.run()};return d&&d(x),p=new l(f),p.scheduler=c?()=>c(x,!1):x,_=e=>function(e,t=!1,n=Oe){if(n){let t=Ee.get(n);t||Ee.set(n,t=[]),t.push(e)}}(e,!1,p),m=p.onStop=()=>{const e=Ee.get(p);if(e){if(u)u(e,4);else for(const t of e)t();Ee.delete(p)}},t?s?x(!0):w=p.run():c?c(x.bind(null,!0),!0):p.run(),y.pause=p.pause.bind(p),y.resume=p.resume.bind(p),y.stop=y,y}function Be(e,t=1/0,n){if(t<=0||!(0,r.Gv)(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,ke(e))Be(e.value,t,n);else if((0,r.cy)(e))for(let r=0;r<e.length;r++)Be(e[r],t,n);else if((0,r.vM)(e)||(0,r.CE)(e))e.forEach(e=>{Be(e,t,n)});else if((0,r.Qd)(e)){for(const r in e)Be(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Be(e[r],t,n)}return e}},7676:(e,t,n)=>{"use strict";n.d(t,{R:()=>r.R});var r=n(6853)},7744:(e,t,n)=>{"use strict";n.d(t,{MR:()=>s.M,MT:()=>a.M,Sv:()=>u.S,UB:()=>c.U,VL:()=>l.V,_D:()=>o._,j5:()=>i.j,wP:()=>r.w,yc:()=>d.y});var r=n(4709),i=n(2189),s=n(4784),o=n(5976),a=n(3214),l=n(2819),c=n(9164),d=n(1150),u=n(6094)},8147:(e,t,n)=>{"use strict";n.d(t,{W:()=>l});var r=n(7633),i=n(7744),s=n(4412),o=n(1717),a=n(6996);class l extends o.K{_format_brush=null;get meta(){return l.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:o,history:a,courier:l}=this,c=new s.vk(l);if(!e)return;const d=structuredClone((0,r.ux)(e));if(d["text-align"]){const t=e["text-align"];c.merge(this.text_align(t)),delete d["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 r of e.children.slice(...n.range))c.tell(r,i.VL.set_css(r.id,structuredClone(d),t))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:a}=o;if(!e||!n||!r)return;const l=i.VL.set_selection_css(e.id,d,n.id,r.id,s,a,t);c.tell(e,l)}a.record(c)}clear(){const{root:e,cursor:t,history:n,courier:r}=this,o=new s.vk(r),a={};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))o.tell(n,i.VL.set_css(n.id,structuredClone(a),!1,!0))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:l}=t;if(!e||!n||!r)return;const c=i.VL.set_selection_css(e.id,a,n.id,r.id,s,l,!1,!0);o.tell(e,c)}n.record(o)}text_align(e){const{root:t,cursor:n,history:r,courier:o}=this,a=new s.vk(o),l={"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))a.tell(n,i.VL.set_css(n.id,structuredClone(l)))}}else{const e=t.cursor.find_selection_lines();for(let t of e){const e=i.VL.set_css(t.id,structuredClone(l));a.tell(t,e)}}return a}indent(){const{root:e,cursor:t,history:n,courier:r,config:o}=this,a=new s.vk(r);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;a.tell(n,i.VL.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;a.tell(t,i.VL.set_attr(t.id,{indent:n}))}}n.record(a)}unindent(){const{root:e,cursor:t,history:n,courier:r}=this,o=new s.vk(r);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&&o.tell(e,i.VL.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&&o.tell(t,i.VL.set_attr(t.id,{indent:e-1}))}}n.record(o)}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((0,r.ux)(t.css))}else{const{cube_focus:e}=t;if(!e)return;this._format_brush=structuredClone((0,r.ux)(e.css))}}apply_format_brush(){const e=this._format_brush;if(!e)return;const{root:t,courier:n,history:r}=this,o=new s.vk(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=i.VL.set_css(n.id,e,!1,!0);o.tell(n,t)}}else{const{cube_selection:e,cube_end:t,cube_start:n,offset_start:r,offset_end:s}=this.cursor;if(!e||!t||!n)return;const a=i.VL.set_selection_css(e.id,this.format_brush,n.id,t.id,r,s,!1,!0);o.tell(e,a)}r.record(o)}static get meta(){return{type:a.Mu.painter,version:1}}}},8219:(e,t,n)=>{"use strict";n.d(t,{o:()=>i,H:()=>s});const r=new Map;class i{static get_cmd_handler(e,t){const n=r.get(e);return n?.get(t)}static set_cmd_handler(e,t,n){let i=r.get(e);i?i.set(t,n):(i=new Map,i.set(t,n),r.set(e,i))}static init_cmd_handler(e){const t=e.meta,n=r.get(t.type);if(n)for(let[t,r]of n)e.set_vip_cmd_handler(t,r.bind(e))}}function s(e){return(t,n)=>{const r=t[n];if(!r)return;const s=t.meta;i.set_cmd_handler(s.type,e,r)}}},8606:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>r});let r=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t}},8860:(e,t,n)=>{"use strict";n.d(t,{f:()=>y});var r=n(7744),i=n(6996),s=n(4089),o=n(3972),a=n(7633),l=n(4412);function c(e,t){return t.css.width?Number.parseInt(t.css.width.trim().slice(0,-2)):e.getBoundingClientRect().width}function d(e,t,n,r){e.stopPropagation(),e.preventDefault(),r.isdown=!0,r.dir=n,r.dom=t.dom;const i=e.currentTarget,s=i.parentElement?.parentElement;if(!s)return;r.x=e.clientX,r.width_origin=t.css.width;const o=c(s,t);r.width=o,r.width_result=o}var u=n(3755),h=n(122);const p=["id","data-type"],f={class:"tools-left"},m={class:"tools-right"},_=["src","loading"],g=(0,s.pM)({__name:"cube-img",props:{cube:{}},setup(e){const{root:t,stats:n}=e.cube,g={isdown:!1,ismove:!1,x:0,width:-1,dir:"left",width_origin:500},b=(0,a.Kh)({resize_origin_width:-1,resize_result:-1,resize_scroll:!1}),v=t.id,y=u.F.url,w=t=>d(t,e.cube,"left",g),x=t=>d(t,e.cube,"right",g),k=t=>function(e,t,n){if(!n.isdown||!n.dom)return;n.ismove=!0,e.preventDefault();const r="left"===n.dir?1:-1,i=e.clientX-n.x,s=Math.abs(n.width-i*r);t.data.css.width=s+"px",n.width_result=s}(t,e.cube,g),S=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:s}=t.root,o=new l.vk(i);o.tell(t,r.VL.set_css(t.id,{width:n.width_result+"px"})),s.record(o)}(0,e.cube,g),C=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:s}=t.root,o=new l.vk(i);o.tell(t,r.VL.set_css(t.id,{width:n.width_result+"px"})),s.record(o)}(0,e.cube,g);function M(t){const n=t.currentTarget.parentElement;Object.assign(n.style,e.cube.css),n.classList.add("cube-img-load-failed")}function T(t){if(!b.resize_scroll)return;const{deltaY:n}=t,r=t.currentTarget;if(!r)return;t.preventDefault(),t.stopPropagation();let i=c(r,e.cube)+10*Math.sign(n);e.cube.data.css.width=i+"px",b.resize_result=i}return(0,s.sV)(()=>{document.documentElement.addEventListener("pointermove",k),document.documentElement.addEventListener("pointerup",S),document.documentElement.addEventListener("pointercancel",C)}),(0,s.hi)(()=>{document.documentElement.removeEventListener("pointermove",k),document.documentElement.removeEventListener("pointerup",S),document.documentElement.removeEventListener("pointercancel",C)}),(l,d)=>((0,s.uX)(),(0,s.CE)("div",{class:(0,o.C4)(["cube-img",{"resize-scroll":b.resize_scroll}]),style:(0,o.Tr)(l.cube.css),id:l.cube.id,"data-type":(0,a.R1)(i.u0).img,onContextmenu:d[1]||(d[1]=e=>(0,a.R1)(h.uz)(e,l.cube)),onWheel:T},[(0,s.Lk)("div",f,[(0,s.Lk)("div",{class:"dragger",onPointerdown:w},null,32)]),(0,s.Lk)("div",m,[(0,s.Lk)("div",{class:"dragger",onPointerdown:x},null,32)]),(0,s.Lk)("img",{style:(0,o.Tr)(l.cube.css),src:t.isdev?e.cube.info:y?y(v,"image",e.cube.info):void 0,alt:"",onErrorOnce:M,onClick:d[0]||(d[0]=t=>function(t){const n=t.currentTarget;if(b.resize_scroll=!b.resize_scroll)b.resize_origin_width=c(n,e.cube);else{if(b.resize_origin_width<0||b.resize_result<0)return;const{courier:t,history:n}=e.cube.root;e.cube.data.css.width=b.resize_origin_width+"px";const i=t.get_recorder();i.tell(e.cube,r.VL.set_css(e.cube.id,{width:b.resize_result+"px"})),n.record(i)}}(t)),loading:(0,a.R1)(n).mode===(0,a.R1)(i.fv).export?"eager":"lazy"},null,44,_),(0,s.Q3)(' <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,p))}}),b=(0,n(5856).A)(g,[["__scopeId","data-v-14032bda"]]);var v=n(5955);class y extends r._D{_component=b;_children=[];get is_empty(){return 0===this.data.info.trim().length}get children(){return this._children}get meta(){return y.meta}get component(){return this._component}constructor(e,t){super(e,t);const n=this.setup(e,t),r=this.clipboard.pasted_from;return r&&this.event.emit_asset_copy(r.noteid,"image",e.info),n}build_child(){}update_data(e){const t=this.versions[this.meta.type];return t>this.meta.version?{data:e,usable:!1}:(1===t&&e.info.startsWith("image://")&&(e.info=e.info.slice(8)),{data:e,usable:!0})}float(e){const{courier:t}=this.root,n={float:"L"===e?"inline-start":"inline-end"},i=t.get_recorder(),s=r.VL.set_css(this.id,n,!0);return i.tell(this,s),i}clear_float(){const{courier:e}=this.root,t=e.get_recorder(),n=r.VL.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 y.replace_id(this.root,e,t)}static get meta(){return{type:i.u0.img,cubename:"图片",block:!1,version:2,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=v.I.get_id();return n[r]=i,t.id=i,t}static get_default(e="",t={},n={}){return{id:v.I.get_id(),type:i.u0.img,info:e,css:t,attrs:n}}}},8984:(e,t,n)=>{"use strict";n.d(t,{L$:()=>T,LU:()=>C,uz:()=>S});var r=n(7744),i=n(1742),s=n(1068),o=n(1556);var a=n(3755);function l(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row,d.col-1))return l?.tip_info("左侧已存在单元格");if(d.col-1<0)return l?.tip_info("左侧已达边界");{const t=r.get_recorder(),n={row:d.row,col:d.col-1,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_col_left(t.left))return l?.tip_info("左侧不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[0];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_col(e.id,d.col,i)),s.record(n)}}function c(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row,d.col+1))return l?.tip_info("右侧已存在单元格");if(d.col+1>=e.size[1])return l?.tip_info("右侧已达边界");{const t=r.get_recorder(),n={row:d.row,col:d.col+1,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_col_right(t.right))return l?.tip_info("右侧不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[0];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_col(e.id,d.col+d.colspan,i)),s.record(n)}}function d(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row-1,d.col))return l?.tip_info("上方已存在单元格");if(d.row-1<0)return l?.tip_info("上方已达边界");{const t=r.get_recorder(),n={row:d.row-1,col:d.col,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_row_top(t.top))return l?.tip_info("上方不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[1];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_row(e.id,d.row,i)),s.record(n)}}function u(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row+1,d.col))return l?.tip_info("下方已存在单元格");if(d.row+1>=e.size[0])return l?.tip_info("下方已达边界");{const t=r.get_recorder(),n={row:d.row+1,col:d.col,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_row_bottom(t.bottom))return l?.tip_info("下方不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[1];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_row(e.id,d.row+d.rowspan,i)),s.record(n)}}function h(e,t){const{cursor:n,courier:r,stats:i,history:s,id:l}=e,c=a.F.tips,{cube_end:d}=n,u=e.get_active_cell();if(!u)return c?.tip_info("未发现激活单元格");const h=r.get_recorder(),p=e.get_cell_area(u);h.tell(e,o.en.col_resize(l,[p.left,p.right],t)),s.record(h)}var p=n(1445);function f(e,t){const{courier:n,history:i}=e,s=n.get_recorder();s.tell(e,r.VL.set_attr(e.id,{column_count:t,column_width:null})),i.record(s)}function m(e,t){const{courier:n,history:i}=e,s=n.get_recorder();s.tell(e,r.VL.set_attr(e.id,{column_width:t,column_count:null})),i.record(s)}var _=n(3803),g=n(5955),b=n(6996);function v(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:o,cube_end:a}=r;if(!o||!a)return;const l=i.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});l.tell(n,_.o.indent(n.id,i)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});l.tell(n,_.o.indent(n.id,i)),s.record(l)}}function y(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:a,cube_end:l}=r;if(!a||!l)return;const c=i.get_recorder();if(t){const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});c.tell(n,o.LO.indent(n.id,i)),s.record(c)}else{const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});c.tell(n,o.LO.indent(n.id,i)),s.record(c)}}function w(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:a,cube_end:l}=r;if(!a||!l)return;const c=i.get_recorder();if(t){const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});c.tell(n,o.A6.indent(n.id,i)),s.record(c)}else{const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});c.tell(n,o.A6.indent(n.id,i)),s.record(c)}}var x=n(4412);function k(e,t="tail"){const{courier:n,history:r}=e,i=new x.vk(n),s=[o.XV.get_default(),o.XV.get_default()],a=o.ry.insert_row(e.id,t,[s]);i.tell(e,a),r.record(i)}async function S(e,t){e.preventDefault(),e.stopPropagation(),i.h_.cube=t,i.h_.point={x:e.clientX,y:e.clientY},i.h_.stack_pos.length=0,i.h_.stack_rect.length=0,i.h_.stack_menus.length=0,t instanceof o.p4?i.h_.menu=function(e){const t=[...T(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:r,history:i,id:s,active_tab:a}=e;if(!a)return;const l=r.get_recorder();l.tell(e,o.DW.change_lang(s,a.id,t)),i.record(l)}}))}}(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:r,history:i,id:s,active_tab:a}=e;if(!a)return;const l=r.get_recorder();l.tell(e,o.DW.change_theme(s,a.id,t)),i.record(l)}}))}}(e),click(e){}},{usable:!0,title:"添加代码块",icon:["iconfont","icon-add"],click(t){(0,i.NW)({文件名:""},t=>{const n=t["文件名"],r=n.lastIndexOf(".");let i="typescript";if(r>=0){const e=n.slice(r);i=o.UF[e]||i}const{code_theme:s}=e.config.data,a=e.create_tab(i,n,s),l=e.courier.get_recorder();l.tell(e,o.DW.add(e.id,a)),e.history.record(l)})},mouseenter(e){}},{usable:!0,title:"重命名",icon:["iconfont","icon-rename"],click(t){const n={文件名:e.active_tab?.name||""};(0,i.NW)(n,t=>{const n=e.active_tab;if(!n)return;const r=t["文件名"],i=e.courier.get_recorder();i.tell(e,o.DW.rename(e.id,n.id,r)),e.history.record(i)})},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 r=e.courier.get_recorder();r.tell(e,o.DW.update(e.id,n.id,"")),e.history.record(r)},mouseenter(e){}},{usable:!0,title:"删除代码",icon:["iconfont","icon-close"],click(t){const n=e.active_tab;if(!n)return;const r=e.courier.get_recorder();r.tell(e,o.DW.remove(e.id,n.id)),e.history.record(r)},mouseenter(e){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.Ku?i.h_.menu=function(e){const t=e.get_active_cell(),n=[...T(e),{usable:!0,title:e.title?"移除标题":"添加标题",icon:["iconfont","icon-a-Addheader2x"],has_submenu:!1,mouseenter(e){},click(t){const{history:n,courier:r,id:i}=e,s=r.get_recorder();if(e.title){const t=o.en.remove_title(i);s.tell(e,t)}else{const t=o.XV.get_default(),n=o.en.add_title(i,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,r=a.F.tips,i=e.copy_selection_table();if(!i)return a.F.tips?.tip_error("复制子表失败");const s=e.get_selection_text();n.set_clipboard_cubedata(s,[i]),r?.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:r}=e,i=a.F.tips,s=t.get_recorder(),l=e.get_selection_area();if(!l)return i?.tip_info("无选中单元格");s.tell(e,o.en.merge(n,l)),r.record(s)}(e)}},{usable:!!t,title:"扩大当前列宽",icon:["iconfont","icon-expand-horizontal-1--expand-resize-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){h(e,1)}},{usable:!!t,title:"缩小当前列宽",icon:["iconfont","icon-shrink-horizontal-1--resize-shrink-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){h(e,-1)}},{usable:!!t,title:"向左插入列",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇠",mouseenter(e){},click(t){l(e)}},{usable:!!t,title:"向右插入列",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇢",mouseenter(e){},click(t){c(e)}},{usable:!!t,title:"向上插入行",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + shift + ↑",mouseenter(e){},click(t){d(e)}},{usable:!!t,title:"向下插入行",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇣",mouseenter(e){},click(t){u(e)}},{usable:!!t,title:"向左插入单元格",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + ⇠",mouseenter(e){},click(t){l(e,!0)}},{usable:!!t,title:"向右插入单元格",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + ⇢",mouseenter(e){},click(t){c(e,!0)}},{usable:!!t,title:"向上插入单元格",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + ↑",mouseenter(e){},click(t){d(e,!0)}},{usable:!!t,title:"向下插入单元格",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + ⇣",mouseenter(e){},click(t){u(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:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(!e.check_orderly_row(d.row))return l?.tip_info("当前行不整齐");{const t=n.get_recorder();t.tell(e,o.en.remove_row(s,d.row)),i.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:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(!e.check_orderly_col(d.col))return l?.tip_info("当前列不整齐");{const t=n.get_recorder();t.tell(e,o.en.remove_col(s,d.col)),i.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:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");const u=n.get_recorder();u.tell(e,o.en.remove_cell(s,d.box.id)),i.record(u)}(e)}}];return{title:e.meta.cubename,active:[],menus:n}}(t):t instanceof o.HR?i.h_.menu=function(e){const t=[...T(e),{usable:!e.attrs.fold,title:"折叠",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){(0,p.yg)(e)}},{usable:!!e.attrs.fold,title:"展开",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){(0,p.yg)(e)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.mM?i.h_.menu=function(e){const t=[...T(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(),s=[o.XV.get_default()];i.tell(e,r.VL.insert_child(e.id,s,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(){m(e,120)}},{usable:!0,title:140,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,140)}},{usable:!0,title:160,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,160)}},{usable:!0,title:180,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,180)}},{usable:!0,title:200,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(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(){f(e,2)}},{usable:!0,title:3,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){f(e,3)}},{usable:!0,title:4,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){f(e,4)}},{usable:!0,title:5,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){f(e,5)}},{usable:!0,title:6,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){f(e,6)}}];return{title:"限定列数",active:[e.attrs.column_count],menus:t}}(e),click(){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.Kw?i.h_.menu=function(e){const t=[...T(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){v(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){v(e,!0)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.list_ordered;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.NQ?i.h_.menu=function(e){const t=[...T(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){y(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){y(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.list;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.k9?i.h_.menu=function(e){const t=[...T(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){w(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){w(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.list;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=g.I.get_id(),s.type=b.u0.list_ordered;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.fC?i.h_.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 a.F.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)&&a.F.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 o.RQ&&(i.h_.menu=function(e){const t=[...T(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 r=n.find_upstream_untill(e);r instanceof o.XV&&k(e,Math.floor(r.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 r=n.find_upstream_untill(e);r instanceof o.XV&&k(e,Math.floor(r.index/2))}}];return{title:e.meta.cubename,active:[],menus:t}}(t))}function C(e,t,n,r=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 i={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(s.MathRect.can_include(i,t)){const i=n.y+t.height-e.height;return{x:n.x+n.width+r,y:i<0?n.y:n.y-i}}{const i=n.y+t.height-e.height;return{x:n.x-t.width-r,y:i<0?n.y:n.y-i}}}function M(e,t){const{courier:n,history:i}=e,s=n.get_recorder(),a=e.pcube;if("A"===t)if(e instanceof o.HR){const t=o.HR.get_default();s.tell(a,r.VL.insert_child(a.id,[t],e.index+1))}else{const t=o.gK.get_default(),n=r.VL.insert_child(a.id,[t],e.index+1);s.tell(a,n)}else if("B"===t&&e)if(e instanceof o.HR){const t=o.HR.get_default();s.tell(a,r.VL.insert_child(a.id,[t],e.index))}else{const t=o.gK.get_default(),n=r.VL.insert_child(a.id,[t],e.index);s.tell(a,n)}i.record(s)}function T(e,t=!1){const n=[{usable:!0,title:"向前插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){M(e,"B")}},{usable:!0,title:"向后插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){M(e,"A")}}],r={usable:!0,title:"全屏",icon:["iconfont","icon-square"],has_submenu:!1,mouseenter(e){},click(t){e.dom?.requestFullscreen()}};return t&&n.push(r),n}},9164:(e,t,n)=>{"use strict";n.d(t,{U:()=>i});var r=n(6996);class i{static in_head(e,t=0,n="none"){return{id:e,name:r.K9.cursor_in_head,offset:t,from:n}}static in_tail(e,t=0,n="none"){return{id:e,name:r.K9.cursor_in_tail,offset:t,from:n}}}}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return n[e](s,s.exports,i),s.exports}i.m=n,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>"chunk/"+e+"-"+i.h()+".js",i.miniCssF=e=>{},i.h=()=>"7dc1af3dd58697c08a24",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="deepsky:",i.l=(n,r,s,o)=>{if(e[n])e[n].push(r);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+s){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",i.nc&&a.setAttribute("nonce",i.nc),a.setAttribute("data-webpack",t+s),a.src=n),e[n]=[r];var h=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);var i=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach(e=>e(r)),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.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 r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={3057:0};i.f.j=(t,n)=>{var r=i.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var s=new Promise((n,i)=>r=e[t]=[n,i]);n.push(r[2]=s);var o=i.p+i.u(t),a=new Error;i.l(o,n=>{if(i.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){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,r[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,s,[o,a,l]=n,c=0;if(o.some(t=>0!==e[t])){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);l&&l(i)}for(t&&t(n);c<o.length;c++)s=o[c],i.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";i.r(s),i.d(s,{BoundBox:()=>r.yI,CodeLanguageMap:()=>r.UF,CommandApi:()=>r.ev,CommandBoxFolder:()=>r.$6,CommandBoxRoot:()=>r.LU,CommandCode:()=>r.DW,CommandCube:()=>o.VL,CommandCursor:()=>o.UB,CommandDetailList:()=>r.ry,CommandFomula:()=>r.OA,CommandLinker:()=>r.PL,CommandListOrdered:()=>r.LO,CommandMap:()=>o.yc,CommandNode:()=>o.Sv,CommandRt:()=>r.fl,CommandTable:()=>r.en,CommandText:()=>r.zl,CommandTextLink:()=>r.ZU,CommandTodo:()=>r.A6,CubeAnnotation:()=>r.vV,CubeApi:()=>r.c9,CubeBase:()=>o.j5,CubeBox:()=>r.XV,CubeBoxColumns:()=>r.mM,CubeBoxFolder:()=>r.de,CubeBoxRoot:()=>r.HR,CubeChild:()=>o._D,CubeCode:()=>r.p4,CubeDetailList:()=>r.RQ,CubeDoc:()=>r.oY,CubeFomula:()=>r.qH,CubeHandler:()=>a.o,CubeImg:()=>r.fC,CubeLine:()=>r.gK,CubeLinker:()=>r.R$,CubeList:()=>r.Kw,CubeListOrdered:()=>r.NQ,CubeLost:()=>r.Qm,CubeMap:()=>r.EU,CubeNode:()=>r.gL,CubePostil:()=>r.$u,CubeRoot:()=>o.MR,CubeRt:()=>r.at,CubeSubMap:()=>r.gv,CubeTable:()=>r.Ku,CubeText:()=>r.P6,CubeTextLink:()=>r.ju,CubeTip:()=>r.LZ,CubeTodo:()=>r.k9,LinkerLine:()=>r.sf,LinkerPoint:()=>r.e8,MapBase:()=>o.MT,MapInteraction:()=>C.T,MapNodeBase:()=>o.wP,MapTools:()=>S.U,Matrix2D:()=>S.c,NodeObserver:()=>r.Nj,NodeShape:()=>r.AG,NoteApi:()=>x.F,NoteBase:()=>l.K,NoteClipBoard:()=>c.F,NoteCourier:()=>d.W,NoteCubes:()=>f.h,NoteCursor:()=>u.P,NoteEvent:()=>p.z,NoteHistory:()=>m.PI,NoteHotkeys:()=>_.Wu,NoteIcons:()=>h.R,NoteListener:()=>v.t,NoteManager:()=>g.K,NotePainter:()=>b.W,NotePlayer:()=>m.C6,NoteScope:()=>y.R,NoteStats:()=>w.I,NoteTools:()=>k.I,Recorder:()=>m.vk,Waiter:()=>k.J,_ApiCommandNames:()=>n.tK,_CodeCommandNames:()=>n.GW,_CubeCommandName:()=>n.zS,_CursorCommandName:()=>n.K9,_DetaiListCommandName:()=>n.J8,_DocCommandName:()=>n.QI,_FomulaCommandNames:()=>n.nY,_FomulaSize:()=>n.$f,_HotKeys:()=>n.ZS,_HotKeysGroup:()=>n.ec,_Keys:()=>n.SN,_LinkerAnchor:()=>n._A,_LinkerCommandNames:()=>n.Sd,_ListCommandNames:()=>n.JC,_ListOrderedCommandNames:()=>n.mM,_MapCommandName:()=>n.kU,_MapGroup:()=>n.L6,_NavigationKey:()=>n.tX,_NodeCommandName:()=>n.s1,_NoteCores:()=>n.Mu,_NoteCubeTypes:()=>n.u0,_NoteEvents:()=>n.dp,_NoteMode:()=>n.fv,_PlayStatus:()=>n.yn,_RtCommandNames:()=>n.DI,_TableCommandNames:()=>n.BS,_TextCommandName:()=>n.lm,_TextLinkCommandNames:()=>n.gS,_TodoCommandNames:()=>n.Ny,cmd:()=>a.H,key:()=>_.Eb,keymap:()=>_.w4,node_observer:()=>r.iO});var e=i(1068),t={};for(const n in e)"default"!==n&&(t[n]=()=>e[n]);i.d(s,t);var n=i(6996),r=i(1556),o=i(7744),a=i(8219),l=i(4031),c=i(443),d=i(1701),u=i(2277),h=i(7676),p=i(3814),f=i(3513),m=i(4412),_=i(3408),g=i(346),b=i(8147),v=i(3736),y=i(5391),w=i(2742),x=i(3755),k=i(5955),S=i(2547),C=i(3676)})(),s})());
|