ht-emr 0.6.2 → 0.6.3

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.
@@ -1,8 +1,8 @@
1
1
  (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="canvas-editor-style",e.appendChild(document.createTextNode(`.ce-select-control-popup{max-width:160px;min-width:69px;max-height:225px;position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;overflow-y:auto}.ce-select-control-popup ul{list-style:none;padding:3px 0;margin:0;box-sizing:border-box}.ce-select-control-popup ul li{font-size:13px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#666;height:36px;line-height:36px;box-sizing:border-box;cursor:pointer}.ce-select-control-popup ul li:hover{background-color:#eef2fd}.ce-select-control-popup ul li.active{color:var(--COLOR-HOVER, #5175f4);font-weight:700}.ce-calculator{position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;padding:8px;width:200px}.ce-calculator-display{width:100%;height:40px;line-height:40px;text-align:right;padding:0 10px;margin-bottom:8px;border:1px solid #e4e7ed;border-radius:4px;background-color:#f5f7fa;font-size:16px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.ce-calculator-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ce-calculator-button{width:100%;height:36px;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;font-size:14px;cursor:pointer;transition:all .2s;box-sizing:border-box}.ce-calculator-button:hover{background-color:#eef2fd;border-color:#c6d1ff}.ce-calculator-button:active{background-color:#e1e8ff}.ce-calculator-button.operator{background-color:#f5f7fa}.ce-calculator-button.operator:hover{background-color:#eef2fd}.ce-calculator-button.equal{background-color:var(--COLOR-HOVER, #5175f4);color:#fff;border-color:var(--COLOR-HOVER, #5175f4)}.ce-calculator-button.equal:hover{background-color:var(--COLOR-HOVER, #6a84ff);border-color:var(--COLOR-HOVER, #6a84ff)}.ce-calculator-button.utility{background-color:#f0f2f5}.ce-calculator-button.utility:hover{background-color:#e6e8eb}.ce-date-container{display:none;width:300px;overflow:hidden;left:0;right:0;position:absolute;z-index:1;color:#606266;background:#fff;border-radius:4px;padding:10px;-webkit-user-select:none;user-select:none;border:1px solid #e4e7ed;box-shadow:0 2px 12px #0000001a}.ce-date-container.active{display:block}.ce-date-wrap{display:none}.ce-date-wrap.active{display:block}.ce-date-title{display:flex;justify-content:center;align-items:center;text-align:center;color:#606266;font-size:16px}.ce-date-title>span{display:inline-block}.ce-date-title>span:not(.ce-date-title__now){font-family:cursive;cursor:pointer}.ce-date-title>span:not(.ce-date-title__now):hover{color:#5175f4}.ce-date-title .ce-date-title__pre-year,.ce-date-title .ce-date-title__pre-month{width:15%}.ce-date-title .ce-date-title__now{width:40%}.ce-date-title .ce-date-title__next-year,.ce-date-title .ce-date-title__next-month{width:15%}.ce-date-week{width:100%;display:flex;justify-content:center;margin-top:15px;padding-bottom:5px;border-bottom:1px solid #e4e7ed}.ce-date-week>span{list-style:none;width:calc(100%/7);text-align:center;color:#606266;font-size:14px}.ce-date-day{width:100%;display:flex;flex-wrap:wrap;align-items:center;margin-top:5px}.ce-date-day>div{width:calc(100%/7);height:40px;text-align:center;color:#606266;font-size:14px;cursor:pointer;line-height:40px;border-radius:4px}.ce-date-day>div:hover{color:#5175f4;opacity:.8}.ce-date-day>div.active{color:#5175f4;font-weight:700}.ce-date-day>div.disable{color:#c0c4cc}.ce-date-day>div.select{color:#fff;background-color:#5175f4}.ce-time-wrap{display:none;padding:10px;height:286px}.ce-time-wrap ::-webkit-scrollbar{width:0}.ce-time-wrap.active{display:flex}.ce-time-wrap li{list-style:none}.ce-time-wrap>li{width:33.3%;height:100%;text-align:center}.ce-time-wrap>li>span{transform:translateY(-5px);display:inline-block}.ce-time-wrap>li>ol{height:calc(100% - 20px);overflow-y:auto;border:1px solid #e2e2e2;position:relative}.ce-time-wrap>li:first-child>ol{border-right:0}.ce-time-wrap>li:last-child>ol{border-left:0}.ce-time-wrap>li>ol>li{line-height:30px;cursor:pointer;transition:all .3s}.ce-time-wrap>li>ol>li:hover{background-color:#eaeaea}.ce-time-wrap>li>ol>li.active{color:#fff;background:#5175f4}.ce-date-menu{width:100%;height:28px;display:flex;justify-content:flex-end;align-items:center;padding-top:10px;position:relative;border-top:1px solid #e4e7ed}.ce-date-menu button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;appearance:none;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;-webkit-user-select:none;user-select:none;padding:7px 15px;font-size:12px;border-radius:3px;margin:0 0 0 10px}.ce-date-menu button:hover{color:#5175f4;border-color:#5175f4}.ce-date-menu button.ce-date-menu__time{border:1px solid transparent;position:absolute;left:0;margin-left:0}.ce-date-menu button.ce-date-menu__time:hover{color:#5175f4}.ce-block-item{position:absolute;z-index:0;background-color:#fff;border:1px solid rgb(235 236 240)}.ce-block-item .ce-resizer-selection{width:100%;height:100%}.ce-block-item .ce-resizer-mask{position:absolute;inset:0;z-index:1;background-color:transparent}.ce-table-tool__row{position:absolute;width:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed}.ce-table-tool__row .ce-table-tool__row__item{width:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__row .ce-table-tool__row__item:after{content:"";position:absolute;bottom:0;left:2px;width:8px;height:1px;background-color:#c0c6cf}.ce-table-tool__row .ce-table-tool__row__item:hover{background-color:#dadce0}.ce-table-tool__row .ce-table-tool__row__item:last-child:after{display:none}.ce-table-tool__quick__add{width:16px;height:16px;position:absolute;border-radius:50%;background-color:#e2e6ed;cursor:pointer}.ce-table-tool__quick__add:after{content:"+";color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-55%)}.ce-table-tool__select{width:16px;height:18px;position:absolute;border-radius:3px;cursor:pointer}.ce-table-tool__select:hover{background-color:#e2e6ed}.ce-table-tool__select:after{content:":::";color:#aaaaab;position:absolute;top:50%;left:50%;transform:translate(-75%,-50%) rotate(-90deg)}.ce-table-tool__col{position:absolute;height:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed;display:flex}.ce-table-tool__col .ce-table-tool__col__item{height:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__col .ce-table-tool__col__item:after{content:"";position:absolute;top:2px;left:-1px;width:1px;height:8px;z-index:1;background-color:#c0c6cf}.ce-table-tool__col .ce-table-tool__col__item:hover{background-color:#dadce0}.ce-table-tool__col .ce-table-tool__col__item:first-child:after{display:none}.ce-table-tool__row .ce-table-tool__row__item.active,.ce-table-tool__col .ce-table-tool__col__item.active{background-color:#c4d7fa}.ce-table-tool__col .ce-table-tool__anchor{right:-5px;width:10px;height:12px;z-index:9;position:absolute;cursor:col-resize}.ce-table-tool__row .ce-table-tool__anchor{bottom:-5px;left:0;width:12px;height:10px;z-index:9;position:absolute;cursor:row-resize}.ce-table-anchor__line{z-index:9;position:absolute;border:1px dotted #000000}.ce-table-tool__border{position:absolute;z-index:1;background:transparent;pointer-events:none}.ce-table-tool__border__row{position:absolute;cursor:row-resize;pointer-events:auto}.ce-table-tool__border__col{position:absolute;cursor:col-resize;pointer-events:auto}.ce-resizer-selection{position:absolute;border:1px solid;pointer-events:none}.ce-resizer-selection .resizer-handle{position:absolute;z-index:9;width:10px;height:10px;box-shadow:0 1px 4px #0000004d;border-radius:5px;border:2px solid #ffffff;box-sizing:border-box;pointer-events:initial}.ce-resizer-selection .handle-0{cursor:nw-resize}.ce-resizer-selection .handle-1{cursor:n-resize}.ce-resizer-selection .handle-2{cursor:ne-resize}.ce-resizer-selection .handle-3{cursor:e-resize}.ce-resizer-selection .handle-4{cursor:se-resize}.ce-resizer-selection .handle-5{cursor:s-resize}.ce-resizer-selection .handle-6{cursor:sw-resize}.ce-resizer-selection .handle-7{cursor:w-resize}.ce-resizer-size-view{display:flex;align-items:center;height:20px;white-space:nowrap;position:absolute;z-index:9;top:-30px;left:0;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px}.ce-resizer-size-view span{color:#fff;font-size:12px}.ce-resizer-image{position:absolute;opacity:.5}.ce-image-previewer{position:fixed;left:0;top:0;z-index:1000;width:100%;height:100%;overflow:hidden;background:#f2f4f7;display:flex;align-items:center;justify-content:center;animation:previewerAnimation .3s}@keyframes previewerAnimation{0%{opacity:.1}to{opacity:1}}.ce-image-previewer .image-close{width:24px;height:24px;display:inline-block;position:absolute;right:50px;top:30px;z-index:99;cursor:pointer;background:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.97%207l1.415%201.414-7.779%207.778%207.779%207.779-1.414%201.414-7.779-7.779-7.778%207.779L7%2023.97l7.778-7.779L7%208.414%208.414%207l7.778%207.778L23.971%207z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e") no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .image-close:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-container{position:relative}.ce-image-previewer .ce-image-container img{cursor:move;position:relative}.ce-image-previewer .ce-image-menu{height:50px;position:absolute;bottom:50px;z-index:99;display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i{width:32px;height:32px;margin:0 8px;cursor:pointer;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .ce-image-menu i:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-menu i.zoom-in{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%2014v-4h2v4h4v2h-4v4h-2v-4h-4v-2h4zm8.749%2010.163A11.952%2011.952%200%200115%2027C8.373%2027%203%2021.627%203%2015S8.373%203%2015%203s12%205.373%2012%2012c0%202.954-1.067%205.658-2.837%207.749l4.908%204.908-1.414%201.414-4.908-4.908zM15%2025c5.523%200%2010-4.477%2010-10S20.523%205%2015%205%205%209.477%205%2015s4.477%2010%2010%2010z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.zoom-out{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.749%2024.163A11.952%2011.952%200%200115%2027C8.373%2027%203%2021.627%203%2015S8.373%203%2015%203s12%205.373%2012%2012c0%202.954-1.067%205.658-2.837%207.749l4.908%204.908-1.414%201.414-4.908-4.908zM15%2025c5.523%200%2010-4.477%2010-10S20.523%205%2015%205%205%209.477%205%2015s4.477%2010%2010%2010zm-5-11h10v2H10v-2z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.rotate{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M16%204c6.627%200%2012%205.373%2012%2012a11.97%2011.97%200%2001-4%208.944V23h-.86A9.968%209.968%200%200026%2016c0-5.523-4.477-10-10-10S6%2010.477%206%2016c0%205.185%203.947%209.449%209%209.95v2.009C8.84%2027.451%204%2022.291%204%2016%204%209.373%209.373%204%2016%204z'%20fill-rule='nonzero'/%3e%3cpath%20d='M19.879%2027.328l1.767-6.717%204.95%204.95z'/%3e%3c/g%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.original-size{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%204h24v24H4V4zm2%202v20h20V6H6zm4%205h2v10h-2V11zm5%202h2v2h-2v-2zm0%204h2v2h-2v-2zm5-6h2v10h-2V11z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.image-download{background-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.5%2015v3.5h15V15H21v5H3v-5h1.5zm8.232-11.226v9.196l4.05-4.05%201.06%201.06-5.834%205.834-5.833-5.833%201.06-1.06%203.998%203.996V3.774h1.5z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu .image-navigate{display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i.image-pre{background-image:url("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.5%204.063L6.875%2010l5.625%205.938'%20stroke='%233D4757'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.image-next{background-image:url("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.5%204.063L13.125%2010%207.5%2015.938'%20stroke='%233D4757'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu .image-count{color:#000;font-size:20px}.ce-image-previewer .ce-image-menu i.disabled{cursor:not-allowed;opacity:.5}.ce-contextmenu-container{z-index:9;position:fixed;display:none;padding:4px;overflow-x:hidden;overflow-y:auto;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.ce-contextmenu-content{display:flex;flex-direction:column}.ce-contextmenu-content .ce-contextmenu-sub-item:after{position:absolute;content:"";width:16px;height:16px;right:12px;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M0%200h16v16H0z'/%3e%3cg%20fill='%23767C85'%3e%3cpath%20d='M7%2012.243l-.707-.707%204.243-4.243.707.707z'/%3e%3cpath%20d='M6.293%204.464L7%203.757%2011.243%208l-.707.707z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-content .ce-contextmenu-item{min-width:140px;padding:0 32px 0 16px;height:30px;display:flex;align-items:center;white-space:nowrap;box-sizing:border-box;cursor:pointer}.ce-contextmenu-content .ce-contextmenu-item.hover{background:#1937580a}.ce-contextmenu-content .ce-contextmenu-item span{max-width:300px;font-size:12px;color:#3d4757;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ce-contextmenu-content .ce-contextmenu-item span.ce-shortcut{color:#767c85;height:30px;flex:1;text-align:right;line-height:30px;margin-left:20px}.ce-contextmenu-content .ce-contextmenu-item i{width:16px;height:16px;vertical-align:middle;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;flex-shrink:0;margin-right:8px}.ce-contextmenu-divider{background-color:#e2e6ed;margin:4px 16px;height:1px}.ce-contextmenu-print{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M12%204h-1V2H5v2H4V2a1%201%200%20011-1h6a1%201%200%20011%201v2zm0%205v4a1%201%200%2001-1%201H5a1%201%200%2001-1-1V9h1v4h6V9h1z'/%3e%3cpath%20d='M12%2012v-1h2V5H2v6h2v1H2a1%201%200%2001-1-1V5a1%201%200%20011-1h12a1%201%200%20011%201v6a1%201%200%2001-1%201h-2z'/%3e%3cpath%20d='M3%208h10v1H3zm8-2h2v1h-2z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-image{background-image:url("data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_插入图片-16px-'%3e%3cg%20id='Group-19'%20transform='translate(1%201)'%3e%3cpath%20id='Combined-Shape'%20class='st0'%20d='M1%200h12c.6%200%201%20.4%201%201v11c0%20.6-.4%201-1%201H1c-.6%200-1-.4-1-1V1c0-.6.4-1%201-1zm0%201v11h12V1H1z'/%3e%3ccircle%20id='椭圆形'%20class='st0'%20cx='10'%20cy='4'%20r='1'/%3e%3cpath%20id='Path'%20class='st0'%20d='M8.5%2011.2l-4-4.1L1%2010.7V9.2c1.7-1.6%202.7-2.5%203-2.8.4-.5.7-.4%201%200L8.5%2010%2011%207.3c.4-.5.6-.5%201-.1l2%202.8v1.5l-2.5-3.4-3%203.1z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-image-change{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(2%204)'%20fill='%233D4757'%3e%3ccircle%20fill-rule='nonzero'%20cx='3'%20cy='1'%20r='1'/%3e%3cpath%20d='M7.473%208.223L3.47%204.107%200%207.667v-1.5C1.715%204.6%202.707%203.664%202.975%203.358c.402-.457.651-.39%201.042%200L7.473%207%209.96%204.349c.414-.462.62-.462%201.011-.071L13%207.06v1.5l-2.51-3.41-3.017%203.072z'/%3e%3c/g%3e%3cpath%20d='M6%201.5H1.5v12h13v-4V13a.5.5%200%2001-.5.5H2a.5.5%200%2001-.5-.5V2a.5.5%200%2001.5-.5h4zm8.5%208V6l-.5.5h1l-.5-.5v3.5zM6%201.5h4L9.5%201v1l.5-.5H6z'%20stroke='%233D4757'/%3e%3cpath%20d='M13.085%201.316l-3.814%204a1%201%200%20001.458%201.368l3.815-4a1%201%200%2010-1.459-1.368z'%20fill='%233D4757'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-row-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%233D4757'%20d='M8.5%205.5h6v4h-6z'/%3e%3cpath%20fill='%233D4757'%20d='M4%207v1h2V7zm-3%20.5L4%205v5zM1%201h12v1H1zm0%2012h12v1H1z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-top-row{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M8%205H7v3h1zm-.5-3L10%205H5z'/%3e%3crect%20stroke='%233D4757'%20x='1.5'%20y='10.5'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-bottom-row{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M7%2011h1V8H7zm.5%203L5%2011h5z'/%3e%3crect%20stroke='%233D4757'%20x='1.5'%20y='2.5'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-left-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M11%207v1h3V7zm-3%20.5L11%205v5z'/%3e%3crect%20stroke='%233D4757'%20transform='rotate(90%204%207.5)'%20x='-2'%20y='6'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-right-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M5%208V7H2v1zm3-.5L5%2010V5z'/%3e%3crect%20stroke='%233D4757'%20transform='rotate(90%2012%207.5)'%20x='6'%20y='6'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-row-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23929AA8'%20d='M8.5%206.5h6v2h-6z'/%3e%3cpath%20fill='%233D4757'%20d='M2%2012h11v1H2zM2%202h11v1H2zm.63%203L7%209.35l-.635.65L2%205.63z'/%3e%3cpath%20fill='%233D4757'%20d='M2%209.363L6.355%205%207%205.707%202.695%2010z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-row{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23929AA8'%20d='M8.5%205.5h6v4h-6z'/%3e%3cpath%20fill='%233D4757'%20d='M1%2013h12v1H1zM1%201h12v1H1zm0%204h1v1H1zm1%201h1v1H2zm1%201h1v1H3zm1-1h1v1H4zm1-1h1v1H5zM4%208h1v1H4zM2%208h1v1H2zm3%201h1v1H5zM1%209h1v1H1z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23929AA8'%20d='M5.5%207.5v-6h4v6z'/%3e%3cpath%20fill='%233D4757'%20d='M13%2015V3h1v12zM1%2015V3h1v12zm4%200v-1h1v1zm1-1v-1h1v1zm1-1v-1h1v1zm-1-1v-1h1v1zm-1-1v-1h1v1zm3%201v-1h1v1zm0%202v-1h1v1zm1-3v-1h1v1zm0%204v-1h1v1z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-table{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M14%2013h-1v-3H2v3H1v-3a1%201%200%20011-1h11a1%201%200%20011%201v3z'%20fill-rule='nonzero'/%3e%3cpath%20d='M5.625%202L10%206.375%209.375%207%205%202.625z'/%3e%3cpath%20d='M5%206.375L9.375%202l.625.625L5.625%207z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-merge-cell{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M6%201v1H2v11h4v1H2a1%201%200%2001-1-1V2a1%201%200%20011-1h4zm3%200h4a1%201%200%20011%201v11a1%201%200%2001-1%201H9v-1h4V2H9V1z'/%3e%3cpath%20fill-rule='nonzero'%20d='M6%201h1v4H6zm2%200h1v4H8z'/%3e%3cpath%20d='M8%207.5L10%206v3zm-1%200L5%206v3z'/%3e%3cpath%20d='M9%207h3v1H9zM3%207h3v1H3z'/%3e%3cpath%20fill-rule='nonzero'%20d='M8%2010h1v4H8zm-2%200h1v4H6z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-merge-cancel-cell{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M6%201v1H2v11h4v1H2a1%201%200%2001-1-1V2a1%201%200%20011-1h4zm3%200h4a1%201%200%20011%201v11a1%201%200%2001-1%201H9v-1h4V2H9V1z'/%3e%3cpath%20fill-rule='nonzero'%20d='M6%201h1v4H6zm2%200h1v4H8z'/%3e%3cpath%20d='M3%207.5L5%206v3zm9%200L10%206v3z'/%3e%3cpath%20d='M4%207h3v1H4zm4%200h3v1H8z'/%3e%3cpath%20fill-rule='nonzero'%20d='M8%2010h1v4H8zm-2%200h1v4H6z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-vertical-align{background-image:url("data:image/svg+xml,%3csvg%20height='16'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2zm0-3h8v1H2zm0-3h12v1H2zm0-6h12v1H2zm0%203h8v1H2z'%20fill='%233d4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-vertical-align-top{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8%208H7v6h1zm-.5-3L10%208H5zM2%203h11v1H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-vertical-align-middle{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8%2012H7v3h1zm-.5-3l2.5%203H5zM7%203h1V0H7zm.5%203L5%203h5zM2%207h11v1H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-vertical-align-bottom{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%209h1V3H7zm.5%203L5%209h5zM2%2013h11v1H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-border-all{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M3%208h11v1H3z'/%3e%3cpath%20fill='%233D4757'%20d='M9%203v11H8V3z'/%3e%3c/svg%3e")}.ce-contextmenu-border-empty{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13%203h-1V2h1a1%201%200%20011%201v1h-1V3zm-3-1v1H8.5v2h-1V3H6V2h4zM4%202v1H3v1H2V3a1%201%200%20011-1h1zM2%206h1v1.5h2v1H3V10H2V6zm0%206h1v1h1v1H3a1%201%200%2001-1-1v-1zm4%202v-1h1.5v-2h1v2H10v1H6zm6%200v-1h1v-1h1v1a1%201%200%2001-1%201h-1zm2-4h-1V8.5h-2v-1h2V6h1v4zM8.5%207.5v-1h-1v1h-1v1h1v1h1v-1h1v-1h-1z'%20fill='%23AAACB0'/%3e%3c/svg%3e")}.ce-contextmenu-border-dash{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13%203h-1V2h1a1%201%200%20011%201v1h-1V3zm-3-1v1H8.5v2h-1V3H6V2h4zM4%202v1H3v1H2V3a1%201%200%20011-1h1zM2%206h1v1.5h2v1H3V10H2V6zm0%206h1v1h1v1H3a1%201%200%2001-1-1v-1zm4%202v-1h1.5v-2h1v2H10v1H6zm6%200v-1h1v-1h1v1a1%201%200%2001-1%201h-1zm2-4h-1V8.5h-2v-1h2V6h1v4zM8.5%207.5v-1h-1v1h-1v1h1v1h1v-1h1v-1h-1z'%20fill='%23000000'/%3e%3c/svg%3e")}.ce-contextmenu-border-external{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%233D4757'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%205V3H8v2h1zm0%209v-2H8v2h1zM5%208H3v1h2V8zm9%200h-2v1h2V8zM9%207v1h1v1H9v1H8V9H7V8h1V7h1z'%20fill='%23AAACB0'/%3e%3c/svg%3e")}.ce-contextmenu-border-internal{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%205V3H8v2h1zm0%209v-2H8v2h1zM5%208H3v1h2V8zm9%200h-2v1h2V8zM9%207v1h1v1H9v1H8V9H7V8h1V7h1z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-contextmenu-border-td{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20d='M8.5%202.5%20v6%20h-6'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-top{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M2.5%203%20h12'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-left{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M3%203%20v11'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-bottom{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M2.5%2014%20h12'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-right{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M14%203%20v11'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-forward{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'%20/%3e%3cpath%20stroke='%233D4757'%20d='M14%203%20l-11%2011'%20/%3e%3c/svg%3e")}.ce-contextmenu-border-td-back{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'%20/%3e%3cpath%20stroke='%233D4757'%20d='M3%203%20l11%2011'%20/%3e%3c/svg%3e")}.ce-hyperlink-popup{background:#fff;box-shadow:0 2px 12px #626b8433;border-radius:2px;color:#3d4757;padding:12px 16px;position:absolute;z-index:1;text-align:center;display:none}.ce-hyperlink-popup a{min-width:100px;max-width:300px;font-size:12px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;text-decoration:none;border-bottom-width:1px;border-bottom-style:solid;color:#00f}.ce-zone-indicator>div{padding:3px 6px;color:#000;font-size:12px;background:#dae7fc;position:absolute;transform-origin:0 0}.ce-zone-indicator-border__top,.ce-zone-indicator-border__bottom,.ce-zone-indicator-border__left,.ce-zone-indicator-border__right{display:block;position:absolute;z-index:0}.ce-zone-indicator-border__top{border-top:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__bottom{border-top:2px dashed rgb(238,238,238);width:100%}.ce-zone-indicator-border__left{border-left:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__right{border-right:2px dashed rgb(238,238,238)}.ce-zone-tip{display:none;align-items:center;height:30px;white-space:nowrap;position:fixed;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px;z-index:9;transition:all .3s;outline:none;-webkit-user-select:none;user-select:none;pointer-events:none;transform:translate(10px,10px)}.ce-zone-tip.show{display:flex}.ce-zone-tip span{color:#fff;font-size:12px}.ce-inputarea{min-width:60px!important;min-height:0;margin:0;padding:0;left:0;top:0;letter-spacing:0;font-size:12px;position:absolute;z-index:-1;outline:none;resize:none;border:none;overflow:hidden;color:transparent;-webkit-user-select:none;user-select:none;caret-color:transparent;background-color:transparent;white-space:pre}.ce-cursor{width:1px;height:20px;left:0;right:0;position:absolute;outline:none;background-color:#000;pointer-events:none}.ce-cursor.ce-cursor--animation{animation-duration:1s;animation-iteration-count:infinite;animation-name:cursorAnimation}@keyframes cursorAnimation{0%{opacity:1}13%{opacity:0}50%{opacity:0}63%{opacity:1}to{opacity:1}}.ce-float-image{position:absolute;opacity:.5;pointer-events:none}.ce-button-input-modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.ce-button-input-modal__content{background:#fff;border-radius:8px;padding:20px;min-width:320px;max-width:480px;box-shadow:0 4px 20px #00000026}.ce-button-input-modal__title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px}.ce-button-input-modal__textarea{width:100%;min-height:100px;padding:10px 12px;border:1px solid #dcdfe6;border-radius:4px;font-size:13px;line-height:1.5;resize:vertical;outline:none;box-sizing:border-box;font-family:inherit}.ce-button-input-modal__textarea:focus{border-color:#5175f4}.ce-button-input-modal__textarea::placeholder{color:#c0c4cc}.ce-button-input-modal__buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.ce-button-input-modal__cancel,.ce-button-input-modal__confirm{padding:8px 16px;font-size:13px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.ce-button-input-modal__cancel:hover{color:#5175f4;border-color:#5175f4}.ce-button-input-modal__confirm{background:#5175f4;border-color:#5175f4;color:#fff}.ce-button-input-modal__confirm:hover{background:#409eff;border-color:#409eff}.ce-button-edit-modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.ce-button-edit-modal__content{background:#fff;border-radius:8px;padding:20px;min-width:320px;max-width:480px;box-shadow:0 4px 20px #00000026}.ce-button-edit-modal__title{font-size:14px;font-weight:500;color:#333;margin-bottom:16px}.ce-button-edit-modal__form{display:flex;flex-direction:column;gap:12px}.ce-button-edit-modal__field{display:flex;align-items:center;gap:8px}.ce-button-edit-modal__field label{min-width:80px;font-size:13px;color:#606266}.ce-button-edit-modal__field input{flex:1;padding:8px 12px;border:1px solid #dcdfe6;border-radius:4px;font-size:13px;outline:none;box-sizing:border-box}.ce-button-edit-modal__field input:focus{border-color:#5175f4}.ce-button-edit-modal__field input::placeholder{color:#c0c4cc}.ce-button-edit-modal__buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.ce-button-edit-modal__cancel,.ce-button-edit-modal__confirm{padding:8px 16px;font-size:13px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.ce-button-edit-modal__cancel:hover{color:#5175f4;border-color:#5175f4}.ce-button-edit-modal__confirm{background:#5175f4;border-color:#5175f4;color:#fff}.ce-button-edit-modal__confirm:hover{background:#409eff;border-color:#409eff}.ce-number-input-modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.ce-number-input-modal__content{background:#fff;border-radius:8px;padding:20px;min-width:300px;max-width:400px;box-shadow:0 4px 20px #00000026}.ce-number-input-modal__title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px}.ce-number-input-modal__hint{font-size:12px;color:#909399;margin-bottom:12px}.ce-number-input-modal__input{width:100%;padding:10px 12px;border:1px solid #dcdfe6;border-radius:4px;font-size:13px;outline:none;box-sizing:border-box}.ce-number-input-modal__input:focus{border-color:#5175f4}.ce-number-input-modal__input::placeholder{color:#c0c4cc}.ce-number-input-modal__error{font-size:12px;color:#f56c6c;margin-top:8px}.ce-number-input-modal__buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.ce-number-input-modal__cancel,.ce-number-input-modal__confirm{padding:8px 16px;font-size:13px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.ce-number-input-modal__cancel:hover{color:#5175f4;border-color:#5175f4}.ce-number-input-modal__confirm{background:#5175f4;border-color:#5175f4;color:#fff}.ce-number-input-modal__confirm:hover{background:#409eff;border-color:#409eff}.tooth-position-edit-modal,.tooth-position-create-modal{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000}.tooth-position-modal__mask{position:absolute;top:0;left:0;width:100%;height:100%;background:#00000080}.tooth-position-modal__container{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#fff;border-radius:8px;box-shadow:0 4px 12px #00000026;min-width:400px;max-width:90vw}.tooth-position-modal__header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #e8e8e8}.tooth-position-modal__header span{font-size:16px;font-weight:500;color:#333}.tooth-position-modal__close{font-size:20px;cursor:pointer;color:#999;line-height:1}.tooth-position-modal__close:hover{color:#333}.tooth-position-modal__content{padding:20px;max-height:60vh;overflow-y:auto}.tooth-section{margin-bottom:20px}.tooth-section:last-child{margin-bottom:0}.tooth-section-title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px;padding-left:8px;border-left:3px solid #1890ff}.tooth-row{display:flex;align-items:center;margin-bottom:8px}.tooth-row:last-child{margin-bottom:0}.tooth-row-label{width:30px;font-size:13px;color:#666}.tooth-buttons{display:flex;gap:8px;flex-wrap:wrap}.letter-buttons{margin-left:30px}.tooth-checkbox{display:flex;align-items:center;cursor:pointer}.tooth-checkbox input{display:none}.tooth-checkbox span{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid #d9d9d9;border-radius:4px;background:#f5f5f5;font-size:14px;color:#333;transition:all .2s}.tooth-checkbox input:checked+span{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-checkbox:hover span{border-color:#1890ff}.tooth-position-modal__footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 20px;border-top:1px solid #e8e8e8}.tooth-position-modal__footer .btn-cancel,.tooth-position-modal__footer .btn-confirm{padding:8px 20px;font-size:14px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.tooth-position-modal__footer .btn-cancel:hover{color:#1890ff;border-color:#1890ff}.tooth-position-modal__footer .btn-confirm{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-position-modal__footer .btn-confirm:hover{background:#40a9ff;border-color:#40a9ff}.tooth-grid-container{display:flex;flex-direction:column;align-items:center;padding:15px 20px;background:#fafafa;border-radius:8px;margin-bottom:15px;position:relative}.tooth-quick-buttons{display:flex;gap:6px;margin-bottom:16px}.tooth-quick-buttons-left{display:flex;flex-direction:column;gap:6px;flex:1}.tooth-quick-buttons-row{display:flex;gap:6px}.tooth-quick-btn{padding:6px 12px;font-size:12px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;background:#fff;color:#333;transition:all .2s;white-space:nowrap}.tooth-quick-btn:hover{border-color:#1890ff;color:#1890ff}.tooth-quick-btn.selected{background:#0ff;border-color:#0ff;color:#fff}.tooth-quick-btn--clear{background:#ff6b6b;border-color:#ff6b6b;color:#fff}.tooth-quick-btn--clear:hover{background:#ff5252;border-color:#ff5252;color:#fff}.tooth-grid-container:before{content:"";position:absolute;left:50%;top:20px;bottom:20px;width:2px;background:#000;transform:translate(-50%);z-index:1}.tooth-grid-container:after{content:"";position:absolute;left:20px;right:20px;top:50%;height:2px;background:#000;transform:translateY(-50%);z-index:1}.tooth-grid-letter-row,.tooth-grid-number-row{display:flex;align-items:center;justify-content:center;position:relative;z-index:2}.tooth-grid-half{display:flex;align-items:center;justify-content:center;gap:4px}.tooth-grid-half.left{justify-content:flex-end;padding-right:15px}.tooth-grid-half.right{justify-content:flex-start;padding-left:15px}.tooth-grid-divider-v,.tooth-grid-divider-h{display:none}.tooth-grid-number-item{width:34px;height:32px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;color:#333;cursor:pointer;background:#fff;transition:all .2s;box-sizing:border-box;border:1px solid #d9d9d9;border-radius:12px}.upper-number-row .tooth-grid-number-item{border-top:none;border-radius:0 0 12px 12px}.lower-number-row .tooth-grid-number-item{border-bottom:none;border-radius:12px 12px 0 0}.tooth-grid-number-item[data-value="1"],.tooth-grid-number-item[data-value="2"],.tooth-grid-number-item[data-value="3"]{border-radius:50px}.upper-number-row .tooth-grid-number-item[data-value="1"],.upper-number-row .tooth-grid-number-item[data-value="2"],.upper-number-row .tooth-grid-number-item[data-value="3"]{border-top:none!important;border-radius:0 0 50px 50px!important}.lower-number-row .tooth-grid-number-item[data-value="1"],.lower-number-row .tooth-grid-number-item[data-value="2"],.lower-number-row .tooth-grid-number-item[data-value="3"]{border-bottom:none!important;border-radius:50px 50px 0 0!important}.tooth-grid-number-item:hover{border-color:#1890ff;color:#1890ff}.tooth-grid-number-item.selected{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-grid-letter-item{width:34px;height:32px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;color:#333;cursor:pointer;background:#fff;border:1px solid #d9d9d9;transition:all .2s;box-sizing:border-box;border-radius:12px}.upper-letter-row .tooth-grid-letter-item{border-top:none;border-radius:0 0 12px 12px}.lower-letter-row .tooth-grid-letter-item{border-bottom:none;border-radius:12px 12px 0 0}.tooth-grid-letter-item[data-value=A],.tooth-grid-letter-item[data-value=B],.tooth-grid-letter-item[data-value=C]{border-radius:50px}.upper-letter-row .tooth-grid-letter-item[data-value=A],.upper-letter-row .tooth-grid-letter-item[data-value=B],.upper-letter-row .tooth-grid-letter-item[data-value=C]{border-top:none!important;border-radius:0 0 50px 50px!important}.lower-letter-row .tooth-grid-letter-item[data-value=A],.lower-letter-row .tooth-grid-letter-item[data-value=B],.lower-letter-row .tooth-grid-letter-item[data-value=C]{border-bottom:none!important;border-radius:50px 50px 0 0!important}.tooth-grid-letter-item:hover{border-color:#1890ff;color:#1890ff}.tooth-grid-letter-item.selected{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-grid-letter-row.hidden,.tooth-grid-number-row.hidden{display:none}.tooth-grid-letter-row{margin-bottom:8px}.tooth-grid-number-row.upper-number-row{margin-bottom:15px}.tooth-grid-number-row.lower-number-row{margin-top:15px}.tooth-grid-letter-row.lower-letter-row{margin-top:8px}.tooth-preview-section{padding-top:10px;border-top:1px solid #e8e8e8}.tooth-preview-title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px}.tooth-preview-wrapper{display:flex;gap:15px}.tooth-preview-container{display:flex;justify-content:center;align-items:center;padding:10px;background:#fafafa;border-radius:8px;flex:1;min-height:60px}.tooth-preview-grid{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:0;width:100%;min-height:70px;position:relative}.tooth-preview-grid:before{content:"";position:absolute;left:50%;top:0;bottom:0;width:1px;background:#000;transform:translate(-50%)}.tooth-preview-grid:after{content:"";position:absolute;top:50%;left:0;right:0;height:1px;background:#000;transform:translateY(-50%)}.tooth-preview-quadrant{display:flex;align-items:center;padding:5px 10px;font-size:12px;flex-wrap:wrap;gap:4px;justify-content:center}.tooth-preview-upper-left{justify-content:flex-end}.tooth-preview-upper-right{justify-content:flex-start}.tooth-preview-lower-left{justify-content:flex-end}.tooth-preview-lower-right{justify-content:flex-start}.tooth-preview-tooth{position:relative;display:inline;margin:0 4px}.tooth-preview-tooth-value{font-size:12px}.tooth-preview-tooth-value--deciduous{font-size:10px}.tooth-preview-tooth-bracket{font-size:12px}.tooth-preview-supernumerary{font-size:9px;vertical-align:super;margin:0 1px}.tooth-preview-surface{font-size:9px;vertical-align:super;margin-left:1px}.tooth-extra-panel{width:100px;display:flex;flex-direction:column;gap:10px}.tooth-surface-panel{background:#fafafa;border-radius:8px;padding:10px 20px}.tooth-surface-title{font-size:12px;font-weight:500;color:#333;margin-bottom:8px;text-align:center}.tooth-surface-grid{display:flex;flex-direction:column;gap:4px;align-items:center}.tooth-surface-row{display:flex;gap:4px;justify-content:center}.tooth-surface-item{width:30px;height:30px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;color:#333;cursor:pointer;background:#fff;border:1px dashed #d9d9d9;border-radius:5px;transition:all .2s;box-sizing:border-box}.tooth-surface-item--indent{margin-left:17px}.tooth-surface-item:hover{border-color:#1890ff;color:#1890ff}.tooth-surface-item.selected{background:#1890ff;border-color:#1890ff;border-style:solid;color:#fff}.tooth-supernumerary-panel{background:#fafafa;border-radius:8px;padding:10px 20px}.tooth-supernumerary-title{font-size:12px;font-weight:500;color:#333;margin-bottom:4px;text-align:center}.tooth-supernumerary-hint{font-size:10px;color:#999;font-weight:400}.tooth-supernumerary-grid{display:flex;gap:8px;justify-content:center;margin-top:8px}.tooth-supernumerary-item{width:30px;height:35px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;color:#333;cursor:pointer;background:#fff;border:1px solid #d9d9d9;border-bottom:none;border-radius:50px;transition:all .2s;box-sizing:border-box}.tooth-supernumerary-item:hover{border-color:#1890ff;color:#1890ff}.tooth-supernumerary-item.selected{background:#1890ff;border-color:#1890ff;color:#fff}.dialog-mask{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000;z-index:99}.dialog-container{position:fixed;inset:0;overflow:auto;z-index:999;margin:0;display:flex;justify-content:center;align-items:center}.dialog{position:absolute;padding:0 30px 30px;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.dialog-title{position:relative;border-bottom:1px solid #e2e6ed;margin-bottom:30px;height:60px;display:flex;align-items:center;justify-content:space-between}.dialog-title i{width:16px;height:16px;cursor:pointer;display:inline-block;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.9%208.192l4.242%204.243-.707.707L8.192%208.9%203.95%2013.142l-.707-.707%204.242-4.243L3.243%203.95l.707-.707%204.242%204.242%204.243-4.242.707.707L8.9%208.192z'%20fill='%236A6A6A'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.dialog-option__item{margin-bottom:18px;display:flex;align-items:center;justify-content:space-between}.dialog-option__item span{margin-right:12px;font-size:14px;color:#3d4757;position:relative}.dialog-option__item input,.dialog-option__item textarea,.dialog-option__item select{width:276px;height:30px;border-radius:2px;border:1px solid #d3d3d3;min-height:30px;padding:5px;box-sizing:border-box;outline:none;appearance:none;-webkit-user-select:none;user-select:none;font-family:inherit}.dialog-option__item input:focus,.dialog-option__item textarea:focus{border-color:#4991f2}.dialog-option__item--require:before{content:"*";color:#f56c6c;margin-right:4px;position:absolute;left:-8px}.dialog-menu{display:flex;align-items:center;justify-content:flex-end}.dialog-menu button{position:relative;display:inline-block;border:1px solid #e2e6ed;border-radius:2px;background:#fff;line-height:22px;padding:0 16px;white-space:nowrap;cursor:pointer}.dialog-menu button:hover{background:#1937580a}.dialog-menu__cancel{margin-right:16px}.dialog-menu button[type=submit]{color:#fff;background:#4991f2;border-color:#4991f2}.dialog-menu button[type=submit]:hover{background:#5b9cf3;border-color:#5b9cf3}.dialog-radio-group{display:flex;flex-direction:column;gap:8px}.dialog-radio-group--horizontal{flex-direction:row;gap:16px}.dialog-radio-item{display:flex;align-items:center;cursor:pointer;font-size:14px;color:#3d4757}.dialog-radio-item input[type=radio]{width:16px;height:16px;margin:0 6px 0 0;cursor:pointer;appearance:auto}.dialog-radio-item span{margin:0}`)),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- (function(l,Qe){typeof exports=="object"&&typeof module<"u"?Qe(exports):typeof define=="function"&&define.amd?define(["exports"],Qe):(l=typeof globalThis<"u"?globalThis:l||self,Qe(l["canvas-editor"]={}))})(this,(function(l){"use strict";const Qe="0.6.2";l.MaxHeightRatio=void 0,(function(o){o.HALF="half",o.ONE_THIRD="one-third",o.QUARTER="quarter"})(l.MaxHeightRatio||(l.MaxHeightRatio={})),l.NumberType=void 0,(function(o){o.ARABIC="arabic",o.CHINESE="chinese"})(l.NumberType||(l.NumberType={})),l.ImageDisplay=void 0,(function(o){o.INLINE="inline",o.BLOCK="block",o.SURROUND="surround",o.FLOAT_TOP="float-top",o.FLOAT_BOTTOM="float-bottom"})(l.ImageDisplay||(l.ImageDisplay={})),l.LocationPosition=void 0,(function(o){o.BEFORE="before",o.AFTER="after",o.OUTER_BEFORE="outer-before",o.OUTER_AFTER="outer-after"})(l.LocationPosition||(l.LocationPosition={})),l.FlexDirection=void 0,(function(o){o.ROW="row",o.COLUMN="column"})(l.FlexDirection||(l.FlexDirection={}));const _="​",Ni=`
3
- `,fo=" ",Fi="&nbsp;",Vr=["·","、",":",":",",",",",".","。",";",";","?","?","!","!"],yi={[l.MaxHeightRatio.HALF]:1/2,[l.MaxHeightRatio.ONE_THIRD]:1/3,[l.MaxHeightRatio.QUARTER]:1/4},To={ENGLISH:"A-Za-z",NUMBER:"0-9.$¥",SPANISH:"A-Za-zÁÉÍÓÚáéíóúÑñÜü",FRENCH:"A-Za-zÀÂÇàâçÉéÈèÊêËëÎîÏïÔôÙùÛûŸÿ",GERMAN:"A-Za-zÄäÖöÜüß",RUSSIAN:"А-Яа-яЁё",PORTUGUESE:"A-Za-zÁÉÍÓÚáéíóúÃÕãõÇç",ITALIAN:"A-Za-zÀàÈèÉéÌìÍíÎîÓóÒòÙù",DUTCH:"A-Za-zÀàÁáÂâÄäÈèÉéÊêËëÌìÍíÎîÏïÓóÒòÔôÖöÙùÛûÜü",SWEDISH:"A-Za-zÅåÄäÖö",GREEK:"ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"},Yr="中";l.RowFlex=void 0,(function(o){o.LEFT="left",o.CENTER="center",o.RIGHT="right",o.ALIGNMENT="alignment",o.JUSTIFY="justify"})(l.RowFlex||(l.RowFlex={}));const mo=/[0-9.]/,Dr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,Ur=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\u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uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,wr=new RegExp(`${Ur.source}|${Dr.source}`,"g"),Zr=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,po=new RegExp(`^[${_}
4
- ]`),Qr=/[^0-9\+\-\.eE,]/,vr=/\s/;function Kr(o,t){let e;return function(...n){e&&window.clearTimeout(e),e=window.setTimeout(()=>{o.apply(this,n)},t)}}function Hr(o,t){let e=0,n;return function(...i){const r=Date.now();r-e>=t?(window.clearTimeout(n),o.apply(this,i),e=r):(window.clearTimeout(n),n=window.setTimeout(()=>{o.apply(this,i),e=r},t))}}function Lo(o,t){if(!o||typeof o!="object")return o;let e={};return Array.isArray(o)?e=o.map(n=>Lo(n,t)):Object.keys(o).forEach(n=>{t.includes(n)||(e[n]=Lo(o[n],t))}),e}function at(o){if(typeof structuredClone=="function")return structuredClone(o);if(!o||typeof o!="object")return o;let t={};return Array.isArray(o)?t=o.map(e=>at(e)):Object.keys(o).forEach(e=>{t[e]=at(o[e])}),t}function Io(o){return o&&o.nodeType===1&&o.tagName.toLowerCase()==="body"}function Wi(o,t,e){if(o&&!Io(o))for(o=o;o;){if(!t||t(o)||Io(o))return t&&!t(o)&&Io(o)?null:o;o=o.parentNode}return null}function lt(){function o(){return((1+Math.random())*65536|0).toString(16).substring(1)}return o()+o()+"-"+o()+"-"+o()+"-"+o()+"-"+o()+o()+o()}function ct(o){const t=[];if(Intl.Segmenter){const n=new Intl.Segmenter().segment(o);for(const{segment:i}of n)t.push(i)}else{const e=new Map;for(const i of o.matchAll(wr))e.set(i.index,i[0]);let n=0;for(;n<o.length;){const i=e.get(n);i?(t.push(i),n+=i.length):(t.push(o[n]),n++)}}return t}function bi(o,t){const e=document.createElement("a");e.href=o,e.download=t,e.click()}function _r(o,t){xr(3,o,t)}function xr(o,t,e){let n=0,i=0;const r=function(s){n=new Date().getTime()-i<300?n+1:0,i=new Date().getTime(),n>=o-1&&(e(s),n=0)};t.addEventListener("click",r)}function Dn(o){return Object.prototype.toString.call(o)==="[object Object]"}function Po(o){return Array.isArray(o)}function Mo(o){return Object.prototype.toString.call(o)==="[object Number]"}function Gr(o){return Object.prototype.toString.call(o)==="[object String]"}function Vi(o,t){if(Dn(o)&&Dn(t)){const e=t;for(const[n,i]of Object.entries(o))e[n]?e[n]=Vi(i,e[n]):e[n]=i}else Po(o)&&Po(t)&&t.push(...o);return t}function Oo(o){if(typeof queueMicrotask=="function"){queueMicrotask(()=>{o()});return}if(typeof Promise<"u"){Promise.resolve().then(()=>{o()});return}setTimeout(()=>{o()},0)}function Ar(o){const t=["零","一","二","三","四","五","六","七","八","九"],e=["","十","百","千","万","十","百","千","亿","十","百","千","万","十","百","千","亿"];if(!o||isNaN(o))return"零";const n=o.toString().split("");let i="";for(let r=0;r<n.length;r++){const s=n.length-1-r;i=`${e[r]}${i}`,i=`${t[Number(n[s])]}${i}`}return i=i.replace(/零(千|百|十)/g,"零").replace(/十零/g,"十"),i=i.replace(/零+/g,"零"),i=i.replace(/零亿/g,"亿").replace(/零万/g,"万"),i=i.replace(/亿万/g,"亿"),i=i.replace(/零+$/,""),i=i.replace(/^一十/g,"十"),i}function Ye(o,t,e){for(let n=0;n<o.length;n++){const i=o[n],r=t[i];r!==void 0?e[i]=r:delete e[i]}}function Yi(o,t){if(!(!t.length||!o.length))for(let e=o.length-1;e>=0;e--)t.includes(o[e])&&o.splice(e,1)}function Dt(o,t){const e={};for(const n in o)t.includes(n)&&(e[n]=o[n]);return e}function ie(o,t){const e={};for(const n in o)t.includes(n)||(e[n]=o[n]);return e}function kr(o){const e=new TextEncoder().encode(o),n=Array.from(e,r=>String.fromCharCode(r));return window.btoa(n.join(""))}function Jr(o){let t=o.parentElement;for(;t;){const n=window.getComputedStyle(t).getPropertyValue("overflow-y");if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"))return t;t=t.parentElement}return document.documentElement}function Di(o,t){return o.length!==t.length?!1:!o.some(e=>!t.includes(e))}function Br(o,t){if(!Dn(o)||!Dn(t))return!1;const e=Object.keys(o),n=Object.keys(t);return e.length!==n.length?!1:!e.some(i=>t[i]!==o[i])}function $r(o,t){const e=o.x,n=o.x+o.width,i=o.y,r=o.y+o.height,s=t.x,a=t.x+t.width,c=t.y,d=t.y+t.height;return!(e>a||n<s||i>d||r<c)}function Ui(o){return o==null}function Un(o){return o.replace(/\r\n|\r/g,`
5
- `)}function wi(o,t,e=0){const n=Math.max(0,Math.floor(e));if(n>=o.length)return typeof t=="string"&&t===""?{index:o.length,length:0}:{index:-1,length:0};if(typeof t=="string"){if(t==="")return{index:n,length:0};const c=o.indexOf(t,n);return c===-1?{index:-1,length:0}:{index:c,length:t.length}}const i=t.flags,r=i.includes("g")?i:i+"g",s=new RegExp(t.source,r);s.lastIndex=n;const a=s.exec(o);return a?{index:a.index,length:a[0].length}:{index:-1,length:0}}function Zi(o,t){if(!t){o.scrollTop=0;return}const e=[];let n=t.offsetParent;for(;n&&o!==n&&o.contains(n);)e.push(n),n=n.offsetParent;const i=t.offsetTop+e.reduce((c,d)=>c+d.offsetTop,0),r=i+t.offsetHeight,s=o.scrollTop,a=s+o.clientHeight;i<s?o.scrollTop=i:r>a&&(o.scrollTop=r-o.clientHeight)}function bt(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function zr(o,t){return o.performance.enabled&&t>=o.performance.threshold}function Co(o,t,e,n=[],i){if(!zr(o,e))return;const r={duration:Number(e.toFixed(2)),breakdown:n.map(s=>({label:s.label,duration:Number(s.duration.toFixed(2))})),...i};console.log(`[canvas-editor perf] ${t}`,r)}const jr=12,qr={width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF",dragFloatImageDisabled:!1},de="editor-component",z="ce",Tn=`${z}-clipboard`,So={print:{imagePreviewerDisabled:!1,backgroundDisabled:!1},readonly:{imagePreviewerDisabled:!1},form:{controlDeletableDisabled:!1,inputTraceEnabled:!0,deleteTraceEnabled:!0}};var Zt;(function(o){o.UP="top",o.DOWN="down",o.LEFT="left",o.RIGHT="right"})(Zt||(Zt={}));const ve=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),tl=typeof navigator<"u"&&/iPad|iPhone/.test(navigator.userAgent),el=/Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),nl=typeof navigator<"u"&&/Firefox/.test(navigator.userAgent);l.ElementType=void 0,(function(o){o.TEXT="text",o.TEXTFIELD="TextField",o.BUTTON="button",o.IMAGE="image",o.TABLE="table",o.HYPERLINK="hyperlink",o.SUPERSCRIPT="superscript",o.SUBSCRIPT="subscript",o.SEPARATOR="separator",o.PAGE_BREAK="pageBreak",o.CONTROL="control",o.AREA="area",o.CHECKBOX="checkbox",o.RADIO="radio",o.LATEX="latex",o.TAB="tab",o.DATE="date",o.BLOCK="block",o.TITLE="title",o.LIST="list",o.SPLIT_TAG="splitTag",o.LABEL="label",o.MENSTRUAL_HISTORY="menstrualHistory",o.FETAL_HEART_POSITION="fetalHeartPosition",o.TOOTH_POSITION="toothPosition",o.SPECIAL_SYMBOLS="specialSymbols",o.MACRO="macro",o.CUSTOM_MACRO="customMacro",o.REUSABLE_ITEM="reusableItem",o.SUB_TEMPLATE="subTemplate"})(l.ElementType||(l.ElementType={}));const Re=["bold","color","highlight","font","size","italic","underline","strikeout","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],Bt=["rowFlex","rowMargin"],ol=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","url","areaId","hyperlinkId","dateId","dateFormat","groupIds","rowMargin","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],il=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","rowMargin","dashArray","trList","tdPadding","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig","templateId","subTemplateExpanded"],sl=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],Be=["tdId","trId","tableId"],Eo=["level","titleId","title"],mn=["listId","listType","listStyle"],Xo=["control","controlId","controlComponent"],Gt=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"],Ke=["areaId","area"],No=[...Be,...Eo,...mn,...Ke],$t=[l.ElementType.TEXT,l.ElementType.HYPERLINK,l.ElementType.SUBSCRIPT,l.ElementType.SUPERSCRIPT,l.ElementType.CONTROL,l.ElementType.DATE],rl=[l.ElementType.IMAGE,l.ElementType.LATEX],ll=[l.ElementType.BLOCK,l.ElementType.PAGE_BREAK,l.ElementType.SEPARATOR,l.ElementType.TABLE],al=["HR","TABLE","UL","OL"],cl=[l.ElementType.TITLE,l.ElementType.LIST];class $e{static sandbox=["allow-scripts","allow-same-origin"];static allow=["fullscreen"];element;constructor(t){this.element=t}_defineIframeProperties(t){Object.defineProperties(t,{parent:{get:()=>null},__POWERED_BY_CANVAS_EDITOR__:{get:()=>!0}})}render(t){const{iframeBlock:e}=this.element.block||{},n=document.createElement("iframe");n.setAttribute("data-id",this.element.id),n.sandbox.add(...e?.sandbox||$e.sandbox),n.setAttribute("allow",[e?.allow||$e.allow].join(" ")),n.style.border="none",n.style.width="100%",n.style.height="100%",e?.src?n.src=e.src:e?.srcdoc&&(n.srcdoc=e.srcdoc),t.append(n),this._defineIframeProperties(n.contentWindow)}}class Qi{draw;options;imageCache;container;floatImageContainer;floatImage;constructor(t){this.draw=t,this.options=t.getOptions(),this.container=t.getContainer(),this.imageCache=new Map,this.floatImageContainer=null,this.floatImage=null}getOriginalMainImageList(){const t=[],e=n=>{for(const i of n)if(i.type===l.ElementType.TABLE){const r=i.trList;for(let s=0;s<r.length;s++){const a=r[s];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];e(d.value)}}}else i.type===l.ElementType.IMAGE&&t.push(i)};return e(this.draw.getOriginalMainElementList()),t}_countImagesBeforeTarget(t,e){let n=0;for(const i of t){if(i===e)break;if(i.type===l.ElementType.TABLE){const r=i.trList;for(const s of r)for(const a of s.tdList)n+=this._countImagesBeforeTarget(a.value,e)}else i.type===l.ElementType.IMAGE&&n++}return n}createFloatImage(t){const{scale:e}=this.options;let n=this.floatImageContainer,i=this.floatImage;n||(n=document.createElement("div"),n.classList.add(`${z}-float-image`),this.container.append(n),this.floatImageContainer=n),i||(i=document.createElement("img"),n.append(i),this.floatImage=i),n.style.display="none",i.style.width=`${t.width*e}px`,i.style.height=`${t.height*e}px`;const r=this.draw.getHeight(),s=this.draw.getPageGap(),a=this.draw.getPageNo()*(r+s),c=t.imgFloatPosition;n.style.left=`${c.x*e}px`,n.style.top=`${a+c.y*e}px`,i.src=t.value}dragFloatImage(t,e){if(!this.floatImageContainer)return;this.floatImageContainer.style.display="block";const n=parseFloat(this.floatImageContainer.style.left)+t,i=parseFloat(this.floatImageContainer.style.top)+e;this.floatImageContainer.style.left=`${n}px`,this.floatImageContainer.style.top=`${i}px`}destroyFloatImage(){this.floatImageContainer&&(this.floatImageContainer.style.display="none")}addImageObserver(t){this.draw.getImageObserver().add(t)}getFallbackImage(t,e){const i=(t-Math.ceil(t/8)*8)/2,r=(e-Math.ceil(e/8)*8)/2,s=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${e}" viewBox="0 0 ${t} ${e}">
2
+ (function(l,He){typeof exports=="object"&&typeof module<"u"?He(exports):typeof define=="function"&&define.amd?define(["exports"],He):(l=typeof globalThis<"u"?globalThis:l||self,He(l["canvas-editor"]={}))})(this,(function(l){"use strict";const He="0.6.2";l.MaxHeightRatio=void 0,(function(o){o.HALF="half",o.ONE_THIRD="one-third",o.QUARTER="quarter"})(l.MaxHeightRatio||(l.MaxHeightRatio={})),l.NumberType=void 0,(function(o){o.ARABIC="arabic",o.CHINESE="chinese"})(l.NumberType||(l.NumberType={})),l.ImageDisplay=void 0,(function(o){o.INLINE="inline",o.BLOCK="block",o.SURROUND="surround",o.FLOAT_TOP="float-top",o.FLOAT_BOTTOM="float-bottom"})(l.ImageDisplay||(l.ImageDisplay={})),l.LocationPosition=void 0,(function(o){o.BEFORE="before",o.AFTER="after",o.OUTER_BEFORE="outer-before",o.OUTER_AFTER="outer-after"})(l.LocationPosition||(l.LocationPosition={})),l.FlexDirection=void 0,(function(o){o.ROW="row",o.COLUMN="column"})(l.FlexDirection||(l.FlexDirection={}));const H="​",bi=`
3
+ `,po=" ",Wi="&nbsp;",Ur=["·","、",":",":",",",",",".","。",";",";","?","?","!","!"],Vi={[l.MaxHeightRatio.HALF]:1/2,[l.MaxHeightRatio.ONE_THIRD]:1/3,[l.MaxHeightRatio.QUARTER]:1/4},Lo={ENGLISH:"A-Za-z",NUMBER:"0-9.$¥",SPANISH:"A-Za-zÁÉÍÓÚáéíóúÑñÜü",FRENCH:"A-Za-zÀÂÇàâçÉéÈèÊêËëÎîÏïÔôÙùÛûŸÿ",GERMAN:"A-Za-zÄäÖöÜüß",RUSSIAN:"А-Яа-яЁё",PORTUGUESE:"A-Za-zÁÉÍÓÚáéíóúÃÕãõÇç",ITALIAN:"A-Za-zÀàÈèÉéÌìÍíÎîÓóÒòÙù",DUTCH:"A-Za-zÀàÁáÂâÄäÈèÉéÊêËëÌìÍíÎîÏïÓóÒòÔôÖöÙùÛûÜü",SWEDISH:"A-Za-zÅåÄäÖö",GREEK:"ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"},wr="中";l.RowFlex=void 0,(function(o){o.LEFT="left",o.CENTER="center",o.RIGHT="right",o.ALIGNMENT="alignment",o.JUSTIFY="justify"})(l.RowFlex||(l.RowFlex={}));const Io=/[0-9.]/,Zr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,Qr=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\u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?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,vr=new RegExp(`${Qr.source}|${Zr.source}`,"g"),Kr=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,Po=new RegExp(`^[${H}
4
+ ]`),Hr=/[^0-9\+\-\.eE,]/,_r=/\s/;function xr(o,t){let e;return function(...n){e&&window.clearTimeout(e),e=window.setTimeout(()=>{o.apply(this,n)},t)}}function Gr(o,t){let e=0,n;return function(...i){const r=Date.now();r-e>=t?(window.clearTimeout(n),o.apply(this,i),e=r):(window.clearTimeout(n),n=window.setTimeout(()=>{o.apply(this,i),e=r},t))}}function Mo(o,t){if(!o||typeof o!="object")return o;let e={};return Array.isArray(o)?e=o.map(n=>Mo(n,t)):Object.keys(o).forEach(n=>{t.includes(n)||(e[n]=Mo(o[n],t))}),e}function at(o){if(typeof structuredClone=="function")return structuredClone(o);if(!o||typeof o!="object")return o;let t={};return Array.isArray(o)?t=o.map(e=>at(e)):Object.keys(o).forEach(e=>{t[e]=at(o[e])}),t}function Oo(o){return o&&o.nodeType===1&&o.tagName.toLowerCase()==="body"}function Yi(o,t,e){if(o&&!Oo(o))for(o=o;o;){if(!t||t(o)||Oo(o))return t&&!t(o)&&Oo(o)?null:o;o=o.parentNode}return null}function lt(){function o(){return((1+Math.random())*65536|0).toString(16).substring(1)}return o()+o()+"-"+o()+"-"+o()+"-"+o()+"-"+o()+o()+o()}function ct(o){const t=[];if(Intl.Segmenter){const n=new Intl.Segmenter().segment(o);for(const{segment:i}of n)t.push(i)}else{const e=new Map;for(const i of o.matchAll(vr))e.set(i.index,i[0]);let n=0;for(;n<o.length;){const i=e.get(n);i?(t.push(i),n+=i.length):(t.push(o[n]),n++)}}return t}function Di(o,t){const e=document.createElement("a");e.href=o,e.download=t,e.click()}function Ar(o,t){kr(3,o,t)}function kr(o,t,e){let n=0,i=0;const r=function(s){n=new Date().getTime()-i<300?n+1:0,i=new Date().getTime(),n>=o-1&&(e(s),n=0)};t.addEventListener("click",r)}function Zn(o){return Object.prototype.toString.call(o)==="[object Object]"}function Co(o){return Array.isArray(o)}function So(o){return Object.prototype.toString.call(o)==="[object Number]"}function Jr(o){return Object.prototype.toString.call(o)==="[object String]"}function Ui(o,t){if(Zn(o)&&Zn(t)){const e=t;for(const[n,i]of Object.entries(o))e[n]?e[n]=Ui(i,e[n]):e[n]=i}else Co(o)&&Co(t)&&t.push(...o);return t}function Eo(o){if(typeof queueMicrotask=="function"){queueMicrotask(()=>{o()});return}if(typeof Promise<"u"){Promise.resolve().then(()=>{o()});return}setTimeout(()=>{o()},0)}function Br(o){const t=["零","一","二","三","四","五","六","七","八","九"],e=["","十","百","千","万","十","百","千","亿","十","百","千","万","十","百","千","亿"];if(!o||isNaN(o))return"零";const n=o.toString().split("");let i="";for(let r=0;r<n.length;r++){const s=n.length-1-r;i=`${e[r]}${i}`,i=`${t[Number(n[s])]}${i}`}return i=i.replace(/零(千|百|十)/g,"零").replace(/十零/g,"十"),i=i.replace(/零+/g,"零"),i=i.replace(/零亿/g,"亿").replace(/零万/g,"万"),i=i.replace(/亿万/g,"亿"),i=i.replace(/零+$/,""),i=i.replace(/^一十/g,"十"),i}function De(o,t,e){for(let n=0;n<o.length;n++){const i=o[n],r=t[i];r!==void 0?e[i]=r:delete e[i]}}function wi(o,t){if(!(!t.length||!o.length))for(let e=o.length-1;e>=0;e--)t.includes(o[e])&&o.splice(e,1)}function Dt(o,t){const e={};for(const n in o)t.includes(n)&&(e[n]=o[n]);return e}function ie(o,t){const e={};for(const n in o)t.includes(n)||(e[n]=o[n]);return e}function $r(o){const e=new TextEncoder().encode(o),n=Array.from(e,r=>String.fromCharCode(r));return window.btoa(n.join(""))}function zr(o){let t=o.parentElement;for(;t;){const n=window.getComputedStyle(t).getPropertyValue("overflow-y");if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"))return t;t=t.parentElement}return document.documentElement}function Zi(o,t){return o.length!==t.length?!1:!o.some(e=>!t.includes(e))}function jr(o,t){if(!Zn(o)||!Zn(t))return!1;const e=Object.keys(o),n=Object.keys(t);return e.length!==n.length?!1:!e.some(i=>t[i]!==o[i])}function qr(o,t){const e=o.x,n=o.x+o.width,i=o.y,r=o.y+o.height,s=t.x,a=t.x+t.width,c=t.y,d=t.y+t.height;return!(e>a||n<s||i>d||r<c)}function Qi(o){return o==null}function Qn(o){return o.replace(/\r\n|\r/g,`
5
+ `)}function vi(o,t,e=0){const n=Math.max(0,Math.floor(e));if(n>=o.length)return typeof t=="string"&&t===""?{index:o.length,length:0}:{index:-1,length:0};if(typeof t=="string"){if(t==="")return{index:n,length:0};const c=o.indexOf(t,n);return c===-1?{index:-1,length:0}:{index:c,length:t.length}}const i=t.flags,r=i.includes("g")?i:i+"g",s=new RegExp(t.source,r);s.lastIndex=n;const a=s.exec(o);return a?{index:a.index,length:a[0].length}:{index:-1,length:0}}function Ki(o,t){if(!t){o.scrollTop=0;return}const e=[];let n=t.offsetParent;for(;n&&o!==n&&o.contains(n);)e.push(n),n=n.offsetParent;const i=t.offsetTop+e.reduce((c,d)=>c+d.offsetTop,0),r=i+t.offsetHeight,s=o.scrollTop,a=s+o.clientHeight;i<s?o.scrollTop=i:r>a&&(o.scrollTop=r-o.clientHeight)}function Vt(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function tl(o,t){return o.performance.enabled&&t>=o.performance.threshold}function Xo(o,t,e,n=[],i){if(!tl(o,e))return;const r={duration:Number(e.toFixed(2)),breakdown:n.map(s=>({label:s.label,duration:Number(s.duration.toFixed(2))})),...i};console.log(`[canvas-editor perf] ${t}`,r)}const el=12,nl={width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF",dragFloatImageDisabled:!1},Re="editor-component",z="ce",Ln=`${z}-clipboard`,No={print:{imagePreviewerDisabled:!1,backgroundDisabled:!1},readonly:{imagePreviewerDisabled:!1},form:{controlDeletableDisabled:!1,inputTraceEnabled:!0,deleteTraceEnabled:!0}};var Zt;(function(o){o.UP="top",o.DOWN="down",o.LEFT="left",o.RIGHT="right"})(Zt||(Zt={}));const _e=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),ol=typeof navigator<"u"&&/iPad|iPhone/.test(navigator.userAgent),il=/Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),sl=typeof navigator<"u"&&/Firefox/.test(navigator.userAgent);l.ElementType=void 0,(function(o){o.TEXT="text",o.TEXTFIELD="TextField",o.BUTTON="button",o.IMAGE="image",o.TABLE="table",o.HYPERLINK="hyperlink",o.SUPERSCRIPT="superscript",o.SUBSCRIPT="subscript",o.SEPARATOR="separator",o.PAGE_BREAK="pageBreak",o.CONTROL="control",o.AREA="area",o.CHECKBOX="checkbox",o.RADIO="radio",o.LATEX="latex",o.TAB="tab",o.DATE="date",o.BLOCK="block",o.TITLE="title",o.LIST="list",o.SPLIT_TAG="splitTag",o.LABEL="label",o.MENSTRUAL_HISTORY="menstrualHistory",o.FETAL_HEART_POSITION="fetalHeartPosition",o.TOOTH_POSITION="toothPosition",o.SPECIAL_SYMBOLS="specialSymbols",o.MACRO="macro",o.CUSTOM_MACRO="customMacro",o.REUSABLE_ITEM="reusableItem",o.SUB_TEMPLATE="subTemplate"})(l.ElementType||(l.ElementType={}));const ue=["bold","color","highlight","font","size","italic","underline","strikeout","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],Bt=["rowFlex","rowMargin"],rl=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","url","areaId","hyperlinkId","dateId","dateFormat","groupIds","rowMargin","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],ll=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","rowMargin","dashArray","trList","tdPadding","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig","templateId","subTemplateExpanded","logicTemplateId","logicTemplateName","logicTemplateTemplateId","logicTemplateDisplayRule"],al=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],je=["tdId","trId","tableId"],Fo=["level","titleId","title"],In=["listId","listType","listStyle"],yo=["control","controlId","controlComponent"],Gt=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"],xe=["areaId","area"],bo=[...je,...Fo,...In,...xe],$t=[l.ElementType.TEXT,l.ElementType.HYPERLINK,l.ElementType.SUBSCRIPT,l.ElementType.SUPERSCRIPT,l.ElementType.CONTROL,l.ElementType.DATE],cl=[l.ElementType.IMAGE,l.ElementType.LATEX],dl=[l.ElementType.BLOCK,l.ElementType.PAGE_BREAK,l.ElementType.SEPARATOR,l.ElementType.TABLE],Rl=["HR","TABLE","UL","OL"],ul=[l.ElementType.TITLE,l.ElementType.LIST];class qe{static sandbox=["allow-scripts","allow-same-origin"];static allow=["fullscreen"];element;constructor(t){this.element=t}_defineIframeProperties(t){Object.defineProperties(t,{parent:{get:()=>null},__POWERED_BY_CANVAS_EDITOR__:{get:()=>!0}})}render(t){const{iframeBlock:e}=this.element.block||{},n=document.createElement("iframe");n.setAttribute("data-id",this.element.id),n.sandbox.add(...e?.sandbox||qe.sandbox),n.setAttribute("allow",[e?.allow||qe.allow].join(" ")),n.style.border="none",n.style.width="100%",n.style.height="100%",e?.src?n.src=e.src:e?.srcdoc&&(n.srcdoc=e.srcdoc),t.append(n),this._defineIframeProperties(n.contentWindow)}}class Hi{draw;options;imageCache;container;floatImageContainer;floatImage;constructor(t){this.draw=t,this.options=t.getOptions(),this.container=t.getContainer(),this.imageCache=new Map,this.floatImageContainer=null,this.floatImage=null}getOriginalMainImageList(){const t=[],e=n=>{for(const i of n)if(i.type===l.ElementType.TABLE){const r=i.trList;for(let s=0;s<r.length;s++){const a=r[s];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];e(d.value)}}}else i.type===l.ElementType.IMAGE&&t.push(i)};return e(this.draw.getOriginalMainElementList()),t}_countImagesBeforeTarget(t,e){let n=0;for(const i of t){if(i===e)break;if(i.type===l.ElementType.TABLE){const r=i.trList;for(const s of r)for(const a of s.tdList)n+=this._countImagesBeforeTarget(a.value,e)}else i.type===l.ElementType.IMAGE&&n++}return n}createFloatImage(t){const{scale:e}=this.options;let n=this.floatImageContainer,i=this.floatImage;n||(n=document.createElement("div"),n.classList.add(`${z}-float-image`),this.container.append(n),this.floatImageContainer=n),i||(i=document.createElement("img"),n.append(i),this.floatImage=i),n.style.display="none",i.style.width=`${t.width*e}px`,i.style.height=`${t.height*e}px`;const r=this.draw.getHeight(),s=this.draw.getPageGap(),a=this.draw.getPageNo()*(r+s),c=t.imgFloatPosition;n.style.left=`${c.x*e}px`,n.style.top=`${a+c.y*e}px`,i.src=t.value}dragFloatImage(t,e){if(!this.floatImageContainer)return;this.floatImageContainer.style.display="block";const n=parseFloat(this.floatImageContainer.style.left)+t,i=parseFloat(this.floatImageContainer.style.top)+e;this.floatImageContainer.style.left=`${n}px`,this.floatImageContainer.style.top=`${i}px`}destroyFloatImage(){this.floatImageContainer&&(this.floatImageContainer.style.display="none")}addImageObserver(t){this.draw.getImageObserver().add(t)}getFallbackImage(t,e){const i=(t-Math.ceil(t/8)*8)/2,r=(e-Math.ceil(e/8)*8)/2,s=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${e}" viewBox="0 0 ${t} ${e}">
6
6
  <rect width="${t}" height="${e}" fill="url(#mosaic)" />
7
7
  <defs>
8
8
  <pattern id="mosaic" x="${i}" y="${r}" width="16" height="16" patternUnits="userSpaceOnUse">
@@ -10,12 +10,12 @@
10
10
  <rect width="8" height="8" fill="#cccccc" transform="translate(8, 8)" />
11
11
  </pattern>
12
12
  </defs>
13
- </svg>`,a=new Image;return a.src=`data:image/svg+xml;base64,${kr(s)}`,a}_drawImageWithCrop(t,e,n,i,r,s,a){if(n.imgCrop){const{x:c,y:d,width:R,height:u}=n.imgCrop;t.drawImage(e,c,d,R,u,i,r,s,a)}else t.drawImage(e,i,r,s,a)}_renderCaption(t,e,n,i,r,s){if(!e.imgCaption?.value)return;const{scale:a,imgCaption:c}=this.options;let d=e.imgCaption.value;if(d.includes("{imageNo}")){const I=this.draw.getOriginalMainElementList(),L=this._countImagesBeforeTarget(I,e)+1;d=d.replace(/\{imageNo\}/g,String(L))}const R=(e.imgCaption.size||c.size)*a,u=e.imgCaption.font||c.font,h=e.imgCaption.color||c.color;t.save(),t.font=`${R}px ${u}`,t.fillStyle=h,t.textAlign="center";let g=d;const f=t.measureText(d);if(f.width>r){let I=0,L=d.length;for(;I<L;){const P=Math.ceil((I+L)/2),O=d.substring(0,P);t.measureText(O+"...").width<=r?I=P:L=P-1}g=d.substring(0,I)+"..."}const T=(e.imgCaption.top??c.top)*a,p=i+s+T+f.actualBoundingBoxAscent,m=n+r/2;t.fillText(g,m,p),t.restore()}render(t,e,n,i){const{scale:r}=this.options,s=e.width*r,a=e.height*r;if(this.imageCache.has(e.value)){const c=this.imageCache.get(e.value);this._drawImageWithCrop(t,c,e,n,i,s,a),this._renderCaption(t,e,n,i,s,a)}else{const c=this.draw.getRenderCount(),d=new Promise((R,u)=>{const h=new Image;h.setAttribute("crossOrigin","Anonymous"),h.src=e.value,h.onload=()=>{this.imageCache.set(e.value,h),R(e),c===this.draw.getRenderCount()&&(e.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM?this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}):(this._drawImageWithCrop(t,h,e,n,i,s,a),this._renderCaption(t,e,n,i,s,a)))},h.onerror=g=>{const f=this.getFallbackImage(s,a);f.onload=()=>{this._drawImageWithCrop(t,f,e,n,i,s,a),this.imageCache.set(e.value,f),this._renderCaption(t,e,n,i,s,a)},u(g)}});this.addImageObserver(d)}}}const wn=82;function ze(o){return Fo[o]==null&&dl(o),Fo[o]}function dl(o){const t=Rl[o];if(t==null)return;const e=t.substring(3,5),n=1*e.charCodeAt(0)-wn,i=1*e.charCodeAt(1)-wn,r=t.substring(5),s=[[]];let a=1/0,c=-1/0,d=1/0,R=-1/0,u=0;for(;u<r.length;){const h=r.substring(u,u+2);if(h==" R")s.push([]);else{const g=h.charCodeAt(0)-wn-n,f=h.charCodeAt(1)-wn;a=Math.min(f,a),c=Math.max(f,c),d=Math.min(g,d),R=Math.max(g,R),s[s.length-1].push([g,f])}u+=2}Fo[o]={w:i-n,xmin:d,xmax:R,ymin:a,ymax:c,polylines:s}}const Fo={},Rl={1:" 9MWRMNV RRMVV RPSTS",2:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",3:" 11MXVNTMRMPNOPOSPURVTVVU",4:" 12MWOMOV ROMRMTNUPUSTURVOV",5:" 12MWOMOV ROMUM ROQSQ ROVUV",6:" 9MVOMOV ROMUM ROQSQ",7:" 15MXVNTMRMPNOPOSPURVTVVUVR RSRVR",8:" 9MWOMOV RUMUV ROQUQ",9:" 3PTRMRV",10:" 7NUSMSTRVPVOTOS",11:" 9MWOMOV RUMOS RQQUV",12:" 6MVOMOV ROVUV",13:" 12LXNMNV RNMRV RVMRV RVMVV",14:" 9MWOMOV ROMUV RUMUV",15:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",16:" 10MWOMOV ROMSMUNUQSROR",17:" 17MXRMPNOPOSPURVSVUUVSVPUNSMRM RSTVW",18:" 13MWOMOV ROMSMUNUQSROR RRRUV",19:" 13MWUNSMQMONOOPPTRUSUUSVQVOU",20:" 6MWRMRV RNMVM",21:" 9MXOMOSPURVSVUUVSVM",22:" 6MWNMRV RVMRV",23:" 12LXNMPV RRMPV RRMTV RVMTV",24:" 6MWOMUV RUMOV",25:" 7MWNMRQRV RVMRQ",26:" 9MWUMOV ROMUM ROVUV",27:" 9MWRMNV RRMVV RPSTS",28:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",29:" 6MVOMOV ROMUM",30:" 9MWRMNV RRMVV RNVVV",31:" 12MWOMOV ROMUM ROQSQ ROVUV",32:" 9MWUMOV ROMUM ROVUV",33:" 9MWOMOV RUMUV ROQUQ",34:" 20MXRMPNOPOSPURVSVUUVSVPUNSMRM RQQTR RTQQR",35:" 3PTRMRV",36:" 9MWOMOV RUMOS RQQUV",37:" 6MWRMNV RRMVV",38:" 12LXNMNV RNMRV RVMRV RVMVV",39:" 9MWOMOV ROMUV RUMUV",40:" 12MWOMUM RPQTR RTQPR ROVUV",41:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",42:" 9MWOMOV RUMUV ROMUM",43:" 10MWOMOV ROMSMUNUQSROR",44:" 10MWOMRQOV ROMUM ROVUV",45:" 6MWRMRV RNMVM",46:" 15MWNONNOMPMQNRPRV RVOVNUMTMSNRP",47:" 13LXRMRV RPONPNSPTTTVSVPTOPO",48:" 6MWOMUV RUMOV",49:" 12LXRMRV RNOOPOSQTSTUSUPVO",50:" 13MXOVQVOROPPNRMSMUNVPVRTVVV",200:" 12MWRMPNOPOSPURVTUUSUPTNRM",201:" 4MWPORMRV",202:" 9MWONQMSMUNUPTROVUV",203:" 15MWONQMSMUNUPSQ RRQSQURUUSVQVOU",204:" 7MWSMSV RSMNSVS",205:" 14MWPMOQQPRPTQUSTURVQVOU RPMTM",206:" 14MWTMRMPNOPOSPURVTUUSTQRPPQOS",207:" 6MWUMQV ROMUM",208:" 19MWQMONOPQQSQUPUNSMQM RQQOROUQVSVUUURSQ",209:" 14MWUPTRRSPROPPNRMTNUPUSTURVPV",210:" 6PURURVSVSURU",211:" 7PUSVRVRUSUSWRY",212:" 12PURPRQSQSPRP RRURVSVSURU",213:" 13PURPRQSQSPRP RSVRVRUSUSWRY",214:" 12PURMRR RSMSR RRURVSVSURU",215:" 17NWPNRMSMUNUPRQRRSRSQUP RRURVSVSURU",216:" 3PTRMRQ",217:" 6NVPMPQ RTMTQ",218:" 10NVQMPNPPQQSQTPTNSMQM",219:" 16MWUNSMQMONOPQQTRUSUUSVQVOU RRLRW",220:" 3MWVLNW",221:" 7OVTLRNQPQSRUTW",222:" 7NUPLRNSPSSRUPW",223:" 3PTRLRW",224:" 3LXNRVR",225:" 6LXRNRV RNRVR",226:" 6LXNPVP RNTVT",227:" 6MWOOUU RUOOU",228:" 9MWRORU ROPUT RUPOT",229:" 6PURQRRSRSQRQ",230:" 7PUSMRORQSQSPRP",231:" 7PUSNRNRMSMSORQ",232:" 7LXSOVRSU RNRVR",233:" 12MXRLPW RULSW ROPVP ROSVS",234:" 21LXVRURTSSURVOVNUNSORRQSPSNRMPMONOPQSSUUVVV",235:" 20LXNNOQOSNV RVNUQUSVV RNNQOSOVN RNVQUSUVV",501:" 9I[RFJ[ RRFZ[ RMTWT",502:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",503:" 19H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV",504:" 16G\\KFK[ RKFRFUGWIXKYNYSXVWXUZR[K[",505:" 12H[LFL[ RLFYF RLPTP RL[Y[",506:" 9HZLFL[ RLFYF RLPTP",507:" 23H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZS RUSZS",508:" 9G]KFK[ RYFY[ RKPYP",509:" 3NVRFR[",510:" 11JZVFVVUYTZR[P[NZMYLVLT",511:" 9G\\KFK[ RYFKT RPOY[",512:" 6HYLFL[ RL[X[",513:" 12F^JFJ[ RJFR[ RZFR[ RZFZ[",514:" 9G]KFK[ RKFY[ RYFY[",515:" 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF",516:" 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ",517:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RSWY]",518:" 17G\\KFK[ RKFTFWGXHYJYLXNWOTPKP RRPY[",519:" 21H\\YIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",520:" 6JZRFR[ RKFYF",521:" 11G]KFKULXNZQ[S[VZXXYUYF",522:" 6I[JFR[ RZFR[",523:" 12F^HFM[ RRFM[ RRFW[ R\\FW[",524:" 6H\\KFY[ RYFK[",525:" 7I[JFRPR[ RZFRP",526:" 9H\\YFK[ RKFYF RK[Y[",527:" 9I[RFJ[ RRFZ[ RMTWT",528:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",529:" 6HYLFL[ RLFXF",530:" 9I[RFJ[ RRFZ[ RJ[Z[",531:" 12H[LFL[ RLFYF RLPTP RL[Y[",532:" 9H\\YFK[ RKFYF RK[Y[",533:" 9G]KFK[ RYFY[ RKPYP",534:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF ROPUP",535:" 3NVRFR[",536:" 9G\\KFK[ RYFKT RPOY[",537:" 6I[RFJ[ RRFZ[",538:" 12F^JFJ[ RJFR[ RZFR[ RZFZ[",539:" 9G]KFK[ RKFY[ RYFY[",540:" 9I[KFYF ROPUP RK[Y[",541:" 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF",542:" 9G]KFK[ RYFY[ RKFYF",543:" 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ",544:" 10I[KFRPK[ RKFYF RK[Y[",545:" 6JZRFR[ RKFYF",546:" 19I[KKKILGMFOFPGQIRMR[ RYKYIXGWFUFTGSIRM",547:" 21H\\RFR[ RPKMLLMKOKRLTMUPVTVWUXTYRYOXMWLTKPK",548:" 6H\\KFY[ RK[YF",549:" 18G]RFR[ RILJLKMLQMSNTQUSUVTWSXQYMZL[L",550:" 17H\\K[O[LTKPKLLINGQFSFVGXIYLYPXTU[Y[",551:" 20G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 ROMVM",607:" 23I\\XMX]W`VaTbQbOa RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",608:" 11I\\MFM[ RMQPNRMUMWNXQX[",609:" 9NVQFRGSFREQF RRMR[",610:" 12MWRFSGTFSERF RSMS^RaPbNb",611:" 9IZMFM[ RWMMW RQSX[",612:" 3NVRFR[",613:" 19CaGMG[ RGQJNLMOMQNRQR[ RRQUNWMZM\\N]Q][",614:" 11I\\MMM[ RMQPNRMUMWNXQX[",615:" 18I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM",616:" 18H[LMLb RLPNNPMSMUNWPXSXUWXUZS[P[NZLX",617:" 18I\\XMXb RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",618:" 9KXOMO[ ROSPPRNTMWM",619:" 18J[XPWNTMQMNNMPNRPSUTWUXWXXWZT[Q[NZMX",620:" 9MYRFRWSZU[W[ ROMVM",621:" 11I\\MMMWNZP[S[UZXW RXMX[",622:" 6JZLMR[ RXMR[",623:" 12G]JMN[ RRMN[ RRMV[ RZMV[",624:" 6J[MMX[ RXMM[",625:" 10JZLMR[ RXMR[P_NaLbKb",626:" 9J[XMM[ RMMXM RM[X[",627:" 24H]QMONMPLRKUKXLZN[P[RZUWWTYPZM RQMSMTNUPWXXZY[Z[",628:" 31I\\UFSGQIOMNPMTLZKb RUFWFYHYKXMWNUORO RROTPVRWTWWVYUZS[Q[OZNYMV",629:" 17I\\JPLNNMOMQNROSRSVR[ RZMYPXRR[P_Ob",630:" 24I[TMQMONMPLSLVMYNZP[R[TZVXWUWRVOTMRKQIQGRFTFVGXI",631:" 19JZWOVNTMQMONOPPRSS RSSOTMVMXNZP[S[UZWX",632:" 23JYTFRGQHQIRJUKXK RXKTMQONRMUMWNYP[S]T_TaSbQbP`",633:" 19H\\IQJOLMNMONOPNTL[ RNTPPRNTMVMXOXRWWTb",634:" 27G\\HQIOKMMMNNNPMUMXNZO[Q[SZUWVUWRXMXJWGUFSFRHRJSMUPWRZT",635:" 9L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WNUMRMPNNPMSMVNYOZQ[T[VZ RMTUT",685:" 23J[TFRGPJOLNOMTMXNZO[Q[SZUWVUWRXMXIWGVFTF RNPWP",686:" 21H\\VFNb RQMNNLPKSKVLXNZQ[S[VZXXYUYRXPVNSMQM",687:" 16I[XOWNTMQMNNMOLQLSMUOWSZT\\T^S_Q_",700:" 18H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF",701:" 5H\\NJPISFS[",702:" 15H\\LKLJMHNGPFTFVGWHXJXLWNUQK[Y[",703:" 16H\\MFXFRNUNWOXPYSYUXXVZS[P[MZLYKW",704:" 7H\\UFKTZT RUFU[",705:" 18H\\WFMFLOMNPMSMVNXPYSYUXXVZS[P[MZLYKW",706:" 24H\\XIWGTFRFOGMJLOLTMXOZR[S[VZXXYUYTXQVOSNRNOOMQLT",707:" 6H\\YFO[ RKFYF",708:" 30H\\PFMGLILKMMONSOVPXRYTYWXYWZT[P[MZLYKWKTLRNPQOUNWMXKXIWGTFPF",709:" 24H\\XMWPURRSQSNRLPKMKLLINGQFRFUGWIXMXRWWUZR[P[MZLX",710:" 6MWRYQZR[SZRY",711:" 9MWSZR[QZRYSZS\\R^Q_",712:" 12MWRMQNROSNRM RRYQZR[SZRY",713:" 15MWRMQNROSNRM RSZR[QZRYSZS\\R^Q_",714:" 9MWRFRT RRYQZR[SZRY",715:" 21I[LKLJMHNGPFTFVGWHXJXLWNVORQRT RRYQZR[SZRY",716:" 3NVRFRM",717:" 6JZNFNM RVFVM",718:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",719:" 27H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",720:" 3G][BIb",721:" 11KYVBTDRGPKOPOTPYR]T`Vb",722:" 11KYNBPDRGTKUPUTTYR]P`Nb",723:" 3NVRBRb",724:" 3E_IR[R",725:" 6E_RIR[ RIR[R",726:" 6E_IO[O RIU[U",727:" 6G]KKYY RYKKY",728:" 9JZRLRX RMOWU RWOMU",729:" 6MWRQQRRSSRRQ",730:" 8MWSFRGQIQKRLSKRJ",731:" 8MWRHQGRFSGSIRKQL",732:" 9E_UMXP[RXTUW RIR[R",733:" 12H]SBLb RYBRb RLOZO RKUYU",734:" 35E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y",735:" 28G]IIJKKOKUJYI[ R[IZKYOYUZY[[ RIIKJOKUKYJ[I RI[KZOYUYYZ[[",737:" 6KYOBO[ RUBU[",738:" 6F^RBR[ RI[[[",739:" 4F^[BI[[[",740:" 18E_RIQJRKSJRI RIYHZI[JZIY R[YZZ[[\\Z[Y",741:" 33F^RHNLKPJSJUKWMXOXQWRU RRHVLYPZSZUYWWXUXSWRU RRUQYP\\ RRUSYT\\ RP\\T\\",742:" 26F^RNQKPINHMHKIJKJOKRLTNWR\\ RRNSKTIVHWHYIZKZOYRXTVWR\\",743:" 20F^RGPJLOIR RRGTJXO[R RIRLUPZR] R[RXUTZR]",744:" 48F^RTTWVXXXZW[U[SZQXPVPSQ RSQUOVMVKUISHQHOINKNMOOQQ RQQNPLPJQISIUJWLXNXPWRT RRTQYP\\ RRTSYT\\ RP\\T\\",745:" 55F^RRR[Q\\ RRVQ\\ RRIQHOHNINKONRR RRISHUHVIVKUNRR RRRNOLNJNIOIQJR RRRVOXNZN[O[QZR RRRNULVJVIUISJR RRRVUXVZV[U[SZR",746:" 55F^ISJSLTMVMXLZ RISIRJQLQMRNTNWMYLZ RRGPIOLOOQUQXPZR\\ RRGTIULUOSUSXTZR\\ R[S[RZQXQWRVTVWWYXZ R[SZSXTWVWXXZ RKVYV",750:" 18PSSRRSQSPRPQQPRPSQSSRUQV RQQQRRRRQQQ",751:" 16PTQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",752:" 9NVPOTU RTOPU RNRVR",753:" 28MWRKQMOPMR RRKSMUPWR RRMOQ RRMUQ RROPQ RROTQ RQQSQ RMRWR",754:" 26MWMRMQNOONQMSMUNVOWQWR RPNTN ROOUO RNPVP RNQVQ RMRWR",755:" 14LRLFLRRRLF RLIPQ RLLOR RLOMQ",756:" 10MWRKQMOPMR RRKSMUPWR",757:" 11MWWRWQVOUNSMQMONNOMQMR",758:" 13G]]R]P\\MZJWHTGPGMHJJHMGPGR",759:" 11MWMRMSNUOVQWSWUVVUWSWR",760:" 7LXLPNRQSSSVRXP",761:" 6RURUTTURTPRO",762:" 7RVRRUPVNVLUKTK",763:" 7NRRROPNNNLOKPK",764:" 21MWWHVGTFQFOGNHMJMLNNOOUSVTWVWXVZU[S\\P\\N[MZ",765:" 21G]IWHVGTGQHOINKMMMONPOTUUVWWYW[V\\U]S]P\\N[M",766:" 31G]RRTUUVWWYW[V\\U]S]Q\\O[NYMWMUNTOPUOVMWKWIVHUGSGQHOINKMMMONPORR",767:" 22H\\KFK[ RHF[FQP[Z RZV[Y\\[ RZVZY RWYZY RWYZZ\\[",768:" 30KYUARBPCNELHKLKRLUNWQXSXVWXUYR RKPLMNKQJSJVKXMYPYVXZV]T_R`Oa",796:" 3>f>RfR",797:" 3D`D``D",798:" 3RRR>Rf",799:" 3D`DD``",800:" 3D`DR`R",801:" 3F^FY^K",802:" 3KYK^YF",803:" 3RRRDR`",804:" 3KYKFY^",805:" 3F^FK^Y",806:" 3KYKRYR",807:" 3MWMWWM",808:" 3RRRKRY",809:" 3MWMMWW",810:" 8GRRGPGMHJJHMGPGR",811:" 8GRGRGTHWJZM\\P]R]",812:" 8R]R]T]W\\ZZ\\W]T]R",813:" 8R]]R]P\\MZJWHTGRG",814:" 9D`DOGQKSPTTTYS]Q`O",815:" 9PUUDSGQKPPPTQYS]U`",816:" 9OTODQGSKTPTTSYQ]O`",817:" 9D`DUGSKQPPTPYQ]S`U",818:" 5KYRJYNKVRZ",819:" 5JZJRNKVYZR",820:" 5KYKVKNYVYN",821:" 5JZLXJPZTXL",822:" 23JZJ]L]O\\Q[TXUVVSVOULTJSIQIPJOLNONSOVPXS[U\\X]Z]",823:" 23I]]Z]X\\U[SXPVOSNONLOJPIQISJTLUOVSVVUXT[Q\\O]L]J",824:" 23JZZGXGUHSIPLONNQNUOXPZQ[S[TZUXVUVQUNTLQIOHLGJG",825:" 23G[GJGLHOIQLTNUQVUVXUZT[S[QZPXOUNQNNOLPISHUGXGZ",826:" 21E[EPFRHTJUMVQVUUXSZP[NZLWLSMQNNPLSKVKYL\\M^",827:" 19EYETHVKWPWSVVTXQYNYLXKVKSLPNNQMTMYN\\P_",828:" 26OUQOOQOSQUSUUSUQSOQO RQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",829:" 11RWRMSMUNVOWQWSVUUVSWRW",830:" 9D`DRJR RORUR RZR`R",831:" 5D`DUDO`O`U",832:" 6JZRDJR RRDZR",833:" 9D`DR`R RJYZY RP`T`",834:" 9D`DR`R RDRRb R`RRb",840:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",841:" 6LXLLLXXXXLLL",842:" 5KYRJKVYVRJ",843:" 6LXRHLRR\\XRRH",844:" 12JZRIPOJOOSMYRUWYUSZOTORI",845:" 6KYRKRY RKRYR",846:" 6MWMMWW RWMMW",847:" 9MWRLRX RMOWU RWOMU",850:" 35NVQNOONQNSOUQVSVUUVSVQUOSNQN ROQOS RPPPT RQOQU RRORU RSOSU RTPTT RUQUS",851:" 27NVNNNVVVVNNN ROOOU RPOPU RQOQU RRORU RSOSU RTOTU RUOUU",852:" 17MWRLMUWURL RROOT RROUT RRRQT RRRST",853:" 17LULRUWUMLR RORTU RORTO RRRTS RRRTQ",854:" 17MWRXWOMORX RRUUP RRUOP RRRSP RRRQP",855:" 17OXXROMOWXR RURPO RURPU RRRPQ RRRPS",856:" 22LXRLNWXPLPVWRL RRRRL RRRLP RRRNW RRRVW RRRXP",857:" 11RYRKRY RRKYNRQ RSMVNSO",860:" 13MWRLRX ROOUO RMUOWQXSXUWWU",861:" 11LXRLRX RLQMOWOXQ RPWTW",862:" 14KYMNWX R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904:" 22G]PGMHJJHMGPGTHWJZM\\P]T]W\\ZZ\\W]T]P\\MZJWHTGPG",905:" 34AcPALBJCGEEGCJBLAPATBXCZE]G_JaLbPcTcXbZa]__]aZbXcTcPbLaJ_G]EZCXBTAPA",906:" 34<hP<K=G?DAAD?G=K<P<T=Y?]A`DcGeKgPhThYg]e`cc`e]gYhThPgKeGcD`A]?Y=T<P<",907:" 50){O)I*E+@-;073370;-@+E*I)O)U*[+_-d0i3m7q;t@wEyIzO{U{[z_ydwitmqqmtiwdy_z[{U{OzIyEw@t;q7m3i0d-_+[*U)O)",908:" 34>fRAPCMDJDGCEA>H@JAMAZB]D_G`M`PaRc RRATCWDZD]C_AfHdJcMcZb]`_]`W`TaRc",909:" 33AcRAPCMDJDGCEABGAKAPBTDXG\\L`Rc RRATCWDZD]C_AbGcKcPbT`X]\\X`Rc RBHbH",997:" 3MWMXWX",998:" 3JZJZZZ",999:" 3JZJ]Z]",1001:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1002:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1003:" 24KYVLWKWOVLTKQKOLNMMPMSNVOWQXTXVWWU RQKOMNPNSOVQX",1004:" 26JZNKNX ROKOX RLKSKVLWMXPXSWVVWSXLX RSKULVMWPWSVVUWSX",1005:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1006:" 20JXNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXQX",1007:" 36K[VLWKWOVLTKQKOLNMMPMSNVOWQXTXVW RQKOMNPNSOVQX RTXUWVU RVSVX RWSWX RTSYS",1008:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1009:" 12NWRKRX RSKSX RPKUK RPXUX",1010:" 19LXSKSURWQX RTKTUSWQXPXNWMUNTOUNV RQKVK",1011:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1012:" 14KXOKOX RPKPX RMKRK RMXWXWTVX",1013:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1014:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1015:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1016:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1017:" 47KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RPWPUQTSTTUUZV[W[XZ RTUUXVZW[",1018:" 37JZNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX RSRTSUWVXWXXW RSRUSVWWX",1019:" 32KZVMWKWOVMULSKQKOLNMNOOPQQTRVSWT RNNOOQPTQVRWSWVVWTXRXPWOVNTNXOV",1020:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1021:" 20J[NKNUOWQXTXVWWUWK ROKOUPWQX RLKQK RUKYK",1022:" 15KYMKRX RNKRU RWKRX RKKPK RTKYK",1023:" 24I[LKOX RMKOT RRKOX RRKUX RSKUT RXKUX RJKOK RVKZK",1024:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1025:" 20LYNKRRRX ROKSR RWKSRSX RLKQK RTKYK RPXUX",1026:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1027:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1028:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1029:" 14KXOKOX RPKPX RMKWKWOVK RMXRX",1030:" 15KYRKLX RRMWX RRKXX RMWVW RLXXX",1031:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1032:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1033:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1034:" 44KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RQOQT RTOTT RQQTQ RQRTR",1035:" 12NWRKRX RSKSX RPKUK RPXUX",1036:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1037:" 15KYRKMX RRNVX RRKWX RKXPX RTXYX",1038:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1039:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1040:" 36JZMJLM RXJWM RPPOS RUPTS RMVLY RXVWY RMKWK RMLWL RPQTQ RPRTR RMWWW RMXWX",1041:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1042:" 21J[NKNX ROKOX RVKVX RWKWX RLKYK RLXQX RTXYX",1043:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1044:" 20K[MKRQ RNKSQMX RMKWKXOVK RNWWW RMXWXXTVX",1045:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1046:" 33KZMONLOKPKQLRORX RXOWLVKUKTLSOSX RMONMOLPLQMRO RXOWMVLULTMSO RPXUX",1047:" 40KZRKRX RSKSX RQNNOMQMRNTQUTUWTXRXQWOTNQN RQNOONQNROTQU RTUVTWRWQVOTN RPKUK RPXUX",1048:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1049:" 33J[RKRX RSKSX RLPMONOOSQU RTUVSWOXOYP RMONROTQUTUVTWRXO RPKUK RPXUX",1050:" 35KZMVNXQXMRMONMOLQKTKVLWMXOXRTXWXXV ROUNRNOOMQK RTKVMWOWRVU RNWPW RUWWW",1051:" 18KYTKKX RSMTX RTKUX RNTTT RIXNX RRXWX",1052:" 34JYPKLX RQKMX RNKUKWLWNVPSQ RUKVLVNUPSQ ROQRQTRUSUUTWQXJX RRQTSTUSWQX",1053:" 25KXVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUU RRKPMOONRNVPX",1054:" 26JYPKLX RQKMX RNKTKVLWNWQVTUVTWQXJX RTKULVNVQUTTVSWQX",1055:" 22JYPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXTXUUSX",1056:" 20JXPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXOX",1057:" 33KYVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUVVS RRKPMOONRNVPX RRXTVUS RSSXS",1058:" 27J[PKLX RQKMX RXKTX RYKUX RNKSK RVK[K ROQVQ RJXOX RRXWX",1059:" 12NWTKPX RUKQX RRKWK RNXSX",1060:" 19LXUKRUQWPX RVKSURWPXOXMWLUMTNUMV RSKXK",1061:" 27JZPKLX RQKMX RYKOR RRPTX RSPUX RNKSK RVK[K RJXOX RRXWX",1062:" 14KXQKMX RRKNX ROKTK RKXUXVUTX",1063:" 30I\\OKKX ROMPX RPKQV RYKPX RYKUX RZKVX RMKPK RYK\\K RIXMX RSXXX",1064:" 21JZPKLX RPKTX RQKTU RXKTX RNKQK RVKZK RJXNX",1065:" 32KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK",1066:" 24JYPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RJXOX",1067:" 46KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK ROWOVPUQURVRZS[T[UZ RRVSZT[",1068:" 35JZPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RSRTWUXVXWW RSRTSUWVX RJXOX",1069:" 28KZWLXLYKXNWLUKRKPLOMOOPPUSVT RONPOURVSVVUWSXPXNWMULXMWNW",1070:" 16KZTKPX RUKQX RPKNNOKZKYNYK RNXSX",1071:" 20J[PKMUMWOXSXUWVUYK RQKNUNWOX RNKSK RWK[K",1072:" 15KYOKPX RPKQV RYKPX RMKRK RVK[K",1073:" 24I[NKMX ROKNV RTKMX RTKSX RUKTV RZKSX RLKQK RXK\\K",1074:" 21KZPKTX RQKUX RYKLX RNKSK RVK[K RJXOX RRXWX",1075:" 20LYPKRQPX RQKSQ RYKSQQX RNKSK RVK[K RNXSX",1076:" 16LYXKLX RYKMX RQKONPKYK RLXUXVUTX",1101:" 32LZQOPPPQOQOPQOTOVQVWWXXX RTOUQUWWX RURRSPTOUOWPXSXTWUU RRSPUPWQX",1102:" 29JYNKNX ROKOX RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLKOK",1103:" 24LXVQUQURVRVQUPSOQOOPNRNUOWQXSXUWVV RQOPPOROUPWQX",1104:" 32L[VKVX RWKWX RVRUPSOQOOPNRNUOWQXSXUWVU RQOPPOROUPWQX RTKWK RVXYX",1105:" 26LXOSVSVRUPSOQOOPNRNUOWQXSXUWVV RUSUQSO RQOPPOROUPWQX",1106:" 20LWTKULUMVMVLTKRKPMPX RRKQMQX RNOSO RNXSX",1107:" 42LYQOOQOSQUSUUSUQSOQO RQOPQPSQU RSUTSTQSO RTPUOVO RPTOUOXPYTYVZ ROWPXTXVYV[T\\P\\N[NYPX",1108:" 28J[NKNX ROKOX RORPPROTOVPWRWX RTOUPVRVX RLKOK RLXQX RTXYX",1109:" 18NWRKRLSLSKRK RRORX RSOSX RPOSO RPXUX",1110:" 23NWSKSLTLTKSK RSOSZR\\ RTOTZR\\P\\O[OZPZP[O[ RQOTO",1111:" 27JZNKNX ROKOX RWOOU RRSVX RSSWX RLKOK RTOYO RLXQX RTXYX",1112:" 12NWRKRX RSKSX RPKSK RPXUX",1113:" 44F_JOJX RKOKX RKRLPNOPORPSRSX RPOQPRRRX RSRTPVOXOZP[R[X RXOYPZRZX RHOKO RHXMX RPXUX RXX]X",1114:" 28J[NONX ROOOX RORPPROTOVPWRWX RTOUPVRVX RLOOO RLXQX RTXYX",1115:" 28LYQOOPNRNUOWQXTXVWWUWRVPTOQO RQOPPOROUPWQX RTXUWVUVRUPTO",1116:" 32JYNON\\ ROOO\\ RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLOOO RL\\Q\\",1117:" 29KYUOU\\ RVOV\\ RURTPROPONPMRMUNWPXRXTWUU RPOOPNRNUOWPX RS\\X\\",1118:" 22KXOOOX RPOPX RPRQPSOUOVPVQUQUPVP RMOPO RMXRX",1119:" 26LYTOUPUQVQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWOVPVPWQX",1120:" 14LWPKPVRXTXUWUV RQKQVRX RNOTO",1121:" 28J[NONUOWQXSXUWVU ROOOUPWQX RVOVX RWOWX RLOOO RTOWO RVXYX",1122:" 15KYNORX ROORV RVORX RLOQO RTOXO",1123:" 24I[LOOX RMOOU RROOX RROUX RSOUU RXOUX RJOOO RVOZO",1124:" 21KYNOUX ROOVX RVONX RLOQO RTOXO RLXPX RSXXX",1125:" 23KYNORX ROORV RVORXP[N\\M\\L[LZMZM[L[ RLOQO RTOXO",1126:" 16LXUONX RVOOX ROONQNOVO RNXVXVVUX",1127:" 32K[QOOPNQMSMUNWPXQXSWUUWRXO RQOOQNSNUOWPX RQOSOUPWWXX RSOTPVWXXYX",1128:" 40KXRKPMOOMUK\\ RQLPNNTL\\ RRKTKVLVNUPRQ RTKULUNTPRQ RRQTRUTUVTWRXQXOWNT RRQSRTTTVRX",1129:" 19KYLQNOPORPSSSXR\\ RLQNPPPRQSS RWOVRSXQ\\",1130:" 39KYSOQOOPNQMSMUNWPXRXTWUVVTVRUPRNQLQKRJTJUKVM RQOOQNSNVPX RRXTVUTUQSO RQLRKTKVM",1131:" 27LXVPTOQOOPOQPRRS RQOPPPQRS RRSOTNUNWPXSXUW RRSPTOUOWPX",1132:" 28LWRKQLQMSNVNVMSNPOOPNRNTOVPWRXSYS[R\\P\\O[ RSNQOPPOROTPVRX",1133:" 26IYJRKPLONOOPOQMX RMONPNQLX ROQPPROTOVPVRS\\ RTOUPURR\\",1134:" 35IYJSKQLPNPOQOVPX RMPNQNUOWPXQXSWTVUTVQVNULTKRKQLQNRPURWS RQXSVTTUQUNTK",1135:" 13NWROPVPWQXSXUWVU RSOQVQWRX",1136:" 26KYOOLX RPOMX RUOVPWPVOTORQOR RORPSRWTXVWWU RORQSSWTX",1137:" 15LXLKNKPLWX RNKOLVX RRPMX RRPNX",1138:" 26KZOOK\\ RPOL\\ RNUNWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1139:" 19JYNOMX ROONUMX RVRVOWOVRTUQWNXMX RLOOO",1140:" 36MXRKQLQMSNVN RTNQOPPPRRSUS RTNROQPQRRS RSSPTOUOWQXSYTZT[S\\Q\\ RSSQTPUPWQX",1141:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1142:" 20IZPPMX RPPNX RTPSX RTPTX RKQMOXO RKQMPXP",1143:" 29JXSOQOOPNQMSJ\\ RQOOQNSK\\ RSOUPVRVTUVTWRXPXNWMU RSOUQUTTVRX",1144:" 28K[YOQOOPNQMSMUNWPXRXTWUVVTVRUPYP RQOOQNSNVPX RRXTVUTUQSO",1145:" 14KZSPQX RSPRX RMQOOXO RMQOPXP",1146:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1147:" 35KZOPNQMSMUNWPXRXUWWUXRXPWOUOTPSRRUO\\ RMUNVPWRWUVWTXR RXQWPUPSR RRUQXP\\",1148:" 17KXMONOPPS[T\\ RNOOPR[T\\U\\ RVOTRNYL\\",1149:" 28I[TKQ\\ RUKP\\ RJRKPLONOOPOVPWSWUVWT RMONPNTOWPXSXUWWTXRYO",1150:" 36JZNPPPPONPMQLSLUMWNXPXQWRUSR RLUNWPWRU RRRRWSXUXWVXTXRWPVOVPWP RRUSWUWWV",1151:" 32KZVOTVTWUXWXXWYU RWOUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1152:" 32JXOKMR RPKNRNVPX RNROPQOSOUPVRVTUVTWRXPXNWMUMR RSOUQUTTVRX RMKPK",1153:" 22KXUPUQVQUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1154:" 35KZWKTVTWUXWXXWYU RXKUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RUKXK",1155:" 23KWNURTTSURUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1156:" 23MXWKXLXKVKTLSNPYO[N\\ RVKULTNQYP[N\\L\\L[M\\ RPOVO",1157:" 34KYVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1158:" 29KZPKLX RQKMX ROQPPROTOVPVRUUUWVX RTOUPURTUTWUXWXXWYU RNKQK",1159:" 26MWSKSLTLTKSK RNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1160:" 26MWTKTLULUKTK RORPPQOSOTPTRRYQ[O\\M\\M[N\\ RROSPSRQYP[O\\",1161:" 32KXPKLX RQKMX RVPUQVQVPUOTORQPROR RORPSQWRXTXUWVU RORQSRWSX RNKQK",1162:" 16NVSKPVPWQXSXTWUU RTKQVQWRX RQKTK",1163:" 46F^GRHPIOKOLPLQJX RJOKPKQIX RLQMPOOQOSPSQQX RQORPRQPX RSQTPVOXOZPZRYUYWZX RXOYPYRXUXWYX[X\\W]U",1164:" 33J[KRLPMOOOPPPQNX RNOOPOQMX RPQQPSOUOWPWRVUVWWX RUOVPVRUUUWVXXXYWZU",1165:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1166:" 35JYKRLPMOOOPPPQM\\ RNOOPOQL\\ RPQROTOVPWRWTVVUWSXQXOVOT RTOVQVTUVSX RJ\\O\\",1167:" 28KYVOR\\ RWOS\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RP\\U\\",1168:" 22LXMRNPOOQORPRQPX RPOQPQQOX RRQSPUOVOWPWQVQWP",1169:" 24LYVPVQWQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWNVOVOW",1170:" 16NWSKPVPWQXSXTWUU RTKQVQWRX RPOUO",1171:" 33IZJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1172:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1173:" 37H\\IRJPKOMONPNRMUMWNX RLOMPMRLULWNXOXQWRV RTORVRWTX RUOSVSWTXUXWWYUZRZOYOZP",1174:" 38JZMRNPPOROSPSR RQORPRRQUPWNXMXLWLVMVLW RXPWQXQXPWOVOTPSRRURWSX RQUQWRXTXVWWU",1175:" 35IYJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\",1176:" 27KYWOWPVQNVMWMX RNQOOROUQ ROPRPUQVQ RNVOVRWUW ROVRXUXVV",1177:" 39H[RKSLSMTMTLRKOKMLLNLX ROKNLMNMX RXKYLYMZMZLXKVKTMTX RVKUMUX RJOWO RJXOX RRXWX",1178:" 29J[UKVLWLWKQKOLNNNX RQKPLONOX RVOVX RWOWX RLOWO RLXQX RTXYX",1179:" 27J[WKQKOLNNNX RQKPLONOX RUKVLVX RWKWX RLOVO RLXQX RTXYX",1180:" 48F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX RYKZL[L[KUKSLRNRX RUKTLSNSX RZOZX R[O[X RHO[O RHXMX RPXUX RXX]X",1181:" 46F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX R[KUKSLRNRX RUKTLSNSX RYKZLZX R[K[X RHOZO RHXMX RPXUX RXX]X",1182:" 12NWRORX RSOSX RPOSO RPXUX",1184:" 21LXVPTOROPPOQ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TQVRWTWUVWTXQXOWNVNUOUOV RTQURVTVUUWTX",1204:" 13LYSMSX RTKTX RTKMTXT RQXVX",1205:" 33LYOKNQ ROKVK ROLSLVK RNQOPQOTOVPWRWUVWTXQXOWNVNUOUOV RTOUPVRVUUWTX",1206:" 36LYVMVNWNWMVLTKRKPLOMNPNUOWQXTXVWWUWSVQTPQPNR RRKPMOPOUPWQX RTXUWVUVSUQTP",1207:" 22LYNKNO RVMRTPX RWKTQQX RNMPKRKUM RNMPLRLUMVM",1208:" 51LYQKOLNNOPQQTQVPWNVLTKQK RQKPLONPPQQ RTQUPVNULTK RQQORNTNUOWQXTXVWWUWTVRTQ RQQPROTOUPWQX RTXUWVUVTURTQ",1209:" 36LYOVOUNUNVOWQXSXUWVVWSWNVLTKQKOLNNNPORQSTSWQ RSXUVVSVNULTK RQKPLONOPPRQS",1210:" 6NVRVQWRXSWRV",1211:" 8NVSWRXQWRVSWSYQ[",1212:" 12NVROQPRQSPRO RRVQWRXSWRV",1213:" 14NVROQPRQSPRO RSWRXQWRVSWSYQ[",1214:" 15NVRKQLRSSLRK RRLRO RRVQWRXSWRV",1215:" 29LYNNONOONONNOLQKTKVLWNWOVQSRRSRTST RTKVMVPUQSR RRWRXSXSWRW",1216:" 6OVRKRP RSKRP",1217:" 12LXOKOP RPKOP RUKUP RVKUP",1218:" 10MWQKPLPNQOSOTNTLSKQK",1219:" 9MWRJRP ROKUO RUKOO",1220:" 3KZXHM\\",1221:" 16MWUHSJQMPPPTQWSZU\\ RSJRLQPQTRXSZ",1222:" 16MWOHQJSMTPTTSWQZO\\ RQJRLSPSTRXQZ",1223:" 12MWPHP\\ RQHQ\\ RPHUH RP\\U\\",1224:" 12MWSHS\\ RTHT\\ ROHTH RO\\T\\",1225:" 38LWSHQIPJPLRNSP RQIPL RSNRQ RPJQLSNSPRQPRRSSTSVQXPZ RRSSV RPXQ[ RSTRVPXPZQ[S\\",1226:" 38MXQHSITJTLRNQP RSITL RQNRQ RTJSLQNQPRQTRRSQTQVSXTZ RRSQV RTXS[ RQTRVTXTZS[Q\\",1227:" 4MWTHPRT\\",1228:" 4MWPHTRP\\",1229:" 3OURHR\\",1230:" 6MWPHP\\ RTHT\\",1231:" 3I[LRXR",1232:" 6I[RLRX RLRXR",1233:" 9JZRMRX RMRWR RMXWX",1234:" 9JZRMRX RMMWM RMRWR",1235:" 6JZMMWW RWMMW",1236:" 6NVRQQRRSSRRQ",1237:" 15I[RLQMRNSMRL RLRXR RRVQWRXSWRV",1238:" 6I[LPXP RLTXT",1239:" 9I[WLMX RLPXP RLTXT",1240:" 9I[LNXN RLRXR RLVXV",1241:" 4JZWLMRWX",1242:" 4JZMLWRMX",1243:" 10JZWKMOWS RMTWT RMXWX",1244:" 10JZMKWOMS RMTWT RMXWX",1245:" 21H[YUWUUTTSRPQOONNNLOKQKRLTNUOUQTRSTPUOWNYN",1246:" 16JZLTLRMPOPUSWSXR RLRMQOQUTWTXRXP",1247:" 8JZMSRPWS RMSRQWS",1248:" 7NVSKPO RSKTLPO",1249:" 7NVQKTO RQKPLTO",1250:" 14LXNKOMQNSNUMVK RNKONQOSOUNVK",1251:" 8NVSLRMQLRKSLSNQP",1252:" 8NVSKQMQORPSORNQO",1253:" 8NVQLRMSLRKQLQNSP",1254:" 8NVQKSMSORPQORNSO",1256:" 11JZWMQMONNOMQMSNUOVQWWW",1257:" 11JZMMMSNUOVQWSWUVVUWSWM",1258:" 11JZMMSMUNVOWQWSVUUVSWMW",1259:" 11JZMWMQNOONQMSMUNVOWQWW",1260:" 14JZWMQMONNOMQMSNUOVQWWW RMRUR",1261:" 13I[TOUPXRUTTU RUPWRUT RLRWR",1262:" 13MWRMRX ROPPORLTOUP RPORMTO",1263:" 13I[POOPLROTPU ROPMROT RMRXR",1264:" 13MWRLRW ROTPURXTUUT RPURWTU",1265:" 37KYVSUPSOQOOPNQMSMUNWPXRXTWUVVTWQWNVLTKQKPLQLRK RQOOQNSNVPX RRXTVUTVQVNULTK",1266:" 15JZLKRX RMKRV RXKRX RLKXK RNLWL",1267:" 10G[IOLORW RKORX R[FRX",1268:" 26I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[",1269:" 40I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[ RQNOONQNSOUQVSVUUVSVQUOSNQN",1270:" 26H\\ZRYTWUVUTTSSQPPONNMNKOJQJRKTMUNUPTQSSPTOVNWNYOZQZR",1271:" 26JZXKLX ROKPLPNOOMOLNLLMKOKSLVLXK RUTTUTWUXWXXWXUWTUT",1272:" 41J[YPXPXQYQYPXOWOVPUTTVSWQXOXMWLVLTMSORRPSNSLRKPKOLONPQUWWXXXYW ROXMVMTOR RONPPVWWX",1273:" 29J[UPSOQOPQPRQTSTUS RUOUSVTXTYRYQXNVLSKRKOLMNLQLRMUOWRXSXVW",1274:" 34KZQHQ\\ RTHT\\ RWLVLVMWMWLUKPKNLNNOPVSWT RNNOOVRWTWVVWTXQXOWNVNUOUOVNV",1275:" 12KYRKN\\ RVKR\\ RNQWQ RMVVV",1276:" 40LXTLSLSMTMTLSKQKPLPNQPTRUS RPNQOTQUSUUSW RQPOROTPVSXTY ROTPUSWTYT[S\\Q\\P[PZQZQ[P[",1277:" 29LXRKQLRMSLRK RRMRQ RRQQSRVSSRQ RRVR\\ RPOONNOOPPOTOUNVOUPTO",1278:" 42LXRMSLRKQLRMRQQRSURV RRQSRQURVRZQ[R\\S[RZ RPOONNOOPPOTOUNVOUPTO RPXOWNXOYPXTXUWVXUYTX",1279:" 12LYVKVX RNKVK RQQVQ RNXVX",1281:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRQQRRSSRRQ",1282:" 33LYQKPLPMQN RTKULUMTN RRNPOOQORPTRUSUUTVRVQUOSNRN RRURY RSUSY ROWVW",1283:" 23LYRKPLONOOPQRRSRUQVOVNULSKRK RRRRX RSRSX ROUVU",1284:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRKRY RKRYR",1285:" 25JYRRPQOQMRLTLUMWOXPXRWSUSTRR RWMRR RRMWMWR RRMVNWR",1286:" 25JZLLMKOKQLRNRPQRPSNT ROKPLQNQQPS RVKUX RWKTX RNTXT",1287:" 27JYNKNU ROKNR RNROPQOSOUPVQVTTVTXUYVYWX RSOUQUTTV RLKOK",1288:" 27LYONRKRQ RVNSKSQ RRQPROTOUPWRXSXUWVUVTURSQ RRTRUSUSTRT",1289:" 27JZRKRY RMKMPNRPSTSVRWPWK RLMMKNM RQMRKSM RVMWKXM ROVUV",1290:" 27JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXVXVUUX",1291:" 20LYWKTKQLONNQNSOVQXTYWY RWKTLRNQQQSRVTXWY",1292:" 23JZRRPQOQMRLTLUMWOXPXRWSUSTRR RSLQQ RWMRR RXQSS",1293:" 12KYPMTW RTMPW RMPWT RWPMT",1294:" 34J[OUMULVLXMYOYPXPVNTMRMONMOLQKTKVLWMXOXRWTUVUXVYXYYXYVXUVU RNMPLULWM",1295:" 34J[OOMOLNLLMKOKPLPNNPMRMUNWOXQYTYVXWWXUXRWPUNULVKXKYLYNXOVO RNWPXUXWW",1401:" 21F^KHK\\ RLHL\\ RXHX\\ RYHY\\ RHH\\H RH\\O\\ RU\\\\\\",1402:" 20H]KHRQJ\\ RJHQQ RJHYHZMXH RK[X[ RJ\\Y\\ZWX\\",1403:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",1404:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",1405:" 12KYOBOb RPBPb ROBVB RObVb",1406:" 12KYTBTb RUBUb RNBUB RNbUb",1407:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",1408:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPUR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OZQ[ RTb[b",2118:" 23IZNMN[ ROMO[ ROSPPRNTMWMXNXOWPVOWN RKMOM RK[R[",2119:" 32J[WOXMXQWOVNTMPMNNMOMQNRPSUUWVXW RMPNQPRUTWUXVXYWZU[Q[OZNYMWM[NY",2120:" 16KZPFPWQZS[U[WZXX RQFQWRZS[ RMMUM",2121:" 28G]LMLXMZP[R[UZWX RMMMXNZP[ RWMW[ RXMX[ RIMMM RTMXM RW[[[",2122:" 15I[LMR[ RMMRY RXMR[ RJMPM RTMZM",2123:" 24F^JMN[ RKMNX RRMN[ RRMV[ RSMVX RZMV[ RGMNM RWM]M",2124:" 21H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[",2125:" 22H[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM",2126:" 16I[WML[ RXMM[ RMMLQLMXM RL[X[XWW[",2127:" 40G^QMNNLPKRJUJXKZN[P[RZUWWTYPZM RQMONMPLRKUKXLZN[ RQMSMUNVPXXYZZ[ RSMTNUPWXXZZ[[[",2128:" 57G\\TFQGOIMMLPKTJZIb RTFRGPINMMPLTKZJb RTFVFXGYHYKXMWNTOPO RVFXHXKWMVNTO RPOTPVRWTWWVYUZR[P[NZMYLV RPOSPURVTVWUYTZR[",2129:" 28H\\IPKNMMOMQNROSRSVRZOb RJOLNPNRO RZMYPXRSYP^Nb RYMXPWRSY",2130:" 44I\\VNTMRMONMQLTLWMYNZP[R[UZWWXTXQWOSJRHRFSEUEWFYH RRMPNNQMTMXNZ RR[TZVWWTWPVNTKSISGTFVFYH",2131:" 32I[XPVNTMPMNNNPPRSS RPMONOPQRSS RSSNTLVLXMZP[S[UZWX RSSOTMVMXNZP[",2132:" 31I[TFRGQHQIRJUKZKZJWKSMPOMRLULWMYP[S]T_TaSbQbPa RULQONRMUMWNYP[",2133:" 32G]HQIOKMNMONOPNTL[ RMMNNNPMTK[ RNTPPRNTMVMXNYOYRXWUb RVMXOXRWWTb",2134:" 44F]GQHOJMM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SXUWXUZS[ RMFWF RMGRGWF",2206:" 48H\\WIVJWKXJXIWGUFRFOGMILKKOKULXNZQ[S[VZXXYUYTXQVOSNRNOOMQLT RRFPGNIMKLOLUMXOZQ[ RS[UZWXXUXTWQUOSN",2207:" 31H\\KFKL RKJLHNFPFUIWIXHYF RLHNGPGUI RYFYIXLTQSSRVR[ RXLSQRSQVQ[",2208:" 63H\\PFMGLILLMNPOTOWNXLXIWGTFPF RPFNGMIMLNNPO RTOVNWLWIVGTF RPOMPLQKSKWLYMZP[T[WZXYYWYSXQWPTO RPONPMQLSLWMYNZP[ RT[VZWYXWXSWQVPTO",2209:" 48H\\XMWPURRSQSNRLPKMKLLINGQFSFVGXIYLYRXVWXUZR[O[MZLXLWMVNWMX RQSORMPLMLLMIOGQF RSFUGWIXLXRWVVXTZR[",2210:" 6MWRYQZR[SZRY",2211:" 8MWR[QZRYSZS\\R^Q_",2212:" 12MWRMQNROSNRM RRYQZR[SZRY",2213:" 14MWRMQNROSNRM RR[QZRYSZS\\R^Q_",2214:" 15MWRFQHRTSHRF RRHRN RRYQZR[SZRY",2215:" 32I[MJNKMLLKLJMHNGPFSFVGWHXJXLWNVORQRT RSFUGVHWJWLVNTP RRYQZR[SZRY",2216:" 6NVRFQM RSFQM",2217:" 12JZNFMM ROFMM RVFUM RWFUM",2218:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",2219:" 9JZRFRR RMIWO RWIMO",2220:" 3G][BIb",2221:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",2222:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",2223:" 12KYOBOb RPBPb ROBVB RObVb",2224:" 12KYTBTb RUBUb RNBUB RNbUb",2225:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",2226:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",2227:" 4KYUBNRUb",2228:" 4KYOBVROb",2229:" 3NVRBRb",2230:" 6KYOBOb RUBUb",2231:" 3E_IR[R",2232:" 6E_RIR[ RIR[R",2233:" 9F^RJR[ RJRZR RJ[Z[",2234:" 9F^RJR[ RJJZJ RJRZR",2235:" 6G]KKYY RYKKY",2236:" 6MWRQQRRSSRRQ",2237:" 15E_RIQJRKSJRI RIR[R RRYQZR[SZRY",2238:" 6E_IO[O RIU[U",2239:" 9E_YIK[ RIO[O RIU[U",2240:" 9E_IM[M RIR[R RIW[W",2241:" 4F^ZIJRZ[",2242:" 4F^JIZRJ[",2243:" 10F^ZFJMZT RJVZV RJ[Z[",2244:" 10F^JFZMJT RJVZV RJ[Z[",2245:" 21F_[WYWWVUTRPQOONMNKOJQJSKUMVOVQURTUPWNYM[M",2246:" 24F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O",2247:" 8G]JTROZT RJTRPZT",2248:" 7LXTFOL RTFUGOL",2249:" 7LXPFUL RPFOGUL",2250:" 18H\\KFLHNJQKSKVJXHYF RKFLINKQLSLVKXIYF",2251:" 8MWRHQGRFSGSIRKQL",2252:" 8MWSFRGQIQKRLSKRJ",2253:" 8MWRHSGRFQGQIRKSL",2254:" 8MWQFRGSISKRLQKRJ",2255:" 10E[HMLMRY RKMR[ R[BR[",2256:" 13F^ZJSJOKMLKNJQJSKVMXOYSZZZ",2257:" 13F^JJJQKULWNYQZSZVYXWYUZQZJ",2258:" 13F^JJQJUKWLYNZQZSYVWXUYQZJZ",2259:" 13F^JZJSKOLMNKQJSJVKXMYOZSZZ",2260:" 16F^ZJSJOKMLKNJQJSKVMXOYSZZZ RJRVR",2261:" 11E_XP[RXT RUMZRUW RIRZR",2262:" 11JZPLRITL RMORJWO RRJR[",2263:" 11E_LPIRLT ROMJROW RJR[R",2264:" 11JZPXR[TX RMURZWU RRIRZ",2265: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N RKMOORLUN RQMTOWLYN RVMXO[L RIULRPT RKSOURRUT RQSTUWRYT RVSXU[R",2312:" 48F^JHNJPLQOQRPUNWJY RJHMIOJQLRO RRRQUOWMXJY RZHWIUJSLRO RRRSUUWWXZY RZHVJTLSOSRTUVWZY RIP[P RIQ[Q",2317:" 12NVQQQSSSSQQQ RQQSS RSQQS",2318:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2319:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2320:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2321:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2322:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2323:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2324:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2325:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2326:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2327:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2328:" 49JZMLWX RMLONQOTOVNWMWKUKUMTO RONTO RQOWM RVKVN RULWL RWXUVSUPUNVMWMYOYOWPU RUVPU RSUMW RNVNY RMXOX",2329:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLWY",2330:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2331:"103EfNSOUQVSVUUVSVQUOSNQNOONPMSMVNYP[S\\V\\Y[[Y\\W]T]P\\MZJXIUHRHOIMJKLIOHSHXI]KaMcPeTfYf]e`cba RKLJNIRIXJ\\L`NbQdUeYe]d_cba RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU RaLaNcNcLaL RbLbN RaMcM RaVaXcXcVaV RbVbX RaWcW",2332:" 30D`H@Hd RM@Md RW@Wd R\\@\\d RMMWK RMNWL RMOWM RMWWU RMXWV RMYWW",2367:" 12NVQQQSSSSQQQ RQQSS RSQQS",2368:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2369:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2370:" 32H\\PMMNLOKQKSLUMVPWTWWVXUYSYQXOWNTMPM RMNLPLSMUNVPW RWVXTXQWOVNTM",2371:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2372:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2373:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2374:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2375:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2376:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2377:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2378:" 36JZQCVMRTRU RULQS RTITKPRRUUY RW\\UYSXQXOYN[N]O_Ra RW\\UZSYOYO]P_Ra RSXPZN]",2379:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLSY",2380:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ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\\LML[M[ RLMMMM[ RMQPNRMUMWNXQX[ RMQPORNTNVOWQW[X[",2615:" 36I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM RQNOONPMSMUNXOYQZTZVYWXXUXSWPVOTNQN",2616:" 36H\\LMLbMb RLMMMMb RMPONQMTMVNXPYSYUXXVZT[Q[OZMX RMPQNTNVOWPXSXUWXVYTZQZMX",2617:" 36H\\WMWbXb RWMXMXb RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX",2618:" 21KYOMO[P[ ROMPMP[ RPSQPSNUMXM RPSQQSOUNXNXM",2619:" 50J[XPWNTMQMNNMPNRPSUUWV RVUWWWXVZ RWYTZQZNY ROZNXMX RXPWPVN RWOTNQNNO RONNPOR RNQPRUTWUXWXXWZT[Q[NZMX",2620:" 16MXRFR[S[ RRFSFS[ ROMVMVN ROMONVN",2621:" 25H\\LMLWMZO[R[TZWW RLMMMMWNYPZRZTYWW RWMW[X[ RWMXMX[",2622:" 14JZLMR[ RLMMMRY RXMWMRY RXMR[",2623:" 26F^IMN[ RIMJMNX RRMNX RRPN[ RRPV[ RRMVX R[MZMVX R[MV[",2624:" 16I[LMW[X[ RLMMMX[ RXMWML[ RXMM[L[",2625:" 17JZLMR[ RLMMMRY RXMWMRYNb RXMR[ObNb",2626:" 20I[VNL[ RXMNZ RLMXM RLMLNVN RNZXZX[ RL[X[",2651:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRTXTZV[XZYY[V RWRUXUZV[",2652:" 23LZLVNSPO RSFMXMZO[P[RZTXUUURVVWWXWZV RTFNXNZO[",2653:" 22LXTSSTTTTSSRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[",2654:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RZFTXTZV[XZYY[V R[FUXUZV[",2655:" 23LXOYQXRWSUSSRRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[",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TDRGPKOPOTPYR]T`Vb",2722:" 24KYNBPDRGTKUPUTTYR]P`NbOb RNBOBQDSGUKVPVTUYS]Q`Ob",2723:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",2724:" 8F_JQ[Q[R RJQJR[R",2725:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",2726:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",2727:" 11NWSFRGRM RSGRM RSFTGRM",2728:" 22I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM",2729:" 30KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF",2750:" 42H]TFQGOIMLLOKSKVLYMZO[Q[TZVXXUYRZNZKYHXGVFTF RTFRGPINLMOLSLVMYO[ RQ[SZUXWUXRYNYKXHVF",2751:" 15H]TJO[ RVFP[ RVFSIPKNL RUIQKNL",2752:" 42H]OJPKOLNKNJOHPGSFVFYGZIZKYMWOTQPSMUKWI[ RVFXGYIYKXMVOPS RJYKXMXRZUZWYXW RMXR[U[WZXW",2753:" 50H]OJPKOLNKNJOHPGSFVFYGZIZKYMVOSP RVFXGYIYKXMVO RQPSPVQWRXTXWWYVZS[O[LZKYJWJVKULVKW RSPUQVRWTWWVYUZS[",2754:" 10H]XGR[ RYFS[ RYFJUZU",2755:" 39H]QFLP RQF[F RQGVG[F RLPMOPNSNVOWPXRXUWXUZR[O[LZKYJWJVKULVKW RSNUOVPWRWUVXTZR[",2756:" 46H]YIXJYKZJZIYGWFTFQGOIMLLOKSKWLYMZO[R[UZWXXVXSWQVPTOQOOPMRLT RTFRGPINLMOLSLXMZ RR[TZVXWVWRVP",2757:" 30H]NFLL R[FZIXLSRQUPWO[ RXLRRPUOWN[ RMIPFRFWI RNHPGRGWIYIZH[F",2758:" 63H]SFPGOHNJNMOOQPTPXOYNZLZIYGVFSF RSFQGPHOJOMPOQP RTPWOXNYLYIXGVF RQPMQKSJUJXKZN[R[VZWYXWXTWRVQTP RQPNQLSKUKXLZN[ RR[UZVYWWWSVQ",2759:" 46H]YMXOVQTRQROQNPMNMKNIPGSFVFXGYHZJZNYRXUVXTZQ[N[LZKXKWLVMWLX ROQNONKOIQGSF RXGYIYNXRWUUXSZQ[",2760:" 6MXPYOZP[QZPY",2761:" 8MXP[OZPYQZQ[P]N_",2762:" 11MXSMRNSOTNSM RPYOZP[QZ",2763:" 14MXSMRNSOTNSM RP[OZPYQZQ[P]N_",2764:" 17MXUFTGRS RUGRS RUFVGRS RPYOZP[QZPY",2765:" 34H]OJPKOLNKNJOHPGSFWFZG[I[KZMYNSPQQQSRTTT RWFYGZIZKYMXNVO RPYOZP[QZPY",2766:" 8MXVFTHSJSKTLUKTJ",2767:" 8MXUHTGUFVGVHUJSL",2768:" 55E_\\N[O\\P]O]N\\M[MYNWPRXPZN[K[HZGXGVHTISKRPPROTMUKUITGRFPGOIOLPRQUSXUZW[Y[ZYZX RK[IZHXHVITJSPP ROLPQQTSWUYWZYZZY",2769:" 41H]TBL_ RYBQ_ RZJYKZL[K[JZHYGVFRFOGMIMKNMONVRXT RMKOMVQWRXTXWWYVZS[O[LZKYJWJVKULVKW",2770:" 3G]_BEb",2771:" 20KZZBVESHQKOONTNXO]P`Qb RVESIQMPPOUOZP_Qb",2772:" 20JYSBTDUGVLVPUUSYQ\\N_Jb RSBTEUJUOTTSWQ[N_",2773:" 9J[TFTR ROIYO RYIOO",2774:" 3E_IR[R",2775:" 6E_RIR[ RIR[R",2776:" 6E_IO[O RIU[U",2777:" 6NWUFSM RVFSM",2778:" 12I[PFNM RQFNM RYFWM RZFWM",2779:" 14KZSFQGPIPKQMSNUNWMXKXIWGUFSF",2801:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2802:" 31G]LFL[ RMFM[ RIFYFYLXF RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2803:" 45G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22G]NMNQMWLZK[J[IZJYKZ RWMW[ RXMX[ RKM[M RT[[[",2913:" 30G^LML[ RLMR[ RMMRY RXMR[ RXMX[ RYMY[ RIMMM RXM\\M RI[O[ RU[\\[",2914:" 27G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RMTWT RI[P[ RT[[[",2915:" 36H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM",2916:" 21G]LML[ RMMM[ RWMW[ RXMX[ RIM[M RI[P[ RT[[[",2917:" 36G\\LMLb RMMMb RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIMMM RIbPb",2918:" 28H[WPVQWRXQXPVNTMQMNNLPKSKULXNZQ[S[VZXX RQMONMPLSLUMXOZQ[",2919:" 16I\\RMR[ RSMS[ RMMLRLMYMYRXM RO[V[",2920:" 22I[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM",2921:" 52H]RFRb RSFSb ROFSF RRPQNPMNMLNKQKWLZN[P[QZRX RNMMNLQLWMZN[ RWMXNYQYWXZW[ RSPTNUMWMYNZQZWYZW[U[TZSX RObVb",2922:" 21H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[",2923:" 23G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RI[[[[`Z[",2924:" 28G]LMLTMVPWRWUVWT RMMMTNVPW RWMW[ RXMX[ RIMPM RTM[M RT[[[",2925:" 30CbHMH[ RIMI[ RRMR[ RSMS[ R\\M\\[ R]M][ REMLM ROMVM RYM`M RE[`[",2926:" 32CbHMH[ RIMI[ RRMR[ RSMS[ R\\M\\[ R]M][ REMLM ROMVM RYM`M RE[`[``_[",2927:" 27H]QMQ[ RRMR[ RLMKRKMUM RRTVTYUZWZXYZV[N[ RVTXUYWYXXZV[",2928:" 37E_JMJ[ RKMK[ RGMNM RKTOTRUSWSXRZO[G[ ROTQURWRX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QXPX RPYPZQZQYPY",3266:" 22MXWFUGTHSJSLTMUMVLVKUJTJ RUGTITJ RTKTLULUKTK",3267:" 22MXVIUITHTGUFVFWGWIVKULSM RUGUHVHVGUG RVIVJUL",3268:" 72E_\\O\\N[N[P]P]N\\M[MYNWPRXPZN[K[HZGXGVHTISKRPPROTMUKUITGRFPGOIOLPRQURWTZV[X[YYYX RL[HZ RIZHXHVITJSLR RPPQSTYVZ RK[JZIXIVJTKSMRRO ROLPOQRSVUYWZXZYY",3269:" 52H]TBL_ RYBQ_ RZKZJYJYL[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJULULWKWKV",3270:" 8G^_BEbFb R_B`BFb",3271:" 32JZZBXCUERHPKNOMSMXN\\O_Qb RSHQKOONTN\\ RZBWDTGRJQLPOOSN\\ RNTO]P`Qb",3272:" 32JZSBUEVHWLWQVUTYR\\O_LaJb RVHVPUUSYQ\\ RSBTDUGVP RVHUQTUSXRZP]M`Jb",3273:" 39J[TFSGUQTR RTFTR RTFUGSQTR ROIPIXOYO ROIYO ROIOJYNYO RYIXIPOOO RYIOO RYIYJONOO",3274:" 8F_JQ[Q[R RJQJR[R",3275:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",3276:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",3277:" 11MWUFTGRM RUGRM RUFVGRM",3278:" 22H\\PFOGMM RPGMM RPFQGMM RZFYGWM RZGWM RZF[GWM",3279:" 30KZSFQGPIPKQMSNUNWMXKXIWGUFSF RSFPIQMUNXKWGSF RUFQGPKSNWMXIUF",3301:" 62F^IHJIIJHIIGKFMFOGPHQKQOPRNTLUIV ROHPKPPOR RMFNGOJOPNSLU RLVOY RKVOZ RIVN[UV R\\G[H\\H\\G[FYFWGVHUJUYW[[W RWHVJVXXZ RYFXGWJWWYY",3302:"101E_GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFN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RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^",3429:" 62J[PIOLNNMOKP RPIPXQYO[ ROONOONOXNYOZPYOX RKPNPNXMYO[ RPPUMWNXPXRWTSV RUNWO RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^",3501:" 60G]LINGPFRFSGZW[X]X RQGRHYXZZ[YYX RNGPGQHXXYZZ[[[]X RLMMLOKPKQL RPLPM RMLOLPN RG[IYKXNXPY RJYNYOZ RG[JZMZN[PY RRJLX RNSVS",3502:"110F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RRIQJPLPU RQKQS RRIRRQTPU RRIXFZG[I[KYMUO RXGZIZK RVGXHYIYLWN RWNZP[R[X RYPZRZW RWNXOYQYX RJ[MYPXTXWY RLZOYTYVZ RJ[NZSZU[WYYX[X RUOUX RURYR RUUYU",3503:" 69E]NGLHJJILHOHSIVJXMZP[S[VZXYZW[U RJKINISKWNYQZTZWY RNGLIKKJNJRKUNXQYTYWXYW[U RPJPV RQJQT RRIRSQUPV RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RWIWX",3504:" 72G^IFWFYGZIZX RKGWGYIYW RIFJGLHWHXIXX ROKNLMNMOKOJPJRKQMQMV RNMNT RKPNP ROKOSNUMV RI[LYOXSXVY RKZNYSYUZ RI[MZRZT[VYXXZX RRHRX RRMTNVNXM RRSTRVRXS",3505:" 94G]IHKFMFOGQF RLGNG RIHKGMHOHQF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RQMRJSHTGVFXF[G RTHVGXGZH RRJSIUHWHYI[G RQURRSPTOVOXP RTPVPWQ RRRSQUQVRXP RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RQMQX",3506:" 91F]JHLFOFQGSF RMGPG RJHLGNHQHSF RPKOLNNNOLOKPKRLQNQNV ROMOT RLPOP RPKPSOUNV RSJSYRZQZMXKXIYG[ RTJTX RTPXP RPZOZMYJY RUIUOXO RXQUQUWTYP[N[LZJZG[ RSJUIXFZG\\G]F RWGYH[H RVHXIZI\\H]F RXIXW",3507:" 87E^NGLHJJILHOHRIUJWLYNZQ[U[XZZX[V[SZQYPWOUO RJKINISJV RNGLIKKJNJSKVLXNZ RYXZWZSYQ RU[WZXYYWYSXQWPUO RPJPW RQJQU RRIRTQVPW RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RYHUOU[ RUSYS RUVYV",3508:"112F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZOYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOWNYLZM[P[TZXX[ RXMYNZPZUYX RWNXNYPYUX[ RUOUY RURYR RUUYU",3509:" 67I\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZSZOXMXKYI[ RWKWW RRZQZOYLY RYHXJXVWXUZS[P[NZKZI[",3510:" 65H\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZ RWKWW RYHXJXVWXUZR[O[LZJXJVKULUMVLWKW RJVMV",3511:"115F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZNYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOXLYM[N RWMYN[N R[NYQWSUU RWSYTZX[Z\\Z RYVZZ RWSXTYZZ[[[\\Z RUOUY",3512:" 85G]IHKFNFPGRF RLGOG RIHKGMHPHRF RNKMLLNLOJOIPIRJQLQLW RMM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VO RWIWN RXHXOVOSPQQ RQPSQVRXRXY RWSWX RVRVY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3704:" 41H\\UFKPKUTU RVUZU[V[TZU RLPLT RMNMU RTGTXRY RUJVHUGUYWZ RUFWHVJVXXYYY RRYSYUZV[WZYY",3705:" 53H\\LFLO RLFXF RMGVG RLHUHWGXF RVLUMSNOOLO RSNTNVOVY RUMWNWX RVLWMYNZNXOXY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3706:" 59H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHRGTFUGWHXH RSGUH RRGTIVIXH RNPOPSOUNVM RSOTOVPVY RUNWPWX RVMWNYOZOXPXY RJYLYNZO[QZVYXY",3707:" 38H\\KHMFPGUGZF RLGOHTHWG RKHOIRIVHZF RZFYHWKSOQRPUPXQ[ RRQQTQWRZ RUMSPRSRVSYQ[",3708:" 71H\\LILO RMJMN RNINO RLINISHUGVF RSHTHVIVO RUGWHWN RVFWGYHZHXIXO RLONOVRXR RXOVONRLR RLRLXJY RMSMXPZ RNRNXPYQZ RVRVY RWSWX RXRXY RJYLYNZO[QZVYXY",3709:" 60H\\LHLQJR RMIMROS RNHNQPRQR RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJRKRMSNTOSQRUQVQ RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3710:" 11LXRXPZR[TZRX RRYQZSZRY",3711:" 14LXR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3712:" 22LXRMPORPTORM RRNQOSORN RRXPZR[TZRX RRYQZSZRY",3713:" 25LXRMPORPTORM RRNQOSORN RR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3714:" 30LXRFQGOHQIRT RRISHRGQHRIRT RRFSGUHSIRT RRXPZR[TZRX RRYQZSZRY",3715:" 51I[LJMHNGQFSFVGWHXJXLWNUPSQ RMJNH RVHWIWMVN RLJNKNIOGQF RSFUGVIVMUOSQ RRQRTSQQQRT RRXPZR[TZRX RRYQZSZRY",3716:" 14LXTFRGQIQKRMTKRIRG RRJRLSKRJ",3717:" 14LXRLRJPHRFSHSJRLPM RRGQHRIRG",3718:" 62E_YNZO[O\\N RXOYP[P RXPYQZQ[P\\N RYNST RRUL[HVNP ROOSKOFJLPRTXVZX[Z[[Z\\X RLZIV RRKOG RKLPQTWVYXZ[Z RMZIU RRLNG RKKQQUWVXXY[Y\\X",3719:" 60H\\PBP_ RTBT_ RTFVGWIWKYJXHWGTFPFMGKIKLLNOPURWSXUXXWZ RXJWH RLLMNOOUQWRXT RMYLW RMGLILKMMONUPXRYTYWXYWZT[P[MZLYKWMVMXNZP[",3720:" 8G^[BIbJb R[B\\BJb",3721:" 27KYUBSDQGOKNPNTOYQ]S`Ub RQHPKOOOUPYQ\\ RSDRFQIPOPUQ[R^S`",3722:" 27KYOBQDSGUKVPVTUYS]Q`Ob RSHTKUOUUTYS\\ RQDRFSITOTUS[R^Q`",3723:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",3724:" 8F_JQ[Q[R RJQJR[R",3725:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",3726:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",3727:" 11NWSFRGRM RSGRM RSFTGRM",3728:" 22I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM",3729:" 30KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF",3801:" 52E_NHLIJKIMHPHSIUKV RJLIOISJU RNHLJKLJOJRKVKXJZH[ RVHXHXYVY RYHYY RZGZZ RHFKGQHVHZG\\F RJPXP RH[KZQYVYZZ\\[",3802:" 65E_LGLZ RMGMZ RPFNGNZP[ RHJJHLGPFUFXGZIZKYM RXHYIYKXM RUFWGXIXKWL RQUOTNRNPONPMSLVLYM[O\\Q\\T[WYYWZT[P[LZJYHW RZO[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MWPWX RTNVPVX RRNUQUY",3916:" 47IZLMMOMXKYMYM_LbN` RNON` RLMNNOOOXQYRZ RNYOYQZ ROZP[UYWX ROZO_PbN` ROORNTMWPWX RTNVPVX RRNUQUY",3917:" 31J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW_XbV` RTNVPV` RRNUQU_TbV`",3918:" 31KXMONOOPOXNYP[ RONPOPXOYPZQYPX RMOOMQOQXRYP[ RQOUMWOUPSN RTNVO",3919:" 41JZMPMSOUURWTWX RNPNSOT ROOOSPT RUSVTVX RTSUTUY RMPSMVNTOQN RRNUN RWXQ[MYOXSZ ROYQZ",3920:" 27MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[ RNMQM RSMVM",3921:" 40I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPWXXYYY RVPWOVNUOVPVYWZ RVMTOUPUYW[YY",3922:" 36I[LMMOMXQ[SYWW RMNNONXQZ RLMNNOOOWRYSY RVMXOWPWW RVPWOVNUOVPVW RVMTOUPUX",3923:" 59E_HMIOIXM[OYQX RINJOJXMZ RHMJNKOKWNYOY RRMPOQPQXU[WY[W RRPSORNQORPRXUZ RRMTOSPSWVYWY RZM\\O[P[W RZP[OZNYOZPZW RZMXOYPYX",3924:" 39I[LONPUZV[XY RMNOOUYWZ RLONMONVXXY RXMVMVOXOXMVOSS RQUNYL[N[NYLYL[ RNTQT RSTVT",3925:" 49I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPW]V_U`SaQaO`MaObQa RVPWOVNUOVPV^U_ RPaNa RVMTOUPU^T`Sa",3926:" 43L[RNOPOORNTMWOWSRU RTNVOVS RRNUPUSTT RRUWWW]V_U`SaQaO`MaObQa RVWV^U_ RPaNa RTVUWU^T`Sa"},gt={"\\frac":{glyph:0,arity:2,flags:{}},"\\binom":{glyph:0,arity:2,flags:{}},"\\sqrt":{glyph:2267,arity:1,flags:{opt:!0,xfl:!0,yfl:!0}},"^":{glyph:0,arity:1,flags:{}},_:{glyph:0,arity:1,flags:{}},"(":{glyph:2221,arity:0,flags:{yfl:!0}},")":{glyph:2222,arity:0,flags:{yfl:!0}},"[":{glyph:2223,arity:0,flags:{yfl:!0}},"]":{glyph:2224,arity:0,flags:{yfl:!0}},"\\langle":{glyph:2227,arity:0,flags:{yfl:!0}},"\\rangle":{glyph:2228,arity:0,flags:{yfl:!0}},"|":{glyph:2229,arity:0,flags:{yfl:!0}},"\\|":{glyph:2230,arity:0,flags:{yfl:!0}},"\\{":{glyph:2225,arity:0,flags:{yfl:!0}},"\\}":{glyph:2226,arity:0,flags:{yfl:!0}},"\\#":{glyph:2275,arity:0,flags:{}},"\\$":{glyph:2274,arity:0,flags:{}},"\\&":{glyph:2273,arity:0,flags:{}},"\\%":{glyph:2271,arity:0,flags:{}},"\\begin":{glyph:0,arity:1,flags:{}},"\\end":{glyph:0,arity:1,flags:{}},"\\left":{glyph:0,arity:1,flags:{}},"\\right":{glyph:0,arity:1,flags:{}},"\\middle":{glyph:0,arity:1,flags:{}},"\\cdot":{glyph:2236,arity:0,flags:{}},"\\pm":{glyph:2233,arity:0,flags:{}},"\\mp":{glyph:2234,arity:0,flags:{}},"\\times":{glyph:2235,arity:0,flags:{}},"\\div":{glyph:2237,arity:0,flags:{}},"\\leqq":{glyph:2243,arity:0,flags:{}},"\\geqq":{glyph:2244,arity:0,flags:{}},"\\leq":{glyph:2243,arity:0,flags:{}},"\\geq":{glyph:2244,arity:0,flags:{}},"\\propto":{glyph:2245,arity:0,flags:{}},"\\sim":{glyph:2246,arity:0,flags:{}},"\\equiv":{glyph:2240,arity:0,flags:{}},"\\dagger":{glyph:2277,arity:0,flags:{}},"\\ddagger":{glyph:2278,arity:0,flags:{}},"\\ell":{glyph:662,arity:0,flags:{}},"\\vec":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overrightarrow":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overleftarrow":{glyph:2263,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\bar":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\overline":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\widehat":{glyph:2247,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\hat":{glyph:2247,arity:1,flags:{hat:!0}},"\\acute":{glyph:2248,arity:1,flags:{hat:!0}},"\\grave":{glyph:2249,arity:1,flags:{hat:!0}},"\\breve":{glyph:2250,arity:1,flags:{hat:!0}},"\\tilde":{glyph:2246,arity:1,flags:{hat:!0}},"\\underline":{glyph:2231,arity:1,flags:{mat:!0,xfl:!0}},"\\not":{glyph:2220,arity:1,flags:{}},"\\neq":{glyph:2239,arity:1,flags:{}},"\\ne":{glyph:2239,arity:1,flags:{}},"\\exists":{glyph:2279,arity:0,flags:{}},"\\in":{glyph:2260,arity:0,flags:{}},"\\subset":{glyph:2256,arity:0,flags:{}},"\\supset":{glyph:2258,arity:0,flags:{}},"\\cup":{glyph:2257,arity:0,flags:{}},"\\cap":{glyph:2259,arity:0,flags:{}},"\\infty":{glyph:2270,arity:0,flags:{}},"\\partial":{glyph:2265,arity:0,flags:{}},"\\nabla":{glyph:2266,arity:0,flags:{}},"\\aleph":{glyph:2077,arity:0,flags:{}},"\\wp":{glyph:2190,arity:0,flags:{}},"\\therefore":{glyph:740,arity:0,flags:{}},"\\mid":{glyph:2229,arity:0,flags:{}},"\\sum":{glyph:2402,arity:0,flags:{big:!0}},"\\prod":{glyph:2401,arity:0,flags:{big:!0}},"\\bigoplus":{glyph:2284,arity:0,flags:{big:!0}},"\\bigodot":{glyph:2281,arity:0,flags:{big:!0}},"\\int":{glyph:2412,arity:0,flags:{yfl:!0}},"\\oint":{glyph:2269,arity:0,flags:{yfl:!0}},"\\oplus":{glyph:1284,arity:0,flags:{}},"\\odot":{glyph:1281,arity:0,flags:{}},"\\perp":{glyph:738,arity:0,flags:{}},"\\angle":{glyph:739,arity:0,flags:{}},"\\triangle":{glyph:842,arity:0,flags:{}},"\\Box":{glyph:841,arity:0,flags:{}},"\\rightarrow":{glyph:2261,arity:0,flags:{}},"\\to":{glyph:2261,arity:0,flags:{}},"\\leftarrow":{glyph:2263,arity:0,flags:{}},"\\gets":{glyph:2263,arity:0,flags:{}},"\\circ":{glyph:902,arity:0,flags:{}},"\\bigcirc":{glyph:904,arity:0,flags:{}},"\\bullet":{glyph:828,arity:0,flags:{}},"\\star":{glyph:856,arity:0,flags:{}},"\\diamond":{glyph:743,arity:0,flags:{}},"\\ast":{glyph:728,arity:0,flags:{}},"\\log":{glyph:0,arity:0,flags:{txt:!0}},"\\ln":{glyph:0,arity:0,flags:{txt:!0}},"\\exp":{glyph:0,arity:0,flags:{txt:!0}},"\\mod":{glyph:0,arity:0,flags:{txt:!0}},"\\lim":{glyph:0,arity:0,flags:{txt:!0,big:!0}},"\\sin":{glyph:0,arity:0,flags:{txt:!0}},"\\cos":{glyph:0,arity:0,flags:{txt:!0}},"\\tan":{glyph:0,arity:0,flags:{txt:!0}},"\\csc":{glyph:0,arity:0,flags:{txt:!0}},"\\sec":{glyph:0,arity:0,flags:{txt:!0}},"\\cot":{glyph:0,arity:0,flags:{txt:!0}},"\\sinh":{glyph:0,arity:0,flags:{txt:!0}},"\\cosh":{glyph:0,arity:0,flags:{txt:!0}},"\\tanh":{glyph:0,arity:0,flags:{txt:!0}},"\\csch":{glyph:0,arity:0,flags:{txt:!0}},"\\sech":{glyph:0,arity:0,flags:{txt:!0}},"\\coth":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsin":{glyph:0,arity:0,flags:{txt:!0}},"\\arccos":{glyph:0,arity:0,flags:{txt:!0}},"\\arctan":{glyph:0,arity:0,flags:{txt:!0}},"\\arccsc":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsec":{glyph:0,arity:0,flags:{txt:!0}},"\\arccot":{glyph:0,arity:0,flags:{txt:!0}},"\\text":{glyph:0,arity:1,flags:{}},"\\mathnormal":{glyph:0,arity:1,flags:{}},"\\mathrm":{glyph:0,arity:1,flags:{}},"\\mathit":{glyph:0,arity:1,flags:{}},"\\mathbf":{glyph:0,arity:1,flags:{}},"\\mathsf":{glyph:0,arity:1,flags:{}},"\\mathtt":{glyph:0,arity:1,flags:{}},"\\mathfrak":{glyph:0,arity:1,flags:{}},"\\mathcal":{glyph:0,arity:1,flags:{}},"\\mathbb":{glyph:0,arity:1,flags:{}},"\\mathscr":{glyph:0,arity:1,flags:{}},"\\rm":{glyph:0,arity:1,flags:{}},"\\it":{glyph:0,arity:1,flags:{}},"\\bf":{glyph:0,arity:1,flags:{}},"\\sf":{glyph:0,arity:1,flags:{}},"\\tt":{glyph:0,arity:1,flags:{}},"\\frak":{glyph:0,arity:1,flags:{}},"\\cal":{glyph:0,arity:1,flags:{}},"\\bb":{glyph:0,arity:1,flags:{}},"\\scr":{glyph:0,arity:1,flags:{}},"\\quad":{glyph:0,arity:0,flags:{}},"\\,":{glyph:0,arity:0,flags:{}},"\\.":{glyph:0,arity:0,flags:{}},"\\;":{glyph:0,arity:0,flags:{}},"\\!":{glyph:0,arity:0,flags:{}},"\\alpha":{glyph:2127,flags:{}},"\\beta":{glyph:2128,flags:{}},"\\gamma":{glyph:2129,flags:{}},"\\delta":{glyph:2130,flags:{}},"\\varepsilon":{glyph:2131,flags:{}},"\\zeta":{glyph:2132,flags:{}},"\\eta":{glyph:2133,flags:{}},"\\vartheta":{glyph:2134,flags:{}},"\\iota":{glyph:2135,flags:{}},"\\kappa":{glyph:2136,flags:{}},"\\lambda":{glyph:2137,flags:{}},"\\mu":{glyph:2138,flags:{}},"\\nu":{glyph:2139,flags:{}},"\\xi":{glyph:2140,flags:{}},"\\omicron":{glyph:2141,flags:{}},"\\pi":{glyph:2142,flags:{}},"\\rho":{glyph:2143,flags:{}},"\\sigma":{glyph:2144,flags:{}},"\\tau":{glyph:2145,flags:{}},"\\upsilon":{glyph:2146,flags:{}},"\\varphi":{glyph:2147,flags:{}},"\\chi":{glyph:2148,flags:{}},"\\psi":{glyph:2149,flags:{}},"\\omega":{glyph:2150,flags:{}},"\\epsilon":{glyph:2184,flags:{}},"\\theta":{glyph:2185,flags:{}},"\\phi":{glyph:2186,flags:{}},"\\varsigma":{glyph:2187,flags:{}},"\\Alpha":{glyph:2027,flags:{}},"\\Beta":{glyph:2028,flags:{}},"\\Gamma":{glyph:2029,flags:{}},"\\Delta":{glyph:2030,flags:{}},"\\Epsilon":{glyph:2031,flags:{}},"\\Zeta":{glyph:2032,flags:{}},"\\Eta":{glyph:2033,flags:{}},"\\Theta":{glyph:2034,flags:{}},"\\Iota":{glyph:2035,flags:{}},"\\Kappa":{glyph:2036,flags:{}},"\\Lambda":{glyph:2037,flags:{}},"\\Mu":{glyph:2038,flags:{}},"\\Nu":{glyph:2039,flags:{}},"\\Xi":{glyph:2040,flags:{}},"\\Omicron":{glyph:2041,flags:{}},"\\Pi":{glyph:2042,flags:{}},"\\Rho":{glyph:2043,flags:{}},"\\Sigma":{glyph:2044,flags:{}},"\\Tau":{glyph:2045,flags:{}},"\\Upsilon":{glyph:2046,flags:{}},"\\Phi":{glyph:2047,flags:{}},"\\Chi":{glyph:2048,flags:{}},"\\Psi":{glyph:2049,flags:{}},"\\Omega":{glyph:2050,flags:{}}};function Zn(o,t="math"){const e=o.charCodeAt(0);if(65<=e&&e<=90){const n=e-65;return t=="text"||t=="rm"?n+2001:t=="tt"?n+501:t=="bf"||t=="bb"?n+3001:t=="sf"?n+2501:t=="frak"?n+3301:t=="scr"||t=="cal"?n+2551:n+2051}if(97<=e&&e<=122){const n=e-97;return t=="text"||t=="rm"?n+2101:t=="tt"?n+601:t=="bf"||t=="bb"?n+3101:t=="sf"?n+2601:t=="frak"?n+3401:t=="scr"||t=="cal"?n+2651:n+2151}if(48<=e&&e<=57){const n=e-48;return t=="it"?n+2750:t=="bf"?n+3200:t=="tt"?n+700:n+2200}return{".":2210,",":2211,":":2212,";":2213,"!":2214,"?":2215,"'":2216,'"':2217,"*":2219,"/":2220,"-":2231,"+":2232,"=":2238,"<":2241,">":2242,"~":2246,"@":2273,"\\":804}[o]}const qt={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function ul(o){o=o.replace(/\n/g," ");let t=0;const e=[];let n="";for(;t<o.length;)o[t]==" "?n.length&&(e.push(n),n=""):o[t]=="\\"?n.length==1&&n[0]=="\\"?(n+=o[t],e.push(n),n=""):(n.length&&e.push(n),n=o[t]):/[A-Za-z0-9\.]/.test(o[t])?n+=o[t]:(n.length&&n!="\\"&&(e.push(n),n=""),n+=o[t],e.push(n),n=""),t++;return n.length&&e.push(n),e}function hl(o){return{type:gt[o]?"symb":"char",mode:"math",text:o,chld:[],bbox:null}}function yo(o){let t=0,e={type:"node",text:"",mode:"math",chld:[],bbox:null};function n(){if(o[t]!="[")return null;let r=0,s=t;for(;s<o.length;){if(o[s]=="[")r++;else if(o[s]=="]"&&(r--,!r))break;s++}const a=yo(o.slice(t+1,s));return t=s,a}function i(r){let s=t,a=s,c=0,d=0;const R=[];for(;s<o.length;){if(o[s]=="{")c||(a=s),c++;else if(o[s]=="}"){if(c--,!c&&(R.push(yo(o.slice(a+1,s))),d++,d==r))break}else if(c==0&&(R.push(hl(o[s])),d++,d==r))break;s++}return t=s,R}for(t=0;t<o.length;t++){const r=gt[o[t]],s={type:"",text:o[t],mode:"math",chld:[],bbox:null};if(r)if(r.arity){t++,s.type="func";let a=null;r.flags.opt&&(a=n(),a&&t++);const c=i(r.arity);s.chld=c,a&&s.chld.push(a)}else s.type="symb";else o[t]=="{"?(s.type="node",s.text="",s.chld=i(1)):s.type="char";e.chld.push(s)}return e.chld.length==1&&(e=e.chld[0]),e}function vi(o){let t=0;for(;t<o.length;){if(o[t].text=="\\begin"){let e;for(e=t;e<o.length&&o[e].text!="\\end";e++);const n=o.splice(t+1,e-(t+1));vi(n),o[t].text=o[t].chld[0].text,o[t].chld=n,o.splice(t+1,1)}t++}}function At(o,t,e,n,i,r){if(e==null&&(e=t),!!o.bbox){r&&(o.bbox.x*=t,o.bbox.y*=e),o.bbox.w*=t,o.bbox.h*=e;for(let s=0;s<o.chld.length;s++)At(o.chld[s],t,e,0,0,!0);o.bbox.x+=n,o.bbox.y+=i}}function Ki(o){let t=1/0,e=-1/0,n=1/0,i=-1/0;for(let r=0;r<o.length;r++)o[r].bbox&&(t=Math.min(t,o[r].bbox.x),n=Math.min(n,o[r].bbox.y),e=Math.max(e,o[r].bbox.x+o[r].bbox.w),i=Math.max(i,o[r].bbox.y+o[r].bbox.h));return{x:t,y:n,w:e-t,h:i-n}}function gl(o){if(!o.length)return null;const t=Ki(o);for(let n=0;n<o.length;n++)o[n].bbox&&(o[n].bbox.x-=t.x,o[n].bbox.y-=t.y);return{type:"node",text:"",mode:"math",chld:o,bbox:t}}function fl(o,t="center"){for(let d=0;d<o.length;d++)if(o[d].text=="^"||o[d].text=="'"){let R=0,u=d;for(;u>0&&(o[u].text=="^"||o[u].text=="_"||o[u].text=="'");)u--;R=o[u].bbox.y,o[d].text=="'"?o[d].bbox.y=R:(At(o[d],qt.SUB_SUP_SCALE,null,0,0),gt[o[u].text]&&gt[o[u].text].flags.big?o[d].bbox.y=R-o[d].bbox.h:o[u].text=="\\int"?o[d].bbox.y=R:o[d].bbox.y=R-o[d].bbox.h/2)}else if(o[d].text=="_"){let R=1,u=d;for(;u>0&&(o[u].text=="^"||o[u].text=="_"||o[u].text=="'");)u--;R=o[u].bbox.y+o[u].bbox.h,At(o[d],qt.SUB_SUP_SCALE,null,0,0),gt[o[u].text]&&gt[o[u].text].flags.big?o[d].bbox.y=R:o[u].text=="\\int"?o[d].bbox.y=R-o[d].bbox.h:o[d].bbox.y=R-o[d].bbox.h/2}function e(d,R,u,h,g){let f=d,T=g,p=1/0,m=-1/0;for(;h>0?f<o.length:f>=0;){if(o[f].text==R)T++;else if(o[f].text==u){if(T--,T==0)break}else o[f].text=="^"||o[f].text=="_"||o[f].bbox&&(p=Math.min(p,o[f].bbox.y),m=Math.max(m,o[f].bbox.y+o[f].bbox.h));f+=h}return[p,m]}for(let d=0;d<o.length;d++)if(o[d].text=="\\left"){const[R,u]=e(d,"\\left","\\right",1,0);R!=1/0&&u!=-1/0&&(o[d].bbox.y=R,At(o[d],1,(u-R)/o[d].bbox.h,0,0))}else if(o[d].text=="\\right"){const[R,u]=e(d,"\\right","\\left",-1,0);R!=1/0&&u!=-1/0&&(o[d].bbox.y=R,At(o[d],1,(u-R)/o[d].bbox.h,0,0))}else if(o[d].text=="\\middle"){const[R,u]=e(d,"\\right","\\left",-1,1),[h,g]=e(d,"\\left","\\right",1,1),f=Math.min(R,h),T=Math.max(u,g);f!=1/0&&T!=-1/0&&(o[d].bbox.y=f,At(o[d],1,(T-f)/o[d].bbox.h,0,0))}if(!o.some(d=>d.text=="&"||d.text=="\\\\"))return;const n=[];let i=[],r=[];for(let d=0;d<o.length;d++)o[d].text=="&"?(i.push(r),r=[]):o[d].text=="\\\\"?(r.length&&(i.push(r),r=[]),n.push(i),i=[]):r.push(o[d]);r.length&&i.push(r),i.length&&n.push(i);const s=[],a=[];for(let d=0;d<n.length;d++){const R=[];for(let u=0;u<n[d].length;u++){const h=gl(n[d][u]);h&&(s[u]=s[u]||0,s[u]=Math.max(h.bbox.w+1,s[u])),R[u]=h}a.push(R)}const c=[];for(let d=0;d<a.length;d++){let R=1/0,u=-1/0;for(let h=0;h<a[d].length;h++)a[d][h]&&(R=Math.min(R,a[d][h].bbox.y),u=Math.max(u,a[d][h].bbox.y+a[d][h].bbox.h));c.push([R,u])}for(let d=0;d<c.length;d++)(c[d][0]==1/0||c[d][1]==1/0)&&(c[d][0]=d==0?0:c[d-1][1],c[d][1]=c[d][0]+2);for(let d=1;d<a.length;d++){const R=c[d-1][1]-c[d][0]+qt.LINE_SPACING;for(let u=0;u<a[d].length;u++)a[d][u]&&(a[d][u].bbox.y+=R);c[d][0]+=R,c[d][1]+=R}o.splice(0,o.length);for(let d=0;d<a.length;d++){let R=0;for(let u=0;u<a[d].length;u++){const h=a[d][u];if(!h){R+=s[u];continue}h.bbox.x+=R,R+=s[u]-h.bbox.w,t=="center"?h.bbox.x+=(s[u]-h.bbox.w)/2:t=="left"||(t=="right"||t=="equation"&&u!=a[d].length-1)&&(h.bbox.x+=s[u]-h.bbox.w),o.push(h)}}}function ue(o,t="math"){const e={"\\text":"text","\\mathnormal":"math","\\mathrm":"rm","\\mathit":"it","\\mathbf":"bf","\\mathsf":"sf","\\mathtt":"tt","\\mathfrak":"frak","\\mathcal":"cal","\\mathbb":"bb","\\mathscr":"scr","\\rm":"rm","\\it":"it","\\bf":"bf","\\sf":"tt","\\tt":"tt","\\frak":"frak","\\cal":"cal","\\bb":"bb","\\scr":"scr"}[o.text]??t;if(!o.chld.length){if(gt[o.text])if(gt[o.text].flags.big)o.text=="\\lim"?o.bbox={x:0,y:0,w:3.5,h:2}:o.bbox={x:0,y:-.5,w:3,h:3};else if(gt[o.text].flags.txt){let n=0;for(let i=1;i<o.text.length;i++)n+=ze(Zn(o.text[i],"text")).w;n/=16,o.bbox={x:0,y:0,w:n,h:2}}else if(gt[o.text].glyph){let n=ze(gt[o.text].glyph).w;n/=16,o.text=="\\int"||o.text=="\\oint"?o.bbox={x:0,y:-1.5,w:n,h:5}:o.bbox={x:0,y:0,w:n,h:2}}else o.bbox={x:0,y:0,w:1,h:2};else{let n=0;for(let i=0;i<o.text.length;i++)ze(Zn(o.text[i],e))&&(e=="tt"?n+=16:n+=ze(Zn(o.text[i],e)).w);n/=16,o.bbox={x:0,y:0,w:n,h:2}}o.mode=e;return}if(o.text=="\\frac"){const n=o.chld[0],i=o.chld[1],r=qt.FRAC_SCALE;ue(n),ue(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const s=Math.max(n.bbox.w,i.bbox.w)*r;At(n,r,null,(s-n.bbox.w*r)/2,0),At(i,r,null,(s-i.bbox.w*r)/2,n.bbox.h+qt.FRAC_SPACING),o.bbox={x:0,y:-n.bbox.h+1-qt.FRAC_SPACING/2,w:s,h:n.bbox.h+i.bbox.h+qt.FRAC_SPACING}}else if(o.text=="\\binom"){const n=o.chld[0],i=o.chld[1];ue(n),ue(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const r=Math.max(n.bbox.w,i.bbox.w);At(n,1,null,(r-n.bbox.w)/2+1,0),At(i,1,null,(r-i.bbox.w)/2+1,n.bbox.h),o.bbox={x:0,y:-n.bbox.h+1,w:r+2,h:n.bbox.h+i.bbox.h}}else if(o.text=="\\sqrt"){const n=o.chld[0];ue(n);const i=o.chld[1];let r=0;i&&(ue(i),r=Math.max(i.bbox.w*qt.SQRT_MAG_SCALE-.5,0),At(i,qt.SQRT_MAG_SCALE,null,0,.5)),At(n,1,null,1+r,.5),o.bbox={x:0,y:2-n.bbox.h-.5,w:n.bbox.w+1+r,h:n.bbox.h+.5}}else if(gt[o.text]&&gt[o.text].flags.hat){const n=o.chld[0];ue(n);const i=n.bbox.y-.5;n.bbox.y=.5,o.bbox={x:0,y:i,w:n.bbox.w,h:n.bbox.h+.5}}else if(gt[o.text]&&gt[o.text].flags.mat){const n=o.chld[0];ue(n),o.bbox={x:0,y:0,w:n.bbox.w,h:n.bbox.h+.5}}else{let n=0,i=0,r=1;for(let u=0;u<o.chld.length;u++){const h=o.chld[u],g={"\\quad":2,"\\,":6/18,"\\:":8/18,"\\;":10/18,"\\!":-6/18}[h.text]??null;if(h.text=="\\\\"){i+=r,n=0,r=1;continue}else{if(h.text=="&")continue;if(g!=null){n+=g;continue}else{if(ue(h,e),At(h,1,null,n,i),h.text=="^"||h.text=="_"||h.text=="'"){let f=u;for(;f>0&&(o.chld[f].text=="^"||o.chld[f].text=="_"||o.chld[f].text=="'");)f--;const T=gt[o.chld[f].text]&&gt[o.chld[f].text].flags.big;if(h.text=="'"){let p=f+1,m=0;for(;p<u;)o.chld[p].text=="'"&&m++,p++;h.bbox.x=o.chld[f].bbox.x+o.chld[f].bbox.w+h.bbox.w*m,n=Math.max(n,h.bbox.x+h.bbox.w)}else if(T){const p=o.chld[f].bbox.x+(o.chld[f].bbox.w-h.bbox.w*qt.SUB_SUP_SCALE)/2;h.bbox.x=p,n=Math.max(n,o.chld[f].bbox.x+o.chld[f].bbox.w+(h.bbox.w*qt.SUB_SUP_SCALE-o.chld[f].bbox.w)/2)}else h.bbox.x=o.chld[f].bbox.x+o.chld[f].bbox.w,n=Math.max(n,h.bbox.x+h.bbox.w*qt.SUB_SUP_SCALE)}else n+=h.bbox.w;t=="text"&&(n+=1),r=Math.max(h.bbox.y+h.bbox.h-i,r)}}}i+=r;const s={bmatrix:["[","]"],pmatrix:["(",")"],Bmatrix:["\\{","\\}"],cases:["\\{"]},a={bmatrix:"center",pmatrix:"center",Bmatrix:"center",cases:"left",matrix:"center",aligned:"equation"}[o.text]??"left",c=!!s[o.text],d=!!s[o.text]&&s[o.text].length>1;fl(o.chld,a);const R=Ki(o.chld);o.text=="\\text"&&(R.x-=1,R.w+=2);for(let u=0;u<o.chld.length;u++)At(o.chld[u],1,null,-R.x+(c?1.5:0),-R.y);o.bbox={x:0,y:0,w:R.w+1.5*Number(c)+1.5*Number(d),h:R.h},c&&o.chld.unshift({type:"symb",text:s[o.text][0],mode:o.mode,chld:[],bbox:{x:0,y:0,w:1,h:R.h}}),d&&o.chld.push({type:"symb",text:s[o.text][1],mode:o.mode,chld:[],bbox:{x:R.w+2,y:0,w:1,h:R.h}}),(c||d||o.text=="matrix")&&(o.type="node",o.text="",o.bbox.y-=(o.bbox.h-2)/2)}}function Tl(o){function t(n,i,r){const s=[];if(n.bbox){if(i+=n.bbox.x,r+=n.bbox.y,n.text=="\\frac"){const a=n.chld[1].bbox.y-(n.chld[0].bbox.y+n.chld[0].bbox.h),c={type:"symb",mode:n.mode,text:"\\bar",bbox:{x:i,y:r+(n.chld[1].bbox.y-a/2)-a/2,w:n.bbox.w,h:a},chld:[]};s.push(c)}else if(n.text=="\\sqrt"){const a=n.chld[0].bbox.y,c=Math.max(0,n.chld[0].bbox.x-n.chld[0].bbox.h/2),d={type:"symb",mode:n.mode,text:"\\sqrt",bbox:{x:i+c,y:r+a/2,w:n.chld[0].bbox.x-c,h:n.bbox.h-a/2},chld:[]};s.push(d),s.push({type:"symb",text:"\\bar",mode:n.mode,bbox:{x:i+n.chld[0].bbox.x,y:r,w:n.bbox.w-n.chld[0].bbox.x,h:a},chld:[]})}else if(n.text=="\\binom"){const a=Math.min(n.chld[0].bbox.x,n.chld[1].bbox.x),c={type:"symb",mode:n.mode,text:"(",bbox:{x:i,y:r,w:a,h:n.bbox.h},chld:[]};s.push(c),s.push({type:"symb",text:")",mode:n.mode,bbox:{x:i+n.bbox.w-a,y:r,w:a,h:n.bbox.h},chld:[]})}else if(gt[n.text]&&gt[n.text].flags.hat){const a=n.chld[0].bbox.y,c={type:"symb",mode:n.mode,text:n.text,bbox:{x:i,y:r,w:n.bbox.w,h:a},chld:[]};s.push(c)}else if(gt[n.text]&&gt[n.text].flags.mat){const a=n.chld[0].bbox.h,c={type:"symb",text:n.text,mode:n.mode,bbox:{x:i,y:r+a,w:n.bbox.w,h:n.bbox.h-a},chld:[]};s.push(c)}else if(n.type!="node"&&n.text!="^"&&n.text!="_"){const a={type:n.type=="func"?"symb":n.type,text:n.text,mode:n.mode,bbox:{x:i,y:r,w:n.bbox.w,h:n.bbox.h},chld:[]};s.push(a)}}for(let a=0;a<n.chld.length;a++){const c=t(n.chld[a],i,r);s.push(...c)}return s}const e=t(o,-o.bbox.x,-o.bbox.y);o.type="node",o.text="",o.chld=e}function ml(o){const t=[];for(let e=0;e<o.chld.length;e++){const n=o.chld[e];let i=n.bbox.h/2,r=!1;if(gt[n.text]&&gt[n.text].flags.hat&&!gt[n.text].flags.xfl&&!gt[n.text].flags.yfl&&(i*=4,r=!0),gt[n.text]&&gt[n.text].glyph){const s=ze(gt[n.text].glyph);for(let a=0;a<s.polylines.length;a++){const c=[];for(let d=0;d<s.polylines[a].length;d++){let R=s.polylines[a][d][0],u=s.polylines[a][d][1];if(gt[n.text].flags.xfl)R=(R-s.xmin)/Math.max(s.xmax-s.xmin,1)*n.bbox.w,R+=n.bbox.x;else if(s.w/16*i>n.bbox.w)R=R/Math.max(s.w,1)*n.bbox.w,R+=n.bbox.x;else{R=R/16*i;const h=(n.bbox.w-s.w/16*i)/2;R+=n.bbox.x+h}if(gt[n.text].flags.yfl)u=(u-s.ymin)/Math.max(s.ymax-s.ymin,1)*n.bbox.h,u+=n.bbox.y;else{if(u=u/16*i,r){const h=(s.ymax+s.ymin)/2;u-=h/16*i}u+=n.bbox.y+n.bbox.h/2}c.push([R,u])}t.push(c)}}else if(gt[n.text]&&gt[n.text].flags.txt||n.type=="char"){let s=n.bbox.x;const a=!!(gt[n.text]&&gt[n.text].flags.txt);for(let c=Number(a);c<n.text.length;c++){const d=ze(Zn(n.text[c],a?"text":n.mode));if(!d){console.warn("unmapped character: "+n.text[c]);continue}for(let R=0;R<d.polylines.length;R++){const u=[];for(let h=0;h<d.polylines[R].length;h++){let g=d.polylines[R][h][0],f=d.polylines[R][h][1];g/=16,f/=16,g*=i,f*=i,n.mode=="tt"&&(d.w>16?g*=16/d.w:g+=(16-d.w)/2/16),g+=s,f+=n.bbox.y+n.bbox.h/2,u.push([g,f])}t.push(u)}n.mode=="tt"?s+=i:s+=d.w/16*i}}}return t}function he(o){return Math.round(o*100)/100}class pl{_latex;_tree;_tokens;_polylines;constructor(t){this._latex=t,this._tokens=ul(t),this._tree=yo(this._tokens),vi(this._tree.chld),ue(this._tree),Tl(this._tree),this._polylines=ml(this._tree)}resolveScale(t){if(t==null)return[16,16,16,16];let e=t.SCALE_X??16,n=t.SCALE_Y??16;if(t.MIN_CHAR_H!=null){let s=0;for(let c=0;c<this._tree.chld.length;c++){const d=this._tree.chld[c];(d.type=="char"||gt[d.text]&&(gt[d.text].flags.txt||!Object.keys(gt[d.text].flags).length))&&(s=Math.min(d.bbox.h,s))}const a=Math.max(1,t.MIN_CHAR_H/s);e*=a,n*=a}if(t.MAX_W!=null){const s=e;e=Math.min(e,t.MAX_W/this._tree.bbox.w),n*=e/s}if(t.MAX_H!=null){const s=n;n=Math.min(n,t.MAX_H/this._tree.bbox.h),e*=n/s}const i=t.MARGIN_X??e,r=t.MARGIN_Y??n;return[i,r,e,n]}polylines(t){t||(t={});const e=[],[n,i,r,s]=this.resolveScale(t);for(let a=0;a<this._polylines.length;a++){e.push([]);for(let c=0;c<this._polylines[a].length;c++){const[d,R]=this._polylines[a][c];e[e.length-1].push([n+d*r,i+R*s])}}return e}pathd(t){t||(t={});let e="";const[n,i,r,s]=this.resolveScale(t);for(let a=0;a<this._polylines.length;a++)for(let c=0;c<this._polylines[a].length;c++){const[d,R]=this._polylines[a][c];e+=c?"L":"M",e+=`${he(n+d*r)} ${he(i+R*s)}`}return e}svg(t){t||(t={});const[e,n,i,r]=this.resolveScale(t),s=he(this._tree.bbox.w*i+e*2),a=he(this._tree.bbox.h*r+n*2);let c=`<svg
13
+ </svg>`,a=new Image;return a.src=`data:image/svg+xml;base64,${$r(s)}`,a}_drawImageWithCrop(t,e,n,i,r,s,a){if(n.imgCrop){const{x:c,y:d,width:R,height:u}=n.imgCrop;t.drawImage(e,c,d,R,u,i,r,s,a)}else t.drawImage(e,i,r,s,a)}_renderCaption(t,e,n,i,r,s){if(!e.imgCaption?.value)return;const{scale:a,imgCaption:c}=this.options;let d=e.imgCaption.value;if(d.includes("{imageNo}")){const I=this.draw.getOriginalMainElementList(),L=this._countImagesBeforeTarget(I,e)+1;d=d.replace(/\{imageNo\}/g,String(L))}const R=(e.imgCaption.size||c.size)*a,u=e.imgCaption.font||c.font,h=e.imgCaption.color||c.color;t.save(),t.font=`${R}px ${u}`,t.fillStyle=h,t.textAlign="center";let g=d;const f=t.measureText(d);if(f.width>r){let I=0,L=d.length;for(;I<L;){const P=Math.ceil((I+L)/2),O=d.substring(0,P);t.measureText(O+"...").width<=r?I=P:L=P-1}g=d.substring(0,I)+"..."}const T=(e.imgCaption.top??c.top)*a,m=i+s+T+f.actualBoundingBoxAscent,p=n+r/2;t.fillText(g,p,m),t.restore()}render(t,e,n,i){const{scale:r}=this.options,s=e.width*r,a=e.height*r;if(this.imageCache.has(e.value)){const c=this.imageCache.get(e.value);this._drawImageWithCrop(t,c,e,n,i,s,a),this._renderCaption(t,e,n,i,s,a)}else{const c=this.draw.getRenderCount(),d=new Promise((R,u)=>{const h=new Image;h.setAttribute("crossOrigin","Anonymous"),h.src=e.value,h.onload=()=>{this.imageCache.set(e.value,h),R(e),c===this.draw.getRenderCount()&&(e.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM?this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}):(this._drawImageWithCrop(t,h,e,n,i,s,a),this._renderCaption(t,e,n,i,s,a)))},h.onerror=g=>{const f=this.getFallbackImage(s,a);f.onload=()=>{this._drawImageWithCrop(t,f,e,n,i,s,a),this.imageCache.set(e.value,f),this._renderCaption(t,e,n,i,s,a)},u(g)}});this.addImageObserver(d)}}}const vn=82;function tn(o){return Wo[o]==null&&hl(o),Wo[o]}function hl(o){const t=gl[o];if(t==null)return;const e=t.substring(3,5),n=1*e.charCodeAt(0)-vn,i=1*e.charCodeAt(1)-vn,r=t.substring(5),s=[[]];let a=1/0,c=-1/0,d=1/0,R=-1/0,u=0;for(;u<r.length;){const h=r.substring(u,u+2);if(h==" R")s.push([]);else{const g=h.charCodeAt(0)-vn-n,f=h.charCodeAt(1)-vn;a=Math.min(f,a),c=Math.max(f,c),d=Math.min(g,d),R=Math.max(g,R),s[s.length-1].push([g,f])}u+=2}Wo[o]={w:i-n,xmin:d,xmax:R,ymin:a,ymax:c,polylines:s}}const Wo={},gl={1:" 9MWRMNV RRMVV RPSTS",2:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",3:" 11MXVNTMRMPNOPOSPURVTVVU",4:" 12MWOMOV ROMRMTNUPUSTURVOV",5:" 12MWOMOV ROMUM ROQSQ ROVUV",6:" 9MVOMOV ROMUM ROQSQ",7:" 15MXVNTMRMPNOPOSPURVTVVUVR RSRVR",8:" 9MWOMOV RUMUV ROQUQ",9:" 3PTRMRV",10:" 7NUSMSTRVPVOTOS",11:" 9MWOMOV RUMOS RQQUV",12:" 6MVOMOV ROVUV",13:" 12LXNMNV RNMRV RVMRV RVMVV",14:" 9MWOMOV ROMUV RUMUV",15:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",16:" 10MWOMOV ROMSMUNUQSROR",17:" 17MXRMPNOPOSPURVSVUUVSVPUNSMRM RSTVW",18:" 13MWOMOV ROMSMUNUQSROR RRRUV",19:" 13MWUNSMQMONOOPPTRUSUUSVQVOU",20:" 6MWRMRV RNMVM",21:" 9MXOMOSPURVSVUUVSVM",22:" 6MWNMRV RVMRV",23:" 12LXNMPV RRMPV RRMTV RVMTV",24:" 6MWOMUV RUMOV",25:" 7MWNMRQRV RVMRQ",26:" 9MWUMOV ROMUM ROVUV",27:" 9MWRMNV RRMVV RPSTS",28:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",29:" 6MVOMOV ROMUM",30:" 9MWRMNV RRMVV RNVVV",31:" 12MWOMOV ROMUM ROQSQ ROVUV",32:" 9MWUMOV ROMUM ROVUV",33:" 9MWOMOV RUMUV ROQUQ",34:" 20MXRMPNOPOSPURVSVUUVSVPUNSMRM RQQTR RTQQR",35:" 3PTRMRV",36:" 9MWOMOV RUMOS RQQUV",37:" 6MWRMNV RRMVV",38:" 12LXNMNV RNMRV RVMRV RVMVV",39:" 9MWOMOV ROMUV RUMUV",40:" 12MWOMUM RPQTR RTQPR ROVUV",41:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",42:" 9MWOMOV RUMUV ROMUM",43:" 10MWOMOV ROMSMUNUQSROR",44:" 10MWOMRQOV ROMUM ROVUV",45:" 6MWRMRV RNMVM",46:" 15MWNONNOMPMQNRPRV RVOVNUMTMSNRP",47:" 13LXRMRV RPONPNSPTTTVSVPTOPO",48:" 6MWOMUV RUMOV",49:" 12LXRMRV RNOOPOSQTSTUSUPVO",50:" 13MXOVQVOROPPNRMSMUNVPVRTVVV",200:" 12MWRMPNOPOSPURVTUUSUPTNRM",201:" 4MWPORMRV",202:" 9MWONQMSMUNUPTROVUV",203:" 15MWONQMSMUNUPSQ RRQSQURUUSVQVOU",204:" 7MWSMSV RSMNSVS",205:" 14MWPMOQQPRPTQUSTURVQVOU RPMTM",206:" 14MWTMRMPNOPOSPURVTUUSTQRPPQOS",207:" 6MWUMQV ROMUM",208:" 19MWQMONOPQQSQUPUNSMQM RQQOROUQVSVUUURSQ",209:" 14MWUPTRRSPROPPNRMTNUPUSTURVPV",210:" 6PURURVSVSURU",211:" 7PUSVRVRUSUSWRY",212:" 12PURPRQSQSPRP RRURVSVSURU",213:" 13PURPRQSQSPRP RSVRVRUSUSWRY",214:" 12PURMRR RSMSR RRURVSVSURU",215:" 17NWPNRMSMUNUPRQRRSRSQUP RRURVSVSURU",216:" 3PTRMRQ",217:" 6NVPMPQ RTMTQ",218:" 10NVQMPNPPQQSQTPTNSMQM",219:" 16MWUNSMQMONOPQQTRUSUUSVQVOU RRLRW",220:" 3MWVLNW",221:" 7OVTLRNQPQSRUTW",222:" 7NUPLRNSPSSRUPW",223:" 3PTRLRW",224:" 3LXNRVR",225:" 6LXRNRV RNRVR",226:" 6LXNPVP RNTVT",227:" 6MWOOUU RUOOU",228:" 9MWRORU ROPUT RUPOT",229:" 6PURQRRSRSQRQ",230:" 7PUSMRORQSQSPRP",231:" 7PUSNRNRMSMSORQ",232:" 7LXSOVRSU RNRVR",233:" 12MXRLPW RULSW ROPVP ROSVS",234:" 21LXVRURTSSURVOVNUNSORRQSPSNRMPMONOPQSSUUVVV",235:" 20LXNNOQOSNV RVNUQUSVV RNNQOSOVN RNVQUSUVV",501:" 9I[RFJ[ RRFZ[ RMTWT",502:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",503:" 19H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV",504:" 16G\\KFK[ RKFRFUGWIXKYNYSXVWXUZR[K[",505:" 12H[LFL[ RLFYF RLPTP RL[Y[",506:" 9HZLFL[ RLFYF RLPTP",507:" 23H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZS RUSZS",508:" 9G]KFK[ RYFY[ RKPYP",509:" 3NVRFR[",510:" 11JZVFVVUYTZR[P[NZMYLVLT",511:" 9G\\KFK[ RYFKT RPOY[",512:" 6HYLFL[ RL[X[",513:" 12F^JFJ[ RJFR[ RZFR[ RZFZ[",514:" 9G]KFK[ RKFY[ RYFY[",515:" 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF",516:" 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ",517:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RSWY]",518:" 17G\\KFK[ RKFTFWGXHYJYLXNWOTPKP RRPY[",519:" 21H\\YIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",520:" 6JZRFR[ RKFYF",521:" 11G]KFKULXNZQ[S[VZXXYUYF",522:" 6I[JFR[ RZFR[",523:" 12F^HFM[ RRFM[ RRFW[ R\\FW[",524:" 6H\\KFY[ RYFK[",525:" 7I[JFRPR[ RZFRP",526:" 9H\\YFK[ RKFYF RK[Y[",527:" 9I[RFJ[ RRFZ[ RMTWT",528:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",529:" 6HYLFL[ RLFXF",530:" 9I[RFJ[ RRFZ[ RJ[Z[",531:" 12H[LFL[ RLFYF RLPTP RL[Y[",532:" 9H\\YFK[ RKFYF RK[Y[",533:" 9G]KFK[ RYFY[ RKPYP",534:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF ROPUP",535:" 3NVRFR[",536:" 9G\\KFK[ RYFKT RPOY[",537:" 6I[RFJ[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\FZFXGVITLPUNXLZJ[H[GZGX",575:" 38F]KMILHJHIIGKFLFNGOIOKNOMRLVLXMZN[P[RZTXVUWSYM R[FYMVWT]RbPfNgMfMdNaP^S[VY[V",576:" 40H]ULTNSOQPOPNNNLOIQGTFWFYGZIZMYPWTTWPZN[K[JZJXKWNWPXQYR[R^QaPcNfLgKfKdLaN^Q[TYZV",583:" 9I[JFR[ RZFR[ RJFZF",601:" 18I\\XMX[ RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",602:" 18H[LFL[ RLPNNPMSMUNWPXSXUWXUZS[P[NZLX",603:" 15I[XPVNTMQMONMPLSLUMXOZQ[T[VZXX",604:" 18I\\XFX[ RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",605:" 18I[LSXSXQWOVNTMQMONMPLSLUMXOZQ[T[VZXX",606:" 9MYWFUFSGRJR[ ROMVM",607:" 23I\\XMX]W`VaTbQbOa RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",608:" 11I\\MFM[ RMQPNRMUMWNXQX[",609:" 9NVQFRGSFREQF RRMR[",610:" 12MWRFSGTFSERF RSMS^RaPbNb",611:" 9IZMFM[ RWMMW RQSX[",612:" 3NVRFR[",613:" 19CaGMG[ RGQJNLMOMQNRQR[ RRQUNWMZM\\N]Q][",614:" 11I\\MMM[ RMQPNRMUMWNXQX[",615:" 18I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM",616:" 18H[LMLb RLPNNPMSMUNWPXSXUWXUZS[P[NZLX",617:" 18I\\XMXb RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",618:" 9KXOMO[ ROSPPRNTMWM",619:" 18J[XPWNTMQMNNMPNRPSUTWUXWXXWZT[Q[NZMX",620:" 9MYRFRWSZU[W[ ROMVM",621:" 11I\\MMMWNZP[S[UZXW RXMX[",622:" 6JZLMR[ RXMR[",623:" 12G]JMN[ RRMN[ RRMV[ RZMV[",624:" 6J[MMX[ RXMM[",625:" 10JZLMR[ RXMR[P_NaLbKb",626:" 9J[XMM[ RMMXM RM[X[",627:" 24H]QMONMPLRKUKXLZN[P[RZUWWTYPZM RQMSMTNUPWXXZY[Z[",628:" 31I\\UFSGQIOMNPMTLZKb RUFWFYHYKXMWNUORO RROTPVRWTWWVYUZS[Q[OZNYMV",629:" 17I\\JPLNNMOMQNROSRSVR[ RZMYPXRR[P_Ob",630:" 24I[TMQMONMPLSLVMYNZP[R[TZVXWUWRVOTMRKQIQGRFTFVGXI",631:" 19JZWOVNTMQMONOPPRSS RSSOTMVMXNZP[S[UZWX",632:" 23JYTFRGQHQIRJUKXK RXKTMQONRMUMWNYP[S]T_TaSbQbP`",633:" 19H\\IQJOLMNMONOPNTL[ RNTPPRNTMVMXOXRWWTb",634:" 27G\\HQIOKMMMNNNPMUMXNZO[Q[SZUWVUWRXMXJWGUFSFRHRJSMUPWRZT",635:" 9LWRMPTOXOZP[R[TYUW",636:" 19I[OMK[ RYNXMWMUNQROSNS RNSPTQUSZT[U[VZ",637:" 9JZKFMFOGPHX[ RRML[",638:" 21H]OMIb RNQMVMYO[Q[SZUXWT RYMWTVXVZW[Y[[Y\\W",639:" 14I[LMOMNSMXL[ RYMXPWRUURXOZL[",640:" 29JZTFRGQHQIRJUKXK RUKRLPMOOOQQSTTVT RTTPUNVMXMZO\\S^T_TaRbPb",641:" 18J[RMPNNPMSMVNYOZQ[S[UZWXXUXRWOVNTMRM",642:" 13G]PML[ RUMVSWXX[ RIPKNNM[M",643:" 19I[MSMVNYOZQ[S[UZWXXUXRWOVNTMRMPNNPMSIb",644:" 18I][MQMONMPLSLVMYNZP[R[TZVXWUWRVOUNSM",645:" 8H\\SMP[ RJPLNOMZM",646:" 16H\\IQJOLMNMONOPMVMYO[Q[TZVXXTYPYM",647:" 21G]ONMOKQJTJWKYLZN[Q[TZWXYUZRZOXMVMTORSPXMb",648:" 14I[KMMMOOU`WbYb RZMYOWRM]K`Jb",649:" 20F]VFNb RGQHOJMLMMNMPLULXMZO[Q[TZVXXUZP[M",650:" 23F]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" 9MWSZR[QZRYSZS\\R^Q_",712:" 12MWRMQNROSNRM RRYQZR[SZRY",713:" 15MWRMQNROSNRM RSZR[QZRYSZS\\R^Q_",714:" 9MWRFRT RRYQZR[SZRY",715:" 21I[LKLJMHNGPFTFVGWHXJXLWNVORQRT RRYQZR[SZRY",716:" 3NVRFRM",717:" 6JZNFNM RVFVM",718:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",719:" 27H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",720:" 3G][BIb",721:" 11KYVBTDRGPKOPOTPYR]T`Vb",722:" 11KYNBPDRGTKUPUTTYR]P`Nb",723:" 3NVRBRb",724:" 3E_IR[R",725:" 6E_RIR[ RIR[R",726:" 6E_IO[O RIU[U",727:" 6G]KKYY RYKKY",728:" 9JZRLRX RMOWU RWOMU",729:" 6MWRQQRRSSRRQ",730:" 8MWSFRGQIQKRLSKRJ",731:" 8MWRHQGRFSGSIRKQL",732:" 9E_UMXP[RXTUW RIR[R",733:" 12H]SBLb RYBRb RLOZO RKUYU",734:" 35E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y",735:" 28G]IIJKKOKUJYI[ R[IZKYOYUZY[[ RIIKJOKUKYJ[I RI[KZOYUYYZ[[",737:" 6KYOBO[ RUBU[",738:" 6F^RBR[ RI[[[",739:" 4F^[BI[[[",740:" 18E_RIQJRKSJRI RIYHZI[JZIY R[YZZ[[\\Z[Y",741:" 33F^RHNLKPJSJUKWMXOXQWRU RRHVLYPZSZUYWWXUXSWRU RRUQYP\\ RRUSYT\\ RP\\T\\",742:" 26F^RNQKPINHMHKIJKJOKRLTNWR\\ RRNSKTIVHWHYIZKZOYRXTVWR\\",743:" 20F^RGPJLOIR RRGTJXO[R RIRLUPZR] R[RXUTZR]",744:" 48F^RTTWVXXXZW[U[SZQXPVPSQ RSQUOVMVKUISHQHOINKNMOOQQ RQQNPLPJQISIUJWLXNXPWRT RRTQYP\\ RRTSYT\\ RP\\T\\",745:" 55F^RRR[Q\\ RRVQ\\ RRIQHOHNINKONRR RRISHUHVIVKUNRR RRRNOLNJNIOIQJR RRRVOXNZN[O[QZR RRRNULVJVIUISJR RRRVUXVZV[U[SZR",746:" 55F^ISJSLTMVMXLZ RISIRJQLQMRNTNWMYLZ RRGPIOLOOQUQXPZR\\ RRGTIULUOSUSXTZR\\ R[S[RZQXQWRVTVWWYXZ R[SZSXTWVWXXZ RKVYV",750:" 18PSSRRSQSPRPQQPRPSQSSRUQV RQQQRRRRQQQ",751:" 16PTQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",752:" 9NVPOTU RTOPU RNRVR",753:" 28MWRKQMOPMR RRKSMUPWR RRMOQ RRMUQ RROPQ RROTQ RQQSQ RMRWR",754:" 26MWMRMQNOONQMSMUNVOWQWR RPNTN ROOUO RNPVP RNQVQ RMRWR",755:" 14LRLFLRRRLF RLIPQ RLLOR RLOMQ",756:" 10MWRKQMOPMR RRKSMUPWR",757:" 11MWWRWQVOUNSMQMONNOMQMR",758:" 13G]]R]P\\MZJWHTGPGMHJJHMGPGR",759:" 11MWMRMSNUOVQWSWUVVUWSWR",760:" 7LXLPNRQSSSVRXP",761:" 6RURUTTURTPRO",762:" 7RVRRUPVNVLUKTK",763:" 7NRRROPNNNLOKPK",764:" 21MWWHVGTFQFOGNHMJMLNNOOUSVTWVWXVZU[S\\P\\N[MZ",765:" 21G]IWHVGTGQHOINKMMMONPOTUUVWWYW[V\\U]S]P\\N[M",766:" 31G]RRTUUVWWYW[V\\U]S]Q\\O[NYMWMUNTOPUOVMWKWIVHUGSGQHOINKMMMONPORR",767:" 22H\\KFK[ RHF[FQP[Z RZV[Y\\[ RZVZY RWYZY RWYZZ\\[",768:" 30KYUARBPCNELHKLKRLUNWQXSXVWXUYR RKPLMNKQJSJVKXMYPYVXZV]T_R`Oa",796:" 3>f>RfR",797:" 3D`D``D",798:" 3RRR>Rf",799:" 3D`DD``",800:" 3D`DR`R",801:" 3F^FY^K",802:" 3KYK^YF",803:" 3RRRDR`",804:" 3KYKFY^",805:" 3F^FK^Y",806:" 3KYKRYR",807:" 3MWMWWM",808:" 3RRRKRY",809:" 3MWMMWW",810:" 8GRRGPGMHJJHMGPGR",811:" 8GRGRGTHWJZM\\P]R]",812:" 8R]R]T]W\\ZZ\\W]T]R",813:" 8R]]R]P\\MZJWHTGRG",814:" 9D`DOGQKSPTTTYS]Q`O",815:" 9PUUDSGQKPPPTQYS]U`",816:" 9OTODQGSKTPTTSYQ]O`",817:" 9D`DUGSKQPPTPYQ]S`U",818:" 5KYRJYNKVRZ",819:" 5JZJRNKVYZR",820:" 5KYKVKNYVYN",821:" 5JZLXJPZTXL",822:" 23JZJ]L]O\\Q[TXUVVSVOULTJSIQIPJOLNONSOVPXS[U\\X]Z]",823:" 23I]]Z]X\\U[SXPVOSNONLOJPIQISJTLUOVSVVUXT[Q\\O]L]J",824:" 23JZZGXGUHSIPLONNQNUOXPZQ[S[TZUXVUVQUNTLQIOHLGJG",825:" 23G[GJGLHOIQLTNUQVUVXUZT[S[QZPXOUNQNNOLPISHUGXGZ",826:" 21E[EPFRHTJUMVQVUUXSZP[NZLWLSMQNNPLSKVKYL\\M^",827:" 19EYETHVKWPWSVVTXQYNYLXKVKSLPNNQMTMYN\\P_",828:" 26OUQOOQOSQUSUUSUQSOQO RQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",829:" 11RWRMSMUNVOWQWSVUUVSWRW",830:" 9D`DRJR RORUR RZR`R",831:" 5D`DUDO`O`U",832:" 6JZRDJR RRDZR",833:" 9D`DR`R RJYZY RP`T`",834:" 9D`DR`R RDRRb R`RRb",840:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",841:" 6LXLLLXXXXLLL",842:" 5KYRJKVYVRJ",843:" 6LXRHLRR\\XRRH",844:" 12JZRIPOJOOSMYRUWYUSZOTORI",845:" 6KYRKRY RKRYR",846:" 6MWMMWW RWMMW",847:" 9MWRLRX RMOWU RWOMU",850:" 35NVQNOONQNSOUQVSVUUVSVQUOSNQN ROQOS RPPPT RQOQU RRORU RSOSU RTPTT RUQUS",851:" 27NVNNNVVVVNNN ROOOU RPOPU RQOQU RRORU RSOSU RTOTU RUOUU",852:" 17MWRLMUWURL RROOT RROUT RRRQT RRRST",853:" 17LULRUWUMLR RORTU RORTO RRRTS RRRTQ",854:" 17MWRXWOMORX RRUUP RRUOP RRRSP RRRQP",855:" 17OXXROMOWXR RURPO RURPU RRRPQ RRRPS",856:" 22LXRLNWXPLPVWRL RRRRL RRRLP RRRNW RRRVW RRRXP",857:" 11RYRKRY RRKYNRQ RSMVNSO",860:" 13MWRLRX ROOUO RMUOWQXSXUWWU",861:" 11LXRLRX RLQMOWOXQ RPWTW",862:" 14KYMNWX RWNMX ROLLOKQ RULXOYQ",863:" 18I[NII[ RVI[[ RMM[[ RWMI[ RNIVI RMMWM",864:" 21I[RGRV RMJWP RWJMP RIVL\\ R[VX\\ RIV[V RL\\X\\",865:" 11G[MJSV RKPSL RG\\[\\[RG\\",866:" 14LXPLPPLPLTPTPXTXTTXTXPTPTLPL",867:" 32KYYPXNVLSKQKNLLNKQKSLVNXQYSYVXXVYT RYPWNUMSMQNPOOQOSPUQVSWUWWVYT",868:" 10KYRJKVYVRJ RRZYNKNRZ",869:" 34G]PIPGQFSFTGTI RGZHXJVKTLPLKMJOIUIWJXKXPYTZV\\X]Z RGZ]Z RQZP[Q\\S\\T[SZ",870:" 64JZRMRS RRSQ\\ RRSS\\ RQ\\S\\ RRMQJPHNG RQJNG RRMSJTHVG RSJVG RRMNKLKJM RPLLLJM RRMVKXKZM RTLXLZM RRMPNOOOR RRMPOOR RRMTNUOUR RRMTOUR",871:" 94JZRIRK RRNRP RRSRU RRYQ\\ RRYS\\ RQ\\S\\ RRGQIPJ RRGSITJ RPJRITJ RRKPNNOMN RRKTNVOWN RNOPORNTOVO RRPPSNTLTKRKSLT R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URVTVUUWSX",1003:" 24KYVLWKWOVLTKQKOLNMMPMSNVOWQXTXVWWU RQKOMNPNSOVQX",1004:" 26JZNKNX ROKOX RLKSKVLWMXPXSWVVWSXLX RSKULVMWPWSVVUWSX",1005:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1006:" 20JXNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXQX",1007:" 36K[VLWKWOVLTKQKOLNMMPMSNVOWQXTXVW RQKOMNPNSOVQX RTXUWVU RVSVX RWSWX RTSYS",1008:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1009:" 12NWRKRX RSKSX RPKUK RPXUX",1010:" 19LXSKSURWQX RTKTUSWQXPXNWMUNTOUNV RQKVK",1011:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1012:" 14KXOKOX RPKPX RMKRK RMXWXWTVX",1013:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1014:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1015:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1016:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1017:" 47KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RPWPUQTSTTUUZV[W[XZ RTUUXVZW[",1018:" 37JZNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX RSRTSUWVXWXXW RSRUSVWWX",1019:" 32KZVMWKWOVMULSKQKOLNMNOOPQQTRVSWT RNNOOQPTQVRWSWVVWTXRXPWOVNTNXOV",1020:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1021:" 20J[NKNUOWQXTXVWWUWK ROKOUPWQX RLKQK RUKYK",1022:" 15KYMKRX RNKRU RWKRX RKKPK RTKYK",1023:" 24I[LKOX RMKOT RRKOX RRKUX RSKUT RXKUX RJKOK RVKZK",1024:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1025:" 20LYNKRRRX ROKSR RWKSRSX RLKQK RTKYK RPXUX",1026:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1027:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1028:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1029:" 14KXOKOX RPKPX RMKWKWOVK RMXRX",1030:" 15KYRKLX RRMWX RRKXX RMWVW RLXXX",1031:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1032:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1033:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1034:" 44KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RQOQT RTOTT RQQTQ RQRTR",1035:" 12NWRKRX RSKSX RPKUK RPXUX",1036:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1037:" 15KYRKMX RRNVX RRKWX RKXPX RTXYX",1038:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1039:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1040:" 36JZMJLM RXJWM RPPOS RUPTS RMVLY RXVWY RMKWK RMLWL RPQTQ RPRTR RMWWW RMXWX",1041:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1042:" 21J[NKNX ROKOX RVKVX RWKWX RLKYK RLXQX RTXYX",1043:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1044:" 20K[MKRQ RNKSQMX RMKWKXOVK RNWWW RMXWXXTVX",1045:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1046:" 33KZMONLOKPKQLRORX RXOWLVKUKTLSOSX RMONMOLPLQMRO RXOWMVLULTMSO RPXUX",1047:" 40KZRKRX RSKSX RQNNOMQMRNTQUTUWTXRXQWOTNQN RQNOONQNROTQU RTUVTWRWQVOTN RPKUK RPXUX",1048:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1049:" 33J[RKRX RSKSX RLPMONOOSQU RTUVSWOXOYP RMONROTQUTUVTWRXO RPKUK RPXUX",1050:" 35KZMVNXQXMRMONMOLQKTKVLWMXOXRTXWXXV ROUNRNOOMQK RTKVMWOWRVU RNWPW RUWWW",1051:" 18KYTKKX RSMTX RTKUX RNTTT RIXNX RRXWX",1052:" 34JYPKLX RQKMX RNKUKWLWNVPSQ RUKVLVNUPSQ ROQRQTRUSUUTWQXJX RRQTSTUSWQX",1053:" 25KXVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUU RRKPMOONRNVPX",1054:" 26JYPKLX RQKMX RNKTKVLWNWQVTUVTWQXJX RTKULVNVQUTTVSWQX",1055:" 22JYPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXTXUUSX",1056:" 20JXPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXOX",1057:" 33KYVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUVVS RRKPMOONRNVPX RRXTVUS RSSXS",1058:" 27J[PKLX RQKMX RXKTX RYKUX RNKSK RVK[K ROQVQ RJXOX RRXWX",1059:" 12NWTKPX RUKQX RRKWK RNXSX",1060:" 19LXUKRUQWPX RVKSURWPXOXMWLUMTNUMV RSKXK",1061:" 27JZPKLX RQKMX RYKOR RRPTX RSPUX RNKSK RVK[K RJXOX RRXWX",1062:" 14KXQKMX RRKNX ROKTK RKXUXVUTX",1063:" 30I\\OKKX ROMPX RPKQV RYKPX RYKUX RZKVX RMKPK RYK\\K RIXMX RSXXX",1064:" 21JZPKLX RPKTX RQKTU RXKTX RNKQK RVKZK RJXNX",1065:" 32KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK",1066:" 24JYPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RJXOX",1067:" 46KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK ROWOVPUQURVRZS[T[UZ RRVSZT[",1068:" 35JZPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RSRTWUXVXWW RSRTSUWVX RJXOX",1069:" 28KZWLXLYKXNWLUKRKPLOMOOPPUSVT RONPOURVSVVUWSXPXNWMULXMWNW",1070:" 16KZTKPX RUKQX RPKNNOKZKYNYK RNXSX",1071:" 20J[PKMUMWOXSXUWVUYK RQKNUNWOX RNKSK RWK[K",1072:" 15KYOKPX RPKQV RYKPX RMKRK RVK[K",1073:" 24I[NKMX ROKNV RTKMX RTKSX RUKTV RZKSX RLKQK RXK\\K",1074:" 21KZPKTX RQKUX RYKLX RNKSK RVK[K RJXOX RRXWX",1075:" 20LYPKRQPX RQKSQ RYKSQQX RNKSK RVK[K RNXSX",1076:" 16LYXKLX RYKMX RQKONPKYK RLXUXVUTX",1101:" 32LZQOPPPQOQOPQOTOVQVWWXXX RTOUQUWWX RURRSPTOUOWPXSXTWUU RRSPUPWQX",1102:" 29JYNKNX ROKOX RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLKOK",1103:" 24LXVQUQURVRVQUPSOQOOPNRNUOWQXSXUWVV RQOPPOROUPWQX",1104:" 32L[VKVX RWKWX RVRUPSOQOOPNRNUOWQXSXUWVU RQOPPOROUPWQX RTKWK RVXYX",1105:" 26LXOSVSVRUPSOQOOPNRNUOWQXSXUWVV RUSUQSO RQOPPOROUPWQX",1106:" 20LWTKULUMVMVLTKRKPMPX RRKQMQX RNOSO RNXSX",1107:" 42LYQOOQOSQUSUUSUQSOQO RQOPQPSQU RSUTSTQSO RTPUOVO RPTOUOXPYTYVZ ROWPXTXVYV[T\\P\\N[NYPX",1108:" 28J[NKNX ROKOX RORPPROTOVPWRWX RTOUPVRVX RLKOK RLXQX RTXYX",1109:" 18NWRKRLSLSKRK RRORX RSOSX RPOSO RPXUX",1110:" 23NWSKSLTLTKSK RSOSZR\\ RTOTZR\\P\\O[OZPZP[O[ RQOTO",1111:" 27JZNKNX ROKOX RWOOU RRSVX RSSWX RLKOK RTOYO RLXQX RTXYX",1112:" 12NWRKRX RSKSX RPKSK RPXUX",1113:" 44F_JOJX RKOKX RKRLPNOPORPSRSX RPOQPRRRX RSRTPVOXOZP[R[X RXOYPZRZX RHOKO RHXMX RPXUX RXX]X",1114:" 28J[NONX ROOOX RORPPROTOVPWRWX RTOUPVRVX RLOOO RLXQX RTXYX",1115:" 28LYQOOPNRNUOWQXTXVWWUWRVPTOQO RQOPPOROUPWQX RTXUWVUVRUPTO",1116:" 32JYNON\\ ROOO\\ RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLOOO RL\\Q\\",1117:" 29KYUOU\\ RVOV\\ RURTPROPONPMRMUNWPXRXTWUU RPOOPNRNUOWPX RS\\X\\",1118:" 22KXOOOX RPOPX RPRQPSOUOVPVQUQUPVP RMOPO RMXRX",1119:" 26LYTOUPUQVQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWOVPVPWQX",1120:" 14LWPKPVRXTXUWUV RQKQVRX RNOTO",1121:" 28J[NONUOWQXSXUWVU ROOOUPWQX RVOVX RWOWX RLOOO RTOWO RVXYX",1122:" 15KYNORX ROORV RVORX RLOQO RTOXO",1123:" 24I[LOOX RMOOU RROOX RROUX RSOUU RXOUX RJOOO RVOZO",1124:" 21KYNOUX ROOVX RVONX RLOQO RTOXO RLXPX RSXXX",1125:" 23KYNORX ROORV RVORXP[N\\M\\L[LZMZM[L[ RLOQO RTOXO",1126:" 16LXUONX RVOOX ROONQNOVO RNXVXVVUX",1127:" 32K[QOOPNQMSMUNWPXQXSWUUWRXO RQOOQNSNUOWPX RQOSOUPWWXX RSOTPVWXXYX",1128:" 40KXRKPMOOMUK\\ RQLPNNTL\\ RRKTKVLVNUPRQ RTKULUNTPRQ RRQTRUTUVTWRXQXOWNT RRQSRTTTVRX",1129:" 19KYLQNOPORPSSSXR\\ RLQNPPPRQSS RWOVRSXQ\\",1130:" 39KYSOQOOPNQMSMUNWPXRXTWUVVTVRUPRNQLQKRJTJUKVM RQOOQNSNVPX RRXTVUTUQSO RQLRKTKVM",1131:" 27LXVPTOQOOPOQPRRS RQOPPPQRS RRSOTNUNWPXSXUW RRSPTOUOWPX",1132:" 28LWRKQLQMSNVNVMSNPOOPNRNTOVPWRXSYS[R\\P\\O[ RSNQOPPOROTPVRX",1133:" 26IYJRKPLONOOPOQMX RMONPNQLX ROQPPROTOVPVRS\\ RTOUPURR\\",1134:" 35IYJSKQLPNPOQOVPX RMPNQNUOWPXQXSWTVUTVQVNULTKRKQLQNRPURWS RQXSVTTUQUNTK",1135:" 13NWROPVPWQXSXUWVU RSOQVQWRX",1136:" 26KYOOLX RPOMX RUOVPWPVOTORQOR RORPSRWTXVWWU RORQSSWTX",1137:" 15LXLKNKPLWX RNKOLVX RRPMX RRPNX",1138:" 26KZOOK\\ RPOL\\ RNUNWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1139:" 19JYNOMX ROONUMX RVRVOWOVRTUQWNXMX RLOOO",1140:" 36MXRKQLQMSNVN RTNQOPPPRRSUS RTNROQPQRRS RSSPTOUOWQXSYTZT[S\\Q\\ RSSQTPUPWQX",1141:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1142:" 20IZPPMX RPPNX RTPSX RTPTX RKQMOXO RKQMPXP",1143:" 29JXSOQOOPNQMSJ\\ RQOOQNSK\\ RSOUPVRVTUVTWRXPXNWMU RSOUQUTTVRX",1144:" 28K[YOQOOPNQMSMUNWPXRXTWUVVTVRUPYP RQOOQNSNVPX RRXTVUTUQSO",1145:" 14KZSPQX RSPRX RMQOOXO RMQOPXP",1146:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1147:" 35KZOPNQMSMUNWPXRXUWWUXRXPWOUOTPSRRUO\\ RMUNVPWRWUVWTXR RXQWPUPSR RRUQXP\\",1148:" 17KXMONOPPS[T\\ RNOOPR[T\\U\\ RVOTRNYL\\",1149:" 28I[TKQ\\ RUKP\\ RJRKPLONOOPOVPWSWUVWT RMONPNTOWPXSXUWWTXRYO",1150:" 36JZNPPPPONPMQLSLUMWNXPXQWRUSR RLUNWPWRU RRRRWSXUXWVXTXRWPVOVPWP RRUSWUWWV",1151:" 32KZVOTVTWUXWXXWYU RWOUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1152:" 32JXOKMR RPKNRNVPX RNROPQOSOUPVRVTUVTWRXPXNWMUMR RSOUQUTTVRX RMKPK",1153:" 22KXUPUQVQUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1154:" 35KZWKTVTWUXWXXWYU RXKUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RUKXK",1155:" 23KWNURTTSURUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1156:" 23MXWKXLXKVKTLSNPYO[N\\ RVKULTNQYP[N\\L\\L[M\\ RPOVO",1157:" 34KYVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1158:" 29KZPKLX RQKMX ROQPPROTOVPVRUUUWVX RTOUPURTUTWUXWXXWYU RNKQK",1159:" 26MWSKSLTLTKSK RNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1160:" 26MWTKTLULUKTK RORPPQOSOTPTRRYQ[O\\M\\M[N\\ RROSPSRQYP[O\\",1161:" 32KXPKLX RQKMX RVPUQVQVPUOTORQPROR RORPSQWRXTXUWVU RORQSRWSX RNKQK",1162:" 16NVSKPVPWQXSXTWUU RTKQVQWRX RQKTK",1163:" 46F^GRHPIOKOLPLQJX RJOKPKQIX RLQMPOOQOSPSQQX RQORPRQPX RSQTPVOXOZPZRYUYWZX RXOYPYRXUXWYX[X\\W]U",1164:" 33J[KRLPMOOOPPPQNX RNOOPOQMX RPQQPSOUOWPWRVUVWWX RUOVPVRUUUWVXXXYWZU",1165:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1166:" 35JYKRLPMOOOPPPQM\\ RNOOPOQL\\ RPQROTOVPWRWTVVUWSXQXOVOT RTOVQVTUVSX RJ\\O\\",1167:" 28KYVOR\\ RWOS\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RP\\U\\",1168:" 22LXMRNPOOQORPRQPX RPOQPQQOX RRQSPUOVOWPWQVQWP",1169:" 24LYVPVQWQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWNVOVOW",1170:" 16NWSKPVPWQXSXTWUU RTKQVQWRX RPOUO",1171:" 33IZJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1172:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1173:" 37H\\IRJPKOMONPNRMUMWNX RLOMPMRLULWNXOXQWRV RTORVRWTX RUOSVSWTXUXWWYUZRZOYOZP",1174:" 38JZMRNPPOROSPSR RQORPRRQUPWNXMXLWLVMVLW RXPWQXQXPWOVOTPSRRURWSX RQUQWRXTXVWWU",1175:" 35IYJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\",1176:" 27KYWOWPVQNVMWMX RNQOOROUQ ROPRPUQVQ RNVOVRWUW ROVRXUXVV",1177:" 39H[RKSLSMTMTLRKOKMLLNLX ROKNLMNMX RXKYLYMZMZLXKVKTMTX RVKUMUX RJOWO RJXOX RRXWX",1178:" 29J[UKVLWLWKQKOLNNNX RQKPLONOX RVOVX RWOWX RLOWO RLXQX RTXYX",1179:" 27J[WKQKOLNNNX RQKPLONOX RUKVLVX RWKWX RLOVO RLXQX RTXYX",1180:" 48F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX RYKZL[L[KUKSLRNRX RUKTLSNSX RZOZX R[O[X RHO[O RHXMX RPXUX RXX]X",1181:" 46F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX R[KUKSLRNRX RUKTLSNSX RYKZLZX R[K[X RHOZO RHXMX RPXUX RXX]X",1182:" 12NWRORX RSOSX RPOSO RPXUX",1184:" 21LXVPTOROPPOQNSNUOWQXSXUW RROPQOSOVQX ROSSS",1185:" 35LYSKQLPMOONRNUOWPXRXTWUVVTWQWNVLUKSK RSKQMPOOSOVPX RRXTVUTVPVMUK ROQVQ",1186:" 34KZTKQ\\ RUKP\\ RQONPMRMUNWQXTXWWXUXRWPTOQO RQOOPNRNUOWQX RTXVWWUWRVPTO",1187:" 22LXUPVRVQUPSOQOOPNRNTOVRX RQOOQOTPVRXSYS[R\\P\\",1191:" 45I[VKWLXLVKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RZK[L[KYKWLVNSYR[Q\\ RYKXLWNTYS[Q\\O\\O[P\\ RLOYO",1192:" 38IZVKWLXLXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RVOTVTWUXWXXWYU RWOUVUWVX RLOWO",1193:" 38IZVKWL RXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RWKTVTWUXWXXWYU RXKUVUWVX RLOVO",1194:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L\\L\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ RZOXVXWYX[X\\W]U R[OYVYWZX RIO[O",1195:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L R\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ R[KXVXWYX[X\\W]U R\\KYVYWZX RIOZO",1196:" 20MWNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1200:" 28LYQKOLNONTOWQXTXVWWTWOVLTKQK RQKPLOOOTPWQX RTXUWVTVOULTK",1201:" 10LYPNSKSX RRLRX ROXVX",1202:" 35LYOMONNNNMOLQKTKVLWNVPTQQROSNUNX RTKULVNUPTQ RNWOVPVSWVWWV RPVSXVXWVWU",1203:" 39LYOMONNNNMOLQKTKVLWNVPTQ RTKULVNUPTQ RRQTQVRWTWUVWTXQXOWNVNUOUOV RTQURVTVUUWTX",1204:" 13LYSMSX RTKTX RTKMTXT RQXVX",1205:" 33LYOKNQ ROKVK ROLSLVK RNQOPQOTOVPWRWUVWTXQXOWNVNUOUOV RTOUPVRVUUWTX",1206:" 36LYVMVNWNWMVLTKRKPLOMNPNUOWQXTXVWWUWSVQTPQPNR RRKPMOPOUPWQX RTXUWVUVSUQTP",1207:" 22LYNKNO RVMRTPX RWKTQQX RNMPKRKUM RNMPLRLUMVM",1208:" 51LYQKOLNNOPQQTQVPWNVLTKQK RQKPLONPPQQ RTQUPVNULTK RQQORNTNUOWQXTXVWWUWTVRTQ RQQPROTOUPWQX RTXUWVUVTURTQ",1209:" 36LYOVOUNUNVOWQXSXUWVVWSWNVLTKQKOLNNNPORQSTSWQ RSXUVVSVNULTK RQKPLONOPPRQS",1210:" 6NVRVQWRXSWRV",1211:" 8NVSWRXQWRVSWSYQ[",1212:" 12NVROQPRQSPRO RRVQWRXSWRV",1213:" 14NVROQPRQSPRO RSWRXQWRVSWSYQ[",1214:" 15NVRKQLRSSLRK RRLRO RRVQWRXSWRV",1215:" 29LYNNONOONONNOLQKTKVLWNWOVQSRRSRTST RTKVMVPUQSR RRWRXSXSWRW",1216:" 6OVRKRP RSKRP",1217:" 12LXOKOP RPKOP RUKUP RVKUP",1218:" 10MWQKPLPNQOSOTNTLSKQK",1219:" 9MWRJRP ROKUO RUKOO",1220:" 3KZXHM\\",1221:" 16MWUHSJQMPPPTQWSZU\\ RSJRLQPQTRXSZ",1222:" 16MWOHQJSMTPTTSWQZO\\ RQJRLSPSTRXQZ",1223:" 12MWPHP\\ RQHQ\\ RPHUH RP\\U\\",1224:" 12MWSHS\\ RTHT\\ ROHTH RO\\T\\",1225:" 38LWSHQIPJPLRNSP RQIPL RSNRQ RPJQLSNSPRQPRRSSTSVQXPZ RRSSV RPXQ[ RSTRVPXPZQ[S\\",1226:" 38MXQHSITJTLRNQP RSITL RQNRQ RTJSLQNQPRQTRRSQTQVSXTZ RRSQV RTXS[ RQTRVTXTZS[Q\\",1227:" 4MWTHPRT\\",1228:" 4MWPHTRP\\",1229:" 3OURHR\\",1230:" 6MWPHP\\ RTHT\\",1231:" 3I[LRXR",1232:" 6I[RLRX RLRXR",1233:" 9JZRMRX RMRWR RMXWX",1234:" 9JZRMRX RMMWM RMRWR",1235:" 6JZMMWW RWMMW",1236:" 6NVRQQRRSSRRQ",1237:" 15I[RLQMRNSMRL RLRXR RRVQWRXSWRV",1238:" 6I[LPXP RLTXT",1239:" 9I[WLMX RLPXP RLTXT",1240:" 9I[LNXN RLRXR RLVXV",1241:" 4JZWLMRWX",1242:" 4JZMLWRMX",1243:" 10JZWKMOWS RMTWT RMXWX",1244:" 10JZMKWOMS RMTWT RMXWX",1245:" 21H[YUWUUTTSRPQOONNNLOKQKRLTNUOUQTRSTPUOWNYN",1246:" 16JZLTLRMPOPUSWSXR RLRMQOQUTWTXRXP",1247:" 8JZMSRPWS RMSRQWS",1248:" 7NVSKPO RSKTLPO",1249:" 7NVQKTO RQKPLTO",1250:" 14LXNKOMQNSNUMVK RNKONQOSOUNVK",1251:" 8NVSLRMQLRKSLSNQP",1252:" 8NVSKQMQORPSORNQO",1253:" 8NVQLRMSLRKQLQNSP",1254:" 8NVQKSMSORPQORNSO",1256:" 11JZWMQMONNOMQMSNUOVQWWW",1257:" 11JZMMMSNUOVQWSWUVVUWSWM",1258:" 11JZMMSMUNVOWQWSVUUVSWMW",1259:" 11JZMWMQNOONQMSMUNVOWQWW",1260:" 14JZWMQMONNOMQMSNUOVQWWW RMRUR",1261:" 13I[TOUPXRUTTU RUPWRUT RLRWR",1262:" 13MWRMRX ROPPORLTOUP RPORMTO",1263:" 13I[POOPLROTPU ROPMROT RMRXR",1264:" 13MWRLRW ROTPURXTUUT RPURWTU",1265:" 37KYVSUPSOQOOPNQMSMUNWPXRXTWUVVTWQWNVLTKQKPLQLRK RQOOQNSNVPX RRXTVUTVQVNULTK",1266:" 15JZLKRX RMKRV RXKRX RLKXK RNLWL",1267:" 10G[IOLORW RKORX R[FRX",1268:" 26I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[",1269:" 40I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[ RQNOONQNSOUQVSVUUVSVQUOSNQN",1270:" 26H\\ZRYTWUVUTTSSQPPONNMNKOJQJRKTMUNUPTQSSPTOVNWNYOZQZR",1271:" 26JZXKLX ROKPLPNOOMOLNLLMKOKSLVLXK RUTTUTWUXWXXWXUWTUT",1272:" 41J[YPXPXQYQYPXOWOVPUTTVSWQXOXMWLVLTMSORRPSNSLRKPKOLONPQUWWXXXYW ROXMVMTOR RONPPVWWX",1273:" 29J[UPSOQOPQPRQTSTUS RUOUSVTXTYRYQXNVLSKRKOLMNLQLRMUOWRXSXVW",1274:" 34KZQHQ\\ RTHT\\ RWLVLVMWMWLUKPKNLNNOPVSWT RNNOOVRWTWVVWTXQXOWNVNUOUOVNV",1275:" 12KYRKN\\ RVKR\\ RNQWQ RMVVV",1276:" 40LXTLSLSMTMTLSKQKPLPNQPTRUS RPNQOTQUSUUSW RQPOROTPVSXTY ROTPUSWTYT[S\\Q\\P[PZQZQ[P[",1277:" 29LXRKQLRMSLRK RRMRQ RRQQSRVSSRQ RRVR\\ RPOONNOOPPOTOUNVOUPTO",1278:" 42LXRMSLRKQLRMRQQRSURV RRQSRQURVRZQ[R\\S[RZ RPOONNOOPPOTOUNVOUPTO RPXOWNXOYPXTXUWVXUYTX",1279:" 12LYVKVX RNKVK RQQVQ RNXVX",1281:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRQQRRSSRRQ",1282:" 33LYQKPLPMQN RTKULUMTN RRNPOOQORPTRUSUUTVRVQUOSNRN RRURY RSUSY ROWVW",1283:" 23LYRKPLONOOPQRRSRUQVOVNULSKRK RRRRX RSRSX ROUVU",1284:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRKRY RKRYR",1285:" 25JYRRPQOQMRLTLUMWOXPXRWSUSTRR RWMRR RRMWMWR RRMVNWR",1286:" 25JZLLMKOKQLRNRPQRPSNT ROKPLQNQQPS RVKUX RWKTX RNTXT",1287:" 27JYNKNU ROKNR RNROPQOSOUPVQVTTVTXUYVYWX RSOUQUTTV RLKOK",1288:" 27LYONRKRQ RVNSKSQ RRQPROTOUPWRXSXUWVUVTURSQ RRTRUSUSTRT",1289:" 27JZRKRY RMKMPNRPSTSVRWPWK RLMMKNM RQMRKSM RVMWKXM ROVUV",1290:" 27JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXVXVUUX",1291:" 20LYWKTKQLONNQNSOVQXTYWY RWKTLRNQQQSRVTXWY",1292:" 23JZRRPQOQMRLTLUMWOXPXRWSUSTRR RSLQQ RWMRR RXQSS",1293:" 12KYPMTW RTMPW RMPWT RWPMT",1294:" 34J[OUMULVLXMYOYPXPVNTMRMONMOLQKTKVLWMXOXRWTUVUXVYXYYXYVXUVU RNMPLULWM",1295:" 34J[OOMOLNLLMKOKPLPNNPMRMUNW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VF\\F",2022:" 15H\\KFR[ RLFRX RYFR[ RIFOF RUF[F",2023:" 24F^JFN[ RKFNV RRFN[ RRFV[ RSFVV RZFV[ RGFNF RWF]F",2024:" 21H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[",2025:" 20H]KFRQR[ RLFSQS[ RZFSQ RIFOF RVF\\F RO[V[",2026:" 16H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[",2027:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2028:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2029:" 14I[NFN[ ROFO[ RKFZFZLYF RK[R[",2030:" 15H\\RFJ[ RRFZ[ RRIY[ RKZYZ RJ[Z[",2031:" 22G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[",2032:" 16H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[",2033:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[",2034:" 56G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF ROMOT RUMUT ROPUP ROQUQ",2035:" 12MXRFR[ RSFS[ ROFVF RO[V[",2036:" 27F\\KFK[ RLFL[ RYFLS RQOY[ RPOX[ RHFOF RUF[F RH[O[ RU[[[",2037:" 15H\\RFK[ RRFY[ RRIX[ RI[O[ RU[[[",2038:" 30F_KFK[ RLFRX RKFR[ RYFR[ RYFY[ RZFZ[ RHFLF RYF]F RH[N[ RV[][",2039:" 21G^LFL[ RMFYY RMHY[ RYFY[ RIFMF RVF\\F RI[O[",2040:" 36G]KEJJ RZEYJ RONNS RVNUS RKWJ\\ RZWY\\ RKGYG RKHYH ROPUP ROQUQ RKYYY RKZYZ",2041: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RWMMW RRSX[ RQSW[ RIFMF RTMZM RI[P[ RT[Z[",2112:" 12MXRFR[ RSFS[ ROFSF RO[V[",2113:" 44BcGMG[ RHMH[ RHPJNMMOMRNSPS[ ROMQNRPR[ RSPUNXMZM]N^P^[ RZM\\N]P][ RDMHM RD[K[ RO[V[ RZ[a[",2114:" 28G]LML[ RMMM[ RMPONRMTMWNXPX[ RTMVNWPW[ RIMMM RI[P[ RT[[[",2115:" 36H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM",2116:" 36G\\LMLb RMMMb RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIMMM RIbPb",2117:" 33H\\WMWb RXMXb RWPUNSMQMNNLPKSKULXNZQ[S[UZWX RQMONMPLSLUMXOZQ[ RTb[b",2118:" 23IZNMN[ ROMO[ ROSPPRNTMWMXNXOWPVOWN RKMOM RK[R[",2119:" 32J[WOXMXQWOVNTMPMNNMOMQNRPSUUWVXW RMPNQPRUTWUXVXYWZU[Q[OZNYMWM[NY",2120:" 16KZPFPWQZS[U[WZXX RQFQWRZS[ RMMUM",2121:" 28G]LMLXMZP[R[UZWX RMMMXNZP[ RWMW[ RXMX[ RIMMM RTMXM RW[[[",2122:" 15I[LMR[ RMMRY RXMR[ RJMPM RTMZM",2123:" 24F^JMN[ RKMNX RRMN[ RRMV[ RSMVX RZMV[ RGMNM RWM]M",2124:" 21H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[",2125:" 22H[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM",2126:" 16I[WML[ RXMM[ RMMLQLMXM RL[X[XWW[",2127:" 40G^QMNNLPKRJUJXKZN[P[RZUWWTYPZM RQMONMPLRKUKXLZN[ RQMSMUNVPXXYZZ[ RSMTNUPWXXZZ[[[",2128:" 57G\\TFQGOIMMLPKTJZIb RTFRGPINMMPLTKZJb RTFVF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GPFSFVGWHXJXLWNVORQRT RSFUGVHWJWLVNTP RRYQZR[SZRY",2216:" 6NVRFQM RSFQM",2217:" 12JZNFMM ROFMM RVFUM RWFUM",2218:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",2219:" 9JZRFRR RMIWO RWIMO",2220:" 3G][BIb",2221:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",2222:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",2223:" 12KYOBOb RPBPb ROBVB RObVb",2224:" 12KYTBTb RUBUb RNBUB RNbUb",2225:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",2226:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",2227:" 4KYUBNRUb",2228:" 4KYOBVROb",2229:" 3NVRBRb",2230:" 6KYOBOb RUBUb",2231:" 3E_IR[R",2232:" 6E_RIR[ RIR[R",2233:" 9F^RJR[ RJRZR RJ[Z[",2234:" 9F^RJR[ RJJZJ RJRZR",2235:" 6G]KKYY RYKKY",2236:" 6MWRQQRRSSRRQ",2237:" 15E_RIQJRKSJRI RIR[R RRYQZR[SZRY",2238:" 6E_IO[O RIU[U",2239:" 9E_YIK[ RIO[O RIU[U",2240:" 9E_IM[M RIR[R RIW[W",2241:" 4F^ZIJRZ[",2242:" 4F^JIZRJ[",2243:" 10F^ZFJMZT RJVZV RJ[Z[",2244:" 10F^JFZMJT RJVZV RJ[Z[",2245:" 21F_[WYWWVUTRPQOONMNKOJQJSKUMVOVQURTUPWNYM[M",2246:" 24F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O",2247:" 8G]JTROZT RJTRPZT",2248:" 7LXTFOL RTFUGOL",2249:" 7LXPFUL RPFOGUL",2250:" 18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UYV[X[YZZX RMSKPJNJKKILH RSGVHXJYLYOXRVU",2306:" 48G_HKKHMKMV RJILLLV RMKPHRKRU ROIQLQU RRKUHWKW[ RTIVLV[ RWKZH[J\\M\\P[SZUXWUYP[ RYIZJ[M[PZSYUWWTYP[",2307:" 41F^ISMSLRKOKMLJNHQGSGVHXJYMYOXRWS[S RITOTMRLOLMMJOHQG RSGUHWJXMXOWRUT[T RKXYX RKYYY",2308:" 30F_GLJIMLMX RIJLMLX RMLPISLSX ROJRMRX RSLVIYLYW[Y RUJXMXXZZ]W",2309:" 33G]ZIJY RZIWJQJ RXKUKQJ RZIYLYR RXKXNYR RQRJR RPSMSJR RQRQY RPSPVQY",2310:" 33F^HOJKOU RJMOWRPWPZO[M[KZIXHWHUITKTMUPVRWUWXUZ RWHVIUKUMWQXTXWWYUZ",2311:" 36F^IOLLPN RKMOORLUN RQMTOWLYN RVMXO[L RIULRPT RKSOURRUT RQSTUWRYT RVSXU[R",2312:" 48F^JHNJPLQOQRPUNWJY RJHMIOJQLRO RRRQUOWMXJY RZHWIUJSLRO RRRSUUWWXZY RZHVJTLSOSRTUVWZY RIP[P RIQ[Q",2317:" 12NVQQQSSSSQQQ RQQSS RSQQS",2318:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2319:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2320:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2321:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2322:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2323:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2324:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2325:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2326:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2327:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2328:" 49JZMLWX RMLONQOTOVNWMWKUKUMTO RONTO RQOWM RVKVN RULWL RWXUVSUPUNVMWMYOYOWPU RUVPU RSUMW RNVNY RMXOX",2329:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLWY",2330:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2331:"103EfNSOUQVSVUUVSVQUOSNQNOONPMSMVNYP[S\\V\\Y[[Y\\W]T]P\\MZJXIUHRHOIMJKLIOHSHXI]KaMcPeTfYf]e`cba RKLJNIRIXJ\\L`NbQdUeYe]d_cba RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU RaLaNcNcLaL RbLbN RaMcM RaVaXcXcVaV RbVbX RaWcW",2332:" 30D`H@Hd RM@Md RW@Wd R\\@\\d RMMWK RMNWL RMOWM RMWWU RMXWV RMYWW",2367:" 12NVQQQSSSSQQQ RQQSS RSQQS",2368:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2369:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2370:" 32H\\PMMNLOKQKSLUMVPWTWWVXUYSYQXOWNTMPM RMNLPLSMUNVPW RWVXTXQWOVNTM",2371:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2372:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2373:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2374:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2375:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2376:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2377:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2378:" 36JZQCVMRTRU RULQS RTITKPRRUUY RW\\UYSXQXOYN[N]O_Ra RW\\UZSYOYO]P_Ra RSXPZN]",2379:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLSY",2380:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2381:" 89IjNQOOQNSNUOVQVSUUSVQVOUNTMQMNNKPISHWH[I^K`NaRaW`[_]]`ZcVfQiMk RWHZI]K_N`R`W_[^]\\`YcTgQi RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU ReLeNgNgLeL RfLfN ReMgM ReVeXgXgVeV RfVfX ReWgW",2382:" 85D`H>Hf RI>If RM>Mf RQBSBSDQDQAR?T>W>Y?[A\\D\\I[LYNWOUOSNRLQNOQNROSQVRXSVUUWUYV[X\\[\\`[cYeWfTfReQcQ`S`SbQb RRBRD RQCSC RY?ZA[D[IZLYN RRLRNPQNRPSRVRX RYVZX[[[`ZcYe RR`Rb RQaSa",2401:" 21AcHBHb RIBIb R[B[b R\\B\\b RDB`B RDbMb RWb`b",2402:" 23BaGBQPFb RFBPP REBPQ REB\\B^I[B RGa\\a RFb\\b^[[b",2403:" 28I[X+U1R8P=OANFMNMVN^OcPgRlUsXy RU1S6Q<P@O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ROMONVN",2607:" 48H\\XMWMW\\V_U`SaQaO`N_L_ RXMX\\W_UaSbPbNaL_ RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX",2608:" 25H\\LFL[M[ RLFMFM[ RMQPNRMUMWNXQX[ RMQPORNTNVOWQW[X[",2609:" 24NWRFQGQHRISITHTGSFRF RRGRHSHSGRG RRMR[S[ RRMSMS[",2610:" 24NWRFQGQHRISITHTGSFRF RRGRHSHSGRG RRMRbSb RRMSMSb",2611:" 22H[LFL[M[ RLFMFM[ RXMWMMW RXMMX RPTV[X[ RQSX[",2612:" 8NWRFR[S[ RRFSFS[",2613:" 42CbGMG[H[ RGMHMH[ RHQKNMMPMRNSQS[ RHQKOMNONQORQR[S[ RSQVNXM[M]N^Q^[ RSQVOXNZN\\O]Q][^[",2614:" 25H\\LML[M[ RLMMMM[ RMQPNRMUMWNXQX[ RMQPORNTNVOWQW[X[",2615:" 36I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM RQNOONPMSMUNXOYQZTZVYWXXUXSWPVOTNQN",2616:" 36H\\LMLbMb RLMMMMb RMPONQMTMVNXPYSYUXXVZT[Q[OZMX RMPQNTNVOWPXSXUWXVYTZQZMX",2617:" 36H\\WMWbXb RWMXMXb RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX",2618:" 21KYOMO[P[ ROMPMP[ RPSQPSNUMXM RPSQQSOUNXNXM",2619:" 50J[XPWNTMQMNNMPNRPSUUWV RVUWWWXVZ RWYTZQZNY ROZNXMX RXPWPVN RWOTNQNNO RONNPOR RNQPRUTWUXWXXWZT[Q[NZMX",2620:" 16MXRFR[S[ RRFSFS[ ROMVMVN ROMONVN",2621:" 25H\\LMLWMZO[R[TZWW RLMMMMWNYPZRZTYWW RWMW[X[ RWMXMX[",2622:" 14JZLMR[ RLMMMRY RXMWMRY RXMR[",2623:" 26F^IMN[ RIMJMNX RRMNX RRPN[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K[JZHYGVFRFOGMIMKNMONVRXT RMKOMVQWRXTXWWYVZS[O[LZKYJWJVKULVKW",2770:" 3G]_BEb",2771:" 20KZZBVESHQKOONTNXO]P`Qb RVESIQMPPOUOZP_Qb",2772:" 20JYSBTDUGVLVPUUSYQ\\N_Jb RSBTEUJUOTTSWQ[N_",2773:" 9J[TFTR ROIYO RYIOO",2774:" 3E_IR[R",2775:" 6E_RIR[ RIR[R",2776:" 6E_IO[O RIU[U",2777:" 6NWUFSM RVFSM",2778:" 12I[PFNM RQFNM RYFWM RZFWM",2779:" 14KZSFQGPIPKQMSNUNWMXKXIWGUFSF",2801:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2802:" 31G]LFL[ RMFM[ RIFYFYLXF RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2803:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2804:" 14I[NFN[ ROFO[ RKFZFZLYF RK[R[",2805:" 31F^NFNLMTLXKZJ[ RXFX[ RYFY[ RKF\\F RG[\\[ RG[Gb RH[Gb R[[\\b R\\[\\b",2806:" 22G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[",2807:" 71CbRFR[ RSFS[ ROFVF RGGHHGIFHFGGFHFIGJIKMLONPWPYOZM[I\\G]F^F_G_H^I]H^G RNPLQKSJXIZH[ RNPMQLSKXJZI[G[FZEX RWPYQZS[X\\Z][ RWPXQYSZX[Z\\[^[_Z`X RO[V[",2808:" 45H\\LIKFKLLINGPFTFWGXIXLWNTOQO RTFVGWIWLVNTO RTOVPXRYTYWXYWZT[O[MZLYKWKVLUMVLW RWQXTXWWYVZT[",2809:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RXHLY RH[O[ RU[\\[",2810:" 37F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RU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OLNOMSMXNZP[",3054:" 63F]OFI[ RPFJ[ RQFK[ RLFUFXGYHZKZOYSWWUYSZO[F[ RWGXHYKYOXSVWTY RUFWHXKXOWSUWRZO[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[",3055:" 80F]OFI[ RPFJ[ RQFK[ RULST RLF[FZL RNPTP RF[U[WV RMFPG RNFOH RRFPH RSFPG RWFZG RXFZH RYFZI RZFZL RULSPST RTNRPSR RTOQPSQ RJZG[ RJYH[ RKYL[ RJZM[ RP[UZ RR[UY RUYWV",3056:" 70F\\OFI[ RPFJ[ RQFK[ RULST RLF[FZL RNPTP RF[N[ RMFPG RNFOH RRFPH RSFPG RWFZG RXFZH RYFZI RZFZL RULSPST RTNRPSR RTOQPSQ RJZG[ RJYH[ RKYL[ RJZM[",3057:" 65H^ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[R[UZWXYT RQHOJNLMOLSLWMY RVXWWXT RTFRGPJOLNOMSMXNZP[ RR[TZVWWT RTT\\T RUTWU RVTWW RZTXV R[TXU",3058:" 81E_NFH[ ROFI[ RPFJ[ RZFT[ R[FU[ R\\FV[ RKFSF RWF_F RLPXP RE[M[ RQ[Y[ RLFOG RMFNH RQFOH RRFOG RXF[G RYFZH R]F[H R^F[G RIZF[ RIYG[ RJYK[ RIZL[ RUZR[ RUYS[ RVYW[ RUZX[",3059:" 39KYTFN[ RUFO[ RVFP[ RQFYF RK[S[ RRFUG RSFTH RWFUH RXFUG ROZL[ ROYM[ RPYQ[ ROZR[",3060:" 47I\\WFRWQYO[ RXFTSSVRX RYFUSSXQZO[M[KZJXJVKULUMVMWLXKX RKVKWLWLVKV RTF\\F RUFXG RVFWH RZFXH R[FXG",3061:" 72F]OFI[ RPFJ[ RQFK[ R\\GMR RQOU[ RROV[ RSNWZ RLFTF RYF_F RF[N[ RR[Y[ RMFPG RNFOH RRFPH RSFPG RZF\\G R^F\\G RJZG[ RJYH[ RKYL[ RJZM[ RUZ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F\\L RMF]F RK[S[ RNFKL RPFLI RRFMG RYF\\G RZF\\H R[F\\I R\\F\\L ROZL[ ROYM[ RPYQ[ ROZR[",3071:" 48F_NFKQJUJXKZN[R[UZWXXU\\G ROFLQKUKYLZ RPFMQLULYN[ RKFSF RYF_F RLFOG RMFNH RQFOH RRFOG RZF\\G R^F\\G",3072:" 35H\\NFNHOYO[ ROGPX RPFQW R[GO[ RLFSF RXF^F RMFNH RQFPH RRFOG RYF[G R]F[G",3073:" 57E_MFMHKYK[ RNGLX ROFMW RUFMWK[ RUFUHSYS[ RVGTX RWFUW R]GUWS[ RJFRF RUFWF RZF`F RKFNG RLFMH RPFNI RQFNG R[F]G R_F]G",3074:" 54G]NFT[ ROFU[ RPFV[ R[GIZ RLFSF RXF^F RF[L[ RQ[X[ RMFOH RQFPH RRFPG RYF[G R]F[G RIZG[ RIZK[ RTZR[ RTYS[ RUYW[",3075:" 51G]MFQPN[ RNFRPO[ ROFSPP[ R\\GSP RKFRF RYF_F RK[S[ RLFNG RPFOH RQFNG RZF\\G R^F\\G ROZL[ ROYM[ RPYQ[ ROZR[",3076:" 35G]ZFH[ R[FI[ R\\FJ[ R\\FNFLL RH[V[XU ROFLL RPFMI RRFNG RR[VZ RT[WX RU[XU",3101:" 54I]NPNOOOOQMQMONNPMTMVNWOXQXXYZZ[ RVOWQWXXZ RTMUNVPVXWZZ[[[ RVRUSPTMULWLXMZP[S[UZVX RNUMWMXNZ RUSQTOUNWNXOZP[",3102:" 47G\\LFL[MZOZ RMGMY RIFNFNZ RNPONQMSMVNXPYSYUXXVZS[Q[OZNX RWPXRXVWX RSMUNVOWRWVVYUZS[ RJFLG RKFLH",3103:" 34H[WQWPVPVRXRXPVNTMQMNNLPKSKULXNZQ[S[VZXX RMPLRLVMX RQMONNOMRMVNYOZQ[",3104:" 52H]VFV[[[ RWGWZ RSFXFX[ RVPUNSMQMNNLPKSKULXNZQ[S[UZVX RMPLRLVMX RQMONNOMRMVNYOZQ[ RTFVG RUFV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FSFST RSFTGTISQ RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",3215:" 52I\\MKMJNJNLLLLJMHNGPFTFWGXHYJYLXNWOSQ RWHXIXMWN RTFVGWIWMVOUP RRQRTSTSQRQ RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",3216:" 24MXTFRGQIQLRMSMTLTKSJRJQK RRKRLSLSKRK RRGQK RQIRJ",3217:" 24MXTHSIRIQHQGRFSFTGTJSLQM RRGRHSHSGRG RSITJ RTHSL",3218:" 74E_[O[NZNZP\\P\\N[MZMYNXPVUTXRZP[L[JZIXIUJSPORMSKSIRGPFNGMIMLNOPRTWWZY[[[\\Y\\X RKZJXJUKSLR RRMSI RSKRG RNGMK RNNPQTVWYYZ RN[LZKXKULSPO RMINMQQUVXYZZ[Z\\Y",3219:" 56H\\PBP_ RTBT_ RXKXJWJWLYLYJXHWGTFPFMGKIKLLNOPURWSXUXXWZ RLLMNOOUQWRXT RMGLILKMMONUPXRYTYWXYWZT[P[MZLYKWKUMUMWLWLV",3220:" 8G^[BIbJb R[B\\BJb",3221:" 27KYUBSDQGOKNPNTOYQ]S`Ub RQHPKOOOUPYQ\\ RSDRFQIPOPUQ[R^S`",3222:" 27KYOBQDSGUKVPVTUYS]Q`Ob RSHTKUOUUTYS\\ RQDRFSITOTUS[R^Q`",3223:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",3224:" 8F_JQ[Q[R RJQJR[R",3225:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",3226:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",3227:" 11NWSFRGRM RSGRM RSFTGRM",3228:" 22I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM",3229:" 30KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF",3250:" 58H]TFQGOIMLLOKSKVLYMZO[Q[TZVX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Z RXYT[SZQYOYM[ RUNVPXOWMSO RVNWO",3425:" 47J[OKMMMONRNXMY RNNNOOROYQZ RNLNMOOPRPXQYRY RMYOZP[SX RPPVMWOXSXWWZV\\T^Q` RUNVOWR RTNVQWTWWV[T^",3426:" 43KYNPSMUNVPVRUTQV RSNUO RRNTOUQURTTSU RSUUWVYV]U_S`Q`O_N]N[OYQXWV RRVTWUY RQVTXUZU]T_S`",3427:" 61JZRMPNMPMRNU RNPNROT RPNOOORPT RPNROTOVNWMWKVJTJ RQNSN RRMTNVN RNUVRWUWWVYR[ RUSVUVXUY RTSUUUXTZ RTZRYOYL[ RSZQZ RR[PZNZL[",3428:" 78J[VFUGSGQFOFNHNMMOLP RTHRHPGOG RVFUHTIRIPHOHNI RNKPP RNPNTO` ROONOONO[ RPPPTO` RLPNP RPPUMWNXPXRWTSV RUNWO RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^",3429:" 62J[PIOLNNMOKP RPIPXQYO[ ROONOONOXNYOZPYOX RKPNPNXMYO[ RPPUMWNXPXRWTSV RUNWO RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^",3501:" 60G]LINGPFRFSGZW[X]X RQGRHYXZZ[YYX RNGPGQHXXYZZ[[[]X RLMMLOKPKQL RPLPM RMLOLPN RG[IYKXNXPY RJYNYOZ RG[JZMZN[PY RRJLX RNSVS",3502:"110F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RRIQJPLPU RQKQS RRIRRQTPU RRIXFZG[I[KYMUO RXGZIZK RVGXHYIYLWN RWNZP[R[X RYPZRZW RWNXOYQYX RJ[MYPXTXWY RLZOYTYVZ RJ[NZSZU[WYYX[X RUOUX RURYR RUUYU",3503:" 69E]NGLHJJILHOHSIVJXMZP[S[VZXYZW[U RJKINISKWNYQZTZWY RNGLIKKJNJRKUNXQYTYWXYW[U RPJPV RQJQT RRIRSQUPV RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RWIWX",3504:" 72G^IFWFYGZIZX RKGWGYIYW RIFJGLHWHXIXX ROKNLMNMOKOJPJRKQMQMV RNMNT RKPNP ROKOSNUMV RI[LYOXSXVY RKZNYSYUZ RI[MZRZT[VYXXZX RRHRX RRMTNVNXM RRSTRVRXS",3505:" 94G]IHKFMFOGQF RLGNG RIHKGMHOHQF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RQMRJSHTGVFXF[G RTHVGXGZH RRJSIUHWHYI[G RQURRSPTOVOXP RTPVPWQ RRRSQUQVRXP RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RQMQX",3506:" 91F]JHLFOFQGSF RMGPG RJHLGNHQHSF RPKOLNNNOLOKPKRLQNQNV ROMOT RLPOP RPKPSOUNV RSJSYRZQZMXKXIYG[ RTJTX RTPXP RPZOZMYJY RUIUOXO RXQUQUWTYP[N[LZJZG[ RSJUIXFZG\\G]F RWGYH[H RVHXIZI\\H]F RXIXW",3507:" 87E^NGLHJJILHOHRIUJWLYNZQ[U[XZZX[V[SZQYPWOUO RJKINISJV RNGLIKKJNJSKVLXNZ RYXZWZSYQ RU[WZXYYWYSXQWPUO RPJPW RQJQU RRIRTQVPW RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RYHUOU[ RUSYS RUVYV",3508:"112F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZOYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOWNYLZM[P[TZXX[ RXMYNZPZUYX RWNXNYPYUX[ RUOUY RURYR RUUYU",3509:" 67I\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZSZOXMXKYI[ RWKW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MVNXOYOWPWXXYYY RTNVOVYWZ RROSOUPUYW[YY",3615:" 40I[MOMXKY RNPNXQZ ROOOXQYRZ RKYMYOZP[RZUYWY RMOOORNTMUNWOYOWPWY RSNVPVX RRNSOUPUY",3616:" 54I[LMMOMXKYMYMb RMNNONaO`N^ RNYOYQZ RLMNNOOOXQYRZ ROZP[RZUYWY ROZO^P`Mb ROPROTNUMVNXOYOWPWY RTNVOVX RROSOUPUY",3617:" 44I[MOMXKY RNPNYPZ ROOOXQYRY RKYLYNZO[PZRYUX RMOOORNTMUNWOYOWPWb RSNVPVaU`V^ RRNSOUPU^T`Wb",3618:" 38JXLOMONPNXLYMYOZP[ RMNOOOYQZ RLONMPOPXRYSYQZP[ RPOTMUNWOXO RSNTOVO RRNTPVPXO",3619:" 59JZMOMSOTUTWUWY RNONS RVUVY RPNOOOSQT RSTUUUYTZ RMOPNRMTNVNWM RQNSN RPNROTOVN RWYTZR[PZNZL[ RSZQZ RTZRYOYL[ RWMVOTROWL[",3620:" 28MWPHQJQXOYPYRZS[ RRJQHRGRYTZ RPHSFSXUYVYTZS[ RNMQM RSMVM",3621:" 47I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPWXXYYY RTNVOVYWZ RUMSOUPUYW[YY",3622:" 36I[LMMOMXP[RYUXWX RMNNONXQZ RLMNNOOOWPXRY RUMVNXOYOWPWX RTNVOVW RUMSOUPUX",3623:" 57E_HMIOIXL[NYQX RINJOJXMZ RHMJNKOKWLXNY RQMOOQPQXT[VYYX[X RPNRORXUZ RQMRNTOSPSWTXVY RYMZN\\O]O[P[X RXNZOZW RYMWOYPYX",3624:" 59H[KOLONPOQSYTZV[XY RMNOOTYVZ RKOMMONPOTWUXWYXY RRSUMVNXNYM RUNVOWO RTOVPXOYM RQUN[MZKZJ[ RNZMYLY ROYMXKYJ[ RMTPT RSTVT",3625:" 60I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPW\\V_TaRbQaO`M` RTNVOV\\ RSaQ`P` RUMSOUPUZV]V_ RTaS`Q_O_M`",3626:" 38I[XML[ RLONPQPTOXM RMNOOSO RLONMPNTNXM RL[PYSXVXXY RQYUYWZ RL[PZTZV[XY RNTVT",3700:" 42H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJYLYNZO[QZVYXY",3701:" 27H\\OHPIQKQXOY RQIPHQGRIRYTZ ROHRFSHSXUYVY ROYPYRZS[TZVY",3702:" 48H\\LHNHPGQFSGVHXH RPHRG RLHNIPIRHSG RVHVP RWIWO RXHXPQPNQLSKVK[ RK[OYSXVXZY RNZQYVYYZ RK[PZUZX[ZY",3703:" 57H\\LHMHOGPFRGVHXH ROHQG RLHNIPIRG RVHVO RWIWN RXHXOVOSPQQ RQPSQVRXRXY RWSWX RVRVY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3704:" 41H\\UFKPKUTU RVUZU[V[TZU RLPLT RMNMU RTGTXRY RUJVHUGUYWZ RUFWHVJVXXYYY RRYSYUZV[WZYY",3705:" 53H\\LFLO RLFXF RMGVG RLHUHWGXF RVLUMSNOOLO RSNTNVOVY RUMWNWX RVLWMYNZNXOXY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3706:" 59H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHRGTFUGWHXH RSGUH RRGTIVIXH RNPOPSOUNVM RSOTOVPVY RUNWPWX RVMWNYOZOXPXY RJYLYNZO[QZVYXY",3707:" 38H\\KHMFPGUGZF RLGOHTHWG RKHOIRIVHZF RZFYHWKSOQRPUPXQ[ RRQQTQWRZ RUMSPRSRVSYQ[",3708:" 71H\\LILO RMJMN RNINO RLINISHUGVF RSHTHVIVO RUGWHWN RVFWGYHZHXIXO RLONOVRXR RXOVONRLR RLRLXJY RMSMXPZ RNRNXPYQZ RVRVY RWSWX RXRXY RJYLYNZO[QZVYXY",3709:" 60H\\LHLQJR RMIMROS RNHNQPRQR RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJRKRMSNTOSQRUQVQ RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3710:" 11LXRXPZR[TZRX RRYQZSZRY",3711:" 14LXR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3712:" 22LXRMPORPTORM RRNQOSORN RRXPZR[TZRX RRYQZSZRY",3713:" 25LXRMPORPTORM RRNQOSORN RR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3714:" 30LXRFQGOHQIRT RRISHRGQHRIRT RRFSGUHSIRT RRXPZR[TZRX RRYQZSZRY",3715:" 51I[LJMHNGQFSFVGWHXJXLWNUPSQ RMJNH RVHWIWMVN RLJNKNIOGQF RSFUGVIVMUOSQ RRQRTSQQQRT RRXPZR[TZRX RRYQZSZRY",3716:" 14LXTFRGQIQKRMTKRIRG RRJRLSKRJ",3717:" 14LXRLRJPHRFSHSJRLPM RRGQHRIRG",3718:" 62E_YNZO[O\\N RXOYP[P RXPYQZQ[P\\N RYNST RRUL[HVNP ROOSKOFJLPRTXVZX[Z[[Z\\X RLZIV RRKOG RKLPQTWVYXZ[Z RMZIU RRLNG RKKQQUWVXXY[Y\\X",3719:" 60H\\PBP_ RTBT_ RTFVGWIWKYJXHWGTFPFMGKIKLLNOPURWSXUXXWZ RXJWH RLLMNOOUQWRXT RMYLW RMGLILKMMONUPXRYTYWXYWZT[P[MZLYKWMVMXNZP[",3720:" 8G^[BIbJb R[B\\BJb",3721:" 27KYUBSDQGOKNPNTOYQ]S`Ub RQHPKOOOUPYQ\\ RSDRFQIPOPUQ[R^S`",3722:" 27KYOBQDSGUKVPVTUYS]Q`Ob RSHTKUOUUTYS\\ RQDRFSITOTUS[R^Q`",3723:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",3724:" 8F_JQ[Q[R R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 41E_HFXYYZ RIGKHZZ RLH\\[ R\\FSP RQRJZ RPSMULW RQRMTLUKWKY RHFLHPITIXH\\F RH[JZNYSYYZ\\[",3825:" 47E_XHXZ RYHYY RZGZY RKHIJHMHPISKUMVPWSWVVXU RLUOVUV RHPIRKTNUTUVV RHFLHPITIXH\\F RHWJYLZP[T[XZ\\X",3826:" 73E_HFIGKHNHSFVFYGZIZKYM RXGYIYKXM RVFWGXIXL RXNTOROPNPLRKTKXL RTKVLWMVNTO RYM[O\\R\\T[WYYWZT[P[MZKYIWHTHRIOJNLMNMPNPPOQNPOO RXMZO[Q[UZW RXNYOZQZUYXWZ",3901:" 42J[PQMTMXP[TY RNTNXPZ ROROWRZ RRSMNNMONNO RONSNUMWOWXXY RUNVOVXUYVZWYVX RSNUPUXTYV[XY",3902:" 31IZNHLFMJMXP[UYWX RNHNXPZ RNHPFOJOWRZ ROOTMWPWX RTNVPVX RRNUQUY",3903:" 23KWNPNYP[RY ROPOYPZ RPOPXQYRY RNPTMVOTPRN RSNUO",3904:" 32JZRMMPMXP[RZUYWY RNPNXPZ ROOOWRZ RPIPFQIWPWY RPIVPVX RPIMIPJUPUY",3905:" 25KXNPNYP[RY ROPOYPZ RPOPXQYRY RNPTMWQPU RSNVQ RRNUR",3906:" 32KWOIOXNYP[ RPIPXOYPZQYPX RQHQXRYP[ ROIUFWHUISG RTGVH RLMOM RQMUM",3907:" 41J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW]V_U`SaQaO`MaObQa RTNVPV]U_ RPaNa RRNUQU^T`Sa",3908:" 42I[NHLFMJMXLYN[ RNHNXMYNZOYNX RNHPFOJOXPYN[ ROORNTMWPWYT]T`UbVbT` RTNVPVYU[ RRNUQUZT]",3909:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQXPYR[ RRPSORNQORPRXQYRZSYRX RRMTOSPSXTYR[",3910:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQYT] RRPSORNQORPRYS[ RRMTO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OY RRMPOQPQXU[WY[W RRPSORNQORPRXUZ RRMTOSPSWVYWY RZM\\O[P[W RZP[OZNYOZPZW RZMXOYPYX",3924:" 39I[LONPUZV[XY RMNOOUYWZ RLONMONVXXY RXMVMVOXOXMVOSS RQUNYL[N[NYLYL[ RNTQT RSTVT",3925:" 49I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPW]V_U`SaQaO`MaObQa RVPWOVNUOVPV^U_ RPaNa RVMTOUPU^T`Sa",3926:" 43L[RNOPOORNTMWOWSRU RTNVOVS RRNUPUSTT RRUWWW]V_U`SaQaO`MaObQa RVWV^U_ RPaNa RTVUWU^T`Sa"},gt={"\\frac":{glyph:0,arity:2,flags:{}},"\\binom":{glyph:0,arity:2,flags:{}},"\\sqrt":{glyph:2267,arity:1,flags:{opt:!0,xfl:!0,yfl:!0}},"^":{glyph:0,arity:1,flags:{}},_:{glyph:0,arity:1,flags:{}},"(":{glyph:2221,arity:0,flags:{yfl:!0}},")":{glyph:2222,arity:0,flags:{yfl:!0}},"[":{glyph:2223,arity:0,flags:{yfl:!0}},"]":{glyph:2224,arity:0,flags:{yfl:!0}},"\\langle":{glyph:2227,arity:0,flags:{yfl:!0}},"\\rangle":{glyph:2228,arity:0,flags:{yfl:!0}},"|":{glyph:2229,arity:0,flags:{yfl:!0}},"\\|":{glyph:2230,arity:0,flags:{yfl:!0}},"\\{":{glyph:2225,arity:0,flags:{yfl:!0}},"\\}":{glyph:2226,arity:0,flags:{yfl:!0}},"\\#":{glyph:2275,arity:0,flags:{}},"\\$":{glyph:2274,arity:0,flags:{}},"\\&":{glyph:2273,arity:0,flags:{}},"\\%":{glyph:2271,arity:0,flags:{}},"\\begin":{glyph:0,arity:1,flags:{}},"\\end":{glyph:0,arity:1,flags:{}},"\\left":{glyph:0,arity:1,flags:{}},"\\right":{glyph:0,arity:1,flags:{}},"\\middle":{glyph:0,arity:1,flags:{}},"\\cdot":{glyph:2236,arity:0,flags:{}},"\\pm":{glyph:2233,arity:0,flags:{}},"\\mp":{glyph:2234,arity:0,flags:{}},"\\times":{glyph:2235,arity:0,flags:{}},"\\div":{glyph:2237,arity:0,flags:{}},"\\leqq":{glyph:2243,arity:0,flags:{}},"\\geqq":{glyph:2244,arity:0,flags:{}},"\\leq":{glyph:2243,arity:0,flags:{}},"\\geq":{glyph:2244,arity:0,flags:{}},"\\propto":{glyph:2245,arity:0,flags:{}},"\\sim":{glyph:2246,arity:0,flags:{}},"\\equiv":{glyph:2240,arity:0,flags:{}},"\\dagger":{glyph:2277,arity:0,flags:{}},"\\ddagger":{glyph:2278,arity:0,flags:{}},"\\ell":{glyph:662,arity:0,flags:{}},"\\vec":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overrightarrow":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overleftarrow":{glyph:2263,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\bar":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\overline":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\widehat":{glyph:2247,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\hat":{glyph:2247,arity:1,flags:{hat:!0}},"\\acute":{glyph:2248,arity:1,flags:{hat:!0}},"\\grave":{glyph:2249,arity:1,flags:{hat:!0}},"\\breve":{glyph:2250,arity:1,flags:{hat:!0}},"\\tilde":{glyph:2246,arity:1,flags:{hat:!0}},"\\underline":{glyph:2231,arity:1,flags:{mat:!0,xfl:!0}},"\\not":{glyph:2220,arity:1,flags:{}},"\\neq":{glyph:2239,arity:1,flags:{}},"\\ne":{glyph:2239,arity:1,flags:{}},"\\exists":{glyph:2279,arity:0,flags:{}},"\\in":{glyph:2260,arity:0,flags:{}},"\\subset":{glyph:2256,arity:0,flags:{}},"\\supset":{glyph:2258,arity:0,flags:{}},"\\cup":{glyph:2257,arity:0,flags:{}},"\\cap":{glyph:2259,arity:0,flags:{}},"\\infty":{glyph:2270,arity:0,flags:{}},"\\partial":{glyph:2265,arity:0,flags:{}},"\\nabla":{glyph:2266,arity:0,flags:{}},"\\aleph":{glyph:2077,arity:0,flags:{}},"\\wp":{glyph:2190,arity:0,flags:{}},"\\therefore":{glyph:740,arity:0,flags:{}},"\\mid":{glyph:2229,arity:0,flags:{}},"\\sum":{glyph:2402,arity:0,flags:{big:!0}},"\\prod":{glyph:2401,arity:0,flags:{big:!0}},"\\bigoplus":{glyph:2284,arity:0,flags:{big:!0}},"\\bigodot":{glyph:2281,arity:0,flags:{big:!0}},"\\int":{glyph:2412,arity:0,flags:{yfl:!0}},"\\oint":{glyph:2269,arity:0,flags:{yfl:!0}},"\\oplus":{glyph:1284,arity:0,flags:{}},"\\odot":{glyph:1281,arity:0,flags:{}},"\\perp":{glyph:738,arity:0,flags:{}},"\\angle":{glyph:739,arity:0,flags:{}},"\\triangle":{glyph:842,arity:0,flags:{}},"\\Box":{glyph:841,arity:0,flags:{}},"\\rightarrow":{glyph:2261,arity:0,flags:{}},"\\to":{glyph:2261,arity:0,flags:{}},"\\leftarrow":{glyph:2263,arity:0,flags:{}},"\\gets":{glyph:2263,arity:0,flags:{}},"\\circ":{glyph:902,arity:0,flags:{}},"\\bigcirc":{glyph:904,arity:0,flags:{}},"\\bullet":{glyph:828,arity:0,flags:{}},"\\star":{glyph:856,arity:0,flags:{}},"\\diamond":{glyph:743,arity:0,flags:{}},"\\ast":{glyph:728,arity:0,flags:{}},"\\log":{glyph:0,arity:0,flags:{txt:!0}},"\\ln":{glyph:0,arity:0,flags:{txt:!0}},"\\exp":{glyph:0,arity:0,flags:{txt:!0}},"\\mod":{glyph:0,arity:0,flags:{txt:!0}},"\\lim":{glyph:0,arity:0,flags:{txt:!0,big:!0}},"\\sin":{glyph:0,arity:0,flags:{txt:!0}},"\\cos":{glyph:0,arity:0,flags:{txt:!0}},"\\tan":{glyph:0,arity:0,flags:{txt:!0}},"\\csc":{glyph:0,arity:0,flags:{txt:!0}},"\\sec":{glyph:0,arity:0,flags:{txt:!0}},"\\cot":{glyph:0,arity:0,flags:{txt:!0}},"\\sinh":{glyph:0,arity:0,flags:{txt:!0}},"\\cosh":{glyph:0,arity:0,flags:{txt:!0}},"\\tanh":{glyph:0,arity:0,flags:{txt:!0}},"\\csch":{glyph:0,arity:0,flags:{txt:!0}},"\\sech":{glyph:0,arity:0,flags:{txt:!0}},"\\coth":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsin":{glyph:0,arity:0,flags:{txt:!0}},"\\arccos":{glyph:0,arity:0,flags:{txt:!0}},"\\arctan":{glyph:0,arity:0,flags:{txt:!0}},"\\arccsc":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsec":{glyph:0,arity:0,flags:{txt:!0}},"\\arccot":{glyph:0,arity:0,flags:{txt:!0}},"\\text":{glyph:0,arity:1,flags:{}},"\\mathnormal":{glyph:0,arity:1,flags:{}},"\\mathrm":{glyph:0,arity:1,flags:{}},"\\mathit":{glyph:0,arity:1,flags:{}},"\\mathbf":{glyph:0,arity:1,flags:{}},"\\mathsf":{glyph:0,arity:1,flags:{}},"\\mathtt":{glyph:0,arity:1,flags:{}},"\\mathfrak":{glyph:0,arity:1,flags:{}},"\\mathcal":{glyph:0,arity:1,flags:{}},"\\mathbb":{glyph:0,arity:1,flags:{}},"\\mathscr":{glyph:0,arity:1,flags:{}},"\\rm":{glyph:0,arity:1,flags:{}},"\\it":{glyph:0,arity:1,flags:{}},"\\bf":{glyph:0,arity:1,flags:{}},"\\sf":{glyph:0,arity:1,flags:{}},"\\tt":{glyph:0,arity:1,flags:{}},"\\frak":{glyph:0,arity:1,flags:{}},"\\cal":{glyph:0,arity:1,flags:{}},"\\bb":{glyph:0,arity:1,flags:{}},"\\scr":{glyph:0,arity:1,flags:{}},"\\quad":{glyph:0,arity:0,flags:{}},"\\,":{glyph:0,arity:0,flags:{}},"\\.":{glyph:0,arity:0,flags:{}},"\\;":{glyph:0,arity:0,flags:{}},"\\!":{glyph:0,arity:0,flags:{}},"\\alpha":{glyph:2127,flags:{}},"\\beta":{glyph:2128,flags:{}},"\\gamma":{glyph:2129,flags:{}},"\\delta":{glyph:2130,flags:{}},"\\varepsilon":{glyph:2131,flags:{}},"\\zeta":{glyph:2132,flags:{}},"\\eta":{glyph:2133,flags:{}},"\\vartheta":{glyph:2134,flags:{}},"\\iota":{glyph:2135,flags:{}},"\\kappa":{glyph:2136,flags:{}},"\\lambda":{glyph:2137,flags:{}},"\\mu":{glyph:2138,flags:{}},"\\nu":{glyph:2139,flags:{}},"\\xi":{glyph:2140,flags:{}},"\\omicron":{glyph:2141,flags:{}},"\\pi":{glyph:2142,flags:{}},"\\rho":{glyph:2143,flags:{}},"\\sigma":{glyph:2144,flags:{}},"\\tau":{glyph:2145,flags:{}},"\\upsilon":{glyph:2146,flags:{}},"\\varphi":{glyph:2147,flags:{}},"\\chi":{glyph:2148,flags:{}},"\\psi":{glyph:2149,flags:{}},"\\omega":{glyph:2150,flags:{}},"\\epsilon":{glyph:2184,flags:{}},"\\theta":{glyph:2185,flags:{}},"\\phi":{glyph:2186,flags:{}},"\\varsigma":{glyph:2187,flags:{}},"\\Alpha":{glyph:2027,flags:{}},"\\Beta":{glyph:2028,flags:{}},"\\Gamma":{glyph:2029,flags:{}},"\\Delta":{glyph:2030,flags:{}},"\\Epsilon":{glyph:2031,flags:{}},"\\Zeta":{glyph:2032,flags:{}},"\\Eta":{glyph:2033,flags:{}},"\\Theta":{glyph:2034,flags:{}},"\\Iota":{glyph:2035,flags:{}},"\\Kappa":{glyph:2036,flags:{}},"\\Lambda":{glyph:2037,flags:{}},"\\Mu":{glyph:2038,flags:{}},"\\Nu":{glyph:2039,flags:{}},"\\Xi":{glyph:2040,flags:{}},"\\Omicron":{glyph:2041,flags:{}},"\\Pi":{glyph:2042,flags:{}},"\\Rho":{glyph:2043,flags:{}},"\\Sigma":{glyph:2044,flags:{}},"\\Tau":{glyph:2045,flags:{}},"\\Upsilon":{glyph:2046,flags:{}},"\\Phi":{glyph:2047,flags:{}},"\\Chi":{glyph:2048,flags:{}},"\\Psi":{glyph:2049,flags:{}},"\\Omega":{glyph:2050,flags:{}}};function Kn(o,t="math"){const e=o.charCodeAt(0);if(65<=e&&e<=90){const n=e-65;return t=="text"||t=="rm"?n+2001:t=="tt"?n+501:t=="bf"||t=="bb"?n+3001:t=="sf"?n+2501:t=="frak"?n+3301:t=="scr"||t=="cal"?n+2551:n+2051}if(97<=e&&e<=122){const n=e-97;return t=="text"||t=="rm"?n+2101:t=="tt"?n+601:t=="bf"||t=="bb"?n+3101:t=="sf"?n+2601:t=="frak"?n+3401:t=="scr"||t=="cal"?n+2651:n+2151}if(48<=e&&e<=57){const n=e-48;return t=="it"?n+2750:t=="bf"?n+3200:t=="tt"?n+700:n+2200}return{".":2210,",":2211,":":2212,";":2213,"!":2214,"?":2215,"'":2216,'"':2217,"*":2219,"/":2220,"-":2231,"+":2232,"=":2238,"<":2241,">":2242,"~":2246,"@":2273,"\\":804}[o]}const qt={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function fl(o){o=o.replace(/\n/g," ");let t=0;const e=[];let n="";for(;t<o.length;)o[t]==" "?n.length&&(e.push(n),n=""):o[t]=="\\"?n.length==1&&n[0]=="\\"?(n+=o[t],e.push(n),n=""):(n.length&&e.push(n),n=o[t]):/[A-Za-z0-9\.]/.test(o[t])?n+=o[t]:(n.length&&n!="\\"&&(e.push(n),n=""),n+=o[t],e.push(n),n=""),t++;return n.length&&e.push(n),e}function Tl(o){return{type:gt[o]?"symb":"char",mode:"math",text:o,chld:[],bbox:null}}function Vo(o){let t=0,e={type:"node",text:"",mode:"math",chld:[],bbox:null};function n(){if(o[t]!="[")return null;let r=0,s=t;for(;s<o.length;){if(o[s]=="[")r++;else if(o[s]=="]"&&(r--,!r))break;s++}const a=Vo(o.slice(t+1,s));return t=s,a}function i(r){let s=t,a=s,c=0,d=0;const R=[];for(;s<o.length;){if(o[s]=="{")c||(a=s),c++;else if(o[s]=="}"){if(c--,!c&&(R.push(Vo(o.slice(a+1,s))),d++,d==r))break}else if(c==0&&(R.push(Tl(o[s])),d++,d==r))break;s++}return t=s,R}for(t=0;t<o.length;t++){const r=gt[o[t]],s={type:"",text:o[t],mode:"math",chld:[],bbox:null};if(r)if(r.arity){t++,s.type="func";let a=null;r.flags.opt&&(a=n(),a&&t++);const c=i(r.arity);s.chld=c,a&&s.chld.push(a)}else s.type="symb";else o[t]=="{"?(s.type="node",s.text="",s.chld=i(1)):s.type="char";e.chld.push(s)}return e.chld.length==1&&(e=e.chld[0]),e}function _i(o){let t=0;for(;t<o.length;){if(o[t].text=="\\begin"){let e;for(e=t;e<o.length&&o[e].text!="\\end";e++);const n=o.splice(t+1,e-(t+1));_i(n),o[t].text=o[t].chld[0].text,o[t].chld=n,o.splice(t+1,1)}t++}}function At(o,t,e,n,i,r){if(e==null&&(e=t),!!o.bbox){r&&(o.bbox.x*=t,o.bbox.y*=e),o.bbox.w*=t,o.bbox.h*=e;for(let s=0;s<o.chld.length;s++)At(o.chld[s],t,e,0,0,!0);o.bbox.x+=n,o.bbox.y+=i}}function xi(o){let t=1/0,e=-1/0,n=1/0,i=-1/0;for(let r=0;r<o.length;r++)o[r].bbox&&(t=Math.min(t,o[r].bbox.x),n=Math.min(n,o[r].bbox.y),e=Math.max(e,o[r].bbox.x+o[r].bbox.w),i=Math.max(i,o[r].bbox.y+o[r].bbox.h));return{x:t,y:n,w:e-t,h:i-n}}function ml(o){if(!o.length)return null;const t=xi(o);for(let n=0;n<o.length;n++)o[n].bbox&&(o[n].bbox.x-=t.x,o[n].bbox.y-=t.y);return{type:"node",text:"",mode:"math",chld:o,bbox:t}}function pl(o,t="center"){for(let d=0;d<o.length;d++)if(o[d].text=="^"||o[d].text=="'"){let R=0,u=d;for(;u>0&&(o[u].text=="^"||o[u].text=="_"||o[u].text=="'");)u--;R=o[u].bbox.y,o[d].text=="'"?o[d].bbox.y=R:(At(o[d],qt.SUB_SUP_SCALE,null,0,0),gt[o[u].text]&&gt[o[u].text].flags.big?o[d].bbox.y=R-o[d].bbox.h:o[u].text=="\\int"?o[d].bbox.y=R:o[d].bbox.y=R-o[d].bbox.h/2)}else if(o[d].text=="_"){let R=1,u=d;for(;u>0&&(o[u].text=="^"||o[u].text=="_"||o[u].text=="'");)u--;R=o[u].bbox.y+o[u].bbox.h,At(o[d],qt.SUB_SUP_SCALE,null,0,0),gt[o[u].text]&&gt[o[u].text].flags.big?o[d].bbox.y=R:o[u].text=="\\int"?o[d].bbox.y=R-o[d].bbox.h:o[d].bbox.y=R-o[d].bbox.h/2}function e(d,R,u,h,g){let f=d,T=g,m=1/0,p=-1/0;for(;h>0?f<o.length:f>=0;){if(o[f].text==R)T++;else if(o[f].text==u){if(T--,T==0)break}else o[f].text=="^"||o[f].text=="_"||o[f].bbox&&(m=Math.min(m,o[f].bbox.y),p=Math.max(p,o[f].bbox.y+o[f].bbox.h));f+=h}return[m,p]}for(let d=0;d<o.length;d++)if(o[d].text=="\\left"){const[R,u]=e(d,"\\left","\\right",1,0);R!=1/0&&u!=-1/0&&(o[d].bbox.y=R,At(o[d],1,(u-R)/o[d].bbox.h,0,0))}else if(o[d].text=="\\right"){const[R,u]=e(d,"\\right","\\left",-1,0);R!=1/0&&u!=-1/0&&(o[d].bbox.y=R,At(o[d],1,(u-R)/o[d].bbox.h,0,0))}else if(o[d].text=="\\middle"){const[R,u]=e(d,"\\right","\\left",-1,1),[h,g]=e(d,"\\left","\\right",1,1),f=Math.min(R,h),T=Math.max(u,g);f!=1/0&&T!=-1/0&&(o[d].bbox.y=f,At(o[d],1,(T-f)/o[d].bbox.h,0,0))}if(!o.some(d=>d.text=="&"||d.text=="\\\\"))return;const n=[];let i=[],r=[];for(let d=0;d<o.length;d++)o[d].text=="&"?(i.push(r),r=[]):o[d].text=="\\\\"?(r.length&&(i.push(r),r=[]),n.push(i),i=[]):r.push(o[d]);r.length&&i.push(r),i.length&&n.push(i);const s=[],a=[];for(let d=0;d<n.length;d++){const R=[];for(let u=0;u<n[d].length;u++){const h=ml(n[d][u]);h&&(s[u]=s[u]||0,s[u]=Math.max(h.bbox.w+1,s[u])),R[u]=h}a.push(R)}const c=[];for(let d=0;d<a.length;d++){let R=1/0,u=-1/0;for(let h=0;h<a[d].length;h++)a[d][h]&&(R=Math.min(R,a[d][h].bbox.y),u=Math.max(u,a[d][h].bbox.y+a[d][h].bbox.h));c.push([R,u])}for(let d=0;d<c.length;d++)(c[d][0]==1/0||c[d][1]==1/0)&&(c[d][0]=d==0?0:c[d-1][1],c[d][1]=c[d][0]+2);for(let d=1;d<a.length;d++){const R=c[d-1][1]-c[d][0]+qt.LINE_SPACING;for(let u=0;u<a[d].length;u++)a[d][u]&&(a[d][u].bbox.y+=R);c[d][0]+=R,c[d][1]+=R}o.splice(0,o.length);for(let d=0;d<a.length;d++){let R=0;for(let u=0;u<a[d].length;u++){const h=a[d][u];if(!h){R+=s[u];continue}h.bbox.x+=R,R+=s[u]-h.bbox.w,t=="center"?h.bbox.x+=(s[u]-h.bbox.w)/2:t=="left"||(t=="right"||t=="equation"&&u!=a[d].length-1)&&(h.bbox.x+=s[u]-h.bbox.w),o.push(h)}}}function he(o,t="math"){const e={"\\text":"text","\\mathnormal":"math","\\mathrm":"rm","\\mathit":"it","\\mathbf":"bf","\\mathsf":"sf","\\mathtt":"tt","\\mathfrak":"frak","\\mathcal":"cal","\\mathbb":"bb","\\mathscr":"scr","\\rm":"rm","\\it":"it","\\bf":"bf","\\sf":"tt","\\tt":"tt","\\frak":"frak","\\cal":"cal","\\bb":"bb","\\scr":"scr"}[o.text]??t;if(!o.chld.length){if(gt[o.text])if(gt[o.text].flags.big)o.text=="\\lim"?o.bbox={x:0,y:0,w:3.5,h:2}:o.bbox={x:0,y:-.5,w:3,h:3};else if(gt[o.text].flags.txt){let n=0;for(let i=1;i<o.text.length;i++)n+=tn(Kn(o.text[i],"text")).w;n/=16,o.bbox={x:0,y:0,w:n,h:2}}else if(gt[o.text].glyph){let n=tn(gt[o.text].glyph).w;n/=16,o.text=="\\int"||o.text=="\\oint"?o.bbox={x:0,y:-1.5,w:n,h:5}:o.bbox={x:0,y:0,w:n,h:2}}else o.bbox={x:0,y:0,w:1,h:2};else{let n=0;for(let i=0;i<o.text.length;i++)tn(Kn(o.text[i],e))&&(e=="tt"?n+=16:n+=tn(Kn(o.text[i],e)).w);n/=16,o.bbox={x:0,y:0,w:n,h:2}}o.mode=e;return}if(o.text=="\\frac"){const n=o.chld[0],i=o.chld[1],r=qt.FRAC_SCALE;he(n),he(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const s=Math.max(n.bbox.w,i.bbox.w)*r;At(n,r,null,(s-n.bbox.w*r)/2,0),At(i,r,null,(s-i.bbox.w*r)/2,n.bbox.h+qt.FRAC_SPACING),o.bbox={x:0,y:-n.bbox.h+1-qt.FRAC_SPACING/2,w:s,h:n.bbox.h+i.bbox.h+qt.FRAC_SPACING}}else if(o.text=="\\binom"){const n=o.chld[0],i=o.chld[1];he(n),he(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const r=Math.max(n.bbox.w,i.bbox.w);At(n,1,null,(r-n.bbox.w)/2+1,0),At(i,1,null,(r-i.bbox.w)/2+1,n.bbox.h),o.bbox={x:0,y:-n.bbox.h+1,w:r+2,h:n.bbox.h+i.bbox.h}}else if(o.text=="\\sqrt"){const n=o.chld[0];he(n);const i=o.chld[1];let r=0;i&&(he(i),r=Math.max(i.bbox.w*qt.SQRT_MAG_SCALE-.5,0),At(i,qt.SQRT_MAG_SCALE,null,0,.5)),At(n,1,null,1+r,.5),o.bbox={x:0,y:2-n.bbox.h-.5,w:n.bbox.w+1+r,h:n.bbox.h+.5}}else if(gt[o.text]&&gt[o.text].flags.hat){const n=o.chld[0];he(n);const i=n.bbox.y-.5;n.bbox.y=.5,o.bbox={x:0,y:i,w:n.bbox.w,h:n.bbox.h+.5}}else if(gt[o.text]&&gt[o.text].flags.mat){const n=o.chld[0];he(n),o.bbox={x:0,y:0,w:n.bbox.w,h:n.bbox.h+.5}}else{let n=0,i=0,r=1;for(let u=0;u<o.chld.length;u++){const h=o.chld[u],g={"\\quad":2,"\\,":6/18,"\\:":8/18,"\\;":10/18,"\\!":-6/18}[h.text]??null;if(h.text=="\\\\"){i+=r,n=0,r=1;continue}else{if(h.text=="&")continue;if(g!=null){n+=g;continue}else{if(he(h,e),At(h,1,null,n,i),h.text=="^"||h.text=="_"||h.text=="'"){let f=u;for(;f>0&&(o.chld[f].text=="^"||o.chld[f].text=="_"||o.chld[f].text=="'");)f--;const T=gt[o.chld[f].text]&&gt[o.chld[f].text].flags.big;if(h.text=="'"){let m=f+1,p=0;for(;m<u;)o.chld[m].text=="'"&&p++,m++;h.bbox.x=o.chld[f].bbox.x+o.chld[f].bbox.w+h.bbox.w*p,n=Math.max(n,h.bbox.x+h.bbox.w)}else if(T){const m=o.chld[f].bbox.x+(o.chld[f].bbox.w-h.bbox.w*qt.SUB_SUP_SCALE)/2;h.bbox.x=m,n=Math.max(n,o.chld[f].bbox.x+o.chld[f].bbox.w+(h.bbox.w*qt.SUB_SUP_SCALE-o.chld[f].bbox.w)/2)}else h.bbox.x=o.chld[f].bbox.x+o.chld[f].bbox.w,n=Math.max(n,h.bbox.x+h.bbox.w*qt.SUB_SUP_SCALE)}else n+=h.bbox.w;t=="text"&&(n+=1),r=Math.max(h.bbox.y+h.bbox.h-i,r)}}}i+=r;const s={bmatrix:["[","]"],pmatrix:["(",")"],Bmatrix:["\\{","\\}"],cases:["\\{"]},a={bmatrix:"center",pmatrix:"center",Bmatrix:"center",cases:"left",matrix:"center",aligned:"equation"}[o.text]??"left",c=!!s[o.text],d=!!s[o.text]&&s[o.text].length>1;pl(o.chld,a);const R=xi(o.chld);o.text=="\\text"&&(R.x-=1,R.w+=2);for(let u=0;u<o.chld.length;u++)At(o.chld[u],1,null,-R.x+(c?1.5:0),-R.y);o.bbox={x:0,y:0,w:R.w+1.5*Number(c)+1.5*Number(d),h:R.h},c&&o.chld.unshift({type:"symb",text:s[o.text][0],mode:o.mode,chld:[],bbox:{x:0,y:0,w:1,h:R.h}}),d&&o.chld.push({type:"symb",text:s[o.text][1],mode:o.mode,chld:[],bbox:{x:R.w+2,y:0,w:1,h:R.h}}),(c||d||o.text=="matrix")&&(o.type="node",o.text="",o.bbox.y-=(o.bbox.h-2)/2)}}function Ll(o){function t(n,i,r){const s=[];if(n.bbox){if(i+=n.bbox.x,r+=n.bbox.y,n.text=="\\frac"){const a=n.chld[1].bbox.y-(n.chld[0].bbox.y+n.chld[0].bbox.h),c={type:"symb",mode:n.mode,text:"\\bar",bbox:{x:i,y:r+(n.chld[1].bbox.y-a/2)-a/2,w:n.bbox.w,h:a},chld:[]};s.push(c)}else if(n.text=="\\sqrt"){const a=n.chld[0].bbox.y,c=Math.max(0,n.chld[0].bbox.x-n.chld[0].bbox.h/2),d={type:"symb",mode:n.mode,text:"\\sqrt",bbox:{x:i+c,y:r+a/2,w:n.chld[0].bbox.x-c,h:n.bbox.h-a/2},chld:[]};s.push(d),s.push({type:"symb",text:"\\bar",mode:n.mode,bbox:{x:i+n.chld[0].bbox.x,y:r,w:n.bbox.w-n.chld[0].bbox.x,h:a},chld:[]})}else if(n.text=="\\binom"){const a=Math.min(n.chld[0].bbox.x,n.chld[1].bbox.x),c={type:"symb",mode:n.mode,text:"(",bbox:{x:i,y:r,w:a,h:n.bbox.h},chld:[]};s.push(c),s.push({type:"symb",text:")",mode:n.mode,bbox:{x:i+n.bbox.w-a,y:r,w:a,h:n.bbox.h},chld:[]})}else if(gt[n.text]&&gt[n.text].flags.hat){const a=n.chld[0].bbox.y,c={type:"symb",mode:n.mode,text:n.text,bbox:{x:i,y:r,w:n.bbox.w,h:a},chld:[]};s.push(c)}else if(gt[n.text]&&gt[n.text].flags.mat){const a=n.chld[0].bbox.h,c={type:"symb",text:n.text,mode:n.mode,bbox:{x:i,y:r+a,w:n.bbox.w,h:n.bbox.h-a},chld:[]};s.push(c)}else if(n.type!="node"&&n.text!="^"&&n.text!="_"){const a={type:n.type=="func"?"symb":n.type,text:n.text,mode:n.mode,bbox:{x:i,y:r,w:n.bbox.w,h:n.bbox.h},chld:[]};s.push(a)}}for(let a=0;a<n.chld.length;a++){const c=t(n.chld[a],i,r);s.push(...c)}return s}const e=t(o,-o.bbox.x,-o.bbox.y);o.type="node",o.text="",o.chld=e}function Il(o){const t=[];for(let e=0;e<o.chld.length;e++){const n=o.chld[e];let i=n.bbox.h/2,r=!1;if(gt[n.text]&&gt[n.text].flags.hat&&!gt[n.text].flags.xfl&&!gt[n.text].flags.yfl&&(i*=4,r=!0),gt[n.text]&&gt[n.text].glyph){const s=tn(gt[n.text].glyph);for(let a=0;a<s.polylines.length;a++){const c=[];for(let d=0;d<s.polylines[a].length;d++){let R=s.polylines[a][d][0],u=s.polylines[a][d][1];if(gt[n.text].flags.xfl)R=(R-s.xmin)/Math.max(s.xmax-s.xmin,1)*n.bbox.w,R+=n.bbox.x;else if(s.w/16*i>n.bbox.w)R=R/Math.max(s.w,1)*n.bbox.w,R+=n.bbox.x;else{R=R/16*i;const h=(n.bbox.w-s.w/16*i)/2;R+=n.bbox.x+h}if(gt[n.text].flags.yfl)u=(u-s.ymin)/Math.max(s.ymax-s.ymin,1)*n.bbox.h,u+=n.bbox.y;else{if(u=u/16*i,r){const h=(s.ymax+s.ymin)/2;u-=h/16*i}u+=n.bbox.y+n.bbox.h/2}c.push([R,u])}t.push(c)}}else if(gt[n.text]&&gt[n.text].flags.txt||n.type=="char"){let s=n.bbox.x;const a=!!(gt[n.text]&&gt[n.text].flags.txt);for(let c=Number(a);c<n.text.length;c++){const d=tn(Kn(n.text[c],a?"text":n.mode));if(!d){console.warn("unmapped character: "+n.text[c]);continue}for(let R=0;R<d.polylines.length;R++){const u=[];for(let h=0;h<d.polylines[R].length;h++){let g=d.polylines[R][h][0],f=d.polylines[R][h][1];g/=16,f/=16,g*=i,f*=i,n.mode=="tt"&&(d.w>16?g*=16/d.w:g+=(16-d.w)/2/16),g+=s,f+=n.bbox.y+n.bbox.h/2,u.push([g,f])}t.push(u)}n.mode=="tt"?s+=i:s+=d.w/16*i}}}return t}function ge(o){return Math.round(o*100)/100}class Pl{_latex;_tree;_tokens;_polylines;constructor(t){this._latex=t,this._tokens=fl(t),this._tree=Vo(this._tokens),_i(this._tree.chld),he(this._tree),Ll(this._tree),this._polylines=Il(this._tree)}resolveScale(t){if(t==null)return[16,16,16,16];let e=t.SCALE_X??16,n=t.SCALE_Y??16;if(t.MIN_CHAR_H!=null){let s=0;for(let c=0;c<this._tree.chld.length;c++){const d=this._tree.chld[c];(d.type=="char"||gt[d.text]&&(gt[d.text].flags.txt||!Object.keys(gt[d.text].flags).length))&&(s=Math.min(d.bbox.h,s))}const a=Math.max(1,t.MIN_CHAR_H/s);e*=a,n*=a}if(t.MAX_W!=null){const s=e;e=Math.min(e,t.MAX_W/this._tree.bbox.w),n*=e/s}if(t.MAX_H!=null){const s=n;n=Math.min(n,t.MAX_H/this._tree.bbox.h),e*=n/s}const i=t.MARGIN_X??e,r=t.MARGIN_Y??n;return[i,r,e,n]}polylines(t){t||(t={});const e=[],[n,i,r,s]=this.resolveScale(t);for(let a=0;a<this._polylines.length;a++){e.push([]);for(let c=0;c<this._polylines[a].length;c++){const[d,R]=this._polylines[a][c];e[e.length-1].push([n+d*r,i+R*s])}}return e}pathd(t){t||(t={});let e="";const[n,i,r,s]=this.resolveScale(t);for(let a=0;a<this._polylines.length;a++)for(let c=0;c<this._polylines[a].length;c++){const[d,R]=this._polylines[a][c];e+=c?"L":"M",e+=`${ge(n+d*r)} ${ge(i+R*s)}`}return e}svg(t){t||(t={});const[e,n,i,r]=this.resolveScale(t),s=ge(this._tree.bbox.w*i+e*2),a=ge(this._tree.bbox.h*r+n*2);let c=`<svg
14
14
  xmlns="http://www.w3.org/2000/svg"
15
15
  width="${s}" height="${a}"
16
16
  fill="none" stroke="${t.FG_COLOR??"black"}" stroke-width="${t.STROKE_W??1}"
17
17
  stroke-linecap="round" stroke-linejoin="round"
18
- >`;t.BG_COLOR&&(c+=`<rect x="0" y="0" width="${s}" height="${a}" fill="${t.BG_COLOR}" stroke="none"></rect>`),c+='<path d="';for(let d=0;d<this._polylines.length;d++){c+="M";for(let R=0;R<this._polylines[d].length;R++){const[u,h]=this._polylines[d][R];c+=he(e+u*i)+" "+he(n+h*r)+" "}}return c+='"/>',c+="</svg>",{svg:`data:image/svg+xml;base64,${window.btoa(c)}`,width:Math.ceil(s),height:Math.ceil(a)}}pdf(t){t||(t={});const[e,n,i,r]=this.resolveScale(t),s=he(this._tree.bbox.w*i+e*2),a=he(this._tree.bbox.h*r+n*2);let c=`%PDF-1.1
18
+ >`;t.BG_COLOR&&(c+=`<rect x="0" y="0" width="${s}" height="${a}" fill="${t.BG_COLOR}" stroke="none"></rect>`),c+='<path d="';for(let d=0;d<this._polylines.length;d++){c+="M";for(let R=0;R<this._polylines[d].length;R++){const[u,h]=this._polylines[d][R];c+=ge(e+u*i)+" "+ge(n+h*r)+" "}}return c+='"/>',c+="</svg>",{svg:`data:image/svg+xml;base64,${window.btoa(c)}`,width:Math.ceil(s),height:Math.ceil(a)}}pdf(t){t||(t={});const[e,n,i,r]=this.resolveScale(t),s=ge(this._tree.bbox.w*i+e*2),a=ge(this._tree.bbox.h*r+n*2);let c=`%PDF-1.1
19
19
  %%¥±ë
20
20
  1 0 obj
21
21
  << /Type /Catalog
@@ -44,7 +44,7 @@ endobj
44
44
  << /Length 0 >>
45
45
  stream
46
46
  1 j 1 J ${t.STROKE_W??1} w
47
- `;for(let h=0;h<this._polylines[u].length;h++){const[g,f]=this._polylines[u][h];d+=`${he(e+g*i)} ${he(a-(n+f*r))} ${h?"l":"m"} `}d+=`
47
+ `;for(let h=0;h<this._polylines[u].length;h++){const[g,f]=this._polylines[u][h];d+=`${ge(e+g*i)} ${ge(a-(n+f*r))} ${h?"l":"m"} `}d+=`
48
48
  S
49
49
  endstream
50
50
  endobj
@@ -58,54 +58,54 @@ trailer
58
58
  >>startxref
59
59
 
60
60
  %%EOF
61
- `,c+d}boxes(t){t||(t={});const[e,n,i,r]=this.resolveScale(t),s=[];for(let a=0;a<this._tree.chld.length;a++){const{x:c,y:d,w:R,h:u}=this._tree.chld[a].bbox;s.push({x:e+c*i,y:n+d*r,w:R*i,h:u*r})}return s}box(t){t||(t={});const[e,n,i,r]=this.resolveScale(t);return{x:e+this._tree.bbox.x*i,y:n+this._tree.bbox.y*r,w:this._tree.bbox.w*i,h:this._tree.bbox.h*r}}}class Hi extends Qi{static convertLaTextToSVG(t){return new pl(t).svg({SCALE_X:10,SCALE_Y:10,MARGIN_X:0,MARGIN_Y:0})}render(t,e,n,i){const{scale:r}=this.options,s=e.width*r,a=e.height*r;if(this.imageCache.has(e.value)){const c=this.imageCache.get(e.value);t.drawImage(c,n,i,s,a)}else{const c=new Promise((d,R)=>{const u=new Image;u.src=e.laTexSVG,u.onload=()=>{t.drawImage(u,n,i,s,a),this.imageCache.set(e.value,u),d(e)},u.onerror=h=>{R(h)}});this.addImageObserver(c)}}}l.ListType=void 0,(function(o){o.UL="ul",o.OL="ol"})(l.ListType||(l.ListType={}));var He;(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.CHECKBOX="checkbox"})(He||(He={}));var _i;(function(o){o.DECIMAL="decimal"})(_i||(_i={})),l.ListStyle=void 0,(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.DECIMAL="decimal",o.CHECKBOX="checkbox"})(l.ListStyle||(l.ListStyle={}));const Ll={inheritStyle:!1},Wo={[He.DISC]:"•",[He.CIRCLE]:"◦",[He.SQUARE]:"▫︎",[He.CHECKBOX]:"☑️"},Il={[l.ListType.OL]:"ol",[l.ListType.UL]:"ul"},Pl={[l.ListStyle.DISC]:"disc",[l.ListStyle.CIRCLE]:"circle",[l.ListStyle.SQUARE]:"square",[l.ListStyle.DECIMAL]:"decimal",[l.ListStyle.CHECKBOX]:"checkbox"};l.TitleLevel=void 0,(function(o){o.FIRST="first",o.SECOND="second",o.THIRD="third",o.FOURTH="fourth",o.FIFTH="fifth",o.SIXTH="sixth"})(l.TitleLevel||(l.TitleLevel={}));const Ml={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},xi={[l.TitleLevel.FIRST]:"defaultFirstSize",[l.TitleLevel.SECOND]:"defaultSecondSize",[l.TitleLevel.THIRD]:"defaultThirdSize",[l.TitleLevel.FOURTH]:"defaultFourthSize",[l.TitleLevel.FIFTH]:"defaultFifthSize",[l.TitleLevel.SIXTH]:"defaultSixthSize"},bo={[l.TitleLevel.FIRST]:1,[l.TitleLevel.SECOND]:2,[l.TitleLevel.THIRD]:3,[l.TitleLevel.FOURTH]:4,[l.TitleLevel.FIFTH]:5,[l.TitleLevel.SIXTH]:6},Ol={H1:l.TitleLevel.FIRST,H2:l.TitleLevel.SECOND,H3:l.TitleLevel.THIRD,H4:l.TitleLevel.FOURTH,H5:l.TitleLevel.FIFTH,H6:l.TitleLevel.SIXTH};l.BlockType=void 0,(function(o){o.IFRAME="iframe",o.VIDEO="video"})(l.BlockType||(l.BlockType={})),l.ControlType=void 0,(function(o){o.TEXT="text",o.SELECT="select",o.CHECKBOX="checkbox",o.RADIO="radio",o.DATE="date",o.NUMBER="number",o.TEXTFIELD="TextField",o.BUTTON="button",o.MENSTRUAL_HISTORY="menstrualHistory"})(l.ControlType||(l.ControlType={})),l.ControlComponent=void 0,(function(o){o.PREFIX="prefix",o.POSTFIX="postfix",o.PRE_TEXT="preText",o.PRETEXTFIX="preTextFix",o.PRETEXTFIX_TEXT="preTextFixText",o.POSTTEXTFIX="postTextFix",o.POSTTEXTFIX_TEXT="postTextFixText",o.POST_TEXT="postText",o.PLACEHOLDER="placeholder",o.TEXTFIXLABEL="textFixLabel",o.VALUE="value",o.DELETEPERSON="deletePerson",o.CHECKBOX="checkbox",o.RADIO="radio",o.UNDERLINE="underline"})(l.ControlComponent||(l.ControlComponent={})),l.ControlIndentation=void 0,(function(o){o.ROW_START="rowStart",o.VALUE_START="valueStart"})(l.ControlIndentation||(l.ControlIndentation={})),l.ControlState=void 0,(function(o){o.ACTIVE="active",o.INACTIVE="inactive"})(l.ControlState||(l.ControlState={}));var Gi;(function(o){o.NUMBER="number",o.OPERATOR="operator",o.UTILITY="utility",o.EQUAL="equal"})(Gi||(Gi={})),l.EditorComponent=void 0,(function(o){o.COMPONENT="component",o.MENU="menu",o.MAIN="main",o.FOOTER="footer",o.CONTEXTMENU="contextmenu",o.POPUP="popup",o.CATALOG="catalog",o.COMMENT="comment"})(l.EditorComponent||(l.EditorComponent={}));var ge;(function(o){o.PAGE="page",o.TABLE="table"})(ge||(ge={})),l.EditorMode=void 0,(function(o){o.EDIT="edit",o.CLEAN="clean",o.READONLY="readonly",o.FORM="form",o.PRINT="print",o.DESIGN="design",o.GRAFFITI="graffiti"})(l.EditorMode||(l.EditorMode={})),l.EditorZone=void 0,(function(o){o.HEADER="header",o.MAIN="main",o.FOOTER="footer"})(l.EditorZone||(l.EditorZone={})),l.PageMode=void 0,(function(o){o.PAGING="paging",o.CONTINUITY="continuity"})(l.PageMode||(l.PageMode={})),l.PaperDirection=void 0,(function(o){o.VERTICAL="vertical",o.HORIZONTAL="horizontal"})(l.PaperDirection||(l.PaperDirection={})),l.WordBreak=void 0,(function(o){o.BREAK_ALL="break-all",o.BREAK_WORD="break-word"})(l.WordBreak||(l.WordBreak={})),l.RenderMode=void 0,(function(o){o.SPEED="speed",o.COMPATIBILITY="compatibility"})(l.RenderMode||(l.RenderMode={})),l.TableBorder=void 0,(function(o){o.ALL="all",o.EMPTY="empty",o.EXTERNAL="external",o.INTERNAL="internal",o.DASH="dash"})(l.TableBorder||(l.TableBorder={})),l.TdBorder=void 0,(function(o){o.TOP="top",o.RIGHT="right",o.BOTTOM="bottom",o.LEFT="left"})(l.TdBorder||(l.TdBorder={})),l.TdSlash=void 0,(function(o){o.FORWARD="forward",o.BACK="back"})(l.TdSlash||(l.TdSlash={})),l.BackgroundSize=void 0,(function(o){o.CONTAIN="contain",o.COVER="cover"})(l.BackgroundSize||(l.BackgroundSize={})),l.BackgroundRepeat=void 0,(function(o){o.REPEAT="repeat",o.NO_REPEAT="no-repeat",o.REPEAT_X="repeat-x",o.REPEAT_Y="repeat-y"})(l.BackgroundRepeat||(l.BackgroundRepeat={}));const Cl={color:"#FFFFFF",image:"",size:l.BackgroundSize.COVER,repeat:l.BackgroundRepeat.NO_REPEAT,applyPageNumbers:[]};l.VerticalAlign=void 0,(function(o){o.TOP="top",o.MIDDLE="middle",o.BOTTOM="bottom"})(l.VerticalAlign||(l.VerticalAlign={}));const Sl={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:l.VerticalAlign.BOTTOM},El={placeholderColor:"#9c9b9b",bracketColor:"#2284FE",textFixColor:"blue",prefix:"[",postfix:"]",preTextFix:"{",postTextFix:"}",textFixLabel:"",preTextFixText:"",postTextFixText:"",borderWidth:1,borderColor:"#000000",activeBackgroundColor:"",disabledBackgroundColor:"",existValueBackgroundColor:"",noValueBackgroundColor:""},Xl={bottom:30,inactiveAlpha:1,maxHeightRadio:l.MaxHeightRatio.HALF,disabled:!1,editable:!0},Nl={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1,deletable:!0},Fl={top:30,inactiveAlpha:1,maxHeightRadio:l.MaxHeightRatio.HALF,disabled:!1,editable:!0},yl={defaultColor:"#1976d2",defaultBackgroundColor:"#e3f2fd",defaultBorderRadius:4,defaultPadding:[4,4,4,4]},Wl={color:"#666666",font:"Microsoft YaHei",size:12,top:5},bl={disabled:!0,color:"#CCCCCC",lineWidth:1.5},Vl={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},pn={PAGE_NO:"{pageNo}",PAGE_COUNT:"{pageCount}"},Yl={bottom:60,size:12,font:"Microsoft YaHei",color:"#000000",rowFlex:l.RowFlex.CENTER,format:pn.PAGE_NO,numberType:l.NumberType.ARABIC,disabled:!1,startPageNo:1,fromPageNo:0,maxPageNo:null},Ai={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},Dl={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:l.VerticalAlign.BOTTOM},Ul={lineWidth:1,strokeStyle:"#000000"},wl={tdPadding:[5,5,5,5],defaultTrMinHeight:24,defaultColMinWidth:40,defaultBorderColor:"#000000",overflow:!0};l.WatermarkType=void 0,(function(o){o.TEXT="text",o.IMAGE="image"})(l.WatermarkType||(l.WatermarkType={}));const Vo={data:"",type:l.WatermarkType.TEXT,width:0,height:0,color:"#AEB5C0",opacity:.3,size:200,font:"Microsoft YaHei",repeat:!1,gap:[10,10],numberType:l.NumberType.ARABIC},Zl={tipDisabled:!0};l.LineNumberType=void 0,(function(o){o.PAGE="page",o.CONTINUITY="continuity"})(l.LineNumberType||(l.LineNumberType={}));const Ql={size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:l.LineNumberType.CONTINUITY},vl={color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0},Kl={top:0,left:5},Hl={defaultLineColor:"#000000",defaultLineWidth:2},_l={disabled:!0,color:"#CCCCCC",radius:1};function Yo(o={}){const t={...wl,...o.table},e={...Fl,...o.header},n={...Xl,...o.footer},i={...Yl,...o.pageNumber},r={...Vo,...o.watermark},s={...El,...o.control},a={...Sl,...o.checkbox},c={...Dl,...o.radio},d={...qr,...o.cursor},R={...Ml,...o.title},u={...Ai,...o.placeholder},h={...Nl,...o.group},g={...Vl,...o.pageBreak},f={...Zl,...o.zone},T={...Cl,...o.background},p={...bl,...o.lineBreak},m={..._l,...o.whiteSpace},I={...Ul,...o.separator},L={...Ql,...o.lineNumber},P={...vl,...o.pageBorder},O={...Kl,...o.badge},S={...Hl,...o.graffiti},F={...yl,...o.label},N={...Wl,...o.imgCaption},V={...Ll,...o.list},Y={print:{...So.print,...o.modeRule?.print},readonly:{...So.readonly,...o.modeRule?.readonly},form:{...So.form,...o.modeRule?.form}};return{mode:l.EditorMode.EDIT,locale:"zhCN",defaultType:"TEXT",defaultColor:"#000000",defaultFont:"SimSun",defaultSize:16,minSize:5,maxSize:72,defaultRowMargin:1,defaultBasicRowMarginHeight:8,defaultTabWidth:32,width:794,height:1123,scale:1,pageGap:20,underlineColor:"#000000",strikeoutColor:"#FF0000",rangeAlpha:.6,rangeColor:"#AECBFA",rangeMinWidth:5,searchMatchAlpha:.6,searchMatchColor:"#FFFF00",searchNavigateMatchColor:"#AAD280",highlightAlpha:.6,highlightMarginHeight:8,resizerColor:"#4182D9",resizerSize:5,marginIndicatorSize:35,marginIndicatorColor:"#BABABA",margins:[75.591,56.693,56.693,56.693],pageMode:l.PageMode.PAGING,renderMode:l.RenderMode.SPEED,defaultHyperlinkColor:"#0000FF",paperDirection:l.PaperDirection.VERTICAL,inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:l.WordBreak.BREAK_WORD,printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:[To.ENGLISH,To.NUMBER],contextMenuDisableKeys:[],shortcutDisableKeys:[],scrollContainerSelector:"",pageOuterSelectionDisable:!1,...o,table:t,header:e,footer:n,pageNumber:i,watermark:r,control:s,checkbox:a,radio:c,cursor:d,title:R,placeholder:u,group:h,pageBreak:g,zone:f,background:T,lineBreak:p,whiteSpace:m,separator:I,lineNumber:L,pageBorder:P,badge:O,modeRule:Y,graffiti:S,label:F,imgCaption:N,list:V,performance:{enabled:!1,threshold:16,...o.performance}}}const ki=new Map;function xl(o){return ki.get(o)}function Qn(o,t){ki.set(o,t)}function Do(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e],i=ct(n.value);for(let r=0;r<i.length;r++)t.push({...n,value:i[r]})}return t}function Vt(o,t){const{isHandleFirstElement:e=!0,isForceCompensation:n=!1,editorOptions:i}=t,r=o[0];(n||e&&r?.type!==l.ElementType.LIST&&(r?.type&&r.type!==l.ElementType.TEXT||!po.test(r?.value)))&&o.unshift({value:_});let s=0;for(;s<o.length;){let a=o[s];if(a.type===l.ElementType.TITLE){o.splice(s,1);const c=a.valueList||[];if(Vt(c,{...t,isHandleFirstElement:!1,isForceCompensation:!1}),c.length){const d=a.titleId||lt(),R=i.title;for(let u=0;u<c.length;u++){const h=c[u];h.title=a.title,a.level&&(h.titleId=d,h.level=a.level),vn(h)&&(h.size||(h.size=R[xi[h.level]]),h.bold===void 0&&(h.bold=!0)),o.splice(s,0,h),s++}}s--}else if(a.type===l.ElementType.LIST){o.splice(s,1);const c=a.valueList||[];if(Vt(c,{...t,isHandleFirstElement:!0,isForceCompensation:!1}),c.length){const d=lt();for(let R=0;R<c.length;R++){const u=c[R];u.listId=d,u.listType=a.listType,u.listStyle=a.listStyle,o.splice(s,0,u),s++}}s--}else if(a.type===l.ElementType.AREA){o.splice(s,1);const c=a?.valueList||[];if(Vt(c,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),c.length){const d=lt();for(let R=0;R<c.length;R++){const u=c[R];if(u.areaId=a.areaId||d,u.area=a.area,u.areaIndex=R,u.type===l.ElementType.TABLE){const h=u.trList;for(let g=0;g<h.length;g++){const f=h[g];for(let T=0;T<f.tdList.length;T++){const m=f.tdList[T].value;for(let I=0;I<m.length;I++){const L=m[I];L.areaId=a.areaId||d,L.area=a.area}}}}o.splice(s,0,u),s++}}s--}else if(a.type===l.ElementType.TABLE){const c=a.id||lt();if(a.id=c,a.trList){const{defaultTrMinHeight:d}=i.table;for(let R=0;R<a.trList.length;R++){const u=a.trList[R],h=u.id||lt();u.id=h,(!u.minHeight||u.minHeight<d)&&(u.minHeight=d),u.height<u.minHeight&&(u.height=u.minHeight);for(let g=0;g<u.tdList.length;g++){const f=u.tdList[g],T=f.id||lt();f.id=T,Vt(f.value,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),!f.value[0].size&&f.value[1]?.size&&vn(f.value[1])&&(f.value[0].size=f.value[1].size);for(let p=0;p<f.value.length;p++){const m=f.value[p];m.tdId=T,m.trId=h,m.tableId=c}}}}}else if(a.type===l.ElementType.HYPERLINK){o.splice(s,1);const c=Do(a.valueList||[]);if(c.length){const d=lt();for(let R=0;R<c.length;R++){const u=c[R];u.type=a.type,u.url=a.url,u.hyperlinkId=d,o.splice(s,0,u),s++}}s--}else if(a.type===l.ElementType.DATE){o.splice(s,1);const c=Do(a.valueList||[]);if(c.length){const d=lt();for(let R=0;R<c.length;R++){const u=c[R];u.type=a.type,u.dateFormat=a.dateFormat,u.dateId=d,o.splice(s,0,u),s++}}s--}else if(a.type===l.ElementType.CONTROL){if(!a.control){s++;continue}if(a.control.type=="TextField"){const{preTextFix:c,postTextFix:d,preTextFixText:R,postTextFixText:u,value:h,placeholder:g,code:f,type:T,valueSets:p}=a.control,m=T,{editorOptions:{control:I,checkbox:L,radio:P}}=t,O=a.controlId||lt();o.splice(s,1);const S=Dt(a,[...No,...Bt]),F=Dt(a.control,Gt),N={...F,color:i.control.textFixColor,fontWeight:"blod"},V={...F,color:void 0},Y=ct(c||I.preTextFix);for(let b=0;b<Y.length;b++){const E=Y[b];o.splice(s,0,{...S,...N,controlId:O,value:E,type:a.type,control:a.control,controlComponent:l.ControlComponent.PRETEXTFIX}),s++}if(R){const b=ct(R);for(let E=0;E<b.length;E++){const C=b[E];o.splice(s,0,{...S,...F,controlId:O,value:C,type:a.type,control:a.control,controlComponent:l.ControlComponent.PRETEXTFIX_TEXT}),s++}}if(h&&h.length||m===l.ControlType.CHECKBOX||m===l.ControlType.RADIO||m===l.ControlType.SELECT&&f&&(!h||!h.length)){let b=h?at(h):[];if(m===l.ControlType.CHECKBOX){const E=f?f.split(","):[];if(Array.isArray(p)&&p.length){const C=b.reduce((y,W)=>y.concat(W.value.split("").map(D=>({...W,value:D}))),[]);let M=0;for(let y=0;y<p.length;y++){const W=p[y];o.splice(s,0,{...S,...F,controlId:O,value:"",type:a.type,control:a.control,controlComponent:l.ControlComponent.CHECKBOX,checkbox:{code:W.code,value:E.includes(W.code)}}),s++;const D=ct(W.value);for(let U=0;U<D.length;U++){const Q=D[U],G=U===D.length-1;o.splice(s,0,{...S,...V,...C[M],controlId:O,value:Q===`
62
- `?_:Q,letterSpacing:G?L.gap:0,control:a.control,controlComponent:l.ControlComponent.VALUE}),M++,s++}}}}else if(m===l.ControlType.RADIO){if(Array.isArray(p)&&p.length){const E=b.reduce((M,y)=>M.concat(y.value.split("").map(W=>({...y,value:W}))),[]);let C=0;for(let M=0;M<p.length;M++){const y=p[M];o.splice(s,0,{...S,...F,controlId:O,value:"",type:a.type,control:a.control,controlComponent:l.ControlComponent.RADIO,radio:{code:y.code,value:f===y.code}}),s++;const W=ct(y.value);for(let D=0;D<W.length;D++){const U=W[D],Q=D===W.length-1;o.splice(s,0,{...S,...V,...E[C],controlId:O,value:U===`
63
- `?_:U,letterSpacing:Q?P.gap:0,control:a.control,controlComponent:l.ControlComponent.VALUE}),C++,s++}}}}else{if((!h||!h.length)&&Array.isArray(p)&&p.length){const E=f?f.split(",").map(C=>C.trim()).filter(C=>C):[];if(E.length>1){const C=[];for(const M of E){const y=p.find(W=>W.code===M);y&&C.push({value:y.value})}C.length>0&&(b=C)}else if(E.length===1){const C=p.find(M=>M.code===E[0]);C&&(b=[{value:C.value}])}}for(let E=0;E<b.length;E++){const C=b[E];if(C.type===l.ElementType.CONTROL&&C.control){const M=C,y=M.controlId||lt(),W=M.control?.value||[],D=M.control?.placeholder||"",U=M.control?.type,Q=U===l.ControlType.TEXTFIELD,G=U===l.ControlType.TEXT,H=U===l.ControlType.CHECKBOX,j=U===l.ControlType.RADIO,st=U===l.ControlType.BUTTON,it=Q?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,nt=Q?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX,et={...S,controlId:y,type:l.ElementType.CONTROL,control:M.control},dt=Q?i.control.textFixColor:G?"#87d068":st?"transparent":i.control.bracketColor,tt=st?"#1677FF":void 0,ht=Q?M.control?.preTextFix||I.preTextFix:M.control?.prefix||I.prefix,ut=ct(ht);for(let w=0;w<ut.length;w++)o.splice(s,0,{...et,color:dt,highlight:tt,originControlId:O,value:ut[w],controlComponent:it}),s++;if(st){const w=M.control.buttonLabel||M.control.label||"按钮",Z=ct(w);for(let J=0;J<Z.length;J++){const x=Z[J];o.splice(s,0,{...et,originControlId:O,value:x,controlComponent:l.ControlComponent.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if(H){const w=M.control?.valueSets||[],Z=M.control?.code||"",J=Z?Z.split(","):[];for(let x=0;x<w.length;x++){const A=w[x];o.splice(s,0,{...et,originControlId:O,value:"",controlComponent:l.ControlComponent.CHECKBOX,checkbox:{code:A.code,value:J.includes(A.code)}}),s++;const $=ct(A.value||"");for(let B=0;B<$.length;B++){const Ct=$[B],Xt=B===$.length-1;o.splice(s,0,{...et,...V,originControlId:O,value:Ct===`
64
- `?_:Ct,letterSpacing:Xt?L.gap:0,controlComponent:l.ControlComponent.VALUE}),s++}}}else if(j){const w=M.control?.valueSets||[],Z=M.control?.code||"";for(let J=0;J<w.length;J++){const x=w[J];o.splice(s,0,{...et,originControlId:O,value:"",controlComponent:l.ControlComponent.RADIO,radio:{code:x.code,value:Z===x.code}}),s++;const A=ct(x.value||"");for(let $=0;$<A.length;$++){const B=A[$],Ct=$===A.length-1;o.splice(s,0,{...et,...V,originControlId:O,value:B===`
65
- `?_:B,letterSpacing:Ct?P.gap:0,controlComponent:l.ControlComponent.VALUE}),s++}}}else if(W.length>0)for(let w=0;w<W.length;w++){const Z=W[w];if(Z.type===l.ElementType.CONTROL&&Z.control){const J=Z,x=J.controlId||lt(),A=J.control?.value||[],$=J.control?.type===l.ControlType.TEXTFIELD,B=J.control?.type===l.ControlType.TEXT,Ct={...et,controlId:x,control:J.control},Xt=$?i.control.textFixColor:B?"#87d068":i.control.bracketColor,pt=$?J.control?.preTextFix||I.preTextFix:J.control?.prefix||I.prefix,yt=ct(pt);for(let Tt=0;Tt<yt.length;Tt++)o.splice(s,0,{...Ct,color:Xt,originControlId:y,value:yt[Tt],controlComponent:$?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX}),s++;for(let Tt=0;Tt<A.length;Tt++){const It=A[Tt];if(It.type===l.ElementType.MENSTRUAL_HISTORY||It.type===l.ElementType.FETAL_HEART_POSITION||It.type===l.ElementType.TOOTH_POSITION||It.type===l.ElementType.MACRO||It.type===l.ElementType.CUSTOM_MACRO||It.type===l.ElementType.REUSABLE_ITEM||It.type===l.ElementType.LIST||It.type===l.ElementType.SPECIAL_SYMBOLS){const Qt=It.id||lt();It.id||(It.id=Qt);const be=J.control?.value?.find(jt=>jt.id===Qt||jt.type===It.type&&jt.value===It.value);be&&Qn(Qt,be),o.splice(s,0,{...Ct,...It,id:Qt,originControlId:y,controlComponent:l.ControlComponent.VALUE,type:It.type})}else o.splice(s,0,{...Ct,...V,...It,originControlId:y,value:It.value===`
66
- `?_:It.value,controlComponent:l.ControlComponent.VALUE});s++}if(A.length===0){const Tt=J.control?.placeholder||"";if(Tt){const It=ct(Tt);for(let Kt=0;Kt<It.length;Kt++)o.splice(s,0,{...Ct,color:i.control.placeholderColor,originControlId:y,value:It[Kt],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}}const Yt=$?J.control?.postTextFix||I.postTextFix:J.control?.postfix||I.postfix,St=ct(Yt);for(let Tt=0;Tt<St.length;Tt++)o.splice(s,0,{...Ct,color:Xt,originControlId:y,value:St[Tt],controlComponent:$?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX}),s++}else{if(Z.type===l.ElementType.MENSTRUAL_HISTORY||Z.type===l.ElementType.FETAL_HEART_POSITION||Z.type===l.ElementType.TOOTH_POSITION||Z.type===l.ElementType.MACRO||Z.type===l.ElementType.CUSTOM_MACRO||Z.type===l.ElementType.REUSABLE_ITEM||Z.type===l.ElementType.LIST||Z.type===l.ElementType.SPECIAL_SYMBOLS){const x=Z.id||lt();Z.id||(Z.id=x);const A=M.control?.value?.find($=>$.id===x||$.type===Z.type&&$.value===Z.value);A&&Qn(x,A),o.splice(s,0,{...et,...Z,id:x,originControlId:O,controlComponent:l.ControlComponent.VALUE,type:Z.type})}else o.splice(s,0,{...et,...V,...Z,originControlId:O,value:Z.value===`
67
- `?_:Z.value,controlComponent:l.ControlComponent.VALUE});s++}}else if(D){const w=ct(D);for(let Z=0;Z<w.length;Z++)o.splice(s,0,{...et,color:i.control.placeholderColor,originControlId:O,value:w[Z],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}else if((U===l.ControlType.SELECT||U===l.ControlType.DATE||U===l.ControlType.NUMBER)&&!M.control?.code&&D){const Z=ct(D);for(let J=0;J<Z.length;J++)o.splice(s,0,{...et,color:i.control.placeholderColor,originControlId:O,value:Z[J],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}const v=Q?M.control?.postTextFix||I.postTextFix:M.control?.postfix||I.postfix,K=ct(v);for(let w=0;w<K.length;w++)o.splice(s,0,{...et,color:dt,highlight:tt,originControlId:O,value:K[w],controlComponent:nt}),s++}else if(C.type===l.ElementType.MENSTRUAL_HISTORY||C.type===l.ElementType.FETAL_HEART_POSITION||C.type===l.ElementType.TOOTH_POSITION||C.type===l.ElementType.MACRO||C.type===l.ElementType.CUSTOM_MACRO||C.type===l.ElementType.REUSABLE_ITEM||C.type===l.ElementType.LIST||C.type===l.ElementType.SPECIAL_SYMBOLS){const M=C.id||lt();C.id||(C.id=M);const y=h?.find(W=>W.id===M||W.type===C.type&&W.value===C.value);y&&Qn(M,y),o.splice(s,0,{...S,...C,id:M,controlId:O,control:a.control,controlComponent:l.ControlComponent.VALUE,type:C.type}),s++}else{const M=ct(C.value||"");for(let y=0;y<M.length;y++){const W=M[y];o.splice(s,0,{...S,...V,...C,controlId:O,value:W===`
68
- `?_:W,type:C.type||l.ElementType.TEXT,control:a.control,controlComponent:l.ControlComponent.VALUE}),s++}}}}}else if(g){const b={...F,color:i.control.placeholderColor},E=ct(g);for(let C=0;C<E.length;C++){const M=E[C];o.splice(s,0,{...S,...b,controlId:O,value:M===`
69
- `?_:M,type:a.type,control:a.control,controlComponent:l.ControlComponent.PLACEHOLDER}),s++}}if(u){const b=ct(u);for(let E=0;E<b.length;E++){const C=b[E];o.splice(s,0,{...S,...F,controlId:O,value:C,type:a.type,control:a.control,controlComponent:l.ControlComponent.POSTTEXTFIX_TEXT}),s++}}const X=ct(d||I.postTextFix);for(let b=0;b<X.length;b++){const E=X[b];o.splice(s,0,{...S,...N,controlId:O,value:E,type:a.type,control:a.control,controlComponent:l.ControlComponent.POSTTEXTFIX}),s++}s--}else{const{prefix:c,postfix:d,preText:R,postText:u,value:h,placeholder:g,code:f,type:T,valueSets:p}=a.control,{editorOptions:{control:m,checkbox:I,radio:L}}=t,P=a.controlId||lt();o.splice(s,1);const O=Dt(a,[...No,...Bt]),S=Dt(a.control,Gt),F={...S,color:T===l.ControlType.TEXT?"#87d068":T===l.ControlType.BUTTON?"transparent":i.control.bracketColor,highlight:T===l.ControlType.BUTTON?"#1677FF":void 0},N={...S,color:void 0},V=ct(c||m.prefix);for(let X=0;X<V.length;X++){const b=V[X];o.splice(s,0,{...O,...F,controlId:P,value:b===`
70
- `?_:b,type:a.type,control:a.control,controlComponent:l.ControlComponent.PREFIX}),s++}if(R){const X=ct(R);for(let b=0;b<X.length;b++){const E=X[b];o.splice(s,0,{...O,...S,controlId:P,value:E,type:a.type,control:a.control,controlComponent:l.ControlComponent.PRE_TEXT}),s++}}if(h&&h.length||T===l.ControlType.CHECKBOX||T===l.ControlType.RADIO||T===l.ControlType.BUTTON||T===l.ControlType.SELECT&&f&&(!h||!h.length)){let X=h?at(h):[];if(T===l.ControlType.CHECKBOX){const b=f?f.split(","):[];if(Array.isArray(p)&&p.length){const E=X.reduce((M,y)=>M.concat(y.value.split("").map(W=>({...y,value:W}))),[]);let C=0;for(let M=0;M<p.length;M++){const y=p[M];o.splice(s,0,{...O,...S,controlId:P,value:"",type:a.type,control:a.control,controlComponent:l.ControlComponent.CHECKBOX,checkbox:{code:y.code,value:b.includes(y.code)}}),s++;const W=ct(y.value);for(let D=0;D<W.length;D++){const U=W[D],Q=D===W.length-1;o.splice(s,0,{...O,...N,...E[C],controlId:P,value:U===`
71
- `?_:U,letterSpacing:Q?I.gap:0,control:a.control,controlComponent:l.ControlComponent.VALUE}),C++,s++}}}}else if(T===l.ControlType.RADIO){if(Array.isArray(p)&&p.length){const b=X.reduce((C,M)=>C.concat(M.value.split("").map(y=>({...M,value:y}))),[]);let E=0;for(let C=0;C<p.length;C++){const M=p[C];o.splice(s,0,{...O,...S,controlId:P,value:"",type:a.type,control:a.control,controlComponent:l.ControlComponent.RADIO,radio:{code:M.code,value:f===M.code}}),s++;const y=ct(M.value);for(let W=0;W<y.length;W++){const D=y[W],U=W===y.length-1;o.splice(s,0,{...O,...N,...b[E],controlId:P,value:D===`
72
- `?_:D,letterSpacing:U?L.gap:0,control:a.control,controlComponent:l.ControlComponent.VALUE}),E++,s++}}}}else{if(T===l.ControlType.BUTTON){const b=a.control.buttonLabel||a.control.label||"按钮",E=ct(b);for(let C=0;C<E.length;C++){const M=E[C];o.splice(s,0,{...O,...S,controlId:P,value:M,type:l.ElementType.CONTROL,control:a.control,controlComponent:l.ControlComponent.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if((!h||!h.length)&&Array.isArray(p)&&p.length){const b=f?f.split(","):[];if(b.length>1){const E=[];for(const C of b){const M=p.find(y=>y.code===C.trim());M&&E.push({value:M.value})}E.length>0&&(X=E)}else{const E=p.find(C=>C.code===f);E&&(X=[{value:E.value}])}}if(T!==l.ControlType.BUTTON)for(let b=0;b<X.length;b++){const E=X[b];if(E.type===l.ElementType.CONTROL&&E.control){const C=E,M=C.controlId||lt(),y=C.control?.value||[],W=C.control?.placeholder||"",D=C.control?.type,U=D===l.ControlType.TEXTFIELD,Q=D===l.ControlType.TEXT,G=D===l.ControlType.CHECKBOX,H=D===l.ControlType.RADIO,j=D===l.ControlType.BUTTON,st=U?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,it=U?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX,nt={...O,controlId:M,type:l.ElementType.CONTROL,control:C.control},et=U?i.control.textFixColor:Q?"#87d068":j?"transparent":i.control.bracketColor,dt=j?"#1677FF":void 0,tt=U?C.control?.preTextFix||m.preTextFix:C.control?.prefix||m.prefix,ht=ct(tt);for(let K=0;K<ht.length;K++)o.splice(s,0,{...nt,color:et,highlight:dt,originControlId:P,value:ht[K],controlComponent:st}),s++;if(j){const K=C.control.buttonLabel||C.control.label||"按钮",w=ct(K);for(let Z=0;Z<w.length;Z++){const J=w[Z];o.splice(s,0,{...nt,originControlId:P,value:J,controlComponent:l.ControlComponent.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if(G){const K=C.control?.valueSets||[],w=C.control?.code||"",Z=w?w.split(","):[];for(let J=0;J<K.length;J++){const x=K[J];o.splice(s,0,{...nt,...S,originControlId:P,value:"",controlComponent:l.ControlComponent.CHECKBOX,checkbox:{code:x.code,value:Z.includes(x.code)}}),s++;const A=ct(x.value||"");for(let $=0;$<A.length;$++){const B=A[$],Ct=$===A.length-1;o.splice(s,0,{...nt,...N,originControlId:P,value:B===`
73
- `?_:B,letterSpacing:Ct?I.gap:0,controlComponent:l.ControlComponent.VALUE}),s++}}}else if(H){const K=C.control?.valueSets||[],w=C.control?.code||"";for(let Z=0;Z<K.length;Z++){const J=K[Z];o.splice(s,0,{...nt,...S,originControlId:P,value:"",controlComponent:l.ControlComponent.RADIO,radio:{code:J.code,value:w===J.code}}),s++;const x=ct(J.value||"");for(let A=0;A<x.length;A++){const $=x[A],B=A===x.length-1;o.splice(s,0,{...nt,...N,originControlId:P,value:$===`
74
- `?_:$,letterSpacing:B?L.gap:0,controlComponent:l.ControlComponent.VALUE}),s++}}}else if(y.length>0)for(let K=0;K<y.length;K++){const w=y[K];if(w.type===l.ElementType.CONTROL&&w.control){const Z=w,J=Z.controlId||lt(),x=Z.control?.value||[],A=Z.control?.type===l.ControlType.TEXTFIELD,$=Z.control?.type===l.ControlType.TEXT,B={...nt,controlId:J,control:Z.control},Ct=A?i.control.textFixColor:$?"#87d068":i.control.bracketColor,Xt=A?Z.control?.preTextFix||m.preTextFix:Z.control?.prefix||m.prefix,pt=ct(Xt);for(let St=0;St<pt.length;St++)o.splice(s,0,{...B,color:Ct,originControlId:M,value:pt[St],controlComponent:A?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX}),s++;for(let St=0;St<x.length;St++){const Tt=x[St];o.splice(s,0,{...B,...N,...Tt,originControlId:M,value:Tt.value===`
75
- `?_:Tt.value,controlComponent:l.ControlComponent.VALUE}),s++}if(x.length===0){const St=Z.control?.placeholder||"";if(St){const Tt=ct(St);for(let It=0;It<Tt.length;It++)o.splice(s,0,{...B,color:i.control.placeholderColor,originControlId:M,value:Tt[It],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}}const yt=A?Z.control?.postTextFix||m.postTextFix:Z.control?.postfix||m.postfix,Yt=ct(yt);for(let St=0;St<Yt.length;St++)o.splice(s,0,{...B,color:Ct,originControlId:M,value:Yt[St],controlComponent:A?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX}),s++}else o.splice(s,0,{...nt,...N,...w,originControlId:P,value:w.value===`
76
- `?_:w.value,controlComponent:l.ControlComponent.VALUE}),s++}else if(W){const K=ct(W);for(let w=0;w<K.length;w++)o.splice(s,0,{...nt,color:i.control.placeholderColor,originControlId:P,value:K[w],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}else if((D===l.ControlType.SELECT||D===l.ControlType.DATE||D===l.ControlType.NUMBER)&&!C.control?.code&&W){const w=ct(W);for(let Z=0;Z<w.length;Z++)o.splice(s,0,{...nt,color:i.control.placeholderColor,originControlId:P,value:w[Z],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}const ut=U?C.control?.postTextFix||m.postTextFix:C.control?.postfix||m.postfix,v=ct(ut);for(let K=0;K<v.length;K++)o.splice(s,0,{...nt,color:et,highlight:dt,originControlId:P,value:v[K],controlComponent:it}),s++}else if(E.type===l.ElementType.MENSTRUAL_HISTORY||E.type===l.ElementType.FETAL_HEART_POSITION||E.type===l.ElementType.TOOTH_POSITION||E.type===l.ElementType.MACRO||E.type===l.ElementType.CUSTOM_MACRO||E.type===l.ElementType.REUSABLE_ITEM||E.type===l.ElementType.LIST||E.type===l.ElementType.SPECIAL_SYMBOLS){const C=E.id||lt();E.id||(E.id=C);const M=a.control?.value;if(M){const y=M.find(W=>W.id===C||W.type===E.type&&W.value===E.value);y&&Qn(C,y)}o.splice(s,0,{...O,...E,id:C,controlId:P,control:a.control,controlComponent:l.ControlComponent.VALUE,type:E.type}),s++}else{const C=ct(E.value||"");for(let M=0;M<C.length;M++){const y=C[M];o.splice(s,0,{...O,...N,...E,controlId:P,value:y===`
77
- `?_:y,type:E.type||l.ElementType.TEXT,control:a.control,controlComponent:l.ControlComponent.VALUE}),s++}}}}}else if(g){const X={...S,color:i.control.placeholderColor},b=ct(g);for(let E=0;E<b.length;E++){const C=b[E];o.splice(s,0,{...O,...X,controlId:P,value:C===`
78
- `?_:C,type:a.type,control:a.control,controlComponent:l.ControlComponent.PLACEHOLDER}),s++}}if(u){const X=ct(u);for(let b=0;b<X.length;b++){const E=X[b];o.splice(s,0,{...O,...S,controlId:P,value:E,type:a.type,control:a.control,controlComponent:l.ControlComponent.POST_TEXT}),s++}}const Y=ct(d||m.postfix);for(let X=0;X<Y.length;X++){const b=Y[X];o.splice(s,0,{...O,...F,controlId:P,value:b===`
79
- `?_:b,type:a.type,control:a.control,controlComponent:l.ControlComponent.POSTFIX}),s++}s--}}else if((!a.type||$t.includes(a.type))&&a.type!==l.ElementType.SPECIAL_SYMBOLS&&a.value?.length>1){o.splice(s,1);const c=ct(a.value);for(let d=0;d<c.length;d++)o.splice(s+d,0,{...a,value:c[d]});a=o[s]}if((a.value===`
61
+ `,c+d}boxes(t){t||(t={});const[e,n,i,r]=this.resolveScale(t),s=[];for(let a=0;a<this._tree.chld.length;a++){const{x:c,y:d,w:R,h:u}=this._tree.chld[a].bbox;s.push({x:e+c*i,y:n+d*r,w:R*i,h:u*r})}return s}box(t){t||(t={});const[e,n,i,r]=this.resolveScale(t);return{x:e+this._tree.bbox.x*i,y:n+this._tree.bbox.y*r,w:this._tree.bbox.w*i,h:this._tree.bbox.h*r}}}class Gi extends Hi{static convertLaTextToSVG(t){return new Pl(t).svg({SCALE_X:10,SCALE_Y:10,MARGIN_X:0,MARGIN_Y:0})}render(t,e,n,i){const{scale:r}=this.options,s=e.width*r,a=e.height*r;if(this.imageCache.has(e.value)){const c=this.imageCache.get(e.value);t.drawImage(c,n,i,s,a)}else{const c=new Promise((d,R)=>{const u=new Image;u.src=e.laTexSVG,u.onload=()=>{t.drawImage(u,n,i,s,a),this.imageCache.set(e.value,u),d(e)},u.onerror=h=>{R(h)}});this.addImageObserver(c)}}}l.ListType=void 0,(function(o){o.UL="ul",o.OL="ol"})(l.ListType||(l.ListType={}));var Ge;(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.CHECKBOX="checkbox"})(Ge||(Ge={}));var Ai;(function(o){o.DECIMAL="decimal"})(Ai||(Ai={})),l.ListStyle=void 0,(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.DECIMAL="decimal",o.CHECKBOX="checkbox"})(l.ListStyle||(l.ListStyle={}));const Ml={inheritStyle:!1},Yo={[Ge.DISC]:"•",[Ge.CIRCLE]:"◦",[Ge.SQUARE]:"▫︎",[Ge.CHECKBOX]:"☑️"},Ol={[l.ListType.OL]:"ol",[l.ListType.UL]:"ul"},Cl={[l.ListStyle.DISC]:"disc",[l.ListStyle.CIRCLE]:"circle",[l.ListStyle.SQUARE]:"square",[l.ListStyle.DECIMAL]:"decimal",[l.ListStyle.CHECKBOX]:"checkbox"};l.TitleLevel=void 0,(function(o){o.FIRST="first",o.SECOND="second",o.THIRD="third",o.FOURTH="fourth",o.FIFTH="fifth",o.SIXTH="sixth"})(l.TitleLevel||(l.TitleLevel={}));const Sl={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},ki={[l.TitleLevel.FIRST]:"defaultFirstSize",[l.TitleLevel.SECOND]:"defaultSecondSize",[l.TitleLevel.THIRD]:"defaultThirdSize",[l.TitleLevel.FOURTH]:"defaultFourthSize",[l.TitleLevel.FIFTH]:"defaultFifthSize",[l.TitleLevel.SIXTH]:"defaultSixthSize"},Do={[l.TitleLevel.FIRST]:1,[l.TitleLevel.SECOND]:2,[l.TitleLevel.THIRD]:3,[l.TitleLevel.FOURTH]:4,[l.TitleLevel.FIFTH]:5,[l.TitleLevel.SIXTH]:6},El={H1:l.TitleLevel.FIRST,H2:l.TitleLevel.SECOND,H3:l.TitleLevel.THIRD,H4:l.TitleLevel.FOURTH,H5:l.TitleLevel.FIFTH,H6:l.TitleLevel.SIXTH};l.BlockType=void 0,(function(o){o.IFRAME="iframe",o.VIDEO="video"})(l.BlockType||(l.BlockType={})),l.ControlType=void 0,(function(o){o.TEXT="text",o.SELECT="select",o.CHECKBOX="checkbox",o.RADIO="radio",o.DATE="date",o.NUMBER="number",o.TEXTFIELD="TextField",o.BUTTON="button",o.MENSTRUAL_HISTORY="menstrualHistory"})(l.ControlType||(l.ControlType={})),l.ControlComponent=void 0,(function(o){o.PREFIX="prefix",o.POSTFIX="postfix",o.PRE_TEXT="preText",o.PRETEXTFIX="preTextFix",o.PRETEXTFIX_TEXT="preTextFixText",o.POSTTEXTFIX="postTextFix",o.POSTTEXTFIX_TEXT="postTextFixText",o.POST_TEXT="postText",o.PLACEHOLDER="placeholder",o.TEXTFIXLABEL="textFixLabel",o.VALUE="value",o.DELETEPERSON="deletePerson",o.CHECKBOX="checkbox",o.RADIO="radio",o.UNDERLINE="underline"})(l.ControlComponent||(l.ControlComponent={})),l.ControlIndentation=void 0,(function(o){o.ROW_START="rowStart",o.VALUE_START="valueStart"})(l.ControlIndentation||(l.ControlIndentation={})),l.ControlState=void 0,(function(o){o.ACTIVE="active",o.INACTIVE="inactive"})(l.ControlState||(l.ControlState={}));var Ji;(function(o){o.NUMBER="number",o.OPERATOR="operator",o.UTILITY="utility",o.EQUAL="equal"})(Ji||(Ji={})),l.EditorComponent=void 0,(function(o){o.COMPONENT="component",o.MENU="menu",o.MAIN="main",o.FOOTER="footer",o.CONTEXTMENU="contextmenu",o.POPUP="popup",o.CATALOG="catalog",o.COMMENT="comment"})(l.EditorComponent||(l.EditorComponent={}));var fe;(function(o){o.PAGE="page",o.TABLE="table"})(fe||(fe={})),l.EditorMode=void 0,(function(o){o.EDIT="edit",o.CLEAN="clean",o.READONLY="readonly",o.FORM="form",o.PRINT="print",o.DESIGN="design",o.GRAFFITI="graffiti"})(l.EditorMode||(l.EditorMode={})),l.EditorZone=void 0,(function(o){o.HEADER="header",o.MAIN="main",o.FOOTER="footer"})(l.EditorZone||(l.EditorZone={})),l.PageMode=void 0,(function(o){o.PAGING="paging",o.CONTINUITY="continuity"})(l.PageMode||(l.PageMode={})),l.PaperDirection=void 0,(function(o){o.VERTICAL="vertical",o.HORIZONTAL="horizontal"})(l.PaperDirection||(l.PaperDirection={})),l.WordBreak=void 0,(function(o){o.BREAK_ALL="break-all",o.BREAK_WORD="break-word"})(l.WordBreak||(l.WordBreak={})),l.RenderMode=void 0,(function(o){o.SPEED="speed",o.COMPATIBILITY="compatibility"})(l.RenderMode||(l.RenderMode={})),l.TableBorder=void 0,(function(o){o.ALL="all",o.EMPTY="empty",o.EXTERNAL="external",o.INTERNAL="internal",o.DASH="dash"})(l.TableBorder||(l.TableBorder={})),l.TdBorder=void 0,(function(o){o.TOP="top",o.RIGHT="right",o.BOTTOM="bottom",o.LEFT="left"})(l.TdBorder||(l.TdBorder={})),l.TdSlash=void 0,(function(o){o.FORWARD="forward",o.BACK="back"})(l.TdSlash||(l.TdSlash={})),l.BackgroundSize=void 0,(function(o){o.CONTAIN="contain",o.COVER="cover"})(l.BackgroundSize||(l.BackgroundSize={})),l.BackgroundRepeat=void 0,(function(o){o.REPEAT="repeat",o.NO_REPEAT="no-repeat",o.REPEAT_X="repeat-x",o.REPEAT_Y="repeat-y"})(l.BackgroundRepeat||(l.BackgroundRepeat={}));const Xl={color:"#FFFFFF",image:"",size:l.BackgroundSize.COVER,repeat:l.BackgroundRepeat.NO_REPEAT,applyPageNumbers:[]};l.VerticalAlign=void 0,(function(o){o.TOP="top",o.MIDDLE="middle",o.BOTTOM="bottom"})(l.VerticalAlign||(l.VerticalAlign={}));const Nl={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:l.VerticalAlign.BOTTOM},Fl={placeholderColor:"#9c9b9b",bracketColor:"#2284FE",textFixColor:"blue",prefix:"[",postfix:"]",preTextFix:"{",postTextFix:"}",textFixLabel:"",preTextFixText:"",postTextFixText:"",borderWidth:1,borderColor:"#000000",activeBackgroundColor:"",disabledBackgroundColor:"",existValueBackgroundColor:"",noValueBackgroundColor:""},yl={bottom:30,inactiveAlpha:1,maxHeightRadio:l.MaxHeightRatio.HALF,disabled:!1,editable:!0},bl={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1,deletable:!0},Wl={top:30,inactiveAlpha:1,maxHeightRadio:l.MaxHeightRatio.HALF,disabled:!1,editable:!0},Vl={defaultColor:"#1976d2",defaultBackgroundColor:"#e3f2fd",defaultBorderRadius:4,defaultPadding:[4,4,4,4]},Yl={color:"#666666",font:"Microsoft YaHei",size:12,top:5},Dl={disabled:!0,color:"#CCCCCC",lineWidth:1.5},Ul={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},Pn={PAGE_NO:"{pageNo}",PAGE_COUNT:"{pageCount}"},wl={bottom:60,size:12,font:"Microsoft YaHei",color:"#000000",rowFlex:l.RowFlex.CENTER,format:Pn.PAGE_NO,numberType:l.NumberType.ARABIC,disabled:!1,startPageNo:1,fromPageNo:0,maxPageNo:null},Bi={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},Zl={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:l.VerticalAlign.BOTTOM},Ql={lineWidth:1,strokeStyle:"#000000"},vl={tdPadding:[5,5,5,5],defaultTrMinHeight:24,defaultColMinWidth:40,defaultBorderColor:"#000000",overflow:!0};l.WatermarkType=void 0,(function(o){o.TEXT="text",o.IMAGE="image"})(l.WatermarkType||(l.WatermarkType={}));const Uo={data:"",type:l.WatermarkType.TEXT,width:0,height:0,color:"#AEB5C0",opacity:.3,size:200,font:"Microsoft YaHei",repeat:!1,gap:[10,10],numberType:l.NumberType.ARABIC},Kl={tipDisabled:!0};l.LineNumberType=void 0,(function(o){o.PAGE="page",o.CONTINUITY="continuity"})(l.LineNumberType||(l.LineNumberType={}));const Hl={size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:l.LineNumberType.CONTINUITY},_l={color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0},xl={top:0,left:5},Gl={defaultLineColor:"#000000",defaultLineWidth:2},Al={disabled:!0,color:"#CCCCCC",radius:1};function wo(o={}){const t={...vl,...o.table},e={...Wl,...o.header},n={...yl,...o.footer},i={...wl,...o.pageNumber},r={...Uo,...o.watermark},s={...Fl,...o.control},a={...Nl,...o.checkbox},c={...Zl,...o.radio},d={...nl,...o.cursor},R={...Sl,...o.title},u={...Bi,...o.placeholder},h={...bl,...o.group},g={...Ul,...o.pageBreak},f={...Kl,...o.zone},T={...Xl,...o.background},m={...Dl,...o.lineBreak},p={...Al,...o.whiteSpace},I={...Ql,...o.separator},L={...Hl,...o.lineNumber},P={..._l,...o.pageBorder},O={...xl,...o.badge},S={...Gl,...o.graffiti},F={...Vl,...o.label},N={...Yl,...o.imgCaption},V={...Ml,...o.list},Y={print:{...No.print,...o.modeRule?.print},readonly:{...No.readonly,...o.modeRule?.readonly},form:{...No.form,...o.modeRule?.form}};return{mode:l.EditorMode.EDIT,locale:"zhCN",defaultType:"TEXT",defaultColor:"#000000",defaultFont:"SimSun",defaultSize:16,minSize:5,maxSize:72,defaultRowMargin:1,defaultBasicRowMarginHeight:8,defaultTabWidth:32,width:794,height:1123,scale:1,pageGap:20,underlineColor:"#000000",strikeoutColor:"#FF0000",rangeAlpha:.6,rangeColor:"#AECBFA",rangeMinWidth:5,searchMatchAlpha:.6,searchMatchColor:"#FFFF00",searchNavigateMatchColor:"#AAD280",highlightAlpha:.6,highlightMarginHeight:8,resizerColor:"#4182D9",resizerSize:5,marginIndicatorSize:35,marginIndicatorColor:"#BABABA",margins:[75.591,56.693,56.693,56.693],pageMode:l.PageMode.PAGING,renderMode:l.RenderMode.SPEED,defaultHyperlinkColor:"#0000FF",paperDirection:l.PaperDirection.VERTICAL,inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:l.WordBreak.BREAK_WORD,printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:[Lo.ENGLISH,Lo.NUMBER],contextMenuDisableKeys:[],shortcutDisableKeys:[],scrollContainerSelector:"",pageOuterSelectionDisable:!1,...o,table:t,header:e,footer:n,pageNumber:i,watermark:r,control:s,checkbox:a,radio:c,cursor:d,title:R,placeholder:u,group:h,pageBreak:g,zone:f,background:T,lineBreak:m,whiteSpace:p,separator:I,lineNumber:L,pageBorder:P,badge:O,modeRule:Y,graffiti:S,label:F,imgCaption:N,list:V,performance:{enabled:!1,threshold:16,...o.performance}}}const $i=new Map;function kl(o){return $i.get(o)}function Hn(o,t){$i.set(o,t)}function Zo(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e],i=ct(n.value);for(let r=0;r<i.length;r++)t.push({...n,value:i[r]})}return t}function bt(o,t){const{isHandleFirstElement:e=!0,isForceCompensation:n=!1,editorOptions:i}=t,r=o[0];(n||e&&r?.type!==l.ElementType.LIST&&(r?.type&&r.type!==l.ElementType.TEXT||!Po.test(r?.value)))&&o.unshift({value:H});let s=0;for(;s<o.length;){let a=o[s];if(a.type===l.ElementType.TITLE){o.splice(s,1);const c=a.valueList||[];if(bt(c,{...t,isHandleFirstElement:!1,isForceCompensation:!1}),c.length){const d=a.titleId||lt(),R=i.title;for(let u=0;u<c.length;u++){const h=c[u];h.title=a.title,a.level&&(h.titleId=d,h.level=a.level),_n(h)&&(h.size||(h.size=R[ki[h.level]]),h.bold===void 0&&(h.bold=!0)),o.splice(s,0,h),s++}}s--}else if(a.type===l.ElementType.LIST){o.splice(s,1);const c=a.valueList||[];if(bt(c,{...t,isHandleFirstElement:!0,isForceCompensation:!1}),c.length){const d=lt();for(let R=0;R<c.length;R++){const u=c[R];u.listId=d,u.listType=a.listType,u.listStyle=a.listStyle,o.splice(s,0,u),s++}}s--}else if(a.type===l.ElementType.AREA){o.splice(s,1);const c=a?.valueList||[];if(bt(c,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),c.length){const d=lt();for(let R=0;R<c.length;R++){const u=c[R];if(u.areaId=a.areaId||d,u.area=a.area,u.areaIndex=R,u.type===l.ElementType.TABLE){const h=u.trList;for(let g=0;g<h.length;g++){const f=h[g];for(let T=0;T<f.tdList.length;T++){const p=f.tdList[T].value;for(let I=0;I<p.length;I++){const L=p[I];L.areaId=a.areaId||d,L.area=a.area}}}}o.splice(s,0,u),s++}}s--}else if(a.type===l.ElementType.TABLE){const c=a.id||lt();if(a.id=c,a.trList){const{defaultTrMinHeight:d}=i.table;for(let R=0;R<a.trList.length;R++){const u=a.trList[R],h=u.id||lt();u.id=h,(!u.minHeight||u.minHeight<d)&&(u.minHeight=d),u.height<u.minHeight&&(u.height=u.minHeight);for(let g=0;g<u.tdList.length;g++){const f=u.tdList[g],T=f.id||lt();f.id=T,bt(f.value,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),!f.value[0].size&&f.value[1]?.size&&_n(f.value[1])&&(f.value[0].size=f.value[1].size);for(let m=0;m<f.value.length;m++){const p=f.value[m];p.tdId=T,p.trId=h,p.tableId=c}}}}}else if(a.type===l.ElementType.HYPERLINK){o.splice(s,1);const c=Zo(a.valueList||[]);if(c.length){const d=lt();for(let R=0;R<c.length;R++){const u=c[R];u.type=a.type,u.url=a.url,u.hyperlinkId=d,o.splice(s,0,u),s++}}s--}else if(a.type===l.ElementType.DATE){o.splice(s,1);const c=Zo(a.valueList||[]);if(c.length){const d=lt();for(let R=0;R<c.length;R++){const u=c[R];u.type=a.type,u.dateFormat=a.dateFormat,u.dateId=d,o.splice(s,0,u),s++}}s--}else if(a.type===l.ElementType.CONTROL){if(!a.control){s++;continue}if(a.control.type=="TextField"){const{preTextFix:c,postTextFix:d,preTextFixText:R,postTextFixText:u,value:h,placeholder:g,code:f,type:T,valueSets:m}=a.control,p=T,{editorOptions:{control:I,checkbox:L,radio:P}}=t,O=a.controlId||lt();o.splice(s,1);const S=Dt(a,[...bo,...Bt]),F=Dt(a.control,Gt),N={...F,color:i.control.textFixColor,fontWeight:"blod"},V={...F,color:void 0},Y=ct(c||I.preTextFix);for(let W=0;W<Y.length;W++){const E=Y[W];o.splice(s,0,{...S,...N,controlId:O,value:E,type:a.type,control:a.control,controlComponent:l.ControlComponent.PRETEXTFIX}),s++}if(R){const W=ct(R);for(let E=0;E<W.length;E++){const C=W[E];o.splice(s,0,{...S,...F,controlId:O,value:C,type:a.type,control:a.control,controlComponent:l.ControlComponent.PRETEXTFIX_TEXT}),s++}}if(h&&h.length||p===l.ControlType.CHECKBOX||p===l.ControlType.RADIO||p===l.ControlType.SELECT&&f&&(!h||!h.length)){let W=h?at(h):[];if(p===l.ControlType.CHECKBOX){const E=f?f.split(","):[];if(Array.isArray(m)&&m.length){const C=W.reduce((y,b)=>y.concat(b.value.split("").map(D=>({...b,value:D}))),[]);let M=0;for(let y=0;y<m.length;y++){const b=m[y];o.splice(s,0,{...S,...F,controlId:O,value:"",type:a.type,control:a.control,controlComponent:l.ControlComponent.CHECKBOX,checkbox:{code:b.code,value:E.includes(b.code)}}),s++;const D=ct(b.value);for(let U=0;U<D.length;U++){const Q=D[U],G=U===D.length-1;o.splice(s,0,{...S,...V,...C[M],controlId:O,value:Q===`
62
+ `?H:Q,letterSpacing:G?L.gap:0,control:a.control,controlComponent:l.ControlComponent.VALUE}),M++,s++}}}}else if(p===l.ControlType.RADIO){if(Array.isArray(m)&&m.length){const E=W.reduce((M,y)=>M.concat(y.value.split("").map(b=>({...y,value:b}))),[]);let C=0;for(let M=0;M<m.length;M++){const y=m[M];o.splice(s,0,{...S,...F,controlId:O,value:"",type:a.type,control:a.control,controlComponent:l.ControlComponent.RADIO,radio:{code:y.code,value:f===y.code}}),s++;const b=ct(y.value);for(let D=0;D<b.length;D++){const U=b[D],Q=D===b.length-1;o.splice(s,0,{...S,...V,...E[C],controlId:O,value:U===`
63
+ `?H:U,letterSpacing:Q?P.gap:0,control:a.control,controlComponent:l.ControlComponent.VALUE}),C++,s++}}}}else{if((!h||!h.length)&&Array.isArray(m)&&m.length){const E=f?f.split(",").map(C=>C.trim()).filter(C=>C):[];if(E.length>1){const C=[];for(const M of E){const y=m.find(b=>b.code===M);y&&C.push({value:y.value})}C.length>0&&(W=C)}else if(E.length===1){const C=m.find(M=>M.code===E[0]);C&&(W=[{value:C.value}])}}for(let E=0;E<W.length;E++){const C=W[E];if(C.type===l.ElementType.CONTROL&&C.control){const M=C,y=M.controlId||lt(),b=M.control?.value||[],D=M.control?.placeholder||"",U=M.control?.type,Q=U===l.ControlType.TEXTFIELD,G=U===l.ControlType.TEXT,_=U===l.ControlType.CHECKBOX,j=U===l.ControlType.RADIO,st=U===l.ControlType.BUTTON,it=Q?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,nt=Q?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX,et={...S,controlId:y,type:l.ElementType.CONTROL,control:M.control},dt=Q?i.control.textFixColor:G?"#87d068":st?"transparent":i.control.bracketColor,tt=st?"#1677FF":void 0,ht=Q?M.control?.preTextFix||I.preTextFix:M.control?.prefix||I.prefix,ut=ct(ht);for(let w=0;w<ut.length;w++)o.splice(s,0,{...et,color:dt,highlight:tt,originControlId:O,value:ut[w],controlComponent:it}),s++;if(st){const w=M.control.buttonLabel||M.control.label||"按钮",Z=ct(w);for(let J=0;J<Z.length;J++){const x=Z[J];o.splice(s,0,{...et,originControlId:O,value:x,controlComponent:l.ControlComponent.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if(_){const w=M.control?.valueSets||[],Z=M.control?.code||"",J=Z?Z.split(","):[];for(let x=0;x<w.length;x++){const A=w[x];o.splice(s,0,{...et,originControlId:O,value:"",controlComponent:l.ControlComponent.CHECKBOX,checkbox:{code:A.code,value:J.includes(A.code)}}),s++;const $=ct(A.value||"");for(let B=0;B<$.length;B++){const Ct=$[B],Xt=B===$.length-1;o.splice(s,0,{...et,...V,originControlId:O,value:Ct===`
64
+ `?H:Ct,letterSpacing:Xt?L.gap:0,controlComponent:l.ControlComponent.VALUE}),s++}}}else if(j){const w=M.control?.valueSets||[],Z=M.control?.code||"";for(let J=0;J<w.length;J++){const x=w[J];o.splice(s,0,{...et,originControlId:O,value:"",controlComponent:l.ControlComponent.RADIO,radio:{code:x.code,value:Z===x.code}}),s++;const A=ct(x.value||"");for(let $=0;$<A.length;$++){const B=A[$],Ct=$===A.length-1;o.splice(s,0,{...et,...V,originControlId:O,value:B===`
65
+ `?H:B,letterSpacing:Ct?P.gap:0,controlComponent:l.ControlComponent.VALUE}),s++}}}else if(b.length>0)for(let w=0;w<b.length;w++){const Z=b[w];if(Z.type===l.ElementType.CONTROL&&Z.control){const J=Z,x=J.controlId||lt(),A=J.control?.value||[],$=J.control?.type===l.ControlType.TEXTFIELD,B=J.control?.type===l.ControlType.TEXT,Ct={...et,controlId:x,control:J.control},Xt=$?i.control.textFixColor:B?"#87d068":i.control.bracketColor,pt=$?J.control?.preTextFix||I.preTextFix:J.control?.prefix||I.prefix,yt=ct(pt);for(let Tt=0;Tt<yt.length;Tt++)o.splice(s,0,{...Ct,color:Xt,originControlId:y,value:yt[Tt],controlComponent:$?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX}),s++;for(let Tt=0;Tt<A.length;Tt++){const It=A[Tt];if(It.type===l.ElementType.MENSTRUAL_HISTORY||It.type===l.ElementType.FETAL_HEART_POSITION||It.type===l.ElementType.TOOTH_POSITION||It.type===l.ElementType.MACRO||It.type===l.ElementType.CUSTOM_MACRO||It.type===l.ElementType.REUSABLE_ITEM||It.type===l.ElementType.LIST||It.type===l.ElementType.SPECIAL_SYMBOLS){const Qt=It.id||lt();It.id||(It.id=Qt);const Ve=J.control?.value?.find(jt=>jt.id===Qt||jt.type===It.type&&jt.value===It.value);Ve&&Hn(Qt,Ve),o.splice(s,0,{...Ct,...It,id:Qt,originControlId:y,controlComponent:l.ControlComponent.VALUE,type:It.type})}else o.splice(s,0,{...Ct,...V,...It,originControlId:y,value:It.value===`
66
+ `?H:It.value,controlComponent:l.ControlComponent.VALUE});s++}if(A.length===0){const Tt=J.control?.placeholder||"";if(Tt){const It=ct(Tt);for(let Kt=0;Kt<It.length;Kt++)o.splice(s,0,{...Ct,color:i.control.placeholderColor,originControlId:y,value:It[Kt],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}}const Yt=$?J.control?.postTextFix||I.postTextFix:J.control?.postfix||I.postfix,St=ct(Yt);for(let Tt=0;Tt<St.length;Tt++)o.splice(s,0,{...Ct,color:Xt,originControlId:y,value:St[Tt],controlComponent:$?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX}),s++}else{if(Z.type===l.ElementType.MENSTRUAL_HISTORY||Z.type===l.ElementType.FETAL_HEART_POSITION||Z.type===l.ElementType.TOOTH_POSITION||Z.type===l.ElementType.MACRO||Z.type===l.ElementType.CUSTOM_MACRO||Z.type===l.ElementType.REUSABLE_ITEM||Z.type===l.ElementType.LIST||Z.type===l.ElementType.SPECIAL_SYMBOLS){const x=Z.id||lt();Z.id||(Z.id=x);const A=M.control?.value?.find($=>$.id===x||$.type===Z.type&&$.value===Z.value);A&&Hn(x,A),o.splice(s,0,{...et,...Z,id:x,originControlId:O,controlComponent:l.ControlComponent.VALUE,type:Z.type})}else o.splice(s,0,{...et,...V,...Z,originControlId:O,value:Z.value===`
67
+ `?H:Z.value,controlComponent:l.ControlComponent.VALUE});s++}}else if(D){const w=ct(D);for(let Z=0;Z<w.length;Z++)o.splice(s,0,{...et,color:i.control.placeholderColor,originControlId:O,value:w[Z],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}else if((U===l.ControlType.SELECT||U===l.ControlType.DATE||U===l.ControlType.NUMBER)&&!M.control?.code&&D){const Z=ct(D);for(let J=0;J<Z.length;J++)o.splice(s,0,{...et,color:i.control.placeholderColor,originControlId:O,value:Z[J],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}const v=Q?M.control?.postTextFix||I.postTextFix:M.control?.postfix||I.postfix,K=ct(v);for(let w=0;w<K.length;w++)o.splice(s,0,{...et,color:dt,highlight:tt,originControlId:O,value:K[w],controlComponent:nt}),s++}else if(C.type===l.ElementType.MENSTRUAL_HISTORY||C.type===l.ElementType.FETAL_HEART_POSITION||C.type===l.ElementType.TOOTH_POSITION||C.type===l.ElementType.MACRO||C.type===l.ElementType.CUSTOM_MACRO||C.type===l.ElementType.REUSABLE_ITEM||C.type===l.ElementType.LIST||C.type===l.ElementType.SPECIAL_SYMBOLS){const M=C.id||lt();C.id||(C.id=M);const y=h?.find(b=>b.id===M||b.type===C.type&&b.value===C.value);y&&Hn(M,y),o.splice(s,0,{...S,...C,id:M,controlId:O,control:a.control,controlComponent:l.ControlComponent.VALUE,type:C.type}),s++}else{const M=ct(C.value||"");for(let y=0;y<M.length;y++){const b=M[y];o.splice(s,0,{...S,...V,...C,controlId:O,value:b===`
68
+ `?H:b,type:C.type||l.ElementType.TEXT,control:a.control,controlComponent:l.ControlComponent.VALUE}),s++}}}}}else if(g){const W={...F,color:i.control.placeholderColor},E=ct(g);for(let C=0;C<E.length;C++){const M=E[C];o.splice(s,0,{...S,...W,controlId:O,value:M===`
69
+ `?H:M,type:a.type,control:a.control,controlComponent:l.ControlComponent.PLACEHOLDER}),s++}}if(u){const W=ct(u);for(let E=0;E<W.length;E++){const C=W[E];o.splice(s,0,{...S,...F,controlId:O,value:C,type:a.type,control:a.control,controlComponent:l.ControlComponent.POSTTEXTFIX_TEXT}),s++}}const X=ct(d||I.postTextFix);for(let W=0;W<X.length;W++){const E=X[W];o.splice(s,0,{...S,...N,controlId:O,value:E,type:a.type,control:a.control,controlComponent:l.ControlComponent.POSTTEXTFIX}),s++}s--}else{const{prefix:c,postfix:d,preText:R,postText:u,value:h,placeholder:g,code:f,type:T,valueSets:m}=a.control,{editorOptions:{control:p,checkbox:I,radio:L}}=t,P=a.controlId||lt();o.splice(s,1);const O=Dt(a,[...bo,...Bt]),S=Dt(a.control,Gt),F={...S,color:T===l.ControlType.TEXT?"#87d068":T===l.ControlType.BUTTON?"transparent":i.control.bracketColor,highlight:T===l.ControlType.BUTTON?"#1677FF":void 0},N={...S,color:void 0},V=ct(c||p.prefix);for(let X=0;X<V.length;X++){const W=V[X];o.splice(s,0,{...O,...F,controlId:P,value:W===`
70
+ `?H:W,type:a.type,control:a.control,controlComponent:l.ControlComponent.PREFIX}),s++}if(R){const X=ct(R);for(let W=0;W<X.length;W++){const E=X[W];o.splice(s,0,{...O,...S,controlId:P,value:E,type:a.type,control:a.control,controlComponent:l.ControlComponent.PRE_TEXT}),s++}}if(h&&h.length||T===l.ControlType.CHECKBOX||T===l.ControlType.RADIO||T===l.ControlType.BUTTON||T===l.ControlType.SELECT&&f&&(!h||!h.length)){let X=h?at(h):[];if(T===l.ControlType.CHECKBOX){const W=f?f.split(","):[];if(Array.isArray(m)&&m.length){const E=X.reduce((M,y)=>M.concat(y.value.split("").map(b=>({...y,value:b}))),[]);let C=0;for(let M=0;M<m.length;M++){const y=m[M];o.splice(s,0,{...O,...S,controlId:P,value:"",type:a.type,control:a.control,controlComponent:l.ControlComponent.CHECKBOX,checkbox:{code:y.code,value:W.includes(y.code)}}),s++;const b=ct(y.value);for(let D=0;D<b.length;D++){const U=b[D],Q=D===b.length-1;o.splice(s,0,{...O,...N,...E[C],controlId:P,value:U===`
71
+ `?H:U,letterSpacing:Q?I.gap:0,control:a.control,controlComponent:l.ControlComponent.VALUE}),C++,s++}}}}else if(T===l.ControlType.RADIO){if(Array.isArray(m)&&m.length){const W=X.reduce((C,M)=>C.concat(M.value.split("").map(y=>({...M,value:y}))),[]);let E=0;for(let C=0;C<m.length;C++){const M=m[C];o.splice(s,0,{...O,...S,controlId:P,value:"",type:a.type,control:a.control,controlComponent:l.ControlComponent.RADIO,radio:{code:M.code,value:f===M.code}}),s++;const y=ct(M.value);for(let b=0;b<y.length;b++){const D=y[b],U=b===y.length-1;o.splice(s,0,{...O,...N,...W[E],controlId:P,value:D===`
72
+ `?H:D,letterSpacing:U?L.gap:0,control:a.control,controlComponent:l.ControlComponent.VALUE}),E++,s++}}}}else{if(T===l.ControlType.BUTTON){const W=a.control.buttonLabel||a.control.label||"按钮",E=ct(W);for(let C=0;C<E.length;C++){const M=E[C];o.splice(s,0,{...O,...S,controlId:P,value:M,type:l.ElementType.CONTROL,control:a.control,controlComponent:l.ControlComponent.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if((!h||!h.length)&&Array.isArray(m)&&m.length){const W=f?f.split(","):[];if(W.length>1){const E=[];for(const C of W){const M=m.find(y=>y.code===C.trim());M&&E.push({value:M.value})}E.length>0&&(X=E)}else{const E=m.find(C=>C.code===f);E&&(X=[{value:E.value}])}}if(T!==l.ControlType.BUTTON)for(let W=0;W<X.length;W++){const E=X[W];if(E.type===l.ElementType.CONTROL&&E.control){const C=E,M=C.controlId||lt(),y=C.control?.value||[],b=C.control?.placeholder||"",D=C.control?.type,U=D===l.ControlType.TEXTFIELD,Q=D===l.ControlType.TEXT,G=D===l.ControlType.CHECKBOX,_=D===l.ControlType.RADIO,j=D===l.ControlType.BUTTON,st=U?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,it=U?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX,nt={...O,controlId:M,type:l.ElementType.CONTROL,control:C.control},et=U?i.control.textFixColor:Q?"#87d068":j?"transparent":i.control.bracketColor,dt=j?"#1677FF":void 0,tt=U?C.control?.preTextFix||p.preTextFix:C.control?.prefix||p.prefix,ht=ct(tt);for(let K=0;K<ht.length;K++)o.splice(s,0,{...nt,color:et,highlight:dt,originControlId:P,value:ht[K],controlComponent:st}),s++;if(j){const K=C.control.buttonLabel||C.control.label||"按钮",w=ct(K);for(let Z=0;Z<w.length;Z++){const J=w[Z];o.splice(s,0,{...nt,originControlId:P,value:J,controlComponent:l.ControlComponent.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if(G){const K=C.control?.valueSets||[],w=C.control?.code||"",Z=w?w.split(","):[];for(let J=0;J<K.length;J++){const x=K[J];o.splice(s,0,{...nt,...S,originControlId:P,value:"",controlComponent:l.ControlComponent.CHECKBOX,checkbox:{code:x.code,value:Z.includes(x.code)}}),s++;const A=ct(x.value||"");for(let $=0;$<A.length;$++){const B=A[$],Ct=$===A.length-1;o.splice(s,0,{...nt,...N,originControlId:P,value:B===`
73
+ `?H:B,letterSpacing:Ct?I.gap:0,controlComponent:l.ControlComponent.VALUE}),s++}}}else if(_){const K=C.control?.valueSets||[],w=C.control?.code||"";for(let Z=0;Z<K.length;Z++){const J=K[Z];o.splice(s,0,{...nt,...S,originControlId:P,value:"",controlComponent:l.ControlComponent.RADIO,radio:{code:J.code,value:w===J.code}}),s++;const x=ct(J.value||"");for(let A=0;A<x.length;A++){const $=x[A],B=A===x.length-1;o.splice(s,0,{...nt,...N,originControlId:P,value:$===`
74
+ `?H:$,letterSpacing:B?L.gap:0,controlComponent:l.ControlComponent.VALUE}),s++}}}else if(y.length>0)for(let K=0;K<y.length;K++){const w=y[K];if(w.type===l.ElementType.CONTROL&&w.control){const Z=w,J=Z.controlId||lt(),x=Z.control?.value||[],A=Z.control?.type===l.ControlType.TEXTFIELD,$=Z.control?.type===l.ControlType.TEXT,B={...nt,controlId:J,control:Z.control},Ct=A?i.control.textFixColor:$?"#87d068":i.control.bracketColor,Xt=A?Z.control?.preTextFix||p.preTextFix:Z.control?.prefix||p.prefix,pt=ct(Xt);for(let St=0;St<pt.length;St++)o.splice(s,0,{...B,color:Ct,originControlId:M,value:pt[St],controlComponent:A?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX}),s++;for(let St=0;St<x.length;St++){const Tt=x[St];o.splice(s,0,{...B,...N,...Tt,originControlId:M,value:Tt.value===`
75
+ `?H:Tt.value,controlComponent:l.ControlComponent.VALUE}),s++}if(x.length===0){const St=Z.control?.placeholder||"";if(St){const Tt=ct(St);for(let It=0;It<Tt.length;It++)o.splice(s,0,{...B,color:i.control.placeholderColor,originControlId:M,value:Tt[It],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}}const yt=A?Z.control?.postTextFix||p.postTextFix:Z.control?.postfix||p.postfix,Yt=ct(yt);for(let St=0;St<Yt.length;St++)o.splice(s,0,{...B,color:Ct,originControlId:M,value:Yt[St],controlComponent:A?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX}),s++}else o.splice(s,0,{...nt,...N,...w,originControlId:P,value:w.value===`
76
+ `?H:w.value,controlComponent:l.ControlComponent.VALUE}),s++}else if(b){const K=ct(b);for(let w=0;w<K.length;w++)o.splice(s,0,{...nt,color:i.control.placeholderColor,originControlId:P,value:K[w],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}else if((D===l.ControlType.SELECT||D===l.ControlType.DATE||D===l.ControlType.NUMBER)&&!C.control?.code&&b){const w=ct(b);for(let Z=0;Z<w.length;Z++)o.splice(s,0,{...nt,color:i.control.placeholderColor,originControlId:P,value:w[Z],controlComponent:l.ControlComponent.PLACEHOLDER}),s++}const ut=U?C.control?.postTextFix||p.postTextFix:C.control?.postfix||p.postfix,v=ct(ut);for(let K=0;K<v.length;K++)o.splice(s,0,{...nt,color:et,highlight:dt,originControlId:P,value:v[K],controlComponent:it}),s++}else if(E.type===l.ElementType.MENSTRUAL_HISTORY||E.type===l.ElementType.FETAL_HEART_POSITION||E.type===l.ElementType.TOOTH_POSITION||E.type===l.ElementType.MACRO||E.type===l.ElementType.CUSTOM_MACRO||E.type===l.ElementType.REUSABLE_ITEM||E.type===l.ElementType.LIST||E.type===l.ElementType.SPECIAL_SYMBOLS){const C=E.id||lt();E.id||(E.id=C);const M=a.control?.value;if(M){const y=M.find(b=>b.id===C||b.type===E.type&&b.value===E.value);y&&Hn(C,y)}o.splice(s,0,{...O,...E,id:C,controlId:P,control:a.control,controlComponent:l.ControlComponent.VALUE,type:E.type}),s++}else{const C=ct(E.value||"");for(let M=0;M<C.length;M++){const y=C[M];o.splice(s,0,{...O,...N,...E,controlId:P,value:y===`
77
+ `?H:y,type:E.type||l.ElementType.TEXT,control:a.control,controlComponent:l.ControlComponent.VALUE}),s++}}}}}else if(g){const X={...S,color:i.control.placeholderColor},W=ct(g);for(let E=0;E<W.length;E++){const C=W[E];o.splice(s,0,{...O,...X,controlId:P,value:C===`
78
+ `?H:C,type:a.type,control:a.control,controlComponent:l.ControlComponent.PLACEHOLDER}),s++}}if(u){const X=ct(u);for(let W=0;W<X.length;W++){const E=X[W];o.splice(s,0,{...O,...S,controlId:P,value:E,type:a.type,control:a.control,controlComponent:l.ControlComponent.POST_TEXT}),s++}}const Y=ct(d||p.postfix);for(let X=0;X<Y.length;X++){const W=Y[X];o.splice(s,0,{...O,...F,controlId:P,value:W===`
79
+ `?H:W,type:a.type,control:a.control,controlComponent:l.ControlComponent.POSTFIX}),s++}s--}}else if((!a.type||$t.includes(a.type))&&a.type!==l.ElementType.SPECIAL_SYMBOLS&&a.value?.length>1){o.splice(s,1);const c=ct(a.value);for(let d=0;d<c.length;d++)o.splice(s+d,0,{...a,value:c[d]});a=o[s]}if((a.value===`
80
80
  `||a.value==`\r
81
- `)&&(a.value=_),(a.type===l.ElementType.IMAGE||a.type===l.ElementType.BLOCK)&&(a.id=a.id||lt()),a.type===l.ElementType.LATEX){const{svg:c,width:d,height:R}=Hi.convertLaTextToSVG(a.value);a.width=a.width||d,a.height=a.height||R,a.laTexSVG=c,a.id=a.id||lt()}(a.type===l.ElementType.MACRO||a.type===l.ElementType.CUSTOM_MACRO||a.type===l.ElementType.REUSABLE_ITEM)&&(a.id=a.id||lt()),(a.type===l.ElementType.MENSTRUAL_HISTORY||a.type===l.ElementType.TOOTH_POSITION||a.type===l.ElementType.FETAL_HEART_POSITION||a.type===l.ElementType.SPECIAL_SYMBOLS)&&(a.id=a.id||lt()),s++}}function Gl(o,t){const e=Object.keys(o),n=Object.keys(t);if(e.length!==n.length)return!1;for(let i=0;i<e.length;i++){const r=e[i];if(r!=="value"&&!(r==="groupIds"&&Array.isArray(o[r])&&Array.isArray(t[r])&&Di(o[r],t[r]))&&o[r]!==t[r])return!1}return!0}function De(o,t={}){const{extraPickAttrs:e}=t,n=[...il];e&&n.push(...e);const i={value:o?.value===_?`
82
- `:o?.value};return o&&n.forEach(r=>{const s=o[r];s!==void 0&&(i[r]=s)}),i}function Pt(o,t={}){const{extraPickAttrs:e,isClassifyArea:n=!1,isClone:i=!0,editorOptions:r}=t,s=(i?at(o):o).filter(d=>d.type!==l.ElementType.SPLIT_TAG),a=[];let c=0;for(;c<s.length;){let d=s[c];if(c===0&&d.value===_&&!d.listId&&(!d.type||d.type===l.ElementType.TEXT)){c++;continue}if(d.areaId){const u=d.areaId,h=d.area,g=[];for(;c<s.length;){const T=s[c];if(u!==T.areaId){c--;break}delete T.area,delete T.areaId,g.push(T),c++}const f=Pt(g,t);if(n){const T={type:l.ElementType.AREA,value:"",areaId:u,area:h};T.valueList=f,d=T}else{a.splice(c,0,...f);continue}}else if(d.titleId&&d.level){const u=d.titleId;if(u){const h=d.level,g={type:l.ElementType.TITLE,title:d.title,titleId:u,value:"",level:h},f=[];for(;c<s.length;){const T=s[c];if(u!==T.titleId){c--;break}delete T.level,delete T.title,f.push(T),c++}g.valueList=Pt(f,t),d=g}}else if(d.listId&&d.listType){const u=d.listId;if(u){const h=d.listType,g=d.listStyle,f=d?.label,T={type:l.ElementType.LIST,value:"",label:f||"",listId:u,listType:h,listStyle:g},p=[];for(;c<s.length;){const m=s[c];if(u!==m.listId){c--;break}delete m.listType,delete m.listStyle,p.push(m),c++}T.valueList=Pt(p,t),d=T}}else if(d.type===l.ElementType.TABLE){if(d.pagingId){let u=c+1,h=0;for(;u<s.length;){const g=s[u];if(g.pagingId===d.pagingId){d.height+=g.height;const f=g.trList.filter(T=>!T.pagingRepeat).filter(T=>(T.tdList=T.tdList.filter(p=>{if(p.originalId){for(let m=0;m<d.trList.length;m++){const L=d.trList[m].tdList.find(({id:P})=>P===p.originalId);if(L){p.value[0]?.type===l.ElementType.SPLIT_TAG&&p.value.splice(0,1),L.value.push(...p.value),L.rowspan=L.originalRowspan??L.rowspan;break}}return!1}return!0}),!T.originalId));d.trList.push(...f),d.trList?.forEach(T=>T.minHeight=T.originalMinHeight??T.minHeight),u++,h++}else break}c+=h}if(d.trList)for(let u=0;u<d.trList.length;u++){const h=d.trList[u];delete h.id;for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g],T={colspan:f.colspan,rowspan:f.rowspan,value:Pt(f.value,{...t,isClassifyArea:!1})};sl.forEach(p=>{const m=f[p];m!==void 0&&(T[p]=m)}),h.tdList[g]=T}}}else if(d.type===l.ElementType.HYPERLINK){const u=d.hyperlinkId;if(u){const h={type:l.ElementType.HYPERLINK,value:"",url:d.url},g=[];for(;c<s.length;){const f=s[c];if(u!==f.hyperlinkId){c--;break}delete f.type,delete f.url,g.push(f),c++}h.valueList=Pt(g,t),d=h}}else if(d.type===l.ElementType.DATE){const u=d.dateId;if(u){const h={type:l.ElementType.DATE,value:"",dateFormat:d.dateFormat},g=[];for(;c<s.length;){const f=s[c];if(u!==f.dateId){c--;break}delete f.type,delete f.dateFormat,g.push(f),c++}h.valueList=Pt(g,t),d=h}}else if(d.type!==l.ElementType.BUTTON){if(d.controlId){const u=d.controlId;if(!(d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)&&d.controlComponent===l.ControlComponent.VALUE){if(d.type===l.ElementType.MENSTRUAL_HISTORY||d.type===l.ElementType.FETAL_HEART_POSITION||d.type===l.ElementType.TOOTH_POSITION||d.type===l.ElementType.MACRO||d.type===l.ElementType.CUSTOM_MACRO||d.type===l.ElementType.REUSABLE_ITEM||d.type===l.ElementType.LIST||d.type===l.ElementType.SPECIAL_SYMBOLS){let p=!1;for(let m=c-1;m>=0;m--){const I=s[m],L=I.controlComponent===l.ControlComponent.PREFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT;if(I.controlId===u&&L){p=!0;break}if(I.controlId!==u)break}if(!p){const m=at(d);delete m.controlId,delete m.control,delete m.controlComponent,delete m.originControlId,a.push(m),c++;continue}}c++;continue}if(d.controlComponent===l.ControlComponent.PLACEHOLDER||d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT||d.controlComponent===l.ControlComponent.PRE_TEXT||d.controlComponent===l.ControlComponent.CHECKBOX||d.controlComponent===l.ControlComponent.RADIO){c++;continue}const g=(T,p,m,I)=>{if(I===l.ControlType.CHECKBOX||I===l.ControlType.RADIO){let P=-1;for(let O=T;O<s.length&&s[O].controlId===p;O++)P=O;return P}const L=m?[l.ControlComponent.POSTTEXTFIX,l.ControlComponent.POSTTEXTFIX_TEXT]:[l.ControlComponent.POSTFIX];for(let P=T;P<s.length;P++){const O=s[P];if(O.controlId===p&&L.includes(O.controlComponent))return P}return-1},f=(T,p,m)=>{const I=[];let L=T;for(;L<=p;){const P=s[L];if(P.controlId&&P.controlId!==m&&P.control){const V=P.control?.type,Y=V===l.ControlType.TEXTFIELD,X=Y?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,b=P.controlComponent===X,E=V===l.ControlType.CHECKBOX||V===l.ControlType.RADIO;if(b||E&&(P.controlComponent===l.ControlComponent.CHECKBOX||P.controlComponent===l.ControlComponent.RADIO)){const C=g(L+1,P.controlId,Y,V);if(C!==-1){const M=s.slice(L,C+1).map(W=>{const D=at(W);return delete D.originControlId,D}),y=Pt(M,t);y.length>0&&I.push(y[0]),L=C+1;continue}}}if(!(P.controlId===m&&(P.controlComponent===l.ControlComponent.VALUE||!P.controlComponent)&&(!P.originControlId||P.originControlId===m)||P.originControlId===m&&P.controlComponent===l.ControlComponent.VALUE||P.controlId===m&&(P.controlComponent===l.ControlComponent.CHECKBOX||P.controlComponent===l.ControlComponent.RADIO)&&!P.originControlId)){L++;continue}if(P.type===l.ElementType.MENSTRUAL_HISTORY||P.type===l.ElementType.FETAL_HEART_POSITION||P.type===l.ElementType.TOOTH_POSITION||P.type===l.ElementType.MACRO||P.type===l.ElementType.CUSTOM_MACRO||P.type===l.ElementType.REUSABLE_ITEM||P.type===l.ElementType.LIST||P.type===l.ElementType.SPECIAL_SYMBOLS){const V=at(P);delete V.controlId,delete V.control,delete V.controlComponent,delete V.originControlId,I.push(V),L++;continue}if(P.controlComponent===l.ControlComponent.CHECKBOX||P.controlComponent===l.ControlComponent.RADIO){I.push(at(P)),L++;continue}const F=d.control?.type;if(F===l.ControlType.CHECKBOX||F===l.ControlType.RADIO){let V=L-1,Y=!1;for(;V>=T-1;){const X=s[V];if(X.controlId===m&&!X.originControlId)if(X.controlComponent===l.ControlComponent.CHECKBOX){Y=X.checkbox?.value===!0;break}else if(X.controlComponent===l.ControlComponent.RADIO){Y=X.radio?.value===!0;break}else if(X.controlComponent===l.ControlComponent.VALUE){V--;continue}else break;V--}if(Y){const X={value:P.value||""},b=[...Bt,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const E of b){const C=P[E];if(C!==void 0){if(E==="color"&&r){const M=r.control?.bracketColor,y=r.control?.placeholderColor;if(C===M||C===y)continue}X[E]=C}}I.push(X)}}else{const V={value:P.value||""},Y=[...Bt,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const X of Y){const b=P[X];if(b!==void 0){if(X==="color"&&r){const E=r.control?.bracketColor,C=r.control?.placeholderColor;if(b===E||b===C)continue}V[X]=b}}I.push(V)}L++}return I};if(d.controlComponent===l.ControlComponent.PREFIX){const T=d.control?.type===l.ControlType.TEXTFIELD,p=g(c+1,u,T);if(p!==-1){const m=f(c+1,p-1,u),I=Dt(d,Gt),L={...d.control,...I,value:m},P={...Dt(d,Bt),type:l.ElementType.CONTROL,value:"",control:L,controlId:u};d=De(P,{extraPickAttrs:e}),c=p}}if(d.controlComponent===l.ControlComponent.PRETEXTFIX){const T=g(c+1,u,!0);if(T!==-1){const p=f(c+1,T-1,u),m=Dt(d,Gt),I={...d.control,...m,value:p},L={...Dt(d,Bt),type:l.ElementType.CONTROL,value:"",control:I,controlId:u};d=De(L,{extraPickAttrs:e}),c=T}}if(d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){const T=g(c+1,u,!0);if(T!==-1){const p=f(c+1,T-1,u),m=Dt(d,Gt),I={...d.control,...m,value:p},L={...Dt(d,Bt),type:l.ElementType.CONTROL,value:"",control:I,controlId:u};d=De(L,{extraPickAttrs:e}),c=T}}}}const R=De(d,{extraPickAttrs:e});if(!d.type||d.type===l.ElementType.TEXT||d.type===l.ElementType.SUBSCRIPT||d.type===l.ElementType.SUPERSCRIPT)for(;c<s.length;){const u=s[c+1];if(c++,u&&Gl(R,De(u,{extraPickAttrs:e}))){const h=u.value===_?`
83
- `:u.value;R.value+=h}else break}else c++;a.push(R)}return a}function Ji(o){switch(window.getComputedStyle(o).textAlign){case"left":case"start":return l.RowFlex.LEFT;case"center":return l.RowFlex.CENTER;case"right":case"end":return l.RowFlex.RIGHT;case"justify":return l.RowFlex.ALIGNMENT;case"justify-all":return l.RowFlex.JUSTIFY;default:return l.RowFlex.LEFT}}function Bi(o){return o===l.RowFlex.ALIGNMENT?"justify":o}function Al(o){switch(o){case l.RowFlex.LEFT:return"flex-start";case l.RowFlex.CENTER:return"center";case l.RowFlex.RIGHT:return"flex-end";case l.RowFlex.ALIGNMENT:case l.RowFlex.JUSTIFY:return"space-between";default:return"flex-start"}}function vn(o){return!o.type||$t.includes(o.type)}function kl(o){return!o.type||o.type===l.ElementType.TEXT}function $i(o){return o.filter(t=>vn(t)).map(t=>t.value).join("").replace(new RegExp(_,"g"),"")}function je(o,t){const e=o[t];if(!e)return null;const n=o[t+1];return!e.listId&&e.value===_&&n&&n.value!==_&&e.areaId===n.areaId?n:e}function Ut(o,t,e,n){let i=je(o,e);if(!i)return;const{isBreakWhenWrap:r=!1,editorOptions:s,ignoreContextKeys:a=[]}=n||{},{mode:c}=s||{};c!==l.EditorMode.DESIGN&&i.title?.disabled&&(i=ie(i,Eo));let d=!1;for(let R=0;R<t.length;R++){const u=t[R];if(r&&!i.listId&&po.test(u.value)&&(d=!0),d||!i.listId&&u.type===l.ElementType.LIST){const g=[...Be,...Bt,...Ke];Yi(g,a),Ye(g,i,u),u.valueList?.forEach(f=>{Ye(g,i,f)});continue}u.valueList?.length&&Ut(o,u.valueList,e,n);const h=[...No];nn(u)||h.push(...Bt),Yi(h,a),Ye(h,i,u)}}function Jl(o,t){let e="span";o.type===l.ElementType.SUPERSCRIPT?e="sup":o.type===l.ElementType.SUBSCRIPT&&(e="sub");const n=document.createElement(e);return n.style.fontFamily=o.font||t.defaultFont,o.rowFlex&&(n.style.textAlign=Bi(o.rowFlex)),o.color&&(n.style.color=o.color),o.bold&&(n.style.fontWeight="600"),o.italic&&(n.style.fontStyle="italic"),n.style.fontSize=`${o.size||t.defaultSize}px`,o.highlight&&(n.style.backgroundColor=o.highlight),o.underline&&(n.style.textDecoration="underline",n.style.textDecorationStyle=o.textDecoration?.style||"solid"),o.strikeout&&(n.style.textDecoration+=" line-through"),o.type&&n.setAttribute("data-type",o.type),o.rowMargin&&(n.style.lineHeight=(o.rowMargin??t.defaultRowMargin).toString()),n.innerText=o.value.replace(new RegExp(`${_}`,"g"),`
84
- `),n}function zi(o){let t=0;const e=new Map;for(let n=0;n<o.length;n++){const i=o[n];if(n===0){if(i.checkbox)continue;i.value=i.value.replace(po,"")}if(i.listWrap){const r=e.get(t)||[];r.push(i),e.set(t,r)}else{const r=i.value.split(`
85
- `);for(let s=0;s<r.length;s++){s>0&&(t+=1);const a=r[s],c=e.get(t)||[];c.push({...i,value:a}),e.set(t,c)}}}return e}function Bl(o){const t=[];if(!o.length)return t;let e=o[0]?.rowFlex||null;t.push({rowFlex:e,data:[o[0]]});for(let n=1;n<o.length;n++){const i=o[n],r=i.rowFlex||null;e===r&&!nn(i)&&!nn(o[n-1])?t[t.length-1].data.push(i):(t.push({rowFlex:r,data:[i]}),e=r)}for(let n=0;n<t.length;n++){const i=t[n];i.data=Pt(i.data)}return t}function qe(o,t){const e=Yo(t);function n(s){const a=document.createElement("div");for(let c=0;c<s.length;c++){const d=s[c];if(d.type===l.ElementType.TABLE){const R=document.createElement("table");R.setAttribute("cellSpacing","0"),R.setAttribute("cellpadding","0"),R.setAttribute("border","0");const u="1px solid #000000";!d.borderType||d.borderType===l.TableBorder.ALL?(R.style.borderTop=u,R.style.borderLeft=u):d.borderType===l.TableBorder.EXTERNAL&&(R.style.border=u),R.style.width=`${d.width}px`;const h=document.createElement("colgroup");for(let f=0;f<d.colgroup.length;f++){const T=d.colgroup[f],p=document.createElement("col");p.setAttribute("width",`${T.width}`),h.append(p)}R.append(h);const g=d.trList;for(let f=0;f<g.length;f++){const T=document.createElement("tr"),p=g[f];T.style.height=`${p.height}px`;for(let m=0;m<p.tdList.length;m++){const I=document.createElement("td");(!d.borderType||d.borderType===l.TableBorder.ALL)&&(I.style.borderBottom=I.style.borderRight="1px solid");const L=p.tdList[m];I.colSpan=L.colspan,I.rowSpan=L.rowspan,I.style.verticalAlign=L.verticalAlign||"top",L.borderTypes?.includes(l.TdBorder.TOP)&&(I.style.borderTop=u),L.borderTypes?.includes(l.TdBorder.RIGHT)&&(I.style.borderRight=u),L.borderTypes?.includes(l.TdBorder.BOTTOM)&&(I.style.borderBottom=u),L.borderTypes?.includes(l.TdBorder.LEFT)&&(I.style.borderLeft=u);const P=qe(L.value,t);I.innerHTML=P.innerHTML,L.backgroundColor&&(I.style.backgroundColor=L.backgroundColor),T.append(I)}R.append(T)}a.append(R)}else if(d.type===l.ElementType.HYPERLINK){const R=document.createElement("a");R.innerText=d.valueList.map(u=>u.value).join(""),d.url&&(R.href=d.url),a.append(R)}else if(d.type===l.ElementType.TITLE){const R=document.createElement(`h${bo[d.level]}`),u=n(d.valueList);R.innerHTML=u.innerHTML,a.append(R)}else if(d.type===l.ElementType.LIST){const R=document.createElement(Il[d.listType]);d.listStyle&&(R.style.listStyleType=Pl[d.listStyle]);const u=Pt(d.valueList);zi(u).forEach(g=>{const f=document.createElement("li"),T=n(g);f.innerHTML=T.innerHTML,R.append(f)}),a.append(R)}else if(d.type===l.ElementType.IMAGE){const R=document.createElement("img");d.value&&(R.src=d.value,R.width=d.width,R.height=d.height),a.append(R)}else if(d.type===l.ElementType.BLOCK){if(d.block?.type===l.BlockType.VIDEO){const R=d.block.videoBlock?.src;if(R){const u=document.createElement("video");u.style.display="block",u.controls=!0,u.src=R,u.width=d.width||t?.width||window.innerWidth,u.height=d.height,a.append(u)}}else if(d.block?.type===l.BlockType.IFRAME){const{src:R,srcdoc:u,sandbox:h,allow:g}=d.block.iframeBlock||{};if(R||u){const f=document.createElement("iframe");f.sandbox.add(...h||$e.sandbox),f.setAttribute("allow",[g||$e.allow].join(" ")),f.style.display="block",f.style.border="none",R?f.src=R:u&&(f.srcdoc=u),f.width=`${d.width||t?.width||window.innerWidth}`,f.height=`${d.height}`,a.append(f)}}}else if(d.type===l.ElementType.SEPARATOR){const R=document.createElement("hr");d.dashArray?.length&&R.setAttribute("data-dash-array",d.dashArray.join(",")),a.append(R)}else if(d.type===l.ElementType.CHECKBOX){const R=document.createElement("input");R.type="checkbox",d.checkbox?.value&&R.setAttribute("checked","true"),a.append(R)}else if(d.type===l.ElementType.RADIO){const R=document.createElement("input");R.type="radio",d.radio?.value&&R.setAttribute("checked","true"),a.append(R)}else if(d.type===l.ElementType.TAB){const R=document.createElement("span");R.innerHTML=`${Fi}${Fi}`,a.append(R)}else if(d.type===l.ElementType.CONTROL){const R=document.createElement("span"),u=n(d.control?.value||[]);R.innerHTML=u.innerHTML,a.append(R)}else if(d.type===l.ElementType.PAGE_BREAK){const R=document.createElement("div");R.style.breakAfter="page",a.append(R)}else if(!d.type||d.type===l.ElementType.LATEX||$t.includes(d.type)){let R="";if(d.type===l.ElementType.DATE?R=d.valueList?.map(h=>h.value).join("")||"":R=d.value,!R)continue;const u=Jl(d,e);s[c-1]?.type===l.ElementType.TITLE&&(R=R.replace(/^\n/,"")),u.innerText=R.replace(new RegExp(`${_}`,"g"),`
86
- `),a.append(u)}}return a}const i=document.createElement("div"),r=Bl(o);for(let s=0;s<r.length;s++){const a=r[s],c=!a.rowFlex||a.rowFlex===l.RowFlex.LEFT,d=document.createElement("div");if(!c){const R=a.data[0];nn(R)?(d.style.display="flex",d.style.justifyContent=Al(R.rowFlex)):(d.style.textAlign=Bi(a.rowFlex),a.rowFlex==="justify"&&(d.style.textAlignLast="justify"))}d.innerHTML=n(a.data).innerHTML,c?d.childNodes.forEach(R=>{i.append(R.cloneNode(!0))}):i.append(d)}return i}function $l(o){if(!o||o.nodeType!==3)return null;const t=o.parentNode,e=t.nodeName==="FONT"?t.parentNode:t,n=Ji(e),i=o.textContent,r=window.getComputedStyle(e);if(!i||e.nodeName==="STYLE")return null;const s={value:i,color:r.color,bold:Number(r.fontWeight)>500,italic:r.fontStyle.includes("italic"),size:Math.floor(parseFloat(r.fontSize))};return e.nodeName==="SUB"||r.verticalAlign==="sub"?s.type=l.ElementType.SUBSCRIPT:(e.nodeName==="SUP"||r.verticalAlign==="super")&&(s.type=l.ElementType.SUPERSCRIPT),n!==l.RowFlex.LEFT&&(s.rowFlex=n),r.backgroundColor!=="rgba(0, 0, 0, 0)"&&(s.highlight=r.backgroundColor),r.textDecorationLine.includes("underline")&&(s.underline=!0),r.textDecorationLine.includes("line-through")&&(s.strikeout=!0),s}function tn(o,t){const e=[];function n(c){if(c.nodeType===3){const d=$l(c);d&&e.push(d)}else if(c.nodeType===1){const d=c.childNodes;for(let R=0;R<d.length;R++){const u=d[R];if(u.nodeName==="BR")e.push({value:`
87
- `});else if(u.nodeName==="A"){const h=u,g=h.innerText;g&&e.push({type:l.ElementType.HYPERLINK,value:"",valueList:[{value:g}],url:h.href})}else if(/H[1-6]/.test(u.nodeName)){const g=tn(zl(u,"div").outerHTML,t);e.push({value:"",type:l.ElementType.TITLE,level:Ol[u.nodeName],valueList:g}),u.nextSibling&&!al.includes(u.nextSibling.nodeName)&&e.push({value:`
88
- `})}else if(u.nodeName==="UL"||u.nodeName==="OL"){const h=u,g={value:"",type:l.ElementType.LIST,valueList:[]};u.nodeName==="OL"?g.listType=l.ListType.OL:(g.listType=l.ListType.UL,g.listStyle=h.style.listStyleType),h.querySelectorAll("li").forEach(f=>{const T=tn(f.innerHTML,t);T.forEach(p=>{p.value===`
89
- `&&(p.listWrap=!0)}),T.unshift({value:`
81
+ `)&&(a.value=H),(a.type===l.ElementType.IMAGE||a.type===l.ElementType.BLOCK)&&(a.id=a.id||lt()),a.type===l.ElementType.LATEX){const{svg:c,width:d,height:R}=Gi.convertLaTextToSVG(a.value);a.width=a.width||d,a.height=a.height||R,a.laTexSVG=c,a.id=a.id||lt()}(a.type===l.ElementType.MACRO||a.type===l.ElementType.CUSTOM_MACRO||a.type===l.ElementType.REUSABLE_ITEM)&&(a.id=a.id||lt()),(a.type===l.ElementType.MENSTRUAL_HISTORY||a.type===l.ElementType.TOOTH_POSITION||a.type===l.ElementType.FETAL_HEART_POSITION||a.type===l.ElementType.SPECIAL_SYMBOLS)&&(a.id=a.id||lt()),s++}}function Jl(o,t){const e=Object.keys(o),n=Object.keys(t);if(e.length!==n.length)return!1;for(let i=0;i<e.length;i++){const r=e[i];if(r!=="value"&&!(r==="groupIds"&&Array.isArray(o[r])&&Array.isArray(t[r])&&Zi(o[r],t[r]))&&o[r]!==t[r])return!1}return!0}function Ue(o,t={}){const{extraPickAttrs:e}=t,n=[...ll];e&&n.push(...e);const i={value:o?.value===H?`
82
+ `:o?.value};return o&&n.forEach(r=>{const s=o[r];s!==void 0&&(i[r]=s)}),i}function Pt(o,t={}){const{extraPickAttrs:e,isClassifyArea:n=!1,isClone:i=!0,editorOptions:r}=t,s=(i?at(o):o).filter(d=>d.type!==l.ElementType.SPLIT_TAG),a=[];let c=0;for(;c<s.length;){let d=s[c];if(c===0&&d.value===H&&!d.listId&&(!d.type||d.type===l.ElementType.TEXT)){c++;continue}if(d.areaId){const u=d.areaId,h=d.area,g=[];for(;c<s.length;){const T=s[c];if(u!==T.areaId){c--;break}delete T.area,delete T.areaId,g.push(T),c++}const f=Pt(g,t);if(n){const T={type:l.ElementType.AREA,value:"",areaId:u,area:h};T.valueList=f,d=T}else{a.splice(c,0,...f);continue}}else if(d.titleId&&d.level){const u=d.titleId;if(u){const h=d.level,g={type:l.ElementType.TITLE,title:d.title,titleId:u,value:"",level:h},f=[];for(;c<s.length;){const T=s[c];if(u!==T.titleId){c--;break}delete T.level,delete T.title,f.push(T),c++}g.valueList=Pt(f,t),d=g}}else if(d.listId&&d.listType){const u=d.listId;if(u){const h=d.listType,g=d.listStyle,f=d?.label,T={type:l.ElementType.LIST,value:"",label:f||"",listId:u,listType:h,listStyle:g},m=[];for(;c<s.length;){const p=s[c];if(u!==p.listId){c--;break}delete p.listType,delete p.listStyle,m.push(p),c++}T.valueList=Pt(m,t),d=T}}else if(d.type===l.ElementType.TABLE){if(d.pagingId){let u=c+1,h=0;for(;u<s.length;){const g=s[u];if(g.pagingId===d.pagingId){d.height+=g.height;const f=g.trList.filter(T=>!T.pagingRepeat).filter(T=>(T.tdList=T.tdList.filter(m=>{if(m.originalId){for(let p=0;p<d.trList.length;p++){const L=d.trList[p].tdList.find(({id:P})=>P===m.originalId);if(L){m.value[0]?.type===l.ElementType.SPLIT_TAG&&m.value.splice(0,1),L.value.push(...m.value),L.rowspan=L.originalRowspan??L.rowspan;break}}return!1}return!0}),!T.originalId));d.trList.push(...f),d.trList?.forEach(T=>T.minHeight=T.originalMinHeight??T.minHeight),u++,h++}else break}c+=h}if(d.trList)for(let u=0;u<d.trList.length;u++){const h=d.trList[u];delete h.id;for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g],T={colspan:f.colspan,rowspan:f.rowspan,value:Pt(f.value,{...t,isClassifyArea:!1})};al.forEach(m=>{const p=f[m];p!==void 0&&(T[m]=p)}),h.tdList[g]=T}}}else if(d.type===l.ElementType.HYPERLINK){const u=d.hyperlinkId;if(u){const h={type:l.ElementType.HYPERLINK,value:"",url:d.url},g=[];for(;c<s.length;){const f=s[c];if(u!==f.hyperlinkId){c--;break}delete f.type,delete f.url,g.push(f),c++}h.valueList=Pt(g,t),d=h}}else if(d.type===l.ElementType.DATE){const u=d.dateId;if(u){const h={type:l.ElementType.DATE,value:"",dateFormat:d.dateFormat},g=[];for(;c<s.length;){const f=s[c];if(u!==f.dateId){c--;break}delete f.type,delete f.dateFormat,g.push(f),c++}h.valueList=Pt(g,t),d=h}}else if(d.type!==l.ElementType.BUTTON){if(d.controlId){const u=d.controlId;if(!(d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)&&d.controlComponent===l.ControlComponent.VALUE){if(d.type===l.ElementType.MENSTRUAL_HISTORY||d.type===l.ElementType.FETAL_HEART_POSITION||d.type===l.ElementType.TOOTH_POSITION||d.type===l.ElementType.MACRO||d.type===l.ElementType.CUSTOM_MACRO||d.type===l.ElementType.REUSABLE_ITEM||d.type===l.ElementType.LIST||d.type===l.ElementType.SPECIAL_SYMBOLS){let m=!1;for(let p=c-1;p>=0;p--){const I=s[p],L=I.controlComponent===l.ControlComponent.PREFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT;if(I.controlId===u&&L){m=!0;break}if(I.controlId!==u)break}if(!m){const p=at(d);delete p.controlId,delete p.control,delete p.controlComponent,delete p.originControlId,a.push(p),c++;continue}}c++;continue}if(d.controlComponent===l.ControlComponent.PLACEHOLDER||d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT||d.controlComponent===l.ControlComponent.PRE_TEXT||d.controlComponent===l.ControlComponent.CHECKBOX||d.controlComponent===l.ControlComponent.RADIO){c++;continue}const g=(T,m,p,I)=>{if(I===l.ControlType.CHECKBOX||I===l.ControlType.RADIO){let P=-1;for(let O=T;O<s.length&&s[O].controlId===m;O++)P=O;return P}const L=p?[l.ControlComponent.POSTTEXTFIX,l.ControlComponent.POSTTEXTFIX_TEXT]:[l.ControlComponent.POSTFIX];for(let P=T;P<s.length;P++){const O=s[P];if(O.controlId===m&&L.includes(O.controlComponent))return P}return-1},f=(T,m,p)=>{const I=[];let L=T;for(;L<=m;){const P=s[L];if(P.controlId&&P.controlId!==p&&P.control){const V=P.control?.type,Y=V===l.ControlType.TEXTFIELD,X=Y?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,W=P.controlComponent===X,E=V===l.ControlType.CHECKBOX||V===l.ControlType.RADIO;if(W||E&&(P.controlComponent===l.ControlComponent.CHECKBOX||P.controlComponent===l.ControlComponent.RADIO)){const C=g(L+1,P.controlId,Y,V);if(C!==-1){const M=s.slice(L,C+1).map(b=>{const D=at(b);return delete D.originControlId,D}),y=Pt(M,t);y.length>0&&I.push(y[0]),L=C+1;continue}}}if(!(P.controlId===p&&(P.controlComponent===l.ControlComponent.VALUE||!P.controlComponent)&&(!P.originControlId||P.originControlId===p)||P.originControlId===p&&P.controlComponent===l.ControlComponent.VALUE||P.controlId===p&&(P.controlComponent===l.ControlComponent.CHECKBOX||P.controlComponent===l.ControlComponent.RADIO)&&!P.originControlId)){L++;continue}if(P.type===l.ElementType.MENSTRUAL_HISTORY||P.type===l.ElementType.FETAL_HEART_POSITION||P.type===l.ElementType.TOOTH_POSITION||P.type===l.ElementType.MACRO||P.type===l.ElementType.CUSTOM_MACRO||P.type===l.ElementType.REUSABLE_ITEM||P.type===l.ElementType.LIST||P.type===l.ElementType.SPECIAL_SYMBOLS){const V=at(P);delete V.controlId,delete V.control,delete V.controlComponent,delete V.originControlId,I.push(V),L++;continue}if(P.controlComponent===l.ControlComponent.CHECKBOX||P.controlComponent===l.ControlComponent.RADIO){I.push(at(P)),L++;continue}const F=d.control?.type;if(F===l.ControlType.CHECKBOX||F===l.ControlType.RADIO){let V=L-1,Y=!1;for(;V>=T-1;){const X=s[V];if(X.controlId===p&&!X.originControlId)if(X.controlComponent===l.ControlComponent.CHECKBOX){Y=X.checkbox?.value===!0;break}else if(X.controlComponent===l.ControlComponent.RADIO){Y=X.radio?.value===!0;break}else if(X.controlComponent===l.ControlComponent.VALUE){V--;continue}else break;V--}if(Y){const X={value:P.value||""},W=[...Bt,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const E of W){const C=P[E];if(C!==void 0){if(E==="color"&&r){const M=r.control?.bracketColor,y=r.control?.placeholderColor;if(C===M||C===y)continue}X[E]=C}}I.push(X)}}else{const V={value:P.value||""},Y=[...Bt,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const X of Y){const W=P[X];if(W!==void 0){if(X==="color"&&r){const E=r.control?.bracketColor,C=r.control?.placeholderColor;if(W===E||W===C)continue}V[X]=W}}I.push(V)}L++}return I};if(d.controlComponent===l.ControlComponent.PREFIX){const T=d.control?.type===l.ControlType.TEXTFIELD,m=g(c+1,u,T);if(m!==-1){const p=f(c+1,m-1,u),I=Dt(d,Gt),L={...d.control,...I,value:p},P={...Dt(d,Bt),type:l.ElementType.CONTROL,value:"",control:L,controlId:u};d=Ue(P,{extraPickAttrs:e}),c=m}}if(d.controlComponent===l.ControlComponent.PRETEXTFIX){const T=g(c+1,u,!0);if(T!==-1){const m=f(c+1,T-1,u),p=Dt(d,Gt),I={...d.control,...p,value:m},L={...Dt(d,Bt),type:l.ElementType.CONTROL,value:"",control:I,controlId:u};d=Ue(L,{extraPickAttrs:e}),c=T}}if(d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){const T=g(c+1,u,!0);if(T!==-1){const m=f(c+1,T-1,u),p=Dt(d,Gt),I={...d.control,...p,value:m},L={...Dt(d,Bt),type:l.ElementType.CONTROL,value:"",control:I,controlId:u};d=Ue(L,{extraPickAttrs:e}),c=T}}}}const R=Ue(d,{extraPickAttrs:e});if(!d.type||d.type===l.ElementType.TEXT||d.type===l.ElementType.SUBSCRIPT||d.type===l.ElementType.SUPERSCRIPT)for(;c<s.length;){const u=s[c+1];if(c++,u&&Jl(R,Ue(u,{extraPickAttrs:e}))){const h=u.value===H?`
83
+ `:u.value;R.value+=h}else break}else c++;a.push(R)}return a}function zi(o){switch(window.getComputedStyle(o).textAlign){case"left":case"start":return l.RowFlex.LEFT;case"center":return l.RowFlex.CENTER;case"right":case"end":return l.RowFlex.RIGHT;case"justify":return l.RowFlex.ALIGNMENT;case"justify-all":return l.RowFlex.JUSTIFY;default:return l.RowFlex.LEFT}}function ji(o){return o===l.RowFlex.ALIGNMENT?"justify":o}function Bl(o){switch(o){case l.RowFlex.LEFT:return"flex-start";case l.RowFlex.CENTER:return"center";case l.RowFlex.RIGHT:return"flex-end";case l.RowFlex.ALIGNMENT:case l.RowFlex.JUSTIFY:return"space-between";default:return"flex-start"}}function _n(o){return!o.type||$t.includes(o.type)}function $l(o){return!o.type||o.type===l.ElementType.TEXT}function qi(o){return o.filter(t=>_n(t)).map(t=>t.value).join("").replace(new RegExp(H,"g"),"")}function en(o,t){const e=o[t];if(!e)return null;const n=o[t+1];return!e.listId&&e.value===H&&n&&n.value!==H&&e.areaId===n.areaId?n:e}function Ut(o,t,e,n){let i=en(o,e);if(!i)return;const{isBreakWhenWrap:r=!1,editorOptions:s,ignoreContextKeys:a=[]}=n||{},{mode:c}=s||{};c!==l.EditorMode.DESIGN&&i.title?.disabled&&(i=ie(i,Fo));let d=!1;for(let R=0;R<t.length;R++){const u=t[R];if(r&&!i.listId&&Po.test(u.value)&&(d=!0),d||!i.listId&&u.type===l.ElementType.LIST){const g=[...je,...Bt,...xe];wi(g,a),De(g,i,u),u.valueList?.forEach(f=>{De(g,i,f)});continue}u.valueList?.length&&Ut(o,u.valueList,e,n);const h=[...bo];rn(u)||h.push(...Bt),wi(h,a),De(h,i,u)}}function zl(o,t){let e="span";o.type===l.ElementType.SUPERSCRIPT?e="sup":o.type===l.ElementType.SUBSCRIPT&&(e="sub");const n=document.createElement(e);return n.style.fontFamily=o.font||t.defaultFont,o.rowFlex&&(n.style.textAlign=ji(o.rowFlex)),o.color&&(n.style.color=o.color),o.bold&&(n.style.fontWeight="600"),o.italic&&(n.style.fontStyle="italic"),n.style.fontSize=`${o.size||t.defaultSize}px`,o.highlight&&(n.style.backgroundColor=o.highlight),o.underline&&(n.style.textDecoration="underline",n.style.textDecorationStyle=o.textDecoration?.style||"solid"),o.strikeout&&(n.style.textDecoration+=" line-through"),o.type&&n.setAttribute("data-type",o.type),o.rowMargin&&(n.style.lineHeight=(o.rowMargin??t.defaultRowMargin).toString()),n.innerText=o.value.replace(new RegExp(`${H}`,"g"),`
84
+ `),n}function ts(o){let t=0;const e=new Map;for(let n=0;n<o.length;n++){const i=o[n];if(n===0){if(i.checkbox)continue;i.value=i.value.replace(Po,"")}if(i.listWrap){const r=e.get(t)||[];r.push(i),e.set(t,r)}else{const r=i.value.split(`
85
+ `);for(let s=0;s<r.length;s++){s>0&&(t+=1);const a=r[s],c=e.get(t)||[];c.push({...i,value:a}),e.set(t,c)}}}return e}function jl(o){const t=[];if(!o.length)return t;let e=o[0]?.rowFlex||null;t.push({rowFlex:e,data:[o[0]]});for(let n=1;n<o.length;n++){const i=o[n],r=i.rowFlex||null;e===r&&!rn(i)&&!rn(o[n-1])?t[t.length-1].data.push(i):(t.push({rowFlex:r,data:[i]}),e=r)}for(let n=0;n<t.length;n++){const i=t[n];i.data=Pt(i.data)}return t}function nn(o,t){const e=wo(t);function n(s){const a=document.createElement("div");for(let c=0;c<s.length;c++){const d=s[c];if(d.type===l.ElementType.TABLE){const R=document.createElement("table");R.setAttribute("cellSpacing","0"),R.setAttribute("cellpadding","0"),R.setAttribute("border","0");const u="1px solid #000000";!d.borderType||d.borderType===l.TableBorder.ALL?(R.style.borderTop=u,R.style.borderLeft=u):d.borderType===l.TableBorder.EXTERNAL&&(R.style.border=u),R.style.width=`${d.width}px`;const h=document.createElement("colgroup");for(let f=0;f<d.colgroup.length;f++){const T=d.colgroup[f],m=document.createElement("col");m.setAttribute("width",`${T.width}`),h.append(m)}R.append(h);const g=d.trList;for(let f=0;f<g.length;f++){const T=document.createElement("tr"),m=g[f];T.style.height=`${m.height}px`;for(let p=0;p<m.tdList.length;p++){const I=document.createElement("td");(!d.borderType||d.borderType===l.TableBorder.ALL)&&(I.style.borderBottom=I.style.borderRight="1px solid");const L=m.tdList[p];I.colSpan=L.colspan,I.rowSpan=L.rowspan,I.style.verticalAlign=L.verticalAlign||"top",L.borderTypes?.includes(l.TdBorder.TOP)&&(I.style.borderTop=u),L.borderTypes?.includes(l.TdBorder.RIGHT)&&(I.style.borderRight=u),L.borderTypes?.includes(l.TdBorder.BOTTOM)&&(I.style.borderBottom=u),L.borderTypes?.includes(l.TdBorder.LEFT)&&(I.style.borderLeft=u);const P=nn(L.value,t);I.innerHTML=P.innerHTML,L.backgroundColor&&(I.style.backgroundColor=L.backgroundColor),T.append(I)}R.append(T)}a.append(R)}else if(d.type===l.ElementType.HYPERLINK){const R=document.createElement("a");R.innerText=d.valueList.map(u=>u.value).join(""),d.url&&(R.href=d.url),a.append(R)}else if(d.type===l.ElementType.TITLE){const R=document.createElement(`h${Do[d.level]}`),u=n(d.valueList);R.innerHTML=u.innerHTML,a.append(R)}else if(d.type===l.ElementType.LIST){const R=document.createElement(Ol[d.listType]);d.listStyle&&(R.style.listStyleType=Cl[d.listStyle]);const u=Pt(d.valueList);ts(u).forEach(g=>{const f=document.createElement("li"),T=n(g);f.innerHTML=T.innerHTML,R.append(f)}),a.append(R)}else if(d.type===l.ElementType.IMAGE){const R=document.createElement("img");d.value&&(R.src=d.value,R.width=d.width,R.height=d.height),a.append(R)}else if(d.type===l.ElementType.BLOCK){if(d.block?.type===l.BlockType.VIDEO){const R=d.block.videoBlock?.src;if(R){const u=document.createElement("video");u.style.display="block",u.controls=!0,u.src=R,u.width=d.width||t?.width||window.innerWidth,u.height=d.height,a.append(u)}}else if(d.block?.type===l.BlockType.IFRAME){const{src:R,srcdoc:u,sandbox:h,allow:g}=d.block.iframeBlock||{};if(R||u){const f=document.createElement("iframe");f.sandbox.add(...h||qe.sandbox),f.setAttribute("allow",[g||qe.allow].join(" ")),f.style.display="block",f.style.border="none",R?f.src=R:u&&(f.srcdoc=u),f.width=`${d.width||t?.width||window.innerWidth}`,f.height=`${d.height}`,a.append(f)}}}else if(d.type===l.ElementType.SEPARATOR){const R=document.createElement("hr");d.dashArray?.length&&R.setAttribute("data-dash-array",d.dashArray.join(",")),a.append(R)}else if(d.type===l.ElementType.CHECKBOX){const R=document.createElement("input");R.type="checkbox",d.checkbox?.value&&R.setAttribute("checked","true"),a.append(R)}else if(d.type===l.ElementType.RADIO){const R=document.createElement("input");R.type="radio",d.radio?.value&&R.setAttribute("checked","true"),a.append(R)}else if(d.type===l.ElementType.TAB){const R=document.createElement("span");R.innerHTML=`${Wi}${Wi}`,a.append(R)}else if(d.type===l.ElementType.CONTROL){const R=document.createElement("span"),u=n(d.control?.value||[]);R.innerHTML=u.innerHTML,a.append(R)}else if(d.type===l.ElementType.PAGE_BREAK){const R=document.createElement("div");R.style.breakAfter="page",a.append(R)}else if(!d.type||d.type===l.ElementType.LATEX||$t.includes(d.type)){let R="";if(d.type===l.ElementType.DATE?R=d.valueList?.map(h=>h.value).join("")||"":R=d.value,!R)continue;const u=zl(d,e);s[c-1]?.type===l.ElementType.TITLE&&(R=R.replace(/^\n/,"")),u.innerText=R.replace(new RegExp(`${H}`,"g"),`
86
+ `),a.append(u)}}return a}const i=document.createElement("div"),r=jl(o);for(let s=0;s<r.length;s++){const a=r[s],c=!a.rowFlex||a.rowFlex===l.RowFlex.LEFT,d=document.createElement("div");if(!c){const R=a.data[0];rn(R)?(d.style.display="flex",d.style.justifyContent=Bl(R.rowFlex)):(d.style.textAlign=ji(a.rowFlex),a.rowFlex==="justify"&&(d.style.textAlignLast="justify"))}d.innerHTML=n(a.data).innerHTML,c?d.childNodes.forEach(R=>{i.append(R.cloneNode(!0))}):i.append(d)}return i}function ql(o){if(!o||o.nodeType!==3)return null;const t=o.parentNode,e=t.nodeName==="FONT"?t.parentNode:t,n=zi(e),i=o.textContent,r=window.getComputedStyle(e);if(!i||e.nodeName==="STYLE")return null;const s={value:i,color:r.color,bold:Number(r.fontWeight)>500,italic:r.fontStyle.includes("italic"),size:Math.floor(parseFloat(r.fontSize))};return e.nodeName==="SUB"||r.verticalAlign==="sub"?s.type=l.ElementType.SUBSCRIPT:(e.nodeName==="SUP"||r.verticalAlign==="super")&&(s.type=l.ElementType.SUPERSCRIPT),n!==l.RowFlex.LEFT&&(s.rowFlex=n),r.backgroundColor!=="rgba(0, 0, 0, 0)"&&(s.highlight=r.backgroundColor),r.textDecorationLine.includes("underline")&&(s.underline=!0),r.textDecorationLine.includes("line-through")&&(s.strikeout=!0),s}function on(o,t){const e=[];function n(c){if(c.nodeType===3){const d=ql(c);d&&e.push(d)}else if(c.nodeType===1){const d=c.childNodes;for(let R=0;R<d.length;R++){const u=d[R];if(u.nodeName==="BR")e.push({value:`
87
+ `});else if(u.nodeName==="A"){const h=u,g=h.innerText;g&&e.push({type:l.ElementType.HYPERLINK,value:"",valueList:[{value:g}],url:h.href})}else if(/H[1-6]/.test(u.nodeName)){const g=on(ta(u,"div").outerHTML,t);e.push({value:"",type:l.ElementType.TITLE,level:El[u.nodeName],valueList:g}),u.nextSibling&&!Rl.includes(u.nextSibling.nodeName)&&e.push({value:`
88
+ `})}else if(u.nodeName==="UL"||u.nodeName==="OL"){const h=u,g={value:"",type:l.ElementType.LIST,valueList:[]};u.nodeName==="OL"?g.listType=l.ListType.OL:(g.listType=l.ListType.UL,g.listStyle=h.style.listStyleType),h.querySelectorAll("li").forEach(f=>{const T=on(f.innerHTML,t);T.forEach(m=>{m.value===`
89
+ `&&(m.listWrap=!0)}),T.unshift({value:`
90
90
  `}),g.valueList.push(...T)}),e.push(g)}else if(u.nodeName==="HR")e.push({value:`
91
- `,type:l.ElementType.SEPARATOR});else if(u.nodeName==="IMG"){const{src:h,width:g,height:f}=u;h&&g&&f&&e.push({width:g,height:f,value:h,type:l.ElementType.IMAGE,rowFlex:Ji(u.parentElement)})}else if(u.nodeName==="VIDEO"){const{src:h,width:g,height:f}=u;h&&g&&f&&e.push({value:"",type:l.ElementType.BLOCK,block:{type:l.BlockType.VIDEO,videoBlock:{src:h}},width:g,height:f})}else if(u.nodeName==="IFRAME"){const{src:h,srcdoc:g,width:f,height:T}=u;(h||g)&&f&&T&&e.push({value:"",type:l.ElementType.BLOCK,block:{type:l.BlockType.IFRAME,iframeBlock:{src:h,srcdoc:g}},width:parseInt(f),height:parseInt(T)})}else if(u.nodeName==="TABLE"){const h=u,g={type:l.ElementType.TABLE,value:`
92
- `,colgroup:[],trList:[]},f=h.querySelectorAll("colgroup col");if(h.querySelectorAll("tr").forEach(T=>{const p=Number(window.getComputedStyle(T).height.replace("px","")),m={height:p,minHeight:p,tdList:[]};T.querySelectorAll("th,td").forEach(I=>{const L=I,P=tn(L.innerHTML,t),O={colspan:L.colSpan,rowspan:L.rowSpan,value:P,verticalAlign:window.getComputedStyle(I).verticalAlign,width:parseFloat(window.getComputedStyle(I).width)};L.style.backgroundColor&&(O.backgroundColor=L.style.backgroundColor),m.tdList.push(O)}),g.trList.push(m)}),g.trList.length){const T=g.trList[0].tdList.reduce((m,I)=>m+I.colspan,0),p=Math.ceil(t.innerWidth/T);for(let m=0;m<T;m++){const I=f[m]?.getAttribute("width");g.colgroup.push({width:I?parseFloat(I):p})}e.push(g)}}else if(u.nodeName==="INPUT"&&u.type===l.ControlComponent.CHECKBOX)e.push({type:l.ElementType.CHECKBOX,value:"",checkbox:{value:u.checked}});else if(u.nodeName==="INPUT"&&u.type===l.ControlComponent.RADIO)e.push({type:l.ElementType.RADIO,value:"",radio:{value:u.checked}});else if(n(u),u.nodeType===1&&R!==d.length-1){const h=u;window.getComputedStyle(h).display==="block"&&!/(\n|\r\n)$/.test(h.textContent)&&e.push({value:`
93
- `})}}}}const i=document.createElement("div");document.body.appendChild(i);const r=i.attachShadow({mode:"open"}),s=document.createElement("div");s.innerHTML=o,r.appendChild(s);const a=[];return s.childNodes.forEach(c=>{c.nodeType!==1&&!c.textContent?.trim()&&a.push(c)}),a.forEach(c=>c.remove()),n(s),i.remove(),e}function en(o){function t(e){let n="";for(let i=0;i<e.length;i++){const r=e[i];if(r.type===l.ElementType.TABLE){n+=`
91
+ `,type:l.ElementType.SEPARATOR});else if(u.nodeName==="IMG"){const{src:h,width:g,height:f}=u;h&&g&&f&&e.push({width:g,height:f,value:h,type:l.ElementType.IMAGE,rowFlex:zi(u.parentElement)})}else if(u.nodeName==="VIDEO"){const{src:h,width:g,height:f}=u;h&&g&&f&&e.push({value:"",type:l.ElementType.BLOCK,block:{type:l.BlockType.VIDEO,videoBlock:{src:h}},width:g,height:f})}else if(u.nodeName==="IFRAME"){const{src:h,srcdoc:g,width:f,height:T}=u;(h||g)&&f&&T&&e.push({value:"",type:l.ElementType.BLOCK,block:{type:l.BlockType.IFRAME,iframeBlock:{src:h,srcdoc:g}},width:parseInt(f),height:parseInt(T)})}else if(u.nodeName==="TABLE"){const h=u,g={type:l.ElementType.TABLE,value:`
92
+ `,colgroup:[],trList:[]},f=h.querySelectorAll("colgroup col");if(h.querySelectorAll("tr").forEach(T=>{const m=Number(window.getComputedStyle(T).height.replace("px","")),p={height:m,minHeight:m,tdList:[]};T.querySelectorAll("th,td").forEach(I=>{const L=I,P=on(L.innerHTML,t),O={colspan:L.colSpan,rowspan:L.rowSpan,value:P,verticalAlign:window.getComputedStyle(I).verticalAlign,width:parseFloat(window.getComputedStyle(I).width)};L.style.backgroundColor&&(O.backgroundColor=L.style.backgroundColor),p.tdList.push(O)}),g.trList.push(p)}),g.trList.length){const T=g.trList[0].tdList.reduce((p,I)=>p+I.colspan,0),m=Math.ceil(t.innerWidth/T);for(let p=0;p<T;p++){const I=f[p]?.getAttribute("width");g.colgroup.push({width:I?parseFloat(I):m})}e.push(g)}}else if(u.nodeName==="INPUT"&&u.type===l.ControlComponent.CHECKBOX)e.push({type:l.ElementType.CHECKBOX,value:"",checkbox:{value:u.checked}});else if(u.nodeName==="INPUT"&&u.type===l.ControlComponent.RADIO)e.push({type:l.ElementType.RADIO,value:"",radio:{value:u.checked}});else if(n(u),u.nodeType===1&&R!==d.length-1){const h=u;window.getComputedStyle(h).display==="block"&&!/(\n|\r\n)$/.test(h.textContent)&&e.push({value:`
93
+ `})}}}}const i=document.createElement("div");document.body.appendChild(i);const r=i.attachShadow({mode:"open"}),s=document.createElement("div");s.innerHTML=o,r.appendChild(s);const a=[];return s.childNodes.forEach(c=>{c.nodeType!==1&&!c.textContent?.trim()&&a.push(c)}),a.forEach(c=>c.remove()),n(s),i.remove(),e}function sn(o){function t(e){let n="";for(let i=0;i<e.length;i++){const r=e[i];if(r.type===l.ElementType.TABLE){n+=`
94
94
  `;const s=r.trList;for(let a=0;a<s.length;a++){const c=s[a];for(let d=0;d<c.tdList.length;d++){const R=c.tdList[d],u=t(Pt(R.value)),h=d===0,g=c.tdList.length-1===d;n+=`${h?"":" "}${u}${g?`
95
- `:""}`}}}else if(r.type===l.ElementType.TAB)n+=" ";else if(r.type===l.ElementType.HYPERLINK)n+=r.valueList.map(s=>s.value).join("");else if(r.type===l.ElementType.TITLE)n+=`${t(Pt(r.valueList))}`;else if(r.type===l.ElementType.LIST){const s=Pt(r.valueList),a=zi(s);let c="";r.listType===l.ListType.UL&&(c=Wo[r.listStyle]),a.forEach((d,R)=>{const u=a.size-1===R;n+=`
95
+ `:""}`}}}else if(r.type===l.ElementType.TAB)n+=" ";else if(r.type===l.ElementType.HYPERLINK)n+=r.valueList.map(s=>s.value).join("");else if(r.type===l.ElementType.TITLE)n+=`${t(Pt(r.valueList))}`;else if(r.type===l.ElementType.LIST){const s=Pt(r.valueList),a=ts(s);let c="";r.listType===l.ListType.UL&&(c=Yo[r.listStyle]),a.forEach((d,R)=>{const u=a.size-1===R;n+=`
96
96
  ${c||`${R+1}.`}${t(d)}${u?`
97
- `:""}`})}else if(r.type===l.ElementType.CHECKBOX)n+=r.checkbox?.value?"☑":"□";else if(r.type===l.ElementType.RADIO)n+=r.radio?.value?"☉":"○";else if(!r.type||r.type===l.ElementType.LATEX||$t.includes(r.type)){let s="";if(r.type===l.ElementType.CONTROL){const a=r.control.value?.[0]?.value||"";s=a?`${r.control?.preText||""}${a}${r.control?.postText||""}`:""}else r.type===l.ElementType.DATE?s=r.valueList?.map(a=>a.value).join("")||"":s=r.value;n+=s.replace(new RegExp(`${_}`,"g"),`
98
- `)}}return n}return t(Pt(o))}function Uo(o){return Lo(o,["metrics","style"])}function nn(o){return!!o?.type&&(ll.includes(o.type)||o.imgDisplay===l.ImageDisplay.INLINE)}function zl(o,t){const e=document.createElement(t);for(let n=0;n<o.attributes.length;n++){const i=o.attributes[n];e.setAttribute(i.name,i.value)}return e.innerHTML=o.innerHTML,e}function wo(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e];n?.imgDisplay===l.ImageDisplay.SURROUND&&t.push(n)}return t}function jl(o,t){for(let e=o.length-1;e>=0;e--)o[e].imgFloatPosition?.pageNo===t&&o.splice(e,1)}function Ln(o,t,e=l.LocationPosition.BEFORE){if(!o[t]?.hide&&!o[t]?.control?.hide&&!o[t]?.area?.hide)return t;let n=t;if(e===l.LocationPosition.BEFORE)for(n=t-1;n>0;){if(!o[n]?.hide&&!o[n]?.control?.hide&&!o[n]?.area?.hide)return n;n--}else for(n=t+1;n<o.length;){if(!o[n]?.hide&&!o[n]?.control?.hide&&!o[n]?.area?.hide)return n;n++}return n}const ji=`${Tn}-control`;function ql(o){localStorage.setItem(Tn,JSON.stringify({text:o.text,elementList:o.elementList}))}function qi(){const o=localStorage.getItem(Tn);return o?JSON.parse(o):null}function ts(){localStorage.removeItem(Tn)}function ta(o){localStorage.setItem(ji,JSON.stringify(o))}function es(){const o=localStorage.getItem(ji);return o?JSON.parse(o):null}function ea(){return!!es()?.element}async function na(o,t,e){if(!o&&!t&&!e.length)return;const n=new Blob([o],{type:"text/plain"}),i=new Blob([t],{type:"text/html"});if(window.ClipboardItem){const r=new ClipboardItem({[n.type]:n,[i.type]:i});await window.navigator.clipboard.write([r])}else{const r=document.createElement("div");r.setAttribute("contenteditable","true"),r.innerHTML=t,document.body.append(r);const s=window.getSelection(),a=document.createRange(),c=document.createElement("span");c.innerText=`
99
- `,r.append(c),a.selectNodeContents(r),s?.removeAllRanges(),s?.addRange(a),document.execCommand("copy"),r.remove()}ql({text:o,elementList:e})}async function ns(o,t){const e=qe(o,t);document.body.append(e);const n=e.innerText;e.remove();const i=e.innerHTML;!n&&!i&&!o.length||await na(n,i,Pt(o))}function oa(o){let t=!1;for(let e=0;e<o.items.length;e++)if(o.items[e].kind==="file"){t=!0;break}return t}function Zo(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled()||e.getControl().getIsDisabledPasteControl())return;const n=e.getRange(),{startIndex:i}=n.getRange(),r=e.getElementList();if(~i&&!n.getIsSelectAll()){const s=r[i];if(s?.titleId||s?.listId){let a=0;for(;a<t.length;){const c=t[a];if(s.titleId&&/^\n/.test(c.value))break;if(cl.includes(c.type)){if(t.splice(a,1),c.valueList)for(let d=0;d<c.valueList.length;d++){const R=c.valueList[d];R.value===_||R.value===`
100
- `||(t.splice(a,0,R),a++)}a--}a++}}Ut(r,t,i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()})}e.insertElementList(t)}function os(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=tn(t,{innerWidth:e.getOriginalInnerWidth()});Zo(o,n)}function Qo(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=e.getRange(),{startIndex:i}=n.getRange(),r=e.getElementList(),s=new FileReader;s.readAsDataURL(t),s.onload=()=>{const a=new Image,c=s.result;a.src=c,a.onload=()=>{const d={value:c,type:l.ElementType.IMAGE,width:a.width,height:a.height};~i&&Ut(r,[d],i,{editorOptions:e.getOptions()}),e.insertElementList([d])}}}function ia(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=t.clipboardData;if(!n)return;const{paste:i}=e.getOverride();if(i&&i(t)?.preventDefault!==!1)return;if(!oa(n)){const s=n.getData("text"),a=qi();if(a&&Un(s)===Un(a.text)){Zo(o,a.elementList);return}}ts();let r=!1;for(let s=0;s<n.items.length;s++)if(n.items[s].type==="text/html"){r=!0;break}for(let s=0;s<n.items.length;s++){const a=n.items[s];if(a.kind==="string"){if(a.type==="text/plain"&&!r){a.getAsString(c=>{o.input(c)});break}if(a.type==="text/html"&&r){a.getAsString(c=>{os(o,c)});break}}else if(a.kind==="file"&&a.type.includes("image")){const c=a.getAsFile();c&&Qo(o,c)}}}async function sa(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const{paste:n}=e.getOverride();if(n&&n()?.preventDefault!==!1)return;const i=await navigator.clipboard.readText(),r=qi();if(r&&Un(i)===Un(r.text)){Zo(o,r.elementList);return}if(ts(),t?.isPlainText)i&&o.input(i);else{const s=await navigator.clipboard.read();let a=!1;for(const c of s)if(c.types.includes("text/html")){a=!0;break}for(const c of s)if(c.types.includes("text/plain")&&!a){const R=await(await c.getType("text/plain")).text();R&&o.input(R)}else if(c.types.includes("text/html")&&a){const R=await(await c.getType("text/html")).text();R&&os(o,R)}else if(c.types.some(d=>d.startsWith("image/"))){const d=c.types.find(u=>u.startsWith("image/")),R=await c.getType(d);Qo(o,R)}}}class ra{draw;container;agentCursorDom;canvasEvent;eventBus;constructor(t,e){this.draw=t,this.container=t.getContainer(),this.canvasEvent=e,this.eventBus=t.getEventBus();const n=document.createElement("textarea");n.autocomplete="off",n.classList.add(`${z}-inputarea`),n.innerText="",this.container.append(n),this.agentCursorDom=n,n.onkeydown=i=>this._keyDown(i),n.oninput=this._input.bind(this),n.onpaste=i=>this._paste(i),n.addEventListener("compositionstart",this._compositionstart.bind(this)),n.addEventListener("compositionupdate",this._compositionupdate.bind(this)),n.addEventListener("compositionend",this._compositionend.bind(this)),n.addEventListener("keydown",this._keydown.bind(this)),this.eventBus.on("rangeStyleChange",i=>{this.agentCursorDom.style.fontSize=Math.max(i.size,18)+"px"})}getAgentCursorDom(){return this.agentCursorDom}_keyDown(t){this.draw.isInteractionSuspended()||this.canvasEvent.keydown(t)}_input(t){if(this.draw.isInteractionSuspended())return;const e=t.data;e&&this.canvasEvent.input(e),this.eventBus.isSubscribe("input")&&this.eventBus.emit("input",t)}_paste(t){this.draw.isInteractionSuspended()||this.draw.isReadonly()||!t.clipboardData||(ia(this.canvasEvent,t),t.preventDefault())}_compositionstart(){this.draw.isInteractionSuspended()||(this.agentCursorDom.style.zIndex="1000",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="#000",this.agentCursorDom.style.background="#fff",this.canvasEvent.compositionstart())}_compositionupdate(){if(this.draw.isInteractionSuspended())return;this.agentCursorDom.style.width="9999px";let t=this.agentCursorDom.scrollWidth;const e=this.container.clientWidth,n=Math.max(e-this.agentCursorDom.offsetLeft,100);t>n&&(t=n),this.agentCursorDom.style.width=t+"px"}_compositionend(t){this.draw.isInteractionSuspended()||(this.agentCursorDom.style.zIndex="-1",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="",this.agentCursorDom.style.background="",this.canvasEvent.compositionend(t))}_keydown(t){this.draw.isInteractionSuspended()||this.canvasEvent.isComposing&&t.code==="Escape"&&this.canvasEvent.compositionCancel()}}class la{ANIMATION_CLASS=`${z}-cursor--animation`;draw;container;options;position;cursorDom;cursorAgent;blinkTimeout;hitLineStartIndex;constructor(t,e){this.draw=t,this.container=t.getContainer(),this.position=t.getPosition(),this.options=t.getOptions(),this.cursorDom=document.createElement("div"),this.cursorDom.classList.add(`${z}-cursor`),this.container.append(this.cursorDom),this.cursorAgent=new ra(t,e),this.blinkTimeout=null}getCursorDom(){return this.cursorDom}getAgentDom(){return this.cursorAgent.getAgentCursorDom()}getAgentIsActive(){return this.getAgentDom()===document.activeElement}getAgentDomValue(){return this.getAgentDom().value}clearAgentDomValue(){this.getAgentDom().value=""}getHitLineStartIndex(){return this.hitLineStartIndex}_blinkStart(){this.cursorDom.classList.add(this.ANIMATION_CLASS)}_blinkStop(){this.cursorDom.classList.remove(this.ANIMATION_CLASS)}_setBlinkTimeout(){this._clearBlinkTimeout(),this.blinkTimeout=window.setTimeout(()=>{this._blinkStart()},500)}_clearBlinkTimeout(){this.blinkTimeout&&(this._blinkStop(),window.clearTimeout(this.blinkTimeout),this.blinkTimeout=null)}focus(){if(el&&this.draw.isReadonly())return;const t=this.cursorAgent.getAgentCursorDom();document.activeElement!==t&&(t.focus(),t.setSelectionRange(0,0))}drawCursor(t){let e=this.position.getCursorPosition();if(!e)return;const{scale:n,cursor:i}=this.options,{color:r,width:s,isShow:a=!0,isBlink:c=!0,isFocus:d=!0,hitLineStartIndex:R}={...i,...t},u=this.draw.getHeight(),h=this.draw.getPageGap();this.hitLineStartIndex=R,R&&(e=this.position.getPositionList()[R]);const{metrics:g,coordinate:{leftTop:f,rightTop:T},ascent:p,pageNo:m}=e,P=(this.draw.getZone().isMainActive()?m:this.draw.getPageNo())*(u+h),O=jr*n,S=Math.min(g.height/4,O),F=g.height+S*2,N=this.cursorAgent.getAgentCursorDom();d&&setTimeout(()=>{this.focus()});const V=g.boundingBoxDescent<0?0:g.boundingBoxDescent,Y=f[1]+p+V-(F-S)+P,X=R?f[0]:T[0];if(N.style.left=`${X}px`,N.style.top=`${Y+F-O}px`,!a){this.recoveryCursor();return}const b=this.cursorDom.style.top,E=this.draw.isReadonly();this.cursorDom.style.width=`${s*n}px`,this.cursorDom.style.backgroundColor=r,this.cursorDom.style.left=`${X}px`,this.cursorDom.style.top=`${Y}px`,this.cursorDom.style.display=E?"none":"block",this.cursorDom.style.height=`${F}px`,c?this._setBlinkTimeout():this._clearBlinkTimeout(),Oo(()=>{this.moveCursorToVisible({cursorPosition:e,direction:parseInt(b)>Y?Zt.UP:Zt.DOWN})})}recoveryCursor(){this.cursorDom.style.display="none",this._clearBlinkTimeout()}moveCursorToVisible(t){const{cursorPosition:e,direction:n}=t;if(!e||!n)return;const{pageNo:i,coordinate:{leftTop:r,leftBottom:s}}=e,a=Jr(this.container),c={left:0,right:0,top:0,bottom:0},d=a===document.documentElement;if(d)c.right=window.innerWidth,c.bottom=window.innerHeight;else{const{left:T,right:p,top:m,bottom:I}=a.getBoundingClientRect();c.left=T,c.right=p,c.top=m,c.bottom=I}const R=i*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,u=n===Zt.UP,h=s[0]+(d?0:c.left),g=u?r[1]+R:s[1]+R,{maskMargin:f}=this.options;if(c.top+=f[0],c.bottom-=f[2],!(h>=c.left&&h<=c.right&&g>=c.top&&g<=c.bottom)){const{scrollLeft:T,scrollTop:p}=a;u?a.scroll(T,p-(c.top-g)):a.scroll(T,p+g-c.bottom)}}}var Kn;(function(o){o[o.LEFT=0]="LEFT",o[o.CENTER=1]="CENTER",o[o.RIGHT=2]="RIGHT"})(Kn||(Kn={}));function fe(o){return ve?o.metaKey:o.ctrlKey}l.KeyMap=void 0,(function(o){o.Delete="Delete",o.Backspace="Backspace",o.Enter="Enter",o.Left="ArrowLeft",o.Right="ArrowRight",o.Up="ArrowUp",o.Down="ArrowDown",o.ESC="Escape",o.TAB="Tab",o.META="Meta",o.LEFT_BRACKET="[",o.RIGHT_BRACKET="]",o.COMMA=",",o.PERIOD=".",o.LEFT_ANGLE_BRACKET="<",o.RIGHT_ANGLE_BRACKET=">",o.EQUAL="=",o.MINUS="-",o.PLUS="+",o.A="a",o.B="b",o.C="c",o.D="d",o.E="e",o.F="f",o.G="g",o.H="h",o.I="i",o.J="j",o.K="k",o.L="l",o.M="m",o.N="n",o.O="o",o.P="p",o.Q="q",o.R="r",o.S="s",o.T="t",o.U="u",o.V="v",o.W="w",o.X="x",o.Y="y",o.Z="z",o.A_UPPERCASE="A",o.B_UPPERCASE="B",o.C_UPPERCASE="C",o.D_UPPERCASE="D",o.E_UPPERCASE="E",o.F_UPPERCASE="F",o.G_UPPERCASE="G",o.H_UPPERCASE="H",o.I_UPPERCASE="I",o.J_UPPERCASE="J",o.K_UPPERCASE="K",o.L_UPPERCASE="L",o.M_UPPERCASE="M",o.N_UPPERCASE="N",o.O_UPPERCASE="O",o.P_UPPERCASE="P",o.Q_UPPERCASE="Q",o.R_UPPERCASE="R",o.S_UPPERCASE="S",o.T_UPPERCASE="T",o.U_UPPERCASE="U",o.V_UPPERCASE="V",o.W_UPPERCASE="W",o.X_UPPERCASE="X",o.Y_UPPERCASE="Y",o.Z_UPPERCASE="Z",o.ZERO="0",o.ONE="1",o.TWO="2",o.THREE="3",o.FOUR="4",o.FIVE="5",o.SIX="6",o.SEVEN="7",o.EIGHT="8",o.NINE="9"})(l.KeyMap||(l.KeyMap={}));class Hn{element;control;constructor(t,e){this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getCode(){return this.element.control?.code||null}getValue(){const t=this.control.getElementList(),{startIndex:e}=this.control.getRange(),n=t[e],i=[];let r=e;for(;r>0;){const a=t[r];if(a.controlId!==n.controlId||a.controlComponent===l.ControlComponent.PREFIX||a.controlComponent===l.ControlComponent.PRE_TEXT)break;a.controlComponent===l.ControlComponent.VALUE&&i.unshift(a),r--}let s=e+1;for(;s<t.length;){const a=t[s];if(a.controlId!==n.controlId||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT)break;a.controlComponent===l.ControlComponent.VALUE&&i.push(a),s++}return i}setValue(){return-1}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const{control:i}=this.element,r=e.elementList||this.control.getElementList(),{startIndex:s}=e.range||this.control.getRange(),a=r[s];let c=s;for(;c>0;){const R=r[c];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT)break;if(R.controlComponent===l.ControlComponent.CHECKBOX){const u=R.checkbox;u.value=t.includes(u.code)}c--}let d=s+1;for(;d<r.length;){const R=r[d];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.POSTFIX||R.controlComponent===l.ControlComponent.POST_TEXT)break;if(R.controlComponent===l.ControlComponent.CHECKBOX){const u=R.checkbox;u.value=t.includes(u.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:s,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getRange();this.control.shrinkBoundary();const{startIndex:n,endIndex:i}=e;return t.key===l.KeyMap.Backspace||t.key===l.KeyMap.Delete?this.control.removeControl(n):i}cut(){return-1}}class vo extends Hn{setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const{control:i}=this.element,r=e.elementList||this.control.getElementList(),{startIndex:s}=e.range||this.control.getRange(),a=r[s];let c=s;for(;c>0;){const R=r[c];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT)break;if(R.controlComponent===l.ControlComponent.RADIO){const u=R.radio;u.value=t.includes(u.code)}c--}let d=s+1;for(;d<r.length;){const R=r[d];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.POSTFIX||R.controlComponent===l.ControlComponent.POST_TEXT)break;if(R.controlComponent===l.ControlComponent.RADIO){const u=R.radio;u.value=t.includes(u.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:s,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}}function is(o){const t=o.getDraw(),e=t.getPosition(),n=t.getRange();o.isAllowDrag=!0,o.cacheRange=at(n.getRange()),o.cacheElementList=t.getElementList(),o.cachePositionList=e.getPositionList(),o.cachePositionContext=e.getPositionContext()}function ss(o,t){const{checkbox:e,control:n}=o;if(!n)t.getCheckboxParticle().setSelect(o);else{const i=n?.code?n.code.split(","):[];if(e?.value){const s=i.findIndex(a=>a===e.code);i.splice(s,1)}else e?.code&&i.push(e.code);const r=t.getControl().getActiveControl();r instanceof Hn&&r.setSelect(i)}}function rs(o,t){const{radio:e,control:n}=o;if(!n)t.getRadioParticle().setSelect(o);else{const i=e?.code?[e.code]:[],r=t.getControl().getActiveControl();r instanceof vo&&r.setSelect(i)}}function aa(o,t){const e=t.getDraw();let n=e.isReadonly();const i=e.getRange(),r=e.getPosition(),s=i.getRange();if(o.button===Kn.RIGHT&&(s.isCrossRowCol||!i.getIsCollapsed()))return;const c=o.target.dataset.index;if(c&&e.setPageNo(Number(c)),!t.isAllowDrag&&!n&&s.startIndex!==s.endIndex&&i.getIsPointInRange(o.offsetX,o.offsetY,e.getPageNo())){is(t);return}t.isAllowSelection=!0;const d=at(r.getPositionContext()),R=r.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!R)return;const{index:u,isDirectHit:h,isCheckbox:g,isRadio:f,isImage:T,isLabel:p,isMacro:m,isTable:I,tdValueIndex:L,hitLineStartIndex:P}=R;h&&m&&console.log("mousedown - positionResult:",{index:u,isDirectHit:h,isMacro:m}),t.mouseDownStartPosition={...R,index:I?L:u,originalIndex:u,x:o.offsetX,y:o.offsetY};const O=e.getElementList(),S=r.getPositionList(),F=I?L:u;let N;I?N=e.getTd().value[L]:N=O[F];const V=!!(h&&T),Y=!!(h&&g),X=!!(h&&f),b=!!(h&&p),E=!!(h&&m),C=tt=>tt&&(tt.type===l.ElementType.MACRO||tt.type===l.ElementType.CUSTOM_MACRO||tt.type===l.ElementType.REUSABLE_ITEM||tt.type===l.ElementType.SUB_TEMPLATE||tt.type===l.ElementType.MENSTRUAL_HISTORY||tt.type===l.ElementType.FETAL_HEART_POSITION||tt.type===l.ElementType.TOOTH_POSITION||tt.type===l.ElementType.LIST||tt.type===l.ElementType.SPECIAL_SYMBOLS),M=tt=>tt&&!!tt.originControlId&&!!tt.controlId,y=tt=>tt&&!!tt.originControlId&&!!tt.controlId&&(tt.controlComponent===l.ControlComponent.POSTFIX||tt.controlComponent===l.ControlComponent.POSTTEXTFIX||tt.controlComponent===l.ControlComponent.POST_TEXT||tt.controlComponent===l.ControlComponent.PLACEHOLDER),W=e.getMode()===l.EditorMode.FORM,D=W?e.getControl().getActiveTextControlLimit():null;let U=F;const Q=!!(D&&(!N?.controlId||N.controlId===D.controlId&&(N.originControlId||null)===D.originControlId||D.parentControlId&&N.controlId===D.parentControlId&&!N.originControlId));if(W&&(N?.controlId||N?.originControlId)){let tt;const ht=N.originControlId||N.controlId;for(let ut=F;ut>=0;ut--){const v=O[ut];if(v.controlId===ht&&!v.originControlId&&v.control?.type){tt=v.control.type;break}if(v.controlId!==N.controlId&&v.controlId!==ht)break}if(tt===l.ControlType.TEXT&&M(N))N.controlComponent===l.ControlComponent.PREFIX||N.controlComponent===l.ControlComponent.PRE_TEXT||N.controlComponent===l.ControlComponent.PRETEXTFIX||N.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT?U=Math.max(F-1,0):(N.controlComponent===l.ControlComponent.POSTFIX||N.controlComponent===l.ControlComponent.POST_TEXT||N.controlComponent===l.ControlComponent.POSTTEXTFIX||N.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)&&(U=F);else if(tt===l.ControlType.TEXTFIELD){const ut=N.controlComponent;if(!M(N)){if(!(F>0&&y(O[F-1]))){if(!(N.controlComponent===l.ControlComponent.VALUE&&C(N))){if(ut===l.ControlComponent.PRETEXTFIX||ut===l.ControlComponent.PRETEXTFIX_TEXT||ut===l.ControlComponent.POSTTEXTFIX||ut===l.ControlComponent.POSTTEXTFIX_TEXT||ut===l.ControlComponent.TEXTFIXLABEL||ut===l.ControlComponent.PREFIX||ut===l.ControlComponent.POSTFIX||ut===l.ControlComponent.PRE_TEXT||ut===l.ControlComponent.POST_TEXT||ut===l.ControlComponent.PLACEHOLDER)for(let v=F+1;v<O.length;v++){const K=O[v];if(K.controlId!==ht&&K.originControlId!==ht)break;if(K.controlComponent===l.ControlComponent.VALUE&&!C(K)){U=v;break}if(K.controlComponent===l.ControlComponent.POSTTEXTFIX||K.controlComponent===l.ControlComponent.POSTFIX){for(let w=F-1;w>=0;w--){const Z=O[w];if(Z.controlId!==ht&&Z.originControlId!==ht)break;if(Z.controlComponent===l.ControlComponent.VALUE&&!C(Z)){U=w;break}}break}}else if(ut===l.ControlComponent.VALUE&&F>0){const v=O[F-1];if(v&&(v.controlId===ht||v.originControlId===ht)&&v.controlComponent===l.ControlComponent.VALUE&&C(v)){let K=!1;for(let w=F-2;w>=0;w--){const Z=O[w];if(Z.controlId!==ht&&Z.originControlId!==ht||Z.controlComponent!==l.ControlComponent.VALUE&&!Z.originControlId&&Z.controlId===ht)break;if(!C(Z)){U=w+1,K=!0;break}}if(!K)for(let w=F;w<O.length;w++){const Z=O[w];if(Z.controlId!==ht&&Z.originControlId!==ht||(Z.controlComponent===l.ControlComponent.POSTTEXTFIX||Z.controlComponent===l.ControlComponent.POSTFIX)&&!Z.originControlId&&Z.controlId===ht)break;if(!C(Z)){U=w,K=!0;break}}}}}}}}}if(~u){Q&&(U=Math.min(Math.max(U,D.startIndex),D.endIndex));let tt=U,ht=U;if(o.shiftKey){const{startIndex:ut}=i.getRange();~ut&&r.getPositionContext().tdId===d.tdId&&(F>ut?tt=ut:ht=ut)}if(Q&&(tt=Math.min(Math.max(tt,D.startIndex),D.endIndex),ht=Math.min(Math.max(ht,D.startIndex),D.endIndex),U=Math.min(Math.max(U,D.startIndex),D.endIndex)),i.setRange(tt,ht),r.setCursorPosition(S[U]),n=e.isReadonly(),Y&&!n)ss(N,e);else if(X&&!n)rs(N,e);else if(N.controlComponent===l.ControlComponent.VALUE&&(N.control?.type===l.ControlType.CHECKBOX||N.control?.type===l.ControlType.RADIO)){let ut=F;for(;ut>0;){const v=O[ut];if(v.controlComponent===l.ControlComponent.CHECKBOX){ss(v,e);break}else if(v.controlComponent===l.ControlComponent.RADIO){rs(v,e);break}ut--}}else{const ut=N?.control?.type===l.ControlType.BUTTON&&!N.control?.buttonText,v=h&&ut;let K=!1;if(W&&N?.controlId&&N?.controlComponent===l.ControlComponent.VALUE&&!N.originControlId)for(let x=F;x>=0;x--){const A=O[x];if(A.controlId!==N.controlId)break;if(A.control?.type===l.ControlType.TEXTFIELD){K=!0;break}}const w=K&&C(N),Z=E&&!w?U+1:void 0;e.render({curIndex:E&&!w?Z:U,isCompute:!1,isSubmitHistory:!1,isSetCursor:!V&&!Y&&!X&&!(v&&W)&&!w});const J=O[U];if(!n&&h&&J?.controlId&&o.button===Kn.LEFT){const A=e.getControl().getActiveControl(),$=A?.getElement()?.control?.type;A&&($===l.ControlType.NUMBER||$===l.ControlType.SELECT)&&A.getElement()?.controlId===J.controlId&&J.controlComponent!==l.ControlComponent.POSTFIX&&J.controlComponent!==l.ControlComponent.POSTTEXTFIX&&J.controlComponent!==l.ControlComponent.POSTTEXTFIX_TEXT&&J.controlComponent!==l.ControlComponent.POST_TEXT&&typeof A.awake=="function"&&A.awake()}}P&&t.getDraw().getCursor().drawCursor({hitLineStartIndex:P})}const G=e.getEventBus();if(b&&G.isSubscribe("labelMousedown")&&G.emit("labelMousedown",{evt:o,element:N}),E&&(N.type===l.ElementType.MACRO||N.type===l.ElementType.CUSTOM_MACRO||N.type===l.ElementType.REUSABLE_ITEM)){const tt=e.getMode();tt===l.EditorMode.EDIT&&N.type===l.ElementType.CUSTOM_MACRO?G.isSubscribe("macroClick")&&G.emit("macroClick",{evt:o,element:N}):tt===l.EditorMode.FORM&&G.isSubscribe("macroValueChange")&&G.emit("macroValueChange",{evt:o,element:N})}if(console.log("检查子模板点击 - isDirectHitMacro:",E,"curElement.type:",N?.type,"ElementType.SUB_TEMPLATE:",l.ElementType.SUB_TEMPLATE),E&&N.type===l.ElementType.SUB_TEMPLATE){console.log("子模板被点击 - isDirectHitMacro:",E,"curElement.type:",N.type);const tt=e.getMode();console.log("当前模式:",tt,"是否表单模式:",tt===l.EditorMode.FORM),tt===l.EditorMode.FORM&&(console.log("准备触发 subTemplateClick 事件, eventBus:",G),console.log("是否订阅了 subTemplateClick:",G.isSubscribe("subTemplateClick")),G.isSubscribe("subTemplateClick")&&(G.emit("subTemplateClick",{evt:o,element:N}),console.log("subTemplateClick 事件已触发")))}else E&&N.type!==l.ElementType.SUB_TEMPLATE&&console.log("isDirectHitMacro 为 true,但 curElement.type 不是 subTemplate:",N.type);const H=e.getPreviewer();if(H.clearResizer(),V){const tt={dragDisable:n||!N.controlId&&e.getMode()===l.EditorMode.FORM};N.type===l.ElementType.LATEX&&(tt.mime="svg",tt.srcKey="laTexSVG"),H.drawResizer(N,S[F],tt),e.getCursor().drawCursor({isShow:!1}),is(t),(N.imgDisplay===l.ImageDisplay.SURROUND||N.imgDisplay===l.ImageDisplay.FLOAT_TOP||N.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)&&e.getImageParticle().createFloatImage(N),G.isSubscribe("imageMousedown")&&G.emit("imageMousedown",{evt:o,element:N})}const j=e.getTableTool();j.dispose(),I&&!n&&e.getMode()!==l.EditorMode.FORM&&j.render();const st=e.getHyperlinkParticle();st.clearHyperlinkPopup(),N.type===l.ElementType.HYPERLINK&&(fe(o)?st.openHyperlink(N):st.drawHyperlinkPopup(N,S[F]));const it=e.getDateParticle();it.clearDatePicker(),N.type===l.ElementType.DATE&&!n&&it.renderDatePicker(N,S[F]);const nt=e.getMenstrualHistoryParticle();nt.clearMenstrualHistoryEditor(),N.type===l.ElementType.MENSTRUAL_HISTORY&&h&&(e.getMode()===l.EditorMode.FORM||e.getMode()===l.EditorMode.EDIT)&&nt.renderMenstrualHistoryEditor(N,S[F]);const et=e.getFetalHeartPositionParticle();et.clearFetalHeartPositionEditor(),N.type===l.ElementType.FETAL_HEART_POSITION&&h&&(e.getMode()===l.EditorMode.FORM||e.getMode()===l.EditorMode.EDIT)&&et.renderFetalHeartPositionEditor(N,S[F]);const dt=e.getToothPositionParticle();dt.clearToothPositionEditor(),N.type===l.ElementType.TOOTH_POSITION&&h&&(e.getMode()===l.EditorMode.FORM||e.getMode()===l.EditorMode.EDIT)&&dt.renderToothPositionEditor(N,S[F])}function _n(o){const t=lt();return Reflect.set(o,"dragId",t),t}function xn(o,t){return t.findIndex(e=>e.dragId===o)}function ls(o,t,e){const n=e.getDraw();if(o.imgDisplay===l.ImageDisplay.SURROUND||o.imgDisplay===l.ImageDisplay.FLOAT_TOP||o.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM){const i=t.offsetX-e.mouseDownStartPosition.x,r=t.offsetY-e.mouseDownStartPosition.y,s=o.imgFloatPosition;o.imgFloatPosition={x:s.x+i,y:s.y+r,pageNo:n.getPageNo()}}n.getImageParticle().destroyFloatImage()}function ca(o,t){if(t.isAllowDrop){const e=t.getDraw();if(e.isReadonly()||e.isDisabled()){t.mousedown(o);return}const n=e.getPosition(),i=n.getPositionList(),r=n.getPositionContext(),s=e.getRange(),a=t.cacheRange,c=t.cacheElementList,d=t.cachePositionList,R=t.cachePositionContext,u=s.getRange(),h=a.startIndex===a.endIndex,g=h?a.startIndex-1:a.startIndex,f=a.endIndex;if(u.startIndex>=g&&u.endIndex<=f&&t.cachePositionContext?.tdId===r.tdId){e.clearSideEffect();let it=!1,nt=!1;if(h){const et=c[f];if(et.type===l.ElementType.IMAGE||et.type===l.ElementType.LATEX){if(ls(et,o,t),et.imgDisplay===l.ImageDisplay.SURROUND||et.imgDisplay===l.ImageDisplay.FLOAT_TOP||et.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(et),it=!0;else{const dt=d[f];e.getPreviewer().drawResizer(et,dt)}nt=et.imgDisplay===l.ImageDisplay.SURROUND}}s.replaceRange({...a}),e.render({isCompute:nt,isSubmitHistory:it,isSetCursor:!1});return}const T=c.slice(g+1,f+1),p=T.find(it=>it.controlId);if(p){const it=c[g+1],nt=c[f];if(!((!it.controlId||it.controlComponent===l.ControlComponent.PREFIX)&&(!nt.controlId||nt.controlComponent===l.ControlComponent.POSTFIX)||it.controlId===nt.controlId&&it.controlComponent===l.ControlComponent.PREFIX&&nt.controlComponent===l.ControlComponent.POSTFIX||it.control?.type===l.ControlType.TEXT&&it.controlComponent===l.ControlComponent.VALUE&&nt.control?.type===l.ControlType.TEXT&&nt.controlComponent===l.ControlComponent.VALUE)){e.render({curIndex:u.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const m=e.getControl(),I=e.getElementList(),L=!p||!!I[u.startIndex].controlId||!m.getIsElementListContainFullControl(T),P=e.getOptions(),O=T.map(it=>{if(!it.type||it.type===l.ElementType.TEXT){const nt={value:it.value},et=Re;return L||et.push(...Xo),et.forEach(dt=>{const tt=it[dt];tt!==void 0&&(nt[dt]=tt)}),nt}else{let nt=at(it);return L&&(nt=ie(nt,Xo)),Vt([nt],{isHandleFirstElement:!1,editorOptions:P}),nt}});Ut(I,O,u.startIndex,{editorOptions:e.getOptions()});const S=c[g],F=d[g],N=_n(c[g]),V=_n(c[f]),Y=O.length;let X=u.startIndex,b=X+Y;const E=m.getActiveControl();if(E&&c[X].controlComponent!==l.ControlComponent.POSTFIX?(b=E.setValue(O),X=b-Y):e.spliceElementList(I,X+1,0,O),!~b){e.render({isSetCursor:!1});return}const C=_n(I[X]),M=_n(I[b]),y=xn(N,c),W=xn(V,c),D=c[W];if(D.controlId&&D.controlComponent!==l.ControlComponent.POSTFIX)s.replaceRange({...a,startIndex:y,endIndex:W}),m.getActiveControl()?.cut();else{let it=!0;if(R?.isTable){const{tableId:nt,trIndex:et,tdIndex:dt}=R;it=!e.getOriginalElementList().some(ht=>ht.id===nt&&ht?.trList?.[et]?.tdList?.[dt]?.deletable===!1)}it&&e.spliceElementList(c,y+1,W-y)}const U=I[u.startIndex],Q=i[u.startIndex];let G=r.index;G&&(U.tableId&&!S.tableId?F.index<G&&(G-=Y):!U.tableId&&S.tableId&&Q.index<G&&(G+=Y),n.setPositionContext({...r,index:G}));const H=xn(C,I),j=xn(M,I);s.setRange(h?j:H,j,u.tableId,u.startTdIndex,u.endTdIndex,u.startTrIndex,u.endTrIndex),e.clearSideEffect();let st=null;if(h){const nt=e.getElementList()[j];(nt.type===l.ElementType.IMAGE||nt.type===l.ElementType.LATEX)&&(ls(nt,o,t),st=nt)}if(e.render({isSetCursor:!1}),E?m.emitControlContentChange():S.controlId&&m.emitControlContentChange({context:{range:a,elementList:c},controlElement:S}),st)if(st.imgDisplay===l.ImageDisplay.SURROUND||st.imgDisplay===l.ImageDisplay.FLOAT_TOP||st.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(st);else{const nt=n.getPositionList()[j];e.getPreviewer().drawResizer(st,nt)}}else t.isAllowDrag&&t.cacheRange?.startIndex!==t.cacheRange?.endIndex&&t.mousedown(o)}function da(o,t){const e=t.getDraw();if(!e.getOptions().pageOuterSelectionDisable)return;const n=e.getPageContainer(),{x:i,y:r,width:s,height:a}=n.getBoundingClientRect();o.x>=i&&o.x<=i+s&&o.y>=r&&o.y<=r+a||t.setIsAllowSelection(!1)}function Ra(o,t){const e=t.getDraw(),n=e.getControl(),i=e.getPageList(),r=e.getPageNo(),s=i[r],c=e.getPosition().getPositionByXY({x:o.offsetX,y:o.offsetY});if(~c.index){const C=e.getElementList(),M=c.isTable?c.tdValueIndex:c.index,y=C[M];y?.control?.type===l.ControlType.BUTTON&&!y.control?.buttonText?s&&(s.style.cursor="pointer"):s&&(s.style.cursor="text")}else s&&(s.style.cursor="text");if(t.isAllowDrag){const C=o.offsetX,M=o.offsetY,{startIndex:y,endIndex:W}=t.cacheRange,D=t.cachePositionList;for(let Q=y+1;Q<=W;Q++){const{coordinate:{leftTop:G,rightBottom:H}}=D[Q];if(C>=G[0]&&C<=H[0]&&M>=G[1]&&M<=H[1])return}const U=t.cacheRange?.startIndex;if(U){const Q=t.cacheElementList[U];Q?.type===l.ElementType.IMAGE&&(Q.imgDisplay===l.ImageDisplay.SURROUND||Q.imgDisplay===l.ImageDisplay.FLOAT_TOP||Q.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)&&(e.getPreviewer().clearResizer(),e.getImageParticle().dragFloatImage(o.movementX,o.movementY))}t.dragover(o),t.isAllowDrop=!0;return}if(!t.isAllowSelection||!t.mouseDownStartPosition)return;const R=o.target.dataset.index;R&&e.setPageNo(Number(R));const u=e.getPosition(),h=u.getPositionByXY({x:o.offsetX,y:o.offsetY});if(!~h.index)return;const{index:g,isTable:f,tdValueIndex:T,tdIndex:p,trIndex:m,tableId:I,trId:L,tdId:P}=h,{index:O,isTable:S,tdIndex:F,tdId:N,trIndex:V,tableId:Y}=t.mouseDownStartPosition,X=f?T:g,b=e.getRange();let E;if(P!==N&&P&&N){const C=e.getTdByPosition({...t.mouseDownStartPosition,isTable:!!t.mouseDownStartPosition.tableId,index:t.mouseDownStartPosition.originalIndex??t.mouseDownStartPosition.index}),M=e.getTdByPosition({...h,isTable:!!h.tableId,index:h.index});if(e.isSplitTd(C,M)){const y=(C.valueStartIndex??0)+O,W=(M.valueStartIndex??0)+T;E=[{index:y,element:C.value[O],originalId:C.originalId,isCurrent:!1,length:C.value.length,startIndex:C.valueStartIndex??0},{index:W,element:M.value[T],originalId:M.originalId,isCurrent:!0,length:M.value.length,startIndex:M.valueStartIndex??0}]}}if(f&&S&&P!==N&&!E)b.setRange(X,X,I,F,p,V,m),u.setPositionContext({isTable:!!f,index:g,trIndex:m,tdIndex:p,tdId:P,trId:L,tableId:I});else{let C=~X?X:0;if((S||f)&&Y!==I&&!E)return;u.setPositionContext({isTable:!!f,index:g,trIndex:m,tdIndex:p,tdId:P,trId:L,tableId:I});let M=O,y,W;if(E)[{element:y},{element:W}]=E;else{const Q=e.getElementList();y=Q[M+1],W=Q[C]}if(M===C||y?.controlComponent===l.ControlComponent.PLACEHOLDER&&W?.controlComponent===l.ControlComponent.PLACEHOLDER&&y.controlId===W.controlId)return;if(M>C&&([M,C]=[C,M]),e.getMode()===l.EditorMode.FORM){const Q=n.getActiveTextControlLimit();Q&&(M=Math.min(Math.max(M,Q.startIndex),Q.endIndex),C=Math.min(Math.max(C,Q.startIndex),Q.endIndex));const G=e.getElementList(),H=G[M],j=G[C];if(H?.control?.type===l.ControlType.TEXTFIELD||j?.control?.type===l.ControlType.TEXTFIELD){const st=H?.controlId||j?.controlId;if(st){let it=-1,nt=-1;for(let et=M;et>=0;et--){const dt=G[et];if(dt.controlId!==st)break;if(dt.controlComponent===l.ControlComponent.PRETEXTFIX||dt.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||dt.controlComponent===l.ControlComponent.TEXTFIXLABEL||dt.controlComponent===l.ControlComponent.PREFIX||dt.controlComponent===l.ControlComponent.PRE_TEXT){it=et+1;break}}for(let et=C;et<G.length;et++){const dt=G[et];if(dt.controlId!==st)break;if(dt.controlComponent===l.ControlComponent.POSTTEXTFIX||dt.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||dt.controlComponent===l.ControlComponent.POSTFIX||dt.controlComponent===l.ControlComponent.POST_TEXT){nt=et-1;break}}it!==-1&&M<it&&(M=it),nt!==-1&&C>nt&&(C=nt)}}}let U;if(E){const[Q,G]=E.sort((H,j)=>H.index-j.index);U={originalId:E[0].originalId??E[1].originalId,startIndex:Q.index,endIndex:G.index},Q.isCurrent?(M=Q.index,C=Q.length-1):(M=0,C=U.endIndex-G.startIndex)}b.setRange(M,C,void 0,void 0,void 0,void 0,void 0,U)}e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}function ua(o){const t=o.getDraw(),e=t.getRange(),n=e.getRange(),i=t.getElementList(),r=i[n.startIndex];if(!r.hide&&!r.control?.hide&&!r.area?.hide)return;let s=n.startIndex;for(;s>0;){const a=i[s];let c=null;a.controlId?(c=t.getControl().removeControl(s),c!==null&&(s=c)):(t.spliceElementList(i,s,1),c=s-1,s--);const d=i[c];if(!d||!d.hide&&!d.control?.hide&&!d.area?.hide){if(c){n.startIndex=c,n.endIndex=c,e.replaceRange(n);const R=t.getPosition(),u=R.getPositionList();R.setCursorPosition(u[c])}break}}}function ha(o,t,e){if(e.originControlId){const n=e.originControlId;for(let i=t;i<o.length;i++){const r=o[i];if(r.controlId===n)return r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX||r.controlComponent===l.ControlComponent.POST_TEXT?{isInParent:!1}:{isInParent:!0,parentControlId:n};if(r.controlId&&r.controlId!==n&&r.originControlId!==n)break}}if(!e.originControlId&&e.controlId){const n=o[t];if(n?.controlId&&n.controlId!==e.controlId&&(n.controlComponent===l.ControlComponent.PREFIX||n.controlComponent===l.ControlComponent.PRETEXTFIX))for(let i=t-1;i>=0;i--){const r=o[i];if(r.controlId===e.controlId&&(r.controlComponent===l.ControlComponent.PREFIX||r.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let s=i-1;s>=0;s--){const a=o[s];if(a.controlId&&a.controlId!==e.controlId&&(a.controlComponent===l.ControlComponent.PRETEXTFIX||a.controlComponent===l.ControlComponent.PREFIX))return{isInParent:!0,parentControlId:a.controlId};if(a.controlId&&a.controlId!==e.controlId&&(a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POSTTEXTFIX))return{isInParent:!1}}break}}if(n?.controlId&&n.controlId!==e.controlId&&!n.originControlId&&(n.controlComponent===l.ControlComponent.POSTFIX||n.controlComponent===l.ControlComponent.POSTTEXTFIX))return e.originControlId===n.controlId?{isInParent:!0,parentControlId:n.controlId}:{isInParent:!1}}return{isInParent:!1}}function ga(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;n.getIsCollapsed()&&ua(t);const i=e.getControl(),{startIndex:r,endIndex:s,isCrossRowCol:a}=n.getRange();let c;const d=e.getElementList();if(n.getIsCollapsed()&&r>0){const u=d[r-1],h=d[r],f=e.getPosition().getPositionList(),T=f[r],p=f[r-1],m=T&&p&&T.rowIndex===p.rowIndex,I=u?.controlComponent===l.ControlComponent.PREFIX||u?.controlComponent===l.ControlComponent.PRETEXTFIX||u?.controlComponent===l.ControlComponent.PRE_TEXT||u?.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT,L=u?.controlComponent===l.ControlComponent.POSTFIX||u?.controlComponent===l.ControlComponent.POSTTEXTFIX||u?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||u?.controlComponent===l.ControlComponent.POST_TEXT,P=!!u?.controlId,O=h?.controlComponent===l.ControlComponent.PLACEHOLDER,S=h?.controlComponent===l.ControlComponent.POSTFIX||h?.controlComponent===l.ControlComponent.POSTTEXTFIX||h?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||h?.controlComponent===l.ControlComponent.POST_TEXT,F=!!h&&!h.controlId&&!h.control;if(O&&I&&P&&m)return;const{isInParent:N,parentControlId:V}=ha(d,r,u);if(L&&P&&m&&N){if(u.originControlId&&V)for(let Y=r;Y<d.length;Y++){const X=d[Y];if(X.controlId===V&&!X.originControlId){if(X.controlComponent===l.ControlComponent.VALUE){n.setRange(Y,Y),e.render({curIndex:Y,isSubmitHistory:!1});return}if(X.controlComponent===l.ControlComponent.POSTFIX||X.controlComponent===l.ControlComponent.POSTTEXTFIX||X.controlComponent===l.ControlComponent.POST_TEXT)return}X.controlId!==V&&X.originControlId}return}if(L&&P&&m&&!N&&!(F&&!O&&!S)){const Y=r-1;c=i.removeControl(Y),e.getGlobalEvent().setCanvasEventAbility(),c===null?(n.setRange(Y,Y),e.render({curIndex:Y,isSubmitHistory:!1})):(n.setRange(c,c),e.render({curIndex:c}));return}if(S&&h?.controlId&&m){const Y=r;c=i.removeControl(Y),e.getGlobalEvent().setCanvasEventAbility(),c===null?(n.setRange(Y,Y),e.render({curIndex:Y,isSubmitHistory:!1})):(n.setRange(c,c),e.render({curIndex:c}));return}}if(a){const u=e.getTableParticle().getRangeRowCol();if(!u)return;let h=!1;for(let g=0;g<u.length;g++){const f=u[g];for(let T=0;T<f.length;T++){const p=f[T];p.value.length>1&&(e.spliceElementList(p.value,1,p.value.length-1),h=!0)}}c=h?0:null}else if(i.getActiveControl()&&i.getIsRangeCanCaptureEvent())c=i.keydown(o),c&&i.emitControlContentChange();else{const u=e.getPosition().getCursorPosition();if(!u)return;const{index:h}=u,g=n.getIsCollapsed(),f=e.getElementList();if(g&&h===0){const I=f[h];if(I.value===_){I.listId&&e.getListParticle().unsetList(),o.preventDefault();return}}const T=f[r];if(g&&T.rowFlex&&T.value===_){const I=n.getRangeRowElementList();if(I){const L=f[r-1];I.forEach(P=>{P.rowFlex=L?.rowFlex})}}const p=T.value===_?f[r-1]:T,m=f[s+1];if(p?.titleId&&m?.titleId&&p.level===m.level&&p.titleId!==m.titleId){const I=p.titleId,L=m.titleId;let P=s+1;for(;P<f.length&&f[P]?.titleId===L;)f[P].titleId=I,P++}g?e.spliceElementList(f,h,1):e.spliceElementList(f,r+1,s-r),c=g?h-1:r}e.getGlobalEvent().setCanvasEventAbility(),c===null?(n.setRange(r,r),e.render({curIndex:r,isSubmitHistory:!1})):(n.setRange(c,c),e.render({curIndex:c}))}function fa(o){const t=o.getDraw(),n=t.getRange().getRange(),i=t.getElementList(),r=i[n.startIndex+1];if(!r.hide&&!r.control?.hide&&!r.area?.hide)return;const s=n.startIndex+1;for(;s<i.length;){const a=i[s];let c=null;a.controlId?c=t.getControl().removeControl(s):(t.spliceElementList(i,s,1),c=s);const d=i[c];if(!d||!d.hide&&!d.control?.hide&&!d.area?.hide)break}}function Ta(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:r,isCrossRowCol:s,splitTdRange:a}=n.getRange(),c=e.getElementList(),d=e.getControl();n.getIsCollapsed()&&fa(t);let R;if(s){const u=e.getTableParticle().getRangeRowCol();if(!u)return;let h=!1;for(let g=0;g<u.length;g++){const f=u[g];for(let T=0;T<f.length;T++){const p=f[T];p.value.length>1&&(e.spliceElementList(p.value,1,p.value.length-1),h=!0)}}R=h?0:null}else if(d.getActiveControl()&&d.getIsRangeWithinControl())R=d.keydown(o),R&&d.emitControlContentChange();else if(c[r+1]?.controlId)R=d.removeControl(r+1);else{e.removeSplitTdOtherRangeElements();const u=e.getPosition(),h=u.getCursorPosition();if(!h)return;const{index:g}=h,f=u.getPositionContext();if(f.isDirectHit&&f.isImage)e.spliceElementList(c,g,1),R=g-1;else{const T=n.getIsCollapsed();if(!T)e.spliceElementList(c,i+1,r-i);else if(c[g+1])e.spliceElementList(c,g+1,1);else{let p=!0;if(f.isTable){const m=e.getTd();if(m?.linkTdNextId){const I=e.getTdById(m.linkTdNextId);I&&(p=!1,e.spliceElementList(I.value,1,1))}}if(p)return}R=T?g:i,R===0&&a&&(R=e.fixPosition(!0)??R)}}e.getGlobalEvent().setCanvasEventAbility(),R===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(R,R),e.render({curIndex:R}))}function ma(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:r}=n.getRange(),s=n.getIsCollapsed(),a=e.getElementList(),c=a[i],d=a[r];if(s&&d.listId&&d.value===_&&a[r+1]?.listId!==d.listId){e.getListParticle().unsetList();return}let R={value:_};if(o.shiftKey&&c.listId&&(R.listWrap=!0),Ut(a,[R],i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()}),o.shiftKey&&d.areaId&&d.areaId!==a[r+1]?.areaId&&(R=ie(R,Ke)),!(a[i+1]?.titleId&&(!c.titleId||c.titleId!==a[i+1]?.titleId))&&!(d.titleId&&d.titleId!==a[r+1]?.titleId)){const p=n.getRangeAnchorStyle(a,r);if(p){const m=[...Bt],I=p.controlComponent===l.ControlComponent.POSTFIX||p.controlComponent===l.ControlComponent.POSTTEXTFIX||p.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||p.controlComponent===l.ControlComponent.POST_TEXT,L=p.control?.type===l.ControlType.BUTTON&&!p.control?.buttonText;!I&&!L&&m.push(...Re),m.forEach(P=>{const O=p[P];O!==void 0&&(R[P]=O)})}}const u=e.getControl(),h=u.getActiveControl();let g;const f=h?.getElement();if(f?.control?.type===l.ControlType.BUTTON&&!f.control?.buttonText&&f?.controlId){const p=f.controlId;let m=r;for(;m+1<a.length&&a[m+1]?.controlId===p;)m++;e.spliceElementList(a,m+1,0,[R]),g=m+1}else if(h&&u.getIsRangeWithinControl())g=u.setValue([R]),u.emitControlContentChange();else{const m=e.getPosition().getCursorPosition();if(!m)return;const{index:I}=m;if(s){if(e.spliceElementList(a,I+1,0,[R]),d.titleId&&a[I+2]?.titleId===d.titleId){const L=lt();let P=I+2;for(;P<a.length&&a[P]?.titleId===d.titleId;)a[P].titleId=L,P++}}else e.spliceElementList(a,i+1,r-i,[R]);g=I+1}~g&&(n.setRange(g,g),e.render({curIndex:g})),o.preventDefault()}function as(o){return o&&(o.type===l.ElementType.MACRO||o.type===l.ElementType.CUSTOM_MACRO||o.type===l.ElementType.REUSABLE_ITEM||o.type===l.ElementType.SUB_TEMPLATE||o.type===l.ElementType.MENSTRUAL_HISTORY||o.type===l.ElementType.FETAL_HEART_POSITION||o.type===l.ElementType.TOOTH_POSITION||o.type===l.ElementType.LIST||o.type===l.ElementType.SPECIAL_SYMBOLS)}function pa(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),r=i.getCursorPosition();if(!r)return;const s=i.getPositionContext(),{index:a}=r;if(a<=0&&!s.isTable)return;const c=e.getRange(),{startIndex:d,endIndex:R}=c.getRange(),u=c.getIsCollapsed(),h=e.getElementList(),g=e.getControl(),f=e.getMode()===l.EditorMode.FORM,T=f?g.getActiveTextControlLimit():null,p=h[a],m=p?.controlComponent===l.ControlComponent.PREFIX||p?.controlComponent===l.ControlComponent.PRETEXTFIX||p?.controlComponent===l.ControlComponent.PRE_TEXT;let I=!1;if(m&&p?.originControlId){const V=p.originControlId;for(let Y=a-1;Y>=0;Y--){const X=h[Y];if(X.controlId===V&&!X.originControlId){I=!0;break}if(X.controlId&&X.controlId!==V&&X.originControlId!==V)break}}if(f&&g.getActiveControl()&&m&&!T&&!I){g.initNextControl({direction:Zt.UP});return}let L=1;if(fe(o)){const V=e.getLetterReg(),Y=o.shiftKey&&!u&&d===r?.index?R:d;if(V.test(h[Y]?.value)){let X=Y-1;for(;X>0;){const b=h[X];if(!V.test(b.value))break;L++,X--}}}if(f){const V=h[d],Y=V?.controlId;if(Y&&V?.controlComponent===l.ControlComponent.VALUE){let X=!1;for(let b=d;b>=0;b--){const E=h[b];if(E.controlId!==Y)break;if(E.control?.type===l.ControlType.TEXTFIELD){X=!0;break}}if(X){if(V.controlComponent===l.ControlComponent.VALUE&&as(V))return;const b=d-L;if(b>=0){const E=h[b];if(E&&E.controlId===Y&&E.controlComponent===l.ControlComponent.VALUE&&as(E))return}}}}const P=T?Math.max(d-L,T.startIndex):d-L;let O=P,S=P;if(o.shiftKey&&r&&(d!==R?d===r.index?(O=d,S=R-L):(O=P,S=R):S=R),!o.shiftKey){const V=h[d];if(V.type===l.ElementType.TABLE){const Y=V.trList,X=Y.length-1,b=Y[X],E=b.tdList.length-1,C=b.tdList[E];i.setPositionContext({isTable:!0,index:d,trIndex:X,tdIndex:E,tdId:C.id,trId:b.id,tableId:V.id}),O=C.value.length-1,S=O}else if(V.tableId&&d===0){const X=e.getOriginalElementList()[s.index],b=e.getTd();if(b?.linkTdPrevId){const E=e.getTdById(b.linkTdPrevId);E&&(i.setPositionContext({...s,isTable:!0,index:E.tableIndex,trIndex:E.trIndex,tdId:E.id,trId:E.trId,tableId:E.tableId}),O=E.value.length-1,S=O)}else{const E=X.trList;t:for(let C=0;C<E.length;C++){const M=E[C];if(M.id!==V.trId)continue;const y=M.tdList;for(let W=0;W<y.length;W++)if(y[W].id===V.tdId){if(C===0&&W===0)i.setPositionContext({isTable:!1}),O=s.index-1,S=O,e.getTableTool().dispose();else{let U=C,Q=W-1;Q<0&&(U=C-1,Q=E[U].tdList.length-1);const G=E[U],H=G.tdList[Q];i.setPositionContext({isTable:!0,index:s.index,trIndex:U,tdIndex:Q,tdId:H.id,trId:G.id,tableId:V.tableId}),O=H.value.length-1,S=O}break t}}}}}if(!~O||!~S)return;const F=e.getElementList();O=Ln(F,O),S=Ln(F,S),c.setRange(O,S);const N=O===S;e.updateTableTool(),e.render({curIndex:N?O:void 0,isSetCursor:N,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function cs(o){return o&&(o.type===l.ElementType.MACRO||o.type===l.ElementType.CUSTOM_MACRO||o.type===l.ElementType.REUSABLE_ITEM||o.type===l.ElementType.SUB_TEMPLATE||o.type===l.ElementType.MENSTRUAL_HISTORY||o.type===l.ElementType.FETAL_HEART_POSITION||o.type===l.ElementType.TOOTH_POSITION||o.type===l.ElementType.LIST||o.type===l.ElementType.SPECIAL_SYMBOLS)}function La(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),r=i.getCursorPosition();if(!r)return;const{index:s}=r,a=i.getPositionList(),c=i.getPositionContext();if(s>a.length-1&&!c.isTable)return;const d=e.getRange(),{startIndex:R,endIndex:u}=d.getRange(),h=d.getIsCollapsed();let g=e.getElementList();const f=e.getControl(),T=e.getMode()===l.EditorMode.FORM,p=T?f.getActiveTextControlLimit():null,m=g[s],I=m?.controlComponent===l.ControlComponent.POSTFIX||m?.controlComponent===l.ControlComponent.POSTTEXTFIX||m?.controlComponent===l.ControlComponent.POST_TEXT;let L=!1;if(I&&m?.originControlId){const X=m.originControlId;for(let b=s+1;b<g.length;b++){const E=g[b];if(E.controlId===X&&!E.originControlId){L=!0;break}if(E.controlId&&E.controlId!==X&&E.originControlId!==X)break}}if(T&&f.getActiveControl()&&I&&!p&&!L){f.initNextControl({direction:Zt.DOWN});return}let P=1;if(fe(o)){const X=e.getLetterReg(),b=o.shiftKey&&!h&&R===r?.index?u:R;if(X.test(g[b+1]?.value)){let E=b+2;for(;E<g.length;){const C=g[E];if(!X.test(C.value))break;P++,E++}}}if(T){const X=g[u],b=X?.controlId;if(b&&X?.controlComponent===l.ControlComponent.VALUE){let E=!1;for(let C=u;C>=0;C--){const M=g[C];if(M.controlId!==b)break;if(M.control?.type===l.ControlType.TEXTFIELD){E=!0;break}}if(E){if(X.controlComponent===l.ControlComponent.VALUE&&cs(X))return;const C=u+P;if(C<g.length){const M=g[C];if(M&&M.controlId===b&&M.controlComponent===l.ControlComponent.VALUE&&cs(M))return}}}}const O=p?Math.min(u+P,p.endIndex):u+P;let S=O,F=O;if(o.shiftKey&&r&&(R!==u?R===r.index?(S=R,F=O):(S=R+P,F=u):S=R),!o.shiftKey){const X=g[u],b=g[u+1];if(b?.type===l.ElementType.TABLE){const C=b.trList[0],M=C.tdList[0];i.setPositionContext({isTable:!0,index:u+1,trIndex:0,tdIndex:0,tdId:M.id,trId:C.id,tableId:b.id}),S=0,F=0}else if(X.tableId&&!b){const E=e.getTd(),C=E?.linkTdNextId?e.getTdById(E.linkTdNextId):void 0;if(C?.value.length)i.setPositionContext({...c,isTable:!0,index:C.tableIndex,trIndex:C.trIndex,tdId:C.id,trId:C.trId,tableId:C.tableId}),S=0,F=S;else{const y=e.getOriginalElementList()[c.index].trList;t:for(let W=0;W<y.length;W++){const D=y[W];if(D.id!==X.trId)continue;const U=D.tdList;for(let Q=0;Q<U.length;Q++)if(U[Q].id===X.tdId){if(W===y.length-1&&Q===U.length-1)i.setPositionContext({isTable:!1}),S=c.index,F=S,g=e.getElementList(),e.getTableTool().dispose();else{let H=W,j=Q+1;j>U.length-1&&(H=W+1,j=0);const st=y[H],it=st.tdList[j];i.setPositionContext({isTable:!0,index:c.index,trIndex:H,tdIndex:j,tdId:it.id,trId:st.id,tableId:X.tableId}),S=0,F=S}break t}}}}}const N=g.length-1;if(S>N||F>N)return;const V=e.getElementList();S=Ln(V,S,l.LocationPosition.AFTER),F=Ln(V,F,l.LocationPosition.AFTER),d.setRange(S,F);const Y=S===F;e.updateTableTool(),e.render({curIndex:Y?S:void 0,isSetCursor:Y,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function Ia(o,t){const e=t.getDraw();if(e.isReadonly())return;o.preventDefault();const i=e.getControl();if(i.getActiveControl()&&i.getIsRangeWithinControl())i.initNextControl({direction:o.shiftKey?Zt.UP:Zt.DOWN});else{const s=e.getRange(),a=e.getElementList(),{startIndex:c,endIndex:d}=s.getRange(),R=s.getRangeAnchorStyle(a,d),h={...R?Dt(R,Re):null,type:l.ElementType.TAB,value:""};Ut(a,[h],c,{editorOptions:e.getOptions()}),e.insertElementList([h])}}function Ko(o){const{positionList:t,index:e,isUp:n,rowNo:i,cursorX:r}=o;let s=-1;const a=[];if(n){let c=e-1;for(;c>=0;){const d=t[c];if(c--,d.rowNo!==i){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.unshift(d)}}}else{let c=e+1;for(;c<t.length;){const d=t[c];if(c++,d.rowNo!==i){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.push(d)}}}for(let c=0;c<a.length;c++){const d=a[c],{coordinate:{leftTop:[R],rightTop:[u]}}=d;if(c===a.length-1&&(s=d.index),!(r<R||r>u)){s=d.index;break}}return s}function Pa(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),r=i.getCursorPosition();if(!r)return;const s=e.getRange(),{startIndex:a,endIndex:c}=s.getRange();let d=i.getPositionList();const R=o.key===l.KeyMap.Up;let u=-1,h=-1;const g=i.getPositionContext();if(!o.shiftKey&&g.isTable&&(R&&r.rowIndex===0||!R&&r.rowIndex===e.getRowCount()-1)){const{index:T,trIndex:p,tdIndex:m,tableId:I}=g;if(R){const L=e.getOriginalElementList();if(p===0)if(L[T].originalId){const O=T-1,S=L[O];for(let F=S.trList.length-1;F>=0;F--){const N=S.trList[F].tdList.find(V=>V.tdIndex===m);if(N?.value.length){i.setPositionContext({isTable:!0,tableId:S.id,index:O,trIndex:F,tdIndex:m}),u=N.value.length-1,h=N.value.length-1;break}}}else i.setPositionContext({isTable:!1}),u=T-1,h=u,e.getTableTool().dispose();else{let P=-1,O=-1;const S=L[T].trList,F=S[p].tdList[m].colIndex;t:for(let Y=p-1;Y>=0;Y--){const b=S[Y].tdList;for(let E=0;E<b.length;E++){const C=b[E];if(C.colIndex===F||C.colIndex+C.colspan-1>=F&&C.colIndex<=F){P=Y,O=E;break t}}}if(!~P||!~O)return;const N=S[P],V=N.tdList[O];i.setPositionContext({isTable:!0,index:T,trIndex:P,tdIndex:O,tdId:V.id,trId:N.id,tableId:I}),u=V.value.length-1,h=u}}else{const L=e.getOriginalElementList(),P=L[T],O=P.trList;if(p===O.length-1){const S=T+1,F=L[S];if(F&&[P.id,P.originalId].includes(F.originalId)){for(let V=m;V>=0;V--)if(F.trList[0].tdList[V].value.length){i.setPositionContext({isTable:!0,index:S,tableId:F.id,trIndex:0,tdIndex:V}),u=0,h=0;break}}else i.setPositionContext({isTable:!1}),u=T,h=u,e.getTableTool().dispose()}else{let S=-1,F=-1;const N=O[p].tdList[m].colIndex;t:for(let X=p+1;X<O.length;X++){const E=O[X].tdList;for(let C=0;C<E.length;C++){const M=E[C];if(M.colIndex===N||M.colIndex+M.colspan-1>=N&&M.colIndex<=N){S=X,F=C;break t}}}if(!~S||!~F)return;const V=O[S],Y=V.tdList[F];i.setPositionContext({isTable:!0,index:T,trIndex:S,tdIndex:F,tdId:Y.id,trId:V.id,tableId:I}),u=Y.value.length-1,h=u}}}else{let T=r;o.shiftKey&&(a===r.index?T=d[c]:T=d[a]);const{index:p,rowNo:m,rowIndex:I,coordinate:{rightTop:[L]}}=T;if(R&&I===0||!R&&I===e.getRowCount()-1)return;const P=Ko({positionList:d,index:p,rowNo:m,isUp:R,cursorX:L});if(P<0)return;u=P,h=P,o.shiftKey&&(a!==c?a===r.index?u=a:h=c:R?h=c:u=a);const S=e.getElementList()[P];if(S.type===l.ElementType.TABLE){const{scale:F}=e.getOptions(),N=e.getMargins(),V=S.trList;let Y=-1,X=-1,b=-1;if(R)t:for(let E=V.length-1;E>=0;E--){const M=V[E].tdList;for(let y=0;y<M.length;y++){const W=M[y],D=W.x*F+N[3],U=W.width*F;if(L>=D&&L<=D+U){const Q=W.positionList,G=Q[Q.length-1],H=Ko({positionList:Q,index:G.index+1,rowNo:G.rowNo-1,isUp:R,cursorX:L})||G.index;Y=E,X=y,b=H;break t}}}else t:for(let E=0;E<V.length;E++){const M=V[E].tdList;for(let y=0;y<M.length;y++){const W=M[y],D=W.x*F+N[3],U=W.width*F;if(L>=D&&L<=D+U){const Q=W.positionList,G=Ko({positionList:Q,index:-1,rowNo:-1,isUp:R,cursorX:L})||0;Y=E,X=y,b=G;break t}}}if(~Y&&~X&&~b){const E=V[Y],C=E.tdList[X];i.setPositionContext({isTable:!0,index:P,trIndex:Y,tdIndex:X,tdId:C.id,trId:E.id,tableId:S.id}),u=b,h=u,d=i.getPositionList()}}}if(!~u||!~h)return;u>h&&([u,h]=[h,u]),s.setRange(u,h);const f=u===h;e.render({curIndex:f?u:void 0,isSetCursor:f,isSubmitHistory:!1,isCompute:!1}),f||(e.getCursor().moveCursorToVisible({cursorPosition:d[R?u:h],direction:R?Zt.UP:Zt.DOWN}),e.updateTableTool())}function Ma(o,t){if(t.isComposing)return;const e=t.getDraw();if(o.key===l.KeyMap.Backspace)ga(o,t);else if(o.key===l.KeyMap.Delete)Ta(o,t);else if(o.key===l.KeyMap.Enter)ma(o,t);else if(o.key===l.KeyMap.Left)pa(o,t);else if(o.key===l.KeyMap.Right)La(o,t);else if(o.key===l.KeyMap.Up||o.key===l.KeyMap.Down)Pa(o,t);else if(fe(o)&&o.key.toLocaleLowerCase()===l.KeyMap.Z){if(e.isReadonly()&&e.getMode()!==l.EditorMode.FORM)return;e.getHistoryManager().undo(),o.preventDefault()}else if(fe(o)&&o.key.toLocaleLowerCase()===l.KeyMap.Y){if(e.isReadonly()&&e.getMode()!==l.EditorMode.FORM)return;e.getHistoryManager().redo(),o.preventDefault()}else if(fe(o)&&o.key.toLocaleLowerCase()===l.KeyMap.C)t.copy(),o.preventDefault();else if(fe(o)&&o.key.toLocaleLowerCase()===l.KeyMap.X)t.cut(),o.preventDefault();else if(fe(o)&&o.key.toLocaleLowerCase()===l.KeyMap.A)t.selectAll(),o.preventDefault();else if(fe(o)&&o.key.toLocaleLowerCase()===l.KeyMap.S){if(e.isReadonly())return;const n=e.getListener();n.saved&&n.saved(e.getValue());const i=e.getEventBus();i.isSubscribe("saved")&&i.emit("saved",e.getValue()),o.preventDefault()}else if(o.key===l.KeyMap.ESC){t.clearPainterStyle();const n=e.getZone();n.isMainActive()||n.setZone(l.EditorZone.MAIN),o.preventDefault()}else o.key===l.KeyMap.TAB&&Ia(o,t)}function Oa(o){return/[\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef]/.test(o)}function Ca(o){return/[a-zA-Z]/.test(o)}function Sa(o,t){return Oa(o)?t:Ca(o)?"Times New Roman":t}function Ea(o){return o?.type===l.ElementType.CONTROL&&(o.controlComponent===l.ControlComponent.PREFIX||o.controlComponent===l.ControlComponent.PRE_TEXT||o.controlComponent===l.ControlComponent.PRETEXTFIX||o.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)}function Xa(o){return o?.type===l.ElementType.CONTROL&&(o.controlComponent===l.ControlComponent.POSTFIX||o.controlComponent===l.ControlComponent.POST_TEXT||o.controlComponent===l.ControlComponent.POSTTEXTFIX||o.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)}function Ho(o,t,e="input"){const n=bt(),i=t.getDraw(),r=i.getControl(),s=i.getOptions(),a=i.getElementList(),R=i.getPosition().getCursorPosition()?.index;if(i.isReadonly()||i.isDisabled())return;const h=i.getPosition().getCursorPosition();if(!o||!h)return;const g=t.isComposing;if(g&&t.compositionInfo?.value===o)return;const f=i.getRange();if(!f.getIsCanInput())return;const{endIndex:T}=f.getRange(),p=i.getElementList(),m=p[T],I=p[T+1];if(m?.type===l.ElementType.SUB_TEMPLATE&&I?.type===l.ElementType.SUB_TEMPLATE)return;if(i.getMode()===l.EditorMode.FORM){const v=r.getActiveTextControlLimit();if(!r.getActiveControl()||!r.getIsRangeWithinControl()&&!r.getIsRangeInPostfix())return;if(v){const x=f.getRange();if(x.startIndex<v.startIndex||x.endIndex>v.endIndex){const A=Math.min(Math.max(x.endIndex,v.startIndex),v.endIndex);f.setRange(A,A),i.render({curIndex:A,isSubmitHistory:!1});return}}const{endIndex:w}=f.getRange(),Z=i.getElementList(),J=Z[w];if(!J?.originControlId){if(J?.controlId&&J?.controlComponent===l.ControlComponent.VALUE)for(let x=w;x>=0;x--){const A=Z[x];if(A.controlId!==J.controlId||A.originControlId)break;if(A.control?.type===l.ControlType.TEXTFIELD)return}}}const P=f.getDefaultStyle()||t.compositionInfo?.defaultStyle||null,O=t.compositionInfo?.perfStartTime,S=Fa(t,i.getElementList());g||i.getCursor().clearAgentDomValue();const{TEXT:F,HYPERLINK:N,SUBSCRIPT:V,SUPERSCRIPT:Y,DATE:X,TAB:b}=l.ElementType,E=o.replaceAll(`
101
- `,_),{startIndex:C,endIndex:M}=f.getRange(),y=f.getRangeAnchorStyle(S,C);if(!y)return;const W=C>0?S[C-1]:null,D=!!(y.controlId||y.control),Q={...!D&&W?W:y,...P},G=i.isDesignMode(),H=S[M+1],j=Ea(H)&&!H?.originControlId,st=Xa(y)&&!y.originControlId||y.type===l.ElementType.CONTROL&&y.controlComponent===l.ControlComponent.VALUE&&H?.type!==l.ElementType.CONTROL&&!y.originControlId,it=j||st,nt=it?{...y,type:void 0,control:void 0,controlId:void 0,controlComponent:void 0,originControlId:void 0,color:s.defaultColor,highlight:void 0}:y,et=it||D?nt:Q,dt=ct(E).map(v=>{const K={value:v};if(G||!et.title?.disabled&&!et.control?.disabled){const w=S[M+1];(!et.type||et.type===F||et.type===N&&w?.type===N||et.type===X&&w?.type===X||et.type===V&&w?.type===V||et.type===Y&&w?.type===Y)&&ol.forEach(Z=>{if(Z==="groupIds"&&!w?.groupIds)return;const J=et[Z];J!==void 0&&(K[Z]=J)}),(P||et.type===b)&&Re.forEach(Z=>{const J=P?.[Z]||et[Z];J!==void 0&&(K[Z]=J)}),g&&(K.underline=!0)}if(!it){const w=y.originControlId&&(y.controlComponent===l.ControlComponent.POSTFIX||y.controlComponent===l.ControlComponent.POSTTEXTFIX||y.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||y.controlComponent===l.ControlComponent.POST_TEXT),Z=!y.originControlId&&y.controlId&&(y.controlComponent===l.ControlComponent.POSTFIX||y.controlComponent===l.ControlComponent.POSTTEXTFIX||y.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||y.controlComponent===l.ControlComponent.POST_TEXT)&&H?.controlId&&H.controlId!==y.controlId,J=y.controlId&&y.originControlId&&(y.controlComponent===l.ControlComponent.VALUE||y.controlComponent===l.ControlComponent.PLACEHOLDER);if(w&&!K.controlId){const x=y.originControlId;let A=null;for(let $=C;$>=0;$--){const B=S[$];if(B.controlId===x&&!B.originControlId&&B.control){A=B.control;break}}K.controlId=x,K.controlComponent=l.ControlComponent.VALUE,A&&(K.control=A)}else if(Z&&!K.controlId){if(H?.controlId&&H.controlId!==y.controlId)if(H.controlComponent===l.ControlComponent.PREFIX||H.controlComponent===l.ControlComponent.PRETEXTFIX)for(let x=C;x>=0;x--){const A=S[x];if(A.controlId===y.controlId&&(A.controlComponent===l.ControlComponent.PREFIX||A.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let $=x-1;$>=0;$--){const B=S[$];if(B.controlId&&B.controlId!==y.controlId&&(B.controlComponent===l.ControlComponent.PRETEXTFIX||B.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||B.controlComponent===l.ControlComponent.PREFIX||B.controlComponent===l.ControlComponent.PRE_TEXT)){K.controlId=B.controlId,K.controlComponent=l.ControlComponent.VALUE,B.control&&(K.control=B.control);break}if(B.controlId&&B.controlId!==y.controlId&&(B.controlComponent===l.ControlComponent.POSTFIX||B.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}else(H.controlComponent===l.ControlComponent.POSTFIX||H.controlComponent===l.ControlComponent.POSTTEXTFIX)&&(K.controlId=H.controlId,K.controlComponent=l.ControlComponent.VALUE,H.control&&(K.control=H.control));if(!K.controlId)for(let x=C;x>=0;x--){const A=S[x];if(A.controlId===y.controlId&&(A.controlComponent===l.ControlComponent.PREFIX||A.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let $=x-1;$>=0;$--){const B=S[$];if(B.controlId&&B.controlId!==y.controlId&&(B.controlComponent===l.ControlComponent.PRETEXTFIX||B.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||B.controlComponent===l.ControlComponent.PREFIX||B.controlComponent===l.ControlComponent.PRE_TEXT)){K.controlId=B.controlId,K.controlComponent=l.ControlComponent.VALUE,B.control&&(K.control=B.control);break}if(B.controlId&&B.controlId!==y.controlId&&(B.controlComponent===l.ControlComponent.POSTFIX||B.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}}else if(J&&!K.controlId){const x=y.controlId;let A=y.control;if(!A)for(let $=C;$>=0;$--){const B=S[$];if(B.controlId===x&&B.control&&(A=B.control,B.controlComponent===l.ControlComponent.PREFIX||B.controlComponent===l.ControlComponent.PRETEXTFIX))break}K.controlId=x,K.originControlId=y.originControlId,K.controlComponent=l.ControlComponent.VALUE,A&&(K.control=A)}else if(y.controlId&&!y.originControlId){let x=y.control;if(!x)for(let A=C;A>=0;A--){const $=S[A];if($.controlId===y.controlId&&!$.originControlId&&$.control){x=$.control;break}}K.controlId||(K.controlId=y.controlId),x&&!K.control&&(K.control=x),K.controlComponent||(K.controlComponent=l.ControlComponent.VALUE)}else if(!K.controlId&&!K.control&&H?.originControlId&&(H.controlComponent===l.ControlComponent.PREFIX||H.controlComponent===l.ControlComponent.PRETEXTFIX)){const x=H.originControlId;let A=null;for(let $=M;$>=0;$--){const B=S[$];if(B.controlId===x&&!B.originControlId&&B.control){A=B.control;break}}K.controlId=x,K.controlComponent=l.ControlComponent.VALUE,A&&(K.control=A)}}if(v&&v!==_){const w=Sa(v,s.defaultFont);K.font=w}return K});let tt;const ht=a[R],ut=a[R+1];if(g)tt=C;else{const v=w=>{if(dt?.length)for(let Z=0;Z<dt.length;Z++)S.splice(w+Z,0,dt[Z]);return C+dt.length},K=C+1;if(C!==M&&(i.removeSplitTdOtherRangeElements(),i.spliceElementList(S,K,M-C)),it)tt=v(K);else if(ht?.originControlId&&(ht?.controlComponent==="postfix"||ht?.controlComponent==="postTextFix"))tt=v(K);else if((ht?.control?.type===l.ControlType.NUMBER||ut?.control?.type===l.ControlType.NUMBER)&&r.getActiveControl()?.getElement()?.control?.type===l.ControlType.NUMBER&&r.getIsRangeWithinControl()){const w=r.getActiveControl();w&&typeof w.awake=="function"&&w.awake(),tt=C}else if((ht?.control?.type===l.ControlType.SELECT||ut?.control?.type===l.ControlType.SELECT)&&r.getActiveControl()?.getElement()?.control?.type===l.ControlType.SELECT&&r.getIsRangeWithinControl()){const w=r.getActiveControl();w&&typeof w.awake=="function"&&w.awake(),tt=C}else ht?.control?.type==="button"||ut?.control?.type==="button"?(ht?.control||ut?.control)?.buttonText?tt=C:r.getActiveControl()&&r.getIsRangeWithinControl()?(r.removePlaceholder(C,{elementList:S}),tt=r.setValue(dt),r.emitControlContentChange()):tt=C:r.getActiveControl()&&r.getIsRangeWithinControl()?(r.removePlaceholder(C,{elementList:S}),tt=r.setValue(dt),r.emitControlContentChange()):(ht?.type==="control"||ut?.type==="control")&&!it?tt=v(K):(Ut(S,dt,C,{editorOptions:s}),i.spliceElementList(S,K,0,dt),tt=C+dt.length)}if(~tt&&!g){const v=bt()-n,K=bt();f.setRange(tt,tt),i.render({curIndex:tt,isSubmitHistory:!g,traceLabel:`input:${e}`}),Co(s,`input:${e}`,bt()-n,[{label:"mutate",duration:v},{label:"renderCall",duration:bt()-K}],{isComposing:g,textLength:dt.length,compositionChainDuration:e==="compositionend"&&O!==void 0?Number((bt()-O).toFixed(2)):void 0})}g&&(t.compositionInfo={value:E,startIndex:tt,endIndex:M,defaultStyle:P,perfStartTime:n})}function Na(o){o.compositionInfo&&(o.compositionInfo=null)}function Fa(o,t){if(!o.compositionInfo||o.isComposing)return t;const{startIndex:e,endIndex:n}=o.compositionInfo;return e!==n&&(o.getDraw().removeSplitTdOtherRangeElements(),o.getDraw().spliceElementList(t,e+1,n-e),o.getDraw().getRange().setRange(e,e)),o.compositionInfo=null,t}async function ya(o){const t=o.getDraw(),e=t.getRange(),{startIndex:n,endIndex:i}=e.getRange();if(!~n&&!~n||t.isReadonly()||!e.getIsCanInput())return;const r=t.getElementList();let s=n,a=i;if(n===i){const h=t.getPosition().getPositionList(),g=h[n],f=g.rowNo,T=g.pageNo,p=[];for(let I=0;I<h.length;I++){const L=h[I];if(L.pageNo>T)break;L.pageNo===T&&L.rowNo===f&&p.push(I)}const m=p[0]-1;s=m<0?0:m,a=p[p.length-1]}const c=t.getOptions();await ns(r.slice(s+1,a+1),c);const d=t.getControl();let R;d.getActiveControl()&&d.getIsRangeWithinControl()?(R=d.cut(),d.emitControlContentChange()):(t.spliceElementList(r,s+1,a-s),R=s),e.setRange(R,R),t.render({curIndex:R})}async function Wa(o,t){const e=o.getDraw(),{copy:n}=e.getOverride();if(n&&n()?.preventDefault!==!1)return;const i=e.getRange();let r=null;if(i.getRange().isCrossRowCol){const a=i.getRangeTableElement();if(!a)return;const c=e.getTableParticle().getRangeRowCol();if(!c)return;const d={type:l.ElementType.TABLE,value:"",colgroup:[],trList:[]},R=c[0],u=R[0].colIndex,h=R[R.length-1],g=h.colIndex+h.colspan-1;for(let f=u;f<=g;f++)d.colgroup.push(a.colgroup[f]);for(let f=0;f<c.length;f++){const T=c[f],p=a.trList[T[0].rowIndex],m={tdList:[],height:p.height,minHeight:p.minHeight};for(let I=0;I<T.length;I++)m.tdList.push(T[I]);d.trList.push(m)}r=Pt([d])}else r=i.getIsCollapsed()?i.getRangeRowElementList():i.getSelectionElementList();t?.isPlainText&&r?.length&&(r=[{value:en(r)}]),r?.length&&await ns(r,e.getOptions())}function ba(o,t){const e=t.getDraw(),{drop:n}=e.getOverride();if(n&&n(o)?.preventDefault!==!1)return;o.preventDefault();const i=o.dataTransfer?.getData("text");if(i)t.input(i);else{const r=o.dataTransfer?.files;if(!r)return;for(let s=0;s<r.length;s++){const a=r[s];a.type.startsWith("image")&&Qo(t,a)}}}function ds(o){if(!Intl.Segmenter)return null;const t=o.getDraw(),e=t.getPosition().getCursorPosition();if(!e)return null;const i=t.getRange().getRangeParagraphInfo();if(!i)return null;const r=i?.elementList?.map(h=>!h.type||h.type!==l.ElementType.CONTROL&&$t.includes(h.type)?h.value:_).join("")||"";if(!r)return null;const s=e.isFirstLetter||t.getCursor().getHitLineStartIndex()?e.index+1:e.index,a=i.startIndex,d=new Intl.Segmenter(void 0,{granularity:"word"}).segment(r);let R=-1,u=-1;for(const{segment:h,index:g,isWordLike:f}of d){const T=g+a;if(f&&s>=T&&s<T+h.length){R=T-1,u=R+h.length;break}}return~R&&~u?{startIndex:R,endIndex:u}:null}function Va(o){const t=o.getDraw(),e=t.getPosition().getCursorPosition();if(!e)return null;const{value:n,index:i}=e,r=t.getLetterReg();let s=0,a=0;const c=mo.test(n);if(c||r.test(n)){const R=t.getElementList();let u=i-1;for(;u>0;){const g=R[u].value;if(c&&mo.test(g)||!c&&r.test(g))s++,u--;else break}let h=i+1;for(;h<R.length;){const g=R[h].value;if(c&&mo.test(g)||!c&&r.test(g))a++,h++;else break}}const d=i-s-1;return d<0?null:{startIndex:d,endIndex:i+a}}function Ya(o,t){const e=o.getDraw(),n=e.getPosition(),i=n.getPositionByXY({x:t.offsetX,y:t.offsetY});if(i.isImage&&i.isDirectHit){const a=e.getElementList(),c=e.getEventBus(),d=a[i.index];if(c.isSubscribe("imageDblclick")&&c.emit("imageDblclick",{evt:t,element:d}),d.imgPreviewDisabled)return;e.getPreviewer().render();return}if(e.getIsPagingMode()&&e.getMode()===l.EditorMode.EDIT&&!~i.index&&i.zone){e.getZone().setZone(i.zone),e.clearSideEffect(),n.setPositionContext({isTable:!1});return}if((i.isCheckbox||i.isRadio)&&i.isDirectHit)return;const r=e.getRange(),s=ds(o)||Va(o);s&&(r.setRange(s.startIndex,s.endIndex),e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),r.setRangeStyle())}function Da(o){const t=o.getDraw(),e=t.getControl();if(e.getActiveControl()&&e.selectValue())return;const i=t.getPosition().getCursorPosition();if(!i)return;const{index:r}=i,s=t.getElementList();let a=0,c=0,d=r-1;for(;d>0;){const f=s[d],T=s[d-1];if(f.value===_&&!f.listWrap||f.listId!==T?.listId||f.titleId!==T?.titleId)break;a++,d--}let R=r+1;for(;R<s.length;){const f=s[R],T=s[R+1];if(f.value===_&&!f.listWrap||f.listId!==T?.listId||f.titleId!==T?.titleId)break;c++,R++}const u=t.getRange();let h=r-a-1;if(s[h]?.value!==_&&(h-=1),h<0)return;let g=r+c+1;(s[g]?.value===_||g>s.length-1)&&(g-=1),u.setRange(h,g),t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}const Rs={dblclick:Ya,threeClick:Da};function Ua(o){o.isComposing=!0}function wa(o,t){const e=bt();o.isComposing=!1;const n=o.getDraw(),i=n.getOptions();if(t.data)o.compositionInfo&&(o.compositionInfo.perfStartTime=e),nl?setTimeout(()=>{o.compositionInfo&&Ho(t.data,o,"compositionend")},1):o.compositionInfo&&Ho(t.data,o,"compositionend");else{const s=o.compositionInfo?.cancel;if(Na(o),!s){const a=n.getRange(),{endIndex:c}=a.getRange();n.render({curIndex:c,isSubmitHistory:!1,traceLabel:"compositionend:empty"})}}n.getCursor().clearAgentDomValue(),Co(i,"compositionend",bt()-e,[],{hasData:!!t.data,dataLength:t.data?.length||0})}function Za(o){o.compositionInfo&&(o.compositionInfo.cancel=!0)}const _o={compositionstart:Ua,compositionend:wa,compositionCancel:Za};function Qa(o,t){const e=t.getDraw();if(e.isReadonly())return;o.preventDefault();const i=e.getPageContainer();if(!Wi(o.target,L=>L===i))return;const a=o.target.dataset.index;a&&e.setPageNo(Number(a));const c=e.getPosition(),d=c.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!d)return;const{isTable:R,tdValueIndex:u,index:h}=d,g=c.getPositionList(),f=R?u:h;~h&&(e.getRange().setRange(f,f),c.setCursorPosition(g[f]));const T=e.getCursor(),{cursor:{dragColor:p,dragWidth:m,dragFloatImageDisabled:I}}=e.getOptions();if(I){const L=t.cacheElementList?.[t.cacheRange.startIndex];if(L?.type===l.ElementType.IMAGE&&(L.imgDisplay===l.ImageDisplay.FLOAT_TOP||L.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM||L.imgDisplay===l.ImageDisplay.SURROUND))return}T.drawCursor({width:m,color:p,isBlink:!1,isFocus:!1})}const va={dragover:Qa};class Ka{isAllowSelection;isComposing;compositionInfo;isAllowDrag;isAllowDrop;cacheRange;cacheElementList;cachePositionList;cachePositionContext;mouseDownStartPosition;draw;pageContainer;pageList;range;position;constructor(t){this.draw=t,this.pageContainer=t.getPageContainer(),this.pageList=t.getPageList(),this.range=this.draw.getRange(),this.position=this.draw.getPosition(),this.isAllowSelection=!1,this.isComposing=!1,this.compositionInfo=null,this.isAllowDrag=!1,this.isAllowDrop=!1,this.cacheRange=null,this.cacheElementList=null,this.cachePositionList=null,this.cachePositionContext=null,this.mouseDownStartPosition=null}getDraw(){return this.draw}register(){this.pageContainer.addEventListener("click",this.click.bind(this)),this.pageContainer.addEventListener("mousedown",this.mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this.mouseup.bind(this)),this.pageContainer.addEventListener("mouseleave",this.mouseleave.bind(this)),this.pageContainer.addEventListener("mousemove",this.mousemove.bind(this)),this.pageContainer.addEventListener("dblclick",this.dblclick.bind(this)),this.pageContainer.addEventListener("dragover",this.dragover.bind(this)),this.pageContainer.addEventListener("drop",this.drop.bind(this)),_r(this.pageContainer,this.threeClick.bind(this))}setIsAllowSelection(t){this.isAllowSelection=t,t||this.applyPainterStyle()}setIsAllowDrag(t){this.isAllowDrag=t,this.isAllowDrop=t}clearPainterStyle(){this.pageList.forEach(t=>{t.style.cursor="text"}),this.draw.setPainterStyle(null)}applyPainterStyle(){const t=this.draw.getPainterStyle();if(!t||this.draw.isReadonly()||this.draw.isDisabled())return;let n=this.range.getSelection();if(!n){const s=ds(this);s&&(n=this.draw.getElementList().slice(s.startIndex+1,s.endIndex+1))}if(!n)return;const i=Object.keys(t);n.forEach(s=>{i.forEach(a=>{const c=a;Reflect.set(s,c,t[c])})}),this.draw.render({isSetCursor:!1});const r=this.draw.getPainterOptions();(!r||!r.isDblclick)&&this.clearPainterStyle()}selectAll(){if(this.position.getPositionContext().isTable)this.draw.getTableOperate().tableSelectAll();else{const t=this.position.getPositionList();this.range.setRange(0,t.length-1),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}}mousemove(t){this.draw.isInteractionSuspended()||Ra(t,this)}mousedown(t){this.draw.isInteractionSuspended()||aa(t,this)}click(){this.draw.isInteractionSuspended()||tl&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(t){this.draw.isInteractionSuspended()||ca(t,this)}mouseleave(t){this.draw.isInteractionSuspended()||da(t,this)}keydown(t){this.draw.isInteractionSuspended()||Ma(t,this)}dblclick(t){this.draw.isInteractionSuspended()||Rs.dblclick(this,t)}threeClick(){this.draw.isInteractionSuspended()||Rs.threeClick(this)}input(t,e="input"){this.draw.isInteractionSuspended()||Ho(t,this,e)}async cut(){this.draw.isInteractionSuspended()||await ya(this)}async copy(t){this.draw.isInteractionSuspended()||await Wa(this,t)}compositionstart(){this.draw.isInteractionSuspended()||_o.compositionstart(this)}compositionend(t){this.draw.isInteractionSuspended()||_o.compositionend(this,t)}compositionCancel(){this.draw.isInteractionSuspended()||_o.compositionCancel(this)}drop(t){this.draw.isInteractionSuspended()||ba(t,this)}dragover(t){this.draw.isInteractionSuspended()||va.dragover(t,this)}}const us={PAGE_SCALE:"pageScale"};class Ha{draw;options;cursor;canvasEvent;range;previewer;tableTool;hyperlinkParticle;control;dateParticle;imageParticle;dprMediaQueryList;constructor(t,e){this.draw=t,this.options=t.getOptions(),this.canvasEvent=e,this.cursor=null,this.range=t.getRange(),this.previewer=t.getPreviewer(),this.tableTool=t.getTableTool(),this.hyperlinkParticle=t.getHyperlinkParticle(),this.dateParticle=t.getDateParticle(),this.imageParticle=t.getImageParticle(),this.control=t.getControl(),this.dprMediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)}register(){this.cursor=this.draw.getCursor(),this.addEvent()}addEvent(){window.addEventListener("blur",this.clearSideEffect),document.addEventListener("mousedown",this.clearSideEffect),document.addEventListener("mouseup",this.setCanvasEventAbility),document.addEventListener("wheel",this.setPageScale,{passive:!1}),document.addEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.addEventListener("change",this._handleDprChange)}removeEvent(){window.removeEventListener("blur",this.clearSideEffect),document.removeEventListener("mousedown",this.clearSideEffect),document.removeEventListener("mouseup",this.setCanvasEventAbility),document.removeEventListener("wheel",this.setPageScale),document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.removeEventListener("change",this._handleDprChange)}clearSideEffect=t=>{if(!this.cursor)return;if(this.draw.isInteractionSuspended()){this.resetSideEffect();return}const e=t?.composedPath?.()[0]||t.target;if(this.draw.isTargetInsideEditor(e)){this.watchCursorActive();return}this.resetSideEffect()};resetSideEffect=()=>{this.cursor&&(this.cursor.recoveryCursor(),this.range.recoveryRangeStyle(),this.previewer.clearResizer(),this.tableTool.dispose(),this.hyperlinkParticle.clearHyperlinkPopup(),this.control.destroyControl(),this.dateParticle.clearDatePicker(),this.imageParticle.destroyFloatImage())};setCanvasEventAbility=()=>{this.canvasEvent.setIsAllowDrag(!1),this.canvasEvent.setIsAllowSelection(!1)};watchCursorActive(){this.range.getIsCollapsed()&&setTimeout(()=>{this.cursor?.getAgentIsActive()||this.cursor?.drawCursor({isFocus:!1,isBlink:!1})})}setPageScale=t=>{if(this.draw.isInteractionSuspended()||!this.draw.isTargetInsideEditor(t.target)||this.options.shortcutDisableKeys.includes(us.PAGE_SCALE)||!t.ctrlKey)return;t.preventDefault();const{scale:e}=this.options;if(t.deltaY<0){const n=e*10+1;n<=30&&this.draw.setPageScale(n/10)}else{const n=e*10-1;n>=5&&this.draw.setPageScale(n/10)}};_handleVisibilityChange=()=>{if(document.visibilityState==="visible"){const t=this.range.getRange(),e=!!~t.startIndex&&!!~t.endIndex&&t.startIndex===t.endIndex;this.range.replaceRange(t),this.draw.render({isSetCursor:e,isCompute:!1,isSubmitHistory:!1,curIndex:t.startIndex})}};_handleDprChange=()=>{this.draw.setPageDevicePixel()}}class _a{undoStack=[];redoStack=[];maxRecordCount;constructor(t){this.maxRecordCount=t.getOptions().historyMaxRecordCount+1}undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t),this.undoStack.length&&this.undoStack[this.undoStack.length-1]()}}redo(){if(this.redoStack.length){const t=this.redoStack.pop();this.undoStack.push(t),t()}}execute(t){for(this.undoStack.push(t),this.redoStack.length&&(this.redoStack=[]);this.undoStack.length>this.maxRecordCount;)this.undoStack.shift()}isCanUndo(){return this.undoStack.length>1}isCanRedo(){return!!this.redoStack.length}isStackEmpty(){return!this.undoStack.length&&!this.redoStack.length}recovery(){this.undoStack=[],this.redoStack=[]}popUndo(){return this.undoStack.pop()}}class xa{cursorPosition;positionContext;positionList;floatPositionList;draw;eventBus;options;constructor(t){this.positionList=[],this.floatPositionList=[],this.cursorPosition=null,this.positionContext={isTable:!1,isControl:!1},this.draw=t,this.eventBus=t.getEventBus(),this.options=t.getOptions()}getFloatPositionList(){return this.floatPositionList}getTablePositionList(t){const{index:e,trIndex:n,tdIndex:i}=this.positionContext;return t[e].trList[n].tdList[i].positionList||[]}getPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalElementList()):this.getOriginalPositionList()}getMainPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalMainElementList()):this.positionList}getOriginalPositionList(){const t=this.draw.getZone();return t.isHeaderActive()?this.draw.getHeader().getPositionList():t.isFooterActive()?this.draw.getFooter().getPositionList():this.positionList}getOriginalMainPositionList(){return this.positionList}getSelectionPositionList(){const{startIndex:t,endIndex:e}=this.draw.getRange().getRange();return t===e?null:this.getPositionList().slice(t+1,e+1)}setPositionList(t){this.positionList=t}setFloatPositionList(t){this.floatPositionList=t}computePageRowPosition(t){const{positionList:e,rowList:n,pageNo:i,startX:r,startY:s,startRowIndex:a,startIndex:c,innerWidth:d,zone:R}=t,{scale:u,table:{tdPadding:h}}=this.options;let g=r,f=s,T=c;for(let p=0;p<n.length;p++){const m=n[p];if(!m.isSurround){const P=m.width+(m.offsetX||0);m.rowFlex===l.RowFlex.CENTER?g+=(d-P)/2:m.rowFlex===l.RowFlex.RIGHT&&(g+=d-P)}g+=m.offsetX||0,f+=m.offsetY||0;const I=g,L=f;for(let P=0;P<m.elementList.length;P++){const O=m.elementList[P],S=O.metrics,F=!O.hide&&(O.imgDisplay!==l.ImageDisplay.INLINE&&O.type===l.ElementType.IMAGE||O.type===l.ElementType.LATEX)?m.ascent-S.height:m.ascent;O.left&&(g+=O.left),O.translateX&&(g+=O.translateX*u);const N={pageNo:i,index:T,value:O.value,rowIndex:a+p,rowNo:p,metrics:S,left:O.left||0,ascent:F,lineHeight:m.height,isFirstLetter:P===0,isLastLetter:P===m.elementList.length-1,coordinate:{leftTop:[g,f],leftBottom:[g,f+m.height],rightTop:[g+S.width,f],rightBottom:[g+S.width,f+m.height]}};if(O.imgDisplay===l.ImageDisplay.SURROUND||O.imgDisplay===l.ImageDisplay.FLOAT_TOP||O.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM){const V=e[e.length-1];V&&(N.metrics=V.metrics,N.coordinate=V.coordinate),O.imgFloatPosition||(O.imgFloatPosition={x:g,y:f,pageNo:i}),this.floatPositionList.push({pageNo:i,element:O,position:N,isTable:t.isTable,index:t.index,tdIndex:t.tdIndex,trIndex:t.trIndex,tdValueIndex:T,zone:R})}if(e.push(N),T++,g+=S.width,O.type===l.ElementType.TABLE&&!O.hide){const V=O.tdPadding||h,Y=V[1]+V[3],X=V[0]+V[2];for(let b=0;b<O.trList.length;b++){const E=O.trList[b];for(let C=0;C<E.tdList.length;C++){const M=E.tdList[C];M.positionList=[];const y=M.rowList,W=this.computePageRowPosition({positionList:M.positionList,rowList:y,pageNo:i,startRowIndex:0,startIndex:0,startX:(M.x+V[3])*u+I+(O.translateX||0)*u,startY:(M.y+V[0])*u+L,innerWidth:(M.width-Y)*u,isTable:!0,index:T-1,tdIndex:C,trIndex:b,zone:R});if(M.verticalAlign===l.VerticalAlign.MIDDLE||M.verticalAlign===l.VerticalAlign.BOTTOM){const D=y.reduce((G,H)=>G+H.height,0),U=(M.height-X)*u-D,Q=M.verticalAlign===l.VerticalAlign.MIDDLE?U/2:U;Math.floor(Q)>0&&M.positionList.forEach(G=>{const{coordinate:{leftTop:H,leftBottom:j,rightBottom:st,rightTop:it}}=G;H[1]+=Q,j[1]+=Q,st[1]+=Q,it[1]+=Q})}g=W.x,f=W.y}}g=I,f=L}}g=r,f+=m.height}return{x:g,y:f,index:T}}computePositionList(){this.positionList=[];const t=this.draw.getInnerWidth(),e=this.draw.getPageRowList(),n=this.draw.getMargins(),i=n[3],s=this.draw.getHeader().getExtraHeight(),a=n[0]+s;let c=0;for(let d=0;d<e.length;d++){const R=e[d];if(!R?.length)continue;const u=R[0].startIndex;this.computePageRowPosition({positionList:this.positionList,rowList:R,pageNo:d,startRowIndex:c,startIndex:u,startX:i,startY:a,innerWidth:t}),c+=R.length}}computeRowPosition(t){const{row:e,innerWidth:n}=t,i=[];return this.computePageRowPosition({positionList:i,innerWidth:n,rowList:[at(e)],pageNo:0,startX:0,startY:0,startIndex:0,startRowIndex:0}),i}setCursorPosition(t){this.cursorPosition=t}getCursorPosition(){return this.cursorPosition}getPositionContext(){return this.positionContext}setPositionContext(t){this.eventBus.emit("positionContextChange",{value:t,oldValue:this.positionContext}),this.positionContext=t}getPositionByXY(t){const{x:e,y:n,isTable:i}=t;let{elementList:r,positionList:s}=t;r||(r=this.draw.getOriginalElementList()),s||(s=this.getOriginalPositionList());const a=this.draw.getZone(),c=t.pageNo??this.draw.getPageNo(),d=a.isMainActive(),R=d?c:0;if(!i){const T=this.getFloatPositionByXY({...t,imgDisplays:[l.ImageDisplay.FLOAT_TOP,l.ImageDisplay.SURROUND]});if(T)return T}for(let T=0;T<s.length;T++){const{index:p,pageNo:m,left:I,isFirstLetter:L,coordinate:{leftTop:P,rightTop:O,leftBottom:S}}=s[T];if(R===m){if(m>R)break;if(P[0]-I<=e&&O[0]>=e&&P[1]<=n&&S[1]>=n){let F=T;const N=r[T];if(N.type===l.ElementType.TABLE)for(let Y=0;Y<N.trList.length;Y++){const X=N.trList[Y];for(let b=0;b<X.tdList.length;b++){const E=X.tdList[b],C=this.getPositionByXY({x:e,y:n,td:E,pageNo:c,tablePosition:s[T],isTable:!0,elementList:E.value,positionList:E.positionList});if(~C.index){const{index:M,hitLineStartIndex:y}=C,W=E.value[M];return{index:p,isCheckbox:C.isCheckbox||W.type===l.ElementType.CHECKBOX||W.controlComponent===l.ControlComponent.CHECKBOX,isRadio:W.type===l.ElementType.RADIO||W.controlComponent===l.ControlComponent.RADIO,isControl:!!W.controlId,isImage:C.isImage,isLabel:C.isLabel,isMacro:C.isMacro,isDirectHit:C.isDirectHit,isTable:!0,tdIndex:b,trIndex:Y,tdValueIndex:M,tdId:E.id,trId:X.id,tableId:N.id,hitLineStartIndex:y}}}}if(N.type===l.ElementType.IMAGE||N.type===l.ElementType.LATEX)return{index:F,isDirectHit:!0,isImage:!0};if(N.type===l.ElementType.MENSTRUAL_HISTORY)return{index:F,isDirectHit:!0};if(N.type===l.ElementType.FETAL_HEART_POSITION)return{index:F,isDirectHit:!0};if(N.type===l.ElementType.TOOTH_POSITION){const{scale:Y}=this.options,X=N.width*Y;return e>=P[0]&&e<=P[0]+X?{index:F,isDirectHit:!0}:{index:F}}if(N.type===l.ElementType.CHECKBOX||N.controlComponent===l.ControlComponent.CHECKBOX)return{index:F,isDirectHit:!0,isCheckbox:!0};if(N.type===l.ElementType.LABEL)return{index:F,isDirectHit:!0,isLabel:!0};if(N.type===l.ElementType.MACRO||N.type===l.ElementType.CUSTOM_MACRO||N.type===l.ElementType.REUSABLE_ITEM||N.type===l.ElementType.SUB_TEMPLATE)return{index:F,isDirectHit:!0,isMacro:!0};if(N.type===l.ElementType.TAB&&N.listStyle===l.ListStyle.CHECKBOX){let Y=F-1;for(;Y>0;){const X=r[Y];if(X.value===_&&X.listStyle===l.ListStyle.CHECKBOX)break;Y--}return{index:Y,isDirectHit:!0,isCheckbox:!0}}if(N.type===l.ElementType.RADIO||N.controlComponent===l.ControlComponent.RADIO)return{index:F,isDirectHit:!0,isRadio:!0};let V;if(r[p].value!==_){const Y=O[0]-P[0];e<P[0]+Y/2&&(F=T-1,L&&(V=T))}return{isDirectHit:!0,hitLineStartIndex:V,index:F,isControl:!!N.controlId}}}}if(!i){const T=this.getFloatPositionByXY({...t,imgDisplays:[l.ImageDisplay.FLOAT_BOTTOM]});if(T)return T}let u=!1,h=-1,g;if(i){const{scale:T}=this.options,{td:p,tablePosition:m}=t;if(p&&m){const{leftTop:I}=m.coordinate,L=p.x*T+I[0],P=p.y*T+I[1],O=p.width*T,S=p.height*T;if(!(L<e&&e<L+O&&P<n&&n<P+S))return{index:h}}}const f=s.filter(T=>T.isLastLetter&&T.pageNo===R);for(let T=0;T<f.length;T++){const{index:p,rowNo:m,coordinate:{leftTop:I,leftBottom:L}}=f[T];if(n>I[1]&&n<=L[1]){const P=s.findIndex(N=>N.pageNo===R&&N.rowNo===m),O=r[P],S=s[P],F=O.listStyle===l.ListStyle.CHECKBOX?this.draw.getMargins()[3]:S.coordinate.leftTop[0];if(e<F)~P?S.value===_?h=P:(h=P-1,g=P):h=p;else{if(O.listStyle===l.ListStyle.CHECKBOX&&e<I[0])return{index:P,isDirectHit:!0,isCheckbox:!0};h=p}u=!0;break}}if(!u){if(this.draw.getIsPagingMode()){const p=this.draw.getHeader(),m=p.getHeight(),I=p.getHeaderTop()+m,L=this.draw.getFooter(),O=this.draw.getHeight()-(L.getFooterBottom()+L.getHeight());if(d){if(n<I)return{index:-1,zone:l.EditorZone.HEADER};if(n>O)return{index:-1,zone:l.EditorZone.FOOTER}}else if(n<=O&&n>=I)return{index:-1,zone:l.EditorZone.MAIN}}const T=this.draw.getMargins();if(n<=T[0])for(let p=0;p<s.length;p++){const m=s[p];if(m.pageNo!==R||m.rowNo!==0)continue;const{leftTop:I,rightTop:L}=m.coordinate;if(e<=T[3]||e>=I[0]&&e<=L[0]||s[p+1]?.rowNo!==0)return{index:m.index}}else{const p=f[f.length-1];if(p){const m=p.rowNo;for(let I=0;I<s.length;I++){const L=s[I];if(L.pageNo!==R||L.rowNo!==m)continue;const{leftTop:P,rightTop:O}=L.coordinate;if(e<=T[3]||e>=P[0]&&e<=O[0]||s[I+1]?.rowNo!==m)return{index:L.index}}}}return{index:f[f.length-1]?.index||s.length-1}}return{hitLineStartIndex:g,index:h,isControl:!!r[h]?.controlId}}getFloatPositionByXY(t){const{x:e,y:n}=t,i=t.pageNo??this.draw.getPageNo(),r=this.draw.getZone().getZone(),{scale:s}=this.options;for(let a=0;a<this.floatPositionList.length;a++){const{position:c,element:d,isTable:R,index:u,trIndex:h,tdIndex:g,tdValueIndex:f,zone:T,pageNo:p}=this.floatPositionList[a];if(i===p&&d.type===l.ElementType.IMAGE&&d.imgDisplay&&t.imgDisplays.includes(d.imgDisplay)&&(!T||T===r)){const m=d.imgFloatPosition,I=m.x*s,L=m.y*s,P=d.width*s,O=d.height*s;if(e>=I&&e<=I+P&&n>=L&&n<=L+O)return R?{index:u,isDirectHit:!0,isImage:!0,isTable:R,trIndex:h,tdIndex:g,tdValueIndex:f,tdId:d.tdId,trId:d.trId,tableId:d.tableId}:{index:c.index,isDirectHit:!0,isImage:!0}}}}adjustPositionContext(t){const e=this.getPositionByXY(t);if(!~e.index)return null;if(e.isControl&&this.draw.getMode()!==l.EditorMode.READONLY){const{index:p,isTable:m,trIndex:I,tdIndex:L,tdValueIndex:P}=e,O=this.draw.getControl(),{newIndex:S}=O.moveCursor({index:p,isTable:m,trIndex:I,tdIndex:L,tdValueIndex:P});m?e.tdValueIndex=S:e.index=S}const{index:n,isCheckbox:i,isRadio:r,isControl:s,isImage:a,isLabel:c,isDirectHit:d,isTable:R,trIndex:u,tdIndex:h,tdId:g,trId:f,tableId:T}=e;return this.setPositionContext({isTable:R||!1,isCheckbox:i||!1,isRadio:r||!1,isControl:s||!1,isImage:a||!1,isLabel:c||!1,isDirectHit:d||!1,index:n,trIndex:u,tdIndex:h,tdId:g,trId:f,tableId:T}),e}setSurroundPosition(t){const{scale:e}=this.options,{pageNo:n,row:i,rowElement:r,rowElementRect:s,surroundElementList:a,availableWidth:c}=t;let d=s.x,R=0;if(a.length&&!nn(r)&&!r.control?.minWidth)for(let u=0;u<a.length;u++){const h=a[u],g=h.imgFloatPosition;if(g.pageNo!==n)continue;const f={...g,x:g.x*e,y:g.y*e,width:h.width*e,height:h.height*e};if($r(s,f)){i.isSurround=!0;const T=f.width+f.x-s.x;if(r.left=T,i.width+=T,R+=T,d=f.x+f.width,i.width+r.metrics.width>c){r.left=0,i.width-=R;break}}}return{x:d,rowIncreaseWidth:R}}}class Ga{draw;options;range;listener;eventBus;position;historyManager;defaultStyle;lastRangeStyle;constructor(t){this.draw=t,this.options=t.getOptions(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.position=t.getPosition(),this.historyManager=t.getHistoryManager(),this.range={startIndex:-1,endIndex:-1},this.defaultStyle=null,this.lastRangeStyle=null}_isSameRangeStyle(t,e){if(!t||!["type","undo","redo","painter","font","size","bold","italic","underline","strikeout","deletePerson","color","highlight","rowFlex","vertical","rowMargin","level","listType","listStyle","textDecoration","extension"].every(c=>t[c]===e[c])||!(t.dashArray.length===e.dashArray.length&&t.dashArray.every((c,d)=>c===e.dashArray[d])))return!1;const s=t.groupIds||[],a=e.groupIds||[];return s.length===a.length&&s.every((c,d)=>c===a[d])}_emitRangeStyle(t){this._isSameRangeStyle(this.lastRangeStyle,t)||(this.lastRangeStyle={...t,dashArray:[...t.dashArray],groupIds:t.groupIds?[...t.groupIds]:null},this.listener.rangeStyleChange?.(t),this.eventBus.isSubscribe("rangeStyleChange")&&this.eventBus.emit("rangeStyleChange",t))}getRange(){return this.range}clearRange(){this.setRange(-1,-1)}setDefaultStyle(t){t?this.defaultStyle={...this.defaultStyle,...t}:this.defaultStyle=null}getDefaultStyle(){return this.defaultStyle}getRangeAnchorStyle(t,e){const n=je(t,e);return n?{...n,...this.defaultStyle}:null}getIsRangeChange(t,e,n,i,r,s,a){return this.range.startIndex!==t||this.range.endIndex!==e||this.range.tableId!==n||this.range.startTdIndex!==i||this.range.endTdIndex!==r||this.range.startTrIndex!==s||this.range.endTrIndex!==a}getIsCollapsed(){const{startIndex:t,endIndex:e}=this.range;return t===e}getIsSelection(){const{startIndex:t,endIndex:e}=this.range;return!~t&&!~e?!1:t!==e}getSelection(){const{startIndex:t,endIndex:e,splitTdRange:n}=this.range;if(t===e)return null;if(n)return this.draw.getSplitTdValues(n.originalId).slice(n.startIndex+1,n.endIndex+1);const i=this.draw.getElementList();return i.slice(i[t]?.value===_?t:t+1,e+1)}getSelectionElementList(){if(this.range.isCrossRowCol){const t=this.draw.getTableParticle().getRangeRowCol();if(!t)return null;const e=[];for(let n=0;n<t.length;n++){const i=t[n];for(let r=0;r<i.length;r++){const s=i[r];e.push(...s.value)}}return e}return this.getSelection()}getTextLikeSelection(){const t=this.getSelection();return t?t.filter(e=>!e.type||$t.includes(e.type)):null}getTextLikeSelectionElementList(){const t=this.getSelectionElementList();return t?t.filter(e=>!e.type||$t.includes(e.type)):null}getRangeRow(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;const n=this.position.getPositionList(),i=new Map;for(let r=t;r<e+1;r++){const{pageNo:s,rowNo:a}=n[r],c=i.get(s);c?c.has(a)||c.add(a):i.set(s,new Set([a]))}return i}getRangeRowElementList(){const{startIndex:t,endIndex:e,isCrossRowCol:n}=this.range;if(!~t&&!~e)return null;if(n)return this.getSelectionElementList();const i=this.getRangeRow();if(!i)return null;const r=this.position.getPositionList(),s=this.draw.getElementList(),a=[];for(let c=0;c<r.length;c++){const d=r[c],R=i.get(d.pageNo);R&&R.has(d.rowNo)&&a.push(s[c])}return a}getRangeParagraph(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;const n=this.position.getPositionList(),i=this.draw.getElementList(),r=new Map;let s=t;for(;s>=0;){const{pageNo:d,rowNo:R}=n[s];let u=r.get(d);u||(u=[],r.set(d,u)),u.includes(R)||u.unshift(R);const h=i[s],g=i[s-1];if(h.value===_&&!h.listWrap||h.listId!==g?.listId||h.titleId!==g?.titleId)break;s--}const a=t===e;if(!a){let d=t+1;for(;d<e;){const{pageNo:R,rowNo:u}=n[d];let h=r.get(R);h||(h=[],r.set(R,h)),h.includes(u)||h.push(u),d++}}let c=e;for(a&&i[t].value===_&&(c+=1);c<n.length;){const d=i[c],R=i[c+1];if(d.value===_&&!d.listWrap||d.listId!==R?.listId||d.titleId!==R?.titleId)break;const{pageNo:u,rowNo:h}=n[c];let g=r.get(u);g||(g=[],r.set(u,g)),g.includes(h)||g.push(h),c++}return r}getRangeParagraphInfo(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;let n=-1;const i=[],r=this.getRangeParagraph();if(!r)return null;const s=this.draw.getElementList(),a=this.position.getPositionList();for(let c=0;c<a.length;c++){const d=a[c],R=r.get(d.pageNo);R&&R.includes(d.rowNo)&&(~n||(n=d.index),i.push(s[c]))}return i.length?{elementList:i,startIndex:n}:null}getRangeParagraphElementList(){return this.getRangeParagraphInfo()?.elementList||null}getRangeTableElement(){const t=this.position.getPositionContext();return t.isTable?this.draw.getOriginalElementList()[t.index]:null}getIsSelectAll(){const t=this.draw.getElementList(),{startIndex:e,endIndex:n}=this.range;return e===0&&t.length-1===n&&!this.position.getPositionContext().isTable}getIsPointInRange(t,e,n){const{startIndex:i,endIndex:r}=this.range,s=this.position.getPositionList();for(let a=i+1;a<=r&&s[a];a++){const{coordinate:{leftTop:d,rightBottom:R},pageNo:u}=s[a];if(n===u&&t>=d[0]&&t<=R[0]&&e>=d[1]&&e<=R[1])return!0}return!1}getKeywordRangeList(t){const e=this.draw.getSearch().getMatchList(t,this.draw.getOriginalElementList()),n=new Map;for(const r of e){const s=n.get(r.groupId);if(s)s.endIndex+=1;else{const{type:a,groupId:c,tableId:d,index:R,tdIndex:u,trIndex:h}=r,g={startIndex:R,endIndex:R};a===ge.TABLE&&(g.tableId=d,g.startTdIndex=u,g.endTdIndex=u,g.startTrIndex=h,g.endTrIndex=h),n.set(c,g)}}const i=[];return n.forEach(r=>{i.push(r)}),i}getIsCanInput(){const{range:{startIndex:t,endIndex:e},elementList:n}=this.getRangeElement(),i=n[t];if(!i)return!1;if(t===e)return(i.controlComponent!==l.ControlComponent.PRE_TEXT||n[t+1]?.controlComponent!==l.ControlComponent.PRE_TEXT)&&i.controlComponent!==l.ControlComponent.POST_TEXT;const r=n[e];return r?!i.controlId&&!r.controlId||(!i.controlId||i.controlComponent===l.ControlComponent.POSTFIX)&&(!r.controlId||r.controlComponent===l.ControlComponent.POSTFIX)||!!i.controlId&&r.controlId===i.controlId&&r.controlComponent!==l.ControlComponent.PRE_TEXT&&r.controlComponent!==l.ControlComponent.POST_TEXT&&r.controlComponent!==l.ControlComponent.POSTFIX:!1}setRange(t,e,n,i,r,s,a,c){this.getIsRangeChange(t,e,n,i,r,s,a)&&(this.range.startIndex=t,this.range.endIndex=e,this.range.tableId=n,this.range.startTdIndex=i,this.range.endTdIndex=r,this.range.startTrIndex=s,this.range.endTrIndex=a,this.range.isCrossRowCol=!!(i||r||s||a),this.range.splitTdRange=c,this.setDefaultStyle(null)),this.range.zone=this.draw.getZone().getZone();const R=this.draw.getControl();if(~t&&~e&&!!this.draw.getElementList()[t]?.controlId){R.initControl();return}R.destroyControl()}replaceRange(t){this.setRange(t.startIndex,t.endIndex,t.tableId,t.startTdIndex,t.endTdIndex,t.startTrIndex,t.endTrIndex)}shrinkRange(){const{startIndex:t,endIndex:e}=this.range;t===e||!~t&&!~e||this.replaceRange({...this.range,startIndex:e})}setRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const{startIndex:n,endIndex:i,isCrossRowCol:r}=this.range;if(!~n&&!~i)return;let s;if(r){const y=this.draw.getOriginalElementList(),W=this.position.getPositionContext();s=y[W.index]}else{const y=~i?i:0,W=this.draw.getElementList();s=this.getRangeAnchorStyle(W,y)}if(!s)return;const a=this.getSelection()||[s],c=s.type||l.ElementType.TEXT,d=s.font||this.options.defaultFont,R=s.size||this.options.defaultSize,u=!~a.findIndex(y=>!y.bold),h=!~a.findIndex(y=>!y.italic),g=!~a.findIndex(y=>!y.underline&&!y.control?.underline),f=!~a.findIndex(y=>!y.strikeout),T=s.color||null,p=s.highlight||null,m=s.rowFlex||null,I=s.vertical||null,L=s.rowMargin??this.options.defaultRowMargin,P=s.dashArray||[],O=s.level||null,S=s.listType||null,F=s.listStyle||null,N=g&&s.textDecoration||null,V=!!this.draw.getPainterStyle(),Y=this.historyManager.isCanUndo(),X=this.historyManager.isCanRedo(),b=s.groupIds||null,E=s.extension??null,C=s.deletePerson??"",M={type:c,undo:Y,redo:X,painter:V,font:d,size:R,bold:u,italic:h,underline:g,strikeout:f,deletePerson:C,color:T,highlight:p,rowFlex:m,vertical:I,rowMargin:L,dashArray:P,level:O,listType:S,listStyle:F,groupIds:b,textDecoration:N,extension:E};this._emitRangeStyle(M)}recoveryRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const n=this.options.defaultFont,i=this.options.defaultSize,r=this.options.defaultRowMargin,s=!!this.draw.getPainterStyle(),a=this.historyManager.isCanUndo(),c=this.historyManager.isCanRedo(),R={type:null,undo:a,redo:c,painter:s,font:n,size:i,bold:!1,italic:!1,underline:!1,strikeout:!1,deletePerson:"123",color:null,highlight:null,rowFlex:null,rowMargin:r,dashArray:[],level:null,listType:null,listStyle:null,groupIds:null,textDecoration:null,extension:null,vertical:null};this._emitRangeStyle(R)}shrinkBoundary(t={}){const{elementList:e,range:n}=this.getRangeElement(t),{startIndex:i,endIndex:r}=n;if(!~i&&!~r)return;const s=e[i],a=e[r];if(i===r){if(s.controlComponent===l.ControlComponent.PLACEHOLDER){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId===s.controlId&&(d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)){n.startIndex=c,n.endIndex=c;break}if(d.controlId!==s.controlId&&!d.originControlId)break;c--}}if(s.controlComponent===l.ControlComponent.TEXTFIXLABEL){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId!==s.controlId||d.controlComponent===l.ControlComponent.VALUE||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;break}c--}}}else{if(s.controlComponent===l.ControlComponent.PLACEHOLDER||a.controlComponent===l.ControlComponent.PLACEHOLDER||s.controlComponent===l.ControlComponent.TEXTFIXLABEL||a.controlComponent===l.ControlComponent.TEXTFIXLABEL){let c=r-1;for(;c>0;){const d=e[c];if(d.controlId!==a.controlId||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;return}c--}}if(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||s.controlComponent===l.ControlComponent.PRETEXTFIX||s.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==s.controlId||d.controlComponent===l.ControlComponent.VALUE){n.startIndex=c-1;break}else if(d.controlComponent===l.ControlComponent.PLACEHOLDER){n.startIndex=c-1,n.endIndex=c-1;return}c++}}if(a.controlComponent!==l.ControlComponent.VALUE){let c=r-1;for(;c>0;){const d=e[c];if(d.controlId!==s.controlId||d.controlComponent===l.ControlComponent.VALUE){n.endIndex=c;break}else if(d.controlComponent===l.ControlComponent.PLACEHOLDER){n.startIndex=c,n.endIndex=c;return}c--}}}}render(t,e,n,i,r){t.save(),t.globalAlpha=this.options.rangeAlpha,t.fillStyle=this.options.rangeColor,t.fillRect(e,n,i,r),t.restore()}toString(){const t=this.getTextLikeSelection();return t?t.map(e=>e.value).join("").replace(new RegExp(_,"g"),""):""}getRangeElement(t={}){const e=t.elementList||this.draw.getElementList(),n=t.range||this.getRange(),{splitTdRange:i}=n,r={elementList:e,range:n};return i&&(r.range=i,r.elementList=this.draw.getSplitTdValues(i.originalId)??[]),r}}class Aa{draw;options;imageCache;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map}_renderBackgroundColor(t,e,n,i){t.save(),t.fillStyle=e,t.fillRect(0,0,n,i),t.restore()}_drawImage(t,e,n,i){const{background:r,scale:s}=this.options;if(r.size===l.BackgroundSize.CONTAIN){const a=e.width*s,c=e.height*s;if(!r.repeat||r.repeat===l.BackgroundRepeat.NO_REPEAT)t.drawImage(e,0,0,a,c);else{let d=0,R=0;const u=r.repeat===l.BackgroundRepeat.REPEAT||r.repeat===l.BackgroundRepeat.REPEAT_X?Math.ceil(n*s/a):1,h=r.repeat===l.BackgroundRepeat.REPEAT||r.repeat===l.BackgroundRepeat.REPEAT_Y?Math.ceil(i*s/c):1;for(let g=0;g<u;g++){for(let f=0;f<h;f++)t.drawImage(e,d,R,a,c),R+=c;R=0,d+=a}}}else t.drawImage(e,0,0,n*s,i*s)}_renderBackgroundImage(t,e,n){const{background:i}=this.options,r=this.imageCache.get(i.image);if(r)this._drawImage(t,r,e,n);else{const s=new Image;s.setAttribute("crossOrigin","Anonymous"),s.src=i.image,s.onload=()=>{this.imageCache.set(i.image,s),this._drawImage(t,s,e,n),this.draw.render({isCompute:!1,isSubmitHistory:!1})}}}render(t,e){const{background:{image:n,color:i,applyPageNumbers:r}}=this.options;if(n&&(!r?.length||r.includes(e))){const{width:s,height:a}=this.options;this._renderBackgroundImage(t,s,a)}else{const s=this.draw.getCanvasWidth(e),a=this.draw.getCanvasHeight(e);this._renderBackgroundColor(t,i,s,a)}}}class xo{fillRect;fillColor;fillDecorationStyle;constructor(){this.fillRect=this.clearFillInfo()}clearFillInfo(){return this.fillColor=void 0,this.fillDecorationStyle=void 0,this.fillRect={x:0,y:0,width:0,height:0},this.fillRect}recordFillInfo(t,e,n,i,r,s,a){const c=!this.fillRect.width;if(!c&&(this.fillColor!==s||this.fillDecorationStyle!==a)){this.render(t),this.clearFillInfo(),this.recordFillInfo(t,e,n,i,r,s,a);return}c&&(this.fillRect.x=e,this.fillRect.y=n),r&&this.fillRect.height<r&&(this.fillRect.height=r),this.fillRect.width+=i,this.fillColor=s,this.fillDecorationStyle=a}}class ka extends xo{options;constructor(t){super(),this.options=t.getOptions()}render(t){if(!this.fillRect.width)return;const{highlightAlpha:e}=this.options,{x:n,y:i,width:r,height:s}=this.fillRect;t.save(),t.globalAlpha=e,t.fillStyle=this.fillColor,t.fillRect(n,i,r,s),t.restore(),this.clearFillInfo()}}class Ja{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{marginIndicatorColor:n,pageMode:i}=this.options,r=this.draw.getWidth(),s=i===l.PageMode.CONTINUITY?this.draw.getCanvasHeight(e)/this.draw.getPagePixelRatio():this.draw.getHeight(),a=this.draw.getMargins(),c=this.draw.getMarginIndicatorSize();t.save(),t.translate(.5,.5),t.strokeStyle=n,t.beginPath();const d=[a[3],a[0]],R=[r-a[1],a[0]],u=[a[3],s-a[2]],h=[r-a[1],s-a[2]];t.moveTo(d[0]-c,d[1]),t.lineTo(...d),t.lineTo(d[0],d[1]-c),t.moveTo(R[0]+c,R[1]),t.lineTo(...R),t.lineTo(R[0],R[1]-c),t.moveTo(u[0]-c,u[1]),t.lineTo(...u),t.lineTo(u[0],u[1]+c),t.moveTo(h[0]+c,h[1]),t.lineTo(...h),t.lineTo(h[0],h[1]+c),t.stroke(),t.restore()}}class Ba{draw;options;position;range;searchKeyword;searchNavigateIndex;searchOptions;searchMatchList;constructor(t){this.draw=t,this.options=t.getOptions(),this.position=t.getPosition(),this.range=t.getRange(),this.searchNavigateIndex=null,this.searchOptions=null,this.searchKeyword=null,this.searchMatchList=[]}getSearchKeyword(){return this.searchKeyword}setSearchKeyword(t,e){this.searchKeyword=t,this.searchNavigateIndex=null,this.searchOptions=e||null}searchNavigatePre(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let t=this.searchNavigateIndex-1,e=!1;const n=this.searchMatchList[this.searchNavigateIndex].groupId;for(;t>=0;){const i=this.searchMatchList[t];if(n!==i.groupId){e=!0,this.searchNavigateIndex=t-(this.searchKeyword.length-1);break}t--}if(!e){if(this.searchMatchList[this.searchMatchList.length-1].groupId===n)return null;this.searchNavigateIndex=this.searchMatchList.length-1-(this.searchKeyword.length-1)}}return this.searchNavigateIndex}searchNavigateNext(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let t=this.searchNavigateIndex+1,e=!1;const n=this.searchMatchList[this.searchNavigateIndex].groupId;for(;t<this.searchMatchList.length;){const i=this.searchMatchList[t];if(n!==i.groupId){e=!0,this.searchNavigateIndex=t;break}t++}if(!e){if(this.searchMatchList[0].groupId===n)return null;this.searchNavigateIndex=0}}return this.searchNavigateIndex}searchNavigateScrollIntoView(t){const{coordinate:{leftTop:e,leftBottom:n,rightTop:i},pageNo:r}=t,s=this.draw.getHeight(),a=this.draw.getPageGap(),c=r*(s+a),d=document.createElement("div");d.style.position="absolute";const R=50;d.style.width=`${i[0]-e[0]+R}px`,d.style.height=`${n[1]-e[1]+R}px`,d.style.left=`${e[0]}px`,d.style.top=`${e[1]+c}px`,this.draw.getContainer().append(d),d.scrollIntoView(!1),d.remove()}getSearchNavigateIndexList(){return this.searchNavigateIndex===null||!this.searchKeyword?[]:new Array(this.searchKeyword.length).fill(this.searchNavigateIndex).map((t,e)=>t+e)}getSearchMatchList(){return this.searchMatchList}getSearchNavigateInfo(){if(!this.searchKeyword||!this.searchMatchList.length)return null;const t=this.searchNavigateIndex!==null?this.searchNavigateIndex/this.searchKeyword.length+1:0;let e=0,n=null;for(let i=0;i<this.searchMatchList.length;i++){const r=this.searchMatchList[i];n!==r.groupId&&(n=r.groupId,e+=1)}return{index:t,count:e}}getMatchList(t,e){const{isRegEnable:n=!1,isIgnoreCase:i=!0}=this.searchOptions||{},r=i?t.toLocaleLowerCase():t,s=[],a=[],c=e.length,d=[];for(let g=0;g<c;g++)e[g].type===l.ElementType.TABLE&&d.push(g);let R=0,u=0;for(;u<c-1;){const g=d.length?d[R]:c,f=e.slice(u,g);f.length&&a.push({index:u,type:ge.PAGE,elementList:f});const T=e[g];T&&a.push({index:g,type:ge.TABLE,elementList:[T]}),u=g+1,R++}function h(g,f,T,p){if(!g)return;let m=T.map(S=>!S.type||$t.includes(S.type)&&S.controlComponent!==l.ControlComponent.CHECKBOX&&S.controlComponent!==l.ControlComponent.RADIO&&!S.hide&&!S.control?.hide&&!S.area?.hide?S.value:_).filter(Boolean).join("");i&&(m=m.toLocaleLowerCase());const I=[],L=n?new RegExp(g):g;let{index:P,length:O}=wi(m,L);for(;P!==-1&&O!==0;){I.push({index:P,length:O});const S=wi(m,L,P+O);P=S.index,O=S.length}for(let S=0;S<I.length;S++){const{index:F,length:N}=I[S],V=lt();for(let Y=0;Y<N;Y++){const X=F+Y+(p?.startIndex||0);s.push({type:f,index:X,groupId:V,...p})}}}for(let g=0;g<a.length;g++){const f=a[g];if(f.type===ge.TABLE){const T=f.elementList[0];for(let p=0;p<T.trList.length;p++){const m=T.trList[p];for(let I=0;I<m.tdList.length;I++){const L=m.tdList[I],P={tableId:T.id,tableIndex:f.index,trIndex:p,tdIndex:I,tdId:L.id};h(r,f.type,L.value,P)}}}else h(r,f.type,f.elementList,{startIndex:f.index})}return s}compute(t){const e=this.searchOptions?.isLimitSelection&&!this.range.getIsCollapsed(),n=e?this.range.getSelectionElementList():this.draw.getOriginalElementList();if(!n?.length||(this.searchMatchList=this.getMatchList(t,n),!e||!this.searchMatchList.length))return;const{startIndex:i}=this.range.getRange(),r=i+1;for(const s of this.searchMatchList)s.type===ge.TABLE?s.tableIndex+=r:s.index+=r}render(t,e){if(!this.searchMatchList||!this.searchMatchList.length||!this.searchKeyword)return;const{searchMatchAlpha:n,searchMatchColor:i,searchNavigateMatchColor:r}=this.options,s=this.position.getOriginalPositionList(),a=this.draw.getOriginalElementList();t.save(),t.globalAlpha=n;for(let c=0;c<this.searchMatchList.length;c++){const d=this.searchMatchList[c];let R=null;if(d.type===ge.TABLE){const{tableIndex:P,trIndex:O,tdIndex:S,index:F}=d;R=a[P]?.trList[O].tdList[S]?.positionList[F]}else R=s[d.index];if(!R)continue;const{coordinate:{leftTop:u,leftBottom:h,rightTop:g},pageNo:f}=R;if(f!==e)continue;if(this.getSearchNavigateIndexList().includes(c)){t.fillStyle=r;const P=this.searchMatchList[c-1];(!P||P.groupId!==d.groupId)&&this.searchNavigateScrollIntoView(R)}else t.fillStyle=i;const p=u[0],m=u[1],I=g[0]-u[0],L=h[1]-u[1];t.fillRect(p,m,I,L)}t.restore()}replace(t,e){if(this.draw.isReadonly()||t==null)return;let i=this.getSearchMatchList();const r=e?.index;if(Mo(r)){const T=[];i.forEach(p=>{const m=T[T.length-1];!m||m[0].groupId!==p.groupId?T.push([p]):m.push(p)}),i=T[r]}if(!i?.length)return;const s=this.draw.isDesignMode();let a=0,c=0,d="",R="",u=-1;const h=this.draw.getOriginalElementList();for(let T=0;T<i.length;T++){const p=i[T];if(p.type===ge.TABLE){const{tableIndex:m,trIndex:I,tdIndex:L,index:P,tdId:O}=p;R&&O!==R&&(c=0),R=O;const S=m+a,F=h[S].trList[I].tdList[L].value,N=P+c,V=F[N];if(!s&&(V?.control?.deletable===!1||V?.title?.deletable===!1))continue;if(t===""){this.draw.spliceElementList(F,N,1),c--,~u||(u=T);continue}if(d===p.groupId){this.draw.spliceElementList(F,N,1),c--;continue}~u||(u=T);for(let Y=0;Y<t.length;Y++){const X=t[Y];Y===0?V.value=X:(this.draw.spliceElementList(F,N+Y,0,[{...V,value:X}]),c++)}}else{const m=p.index+a,I=h[m];if(!s&&(I?.control?.deletable===!1||I?.title?.deletable===!1)||I.type===l.ElementType.CONTROL&&I.controlComponent!==l.ControlComponent.VALUE)continue;if(t===""){this.draw.spliceElementList(h,m,1),a--,~u||(u=T);continue}if(~u||(u=T),d===p.groupId){this.draw.spliceElementList(h,m,1),a--;continue}for(let L=0;L<t.length;L++){const P=t[L];L===0?I.value=P:(this.draw.spliceElementList(h,m+L,0,[{...I,value:P}]),a++)}}d=p.groupId}if(!~u)return;const g=i[u],f=g.index+(t.length-1);if(g.type===ge.TABLE){const{tableIndex:T,trIndex:p,tdIndex:m,index:I}=g,L=h[T].trList[p].tdList[m].value[I];this.position.setPositionContext({isTable:!0,index:T,trIndex:p,tdIndex:m,tdId:L.tdId,trId:L.trId,tableId:L.tableId})}else this.position.setPositionContext({isTable:!1});this.draw.getRange().setRange(f,f),this.draw.render({curIndex:f})}}class $a extends xo{options;constructor(t){super(),this.options=t.getOptions()}render(t){if(!this.fillRect.width)return;const{scale:e,strikeoutColor:n}=this.options,{x:i,y:r,width:s}=this.fillRect;t.save(),t.lineWidth=e,t.strokeStyle=n;const a=r-3;t.beginPath(),t.moveTo(i,a),t.lineTo(i+s,a),t.stroke(),t.beginPath(),t.moveTo(i,r+3.5),t.lineTo(i+s,r+3.5),t.stroke(),t.restore(),this.clearFillInfo()}}l.TextDecorationStyle=void 0,(function(o){o.SOLID="solid",o.DOUBLE="double",o.DASHED="dashed",o.DOTTED="dotted",o.WAVY="wavy"})(l.TextDecorationStyle||(l.TextDecorationStyle={}));var on;(function(o){o.SOLID="solid",o.DASHED="dashed",o.DOTTED="dotted"})(on||(on={}));class za extends xo{options;constructor(t){super(),this.options=t.getOptions()}_drawLine(t,e,n,i,r){const s=e+i;switch(t.beginPath(),r){case on.DASHED:t.setLineDash([3,1]);break;case on.DOTTED:t.setLineDash([1,1]);break}t.moveTo(e,n),t.lineTo(s,n),t.stroke()}_drawDouble(t,e,n,i){const s=e+i,a=n+3*this.options.scale;this.options.mode===l.EditorMode.PRINT?t.strokeStyle="transparent":t.strokeStyle="red",t.beginPath(),t.moveTo(e,n),t.lineTo(s,n),t.stroke(),t.beginPath(),t.moveTo(e,a),t.lineTo(s,a),t.stroke()}_drawWave(t,e,n,i){const{scale:r}=this.options,s=1.2*r,a=1/r,c=n+2*s;t.beginPath();for(let d=0;d<i;d++){const R=s*Math.sin(a*d);t.lineTo(e+d,c+R)}t.stroke()}render(t){if(!this.fillRect.width)return;const{underlineColor:e,scale:n}=this.options,{x:i,y:r,width:s}=this.fillRect;t.save(),t.strokeStyle=this.fillColor||e,t.lineWidth=n;const a=Math.floor(r+2*t.lineWidth)+.5;switch(this.fillDecorationStyle){case l.TextDecorationStyle.WAVY:this._drawWave(t,i,a,s);break;case l.TextDecorationStyle.DOUBLE:this._drawDouble(t,i,a,s);break;case l.TextDecorationStyle.DASHED:this._drawLine(t,i,a,s,on.DASHED);break;case l.TextDecorationStyle.DOTTED:this._drawLine(t,i,a,s,on.DOTTED);break;default:this._drawLine(t,i,a,s);break}t.restore(),this.clearFillInfo()}}class ja{draw;options;ctx;curX;curY;text;curStyle;curColor;cacheMeasureText;constructor(t){this.draw=t,this.options=t.getOptions(),this.ctx=t.getCtx(),this.curX=-1,this.curY=-1,this.text="",this.curStyle="",this.cacheMeasureText=new Map}measureBasisWord(t,e){t.save(),t.font=e;const n=this.measureText(t,{value:Yr});return t.restore(),n}measureWord(t,e,n){const i=this.draw.getLetterReg();let r=0,s=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==l.ElementType.TEXT||!i.test(c.value)){s=c;break}r+=this.measureText(t,c).width,a++}return{width:r,endElement:s}}buttonMeasureWord(t,e,n){const i=this.draw.getLetterReg();let r=0,s=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==l.ElementType.TEXT||!i.test(c.value)){s=c;break}r+=this.measureText(t,c).width,a++}return{width:r,endElement:s}}measurePunctuationWidth(t,e){return!e||!Vr.includes(e.value)?0:(t.font=this.draw.getElementFont(e),this.measureText(t,e).width)}measureText(t,e){if(e.width){const s=t.measureText(e.value);return{width:e.width,actualBoundingBoxAscent:s.actualBoundingBoxAscent,actualBoundingBoxDescent:s.actualBoundingBoxDescent,actualBoundingBoxLeft:s.actualBoundingBoxLeft,actualBoundingBoxRight:s.actualBoundingBoxRight,fontBoundingBoxAscent:s.fontBoundingBoxAscent,fontBoundingBoxDescent:s.fontBoundingBoxDescent}}const n=`${e.value}${t.font}`,i=this.cacheMeasureText.get(n);if(i)return i;const r=t.measureText(e.value);return this.cacheMeasureText.set(n,r),r}getBasisWordBoundingBoxAscent(t,e){return this.measureBasisWord(t,e).actualBoundingBoxAscent}complete(){this._render(),this.text=""}record(t,e,n,i){if(this.ctx=t,this.options.renderMode===l.RenderMode.COMPATIBILITY){this._setCurXY(n,i),this.text=e.value,this.curStyle=e.style,this.curColor=e.color,this.complete();return}this.text||this._setCurXY(n,i),(this.curStyle&&e.style!==this.curStyle||e.color!==this.curColor)&&(this.complete(),this._setCurXY(n,i)),this.text+=e.value,this.curStyle=e.style,this.curColor=e.color}_setCurXY(t,e){this.curX=t,this.curY=e}_render(){!this.text||!~this.curX||!~this.curX||(this.ctx.save(),this.ctx.font=this.curStyle,this.ctx.fillStyle=this.curColor||this.options.defaultColor,this.ctx.fillText(this.text,this.curX,this.curY),this.ctx.restore())}}class sn{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}static formatNumberPlaceholder(t,e,n,i){const r=i===l.NumberType.CHINESE?Ar(e):`${e}`;return t.replace(n,r)}render(t,e){const{scale:n,pageNumber:{size:i,font:r,color:s,rowFlex:a,numberType:c,format:d,startPageNo:R,fromPageNo:u}}=this.options;if(e<u)return;let h=d;const g=new RegExp(pn.PAGE_NO);g.test(h)&&(h=sn.formatNumberPlaceholder(h,e+R-u,g,c));const f=new RegExp(pn.PAGE_COUNT);f.test(h)&&(h=sn.formatNumberPlaceholder(h,this.draw.getPageCount()-u,f,c));const T=this.draw.getWidth(),p=this.draw.getHeight(),m=this.draw.getPageNumberBottom(),I=p-m;t.save(),t.fillStyle=s,t.font=`${i*n}px ${r}`;let L=0;const P=this.draw.getMargins(),{width:O}=t.measureText(h);a===l.RowFlex.CENTER?L=(T-O)/2:a===l.RowFlex.RIGHT?L=T-O-P[1]:L=P[3],t.fillText(h,L,I),t.restore()}}class qa{draw;options;scrollContainer;constructor(t){this.draw=t,this.options=t.getOptions(),this.scrollContainer=this.getScrollContainer(),setTimeout(()=>{window.scrollY||this._observer()}),this._addEvent()}getScrollContainer(){return this.options.scrollContainerSelector&&document.querySelector(this.options.scrollContainerSelector)||document}_addEvent(){this.scrollContainer.addEventListener("scroll",this._observer)}removeEvent(){this.scrollContainer.removeEventListener("scroll",this._observer)}getElementVisibleInfo(t){const e=t.getBoundingClientRect(),n=this.scrollContainer===document?Math.max(document.documentElement.clientHeight,window.innerHeight):this.scrollContainer.clientHeight,i=Math.min(e.bottom,n)-Math.max(e.top,0);return{intersectionHeight:i>0?i:0}}getPageVisibleInfo(){const t=this.draw.getPageList(),e=[];let n=0,i=0;for(let r=0;r<t.length;r++){const s=t[r],{intersectionHeight:a}=this.getElementVisibleInfo(s);if(i&&!a)break;a&&e.push(r),a>i&&(i=a,n=r)}return{intersectionPageNo:n,visiblePageNoList:e}}_observer=Kr(()=>{const{intersectionPageNo:t,visiblePageNoList:e}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(t),this.draw.setVisiblePageNoList(e)},150)}class tc{draw;step=5;thresholdPoints=[70,40,10,20];selectionContainer;rangeManager;requestAnimationFrameId;isMousedown;isMoving;clientWidth;clientHeight;containerRect;constructor(t){this.draw=t,this.rangeManager=t.getRange();const{scrollContainerSelector:e}=t.getOptions();this.selectionContainer=e&&document.querySelector(e)||document,this.requestAnimationFrameId=null,this.isMousedown=!1,this.isMoving=!1,this.clientWidth=0,this.clientHeight=0,this.containerRect=null,this._addEvent()}_addEvent(){const t=this.selectionContainer;t.addEventListener("mousedown",this._mousedown),t.addEventListener("mousemove",this._mousemove),t.addEventListener("mouseup",this._mouseup),document.addEventListener("mouseleave",this._mouseup)}removeEvent(){const t=this.selectionContainer;t.removeEventListener("mousedown",this._mousedown),t.removeEventListener("mousemove",this._mousemove),t.removeEventListener("mouseup",this._mouseup),document.removeEventListener("mouseleave",this._mouseup)}_mousedown=t=>{if(this.draw.isInteractionSuspended()){this._mouseup();return}if(!this.draw.isTargetInsideEditor(t.target)){this._mouseup();return}if(this.isMousedown=!0,this.clientWidth=this.selectionContainer instanceof Document?document.documentElement.clientWidth:this.selectionContainer.clientWidth,this.clientHeight=this.selectionContainer instanceof Document?document.documentElement.clientHeight:this.selectionContainer.clientHeight,!(this.selectionContainer instanceof Document)){const e=this.selectionContainer.getBoundingClientRect();this.containerRect=e}};_mouseup=()=>{this.isMousedown=!1,this._stopMove()};_mousemove=t=>{if(this.draw.isInteractionSuspended()||!this.isMousedown||this.rangeManager.getIsCollapsed())return;let{x:e,y:n}=t;this.containerRect&&(e=e-this.containerRect.x,n=n-this.containerRect.y),n<this.thresholdPoints[0]?this._startMove(Zt.UP):this.clientHeight-n<=this.thresholdPoints[1]?this._startMove(Zt.DOWN):e<this.thresholdPoints[2]?this._startMove(Zt.LEFT):this.clientWidth-e<this.thresholdPoints[3]?this._startMove(Zt.RIGHT):this._stopMove()};_move(t){const e=this.selectionContainer instanceof Document?window:this.selectionContainer,n=this.selectionContainer instanceof Document?window.scrollX:e.scrollLeft,i=this.selectionContainer instanceof Document?window.scrollY:e.scrollTop;t===Zt.DOWN?e.scrollTo(n,i+this.step):t===Zt.UP?e.scrollTo(n,i-this.step):t===Zt.LEFT?e.scrollTo(n-this.step,i):e.scrollTo(n+this.step,i),this.requestAnimationFrameId=window.requestAnimationFrame(this._move.bind(this,t))}_startMove(t){this.isMoving||(this.isMoving=!0,this._move(t))}_stopMove(){this.requestAnimationFrameId&&(window.cancelAnimationFrame(this.requestAnimationFrameId),this.requestAnimationFrameId=null,this.isMoving=!1)}}class ec{draw;range;options;constructor(t){this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}getTrListGroupByCol(t){const e=at(t);for(let n=0;n<t.length;n++){const i=e[n];for(let r=i.tdList.length-1;r>=0;r--){const s=i.tdList[r],{rowspan:a,rowIndex:c,colIndex:d}=s,R=c+a-1;if(R!==r){const u=i.tdList.splice(r,1)[0];e[R]?.tdList.splice(d,0,u)}}}return e}getRangeRowCol(){const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.draw.getPosition().getPositionContext();if(!t)return null;const{isCrossRowCol:r,startTdIndex:s,endTdIndex:a,startTrIndex:c,endTrIndex:d}=this.range.getRange(),h=this.draw.getOriginalElementList()[e].trList;if(!r)return[[h[n].tdList[i]]];let g=h[c].tdList[s],f=h[d].tdList[a];(g.x>f.x||g.y>f.y)&&([g,f]=[f,g]);const T=g.colIndex,p=f.colIndex+(f.colspan-1),m=g.rowIndex,I=f.rowIndex+(f.rowspan-1),L=[];for(let P=0;P<h.length;P++){const O=h[P],S=[];for(let F=0;F<O.tdList.length;F++){const N=O.tdList[F],V=N.colIndex,Y=N.rowIndex;V>=T&&V<=p&&Y>=m&&Y<=I&&S.push(N)}S.length&&L.push(S)}return L.length?L:null}_drawOuterBorder(t){const{ctx:e,startX:n,startY:i,width:r,height:s,isDrawFullBorder:a,borderExternalWidth:c}=t,{scale:d}=this.options,R=e.lineWidth;c&&(e.lineWidth=c*d),e.beginPath();const u=Math.round(n),h=Math.round(i);e.translate(.5,.5),a?e.rect(u,h,r,s):(e.moveTo(u,h+s),e.lineTo(u,h),e.lineTo(u+r,h)),e.stroke(),c&&(e.lineWidth=R),e.translate(-.5,-.5)}_drawSlash(t,e,n,i){const{scale:r}=this.options;t.save();const s=e.width*r,a=e.height*r,c=Math.round(e.x*r+n),d=Math.round(e.y*r+i);e.slashTypes?.includes(l.TdSlash.FORWARD)&&(t.moveTo(c+s,d),t.lineTo(c,d+a)),e.slashTypes?.includes(l.TdSlash.BACK)&&(t.moveTo(c,d),t.lineTo(c+s,d+a)),t.stroke(),t.restore()}_drawBorder(t,e,n,i){const{colgroup:r,trList:s,borderType:a,borderColor:c,borderWidth:d=1,borderExternalWidth:R}=e;if(!r||!s)return;const{scale:u,table:{defaultBorderColor:h}}=this.options,g=e.width*u,f=e.height*u,T=a===l.TableBorder.EMPTY,p=a===l.TableBorder.EXTERNAL,m=a===l.TableBorder.INTERNAL;t.save(),a===l.TableBorder.DASH&&t.setLineDash([3,3]),t.lineWidth=d*u,t.strokeStyle=c||h,!T&&!m&&this._drawOuterBorder({ctx:t,startX:n,startY:i,width:g,height:f,borderExternalWidth:R,isDrawFullBorder:p});for(let I=0;I<s.length;I++){const L=s[I];for(let P=0;P<L.tdList.length;P++){const O=L.tdList[P];if(O.slashTypes?.length&&this._drawSlash(t,O,n,i),!O.borderTypes?.length&&(T||p))continue;const S=O.width*u,F=O.height*u,N=Math.round(O.x*u+n+S),V=Math.round(O.y*u+i);if(t.translate(.5,.5),t.beginPath(),O.borderTypes?.includes(l.TdBorder.TOP)&&(t.moveTo(N-S,V),t.lineTo(N,V),t.stroke()),O.borderTypes?.includes(l.TdBorder.RIGHT)&&(t.moveTo(N,V),t.lineTo(N,V+F),t.stroke()),O.borderTypes?.includes(l.TdBorder.BOTTOM)&&(t.moveTo(N,V+F),t.lineTo(N-S,V+F),t.stroke()),O.borderTypes?.includes(l.TdBorder.LEFT)&&(t.moveTo(N-S,V),t.lineTo(N-S,V+F),t.stroke()),!T&&!p){if((!m||O.colIndex+O.colspan<r.length)&&(t.moveTo(N,V),t.lineTo(N,V+F),R&&R!==d&&O.colIndex+O.colspan===r.length)){const Y=t.lineWidth;t.lineWidth=R*u,t.stroke(),t.beginPath(),t.lineWidth=Y}if(!m||O.rowIndex+O.rowspan<s.length){const Y=R&&R!==d&&O.rowIndex+O.rowspan===s.length;if(Y&&(t.stroke(),t.beginPath()),t.moveTo(N,V+F),t.lineTo(N-S,V+F),Y){const X=t.lineWidth;t.lineWidth=R*u,t.stroke(),t.beginPath(),t.lineWidth=X}}t.stroke()}t.translate(-.5,-.5)}}t.restore()}_drawBackgroundColor(t,e,n,i){const{trList:r}=e;if(!r)return;const{scale:s}=this.options;for(let a=0;a<r.length;a++){const c=r[a];for(let d=0;d<c.tdList.length;d++){const R=c.tdList[d];if(!R.backgroundColor)continue;t.save();const u=R.width*s,h=R.height*s,g=Math.round(R.x*s+n),f=Math.round(R.y*s+i);t.fillStyle=R.backgroundColor,t.fillRect(g,f,u,h),t.restore()}}}getTableWidth(t){return t.colgroup.reduce((e,n)=>e+n.width,0)}getTableHeight(t){const e=t.trList;return e?.length?this.getTdListByColIndex(e,0).reduce((n,i)=>n+i.height,0):0}getRowCountByColIndex(t,e){return this.getTdListByColIndex(t,e).reduce((n,i)=>n+i.rowspan,0)}getTdListByColIndex(t,e){const n=[];for(let i=0;i<t.length;i++){const r=t[i].tdList;for(let s=0;s<r.length;s++){const a=r[s],c=a.colIndex,d=c+a.colspan-1;e>=c&&e<=d&&n.push(a)}}return n}getTdListByRowIndex(t,e){const n=[];for(let i=0;i<t.length;i++){const r=t[i].tdList;for(let s=0;s<r.length;s++){const a=r[s],c=a.rowIndex,d=c+a.rowspan-1;e>=c&&e<=d&&n.push(a)}}return n}computeRowColInfo(t){const{colgroup:e,trList:n}=t;if(!e||!n)return;let i=0;for(let r=0;r<n.length;r++){const s=n[r],a=n.length-1===r;for(let c=0;c<s.tdList.length;c++){const d=s.tdList[c];let R=0;if(n.length>1&&r!==0){const m=s.tdList[c-1],I=m?m.colIndex+m.colspan:c;for(let L=I;L<e.length;L++)if(this.getRowCountByColIndex(n.slice(0,r),L)===r){R=L;let O=0;for(let S=0;S<L;S++)O+=e[S].width;i=O;break}}else{const m=s.tdList[c-1];m&&(R=m.colIndex+m.colspan)}let u=0;for(let m=0;m<d.colspan;m++)u+=e[m+R].width;let h=0;for(let m=0;m<d.rowspan;m++){const I=n[m+r]||n[r];h+=I.height}const g=s.tdList.length-1===c;let f=a;if(!f&&d.rowspan>1){const m=n.length-1-r;f=d.rowspan-1===m}const T=a&&g;d.isLastRowTd=g,d.isLastColTd=f,d.isLastTd=T,d.x=i;let p=0;for(let m=0;m<r;m++){const I=n[m].tdList;for(let L=0;L<I.length;L++){const P=I[L];if(R>=P.colIndex&&R<P.colIndex+P.colspan){p+=P.height;break}}}d.y=p,d.width=u,d.height=h,d.rowIndex=r,d.colIndex=R,d.trIndex=r,d.tdIndex=c,i+=u,g&&!T&&(i=0)}}}drawRange(t,e,n,i){const{scale:r,rangeAlpha:s,rangeColor:a}=this.options,{type:c,trList:d}=e;if(!d||c!==l.ElementType.TABLE)return;const{isCrossRowCol:R,startTdIndex:u,endTdIndex:h,startTrIndex:g,endTrIndex:f}=this.range.getRange();if(!R)return;let T=d[g].tdList[u],p=d[f].tdList[h];(T.x>p.x||T.y>p.y)&&([T,p]=[p,T]);const m=T.colIndex,I=p.colIndex+(p.colspan-1),L=T.rowIndex,P=p.rowIndex+(p.rowspan-1);t.save();for(let O=0;O<d.length;O++){const S=d[O];for(let F=0;F<S.tdList.length;F++){const N=S.tdList[F],V=N.colIndex,Y=N.rowIndex;if(V>=m&&V<=I&&Y>=L&&Y<=P){const X=N.x*r,b=N.y*r,E=N.width*r,C=N.height*r;t.globalAlpha=s,t.fillStyle=a,t.fillRect(X+n,b+i,E,C)}}}t.restore()}render(t,e,n,i){this._drawBackgroundColor(t,e,n,i),this._drawBorder(t,e,n,i)}findPreRowSpanTd(t,e,n){for(let i=e;i>=0;i--){const r=t[i].tdList.find(s=>s.colIndex===n);if(r)return r}}computeTrHeight(t,e){const{scale:n,table:{tdPadding:i,defaultTrMinHeight:r}}=this.options,s=t.tdPadding||i,a=s[0]+s[2],c=t.trList;for(let u=0;u<c.length;u++){const h=c[u];h.height=h.minHeight||r,h.minHeight=h.height}this.computeRowColInfo(t);const d={},R={};for(let u=0;u<c.length;u++){const h=c[u];if(!h.tdList.length){h.height=0;continue}const g=[],f=[];for(let p=0;p<t.colgroup.length;p++){const m=h.tdList.find(I=>I.colIndex===p);if(m){const I=e?e(m):m.rowList,L=I.reduce((O,S)=>O+S.height,0);m.rowList=I;const P=L/n+a;m.mainHeight=P,m.rowspan>1?(R[m.colIndex]=m.id,d[m.id]={td:m,rowSpan:[u,u+m.rowspan-1],preHeight:0,preMinHeight:0,extraHeight:P},f.push(P)):m.height<P?(m.height=P,m.realHeight=P,g.push(P)):g.push(m.height)}else{const I=d[R[p]];I?.rowSpan[1]==u&&g.push(I.extraHeight)}}const T=Math.max(...g.length?g:f);Object.values(d).forEach(p=>{p.rowSpan[0]<=u&&p.rowSpan[1]>=u&&(p.extraHeight-=T,p.preHeight+=T,p.preMinHeight+=h.minHeight)}),h.height=T;for(let p=0;p<t.colgroup.length;p++){const m=h.tdList.find(I=>I.colIndex===p)??this.findPreRowSpanTd(c,u,p);if(m){const I=d[m.id]?.preHeight??0,L=d[m.id]?.preMinHeight??h.minHeight;m.height=T+I,m.realHeight=T+I,m.realMinHeight=L}}}this.computeRowColInfo(t)}}var Te;(function(o){o.ROW="row",o.COL="col"})(Te||(Te={}));class nc{MIN_TD_WIDTH=20;ROW_COL_OFFSET=18;ROW_COL_QUICK_WIDTH=16;ROW_COL_QUICK_OFFSET=5;ROW_COL_QUICK_POSITION=this.ROW_COL_OFFSET+(this.ROW_COL_OFFSET-this.ROW_COL_QUICK_WIDTH)/2;BORDER_VALUE=4;TABLE_SELECT_OFFSET=20;draw;canvas;options;position;range;container;toolRowContainer;toolRowAddBtn;toolColAddBtn;toolTableSelectBtn;toolColContainer;toolBorderContainer;anchorLine;mousedownX;mousedownY;constructor(t){this.draw=t,this.canvas=t.getPage(),this.options=t.getOptions(),this.position=t.getPosition(),this.range=t.getRange(),this.container=t.getContainer(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null,this.anchorLine=null,this.mousedownX=0,this.mousedownY=0}dispose(){this.toolRowContainer?.remove(),this.toolRowAddBtn?.remove(),this.toolColAddBtn?.remove(),this.toolTableSelectBtn?.remove(),this.toolColContainer?.remove(),this.toolBorderContainer?.remove(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null}render(){if(this.draw.getMode()===l.EditorMode.FORM){this.dispose();return}const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.position.getPositionContext();if(!t)return;this.dispose();const r=this.draw.getOriginalElementList(),s=this.position.getOriginalPositionList(),a=r[e];if(a.tableToolDisabled&&!this.draw.isDesignMode())return;const{scale:c,table:{overflow:d}}=this.options,R=s[e],{colgroup:u,trList:h}=a,{coordinate:{leftTop:g}}=R,f=this.draw.getHeight(),T=this.draw.getPageGap(),p=this.draw.getPageNo()*(f+T),m=g[0],I=g[1]+p,L=a.trList[n].tdList[i],P=L.rowIndex,O=L.colIndex,S=a.height*c,F=a.width*c,N=document.createElement("div");N.classList.add(`${z}-table-tool__select`),N.style.height=`${S*c}`,N.style.left=`${m}px`,N.style.top=`${I}px`,N.style.transform=`translate(-${this.TABLE_SELECT_OFFSET*c}px, ${-this.TABLE_SELECT_OFFSET*c}px)`,N.onclick=()=>{this.draw.getTableOperate().tableSelectAll()},this.container.append(N),this.toolTableSelectBtn=N;const V=h.map(y=>y.height),Y=document.createElement("div");Y.classList.add(`${z}-table-tool__row`),Y.style.transform=`translateX(-${this.ROW_COL_OFFSET*c}px)`;for(let y=0;y<V.length;y++){const W=V[y]*c,D=document.createElement("div");D.classList.add(`${z}-table-tool__row__item`),y===P&&D.classList.add("active"),D.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByRowIndex(h,y),G=Q[0],H=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:G.trIndex,tdIndex:G.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,G.tdIndex,H.tdIndex,G.trIndex,H.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(Y,y)};const U=document.createElement("div");U.classList.add(`${z}-table-tool__anchor`),U.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:y,order:Te.ROW})},D.append(U),D.style.height=`${W}px`,Y.append(D)}Y.style.left=`${m}px`,Y.style.top=`${I}px`,this.container.append(Y),this.toolRowContainer=Y;const X=document.createElement("div");X.classList.add(`${z}-table-tool__quick__add`),X.style.height=`${S*c}`,X.style.left=`${m}px`,X.style.top=`${I+S}px`,X.style.transform=`translate(-${this.ROW_COL_QUICK_POSITION*c}px, ${this.ROW_COL_QUICK_OFFSET*c}px)`,X.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:h.length-1,tdIndex:0,tableId:a.id}),this.draw.getTableOperate().insertTableBottomRow()},this.container.append(X),this.toolRowAddBtn=X;const b=u.map(y=>y.width),E=document.createElement("div");E.classList.add(`${z}-table-tool__col`),E.style.transform=`translateY(-${this.ROW_COL_OFFSET*c}px)`;for(let y=0;y<b.length;y++){const W=b[y]*c,D=document.createElement("div");D.classList.add(`${z}-table-tool__col__item`),y===O&&D.classList.add("active"),D.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByColIndex(h,y),G=Q[0],H=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:G.trIndex,tdIndex:G.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,G.tdIndex,H.tdIndex,G.trIndex,H.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(E,y)};const U=document.createElement("div");U.classList.add(`${z}-table-tool__anchor`),U.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:y,order:Te.COL})},D.append(U),D.style.width=`${W}px`,E.append(D)}E.style.left=`${m}px`,E.style.top=`${I}px`,this.container.append(E),this.toolColContainer=E;const C=document.createElement("div");C.classList.add(`${z}-table-tool__quick__add`),C.style.height=`${S*c}`,C.style.left=`${m+F}px`,C.style.top=`${I}px`,C.style.transform=`translate(${this.ROW_COL_QUICK_OFFSET*c}px, -${this.ROW_COL_QUICK_POSITION*c}px)`,C.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:0,tdIndex:h[0].tdList.length-1||0,tableId:a.id}),this.draw.getTableOperate().insertTableRightCol()},this.container.append(C),this.toolColAddBtn=C;const M=document.createElement("div");M.classList.add(`${z}-table-tool__border`),M.style.height=`${S}px`,M.style.width=`${F}px`,M.style.left=`${m}px`,M.style.top=`${I}px`;for(let y=0;y<h.length;y++){const W=h[y];for(let D=0;D<W.tdList.length;D++){const U=W.tdList[D],Q=document.createElement("div");Q.classList.add(`${z}-table-tool__border__row`),Q.style.width=`${U.width*c}px`,Q.style.height=`${this.BORDER_VALUE}px`,Q.style.top=`${(U.y+U.height)*c-this.BORDER_VALUE/2}px`,Q.style.left=`${U.x*c}px`,Q.onmousedown=H=>{this._mousedown({evt:H,element:a,index:U.rowIndex+U.rowspan-1,order:Te.ROW})},M.appendChild(Q);const G=document.createElement("div");if(G.classList.add(`${z}-table-tool__border__col`),G.style.width=`${this.BORDER_VALUE}px`,G.style.height=`${U.height*c}px`,G.style.top=`${U.y*c}px`,G.style.left=`${(U.x+U.width)*c-this.BORDER_VALUE/2}px`,G.onmousedown=H=>{this._mousedown({evt:H,element:a,index:U.colIndex+U.colspan-1,order:Te.COL})},M.appendChild(G),d&&U.colIndex===0){const H=document.createElement("div");H.classList.add(`${z}-table-tool__border__col`),H.style.width=`${this.BORDER_VALUE}px`,H.style.height=`${U.height*c}px`,H.style.top=`${U.y*c}px`,H.style.left=`${U.x*c-this.BORDER_VALUE/2}px`,H.onmousedown=j=>{this._mousedown({evt:j,element:a,index:0,isLeftStartBorder:!0,order:Te.COL})},M.appendChild(H)}}}this.container.append(M),this.toolBorderContainer=M}_setAnchorActive(t,e){const n=t.children;for(let i=0;i<n.length;i++){const r=n[i];i===e?r.classList.add("active"):r.classList.remove("active")}}_mousedown(t){const{evt:e,index:n,order:i,element:r,isLeftStartBorder:s}=t;this.canvas=this.draw.getPage();const{scale:a,table:{overflow:c}}=this.options,d=this.draw.getWidth(),R=this.draw.getHeight(),u=this.draw.getPageGap(),h=this.draw.getPageNo()*(R+u),g=this.position.getPositionContext(),p=(this.position.getOriginalPositionList()[g.index]?.coordinate?.leftTop?.[0]||0)*a,m=this.draw.getMargins(),I=m[0],L=m[1],P=I,O=d-L;this.mousedownX=e.x,this.mousedownY=e.y;const S=e.target,F=this.canvas.getBoundingClientRect(),N=window.getComputedStyle(S).cursor;document.body.style.cursor=N,this.canvas.style.cursor=N;let V=0,Y=0;const X=document.createElement("div");X.classList.add(`${z}-table-anchor__line`),i===Te.ROW?(X.classList.add(`${z}-table-anchor__line__row`),X.style.width=`${d}px`,V=0,Y=h+this.mousedownY-F.top):(X.classList.add(`${z}-table-anchor__line__col`),X.style.height=`${R}px`,V=this.mousedownX-F.left,Y=h),X.style.left=`${V}px`,X.style.top=`${Y}px`,this.container.append(X),this.anchorLine=X;let b=0,E=0;const C=M=>{const y=this._mousemove(M,i,V,Y);y&&(b=y.dx,E=y.dy)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",()=>{let M=!1;if(i===Te.ROW){const y=r.trList,W=y[n]||y[n-1],{defaultTrMinHeight:D}=this.options.table;E<0&&W.height+E<D&&(E=D-W.height),E&&(W.height+=E,W.minHeight=W.height,M=!0)}else{const{colgroup:y}=r;if(y&&b)if(c&&s){y[n].width-b/a<=this.MIN_TD_WIDTH&&(b=(y[n].width-this.MIN_TD_WIDTH)*a);const W=p+(r.translateX||0)*a;W+b<P&&(b=P-W),y[n].width-=b/a,r.width-=b/a,r.translateX=(r.translateX||0)+b/a,M=!0}else{const W=y[n].width;b<0&&W*a+b<this.MIN_TD_WIDTH*a&&(b=this.MIN_TD_WIDTH*a-W*a);const D=y[n+1]?.width;if(b>0&&D&&D*a-b<this.MIN_TD_WIDTH*a&&(b=D*a-this.MIN_TD_WIDTH*a),n===y.length-1){const Q=p+(r.translateX||0)*a+r.width*a;Q+b>O&&(b=O-Q)}b&&(y.length-1!==n&&(y[n+1].width-=b/a),y[n].width+=b/a,M=!0)}}M&&this.draw.render({isSetCursor:!1}),X.remove(),document.removeEventListener("mousemove",C),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),e.preventDefault()}_mousemove(t,e,n,i){if(!this.anchorLine)return null;const r=t.x-this.mousedownX,s=t.y-this.mousedownY;return e===Te.ROW?this.anchorLine.style.top=`${i+s}px`:this.anchorLine.style.left=`${n+r}px`,t.preventDefault(),{dx:r,dy:s}}}class oc{draw;options;container;hyperlinkPopupContainer;hyperlinkDom;constructor(t){this.draw=t,this.options=t.getOptions(),this.container=t.getContainer();const{hyperlinkPopupContainer:e,hyperlinkDom:n}=this._createHyperlinkPopupDom();this.hyperlinkDom=n,this.hyperlinkPopupContainer=e}_createHyperlinkPopupDom(){const t=document.createElement("div");t.classList.add(`${z}-hyperlink-popup`);const e=document.createElement("a");return e.target="_blank",e.rel="noopener",t.append(e),this.container.append(t),{hyperlinkPopupContainer:t,hyperlinkDom:e}}drawHyperlinkPopup(t,e){const{coordinate:{leftTop:[n,i]},lineHeight:r}=e,s=this.draw.getHeight(),a=this.draw.getPageGap(),c=this.draw.getPageNo()*(s+a);this.hyperlinkPopupContainer.style.display="block",this.hyperlinkPopupContainer.style.left=`${n}px`,this.hyperlinkPopupContainer.style.top=`${i+c+r}px`;const d=t.url||"#";this.hyperlinkDom.href=d,this.hyperlinkDom.title=d,this.hyperlinkDom.innerText=d}clearHyperlinkPopup(){this.hyperlinkPopupContainer.style.display="none"}openHyperlink(t){const e=window.open(t.url,"_blank");e&&(e.opener=null)}render(t,e,n,i){t.save(),t.font=e.style,e.color||(e.color=this.options.defaultHyperlinkColor),t.fillStyle=e.color,e.underline===void 0&&(e.underline=!0),t.fillText(e.value,n,i),t.restore()}}class ic{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:r,label:{defaultBackgroundColor:s,defaultColor:a,defaultBorderRadius:c,defaultPadding:d}}=this.options,R=e.label?.backgroundColor||s,u=e.label?.color||a,h=e.label?.borderRadius||c,g=e.label?.padding||d;t.save(),t.font=e.style;const{width:f,height:T,boundingBoxAscent:p}=e.metrics;t.fillStyle=R,this._drawRoundedRect(t,n,i-p,f,T+(g[0]+g[3])*r,h*r),t.fill(),t.fillStyle=u,t.fillText(e.value,n+g[3]*r,i),t.restore()}_drawRoundedRect(t,e,n,i,r,s){t.beginPath(),t.moveTo(e+s,n),t.lineTo(e+i-s,n),t.quadraticCurveTo(e+i,n,e+i,n+s),t.lineTo(e+i,n+r-s),t.quadraticCurveTo(e+i,n+r,e+i-s,n+r),t.lineTo(e+s,n+r),t.quadraticCurveTo(e,n+r,e,n+r-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+s,n),t.closePath()}}class sc{options;draw;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e,n,i){const r=this.draw.getMode(),s=e.macroConfig;if(e.type==="subTemplate"&&console.log("MacroParticle.render - 子模板元素:",e.type,"当前模式:",r,"label:",e.label),r===l.EditorMode.EDIT){const c=e.label||e.value||"";this._renderEditMode(t,e,n,i,c);return}if(e.type==="macro"){const c=e.label||"",d=e.value||`获取 ${c}`;this._renderPlainText(t,e,n,i,d);return}if(e.type==="customMacro"){const c=s?.type||"text",d=s?.value||"",R=e.label||"";if(r===l.EditorMode.FORM)c==="select"?this._renderSelectControl(t,e,n,i,d):this._renderTextControl(t,e,n,i,d);else{const u=d||`获取 ${R}`;this._renderPlainText(t,e,n,i,u)}return}if(e.type==="reusableItem"){const d=e.reusableItemConfig?.value||"",R=e.label||"";if(r===l.EditorMode.FORM)this._renderTextControl(t,e,n,i,d);else{const u=d||`获取 ${R}`;this._renderPlainText(t,e,n,i,u)}return}if(e.type==="subTemplate"){const c=e.label||"子模板";r===l.EditorMode.FORM?e.subTemplateExpanded||this._renderSubTemplateTag(t,e,n,i,c):this._renderPlainText(t,e,n,i,c);return}const a=e.value||e.label||"";this._renderPlainText(t,e,n,i,a)}_renderPlainText(t,e,n,i,r){t.save(),t.font=e.style,t.fillStyle=e.color||"#000000",t.textBaseline="alphabetic",t.fillText(r,n,i),t.restore()}_renderSubTemplateTag(t,e,n,i,r){const{scale:s}=this.options,a="#722ed1",c="#f9f0ff";t.save(),t.font=e.style;const d=t.measureText(r),R=d.actualBoundingBoxAscent+d.actualBoundingBoxDescent,u=8*s,h=4*s,g=4*s,f=d.width+u*2,T=R+h*2,p=e.metrics,m=n,I=i-p.boundingBoxAscent+(p.boundingBoxAscent+p.boundingBoxDescent-T)/2;t.fillStyle=c,this._drawRoundedRect(t,m,I,f,T,g),t.fill(),t.strokeStyle=a,t.lineWidth=1*s,t.setLineDash([4*s,2*s]),this._drawRoundedRect(t,m,I,f,T,g),t.stroke(),t.fillStyle=a,t.textBaseline="middle",t.fillText(r,n+u,I+T/2),t.restore()}_renderEditMode(t,e,n,i,r){const{scale:s}=this.options,a=e.type==="customMacro",c=e.type==="reusableItem",d=e.type==="subTemplate";let R,u;d?(R="#722ed1",u="#f9f0ff"):c?(R="#52c41a",u="#f6ffed"):a?(R="#fa8c16",u="#fff7e6"):(R="#1677ff",u="#e6f4ff"),t.save(),t.font=e.style;const h=t.measureText(r),g=h.actualBoundingBoxAscent+h.actualBoundingBoxDescent,f=8*s,T=4*s,p=4*s,m=h.width+f*2,I=g+T*2,L=e.metrics,P=n,O=i-L.boundingBoxAscent+(L.boundingBoxAscent+L.boundingBoxDescent-I)/2;t.fillStyle=u,this._drawRoundedRect(t,P,O,m,I,p),t.fill(),t.fillStyle=R,t.textBaseline="middle",t.fillText(r,n+f,O+I/2),t.restore()}_renderTextControl(t,e,n,i,r){const{scale:s,control:a,strikeoutColor:c}=this.options,{placeholderColor:d,bracketColor:R}=a;t.save(),t.font=e.style;const h=`请输入${e.label||""}`,g=r||h,T=t.measureText(g).width;t.fillStyle=R,t.textBaseline="alphabetic",t.fillText("[",n,i);const p=n+t.measureText("[").width;t.fillStyle=r?e.color||"#000000":d,t.fillText(g,p,i);const m=p+T;if(t.fillStyle=R,t.fillText("]",m,i),e.type==="reusableItem"){const I=t.measureText("[").width+T+t.measureText("]").width;if(t.lineWidth=s,this.draw.getMode()===l.EditorMode.PRINT?t.strokeStyle="transparent":t.strokeStyle=c||"red",e.strikeout){const L=i-3*s,P=i+3.5*s;t.beginPath(),t.moveTo(n,L),t.lineTo(n+I,L),t.stroke(),t.beginPath(),t.moveTo(n,P),t.lineTo(n+I,P),t.stroke()}else if(e.underline&&e.textDecoration?.style==="double"){const L=Math.floor(i+2*s)+.5,P=3*s;t.beginPath(),t.moveTo(n,L),t.lineTo(n+I,L),t.stroke(),t.beginPath(),t.moveTo(n,L+P),t.lineTo(n+I,L+P),t.stroke()}}t.restore()}_renderSelectControl(t,e,n,i,r){const{scale:s,control:a}=this.options,{placeholderColor:c,bracketColor:d}=a;t.save(),t.font=e.style;const u=`请选择${e.label||""}`,h=r||u,g=t.measureText(h),f=g.actualBoundingBoxAscent+g.actualBoundingBoxDescent;t.fillStyle=d,t.textBaseline="alphabetic",t.fillText("[",n,i);const T=n+t.measureText("[").width;t.fillStyle=r?e.color||"#000000":c,t.fillText(h,T,i);const p=T+g.width+2*s,m=i-f/2;t.beginPath(),t.moveTo(p,m-2*s),t.lineTo(p+5*s,m-2*s),t.lineTo(p+2.5*s,m+2*s),t.closePath(),t.fillStyle="#666666",t.fill();const I=p+6*s;t.fillStyle=d,t.fillText("]",I,i),t.restore()}_drawRoundedRect(t,e,n,i,r,s){t.beginPath(),t.moveTo(e+s,n),t.lineTo(e+i-s,n),t.quadraticCurveTo(e+i,n,e+i,n+s),t.lineTo(e+i,n+r-s),t.quadraticCurveTo(e+i,n+r,e+i-s,n+r),t.lineTo(e+s,n+r),t.quadraticCurveTo(e,n+r,e,n+r-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+s,n),t.closePath()}}class rc{draw;position;zone;options;elementList;rowList;positionList;constructor(t,e){this.draw=t,this.position=t.getPosition(),this.zone=t.getZone(),this.options=t.getOptions(),this.elementList=e||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(t){this.elementList=t}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const t=this.draw.getInnerWidth(),e=this.draw.getMargins(),n=wo(this.elementList);this.rowList=this.draw.computeRowList({startX:e[3],startY:this.getHeaderTop(),innerWidth:t,elementList:this.elementList,surroundElementList:n})}_computePositionList(){const t=this.getHeaderTop(),e=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],r=t;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:r,innerWidth:e,zone:l.EditorZone.HEADER})}getHeaderTop(){const{header:{top:t,disabled:e},scale:n}=this.options;return e?0:Math.floor(t*n)}getMaxHeight(){const{header:{maxHeightRadio:t}}=this.options,e=this.draw.getHeight();return Math.floor(e*yi[t])}getHeight(){if(this.options.header.disabled)return 0;const t=this.getMaxHeight(),e=this.getRowHeight();return e>t?t:e}getRowHeight(){return this.rowList.reduce((t,e)=>t+e.height,0)}getExtraHeight(){const t=this.draw.getMargins(),e=this.getHeight(),i=this.getHeaderTop()+e-t[0];return i<=0?0:i}render(t,e){t.save(),t.globalAlpha=this.zone.isHeaderActive()?1:this.options.header.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),r=[];let s=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(s+c.height>i)break;r.push(c),s+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:r,pageNo:e,startIndex:0,innerWidth:n,zone:l.EditorZone.HEADER}),t.restore()}}class lc{getOffsetY(t){return-t.metrics.height/2}render(t,e,n,i){t.save(),t.font=e.style,e.color&&(t.fillStyle=e.color),t.fillText(e.value,n,i+this.getOffsetY(e)),t.restore()}}class ac{getOffsetY(t){return t.metrics.height/2}render(t,e,n,i){t.save(),t.font=e.style,e.color&&(t.fillStyle=e.color),t.fillText(e.value,n,i+this.getOffsetY(e)),t.restore()}}class cc{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){t.save();const{scale:r,separator:{lineWidth:s,strokeStyle:a}}=this.options;t.lineWidth=(e.lineWidth||s)*r,t.strokeStyle=e.color||a,e.dashArray?.length&&t.setLineDash(e.dashArray);const c=Math.round(i);t.translate(0,t.lineWidth/2),t.beginPath(),t.moveTo(n,c),t.lineTo(n+e.width*r,c),t.stroke(),t.restore()}}class dc{draw;options;i18n;constructor(t){this.draw=t,this.options=t.getOptions(),this.i18n=t.getI18n()}render(t,e,n,i){const{pageBreak:{font:r,fontSize:s,lineDash:a}}=this.options,c=this.i18n.t("pageBreak.displayName"),{scale:d,defaultRowMargin:R}=this.options,u=s*d,h=e.width*d,g=this.draw.getDefaultBasicRowMarginHeight()*R;t.save(),t.font=`${u}px ${r}`;const f=t.measureText(c),T=(h-f.width)/2;t.setLineDash(a),t.translate(0,.5+g),t.beginPath(),t.moveTo(n,i),t.lineTo(n+T,i),t.moveTo(n+T+f.width,i),t.lineTo(n+h,i),t.stroke(),t.fillText(c,n+T,i+f.actualBoundingBoxAscent-u/2),t.restore()}}class Rc{draw;options;imageCache;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map}renderText(t,e){const{watermark:{data:n,opacity:i,font:r,size:s,color:a,repeat:c,gap:d,numberType:R},scale:u}=this.options,h=this.draw.getWidth(),g=this.draw.getHeight();t.save(),t.globalAlpha=i,t.font=`${s*u}px ${r}`;let f=n;const T=new RegExp(pn.PAGE_NO);T.test(f)&&(f=sn.formatNumberPlaceholder(f,e+1,T,R));const p=new RegExp(pn.PAGE_COUNT);p.test(f)&&(f=sn.formatNumberPlaceholder(f,this.draw.getPageCount(),p,R));const m=t.measureText(f);if(c){const I=this.draw.getPagePixelRatio(),L=document.createElement("canvas"),P=L.getContext("2d"),O=m.width,S=m.actualBoundingBoxAscent+m.actualBoundingBoxDescent,F=Math.sqrt(Math.pow(O,2)+Math.pow(S,2)),N=F+2*d[0]*u,V=F+2*d[1]*u;L.width=N,L.height=V,L.style.width=`${N*I}px`,L.style.height=`${V*I}px`,P.translate(N/2,V/2),P.rotate(-45*Math.PI/180),P.translate(-N/2,-V/2),P.font=`${s*u}px ${r}`,P.fillStyle=a,P.fillText(f,(N-O)/2,(V-S)/2+m.actualBoundingBoxAscent);const Y=t.createPattern(L,"repeat");Y&&(t.fillStyle=Y,t.fillRect(0,0,h,g))}else{const I=h/2,L=g/2;t.fillStyle=a,t.translate(I,L),t.rotate(-45*Math.PI/180),t.fillText(f,-m.width/2,m.actualBoundingBoxAscent-s*u/2)}t.restore()}renderImage(t){const{watermark:{width:e,height:n,data:i,opacity:r,repeat:s,gap:a},scale:c}=this.options;if(!this.imageCache.has(i)){const g=new Image;g.setAttribute("crossOrigin","Anonymous"),g.src=i,g.onload=()=>{this.imageCache.set(i,g),this.draw.render({isCompute:!1,isSubmitHistory:!1})};return}const d=this.draw.getWidth(),R=this.draw.getHeight(),u=e*c,h=n*c;if(t.save(),t.globalAlpha=r,s){const g=this.draw.getPagePixelRatio(),f=document.createElement("canvas"),T=f.getContext("2d"),p=Math.sqrt(Math.pow(u,2)+Math.pow(h,2)),m=p+2*a[0]*c,I=p+2*a[1]*c;f.width=m,f.height=I,f.style.width=`${m*g}px`,f.style.height=`${I*g}px`,T.translate(m/2,I/2),T.rotate(-45*Math.PI/180),T.translate(-m/2,-I/2),T.drawImage(this.imageCache.get(i),(m-u)/2,(I-h)/2,u,h);const L=t.createPattern(f,"repeat");L&&(t.fillStyle=L,t.fillRect(0,0,d,R))}else{const g=d/2,f=R/2;t.translate(g,f),t.rotate(-45*Math.PI/180),t.drawImage(this.imageCache.get(i),-u/2,-h/2,u,h)}t.restore()}render(t,e){this.options.watermark.type===l.WatermarkType.IMAGE?this.renderImage(t):this.renderText(t,e)}}class uc{draw;control;options;highlightList;highlightMatchResult;constructor(t){this.draw=t.getDraw(),this.control=t,this.options=this.draw.getOptions(),this.highlightList=[],this.highlightMatchResult=[]}getControlHighlight(t,e){const{control:{activeBackgroundColor:n,disabledBackgroundColor:i,existValueBackgroundColor:r,noValueBackgroundColor:s}}=this.options,a=t[e],c=this.draw.isPrintMode(),d=this.control.getActiveControl()?.getElement();let R=!1,u=!1,h=!1,g=!1;return a.highlight||(R=!c&&!!n&&!!d&&a.controlId===d.controlId&&!this.control.getIsRangeInPostfix()),R||(u=!c&&!!i&&!!a.control?.disabled),u||(h=!c&&!!r&&!!a.controlId&&this.control.getIsExistValueByElementListIndex(t,e)),h||(g=!c&&!!s&&!!a.controlId&&!this.control.getIsExistValueByElementListIndex(t,e)),(R?n:"")||(u?i:"")||(h?r:"")||(g?s:"")}getHighlightMatchResult(){return this.highlightMatchResult}getHighlightList(){return this.highlightList}setHighlightList(t){this.highlightList=t}computeHighlightList(){const t=this.draw.getSearch(),e=(n,i)=>{let r=0;for(;r<n.length;){const s=n[r];if(r++,s.type===l.ElementType.TABLE){const f=s.trList;for(let T=0;T<f.length;T++){const p=f[T];for(let m=0;m<p.tdList.length;m++){const I=p.tdList[m],L={tableId:s.id,tableIndex:r-1,trIndex:T,tdIndex:m,tdId:I.id};e(I.value,L)}}}const a=s?.control;if(!a)continue;const c=this.highlightList.findIndex(f=>f.id===s.controlId||a.conceptId&&a.conceptId===f.conceptId);if(!~c)continue;const d=r;let R=r;for(;R<n.length&&n[R].controlId===s.controlId;)R++;r=R;const u=n.slice(d,R).map(f=>f.controlComponent===l.ControlComponent.VALUE?f:{value:_}),h=this.highlightList[c],{ruleList:g}=h;for(let f=0;f<g.length;f++){const T=g[f],p=t.getMatchList(T.keyword,u);this.highlightMatchResult.push(...p.map(m=>({...m,...T,...i,index:m.index+d})))}}};this.highlightMatchResult=[],e(this.draw.getOriginalMainElementList())}renderHighlightList(t,e){if(!this.highlightMatchResult?.length)return;const{searchMatchAlpha:n,searchMatchColor:i}=this.options,r=this.draw.getPosition().getOriginalPositionList(),s=this.draw.getOriginalElementList();t.save();for(let a=0;a<this.highlightMatchResult.length;a++){const c=this.highlightMatchResult[a];let d=null;if(c.tableId){const{tableIndex:I,trIndex:L,tdIndex:P,index:O}=c;d=s[I]?.trList[L].tdList[P]?.positionList[O]}else d=r[c.index];if(!d)continue;const{coordinate:{leftTop:R,leftBottom:u,rightTop:h},pageNo:g}=d;if(g!==e)continue;t.fillStyle=c.backgroundColor||i,t.globalAlpha=c.alpha||n;const f=R[0],T=R[1],p=h[0]-R[0],m=u[1]-R[1];t.fillRect(f,T,p,m)}t.restore()}}class hc{borderRect;options;constructor(t){this.borderRect=this.clearBorderInfo(),this.options=t.getOptions()}clearBorderInfo(){return this.borderRect={x:0,y:0,width:0,height:0},this.borderRect}recordBorderInfo(t,e,n,i){!this.borderRect.width&&(this.borderRect.x=t,this.borderRect.y=e,this.borderRect.height=i),this.borderRect.width+=n}render(t){if(!this.borderRect.width)return;const{scale:e,control:{borderWidth:n,borderColor:i}}=this.options,{x:r,y:s,width:a,height:c}=this.borderRect;t.save(),t.translate(0,1*e),t.lineWidth=n*e,t.strokeStyle=i,t.beginPath(),t.rect(r,s,a,c),t.stroke(),t.restore(),this.clearBorderInfo()}}class In{draw;element;control;isPopup;selectDom;options;VALUE_DELIMITER=",";DEFAULT_MULTI_SELECT_DELIMITER=",";constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1,this.selectDom=null}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getCodes(){return this.element?.control?.code?this.element.control.code.split(","):[]}getText(t){if(!this.element?.control)return null;const e=this.element.control;if(!e.valueSets?.length)return null;const n=e?.multiSelectDelimiter||this.DEFAULT_MULTI_SELECT_DELIMITER,i=e.valueSets,r=[];return t.forEach(s=>{const a=i.find(c=>c.code===s);a&&!Ui(a.value)&&r.push(a.value)}),r.join(n)||null}getValue(t={}){const{elementList:e,range:n}=this.control.mergeControl(t),{startIndex:i}=n,r=e[i],s=[];let a=i;for(;a>=0;){const d=e[a];if(!d||d.controlId!==r.controlId||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT)break;d.controlComponent===l.ControlComponent.VALUE&&s.unshift(d),a--}let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==r.controlId||d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POST_TEXT)break;d.controlComponent===l.ControlComponent.VALUE&&s.push(d),c++}return s}setValue(t,e={},n={}){if(!this.element.control?.selectExclusiveOptions?.inputAble||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=r,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s):this.control.removePlaceholder(s,{elementList:i});const d=i[s],R=d.type&&!$t.includes(d.type)||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...Gt]):ie(d,["type"]),u=r.startIndex+1;for(let h=0;h<t.length;h++){const g={...R,...t[h],controlComponent:l.ControlComponent.VALUE};Ut(i,[g],s,{editorOptions:this.options}),c.spliceElementList(i,u+h,0,[g])}return u+t.length-1}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=e[i],a=e[r],c=this.element.control?.selectExclusiveOptions?.inputAble;if(t.key===l.KeyMap.Backspace)return i!==r?c?(this.draw.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect():s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):c?(this.draw.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1):this.clearSelect();if(t.key===l.KeyMap.Delete){if(i!==r)return c?(this.draw.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect();{const d=e[r+1];return(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT)&&d.controlComponent===l.ControlComponent.PLACEHOLDER||d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POST_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):c?(this.draw.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect()}}return r}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();return t===e?t:this.clearSelect()}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const r=t.elementList||this.control.getElementList(),{startIndex:s}=t.range||this.control.getRange(),a=r[s];let c=-1,d=-1,R=s;for(;R>0;){const g=r[R];if(g.controlId!==a.controlId||g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT){c=R;break}R--}let u=s+1;for(;u<r.length;){const g=r[u];if(g.controlId!==a.controlId||g.controlComponent===l.ControlComponent.POSTFIX||g.controlComponent===l.ControlComponent.POST_TEXT){d=u-1;break}u++}return!~c||!~d?-1:(this.control.getDraw().spliceElementList(r,c+1,d-c,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(R,t),this.control.setControlProperties({code:void 0},{elementList:r,range:{startIndex:R,endIndex:R}}),R)}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const i=e.elementList||this.control.getElementList(),r=e.range||this.control.getRange(),s=this.element.control,a=t?.split(this.VALUE_DELIMITER)||[],c=s.code,d=s.code?.split(this.VALUE_DELIMITER)||[],R=s.isMultiSelect;if(!R&&t===c||R&&Di(d,a)){this.control.repaintControl({curIndex:r.startIndex,isCompute:!1,isSubmitHistory:!1}),this.destroy();return}const u=s.valueSets;if(!Array.isArray(u)||!u.length)return;const h=this.getText(a);if(!h){if(c){const P=this.clearSelect(e,{isIgnoreDeletedRule:n.isIgnoreDeletedRule});~P&&(this.control.repaintControl({curIndex:P}),this.control.emitControlContentChange({controlValue:[]}))}return}const g=this.getValue(e)[0],f=g?Dt(g,Re):Dt(i[r.startIndex],Gt),T=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~T)return;c||this.control.removePlaceholder(T,e);const p=ie(i[T],Re),m=T+1,I=ct(h),L=this.control.getDraw();for(let P=0;P<I.length;P++){const O={...f,...p,type:l.ElementType.TEXT,value:I[P],controlComponent:l.ControlComponent.VALUE};(O.color===this.options.control.bracketColor||O.color===this.options.control.placeholderColor)&&(O.color=this.options.defaultColor),Ut(i,[O],T,{editorOptions:this.options}),L.spliceElementList(i,m+P,0,[O])}if(this.control.setControlProperties({code:t},{elementList:i,range:{startIndex:T,endIndex:T}}),!e.range){const P=m+I.length-1;this.control.repaintControl({curIndex:P}),this.control.emitControlContentChange({context:e}),R||this.destroy()}}_createSelectPopupDom(){const t=this.element.control,e=t.valueSets;if(!Array.isArray(e)||!e.length)return;const n=this.control.getPosition();if(!n)return;const i=document.createElement("div");i.classList.add(`${z}-select-control-popup`),i.setAttribute(de,l.EditorComponent.POPUP);const r=document.createElement("ul");let s=null;for(let h=0;h<e.length;h++){const g=e[h],f=document.createElement("li");let T=this.getCodes();T.includes(g.code)&&(f.classList.add("active"),s=f),f.onclick=()=>{const p=T.findIndex(m=>m===g.code);t.isMultiSelect?~p?T.splice(p,1):T.push(g.code):~p?T=[]:T=[g.code],this.setSelect(T.join(this.VALUE_DELIMITER))},f.append(document.createTextNode(g.value)),r.append(f)}i.append(r);const{coordinate:{leftTop:[a,c]},lineHeight:d}=n,R=this.control.getPreY();i.style.left=`${a}px`,i.style.top=`${c+R+d}px`,this.control.getContainer().append(i),this.selectDom=i,s&&Zi(i,s)}awake(){if(this.isPopup||this.control.getIsDisabledControl())return;const{startIndex:t}=this.control.getRange(),n=this.control.getElementList()[t];if(!n||n.controlId!==this.element.controlId)return;const i=n.controlComponent===l.ControlComponent.PREFIX||n.controlComponent===l.ControlComponent.PRE_TEXT||n.controlComponent===l.ControlComponent.POSTFIX||n.controlComponent===l.ControlComponent.POST_TEXT||n.controlComponent===l.ControlComponent.PLACEHOLDER;!this.control.getIsRangeWithinControl()&&!i||(this._createSelectPopupDom(),this.isPopup=!0)}destroy(){this.isPopup&&(this.selectDom?.remove(),this.isPopup=!1)}}var hs;function q(){return hs.apply(null,arguments)}function gc(o){hs=o}function se(o){return o instanceof Array||Object.prototype.toString.call(o)==="[object Array]"}function _e(o){return o!=null&&Object.prototype.toString.call(o)==="[object Object]"}function Mt(o,t){return Object.prototype.hasOwnProperty.call(o,t)}function Go(o){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(o).length===0;var t;for(t in o)if(Mt(o,t))return!1;return!0}function kt(o){return o===void 0}function Me(o){return typeof o=="number"||Object.prototype.toString.call(o)==="[object Number]"}function Pn(o){return o instanceof Date||Object.prototype.toString.call(o)==="[object Date]"}function gs(o,t){var e=[],n,i=o.length;for(n=0;n<i;++n)e.push(t(o[n],n));return e}function Ue(o,t){for(var e in t)Mt(t,e)&&(o[e]=t[e]);return Mt(t,"toString")&&(o.toString=t.toString),Mt(t,"valueOf")&&(o.valueOf=t.valueOf),o}function me(o,t,e,n){return Ks(o,t,e,n,!0).utc()}function fc(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Rt(o){return o._pf==null&&(o._pf=fc()),o._pf}var Ao;Array.prototype.some?Ao=Array.prototype.some:Ao=function(o){var t=Object(this),e=t.length>>>0,n;for(n=0;n<e;n++)if(n in t&&o.call(this,t[n],n,t))return!0;return!1};function ko(o){var t=null,e=!1,n=o._d&&!isNaN(o._d.getTime());if(n&&(t=Rt(o),e=Ao.call(t.parsedDateParts,function(i){return i!=null}),n=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&e),o._strict&&(n=n&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(o))o._isValid=n;else return n;return o._isValid}function Gn(o){var t=me(NaN);return o!=null?Ue(Rt(t),o):Rt(t).userInvalidated=!0,t}var fs=q.momentProperties=[],Jo=!1;function Bo(o,t){var e,n,i,r=fs.length;if(kt(t._isAMomentObject)||(o._isAMomentObject=t._isAMomentObject),kt(t._i)||(o._i=t._i),kt(t._f)||(o._f=t._f),kt(t._l)||(o._l=t._l),kt(t._strict)||(o._strict=t._strict),kt(t._tzm)||(o._tzm=t._tzm),kt(t._isUTC)||(o._isUTC=t._isUTC),kt(t._offset)||(o._offset=t._offset),kt(t._pf)||(o._pf=Rt(t)),kt(t._locale)||(o._locale=t._locale),r>0)for(e=0;e<r;e++)n=fs[e],i=t[n],kt(i)||(o[n]=i);return o}function Mn(o){Bo(this,o),this._d=new Date(o._d!=null?o._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Jo===!1&&(Jo=!0,q.updateOffset(this),Jo=!1)}function re(o){return o instanceof Mn||o!=null&&o._isAMomentObject!=null}function Ts(o){q.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+o)}function te(o,t){var e=!0;return Ue(function(){if(q.deprecationHandler!=null&&q.deprecationHandler(null,o),e){var n=[],i,r,s,a=arguments.length;for(r=0;r<a;r++){if(i="",typeof arguments[r]=="object"){i+=`
102
- [`+r+"] ";for(s in arguments[0])Mt(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[r];n.push(i)}Ts(o+`
97
+ `:""}`})}else if(r.type===l.ElementType.CHECKBOX)n+=r.checkbox?.value?"☑":"□";else if(r.type===l.ElementType.RADIO)n+=r.radio?.value?"☉":"○";else if(!r.type||r.type===l.ElementType.LATEX||$t.includes(r.type)){let s="";if(r.type===l.ElementType.CONTROL){const a=r.control.value?.[0]?.value||"";s=a?`${r.control?.preText||""}${a}${r.control?.postText||""}`:""}else r.type===l.ElementType.DATE?s=r.valueList?.map(a=>a.value).join("")||"":s=r.value;n+=s.replace(new RegExp(`${H}`,"g"),`
98
+ `)}}return n}return t(Pt(o))}function Qo(o){return Mo(o,["metrics","style"])}function rn(o){return!!o?.type&&(dl.includes(o.type)||o.imgDisplay===l.ImageDisplay.INLINE)}function ta(o,t){const e=document.createElement(t);for(let n=0;n<o.attributes.length;n++){const i=o.attributes[n];e.setAttribute(i.name,i.value)}return e.innerHTML=o.innerHTML,e}function vo(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e];n?.imgDisplay===l.ImageDisplay.SURROUND&&t.push(n)}return t}function ea(o,t){for(let e=o.length-1;e>=0;e--)o[e].imgFloatPosition?.pageNo===t&&o.splice(e,1)}function se(o){return!!(o?.hide||o?.control?.hide||o?.area?.hide||o?.logicTemplateHidden)}function we(o){return!se(o)}function Mn(o,t,e=l.LocationPosition.BEFORE){if(we(o[t]))return t;let n=t;if(e===l.LocationPosition.BEFORE)for(n=t-1;n>0;){if(we(o[n]))return n;n--}else for(n=t+1;n<o.length;){if(we(o[n]))return n;n++}return n}const es=`${Ln}-control`;function na(o){localStorage.setItem(Ln,JSON.stringify({text:o.text,elementList:o.elementList}))}function ns(){const o=localStorage.getItem(Ln);return o?JSON.parse(o):null}function os(){localStorage.removeItem(Ln)}function oa(o){localStorage.setItem(es,JSON.stringify(o))}function is(){const o=localStorage.getItem(es);return o?JSON.parse(o):null}function ia(){return!!is()?.element}async function sa(o,t,e){if(!o&&!t&&!e.length)return;const n=new Blob([o],{type:"text/plain"}),i=new Blob([t],{type:"text/html"});if(window.ClipboardItem){const r=new ClipboardItem({[n.type]:n,[i.type]:i});await window.navigator.clipboard.write([r])}else{const r=document.createElement("div");r.setAttribute("contenteditable","true"),r.innerHTML=t,document.body.append(r);const s=window.getSelection(),a=document.createRange(),c=document.createElement("span");c.innerText=`
99
+ `,r.append(c),a.selectNodeContents(r),s?.removeAllRanges(),s?.addRange(a),document.execCommand("copy"),r.remove()}na({text:o,elementList:e})}async function ss(o,t){const e=nn(o,t);document.body.append(e);const n=e.innerText;e.remove();const i=e.innerHTML;!n&&!i&&!o.length||await sa(n,i,Pt(o))}function ra(o){let t=!1;for(let e=0;e<o.items.length;e++)if(o.items[e].kind==="file"){t=!0;break}return t}function Ko(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled()||e.getControl().getIsDisabledPasteControl())return;const n=e.getRange(),{startIndex:i}=n.getRange(),r=e.getElementList();if(~i&&!n.getIsSelectAll()){const s=r[i];if(s?.titleId||s?.listId){let a=0;for(;a<t.length;){const c=t[a];if(s.titleId&&/^\n/.test(c.value))break;if(ul.includes(c.type)){if(t.splice(a,1),c.valueList)for(let d=0;d<c.valueList.length;d++){const R=c.valueList[d];R.value===H||R.value===`
100
+ `||(t.splice(a,0,R),a++)}a--}a++}}Ut(r,t,i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()})}e.insertElementList(t)}function rs(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=on(t,{innerWidth:e.getOriginalInnerWidth()});Ko(o,n)}function Ho(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=e.getRange(),{startIndex:i}=n.getRange(),r=e.getElementList(),s=new FileReader;s.readAsDataURL(t),s.onload=()=>{const a=new Image,c=s.result;a.src=c,a.onload=()=>{const d={value:c,type:l.ElementType.IMAGE,width:a.width,height:a.height};~i&&Ut(r,[d],i,{editorOptions:e.getOptions()}),e.insertElementList([d])}}}function la(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=t.clipboardData;if(!n)return;const{paste:i}=e.getOverride();if(i&&i(t)?.preventDefault!==!1)return;if(!ra(n)){const s=n.getData("text"),a=ns();if(a&&Qn(s)===Qn(a.text)){Ko(o,a.elementList);return}}os();let r=!1;for(let s=0;s<n.items.length;s++)if(n.items[s].type==="text/html"){r=!0;break}for(let s=0;s<n.items.length;s++){const a=n.items[s];if(a.kind==="string"){if(a.type==="text/plain"&&!r){a.getAsString(c=>{o.input(c)});break}if(a.type==="text/html"&&r){a.getAsString(c=>{rs(o,c)});break}}else if(a.kind==="file"&&a.type.includes("image")){const c=a.getAsFile();c&&Ho(o,c)}}}async function aa(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const{paste:n}=e.getOverride();if(n&&n()?.preventDefault!==!1)return;const i=await navigator.clipboard.readText(),r=ns();if(r&&Qn(i)===Qn(r.text)){Ko(o,r.elementList);return}if(os(),t?.isPlainText)i&&o.input(i);else{const s=await navigator.clipboard.read();let a=!1;for(const c of s)if(c.types.includes("text/html")){a=!0;break}for(const c of s)if(c.types.includes("text/plain")&&!a){const R=await(await c.getType("text/plain")).text();R&&o.input(R)}else if(c.types.includes("text/html")&&a){const R=await(await c.getType("text/html")).text();R&&rs(o,R)}else if(c.types.some(d=>d.startsWith("image/"))){const d=c.types.find(u=>u.startsWith("image/")),R=await c.getType(d);Ho(o,R)}}}class ca{draw;container;agentCursorDom;canvasEvent;eventBus;constructor(t,e){this.draw=t,this.container=t.getContainer(),this.canvasEvent=e,this.eventBus=t.getEventBus();const n=document.createElement("textarea");n.autocomplete="off",n.classList.add(`${z}-inputarea`),n.innerText="",this.container.append(n),this.agentCursorDom=n,n.onkeydown=i=>this._keyDown(i),n.oninput=this._input.bind(this),n.onpaste=i=>this._paste(i),n.addEventListener("compositionstart",this._compositionstart.bind(this)),n.addEventListener("compositionupdate",this._compositionupdate.bind(this)),n.addEventListener("compositionend",this._compositionend.bind(this)),n.addEventListener("keydown",this._keydown.bind(this)),this.eventBus.on("rangeStyleChange",i=>{this.agentCursorDom.style.fontSize=Math.max(i.size,18)+"px"})}getAgentCursorDom(){return this.agentCursorDom}_keyDown(t){this.draw.isInteractionSuspended()||this.canvasEvent.keydown(t)}_input(t){if(this.draw.isInteractionSuspended())return;const e=t.data;e&&this.canvasEvent.input(e),this.eventBus.isSubscribe("input")&&this.eventBus.emit("input",t)}_paste(t){this.draw.isInteractionSuspended()||this.draw.isReadonly()||!t.clipboardData||(la(this.canvasEvent,t),t.preventDefault())}_compositionstart(){this.draw.isInteractionSuspended()||(this.agentCursorDom.style.zIndex="1000",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="#000",this.agentCursorDom.style.background="#fff",this.canvasEvent.compositionstart())}_compositionupdate(){if(this.draw.isInteractionSuspended())return;this.agentCursorDom.style.width="9999px";let t=this.agentCursorDom.scrollWidth;const e=this.container.clientWidth,n=Math.max(e-this.agentCursorDom.offsetLeft,100);t>n&&(t=n),this.agentCursorDom.style.width=t+"px"}_compositionend(t){this.draw.isInteractionSuspended()||(this.agentCursorDom.style.zIndex="-1",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="",this.agentCursorDom.style.background="",this.canvasEvent.compositionend(t))}_keydown(t){this.draw.isInteractionSuspended()||this.canvasEvent.isComposing&&t.code==="Escape"&&this.canvasEvent.compositionCancel()}}class da{ANIMATION_CLASS=`${z}-cursor--animation`;draw;container;options;position;cursorDom;cursorAgent;blinkTimeout;hitLineStartIndex;constructor(t,e){this.draw=t,this.container=t.getContainer(),this.position=t.getPosition(),this.options=t.getOptions(),this.cursorDom=document.createElement("div"),this.cursorDom.classList.add(`${z}-cursor`),this.container.append(this.cursorDom),this.cursorAgent=new ca(t,e),this.blinkTimeout=null}getCursorDom(){return this.cursorDom}getAgentDom(){return this.cursorAgent.getAgentCursorDom()}getAgentIsActive(){return this.getAgentDom()===document.activeElement}getAgentDomValue(){return this.getAgentDom().value}clearAgentDomValue(){this.getAgentDom().value=""}getHitLineStartIndex(){return this.hitLineStartIndex}_blinkStart(){this.cursorDom.classList.add(this.ANIMATION_CLASS)}_blinkStop(){this.cursorDom.classList.remove(this.ANIMATION_CLASS)}_setBlinkTimeout(){this._clearBlinkTimeout(),this.blinkTimeout=window.setTimeout(()=>{this._blinkStart()},500)}_clearBlinkTimeout(){this.blinkTimeout&&(this._blinkStop(),window.clearTimeout(this.blinkTimeout),this.blinkTimeout=null)}focus(){if(il&&this.draw.isReadonly())return;const t=this.cursorAgent.getAgentCursorDom();document.activeElement!==t&&(t.focus(),t.setSelectionRange(0,0))}drawCursor(t){let e=this.position.getCursorPosition();if(!e)return;const{scale:n,cursor:i}=this.options,{color:r,width:s,isShow:a=!0,isBlink:c=!0,isFocus:d=!0,hitLineStartIndex:R}={...i,...t},u=this.draw.getHeight(),h=this.draw.getPageGap();this.hitLineStartIndex=R,R&&(e=this.position.getPositionList()[R]);const{metrics:g,coordinate:{leftTop:f,rightTop:T},ascent:m,pageNo:p}=e,P=(this.draw.getZone().isMainActive()?p:this.draw.getPageNo())*(u+h),O=el*n,S=Math.min(g.height/4,O),F=g.height+S*2,N=this.cursorAgent.getAgentCursorDom();d&&setTimeout(()=>{this.focus()});const V=g.boundingBoxDescent<0?0:g.boundingBoxDescent,Y=f[1]+m+V-(F-S)+P,X=R?f[0]:T[0];if(N.style.left=`${X}px`,N.style.top=`${Y+F-O}px`,!a){this.recoveryCursor();return}const W=this.cursorDom.style.top,E=this.draw.isReadonly();this.cursorDom.style.width=`${s*n}px`,this.cursorDom.style.backgroundColor=r,this.cursorDom.style.left=`${X}px`,this.cursorDom.style.top=`${Y}px`,this.cursorDom.style.display=E?"none":"block",this.cursorDom.style.height=`${F}px`,c?this._setBlinkTimeout():this._clearBlinkTimeout(),Eo(()=>{this.moveCursorToVisible({cursorPosition:e,direction:parseInt(W)>Y?Zt.UP:Zt.DOWN})})}recoveryCursor(){this.cursorDom.style.display="none",this._clearBlinkTimeout()}moveCursorToVisible(t){const{cursorPosition:e,direction:n}=t;if(!e||!n)return;const{pageNo:i,coordinate:{leftTop:r,leftBottom:s}}=e,a=zr(this.container),c={left:0,right:0,top:0,bottom:0},d=a===document.documentElement;if(d)c.right=window.innerWidth,c.bottom=window.innerHeight;else{const{left:T,right:m,top:p,bottom:I}=a.getBoundingClientRect();c.left=T,c.right=m,c.top=p,c.bottom=I}const R=i*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,u=n===Zt.UP,h=s[0]+(d?0:c.left),g=u?r[1]+R:s[1]+R,{maskMargin:f}=this.options;if(c.top+=f[0],c.bottom-=f[2],!(h>=c.left&&h<=c.right&&g>=c.top&&g<=c.bottom)){const{scrollLeft:T,scrollTop:m}=a;u?a.scroll(T,m-(c.top-g)):a.scroll(T,m+g-c.bottom)}}}var xn;(function(o){o[o.LEFT=0]="LEFT",o[o.CENTER=1]="CENTER",o[o.RIGHT=2]="RIGHT"})(xn||(xn={}));function Te(o){return _e?o.metaKey:o.ctrlKey}l.KeyMap=void 0,(function(o){o.Delete="Delete",o.Backspace="Backspace",o.Enter="Enter",o.Left="ArrowLeft",o.Right="ArrowRight",o.Up="ArrowUp",o.Down="ArrowDown",o.ESC="Escape",o.TAB="Tab",o.META="Meta",o.LEFT_BRACKET="[",o.RIGHT_BRACKET="]",o.COMMA=",",o.PERIOD=".",o.LEFT_ANGLE_BRACKET="<",o.RIGHT_ANGLE_BRACKET=">",o.EQUAL="=",o.MINUS="-",o.PLUS="+",o.A="a",o.B="b",o.C="c",o.D="d",o.E="e",o.F="f",o.G="g",o.H="h",o.I="i",o.J="j",o.K="k",o.L="l",o.M="m",o.N="n",o.O="o",o.P="p",o.Q="q",o.R="r",o.S="s",o.T="t",o.U="u",o.V="v",o.W="w",o.X="x",o.Y="y",o.Z="z",o.A_UPPERCASE="A",o.B_UPPERCASE="B",o.C_UPPERCASE="C",o.D_UPPERCASE="D",o.E_UPPERCASE="E",o.F_UPPERCASE="F",o.G_UPPERCASE="G",o.H_UPPERCASE="H",o.I_UPPERCASE="I",o.J_UPPERCASE="J",o.K_UPPERCASE="K",o.L_UPPERCASE="L",o.M_UPPERCASE="M",o.N_UPPERCASE="N",o.O_UPPERCASE="O",o.P_UPPERCASE="P",o.Q_UPPERCASE="Q",o.R_UPPERCASE="R",o.S_UPPERCASE="S",o.T_UPPERCASE="T",o.U_UPPERCASE="U",o.V_UPPERCASE="V",o.W_UPPERCASE="W",o.X_UPPERCASE="X",o.Y_UPPERCASE="Y",o.Z_UPPERCASE="Z",o.ZERO="0",o.ONE="1",o.TWO="2",o.THREE="3",o.FOUR="4",o.FIVE="5",o.SIX="6",o.SEVEN="7",o.EIGHT="8",o.NINE="9"})(l.KeyMap||(l.KeyMap={}));class Gn{element;control;constructor(t,e){this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getCode(){return this.element.control?.code||null}getValue(){const t=this.control.getElementList(),{startIndex:e}=this.control.getRange(),n=t[e],i=[];let r=e;for(;r>0;){const a=t[r];if(a.controlId!==n.controlId||a.controlComponent===l.ControlComponent.PREFIX||a.controlComponent===l.ControlComponent.PRE_TEXT)break;a.controlComponent===l.ControlComponent.VALUE&&i.unshift(a),r--}let s=e+1;for(;s<t.length;){const a=t[s];if(a.controlId!==n.controlId||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT)break;a.controlComponent===l.ControlComponent.VALUE&&i.push(a),s++}return i}setValue(){return-1}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const{control:i}=this.element,r=e.elementList||this.control.getElementList(),{startIndex:s}=e.range||this.control.getRange(),a=r[s];let c=s;for(;c>0;){const R=r[c];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT)break;if(R.controlComponent===l.ControlComponent.CHECKBOX){const u=R.checkbox;u.value=t.includes(u.code)}c--}let d=s+1;for(;d<r.length;){const R=r[d];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.POSTFIX||R.controlComponent===l.ControlComponent.POST_TEXT)break;if(R.controlComponent===l.ControlComponent.CHECKBOX){const u=R.checkbox;u.value=t.includes(u.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:s,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getRange();this.control.shrinkBoundary();const{startIndex:n,endIndex:i}=e;return t.key===l.KeyMap.Backspace||t.key===l.KeyMap.Delete?this.control.removeControl(n):i}cut(){return-1}}class _o extends Gn{setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const{control:i}=this.element,r=e.elementList||this.control.getElementList(),{startIndex:s}=e.range||this.control.getRange(),a=r[s];let c=s;for(;c>0;){const R=r[c];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT)break;if(R.controlComponent===l.ControlComponent.RADIO){const u=R.radio;u.value=t.includes(u.code)}c--}let d=s+1;for(;d<r.length;){const R=r[d];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.POSTFIX||R.controlComponent===l.ControlComponent.POST_TEXT)break;if(R.controlComponent===l.ControlComponent.RADIO){const u=R.radio;u.value=t.includes(u.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:s,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}}function ls(o){const t=o.getDraw(),e=t.getPosition(),n=t.getRange();o.isAllowDrag=!0,o.cacheRange=at(n.getRange()),o.cacheElementList=t.getElementList(),o.cachePositionList=e.getPositionList(),o.cachePositionContext=e.getPositionContext()}function as(o,t){const{checkbox:e,control:n}=o;if(!n)t.getCheckboxParticle().setSelect(o);else{const i=n?.code?n.code.split(","):[];if(e?.value){const s=i.findIndex(a=>a===e.code);i.splice(s,1)}else e?.code&&i.push(e.code);const r=t.getControl().getActiveControl();r instanceof Gn&&r.setSelect(i)}}function cs(o,t){const{radio:e,control:n}=o;if(!n)t.getRadioParticle().setSelect(o);else{const i=e?.code?[e.code]:[],r=t.getControl().getActiveControl();r instanceof _o&&r.setSelect(i)}}function Ra(o,t){const e=t.getDraw();let n=e.isReadonly();const i=e.getRange(),r=e.getPosition(),s=i.getRange();if(o.button===xn.RIGHT&&(s.isCrossRowCol||!i.getIsCollapsed()))return;const c=o.target.dataset.index;if(c&&e.setPageNo(Number(c)),!t.isAllowDrag&&!n&&s.startIndex!==s.endIndex&&i.getIsPointInRange(o.offsetX,o.offsetY,e.getPageNo())){ls(t);return}t.isAllowSelection=!0;const d=at(r.getPositionContext()),R=r.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!R)return;const{index:u,isDirectHit:h,isCheckbox:g,isRadio:f,isImage:T,isLabel:m,isMacro:p,isTable:I,tdValueIndex:L,hitLineStartIndex:P}=R;h&&p&&console.log("mousedown - positionResult:",{index:u,isDirectHit:h,isMacro:p}),t.mouseDownStartPosition={...R,index:I?L:u,originalIndex:u,x:o.offsetX,y:o.offsetY};const O=e.getElementList(),S=r.getPositionList(),F=I?L:u;let N;I?N=e.getTd().value[L]:N=O[F];const V=!!(h&&T),Y=!!(h&&g),X=!!(h&&f),W=!!(h&&m),E=!!(h&&p),C=tt=>tt&&(tt.type===l.ElementType.MACRO||tt.type===l.ElementType.CUSTOM_MACRO||tt.type===l.ElementType.REUSABLE_ITEM||tt.type===l.ElementType.SUB_TEMPLATE||tt.type===l.ElementType.MENSTRUAL_HISTORY||tt.type===l.ElementType.FETAL_HEART_POSITION||tt.type===l.ElementType.TOOTH_POSITION||tt.type===l.ElementType.LIST||tt.type===l.ElementType.SPECIAL_SYMBOLS),M=tt=>tt&&!!tt.originControlId&&!!tt.controlId,y=tt=>tt&&!!tt.originControlId&&!!tt.controlId&&(tt.controlComponent===l.ControlComponent.POSTFIX||tt.controlComponent===l.ControlComponent.POSTTEXTFIX||tt.controlComponent===l.ControlComponent.POST_TEXT||tt.controlComponent===l.ControlComponent.PLACEHOLDER),b=e.getMode()===l.EditorMode.FORM,D=b?e.getControl().getActiveTextControlLimit():null;let U=F;const Q=!!(D&&(!N?.controlId||N.controlId===D.controlId&&(N.originControlId||null)===D.originControlId||D.parentControlId&&N.controlId===D.parentControlId&&!N.originControlId));if(b&&(N?.controlId||N?.originControlId)){let tt;const ht=N.originControlId||N.controlId;for(let ut=F;ut>=0;ut--){const v=O[ut];if(v.controlId===ht&&!v.originControlId&&v.control?.type){tt=v.control.type;break}if(v.controlId!==N.controlId&&v.controlId!==ht)break}if(tt===l.ControlType.TEXT&&M(N))N.controlComponent===l.ControlComponent.PREFIX||N.controlComponent===l.ControlComponent.PRE_TEXT||N.controlComponent===l.ControlComponent.PRETEXTFIX||N.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT?U=Math.max(F-1,0):(N.controlComponent===l.ControlComponent.POSTFIX||N.controlComponent===l.ControlComponent.POST_TEXT||N.controlComponent===l.ControlComponent.POSTTEXTFIX||N.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)&&(U=F);else if(tt===l.ControlType.TEXTFIELD){const ut=N.controlComponent;if(!M(N)){if(!(F>0&&y(O[F-1]))){if(!(N.controlComponent===l.ControlComponent.VALUE&&C(N))){if(ut===l.ControlComponent.PRETEXTFIX||ut===l.ControlComponent.PRETEXTFIX_TEXT||ut===l.ControlComponent.POSTTEXTFIX||ut===l.ControlComponent.POSTTEXTFIX_TEXT||ut===l.ControlComponent.TEXTFIXLABEL||ut===l.ControlComponent.PREFIX||ut===l.ControlComponent.POSTFIX||ut===l.ControlComponent.PRE_TEXT||ut===l.ControlComponent.POST_TEXT||ut===l.ControlComponent.PLACEHOLDER)for(let v=F+1;v<O.length;v++){const K=O[v];if(K.controlId!==ht&&K.originControlId!==ht)break;if(K.controlComponent===l.ControlComponent.VALUE&&!C(K)){U=v;break}if(K.controlComponent===l.ControlComponent.POSTTEXTFIX||K.controlComponent===l.ControlComponent.POSTFIX){for(let w=F-1;w>=0;w--){const Z=O[w];if(Z.controlId!==ht&&Z.originControlId!==ht)break;if(Z.controlComponent===l.ControlComponent.VALUE&&!C(Z)){U=w;break}}break}}else if(ut===l.ControlComponent.VALUE&&F>0){const v=O[F-1];if(v&&(v.controlId===ht||v.originControlId===ht)&&v.controlComponent===l.ControlComponent.VALUE&&C(v)){let K=!1;for(let w=F-2;w>=0;w--){const Z=O[w];if(Z.controlId!==ht&&Z.originControlId!==ht||Z.controlComponent!==l.ControlComponent.VALUE&&!Z.originControlId&&Z.controlId===ht)break;if(!C(Z)){U=w+1,K=!0;break}}if(!K)for(let w=F;w<O.length;w++){const Z=O[w];if(Z.controlId!==ht&&Z.originControlId!==ht||(Z.controlComponent===l.ControlComponent.POSTTEXTFIX||Z.controlComponent===l.ControlComponent.POSTFIX)&&!Z.originControlId&&Z.controlId===ht)break;if(!C(Z)){U=w,K=!0;break}}}}}}}}}if(~u){Q&&(U=Math.min(Math.max(U,D.startIndex),D.endIndex));let tt=U,ht=U;if(o.shiftKey){const{startIndex:ut}=i.getRange();~ut&&r.getPositionContext().tdId===d.tdId&&(F>ut?tt=ut:ht=ut)}if(Q&&(tt=Math.min(Math.max(tt,D.startIndex),D.endIndex),ht=Math.min(Math.max(ht,D.startIndex),D.endIndex),U=Math.min(Math.max(U,D.startIndex),D.endIndex)),i.setRange(tt,ht),r.setCursorPosition(S[U]),n=e.isReadonly(),Y&&!n)as(N,e);else if(X&&!n)cs(N,e);else if(N.controlComponent===l.ControlComponent.VALUE&&(N.control?.type===l.ControlType.CHECKBOX||N.control?.type===l.ControlType.RADIO)){let ut=F;for(;ut>0;){const v=O[ut];if(v.controlComponent===l.ControlComponent.CHECKBOX){as(v,e);break}else if(v.controlComponent===l.ControlComponent.RADIO){cs(v,e);break}ut--}}else{const ut=N?.control?.type===l.ControlType.BUTTON&&!N.control?.buttonText,v=h&&ut;let K=!1;if(b&&N?.controlId&&N?.controlComponent===l.ControlComponent.VALUE&&!N.originControlId)for(let x=F;x>=0;x--){const A=O[x];if(A.controlId!==N.controlId)break;if(A.control?.type===l.ControlType.TEXTFIELD){K=!0;break}}const w=K&&C(N),Z=E&&!w?U+1:void 0;e.render({curIndex:E&&!w?Z:U,isCompute:!1,isSubmitHistory:!1,isSetCursor:!V&&!Y&&!X&&!(v&&b)&&!w});const J=O[U];if(!n&&h&&J?.controlId&&o.button===xn.LEFT){const A=e.getControl().getActiveControl(),$=A?.getElement()?.control?.type;A&&($===l.ControlType.NUMBER||$===l.ControlType.SELECT)&&A.getElement()?.controlId===J.controlId&&J.controlComponent!==l.ControlComponent.POSTFIX&&J.controlComponent!==l.ControlComponent.POSTTEXTFIX&&J.controlComponent!==l.ControlComponent.POSTTEXTFIX_TEXT&&J.controlComponent!==l.ControlComponent.POST_TEXT&&typeof A.awake=="function"&&A.awake()}}P&&t.getDraw().getCursor().drawCursor({hitLineStartIndex:P})}const G=e.getEventBus();if(W&&G.isSubscribe("labelMousedown")&&G.emit("labelMousedown",{evt:o,element:N}),E&&(N.type===l.ElementType.MACRO||N.type===l.ElementType.CUSTOM_MACRO||N.type===l.ElementType.REUSABLE_ITEM)){const tt=e.getMode();tt===l.EditorMode.EDIT&&N.type===l.ElementType.CUSTOM_MACRO?G.isSubscribe("macroClick")&&G.emit("macroClick",{evt:o,element:N}):tt===l.EditorMode.FORM&&G.isSubscribe("macroValueChange")&&G.emit("macroValueChange",{evt:o,element:N})}if(console.log("检查子模板点击 - isDirectHitMacro:",E,"curElement.type:",N?.type,"ElementType.SUB_TEMPLATE:",l.ElementType.SUB_TEMPLATE),E&&N.type===l.ElementType.SUB_TEMPLATE){console.log("子模板被点击 - isDirectHitMacro:",E,"curElement.type:",N.type);const tt=e.getMode();console.log("当前模式:",tt,"是否表单模式:",tt===l.EditorMode.FORM),tt===l.EditorMode.FORM&&(console.log("准备触发 subTemplateClick 事件, eventBus:",G),console.log("是否订阅了 subTemplateClick:",G.isSubscribe("subTemplateClick")),G.isSubscribe("subTemplateClick")&&(G.emit("subTemplateClick",{evt:o,element:N}),console.log("subTemplateClick 事件已触发")))}else E&&N.type!==l.ElementType.SUB_TEMPLATE&&console.log("isDirectHitMacro 为 true,但 curElement.type 不是 subTemplate:",N.type);const _=e.getPreviewer();if(_.clearResizer(),V){const tt={dragDisable:n||!N.controlId&&e.getMode()===l.EditorMode.FORM};N.type===l.ElementType.LATEX&&(tt.mime="svg",tt.srcKey="laTexSVG"),_.drawResizer(N,S[F],tt),e.getCursor().drawCursor({isShow:!1}),ls(t),(N.imgDisplay===l.ImageDisplay.SURROUND||N.imgDisplay===l.ImageDisplay.FLOAT_TOP||N.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)&&e.getImageParticle().createFloatImage(N),G.isSubscribe("imageMousedown")&&G.emit("imageMousedown",{evt:o,element:N})}const j=e.getTableTool();j.dispose(),I&&!n&&e.getMode()!==l.EditorMode.FORM&&j.render();const st=e.getHyperlinkParticle();st.clearHyperlinkPopup(),N.type===l.ElementType.HYPERLINK&&(Te(o)?st.openHyperlink(N):st.drawHyperlinkPopup(N,S[F]));const it=e.getDateParticle();it.clearDatePicker(),N.type===l.ElementType.DATE&&!n&&it.renderDatePicker(N,S[F]);const nt=e.getMenstrualHistoryParticle();nt.clearMenstrualHistoryEditor(),N.type===l.ElementType.MENSTRUAL_HISTORY&&h&&(e.getMode()===l.EditorMode.FORM||e.getMode()===l.EditorMode.EDIT)&&nt.renderMenstrualHistoryEditor(N,S[F]);const et=e.getFetalHeartPositionParticle();et.clearFetalHeartPositionEditor(),N.type===l.ElementType.FETAL_HEART_POSITION&&h&&(e.getMode()===l.EditorMode.FORM||e.getMode()===l.EditorMode.EDIT)&&et.renderFetalHeartPositionEditor(N,S[F]);const dt=e.getToothPositionParticle();dt.clearToothPositionEditor(),N.type===l.ElementType.TOOTH_POSITION&&h&&(e.getMode()===l.EditorMode.FORM||e.getMode()===l.EditorMode.EDIT)&&dt.renderToothPositionEditor(N,S[F])}function An(o){const t=lt();return Reflect.set(o,"dragId",t),t}function kn(o,t){return t.findIndex(e=>e.dragId===o)}function ds(o,t,e){const n=e.getDraw();if(o.imgDisplay===l.ImageDisplay.SURROUND||o.imgDisplay===l.ImageDisplay.FLOAT_TOP||o.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM){const i=t.offsetX-e.mouseDownStartPosition.x,r=t.offsetY-e.mouseDownStartPosition.y,s=o.imgFloatPosition;o.imgFloatPosition={x:s.x+i,y:s.y+r,pageNo:n.getPageNo()}}n.getImageParticle().destroyFloatImage()}function ua(o,t){if(t.isAllowDrop){const e=t.getDraw();if(e.isReadonly()||e.isDisabled()){t.mousedown(o);return}const n=e.getPosition(),i=n.getPositionList(),r=n.getPositionContext(),s=e.getRange(),a=t.cacheRange,c=t.cacheElementList,d=t.cachePositionList,R=t.cachePositionContext,u=s.getRange(),h=a.startIndex===a.endIndex,g=h?a.startIndex-1:a.startIndex,f=a.endIndex;if(u.startIndex>=g&&u.endIndex<=f&&t.cachePositionContext?.tdId===r.tdId){e.clearSideEffect();let it=!1,nt=!1;if(h){const et=c[f];if(et.type===l.ElementType.IMAGE||et.type===l.ElementType.LATEX){if(ds(et,o,t),et.imgDisplay===l.ImageDisplay.SURROUND||et.imgDisplay===l.ImageDisplay.FLOAT_TOP||et.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(et),it=!0;else{const dt=d[f];e.getPreviewer().drawResizer(et,dt)}nt=et.imgDisplay===l.ImageDisplay.SURROUND}}s.replaceRange({...a}),e.render({isCompute:nt,isSubmitHistory:it,isSetCursor:!1});return}const T=c.slice(g+1,f+1),m=T.find(it=>it.controlId);if(m){const it=c[g+1],nt=c[f];if(!((!it.controlId||it.controlComponent===l.ControlComponent.PREFIX)&&(!nt.controlId||nt.controlComponent===l.ControlComponent.POSTFIX)||it.controlId===nt.controlId&&it.controlComponent===l.ControlComponent.PREFIX&&nt.controlComponent===l.ControlComponent.POSTFIX||it.control?.type===l.ControlType.TEXT&&it.controlComponent===l.ControlComponent.VALUE&&nt.control?.type===l.ControlType.TEXT&&nt.controlComponent===l.ControlComponent.VALUE)){e.render({curIndex:u.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const p=e.getControl(),I=e.getElementList(),L=!m||!!I[u.startIndex].controlId||!p.getIsElementListContainFullControl(T),P=e.getOptions(),O=T.map(it=>{if(!it.type||it.type===l.ElementType.TEXT){const nt={value:it.value},et=ue;return L||et.push(...yo),et.forEach(dt=>{const tt=it[dt];tt!==void 0&&(nt[dt]=tt)}),nt}else{let nt=at(it);return L&&(nt=ie(nt,yo)),bt([nt],{isHandleFirstElement:!1,editorOptions:P}),nt}});Ut(I,O,u.startIndex,{editorOptions:e.getOptions()});const S=c[g],F=d[g],N=An(c[g]),V=An(c[f]),Y=O.length;let X=u.startIndex,W=X+Y;const E=p.getActiveControl();if(E&&c[X].controlComponent!==l.ControlComponent.POSTFIX?(W=E.setValue(O),X=W-Y):e.spliceElementList(I,X+1,0,O),!~W){e.render({isSetCursor:!1});return}const C=An(I[X]),M=An(I[W]),y=kn(N,c),b=kn(V,c),D=c[b];if(D.controlId&&D.controlComponent!==l.ControlComponent.POSTFIX)s.replaceRange({...a,startIndex:y,endIndex:b}),p.getActiveControl()?.cut();else{let it=!0;if(R?.isTable){const{tableId:nt,trIndex:et,tdIndex:dt}=R;it=!e.getOriginalElementList().some(ht=>ht.id===nt&&ht?.trList?.[et]?.tdList?.[dt]?.deletable===!1)}it&&e.spliceElementList(c,y+1,b-y)}const U=I[u.startIndex],Q=i[u.startIndex];let G=r.index;G&&(U.tableId&&!S.tableId?F.index<G&&(G-=Y):!U.tableId&&S.tableId&&Q.index<G&&(G+=Y),n.setPositionContext({...r,index:G}));const _=kn(C,I),j=kn(M,I);s.setRange(h?j:_,j,u.tableId,u.startTdIndex,u.endTdIndex,u.startTrIndex,u.endTrIndex),e.clearSideEffect();let st=null;if(h){const nt=e.getElementList()[j];(nt.type===l.ElementType.IMAGE||nt.type===l.ElementType.LATEX)&&(ds(nt,o,t),st=nt)}if(e.render({isSetCursor:!1}),E?p.emitControlContentChange():S.controlId&&p.emitControlContentChange({context:{range:a,elementList:c},controlElement:S}),st)if(st.imgDisplay===l.ImageDisplay.SURROUND||st.imgDisplay===l.ImageDisplay.FLOAT_TOP||st.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(st);else{const nt=n.getPositionList()[j];e.getPreviewer().drawResizer(st,nt)}}else t.isAllowDrag&&t.cacheRange?.startIndex!==t.cacheRange?.endIndex&&t.mousedown(o)}function ha(o,t){const e=t.getDraw();if(!e.getOptions().pageOuterSelectionDisable)return;const n=e.getPageContainer(),{x:i,y:r,width:s,height:a}=n.getBoundingClientRect();o.x>=i&&o.x<=i+s&&o.y>=r&&o.y<=r+a||t.setIsAllowSelection(!1)}function ga(o,t){const e=t.getDraw(),n=e.getControl(),i=e.getPageList(),r=e.getPageNo(),s=i[r],c=e.getPosition().getPositionByXY({x:o.offsetX,y:o.offsetY});if(~c.index){const C=e.getElementList(),M=c.isTable?c.tdValueIndex:c.index,y=C[M];y?.control?.type===l.ControlType.BUTTON&&!y.control?.buttonText?s&&(s.style.cursor="pointer"):s&&(s.style.cursor="text")}else s&&(s.style.cursor="text");if(t.isAllowDrag){const C=o.offsetX,M=o.offsetY,{startIndex:y,endIndex:b}=t.cacheRange,D=t.cachePositionList;for(let Q=y+1;Q<=b;Q++){const{coordinate:{leftTop:G,rightBottom:_}}=D[Q];if(C>=G[0]&&C<=_[0]&&M>=G[1]&&M<=_[1])return}const U=t.cacheRange?.startIndex;if(U){const Q=t.cacheElementList[U];Q?.type===l.ElementType.IMAGE&&(Q.imgDisplay===l.ImageDisplay.SURROUND||Q.imgDisplay===l.ImageDisplay.FLOAT_TOP||Q.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)&&(e.getPreviewer().clearResizer(),e.getImageParticle().dragFloatImage(o.movementX,o.movementY))}t.dragover(o),t.isAllowDrop=!0;return}if(!t.isAllowSelection||!t.mouseDownStartPosition)return;const R=o.target.dataset.index;R&&e.setPageNo(Number(R));const u=e.getPosition(),h=u.getPositionByXY({x:o.offsetX,y:o.offsetY});if(!~h.index)return;const{index:g,isTable:f,tdValueIndex:T,tdIndex:m,trIndex:p,tableId:I,trId:L,tdId:P}=h,{index:O,isTable:S,tdIndex:F,tdId:N,trIndex:V,tableId:Y}=t.mouseDownStartPosition,X=f?T:g,W=e.getRange();let E;if(P!==N&&P&&N){const C=e.getTdByPosition({...t.mouseDownStartPosition,isTable:!!t.mouseDownStartPosition.tableId,index:t.mouseDownStartPosition.originalIndex??t.mouseDownStartPosition.index}),M=e.getTdByPosition({...h,isTable:!!h.tableId,index:h.index});if(e.isSplitTd(C,M)){const y=(C.valueStartIndex??0)+O,b=(M.valueStartIndex??0)+T;E=[{index:y,element:C.value[O],originalId:C.originalId,isCurrent:!1,length:C.value.length,startIndex:C.valueStartIndex??0},{index:b,element:M.value[T],originalId:M.originalId,isCurrent:!0,length:M.value.length,startIndex:M.valueStartIndex??0}]}}if(f&&S&&P!==N&&!E)W.setRange(X,X,I,F,m,V,p),u.setPositionContext({isTable:!!f,index:g,trIndex:p,tdIndex:m,tdId:P,trId:L,tableId:I});else{let C=~X?X:0;if((S||f)&&Y!==I&&!E)return;u.setPositionContext({isTable:!!f,index:g,trIndex:p,tdIndex:m,tdId:P,trId:L,tableId:I});let M=O,y,b;if(E)[{element:y},{element:b}]=E;else{const Q=e.getElementList();y=Q[M+1],b=Q[C]}if(M===C||y?.controlComponent===l.ControlComponent.PLACEHOLDER&&b?.controlComponent===l.ControlComponent.PLACEHOLDER&&y.controlId===b.controlId)return;if(M>C&&([M,C]=[C,M]),e.getMode()===l.EditorMode.FORM){const Q=n.getActiveTextControlLimit();Q&&(M=Math.min(Math.max(M,Q.startIndex),Q.endIndex),C=Math.min(Math.max(C,Q.startIndex),Q.endIndex));const G=e.getElementList(),_=G[M],j=G[C];if(_?.control?.type===l.ControlType.TEXTFIELD||j?.control?.type===l.ControlType.TEXTFIELD){const st=_?.controlId||j?.controlId;if(st){let it=-1,nt=-1;for(let et=M;et>=0;et--){const dt=G[et];if(dt.controlId!==st)break;if(dt.controlComponent===l.ControlComponent.PRETEXTFIX||dt.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||dt.controlComponent===l.ControlComponent.TEXTFIXLABEL||dt.controlComponent===l.ControlComponent.PREFIX||dt.controlComponent===l.ControlComponent.PRE_TEXT){it=et+1;break}}for(let et=C;et<G.length;et++){const dt=G[et];if(dt.controlId!==st)break;if(dt.controlComponent===l.ControlComponent.POSTTEXTFIX||dt.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||dt.controlComponent===l.ControlComponent.POSTFIX||dt.controlComponent===l.ControlComponent.POST_TEXT){nt=et-1;break}}it!==-1&&M<it&&(M=it),nt!==-1&&C>nt&&(C=nt)}}}let U;if(E){const[Q,G]=E.sort((_,j)=>_.index-j.index);U={originalId:E[0].originalId??E[1].originalId,startIndex:Q.index,endIndex:G.index},Q.isCurrent?(M=Q.index,C=Q.length-1):(M=0,C=U.endIndex-G.startIndex)}W.setRange(M,C,void 0,void 0,void 0,void 0,void 0,U)}e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}function fa(o){const t=o.getDraw(),e=t.getRange(),n=e.getRange(),i=t.getElementList(),r=i[n.startIndex];if(we(r))return;let s=n.startIndex;for(;s>0;){const a=i[s];let c=null;a.controlId?(c=t.getControl().removeControl(s),c!==null&&(s=c)):(t.spliceElementList(i,s,1),c=s-1,s--);const d=i[c];if(!d||we(d)){if(c){n.startIndex=c,n.endIndex=c,e.replaceRange(n);const R=t.getPosition(),u=R.getPositionList();R.setCursorPosition(u[c])}break}}}function Ta(o,t,e){if(e.originControlId){const n=e.originControlId;for(let i=t;i<o.length;i++){const r=o[i];if(r.controlId===n)return r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX||r.controlComponent===l.ControlComponent.POST_TEXT?{isInParent:!1}:{isInParent:!0,parentControlId:n};if(r.controlId&&r.controlId!==n&&r.originControlId!==n)break}}if(!e.originControlId&&e.controlId){const n=o[t];if(n?.controlId&&n.controlId!==e.controlId&&(n.controlComponent===l.ControlComponent.PREFIX||n.controlComponent===l.ControlComponent.PRETEXTFIX))for(let i=t-1;i>=0;i--){const r=o[i];if(r.controlId===e.controlId&&(r.controlComponent===l.ControlComponent.PREFIX||r.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let s=i-1;s>=0;s--){const a=o[s];if(a.controlId&&a.controlId!==e.controlId&&(a.controlComponent===l.ControlComponent.PRETEXTFIX||a.controlComponent===l.ControlComponent.PREFIX))return{isInParent:!0,parentControlId:a.controlId};if(a.controlId&&a.controlId!==e.controlId&&(a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POSTTEXTFIX))return{isInParent:!1}}break}}if(n?.controlId&&n.controlId!==e.controlId&&!n.originControlId&&(n.controlComponent===l.ControlComponent.POSTFIX||n.controlComponent===l.ControlComponent.POSTTEXTFIX))return e.originControlId===n.controlId?{isInParent:!0,parentControlId:n.controlId}:{isInParent:!1}}return{isInParent:!1}}function ma(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;n.getIsCollapsed()&&fa(t);const i=e.getControl(),{startIndex:r,endIndex:s,isCrossRowCol:a}=n.getRange();let c;const d=e.getElementList();if(n.getIsCollapsed()&&r>0){const u=d[r-1],h=d[r],f=e.getPosition().getPositionList(),T=f[r],m=f[r-1],p=T&&m&&T.rowIndex===m.rowIndex,I=u?.controlComponent===l.ControlComponent.PREFIX||u?.controlComponent===l.ControlComponent.PRETEXTFIX||u?.controlComponent===l.ControlComponent.PRE_TEXT||u?.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT,L=u?.controlComponent===l.ControlComponent.POSTFIX||u?.controlComponent===l.ControlComponent.POSTTEXTFIX||u?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||u?.controlComponent===l.ControlComponent.POST_TEXT,P=!!u?.controlId,O=h?.controlComponent===l.ControlComponent.PLACEHOLDER,S=h?.controlComponent===l.ControlComponent.POSTFIX||h?.controlComponent===l.ControlComponent.POSTTEXTFIX||h?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||h?.controlComponent===l.ControlComponent.POST_TEXT,F=!!h&&!h.controlId&&!h.control;if(O&&I&&P&&p)return;const{isInParent:N,parentControlId:V}=Ta(d,r,u);if(L&&P&&p&&N){if(u.originControlId&&V)for(let Y=r;Y<d.length;Y++){const X=d[Y];if(X.controlId===V&&!X.originControlId){if(X.controlComponent===l.ControlComponent.VALUE){n.setRange(Y,Y),e.render({curIndex:Y,isSubmitHistory:!1});return}if(X.controlComponent===l.ControlComponent.POSTFIX||X.controlComponent===l.ControlComponent.POSTTEXTFIX||X.controlComponent===l.ControlComponent.POST_TEXT)return}X.controlId!==V&&X.originControlId}return}if(L&&P&&p&&!N&&!(F&&!O&&!S)){const Y=r-1;c=i.removeControl(Y),e.getGlobalEvent().setCanvasEventAbility(),c===null?(n.setRange(Y,Y),e.render({curIndex:Y,isSubmitHistory:!1})):(n.setRange(c,c),e.render({curIndex:c}));return}if(S&&h?.controlId&&p){const Y=r;c=i.removeControl(Y),e.getGlobalEvent().setCanvasEventAbility(),c===null?(n.setRange(Y,Y),e.render({curIndex:Y,isSubmitHistory:!1})):(n.setRange(c,c),e.render({curIndex:c}));return}}if(a){const u=e.getTableParticle().getRangeRowCol();if(!u)return;let h=!1;for(let g=0;g<u.length;g++){const f=u[g];for(let T=0;T<f.length;T++){const m=f[T];m.value.length>1&&(e.spliceElementList(m.value,1,m.value.length-1),h=!0)}}c=h?0:null}else if(i.getActiveControl()&&i.getIsRangeCanCaptureEvent())c=i.keydown(o),c&&i.emitControlContentChange();else{const u=e.getPosition().getCursorPosition();if(!u)return;const{index:h}=u,g=n.getIsCollapsed(),f=e.getElementList();if(g&&h===0){const I=f[h];if(I.value===H){I.listId&&e.getListParticle().unsetList(),o.preventDefault();return}}const T=f[r];if(g&&T.rowFlex&&T.value===H){const I=n.getRangeRowElementList();if(I){const L=f[r-1];I.forEach(P=>{P.rowFlex=L?.rowFlex})}}const m=T.value===H?f[r-1]:T,p=f[s+1];if(m?.titleId&&p?.titleId&&m.level===p.level&&m.titleId!==p.titleId){const I=m.titleId,L=p.titleId;let P=s+1;for(;P<f.length&&f[P]?.titleId===L;)f[P].titleId=I,P++}g?e.spliceElementList(f,h,1):e.spliceElementList(f,r+1,s-r),c=g?h-1:r}e.getGlobalEvent().setCanvasEventAbility(),c===null?(n.setRange(r,r),e.render({curIndex:r,isSubmitHistory:!1})):(n.setRange(c,c),e.render({curIndex:c}))}function pa(o){const t=o.getDraw(),n=t.getRange().getRange(),i=t.getElementList(),r=i[n.startIndex+1];if(we(r))return;const s=n.startIndex+1;for(;s<i.length;){const a=i[s];let c=null;a.controlId?c=t.getControl().removeControl(s):(t.spliceElementList(i,s,1),c=s);const d=i[c];if(!d||we(d))break}}function La(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:r,isCrossRowCol:s,splitTdRange:a}=n.getRange(),c=e.getElementList(),d=e.getControl();n.getIsCollapsed()&&pa(t);let R;if(s){const u=e.getTableParticle().getRangeRowCol();if(!u)return;let h=!1;for(let g=0;g<u.length;g++){const f=u[g];for(let T=0;T<f.length;T++){const m=f[T];m.value.length>1&&(e.spliceElementList(m.value,1,m.value.length-1),h=!0)}}R=h?0:null}else if(d.getActiveControl()&&d.getIsRangeWithinControl())R=d.keydown(o),R&&d.emitControlContentChange();else if(c[r+1]?.controlId)R=d.removeControl(r+1);else{e.removeSplitTdOtherRangeElements();const u=e.getPosition(),h=u.getCursorPosition();if(!h)return;const{index:g}=h,f=u.getPositionContext();if(f.isDirectHit&&f.isImage)e.spliceElementList(c,g,1),R=g-1;else{const T=n.getIsCollapsed();if(!T)e.spliceElementList(c,i+1,r-i);else if(c[g+1])e.spliceElementList(c,g+1,1);else{let m=!0;if(f.isTable){const p=e.getTd();if(p?.linkTdNextId){const I=e.getTdById(p.linkTdNextId);I&&(m=!1,e.spliceElementList(I.value,1,1))}}if(m)return}R=T?g:i,R===0&&a&&(R=e.fixPosition(!0)??R)}}e.getGlobalEvent().setCanvasEventAbility(),R===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(R,R),e.render({curIndex:R}))}function Ia(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:r}=n.getRange(),s=n.getIsCollapsed(),a=e.getElementList(),c=a[i],d=a[r];if(s&&d.listId&&d.value===H&&a[r+1]?.listId!==d.listId){e.getListParticle().unsetList();return}let R={value:H};if(o.shiftKey&&c.listId&&(R.listWrap=!0),Ut(a,[R],i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()}),o.shiftKey&&d.areaId&&d.areaId!==a[r+1]?.areaId&&(R=ie(R,xe)),!(a[i+1]?.titleId&&(!c.titleId||c.titleId!==a[i+1]?.titleId))&&!(d.titleId&&d.titleId!==a[r+1]?.titleId)){const m=n.getRangeAnchorStyle(a,r);if(m){const p=[...Bt],I=m.controlComponent===l.ControlComponent.POSTFIX||m.controlComponent===l.ControlComponent.POSTTEXTFIX||m.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||m.controlComponent===l.ControlComponent.POST_TEXT,L=m.control?.type===l.ControlType.BUTTON&&!m.control?.buttonText;!I&&!L&&p.push(...ue),p.forEach(P=>{const O=m[P];O!==void 0&&(R[P]=O)})}}const u=e.getControl(),h=u.getActiveControl();let g;const f=h?.getElement();if(f?.control?.type===l.ControlType.BUTTON&&!f.control?.buttonText&&f?.controlId){const m=f.controlId;let p=r;for(;p+1<a.length&&a[p+1]?.controlId===m;)p++;e.spliceElementList(a,p+1,0,[R]),g=p+1}else if(h&&u.getIsRangeWithinControl())g=u.setValue([R]),u.emitControlContentChange();else{const p=e.getPosition().getCursorPosition();if(!p)return;const{index:I}=p;if(s){if(e.spliceElementList(a,I+1,0,[R]),d.titleId&&a[I+2]?.titleId===d.titleId){const L=lt();let P=I+2;for(;P<a.length&&a[P]?.titleId===d.titleId;)a[P].titleId=L,P++}}else e.spliceElementList(a,i+1,r-i,[R]);g=I+1}~g&&(n.setRange(g,g),e.render({curIndex:g})),o.preventDefault()}function Rs(o){return o&&(o.type===l.ElementType.MACRO||o.type===l.ElementType.CUSTOM_MACRO||o.type===l.ElementType.REUSABLE_ITEM||o.type===l.ElementType.SUB_TEMPLATE||o.type===l.ElementType.MENSTRUAL_HISTORY||o.type===l.ElementType.FETAL_HEART_POSITION||o.type===l.ElementType.TOOTH_POSITION||o.type===l.ElementType.LIST||o.type===l.ElementType.SPECIAL_SYMBOLS)}function Pa(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),r=i.getCursorPosition();if(!r)return;const s=i.getPositionContext(),{index:a}=r;if(a<=0&&!s.isTable)return;const c=e.getRange(),{startIndex:d,endIndex:R}=c.getRange(),u=c.getIsCollapsed(),h=e.getElementList(),g=e.getControl(),f=e.getMode()===l.EditorMode.FORM,T=f?g.getActiveTextControlLimit():null,m=h[a],p=m?.controlComponent===l.ControlComponent.PREFIX||m?.controlComponent===l.ControlComponent.PRETEXTFIX||m?.controlComponent===l.ControlComponent.PRE_TEXT;let I=!1;if(p&&m?.originControlId){const V=m.originControlId;for(let Y=a-1;Y>=0;Y--){const X=h[Y];if(X.controlId===V&&!X.originControlId){I=!0;break}if(X.controlId&&X.controlId!==V&&X.originControlId!==V)break}}if(f&&g.getActiveControl()&&p&&!T&&!I){g.initNextControl({direction:Zt.UP});return}let L=1;if(Te(o)){const V=e.getLetterReg(),Y=o.shiftKey&&!u&&d===r?.index?R:d;if(V.test(h[Y]?.value)){let X=Y-1;for(;X>0;){const W=h[X];if(!V.test(W.value))break;L++,X--}}}if(f){const V=h[d],Y=V?.controlId;if(Y&&V?.controlComponent===l.ControlComponent.VALUE){let X=!1;for(let W=d;W>=0;W--){const E=h[W];if(E.controlId!==Y)break;if(E.control?.type===l.ControlType.TEXTFIELD){X=!0;break}}if(X){if(V.controlComponent===l.ControlComponent.VALUE&&Rs(V))return;const W=d-L;if(W>=0){const E=h[W];if(E&&E.controlId===Y&&E.controlComponent===l.ControlComponent.VALUE&&Rs(E))return}}}}const P=T?Math.max(d-L,T.startIndex):d-L;let O=P,S=P;if(o.shiftKey&&r&&(d!==R?d===r.index?(O=d,S=R-L):(O=P,S=R):S=R),!o.shiftKey){const V=h[d];if(V.type===l.ElementType.TABLE){const Y=V.trList,X=Y.length-1,W=Y[X],E=W.tdList.length-1,C=W.tdList[E];i.setPositionContext({isTable:!0,index:d,trIndex:X,tdIndex:E,tdId:C.id,trId:W.id,tableId:V.id}),O=C.value.length-1,S=O}else if(V.tableId&&d===0){const X=e.getOriginalElementList()[s.index],W=e.getTd();if(W?.linkTdPrevId){const E=e.getTdById(W.linkTdPrevId);E&&(i.setPositionContext({...s,isTable:!0,index:E.tableIndex,trIndex:E.trIndex,tdId:E.id,trId:E.trId,tableId:E.tableId}),O=E.value.length-1,S=O)}else{const E=X.trList;t:for(let C=0;C<E.length;C++){const M=E[C];if(M.id!==V.trId)continue;const y=M.tdList;for(let b=0;b<y.length;b++)if(y[b].id===V.tdId){if(C===0&&b===0)i.setPositionContext({isTable:!1}),O=s.index-1,S=O,e.getTableTool().dispose();else{let U=C,Q=b-1;Q<0&&(U=C-1,Q=E[U].tdList.length-1);const G=E[U],_=G.tdList[Q];i.setPositionContext({isTable:!0,index:s.index,trIndex:U,tdIndex:Q,tdId:_.id,trId:G.id,tableId:V.tableId}),O=_.value.length-1,S=O}break t}}}}}if(!~O||!~S)return;const F=e.getElementList();O=Mn(F,O),S=Mn(F,S),c.setRange(O,S);const N=O===S;e.updateTableTool(),e.render({curIndex:N?O:void 0,isSetCursor:N,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function us(o){return o&&(o.type===l.ElementType.MACRO||o.type===l.ElementType.CUSTOM_MACRO||o.type===l.ElementType.REUSABLE_ITEM||o.type===l.ElementType.SUB_TEMPLATE||o.type===l.ElementType.MENSTRUAL_HISTORY||o.type===l.ElementType.FETAL_HEART_POSITION||o.type===l.ElementType.TOOTH_POSITION||o.type===l.ElementType.LIST||o.type===l.ElementType.SPECIAL_SYMBOLS)}function Ma(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),r=i.getCursorPosition();if(!r)return;const{index:s}=r,a=i.getPositionList(),c=i.getPositionContext();if(s>a.length-1&&!c.isTable)return;const d=e.getRange(),{startIndex:R,endIndex:u}=d.getRange(),h=d.getIsCollapsed();let g=e.getElementList();const f=e.getControl(),T=e.getMode()===l.EditorMode.FORM,m=T?f.getActiveTextControlLimit():null,p=g[s],I=p?.controlComponent===l.ControlComponent.POSTFIX||p?.controlComponent===l.ControlComponent.POSTTEXTFIX||p?.controlComponent===l.ControlComponent.POST_TEXT;let L=!1;if(I&&p?.originControlId){const X=p.originControlId;for(let W=s+1;W<g.length;W++){const E=g[W];if(E.controlId===X&&!E.originControlId){L=!0;break}if(E.controlId&&E.controlId!==X&&E.originControlId!==X)break}}if(T&&f.getActiveControl()&&I&&!m&&!L){f.initNextControl({direction:Zt.DOWN});return}let P=1;if(Te(o)){const X=e.getLetterReg(),W=o.shiftKey&&!h&&R===r?.index?u:R;if(X.test(g[W+1]?.value)){let E=W+2;for(;E<g.length;){const C=g[E];if(!X.test(C.value))break;P++,E++}}}if(T){const X=g[u],W=X?.controlId;if(W&&X?.controlComponent===l.ControlComponent.VALUE){let E=!1;for(let C=u;C>=0;C--){const M=g[C];if(M.controlId!==W)break;if(M.control?.type===l.ControlType.TEXTFIELD){E=!0;break}}if(E){if(X.controlComponent===l.ControlComponent.VALUE&&us(X))return;const C=u+P;if(C<g.length){const M=g[C];if(M&&M.controlId===W&&M.controlComponent===l.ControlComponent.VALUE&&us(M))return}}}}const O=m?Math.min(u+P,m.endIndex):u+P;let S=O,F=O;if(o.shiftKey&&r&&(R!==u?R===r.index?(S=R,F=O):(S=R+P,F=u):S=R),!o.shiftKey){const X=g[u],W=g[u+1];if(W?.type===l.ElementType.TABLE){const C=W.trList[0],M=C.tdList[0];i.setPositionContext({isTable:!0,index:u+1,trIndex:0,tdIndex:0,tdId:M.id,trId:C.id,tableId:W.id}),S=0,F=0}else if(X.tableId&&!W){const E=e.getTd(),C=E?.linkTdNextId?e.getTdById(E.linkTdNextId):void 0;if(C?.value.length)i.setPositionContext({...c,isTable:!0,index:C.tableIndex,trIndex:C.trIndex,tdId:C.id,trId:C.trId,tableId:C.tableId}),S=0,F=S;else{const y=e.getOriginalElementList()[c.index].trList;t:for(let b=0;b<y.length;b++){const D=y[b];if(D.id!==X.trId)continue;const U=D.tdList;for(let Q=0;Q<U.length;Q++)if(U[Q].id===X.tdId){if(b===y.length-1&&Q===U.length-1)i.setPositionContext({isTable:!1}),S=c.index,F=S,g=e.getElementList(),e.getTableTool().dispose();else{let _=b,j=Q+1;j>U.length-1&&(_=b+1,j=0);const st=y[_],it=st.tdList[j];i.setPositionContext({isTable:!0,index:c.index,trIndex:_,tdIndex:j,tdId:it.id,trId:st.id,tableId:X.tableId}),S=0,F=S}break t}}}}}const N=g.length-1;if(S>N||F>N)return;const V=e.getElementList();S=Mn(V,S,l.LocationPosition.AFTER),F=Mn(V,F,l.LocationPosition.AFTER),d.setRange(S,F);const Y=S===F;e.updateTableTool(),e.render({curIndex:Y?S:void 0,isSetCursor:Y,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function Oa(o,t){const e=t.getDraw();if(e.isReadonly())return;o.preventDefault();const i=e.getControl();if(i.getActiveControl()&&i.getIsRangeWithinControl())i.initNextControl({direction:o.shiftKey?Zt.UP:Zt.DOWN});else{const s=e.getRange(),a=e.getElementList(),{startIndex:c,endIndex:d}=s.getRange(),R=s.getRangeAnchorStyle(a,d),h={...R?Dt(R,ue):null,type:l.ElementType.TAB,value:""};Ut(a,[h],c,{editorOptions:e.getOptions()}),e.insertElementList([h])}}function xo(o){const{positionList:t,index:e,isUp:n,rowNo:i,cursorX:r}=o;let s=-1;const a=[];if(n){let c=e-1;for(;c>=0;){const d=t[c];if(c--,d.rowNo!==i){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.unshift(d)}}}else{let c=e+1;for(;c<t.length;){const d=t[c];if(c++,d.rowNo!==i){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.push(d)}}}for(let c=0;c<a.length;c++){const d=a[c],{coordinate:{leftTop:[R],rightTop:[u]}}=d;if(c===a.length-1&&(s=d.index),!(r<R||r>u)){s=d.index;break}}return s}function Ca(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),r=i.getCursorPosition();if(!r)return;const s=e.getRange(),{startIndex:a,endIndex:c}=s.getRange();let d=i.getPositionList();const R=o.key===l.KeyMap.Up;let u=-1,h=-1;const g=i.getPositionContext();if(!o.shiftKey&&g.isTable&&(R&&r.rowIndex===0||!R&&r.rowIndex===e.getRowCount()-1)){const{index:T,trIndex:m,tdIndex:p,tableId:I}=g;if(R){const L=e.getOriginalElementList();if(m===0)if(L[T].originalId){const O=T-1,S=L[O];for(let F=S.trList.length-1;F>=0;F--){const N=S.trList[F].tdList.find(V=>V.tdIndex===p);if(N?.value.length){i.setPositionContext({isTable:!0,tableId:S.id,index:O,trIndex:F,tdIndex:p}),u=N.value.length-1,h=N.value.length-1;break}}}else i.setPositionContext({isTable:!1}),u=T-1,h=u,e.getTableTool().dispose();else{let P=-1,O=-1;const S=L[T].trList,F=S[m].tdList[p].colIndex;t:for(let Y=m-1;Y>=0;Y--){const W=S[Y].tdList;for(let E=0;E<W.length;E++){const C=W[E];if(C.colIndex===F||C.colIndex+C.colspan-1>=F&&C.colIndex<=F){P=Y,O=E;break t}}}if(!~P||!~O)return;const N=S[P],V=N.tdList[O];i.setPositionContext({isTable:!0,index:T,trIndex:P,tdIndex:O,tdId:V.id,trId:N.id,tableId:I}),u=V.value.length-1,h=u}}else{const L=e.getOriginalElementList(),P=L[T],O=P.trList;if(m===O.length-1){const S=T+1,F=L[S];if(F&&[P.id,P.originalId].includes(F.originalId)){for(let V=p;V>=0;V--)if(F.trList[0].tdList[V].value.length){i.setPositionContext({isTable:!0,index:S,tableId:F.id,trIndex:0,tdIndex:V}),u=0,h=0;break}}else i.setPositionContext({isTable:!1}),u=T,h=u,e.getTableTool().dispose()}else{let S=-1,F=-1;const N=O[m].tdList[p].colIndex;t:for(let X=m+1;X<O.length;X++){const E=O[X].tdList;for(let C=0;C<E.length;C++){const M=E[C];if(M.colIndex===N||M.colIndex+M.colspan-1>=N&&M.colIndex<=N){S=X,F=C;break t}}}if(!~S||!~F)return;const V=O[S],Y=V.tdList[F];i.setPositionContext({isTable:!0,index:T,trIndex:S,tdIndex:F,tdId:Y.id,trId:V.id,tableId:I}),u=Y.value.length-1,h=u}}}else{let T=r;o.shiftKey&&(a===r.index?T=d[c]:T=d[a]);const{index:m,rowNo:p,rowIndex:I,coordinate:{rightTop:[L]}}=T;if(R&&I===0||!R&&I===e.getRowCount()-1)return;const P=xo({positionList:d,index:m,rowNo:p,isUp:R,cursorX:L});if(P<0)return;u=P,h=P,o.shiftKey&&(a!==c?a===r.index?u=a:h=c:R?h=c:u=a);const S=e.getElementList()[P];if(S.type===l.ElementType.TABLE){const{scale:F}=e.getOptions(),N=e.getMargins(),V=S.trList;let Y=-1,X=-1,W=-1;if(R)t:for(let E=V.length-1;E>=0;E--){const M=V[E].tdList;for(let y=0;y<M.length;y++){const b=M[y],D=b.x*F+N[3],U=b.width*F;if(L>=D&&L<=D+U){const Q=b.positionList,G=Q[Q.length-1],_=xo({positionList:Q,index:G.index+1,rowNo:G.rowNo-1,isUp:R,cursorX:L})||G.index;Y=E,X=y,W=_;break t}}}else t:for(let E=0;E<V.length;E++){const M=V[E].tdList;for(let y=0;y<M.length;y++){const b=M[y],D=b.x*F+N[3],U=b.width*F;if(L>=D&&L<=D+U){const Q=b.positionList,G=xo({positionList:Q,index:-1,rowNo:-1,isUp:R,cursorX:L})||0;Y=E,X=y,W=G;break t}}}if(~Y&&~X&&~W){const E=V[Y],C=E.tdList[X];i.setPositionContext({isTable:!0,index:P,trIndex:Y,tdIndex:X,tdId:C.id,trId:E.id,tableId:S.id}),u=W,h=u,d=i.getPositionList()}}}if(!~u||!~h)return;u>h&&([u,h]=[h,u]),s.setRange(u,h);const f=u===h;e.render({curIndex:f?u:void 0,isSetCursor:f,isSubmitHistory:!1,isCompute:!1}),f||(e.getCursor().moveCursorToVisible({cursorPosition:d[R?u:h],direction:R?Zt.UP:Zt.DOWN}),e.updateTableTool())}function Sa(o,t){if(t.isComposing)return;const e=t.getDraw();if(o.key===l.KeyMap.Backspace)ma(o,t);else if(o.key===l.KeyMap.Delete)La(o,t);else if(o.key===l.KeyMap.Enter)Ia(o,t);else if(o.key===l.KeyMap.Left)Pa(o,t);else if(o.key===l.KeyMap.Right)Ma(o,t);else if(o.key===l.KeyMap.Up||o.key===l.KeyMap.Down)Ca(o,t);else if(Te(o)&&o.key.toLocaleLowerCase()===l.KeyMap.Z){if(e.isReadonly()&&e.getMode()!==l.EditorMode.FORM)return;e.getHistoryManager().undo(),o.preventDefault()}else if(Te(o)&&o.key.toLocaleLowerCase()===l.KeyMap.Y){if(e.isReadonly()&&e.getMode()!==l.EditorMode.FORM)return;e.getHistoryManager().redo(),o.preventDefault()}else if(Te(o)&&o.key.toLocaleLowerCase()===l.KeyMap.C)t.copy(),o.preventDefault();else if(Te(o)&&o.key.toLocaleLowerCase()===l.KeyMap.X)t.cut(),o.preventDefault();else if(Te(o)&&o.key.toLocaleLowerCase()===l.KeyMap.A)t.selectAll(),o.preventDefault();else if(Te(o)&&o.key.toLocaleLowerCase()===l.KeyMap.S){if(e.isReadonly())return;const n=e.getListener();n.saved&&n.saved(e.getValue());const i=e.getEventBus();i.isSubscribe("saved")&&i.emit("saved",e.getValue()),o.preventDefault()}else if(o.key===l.KeyMap.ESC){t.clearPainterStyle();const n=e.getZone();n.isMainActive()||n.setZone(l.EditorZone.MAIN),o.preventDefault()}else o.key===l.KeyMap.TAB&&Oa(o,t)}function Ea(o){return/[\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef]/.test(o)}function Xa(o){return/[a-zA-Z]/.test(o)}function Na(o,t){return Ea(o)?t:Xa(o)?"Times New Roman":t}function Fa(o){return o?.type===l.ElementType.CONTROL&&(o.controlComponent===l.ControlComponent.PREFIX||o.controlComponent===l.ControlComponent.PRE_TEXT||o.controlComponent===l.ControlComponent.PRETEXTFIX||o.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)}function ya(o){return o?.type===l.ElementType.CONTROL&&(o.controlComponent===l.ControlComponent.POSTFIX||o.controlComponent===l.ControlComponent.POST_TEXT||o.controlComponent===l.ControlComponent.POSTTEXTFIX||o.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)}function Go(o,t,e="input"){const n=Vt(),i=t.getDraw(),r=i.getControl(),s=i.getOptions(),a=i.getElementList(),R=i.getPosition().getCursorPosition()?.index;if(i.isReadonly()||i.isDisabled())return;const h=i.getPosition().getCursorPosition();if(!o||!h)return;const g=t.isComposing;if(g&&t.compositionInfo?.value===o)return;const f=i.getRange();if(!f.getIsCanInput())return;const{endIndex:T}=f.getRange(),m=i.getElementList(),p=m[T],I=m[T+1];if(p?.type===l.ElementType.SUB_TEMPLATE&&I?.type===l.ElementType.SUB_TEMPLATE)return;if(i.getMode()===l.EditorMode.FORM){const v=r.getActiveTextControlLimit();if(!r.getActiveControl()||!r.getIsRangeWithinControl()&&!r.getIsRangeInPostfix())return;if(v){const x=f.getRange();if(x.startIndex<v.startIndex||x.endIndex>v.endIndex){const A=Math.min(Math.max(x.endIndex,v.startIndex),v.endIndex);f.setRange(A,A),i.render({curIndex:A,isSubmitHistory:!1});return}}const{endIndex:w}=f.getRange(),Z=i.getElementList(),J=Z[w];if(!J?.originControlId){if(J?.controlId&&J?.controlComponent===l.ControlComponent.VALUE)for(let x=w;x>=0;x--){const A=Z[x];if(A.controlId!==J.controlId||A.originControlId)break;if(A.control?.type===l.ControlType.TEXTFIELD)return}}}const P=f.getDefaultStyle()||t.compositionInfo?.defaultStyle||null,O=t.compositionInfo?.perfStartTime,S=Wa(t,i.getElementList());g||i.getCursor().clearAgentDomValue();const{TEXT:F,HYPERLINK:N,SUBSCRIPT:V,SUPERSCRIPT:Y,DATE:X,TAB:W}=l.ElementType,E=o.replaceAll(`
101
+ `,H),{startIndex:C,endIndex:M}=f.getRange(),y=f.getRangeAnchorStyle(S,C);if(!y)return;const b=C>0?S[C-1]:null,D=!!(y.controlId||y.control),Q={...!D&&b?b:y,...P},G=i.isDesignMode(),_=S[M+1],j=Fa(_)&&!_?.originControlId,st=ya(y)&&!y.originControlId||y.type===l.ElementType.CONTROL&&y.controlComponent===l.ControlComponent.VALUE&&_?.type!==l.ElementType.CONTROL&&!y.originControlId,it=j||st,nt=it?{...y,type:void 0,control:void 0,controlId:void 0,controlComponent:void 0,originControlId:void 0,color:s.defaultColor,highlight:void 0}:y,et=it||D?nt:Q,dt=ct(E).map(v=>{const K={value:v};if(G||!et.title?.disabled&&!et.control?.disabled){const w=S[M+1];(!et.type||et.type===F||et.type===N&&w?.type===N||et.type===X&&w?.type===X||et.type===V&&w?.type===V||et.type===Y&&w?.type===Y)&&rl.forEach(Z=>{if(Z==="groupIds"&&!w?.groupIds)return;const J=et[Z];J!==void 0&&(K[Z]=J)}),(P||et.type===W)&&ue.forEach(Z=>{const J=P?.[Z]||et[Z];J!==void 0&&(K[Z]=J)}),g&&(K.underline=!0)}if(!it){const w=y.originControlId&&(y.controlComponent===l.ControlComponent.POSTFIX||y.controlComponent===l.ControlComponent.POSTTEXTFIX||y.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||y.controlComponent===l.ControlComponent.POST_TEXT),Z=!y.originControlId&&y.controlId&&(y.controlComponent===l.ControlComponent.POSTFIX||y.controlComponent===l.ControlComponent.POSTTEXTFIX||y.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||y.controlComponent===l.ControlComponent.POST_TEXT)&&_?.controlId&&_.controlId!==y.controlId,J=y.controlId&&y.originControlId&&(y.controlComponent===l.ControlComponent.VALUE||y.controlComponent===l.ControlComponent.PLACEHOLDER);if(w&&!K.controlId){const x=y.originControlId;let A=null;for(let $=C;$>=0;$--){const B=S[$];if(B.controlId===x&&!B.originControlId&&B.control){A=B.control;break}}K.controlId=x,K.controlComponent=l.ControlComponent.VALUE,A&&(K.control=A)}else if(Z&&!K.controlId){if(_?.controlId&&_.controlId!==y.controlId)if(_.controlComponent===l.ControlComponent.PREFIX||_.controlComponent===l.ControlComponent.PRETEXTFIX)for(let x=C;x>=0;x--){const A=S[x];if(A.controlId===y.controlId&&(A.controlComponent===l.ControlComponent.PREFIX||A.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let $=x-1;$>=0;$--){const B=S[$];if(B.controlId&&B.controlId!==y.controlId&&(B.controlComponent===l.ControlComponent.PRETEXTFIX||B.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||B.controlComponent===l.ControlComponent.PREFIX||B.controlComponent===l.ControlComponent.PRE_TEXT)){K.controlId=B.controlId,K.controlComponent=l.ControlComponent.VALUE,B.control&&(K.control=B.control);break}if(B.controlId&&B.controlId!==y.controlId&&(B.controlComponent===l.ControlComponent.POSTFIX||B.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}else(_.controlComponent===l.ControlComponent.POSTFIX||_.controlComponent===l.ControlComponent.POSTTEXTFIX)&&(K.controlId=_.controlId,K.controlComponent=l.ControlComponent.VALUE,_.control&&(K.control=_.control));if(!K.controlId)for(let x=C;x>=0;x--){const A=S[x];if(A.controlId===y.controlId&&(A.controlComponent===l.ControlComponent.PREFIX||A.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let $=x-1;$>=0;$--){const B=S[$];if(B.controlId&&B.controlId!==y.controlId&&(B.controlComponent===l.ControlComponent.PRETEXTFIX||B.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||B.controlComponent===l.ControlComponent.PREFIX||B.controlComponent===l.ControlComponent.PRE_TEXT)){K.controlId=B.controlId,K.controlComponent=l.ControlComponent.VALUE,B.control&&(K.control=B.control);break}if(B.controlId&&B.controlId!==y.controlId&&(B.controlComponent===l.ControlComponent.POSTFIX||B.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}}else if(J&&!K.controlId){const x=y.controlId;let A=y.control;if(!A)for(let $=C;$>=0;$--){const B=S[$];if(B.controlId===x&&B.control&&(A=B.control,B.controlComponent===l.ControlComponent.PREFIX||B.controlComponent===l.ControlComponent.PRETEXTFIX))break}K.controlId=x,K.originControlId=y.originControlId,K.controlComponent=l.ControlComponent.VALUE,A&&(K.control=A)}else if(y.controlId&&!y.originControlId){let x=y.control;if(!x)for(let A=C;A>=0;A--){const $=S[A];if($.controlId===y.controlId&&!$.originControlId&&$.control){x=$.control;break}}K.controlId||(K.controlId=y.controlId),x&&!K.control&&(K.control=x),K.controlComponent||(K.controlComponent=l.ControlComponent.VALUE)}else if(!K.controlId&&!K.control&&_?.originControlId&&(_.controlComponent===l.ControlComponent.PREFIX||_.controlComponent===l.ControlComponent.PRETEXTFIX)){const x=_.originControlId;let A=null;for(let $=M;$>=0;$--){const B=S[$];if(B.controlId===x&&!B.originControlId&&B.control){A=B.control;break}}K.controlId=x,K.controlComponent=l.ControlComponent.VALUE,A&&(K.control=A)}}if(v&&v!==H){const w=Na(v,s.defaultFont);K.font=w}return K});let tt;const ht=a[R],ut=a[R+1];if(g)tt=C;else{const v=w=>{if(dt?.length)for(let Z=0;Z<dt.length;Z++)S.splice(w+Z,0,dt[Z]);return C+dt.length},K=C+1;if(C!==M&&(i.removeSplitTdOtherRangeElements(),i.spliceElementList(S,K,M-C)),it)tt=v(K);else if(ht?.originControlId&&(ht?.controlComponent==="postfix"||ht?.controlComponent==="postTextFix"))tt=v(K);else if((ht?.control?.type===l.ControlType.NUMBER||ut?.control?.type===l.ControlType.NUMBER)&&r.getActiveControl()?.getElement()?.control?.type===l.ControlType.NUMBER&&r.getIsRangeWithinControl()){const w=r.getActiveControl();w&&typeof w.awake=="function"&&w.awake(),tt=C}else if((ht?.control?.type===l.ControlType.SELECT||ut?.control?.type===l.ControlType.SELECT)&&r.getActiveControl()?.getElement()?.control?.type===l.ControlType.SELECT&&r.getIsRangeWithinControl()){const w=r.getActiveControl();w&&typeof w.awake=="function"&&w.awake(),tt=C}else ht?.control?.type==="button"||ut?.control?.type==="button"?(ht?.control||ut?.control)?.buttonText?tt=C:r.getActiveControl()&&r.getIsRangeWithinControl()?(r.removePlaceholder(C,{elementList:S}),tt=r.setValue(dt),r.emitControlContentChange()):tt=C:r.getActiveControl()&&r.getIsRangeWithinControl()?(r.removePlaceholder(C,{elementList:S}),tt=r.setValue(dt),r.emitControlContentChange()):(ht?.type==="control"||ut?.type==="control")&&!it?tt=v(K):(Ut(S,dt,C,{editorOptions:s}),i.spliceElementList(S,K,0,dt),tt=C+dt.length)}if(~tt&&!g){const v=Vt()-n,K=Vt();f.setRange(tt,tt),i.render({curIndex:tt,isSubmitHistory:!g,traceLabel:`input:${e}`}),Xo(s,`input:${e}`,Vt()-n,[{label:"mutate",duration:v},{label:"renderCall",duration:Vt()-K}],{isComposing:g,textLength:dt.length,compositionChainDuration:e==="compositionend"&&O!==void 0?Number((Vt()-O).toFixed(2)):void 0})}g&&(t.compositionInfo={value:E,startIndex:tt,endIndex:M,defaultStyle:P,perfStartTime:n})}function ba(o){o.compositionInfo&&(o.compositionInfo=null)}function Wa(o,t){if(!o.compositionInfo||o.isComposing)return t;const{startIndex:e,endIndex:n}=o.compositionInfo;return e!==n&&(o.getDraw().removeSplitTdOtherRangeElements(),o.getDraw().spliceElementList(t,e+1,n-e),o.getDraw().getRange().setRange(e,e)),o.compositionInfo=null,t}async function Va(o){const t=o.getDraw(),e=t.getRange(),{startIndex:n,endIndex:i}=e.getRange();if(!~n&&!~n||t.isReadonly()||!e.getIsCanInput())return;const r=t.getElementList();let s=n,a=i;if(n===i){const h=t.getPosition().getPositionList(),g=h[n],f=g.rowNo,T=g.pageNo,m=[];for(let I=0;I<h.length;I++){const L=h[I];if(L.pageNo>T)break;L.pageNo===T&&L.rowNo===f&&m.push(I)}const p=m[0]-1;s=p<0?0:p,a=m[m.length-1]}const c=t.getOptions();await ss(r.slice(s+1,a+1),c);const d=t.getControl();let R;d.getActiveControl()&&d.getIsRangeWithinControl()?(R=d.cut(),d.emitControlContentChange()):(t.spliceElementList(r,s+1,a-s),R=s),e.setRange(R,R),t.render({curIndex:R})}async function Ya(o,t){const e=o.getDraw(),{copy:n}=e.getOverride();if(n&&n()?.preventDefault!==!1)return;const i=e.getRange();let r=null;if(i.getRange().isCrossRowCol){const a=i.getRangeTableElement();if(!a)return;const c=e.getTableParticle().getRangeRowCol();if(!c)return;const d={type:l.ElementType.TABLE,value:"",colgroup:[],trList:[]},R=c[0],u=R[0].colIndex,h=R[R.length-1],g=h.colIndex+h.colspan-1;for(let f=u;f<=g;f++)d.colgroup.push(a.colgroup[f]);for(let f=0;f<c.length;f++){const T=c[f],m=a.trList[T[0].rowIndex],p={tdList:[],height:m.height,minHeight:m.minHeight};for(let I=0;I<T.length;I++)p.tdList.push(T[I]);d.trList.push(p)}r=Pt([d])}else r=i.getIsCollapsed()?i.getRangeRowElementList():i.getSelectionElementList();t?.isPlainText&&r?.length&&(r=[{value:sn(r)}]),r?.length&&await ss(r,e.getOptions())}function Da(o,t){const e=t.getDraw(),{drop:n}=e.getOverride();if(n&&n(o)?.preventDefault!==!1)return;o.preventDefault();const i=o.dataTransfer?.getData("text");if(i)t.input(i);else{const r=o.dataTransfer?.files;if(!r)return;for(let s=0;s<r.length;s++){const a=r[s];a.type.startsWith("image")&&Ho(t,a)}}}function hs(o){if(!Intl.Segmenter)return null;const t=o.getDraw(),e=t.getPosition().getCursorPosition();if(!e)return null;const i=t.getRange().getRangeParagraphInfo();if(!i)return null;const r=i?.elementList?.map(h=>!h.type||h.type!==l.ElementType.CONTROL&&$t.includes(h.type)?h.value:H).join("")||"";if(!r)return null;const s=e.isFirstLetter||t.getCursor().getHitLineStartIndex()?e.index+1:e.index,a=i.startIndex,d=new Intl.Segmenter(void 0,{granularity:"word"}).segment(r);let R=-1,u=-1;for(const{segment:h,index:g,isWordLike:f}of d){const T=g+a;if(f&&s>=T&&s<T+h.length){R=T-1,u=R+h.length;break}}return~R&&~u?{startIndex:R,endIndex:u}:null}function Ua(o){const t=o.getDraw(),e=t.getPosition().getCursorPosition();if(!e)return null;const{value:n,index:i}=e,r=t.getLetterReg();let s=0,a=0;const c=Io.test(n);if(c||r.test(n)){const R=t.getElementList();let u=i-1;for(;u>0;){const g=R[u].value;if(c&&Io.test(g)||!c&&r.test(g))s++,u--;else break}let h=i+1;for(;h<R.length;){const g=R[h].value;if(c&&Io.test(g)||!c&&r.test(g))a++,h++;else break}}const d=i-s-1;return d<0?null:{startIndex:d,endIndex:i+a}}function wa(o,t){const e=o.getDraw(),n=e.getPosition(),i=n.getPositionByXY({x:t.offsetX,y:t.offsetY});if(i.isImage&&i.isDirectHit){const a=e.getElementList(),c=e.getEventBus(),d=a[i.index];if(c.isSubscribe("imageDblclick")&&c.emit("imageDblclick",{evt:t,element:d}),d.imgPreviewDisabled)return;e.getPreviewer().render();return}if(e.getIsPagingMode()&&e.getMode()===l.EditorMode.EDIT&&!~i.index&&i.zone){e.getZone().setZone(i.zone),e.clearSideEffect(),n.setPositionContext({isTable:!1});return}if((i.isCheckbox||i.isRadio)&&i.isDirectHit)return;const r=e.getRange(),s=hs(o)||Ua(o);s&&(r.setRange(s.startIndex,s.endIndex),e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),r.setRangeStyle())}function Za(o){const t=o.getDraw(),e=t.getControl();if(e.getActiveControl()&&e.selectValue())return;const i=t.getPosition().getCursorPosition();if(!i)return;const{index:r}=i,s=t.getElementList();let a=0,c=0,d=r-1;for(;d>0;){const f=s[d],T=s[d-1];if(f.value===H&&!f.listWrap||f.listId!==T?.listId||f.titleId!==T?.titleId)break;a++,d--}let R=r+1;for(;R<s.length;){const f=s[R],T=s[R+1];if(f.value===H&&!f.listWrap||f.listId!==T?.listId||f.titleId!==T?.titleId)break;c++,R++}const u=t.getRange();let h=r-a-1;if(s[h]?.value!==H&&(h-=1),h<0)return;let g=r+c+1;(s[g]?.value===H||g>s.length-1)&&(g-=1),u.setRange(h,g),t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}const gs={dblclick:wa,threeClick:Za};function Qa(o){o.isComposing=!0}function va(o,t){const e=Vt();o.isComposing=!1;const n=o.getDraw(),i=n.getOptions();if(t.data)o.compositionInfo&&(o.compositionInfo.perfStartTime=e),sl?setTimeout(()=>{o.compositionInfo&&Go(t.data,o,"compositionend")},1):o.compositionInfo&&Go(t.data,o,"compositionend");else{const s=o.compositionInfo?.cancel;if(ba(o),!s){const a=n.getRange(),{endIndex:c}=a.getRange();n.render({curIndex:c,isSubmitHistory:!1,traceLabel:"compositionend:empty"})}}n.getCursor().clearAgentDomValue(),Xo(i,"compositionend",Vt()-e,[],{hasData:!!t.data,dataLength:t.data?.length||0})}function Ka(o){o.compositionInfo&&(o.compositionInfo.cancel=!0)}const Ao={compositionstart:Qa,compositionend:va,compositionCancel:Ka};function Ha(o,t){const e=t.getDraw();if(e.isReadonly())return;o.preventDefault();const i=e.getPageContainer();if(!Yi(o.target,L=>L===i))return;const a=o.target.dataset.index;a&&e.setPageNo(Number(a));const c=e.getPosition(),d=c.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!d)return;const{isTable:R,tdValueIndex:u,index:h}=d,g=c.getPositionList(),f=R?u:h;~h&&(e.getRange().setRange(f,f),c.setCursorPosition(g[f]));const T=e.getCursor(),{cursor:{dragColor:m,dragWidth:p,dragFloatImageDisabled:I}}=e.getOptions();if(I){const L=t.cacheElementList?.[t.cacheRange.startIndex];if(L?.type===l.ElementType.IMAGE&&(L.imgDisplay===l.ImageDisplay.FLOAT_TOP||L.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM||L.imgDisplay===l.ImageDisplay.SURROUND))return}T.drawCursor({width:p,color:m,isBlink:!1,isFocus:!1})}const _a={dragover:Ha};class xa{isAllowSelection;isComposing;compositionInfo;isAllowDrag;isAllowDrop;cacheRange;cacheElementList;cachePositionList;cachePositionContext;mouseDownStartPosition;draw;pageContainer;pageList;range;position;constructor(t){this.draw=t,this.pageContainer=t.getPageContainer(),this.pageList=t.getPageList(),this.range=this.draw.getRange(),this.position=this.draw.getPosition(),this.isAllowSelection=!1,this.isComposing=!1,this.compositionInfo=null,this.isAllowDrag=!1,this.isAllowDrop=!1,this.cacheRange=null,this.cacheElementList=null,this.cachePositionList=null,this.cachePositionContext=null,this.mouseDownStartPosition=null}getDraw(){return this.draw}register(){this.pageContainer.addEventListener("click",this.click.bind(this)),this.pageContainer.addEventListener("mousedown",this.mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this.mouseup.bind(this)),this.pageContainer.addEventListener("mouseleave",this.mouseleave.bind(this)),this.pageContainer.addEventListener("mousemove",this.mousemove.bind(this)),this.pageContainer.addEventListener("dblclick",this.dblclick.bind(this)),this.pageContainer.addEventListener("dragover",this.dragover.bind(this)),this.pageContainer.addEventListener("drop",this.drop.bind(this)),Ar(this.pageContainer,this.threeClick.bind(this))}setIsAllowSelection(t){this.isAllowSelection=t,t||this.applyPainterStyle()}setIsAllowDrag(t){this.isAllowDrag=t,this.isAllowDrop=t}clearPainterStyle(){this.pageList.forEach(t=>{t.style.cursor="text"}),this.draw.setPainterStyle(null)}applyPainterStyle(){const t=this.draw.getPainterStyle();if(!t||this.draw.isReadonly()||this.draw.isDisabled())return;let n=this.range.getSelection();if(!n){const s=hs(this);s&&(n=this.draw.getElementList().slice(s.startIndex+1,s.endIndex+1))}if(!n)return;const i=Object.keys(t);n.forEach(s=>{i.forEach(a=>{const c=a;Reflect.set(s,c,t[c])})}),this.draw.render({isSetCursor:!1});const r=this.draw.getPainterOptions();(!r||!r.isDblclick)&&this.clearPainterStyle()}selectAll(){if(this.position.getPositionContext().isTable)this.draw.getTableOperate().tableSelectAll();else{const t=this.position.getPositionList();this.range.setRange(0,t.length-1),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}}mousemove(t){this.draw.isInteractionSuspended()||ga(t,this)}mousedown(t){this.draw.isInteractionSuspended()||Ra(t,this)}click(){this.draw.isInteractionSuspended()||ol&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(t){this.draw.isInteractionSuspended()||ua(t,this)}mouseleave(t){this.draw.isInteractionSuspended()||ha(t,this)}keydown(t){this.draw.isInteractionSuspended()||Sa(t,this)}dblclick(t){this.draw.isInteractionSuspended()||gs.dblclick(this,t)}threeClick(){this.draw.isInteractionSuspended()||gs.threeClick(this)}input(t,e="input"){this.draw.isInteractionSuspended()||Go(t,this,e)}async cut(){this.draw.isInteractionSuspended()||await Va(this)}async copy(t){this.draw.isInteractionSuspended()||await Ya(this,t)}compositionstart(){this.draw.isInteractionSuspended()||Ao.compositionstart(this)}compositionend(t){this.draw.isInteractionSuspended()||Ao.compositionend(this,t)}compositionCancel(){this.draw.isInteractionSuspended()||Ao.compositionCancel(this)}drop(t){this.draw.isInteractionSuspended()||Da(t,this)}dragover(t){this.draw.isInteractionSuspended()||_a.dragover(t,this)}}const fs={PAGE_SCALE:"pageScale"};class Ga{draw;options;cursor;canvasEvent;range;previewer;tableTool;hyperlinkParticle;control;dateParticle;imageParticle;dprMediaQueryList;constructor(t,e){this.draw=t,this.options=t.getOptions(),this.canvasEvent=e,this.cursor=null,this.range=t.getRange(),this.previewer=t.getPreviewer(),this.tableTool=t.getTableTool(),this.hyperlinkParticle=t.getHyperlinkParticle(),this.dateParticle=t.getDateParticle(),this.imageParticle=t.getImageParticle(),this.control=t.getControl(),this.dprMediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)}register(){this.cursor=this.draw.getCursor(),this.addEvent()}addEvent(){window.addEventListener("blur",this.clearSideEffect),document.addEventListener("mousedown",this.clearSideEffect),document.addEventListener("mouseup",this.setCanvasEventAbility),document.addEventListener("wheel",this.setPageScale,{passive:!1}),document.addEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.addEventListener("change",this._handleDprChange)}removeEvent(){window.removeEventListener("blur",this.clearSideEffect),document.removeEventListener("mousedown",this.clearSideEffect),document.removeEventListener("mouseup",this.setCanvasEventAbility),document.removeEventListener("wheel",this.setPageScale),document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.removeEventListener("change",this._handleDprChange)}clearSideEffect=t=>{if(!this.cursor)return;if(this.draw.isInteractionSuspended()){this.resetSideEffect();return}const e=t?.composedPath?.()[0]||t.target;if(this.draw.isTargetInsideEditor(e)){this.watchCursorActive();return}this.resetSideEffect()};resetSideEffect=()=>{this.cursor&&(this.cursor.recoveryCursor(),this.range.recoveryRangeStyle(),this.previewer.clearResizer(),this.tableTool.dispose(),this.hyperlinkParticle.clearHyperlinkPopup(),this.control.destroyControl(),this.dateParticle.clearDatePicker(),this.imageParticle.destroyFloatImage())};setCanvasEventAbility=()=>{this.canvasEvent.setIsAllowDrag(!1),this.canvasEvent.setIsAllowSelection(!1)};watchCursorActive(){this.range.getIsCollapsed()&&setTimeout(()=>{this.cursor?.getAgentIsActive()||this.cursor?.drawCursor({isFocus:!1,isBlink:!1})})}setPageScale=t=>{if(this.draw.isInteractionSuspended()||!this.draw.isTargetInsideEditor(t.target)||this.options.shortcutDisableKeys.includes(fs.PAGE_SCALE)||!t.ctrlKey)return;t.preventDefault();const{scale:e}=this.options;if(t.deltaY<0){const n=e*10+1;n<=30&&this.draw.setPageScale(n/10)}else{const n=e*10-1;n>=5&&this.draw.setPageScale(n/10)}};_handleVisibilityChange=()=>{if(document.visibilityState==="visible"){const t=this.range.getRange(),e=!!~t.startIndex&&!!~t.endIndex&&t.startIndex===t.endIndex;this.range.replaceRange(t),this.draw.render({isSetCursor:e,isCompute:!1,isSubmitHistory:!1,curIndex:t.startIndex})}};_handleDprChange=()=>{this.draw.setPageDevicePixel()}}class Aa{undoStack=[];redoStack=[];maxRecordCount;constructor(t){this.maxRecordCount=t.getOptions().historyMaxRecordCount+1}undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t),this.undoStack.length&&this.undoStack[this.undoStack.length-1]()}}redo(){if(this.redoStack.length){const t=this.redoStack.pop();this.undoStack.push(t),t()}}execute(t){for(this.undoStack.push(t),this.redoStack.length&&(this.redoStack=[]);this.undoStack.length>this.maxRecordCount;)this.undoStack.shift()}isCanUndo(){return this.undoStack.length>1}isCanRedo(){return!!this.redoStack.length}isStackEmpty(){return!this.undoStack.length&&!this.redoStack.length}recovery(){this.undoStack=[],this.redoStack=[]}popUndo(){return this.undoStack.pop()}}class ka{cursorPosition;positionContext;positionList;floatPositionList;draw;eventBus;options;constructor(t){this.positionList=[],this.floatPositionList=[],this.cursorPosition=null,this.positionContext={isTable:!1,isControl:!1},this.draw=t,this.eventBus=t.getEventBus(),this.options=t.getOptions()}getFloatPositionList(){return this.floatPositionList}getTablePositionList(t){const{index:e,trIndex:n,tdIndex:i}=this.positionContext;return t[e].trList[n].tdList[i].positionList||[]}getPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalElementList()):this.getOriginalPositionList()}getMainPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalMainElementList()):this.positionList}getOriginalPositionList(){const t=this.draw.getZone();return t.isHeaderActive()?this.draw.getHeader().getPositionList():t.isFooterActive()?this.draw.getFooter().getPositionList():this.positionList}getOriginalMainPositionList(){return this.positionList}getSelectionPositionList(){const{startIndex:t,endIndex:e}=this.draw.getRange().getRange();return t===e?null:this.getPositionList().slice(t+1,e+1)}setPositionList(t){this.positionList=t}setFloatPositionList(t){this.floatPositionList=t}computePageRowPosition(t){const{positionList:e,rowList:n,pageNo:i,startX:r,startY:s,startRowIndex:a,startIndex:c,innerWidth:d,zone:R}=t,{scale:u,table:{tdPadding:h}}=this.options;let g=r,f=s,T=c;for(let m=0;m<n.length;m++){const p=n[m];if(!p.isSurround){const P=p.width+(p.offsetX||0);p.rowFlex===l.RowFlex.CENTER?g+=(d-P)/2:p.rowFlex===l.RowFlex.RIGHT&&(g+=d-P)}g+=p.offsetX||0,f+=p.offsetY||0;const I=g,L=f;for(let P=0;P<p.elementList.length;P++){const O=p.elementList[P],S=O.metrics,F=!se(O)&&(O.imgDisplay!==l.ImageDisplay.INLINE&&O.type===l.ElementType.IMAGE||O.type===l.ElementType.LATEX)?p.ascent-S.height:p.ascent;O.left&&(g+=O.left),O.translateX&&(g+=O.translateX*u);const N={pageNo:i,index:T,value:O.value,rowIndex:a+m,rowNo:m,metrics:S,left:O.left||0,ascent:F,lineHeight:p.height,isFirstLetter:P===0,isLastLetter:P===p.elementList.length-1,coordinate:{leftTop:[g,f],leftBottom:[g,f+p.height],rightTop:[g+S.width,f],rightBottom:[g+S.width,f+p.height]}};if(O.imgDisplay===l.ImageDisplay.SURROUND||O.imgDisplay===l.ImageDisplay.FLOAT_TOP||O.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM){const V=e[e.length-1];V&&(N.metrics=V.metrics,N.coordinate=V.coordinate),O.imgFloatPosition||(O.imgFloatPosition={x:g,y:f,pageNo:i}),this.floatPositionList.push({pageNo:i,element:O,position:N,isTable:t.isTable,index:t.index,tdIndex:t.tdIndex,trIndex:t.trIndex,tdValueIndex:T,zone:R})}if(e.push(N),T++,g+=S.width,O.type===l.ElementType.TABLE&&!se(O)){const V=O.tdPadding||h,Y=V[1]+V[3],X=V[0]+V[2];for(let W=0;W<O.trList.length;W++){const E=O.trList[W];for(let C=0;C<E.tdList.length;C++){const M=E.tdList[C];M.positionList=[];const y=M.rowList,b=this.computePageRowPosition({positionList:M.positionList,rowList:y,pageNo:i,startRowIndex:0,startIndex:0,startX:(M.x+V[3])*u+I+(O.translateX||0)*u,startY:(M.y+V[0])*u+L,innerWidth:(M.width-Y)*u,isTable:!0,index:T-1,tdIndex:C,trIndex:W,zone:R});if(M.verticalAlign===l.VerticalAlign.MIDDLE||M.verticalAlign===l.VerticalAlign.BOTTOM){const D=y.reduce((G,_)=>G+_.height,0),U=(M.height-X)*u-D,Q=M.verticalAlign===l.VerticalAlign.MIDDLE?U/2:U;Math.floor(Q)>0&&M.positionList.forEach(G=>{const{coordinate:{leftTop:_,leftBottom:j,rightBottom:st,rightTop:it}}=G;_[1]+=Q,j[1]+=Q,st[1]+=Q,it[1]+=Q})}g=b.x,f=b.y}}g=I,f=L}}g=r,f+=p.height}return{x:g,y:f,index:T}}computePositionList(){this.positionList=[];const t=this.draw.getInnerWidth(),e=this.draw.getPageRowList(),n=this.draw.getMargins(),i=n[3],s=this.draw.getHeader().getExtraHeight(),a=n[0]+s;let c=0;for(let d=0;d<e.length;d++){const R=e[d];if(!R?.length)continue;const u=R[0].startIndex;this.computePageRowPosition({positionList:this.positionList,rowList:R,pageNo:d,startRowIndex:c,startIndex:u,startX:i,startY:a,innerWidth:t}),c+=R.length}}computeRowPosition(t){const{row:e,innerWidth:n}=t,i=[];return this.computePageRowPosition({positionList:i,innerWidth:n,rowList:[at(e)],pageNo:0,startX:0,startY:0,startIndex:0,startRowIndex:0}),i}setCursorPosition(t){this.cursorPosition=t}getCursorPosition(){return this.cursorPosition}getPositionContext(){return this.positionContext}setPositionContext(t){this.eventBus.emit("positionContextChange",{value:t,oldValue:this.positionContext}),this.positionContext=t}getPositionByXY(t){const{x:e,y:n,isTable:i}=t;let{elementList:r,positionList:s}=t;r||(r=this.draw.getOriginalElementList()),s||(s=this.getOriginalPositionList());const a=this.draw.getZone(),c=t.pageNo??this.draw.getPageNo(),d=a.isMainActive(),R=d?c:0;if(!i){const T=this.getFloatPositionByXY({...t,imgDisplays:[l.ImageDisplay.FLOAT_TOP,l.ImageDisplay.SURROUND]});if(T)return T}for(let T=0;T<s.length;T++){const{index:m,pageNo:p,left:I,isFirstLetter:L,coordinate:{leftTop:P,rightTop:O,leftBottom:S}}=s[T];if(R===p){if(p>R)break;if(P[0]-I<=e&&O[0]>=e&&P[1]<=n&&S[1]>=n){let F=T;const N=r[T];if(N.type===l.ElementType.TABLE)for(let Y=0;Y<N.trList.length;Y++){const X=N.trList[Y];for(let W=0;W<X.tdList.length;W++){const E=X.tdList[W],C=this.getPositionByXY({x:e,y:n,td:E,pageNo:c,tablePosition:s[T],isTable:!0,elementList:E.value,positionList:E.positionList});if(~C.index){const{index:M,hitLineStartIndex:y}=C,b=E.value[M];return{index:m,isCheckbox:C.isCheckbox||b.type===l.ElementType.CHECKBOX||b.controlComponent===l.ControlComponent.CHECKBOX,isRadio:b.type===l.ElementType.RADIO||b.controlComponent===l.ControlComponent.RADIO,isControl:!!b.controlId,isImage:C.isImage,isLabel:C.isLabel,isMacro:C.isMacro,isDirectHit:C.isDirectHit,isTable:!0,tdIndex:W,trIndex:Y,tdValueIndex:M,tdId:E.id,trId:X.id,tableId:N.id,hitLineStartIndex:y}}}}if(N.type===l.ElementType.IMAGE||N.type===l.ElementType.LATEX)return{index:F,isDirectHit:!0,isImage:!0};if(N.type===l.ElementType.MENSTRUAL_HISTORY)return{index:F,isDirectHit:!0};if(N.type===l.ElementType.FETAL_HEART_POSITION)return{index:F,isDirectHit:!0};if(N.type===l.ElementType.TOOTH_POSITION){const{scale:Y}=this.options,X=N.width*Y;return e>=P[0]&&e<=P[0]+X?{index:F,isDirectHit:!0}:{index:F}}if(N.type===l.ElementType.CHECKBOX||N.controlComponent===l.ControlComponent.CHECKBOX)return{index:F,isDirectHit:!0,isCheckbox:!0};if(N.type===l.ElementType.LABEL)return{index:F,isDirectHit:!0,isLabel:!0};if(N.type===l.ElementType.MACRO||N.type===l.ElementType.CUSTOM_MACRO||N.type===l.ElementType.REUSABLE_ITEM||N.type===l.ElementType.SUB_TEMPLATE)return{index:F,isDirectHit:!0,isMacro:!0};if(N.type===l.ElementType.TAB&&N.listStyle===l.ListStyle.CHECKBOX){let Y=F-1;for(;Y>0;){const X=r[Y];if(X.value===H&&X.listStyle===l.ListStyle.CHECKBOX)break;Y--}return{index:Y,isDirectHit:!0,isCheckbox:!0}}if(N.type===l.ElementType.RADIO||N.controlComponent===l.ControlComponent.RADIO)return{index:F,isDirectHit:!0,isRadio:!0};let V;if(r[m].value!==H){const Y=O[0]-P[0];e<P[0]+Y/2&&(F=T-1,L&&(V=T))}return{isDirectHit:!0,hitLineStartIndex:V,index:F,isControl:!!N.controlId}}}}if(!i){const T=this.getFloatPositionByXY({...t,imgDisplays:[l.ImageDisplay.FLOAT_BOTTOM]});if(T)return T}let u=!1,h=-1,g;if(i){const{scale:T}=this.options,{td:m,tablePosition:p}=t;if(m&&p){const{leftTop:I}=p.coordinate,L=m.x*T+I[0],P=m.y*T+I[1],O=m.width*T,S=m.height*T;if(!(L<e&&e<L+O&&P<n&&n<P+S))return{index:h}}}const f=s.filter(T=>T.isLastLetter&&T.pageNo===R);for(let T=0;T<f.length;T++){const{index:m,rowNo:p,coordinate:{leftTop:I,leftBottom:L}}=f[T];if(n>I[1]&&n<=L[1]){const P=s.findIndex(N=>N.pageNo===R&&N.rowNo===p),O=r[P],S=s[P],F=O.listStyle===l.ListStyle.CHECKBOX?this.draw.getMargins()[3]:S.coordinate.leftTop[0];if(e<F)~P?S.value===H?h=P:(h=P-1,g=P):h=m;else{if(O.listStyle===l.ListStyle.CHECKBOX&&e<I[0])return{index:P,isDirectHit:!0,isCheckbox:!0};h=m}u=!0;break}}if(!u){if(this.draw.getIsPagingMode()){const m=this.draw.getHeader(),p=m.getHeight(),I=m.getHeaderTop()+p,L=this.draw.getFooter(),O=this.draw.getHeight()-(L.getFooterBottom()+L.getHeight());if(d){if(n<I)return{index:-1,zone:l.EditorZone.HEADER};if(n>O)return{index:-1,zone:l.EditorZone.FOOTER}}else if(n<=O&&n>=I)return{index:-1,zone:l.EditorZone.MAIN}}const T=this.draw.getMargins();if(n<=T[0])for(let m=0;m<s.length;m++){const p=s[m];if(p.pageNo!==R||p.rowNo!==0)continue;const{leftTop:I,rightTop:L}=p.coordinate;if(e<=T[3]||e>=I[0]&&e<=L[0]||s[m+1]?.rowNo!==0)return{index:p.index}}else{const m=f[f.length-1];if(m){const p=m.rowNo;for(let I=0;I<s.length;I++){const L=s[I];if(L.pageNo!==R||L.rowNo!==p)continue;const{leftTop:P,rightTop:O}=L.coordinate;if(e<=T[3]||e>=P[0]&&e<=O[0]||s[I+1]?.rowNo!==p)return{index:L.index}}}}return{index:f[f.length-1]?.index||s.length-1}}return{hitLineStartIndex:g,index:h,isControl:!!r[h]?.controlId}}getFloatPositionByXY(t){const{x:e,y:n}=t,i=t.pageNo??this.draw.getPageNo(),r=this.draw.getZone().getZone(),{scale:s}=this.options;for(let a=0;a<this.floatPositionList.length;a++){const{position:c,element:d,isTable:R,index:u,trIndex:h,tdIndex:g,tdValueIndex:f,zone:T,pageNo:m}=this.floatPositionList[a];if(i===m&&d.type===l.ElementType.IMAGE&&d.imgDisplay&&t.imgDisplays.includes(d.imgDisplay)&&(!T||T===r)){const p=d.imgFloatPosition,I=p.x*s,L=p.y*s,P=d.width*s,O=d.height*s;if(e>=I&&e<=I+P&&n>=L&&n<=L+O)return R?{index:u,isDirectHit:!0,isImage:!0,isTable:R,trIndex:h,tdIndex:g,tdValueIndex:f,tdId:d.tdId,trId:d.trId,tableId:d.tableId}:{index:c.index,isDirectHit:!0,isImage:!0}}}}adjustPositionContext(t){const e=this.getPositionByXY(t);if(!~e.index)return null;if(e.isControl&&this.draw.getMode()!==l.EditorMode.READONLY){const{index:m,isTable:p,trIndex:I,tdIndex:L,tdValueIndex:P}=e,O=this.draw.getControl(),{newIndex:S}=O.moveCursor({index:m,isTable:p,trIndex:I,tdIndex:L,tdValueIndex:P});p?e.tdValueIndex=S:e.index=S}const{index:n,isCheckbox:i,isRadio:r,isControl:s,isImage:a,isLabel:c,isDirectHit:d,isTable:R,trIndex:u,tdIndex:h,tdId:g,trId:f,tableId:T}=e;return this.setPositionContext({isTable:R||!1,isCheckbox:i||!1,isRadio:r||!1,isControl:s||!1,isImage:a||!1,isLabel:c||!1,isDirectHit:d||!1,index:n,trIndex:u,tdIndex:h,tdId:g,trId:f,tableId:T}),e}setSurroundPosition(t){const{scale:e}=this.options,{pageNo:n,row:i,rowElement:r,rowElementRect:s,surroundElementList:a,availableWidth:c}=t;let d=s.x,R=0;if(a.length&&!rn(r)&&!r.control?.minWidth)for(let u=0;u<a.length;u++){const h=a[u],g=h.imgFloatPosition;if(g.pageNo!==n)continue;const f={...g,x:g.x*e,y:g.y*e,width:h.width*e,height:h.height*e};if(qr(s,f)){i.isSurround=!0;const T=f.width+f.x-s.x;if(r.left=T,i.width+=T,R+=T,d=f.x+f.width,i.width+r.metrics.width>c){r.left=0,i.width-=R;break}}}return{x:d,rowIncreaseWidth:R}}}class Ja{draw;options;range;listener;eventBus;position;historyManager;defaultStyle;lastRangeStyle;constructor(t){this.draw=t,this.options=t.getOptions(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.position=t.getPosition(),this.historyManager=t.getHistoryManager(),this.range={startIndex:-1,endIndex:-1},this.defaultStyle=null,this.lastRangeStyle=null}_isSameRangeStyle(t,e){if(!t||!["type","undo","redo","painter","font","size","bold","italic","underline","strikeout","deletePerson","color","highlight","rowFlex","vertical","rowMargin","level","listType","listStyle","textDecoration","extension"].every(c=>t[c]===e[c])||!(t.dashArray.length===e.dashArray.length&&t.dashArray.every((c,d)=>c===e.dashArray[d])))return!1;const s=t.groupIds||[],a=e.groupIds||[];return s.length===a.length&&s.every((c,d)=>c===a[d])}_emitRangeStyle(t){this._isSameRangeStyle(this.lastRangeStyle,t)||(this.lastRangeStyle={...t,dashArray:[...t.dashArray],groupIds:t.groupIds?[...t.groupIds]:null},this.listener.rangeStyleChange?.(t),this.eventBus.isSubscribe("rangeStyleChange")&&this.eventBus.emit("rangeStyleChange",t))}getRange(){return this.range}clearRange(){this.setRange(-1,-1)}setDefaultStyle(t){t?this.defaultStyle={...this.defaultStyle,...t}:this.defaultStyle=null}getDefaultStyle(){return this.defaultStyle}getRangeAnchorStyle(t,e){const n=en(t,e);return n?{...n,...this.defaultStyle}:null}getIsRangeChange(t,e,n,i,r,s,a){return this.range.startIndex!==t||this.range.endIndex!==e||this.range.tableId!==n||this.range.startTdIndex!==i||this.range.endTdIndex!==r||this.range.startTrIndex!==s||this.range.endTrIndex!==a}getIsCollapsed(){const{startIndex:t,endIndex:e}=this.range;return t===e}getIsSelection(){const{startIndex:t,endIndex:e}=this.range;return!~t&&!~e?!1:t!==e}getSelection(){const{startIndex:t,endIndex:e,splitTdRange:n}=this.range;if(t===e)return null;if(n)return this.draw.getSplitTdValues(n.originalId).slice(n.startIndex+1,n.endIndex+1);const i=this.draw.getElementList();return i.slice(i[t]?.value===H?t:t+1,e+1)}getSelectionElementList(){if(this.range.isCrossRowCol){const t=this.draw.getTableParticle().getRangeRowCol();if(!t)return null;const e=[];for(let n=0;n<t.length;n++){const i=t[n];for(let r=0;r<i.length;r++){const s=i[r];e.push(...s.value)}}return e}return this.getSelection()}getTextLikeSelection(){const t=this.getSelection();return t?t.filter(e=>!e.type||$t.includes(e.type)):null}getTextLikeSelectionElementList(){const t=this.getSelectionElementList();return t?t.filter(e=>!e.type||$t.includes(e.type)):null}getRangeRow(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;const n=this.position.getPositionList(),i=new Map;for(let r=t;r<e+1;r++){const{pageNo:s,rowNo:a}=n[r],c=i.get(s);c?c.has(a)||c.add(a):i.set(s,new Set([a]))}return i}getRangeRowElementList(){const{startIndex:t,endIndex:e,isCrossRowCol:n}=this.range;if(!~t&&!~e)return null;if(n)return this.getSelectionElementList();const i=this.getRangeRow();if(!i)return null;const r=this.position.getPositionList(),s=this.draw.getElementList(),a=[];for(let c=0;c<r.length;c++){const d=r[c],R=i.get(d.pageNo);R&&R.has(d.rowNo)&&a.push(s[c])}return a}getRangeParagraph(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;const n=this.position.getPositionList(),i=this.draw.getElementList(),r=new Map;let s=t;for(;s>=0;){const{pageNo:d,rowNo:R}=n[s];let u=r.get(d);u||(u=[],r.set(d,u)),u.includes(R)||u.unshift(R);const h=i[s],g=i[s-1];if(h.value===H&&!h.listWrap||h.listId!==g?.listId||h.titleId!==g?.titleId)break;s--}const a=t===e;if(!a){let d=t+1;for(;d<e;){const{pageNo:R,rowNo:u}=n[d];let h=r.get(R);h||(h=[],r.set(R,h)),h.includes(u)||h.push(u),d++}}let c=e;for(a&&i[t].value===H&&(c+=1);c<n.length;){const d=i[c],R=i[c+1];if(d.value===H&&!d.listWrap||d.listId!==R?.listId||d.titleId!==R?.titleId)break;const{pageNo:u,rowNo:h}=n[c];let g=r.get(u);g||(g=[],r.set(u,g)),g.includes(h)||g.push(h),c++}return r}getRangeParagraphInfo(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;let n=-1;const i=[],r=this.getRangeParagraph();if(!r)return null;const s=this.draw.getElementList(),a=this.position.getPositionList();for(let c=0;c<a.length;c++){const d=a[c],R=r.get(d.pageNo);R&&R.includes(d.rowNo)&&(~n||(n=d.index),i.push(s[c]))}return i.length?{elementList:i,startIndex:n}:null}getRangeParagraphElementList(){return this.getRangeParagraphInfo()?.elementList||null}getRangeTableElement(){const t=this.position.getPositionContext();return t.isTable?this.draw.getOriginalElementList()[t.index]:null}getIsSelectAll(){const t=this.draw.getElementList(),{startIndex:e,endIndex:n}=this.range;return e===0&&t.length-1===n&&!this.position.getPositionContext().isTable}getIsPointInRange(t,e,n){const{startIndex:i,endIndex:r}=this.range,s=this.position.getPositionList();for(let a=i+1;a<=r&&s[a];a++){const{coordinate:{leftTop:d,rightBottom:R},pageNo:u}=s[a];if(n===u&&t>=d[0]&&t<=R[0]&&e>=d[1]&&e<=R[1])return!0}return!1}getKeywordRangeList(t){const e=this.draw.getSearch().getMatchList(t,this.draw.getOriginalElementList()),n=new Map;for(const r of e){const s=n.get(r.groupId);if(s)s.endIndex+=1;else{const{type:a,groupId:c,tableId:d,index:R,tdIndex:u,trIndex:h}=r,g={startIndex:R,endIndex:R};a===fe.TABLE&&(g.tableId=d,g.startTdIndex=u,g.endTdIndex=u,g.startTrIndex=h,g.endTrIndex=h),n.set(c,g)}}const i=[];return n.forEach(r=>{i.push(r)}),i}getIsCanInput(){const{range:{startIndex:t,endIndex:e},elementList:n}=this.getRangeElement(),i=n[t];if(!i)return!1;if(t===e)return(i.controlComponent!==l.ControlComponent.PRE_TEXT||n[t+1]?.controlComponent!==l.ControlComponent.PRE_TEXT)&&i.controlComponent!==l.ControlComponent.POST_TEXT;const r=n[e];return r?!i.controlId&&!r.controlId||(!i.controlId||i.controlComponent===l.ControlComponent.POSTFIX)&&(!r.controlId||r.controlComponent===l.ControlComponent.POSTFIX)||!!i.controlId&&r.controlId===i.controlId&&r.controlComponent!==l.ControlComponent.PRE_TEXT&&r.controlComponent!==l.ControlComponent.POST_TEXT&&r.controlComponent!==l.ControlComponent.POSTFIX:!1}setRange(t,e,n,i,r,s,a,c){this.getIsRangeChange(t,e,n,i,r,s,a)&&(this.range.startIndex=t,this.range.endIndex=e,this.range.tableId=n,this.range.startTdIndex=i,this.range.endTdIndex=r,this.range.startTrIndex=s,this.range.endTrIndex=a,this.range.isCrossRowCol=!!(i||r||s||a),this.range.splitTdRange=c,this.setDefaultStyle(null)),this.range.zone=this.draw.getZone().getZone();const R=this.draw.getControl();if(~t&&~e&&!!this.draw.getElementList()[t]?.controlId){R.initControl();return}R.destroyControl()}replaceRange(t){this.setRange(t.startIndex,t.endIndex,t.tableId,t.startTdIndex,t.endTdIndex,t.startTrIndex,t.endTrIndex)}shrinkRange(){const{startIndex:t,endIndex:e}=this.range;t===e||!~t&&!~e||this.replaceRange({...this.range,startIndex:e})}setRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const{startIndex:n,endIndex:i,isCrossRowCol:r}=this.range;if(!~n&&!~i)return;let s;if(r){const y=this.draw.getOriginalElementList(),b=this.position.getPositionContext();s=y[b.index]}else{const y=~i?i:0,b=this.draw.getElementList();s=this.getRangeAnchorStyle(b,y)}if(!s)return;const a=this.getSelection()||[s],c=s.type||l.ElementType.TEXT,d=s.font||this.options.defaultFont,R=s.size||this.options.defaultSize,u=!~a.findIndex(y=>!y.bold),h=!~a.findIndex(y=>!y.italic),g=!~a.findIndex(y=>!y.underline&&!y.control?.underline),f=!~a.findIndex(y=>!y.strikeout),T=s.color||null,m=s.highlight||null,p=s.rowFlex||null,I=s.vertical||null,L=s.rowMargin??this.options.defaultRowMargin,P=s.dashArray||[],O=s.level||null,S=s.listType||null,F=s.listStyle||null,N=g&&s.textDecoration||null,V=!!this.draw.getPainterStyle(),Y=this.historyManager.isCanUndo(),X=this.historyManager.isCanRedo(),W=s.groupIds||null,E=s.extension??null,C=s.deletePerson??"",M={type:c,undo:Y,redo:X,painter:V,font:d,size:R,bold:u,italic:h,underline:g,strikeout:f,deletePerson:C,color:T,highlight:m,rowFlex:p,vertical:I,rowMargin:L,dashArray:P,level:O,listType:S,listStyle:F,groupIds:W,textDecoration:N,extension:E};this._emitRangeStyle(M)}recoveryRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const n=this.options.defaultFont,i=this.options.defaultSize,r=this.options.defaultRowMargin,s=!!this.draw.getPainterStyle(),a=this.historyManager.isCanUndo(),c=this.historyManager.isCanRedo(),R={type:null,undo:a,redo:c,painter:s,font:n,size:i,bold:!1,italic:!1,underline:!1,strikeout:!1,deletePerson:"123",color:null,highlight:null,rowFlex:null,rowMargin:r,dashArray:[],level:null,listType:null,listStyle:null,groupIds:null,textDecoration:null,extension:null,vertical:null};this._emitRangeStyle(R)}shrinkBoundary(t={}){const{elementList:e,range:n}=this.getRangeElement(t),{startIndex:i,endIndex:r}=n;if(!~i&&!~r)return;const s=e[i],a=e[r];if(i===r){if(s.controlComponent===l.ControlComponent.PLACEHOLDER){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId===s.controlId&&(d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)){n.startIndex=c,n.endIndex=c;break}if(d.controlId!==s.controlId&&!d.originControlId)break;c--}}if(s.controlComponent===l.ControlComponent.TEXTFIXLABEL){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId!==s.controlId||d.controlComponent===l.ControlComponent.VALUE||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;break}c--}}}else{if(s.controlComponent===l.ControlComponent.PLACEHOLDER||a.controlComponent===l.ControlComponent.PLACEHOLDER||s.controlComponent===l.ControlComponent.TEXTFIXLABEL||a.controlComponent===l.ControlComponent.TEXTFIXLABEL){let c=r-1;for(;c>0;){const d=e[c];if(d.controlId!==a.controlId||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;return}c--}}if(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||s.controlComponent===l.ControlComponent.PRETEXTFIX||s.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==s.controlId||d.controlComponent===l.ControlComponent.VALUE){n.startIndex=c-1;break}else if(d.controlComponent===l.ControlComponent.PLACEHOLDER){n.startIndex=c-1,n.endIndex=c-1;return}c++}}if(a.controlComponent!==l.ControlComponent.VALUE){let c=r-1;for(;c>0;){const d=e[c];if(d.controlId!==s.controlId||d.controlComponent===l.ControlComponent.VALUE){n.endIndex=c;break}else if(d.controlComponent===l.ControlComponent.PLACEHOLDER){n.startIndex=c,n.endIndex=c;return}c--}}}}render(t,e,n,i,r){t.save(),t.globalAlpha=this.options.rangeAlpha,t.fillStyle=this.options.rangeColor,t.fillRect(e,n,i,r),t.restore()}toString(){const t=this.getTextLikeSelection();return t?t.map(e=>e.value).join("").replace(new RegExp(H,"g"),""):""}getRangeElement(t={}){const e=t.elementList||this.draw.getElementList(),n=t.range||this.getRange(),{splitTdRange:i}=n,r={elementList:e,range:n};return i&&(r.range=i,r.elementList=this.draw.getSplitTdValues(i.originalId)??[]),r}}class Ba{draw;options;imageCache;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map}_renderBackgroundColor(t,e,n,i){t.save(),t.fillStyle=e,t.fillRect(0,0,n,i),t.restore()}_drawImage(t,e,n,i){const{background:r,scale:s}=this.options;if(r.size===l.BackgroundSize.CONTAIN){const a=e.width*s,c=e.height*s;if(!r.repeat||r.repeat===l.BackgroundRepeat.NO_REPEAT)t.drawImage(e,0,0,a,c);else{let d=0,R=0;const u=r.repeat===l.BackgroundRepeat.REPEAT||r.repeat===l.BackgroundRepeat.REPEAT_X?Math.ceil(n*s/a):1,h=r.repeat===l.BackgroundRepeat.REPEAT||r.repeat===l.BackgroundRepeat.REPEAT_Y?Math.ceil(i*s/c):1;for(let g=0;g<u;g++){for(let f=0;f<h;f++)t.drawImage(e,d,R,a,c),R+=c;R=0,d+=a}}}else t.drawImage(e,0,0,n*s,i*s)}_renderBackgroundImage(t,e,n){const{background:i}=this.options,r=this.imageCache.get(i.image);if(r)this._drawImage(t,r,e,n);else{const s=new Image;s.setAttribute("crossOrigin","Anonymous"),s.src=i.image,s.onload=()=>{this.imageCache.set(i.image,s),this._drawImage(t,s,e,n),this.draw.render({isCompute:!1,isSubmitHistory:!1})}}}render(t,e){const{background:{image:n,color:i,applyPageNumbers:r}}=this.options;if(n&&(!r?.length||r.includes(e))){const{width:s,height:a}=this.options;this._renderBackgroundImage(t,s,a)}else{const s=this.draw.getCanvasWidth(e),a=this.draw.getCanvasHeight(e);this._renderBackgroundColor(t,i,s,a)}}}class ko{fillRect;fillColor;fillDecorationStyle;constructor(){this.fillRect=this.clearFillInfo()}clearFillInfo(){return this.fillColor=void 0,this.fillDecorationStyle=void 0,this.fillRect={x:0,y:0,width:0,height:0},this.fillRect}recordFillInfo(t,e,n,i,r,s,a){const c=!this.fillRect.width;if(!c&&(this.fillColor!==s||this.fillDecorationStyle!==a)){this.render(t),this.clearFillInfo(),this.recordFillInfo(t,e,n,i,r,s,a);return}c&&(this.fillRect.x=e,this.fillRect.y=n),r&&this.fillRect.height<r&&(this.fillRect.height=r),this.fillRect.width+=i,this.fillColor=s,this.fillDecorationStyle=a}}class $a extends ko{options;constructor(t){super(),this.options=t.getOptions()}render(t){if(!this.fillRect.width)return;const{highlightAlpha:e}=this.options,{x:n,y:i,width:r,height:s}=this.fillRect;t.save(),t.globalAlpha=e,t.fillStyle=this.fillColor,t.fillRect(n,i,r,s),t.restore(),this.clearFillInfo()}}class za{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{marginIndicatorColor:n,pageMode:i}=this.options,r=this.draw.getWidth(),s=i===l.PageMode.CONTINUITY?this.draw.getCanvasHeight(e)/this.draw.getPagePixelRatio():this.draw.getHeight(),a=this.draw.getMargins(),c=this.draw.getMarginIndicatorSize();t.save(),t.translate(.5,.5),t.strokeStyle=n,t.beginPath();const d=[a[3],a[0]],R=[r-a[1],a[0]],u=[a[3],s-a[2]],h=[r-a[1],s-a[2]];t.moveTo(d[0]-c,d[1]),t.lineTo(...d),t.lineTo(d[0],d[1]-c),t.moveTo(R[0]+c,R[1]),t.lineTo(...R),t.lineTo(R[0],R[1]-c),t.moveTo(u[0]-c,u[1]),t.lineTo(...u),t.lineTo(u[0],u[1]+c),t.moveTo(h[0]+c,h[1]),t.lineTo(...h),t.lineTo(h[0],h[1]+c),t.stroke(),t.restore()}}class ja{draw;options;position;range;searchKeyword;searchNavigateIndex;searchOptions;searchMatchList;constructor(t){this.draw=t,this.options=t.getOptions(),this.position=t.getPosition(),this.range=t.getRange(),this.searchNavigateIndex=null,this.searchOptions=null,this.searchKeyword=null,this.searchMatchList=[]}getSearchKeyword(){return this.searchKeyword}setSearchKeyword(t,e){this.searchKeyword=t,this.searchNavigateIndex=null,this.searchOptions=e||null}searchNavigatePre(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let t=this.searchNavigateIndex-1,e=!1;const n=this.searchMatchList[this.searchNavigateIndex].groupId;for(;t>=0;){const i=this.searchMatchList[t];if(n!==i.groupId){e=!0,this.searchNavigateIndex=t-(this.searchKeyword.length-1);break}t--}if(!e){if(this.searchMatchList[this.searchMatchList.length-1].groupId===n)return null;this.searchNavigateIndex=this.searchMatchList.length-1-(this.searchKeyword.length-1)}}return this.searchNavigateIndex}searchNavigateNext(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let t=this.searchNavigateIndex+1,e=!1;const n=this.searchMatchList[this.searchNavigateIndex].groupId;for(;t<this.searchMatchList.length;){const i=this.searchMatchList[t];if(n!==i.groupId){e=!0,this.searchNavigateIndex=t;break}t++}if(!e){if(this.searchMatchList[0].groupId===n)return null;this.searchNavigateIndex=0}}return this.searchNavigateIndex}searchNavigateScrollIntoView(t){const{coordinate:{leftTop:e,leftBottom:n,rightTop:i},pageNo:r}=t,s=this.draw.getHeight(),a=this.draw.getPageGap(),c=r*(s+a),d=document.createElement("div");d.style.position="absolute";const R=50;d.style.width=`${i[0]-e[0]+R}px`,d.style.height=`${n[1]-e[1]+R}px`,d.style.left=`${e[0]}px`,d.style.top=`${e[1]+c}px`,this.draw.getContainer().append(d),d.scrollIntoView(!1),d.remove()}getSearchNavigateIndexList(){return this.searchNavigateIndex===null||!this.searchKeyword?[]:new Array(this.searchKeyword.length).fill(this.searchNavigateIndex).map((t,e)=>t+e)}getSearchMatchList(){return this.searchMatchList}getSearchNavigateInfo(){if(!this.searchKeyword||!this.searchMatchList.length)return null;const t=this.searchNavigateIndex!==null?this.searchNavigateIndex/this.searchKeyword.length+1:0;let e=0,n=null;for(let i=0;i<this.searchMatchList.length;i++){const r=this.searchMatchList[i];n!==r.groupId&&(n=r.groupId,e+=1)}return{index:t,count:e}}getMatchList(t,e){const{isRegEnable:n=!1,isIgnoreCase:i=!0}=this.searchOptions||{},r=i?t.toLocaleLowerCase():t,s=[],a=[],c=e.length,d=[];for(let g=0;g<c;g++)e[g].type===l.ElementType.TABLE&&d.push(g);let R=0,u=0;for(;u<c-1;){const g=d.length?d[R]:c,f=e.slice(u,g);f.length&&a.push({index:u,type:fe.PAGE,elementList:f});const T=e[g];T&&a.push({index:g,type:fe.TABLE,elementList:[T]}),u=g+1,R++}function h(g,f,T,m){if(!g)return;let p=T.map(S=>!S.type||$t.includes(S.type)&&S.controlComponent!==l.ControlComponent.CHECKBOX&&S.controlComponent!==l.ControlComponent.RADIO&&!S.hide&&!S.control?.hide&&!S.area?.hide?S.value:H).filter(Boolean).join("");i&&(p=p.toLocaleLowerCase());const I=[],L=n?new RegExp(g):g;let{index:P,length:O}=vi(p,L);for(;P!==-1&&O!==0;){I.push({index:P,length:O});const S=vi(p,L,P+O);P=S.index,O=S.length}for(let S=0;S<I.length;S++){const{index:F,length:N}=I[S],V=lt();for(let Y=0;Y<N;Y++){const X=F+Y+(m?.startIndex||0);s.push({type:f,index:X,groupId:V,...m})}}}for(let g=0;g<a.length;g++){const f=a[g];if(f.type===fe.TABLE){const T=f.elementList[0];for(let m=0;m<T.trList.length;m++){const p=T.trList[m];for(let I=0;I<p.tdList.length;I++){const L=p.tdList[I],P={tableId:T.id,tableIndex:f.index,trIndex:m,tdIndex:I,tdId:L.id};h(r,f.type,L.value,P)}}}else h(r,f.type,f.elementList,{startIndex:f.index})}return s}compute(t){const e=this.searchOptions?.isLimitSelection&&!this.range.getIsCollapsed(),n=e?this.range.getSelectionElementList():this.draw.getOriginalElementList();if(!n?.length||(this.searchMatchList=this.getMatchList(t,n),!e||!this.searchMatchList.length))return;const{startIndex:i}=this.range.getRange(),r=i+1;for(const s of this.searchMatchList)s.type===fe.TABLE?s.tableIndex+=r:s.index+=r}render(t,e){if(!this.searchMatchList||!this.searchMatchList.length||!this.searchKeyword)return;const{searchMatchAlpha:n,searchMatchColor:i,searchNavigateMatchColor:r}=this.options,s=this.position.getOriginalPositionList(),a=this.draw.getOriginalElementList();t.save(),t.globalAlpha=n;for(let c=0;c<this.searchMatchList.length;c++){const d=this.searchMatchList[c];let R=null;if(d.type===fe.TABLE){const{tableIndex:P,trIndex:O,tdIndex:S,index:F}=d;R=a[P]?.trList[O].tdList[S]?.positionList[F]}else R=s[d.index];if(!R)continue;const{coordinate:{leftTop:u,leftBottom:h,rightTop:g},pageNo:f}=R;if(f!==e)continue;if(this.getSearchNavigateIndexList().includes(c)){t.fillStyle=r;const P=this.searchMatchList[c-1];(!P||P.groupId!==d.groupId)&&this.searchNavigateScrollIntoView(R)}else t.fillStyle=i;const m=u[0],p=u[1],I=g[0]-u[0],L=h[1]-u[1];t.fillRect(m,p,I,L)}t.restore()}replace(t,e){if(this.draw.isReadonly()||t==null)return;let i=this.getSearchMatchList();const r=e?.index;if(So(r)){const T=[];i.forEach(m=>{const p=T[T.length-1];!p||p[0].groupId!==m.groupId?T.push([m]):p.push(m)}),i=T[r]}if(!i?.length)return;const s=this.draw.isDesignMode();let a=0,c=0,d="",R="",u=-1;const h=this.draw.getOriginalElementList();for(let T=0;T<i.length;T++){const m=i[T];if(m.type===fe.TABLE){const{tableIndex:p,trIndex:I,tdIndex:L,index:P,tdId:O}=m;R&&O!==R&&(c=0),R=O;const S=p+a,F=h[S].trList[I].tdList[L].value,N=P+c,V=F[N];if(!s&&(V?.control?.deletable===!1||V?.title?.deletable===!1))continue;if(t===""){this.draw.spliceElementList(F,N,1),c--,~u||(u=T);continue}if(d===m.groupId){this.draw.spliceElementList(F,N,1),c--;continue}~u||(u=T);for(let Y=0;Y<t.length;Y++){const X=t[Y];Y===0?V.value=X:(this.draw.spliceElementList(F,N+Y,0,[{...V,value:X}]),c++)}}else{const p=m.index+a,I=h[p];if(!s&&(I?.control?.deletable===!1||I?.title?.deletable===!1)||I.type===l.ElementType.CONTROL&&I.controlComponent!==l.ControlComponent.VALUE)continue;if(t===""){this.draw.spliceElementList(h,p,1),a--,~u||(u=T);continue}if(~u||(u=T),d===m.groupId){this.draw.spliceElementList(h,p,1),a--;continue}for(let L=0;L<t.length;L++){const P=t[L];L===0?I.value=P:(this.draw.spliceElementList(h,p+L,0,[{...I,value:P}]),a++)}}d=m.groupId}if(!~u)return;const g=i[u],f=g.index+(t.length-1);if(g.type===fe.TABLE){const{tableIndex:T,trIndex:m,tdIndex:p,index:I}=g,L=h[T].trList[m].tdList[p].value[I];this.position.setPositionContext({isTable:!0,index:T,trIndex:m,tdIndex:p,tdId:L.tdId,trId:L.trId,tableId:L.tableId})}else this.position.setPositionContext({isTable:!1});this.draw.getRange().setRange(f,f),this.draw.render({curIndex:f})}}class qa extends ko{options;constructor(t){super(),this.options=t.getOptions()}render(t){if(!this.fillRect.width)return;const{scale:e,strikeoutColor:n}=this.options,{x:i,y:r,width:s}=this.fillRect;t.save(),t.lineWidth=e,t.strokeStyle=n;const a=r-3;t.beginPath(),t.moveTo(i,a),t.lineTo(i+s,a),t.stroke(),t.beginPath(),t.moveTo(i,r+3.5),t.lineTo(i+s,r+3.5),t.stroke(),t.restore(),this.clearFillInfo()}}l.TextDecorationStyle=void 0,(function(o){o.SOLID="solid",o.DOUBLE="double",o.DASHED="dashed",o.DOTTED="dotted",o.WAVY="wavy"})(l.TextDecorationStyle||(l.TextDecorationStyle={}));var ln;(function(o){o.SOLID="solid",o.DASHED="dashed",o.DOTTED="dotted"})(ln||(ln={}));class tc extends ko{options;constructor(t){super(),this.options=t.getOptions()}_drawLine(t,e,n,i,r){const s=e+i;switch(t.beginPath(),r){case ln.DASHED:t.setLineDash([3,1]);break;case ln.DOTTED:t.setLineDash([1,1]);break}t.moveTo(e,n),t.lineTo(s,n),t.stroke()}_drawDouble(t,e,n,i){const s=e+i,a=n+3*this.options.scale;this.options.mode===l.EditorMode.PRINT?t.strokeStyle="transparent":t.strokeStyle="red",t.beginPath(),t.moveTo(e,n),t.lineTo(s,n),t.stroke(),t.beginPath(),t.moveTo(e,a),t.lineTo(s,a),t.stroke()}_drawWave(t,e,n,i){const{scale:r}=this.options,s=1.2*r,a=1/r,c=n+2*s;t.beginPath();for(let d=0;d<i;d++){const R=s*Math.sin(a*d);t.lineTo(e+d,c+R)}t.stroke()}render(t){if(!this.fillRect.width)return;const{underlineColor:e,scale:n}=this.options,{x:i,y:r,width:s}=this.fillRect;t.save(),t.strokeStyle=this.fillColor||e,t.lineWidth=n;const a=Math.floor(r+2*t.lineWidth)+.5;switch(this.fillDecorationStyle){case l.TextDecorationStyle.WAVY:this._drawWave(t,i,a,s);break;case l.TextDecorationStyle.DOUBLE:this._drawDouble(t,i,a,s);break;case l.TextDecorationStyle.DASHED:this._drawLine(t,i,a,s,ln.DASHED);break;case l.TextDecorationStyle.DOTTED:this._drawLine(t,i,a,s,ln.DOTTED);break;default:this._drawLine(t,i,a,s);break}t.restore(),this.clearFillInfo()}}class ec{draw;options;ctx;curX;curY;text;curStyle;curColor;cacheMeasureText;constructor(t){this.draw=t,this.options=t.getOptions(),this.ctx=t.getCtx(),this.curX=-1,this.curY=-1,this.text="",this.curStyle="",this.cacheMeasureText=new Map}measureBasisWord(t,e){t.save(),t.font=e;const n=this.measureText(t,{value:wr});return t.restore(),n}measureWord(t,e,n){const i=this.draw.getLetterReg();let r=0,s=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==l.ElementType.TEXT||!i.test(c.value)){s=c;break}r+=this.measureText(t,c).width,a++}return{width:r,endElement:s}}buttonMeasureWord(t,e,n){const i=this.draw.getLetterReg();let r=0,s=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==l.ElementType.TEXT||!i.test(c.value)){s=c;break}r+=this.measureText(t,c).width,a++}return{width:r,endElement:s}}measurePunctuationWidth(t,e){return!e||!Ur.includes(e.value)?0:(t.font=this.draw.getElementFont(e),this.measureText(t,e).width)}measureText(t,e){if(e.width){const s=t.measureText(e.value);return{width:e.width,actualBoundingBoxAscent:s.actualBoundingBoxAscent,actualBoundingBoxDescent:s.actualBoundingBoxDescent,actualBoundingBoxLeft:s.actualBoundingBoxLeft,actualBoundingBoxRight:s.actualBoundingBoxRight,fontBoundingBoxAscent:s.fontBoundingBoxAscent,fontBoundingBoxDescent:s.fontBoundingBoxDescent}}const n=`${e.value}${t.font}`,i=this.cacheMeasureText.get(n);if(i)return i;const r=t.measureText(e.value);return this.cacheMeasureText.set(n,r),r}getBasisWordBoundingBoxAscent(t,e){return this.measureBasisWord(t,e).actualBoundingBoxAscent}complete(){this._render(),this.text=""}record(t,e,n,i){if(this.ctx=t,this.options.renderMode===l.RenderMode.COMPATIBILITY){this._setCurXY(n,i),this.text=e.value,this.curStyle=e.style,this.curColor=e.color,this.complete();return}this.text||this._setCurXY(n,i),(this.curStyle&&e.style!==this.curStyle||e.color!==this.curColor)&&(this.complete(),this._setCurXY(n,i)),this.text+=e.value,this.curStyle=e.style,this.curColor=e.color}_setCurXY(t,e){this.curX=t,this.curY=e}_render(){!this.text||!~this.curX||!~this.curX||(this.ctx.save(),this.ctx.font=this.curStyle,this.ctx.fillStyle=this.curColor||this.options.defaultColor,this.ctx.fillText(this.text,this.curX,this.curY),this.ctx.restore())}}class an{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}static formatNumberPlaceholder(t,e,n,i){const r=i===l.NumberType.CHINESE?Br(e):`${e}`;return t.replace(n,r)}render(t,e){const{scale:n,pageNumber:{size:i,font:r,color:s,rowFlex:a,numberType:c,format:d,startPageNo:R,fromPageNo:u}}=this.options;if(e<u)return;let h=d;const g=new RegExp(Pn.PAGE_NO);g.test(h)&&(h=an.formatNumberPlaceholder(h,e+R-u,g,c));const f=new RegExp(Pn.PAGE_COUNT);f.test(h)&&(h=an.formatNumberPlaceholder(h,this.draw.getPageCount()-u,f,c));const T=this.draw.getWidth(),m=this.draw.getHeight(),p=this.draw.getPageNumberBottom(),I=m-p;t.save(),t.fillStyle=s,t.font=`${i*n}px ${r}`;let L=0;const P=this.draw.getMargins(),{width:O}=t.measureText(h);a===l.RowFlex.CENTER?L=(T-O)/2:a===l.RowFlex.RIGHT?L=T-O-P[1]:L=P[3],t.fillText(h,L,I),t.restore()}}class nc{draw;options;scrollContainer;constructor(t){this.draw=t,this.options=t.getOptions(),this.scrollContainer=this.getScrollContainer(),setTimeout(()=>{window.scrollY||this._observer()}),this._addEvent()}getScrollContainer(){return this.options.scrollContainerSelector&&document.querySelector(this.options.scrollContainerSelector)||document}_addEvent(){this.scrollContainer.addEventListener("scroll",this._observer)}removeEvent(){this.scrollContainer.removeEventListener("scroll",this._observer)}getElementVisibleInfo(t){const e=t.getBoundingClientRect(),n=this.scrollContainer===document?Math.max(document.documentElement.clientHeight,window.innerHeight):this.scrollContainer.clientHeight,i=Math.min(e.bottom,n)-Math.max(e.top,0);return{intersectionHeight:i>0?i:0}}getPageVisibleInfo(){const t=this.draw.getPageList(),e=[];let n=0,i=0;for(let r=0;r<t.length;r++){const s=t[r],{intersectionHeight:a}=this.getElementVisibleInfo(s);if(i&&!a)break;a&&e.push(r),a>i&&(i=a,n=r)}return{intersectionPageNo:n,visiblePageNoList:e}}_observer=xr(()=>{const{intersectionPageNo:t,visiblePageNoList:e}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(t),this.draw.setVisiblePageNoList(e)},150)}class oc{draw;step=5;thresholdPoints=[70,40,10,20];selectionContainer;rangeManager;requestAnimationFrameId;isMousedown;isMoving;clientWidth;clientHeight;containerRect;constructor(t){this.draw=t,this.rangeManager=t.getRange();const{scrollContainerSelector:e}=t.getOptions();this.selectionContainer=e&&document.querySelector(e)||document,this.requestAnimationFrameId=null,this.isMousedown=!1,this.isMoving=!1,this.clientWidth=0,this.clientHeight=0,this.containerRect=null,this._addEvent()}_addEvent(){const t=this.selectionContainer;t.addEventListener("mousedown",this._mousedown),t.addEventListener("mousemove",this._mousemove),t.addEventListener("mouseup",this._mouseup),document.addEventListener("mouseleave",this._mouseup)}removeEvent(){const t=this.selectionContainer;t.removeEventListener("mousedown",this._mousedown),t.removeEventListener("mousemove",this._mousemove),t.removeEventListener("mouseup",this._mouseup),document.removeEventListener("mouseleave",this._mouseup)}_mousedown=t=>{if(this.draw.isInteractionSuspended()){this._mouseup();return}if(!this.draw.isTargetInsideEditor(t.target)){this._mouseup();return}if(this.isMousedown=!0,this.clientWidth=this.selectionContainer instanceof Document?document.documentElement.clientWidth:this.selectionContainer.clientWidth,this.clientHeight=this.selectionContainer instanceof Document?document.documentElement.clientHeight:this.selectionContainer.clientHeight,!(this.selectionContainer instanceof Document)){const e=this.selectionContainer.getBoundingClientRect();this.containerRect=e}};_mouseup=()=>{this.isMousedown=!1,this._stopMove()};_mousemove=t=>{if(this.draw.isInteractionSuspended()||!this.isMousedown||this.rangeManager.getIsCollapsed())return;let{x:e,y:n}=t;this.containerRect&&(e=e-this.containerRect.x,n=n-this.containerRect.y),n<this.thresholdPoints[0]?this._startMove(Zt.UP):this.clientHeight-n<=this.thresholdPoints[1]?this._startMove(Zt.DOWN):e<this.thresholdPoints[2]?this._startMove(Zt.LEFT):this.clientWidth-e<this.thresholdPoints[3]?this._startMove(Zt.RIGHT):this._stopMove()};_move(t){const e=this.selectionContainer instanceof Document?window:this.selectionContainer,n=this.selectionContainer instanceof Document?window.scrollX:e.scrollLeft,i=this.selectionContainer instanceof Document?window.scrollY:e.scrollTop;t===Zt.DOWN?e.scrollTo(n,i+this.step):t===Zt.UP?e.scrollTo(n,i-this.step):t===Zt.LEFT?e.scrollTo(n-this.step,i):e.scrollTo(n+this.step,i),this.requestAnimationFrameId=window.requestAnimationFrame(this._move.bind(this,t))}_startMove(t){this.isMoving||(this.isMoving=!0,this._move(t))}_stopMove(){this.requestAnimationFrameId&&(window.cancelAnimationFrame(this.requestAnimationFrameId),this.requestAnimationFrameId=null,this.isMoving=!1)}}class ic{draw;range;options;constructor(t){this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}getTrListGroupByCol(t){const e=at(t);for(let n=0;n<t.length;n++){const i=e[n];for(let r=i.tdList.length-1;r>=0;r--){const s=i.tdList[r],{rowspan:a,rowIndex:c,colIndex:d}=s,R=c+a-1;if(R!==r){const u=i.tdList.splice(r,1)[0];e[R]?.tdList.splice(d,0,u)}}}return e}getRangeRowCol(){const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.draw.getPosition().getPositionContext();if(!t)return null;const{isCrossRowCol:r,startTdIndex:s,endTdIndex:a,startTrIndex:c,endTrIndex:d}=this.range.getRange(),h=this.draw.getOriginalElementList()[e].trList;if(!r)return[[h[n].tdList[i]]];let g=h[c].tdList[s],f=h[d].tdList[a];(g.x>f.x||g.y>f.y)&&([g,f]=[f,g]);const T=g.colIndex,m=f.colIndex+(f.colspan-1),p=g.rowIndex,I=f.rowIndex+(f.rowspan-1),L=[];for(let P=0;P<h.length;P++){const O=h[P],S=[];for(let F=0;F<O.tdList.length;F++){const N=O.tdList[F],V=N.colIndex,Y=N.rowIndex;V>=T&&V<=m&&Y>=p&&Y<=I&&S.push(N)}S.length&&L.push(S)}return L.length?L:null}_drawOuterBorder(t){const{ctx:e,startX:n,startY:i,width:r,height:s,isDrawFullBorder:a,borderExternalWidth:c}=t,{scale:d}=this.options,R=e.lineWidth;c&&(e.lineWidth=c*d),e.beginPath();const u=Math.round(n),h=Math.round(i);e.translate(.5,.5),a?e.rect(u,h,r,s):(e.moveTo(u,h+s),e.lineTo(u,h),e.lineTo(u+r,h)),e.stroke(),c&&(e.lineWidth=R),e.translate(-.5,-.5)}_drawSlash(t,e,n,i){const{scale:r}=this.options;t.save();const s=e.width*r,a=e.height*r,c=Math.round(e.x*r+n),d=Math.round(e.y*r+i);e.slashTypes?.includes(l.TdSlash.FORWARD)&&(t.moveTo(c+s,d),t.lineTo(c,d+a)),e.slashTypes?.includes(l.TdSlash.BACK)&&(t.moveTo(c,d),t.lineTo(c+s,d+a)),t.stroke(),t.restore()}_drawBorder(t,e,n,i){const{colgroup:r,trList:s,borderType:a,borderColor:c,borderWidth:d=1,borderExternalWidth:R}=e;if(!r||!s)return;const{scale:u,table:{defaultBorderColor:h}}=this.options,g=e.width*u,f=e.height*u,T=a===l.TableBorder.EMPTY,m=a===l.TableBorder.EXTERNAL,p=a===l.TableBorder.INTERNAL;t.save(),a===l.TableBorder.DASH&&t.setLineDash([3,3]),t.lineWidth=d*u,t.strokeStyle=c||h,!T&&!p&&this._drawOuterBorder({ctx:t,startX:n,startY:i,width:g,height:f,borderExternalWidth:R,isDrawFullBorder:m});for(let I=0;I<s.length;I++){const L=s[I];for(let P=0;P<L.tdList.length;P++){const O=L.tdList[P];if(O.slashTypes?.length&&this._drawSlash(t,O,n,i),!O.borderTypes?.length&&(T||m))continue;const S=O.width*u,F=O.height*u,N=Math.round(O.x*u+n+S),V=Math.round(O.y*u+i);if(t.translate(.5,.5),t.beginPath(),O.borderTypes?.includes(l.TdBorder.TOP)&&(t.moveTo(N-S,V),t.lineTo(N,V),t.stroke()),O.borderTypes?.includes(l.TdBorder.RIGHT)&&(t.moveTo(N,V),t.lineTo(N,V+F),t.stroke()),O.borderTypes?.includes(l.TdBorder.BOTTOM)&&(t.moveTo(N,V+F),t.lineTo(N-S,V+F),t.stroke()),O.borderTypes?.includes(l.TdBorder.LEFT)&&(t.moveTo(N-S,V),t.lineTo(N-S,V+F),t.stroke()),!T&&!m){if((!p||O.colIndex+O.colspan<r.length)&&(t.moveTo(N,V),t.lineTo(N,V+F),R&&R!==d&&O.colIndex+O.colspan===r.length)){const Y=t.lineWidth;t.lineWidth=R*u,t.stroke(),t.beginPath(),t.lineWidth=Y}if(!p||O.rowIndex+O.rowspan<s.length){const Y=R&&R!==d&&O.rowIndex+O.rowspan===s.length;if(Y&&(t.stroke(),t.beginPath()),t.moveTo(N,V+F),t.lineTo(N-S,V+F),Y){const X=t.lineWidth;t.lineWidth=R*u,t.stroke(),t.beginPath(),t.lineWidth=X}}t.stroke()}t.translate(-.5,-.5)}}t.restore()}_drawBackgroundColor(t,e,n,i){const{trList:r}=e;if(!r)return;const{scale:s}=this.options;for(let a=0;a<r.length;a++){const c=r[a];for(let d=0;d<c.tdList.length;d++){const R=c.tdList[d];if(!R.backgroundColor)continue;t.save();const u=R.width*s,h=R.height*s,g=Math.round(R.x*s+n),f=Math.round(R.y*s+i);t.fillStyle=R.backgroundColor,t.fillRect(g,f,u,h),t.restore()}}}getTableWidth(t){return t.colgroup.reduce((e,n)=>e+n.width,0)}getTableHeight(t){const e=t.trList;return e?.length?this.getTdListByColIndex(e,0).reduce((n,i)=>n+i.height,0):0}getRowCountByColIndex(t,e){return this.getTdListByColIndex(t,e).reduce((n,i)=>n+i.rowspan,0)}getTdListByColIndex(t,e){const n=[];for(let i=0;i<t.length;i++){const r=t[i].tdList;for(let s=0;s<r.length;s++){const a=r[s],c=a.colIndex,d=c+a.colspan-1;e>=c&&e<=d&&n.push(a)}}return n}getTdListByRowIndex(t,e){const n=[];for(let i=0;i<t.length;i++){const r=t[i].tdList;for(let s=0;s<r.length;s++){const a=r[s],c=a.rowIndex,d=c+a.rowspan-1;e>=c&&e<=d&&n.push(a)}}return n}computeRowColInfo(t){const{colgroup:e,trList:n}=t;if(!e||!n)return;let i=0;for(let r=0;r<n.length;r++){const s=n[r],a=n.length-1===r;for(let c=0;c<s.tdList.length;c++){const d=s.tdList[c];let R=0;if(n.length>1&&r!==0){const p=s.tdList[c-1],I=p?p.colIndex+p.colspan:c;for(let L=I;L<e.length;L++)if(this.getRowCountByColIndex(n.slice(0,r),L)===r){R=L;let O=0;for(let S=0;S<L;S++)O+=e[S].width;i=O;break}}else{const p=s.tdList[c-1];p&&(R=p.colIndex+p.colspan)}let u=0;for(let p=0;p<d.colspan;p++)u+=e[p+R].width;let h=0;for(let p=0;p<d.rowspan;p++){const I=n[p+r]||n[r];h+=I.height}const g=s.tdList.length-1===c;let f=a;if(!f&&d.rowspan>1){const p=n.length-1-r;f=d.rowspan-1===p}const T=a&&g;d.isLastRowTd=g,d.isLastColTd=f,d.isLastTd=T,d.x=i;let m=0;for(let p=0;p<r;p++){const I=n[p].tdList;for(let L=0;L<I.length;L++){const P=I[L];if(R>=P.colIndex&&R<P.colIndex+P.colspan){m+=P.height;break}}}d.y=m,d.width=u,d.height=h,d.rowIndex=r,d.colIndex=R,d.trIndex=r,d.tdIndex=c,i+=u,g&&!T&&(i=0)}}}drawRange(t,e,n,i){const{scale:r,rangeAlpha:s,rangeColor:a}=this.options,{type:c,trList:d}=e;if(!d||c!==l.ElementType.TABLE)return;const{isCrossRowCol:R,startTdIndex:u,endTdIndex:h,startTrIndex:g,endTrIndex:f}=this.range.getRange();if(!R)return;let T=d[g].tdList[u],m=d[f].tdList[h];(T.x>m.x||T.y>m.y)&&([T,m]=[m,T]);const p=T.colIndex,I=m.colIndex+(m.colspan-1),L=T.rowIndex,P=m.rowIndex+(m.rowspan-1);t.save();for(let O=0;O<d.length;O++){const S=d[O];for(let F=0;F<S.tdList.length;F++){const N=S.tdList[F],V=N.colIndex,Y=N.rowIndex;if(V>=p&&V<=I&&Y>=L&&Y<=P){const X=N.x*r,W=N.y*r,E=N.width*r,C=N.height*r;t.globalAlpha=s,t.fillStyle=a,t.fillRect(X+n,W+i,E,C)}}}t.restore()}render(t,e,n,i){this._drawBackgroundColor(t,e,n,i),this._drawBorder(t,e,n,i)}findPreRowSpanTd(t,e,n){for(let i=e;i>=0;i--){const r=t[i].tdList.find(s=>s.colIndex===n);if(r)return r}}computeTrHeight(t,e){const{scale:n,table:{tdPadding:i,defaultTrMinHeight:r}}=this.options,s=t.tdPadding||i,a=s[0]+s[2],c=t.trList;for(let u=0;u<c.length;u++){const h=c[u];h.height=h.minHeight||r,h.minHeight=h.height}this.computeRowColInfo(t);const d={},R={};for(let u=0;u<c.length;u++){const h=c[u];if(!h.tdList.length){h.height=0;continue}const g=[],f=[];for(let m=0;m<t.colgroup.length;m++){const p=h.tdList.find(I=>I.colIndex===m);if(p){const I=e?e(p):p.rowList,L=I.reduce((O,S)=>O+S.height,0);p.rowList=I;const P=L/n+a;p.mainHeight=P,p.rowspan>1?(R[p.colIndex]=p.id,d[p.id]={td:p,rowSpan:[u,u+p.rowspan-1],preHeight:0,preMinHeight:0,extraHeight:P},f.push(P)):p.height<P?(p.height=P,p.realHeight=P,g.push(P)):g.push(p.height)}else{const I=d[R[m]];I?.rowSpan[1]==u&&g.push(I.extraHeight)}}const T=Math.max(...g.length?g:f);Object.values(d).forEach(m=>{m.rowSpan[0]<=u&&m.rowSpan[1]>=u&&(m.extraHeight-=T,m.preHeight+=T,m.preMinHeight+=h.minHeight)}),h.height=T;for(let m=0;m<t.colgroup.length;m++){const p=h.tdList.find(I=>I.colIndex===m)??this.findPreRowSpanTd(c,u,m);if(p){const I=d[p.id]?.preHeight??0,L=d[p.id]?.preMinHeight??h.minHeight;p.height=T+I,p.realHeight=T+I,p.realMinHeight=L}}}this.computeRowColInfo(t)}}var me;(function(o){o.ROW="row",o.COL="col"})(me||(me={}));class sc{MIN_TD_WIDTH=20;ROW_COL_OFFSET=18;ROW_COL_QUICK_WIDTH=16;ROW_COL_QUICK_OFFSET=5;ROW_COL_QUICK_POSITION=this.ROW_COL_OFFSET+(this.ROW_COL_OFFSET-this.ROW_COL_QUICK_WIDTH)/2;BORDER_VALUE=4;TABLE_SELECT_OFFSET=20;draw;canvas;options;position;range;container;toolRowContainer;toolRowAddBtn;toolColAddBtn;toolTableSelectBtn;toolColContainer;toolBorderContainer;anchorLine;mousedownX;mousedownY;constructor(t){this.draw=t,this.canvas=t.getPage(),this.options=t.getOptions(),this.position=t.getPosition(),this.range=t.getRange(),this.container=t.getContainer(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null,this.anchorLine=null,this.mousedownX=0,this.mousedownY=0}dispose(){this.toolRowContainer?.remove(),this.toolRowAddBtn?.remove(),this.toolColAddBtn?.remove(),this.toolTableSelectBtn?.remove(),this.toolColContainer?.remove(),this.toolBorderContainer?.remove(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null}render(){if(this.draw.getMode()===l.EditorMode.FORM){this.dispose();return}const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.position.getPositionContext();if(!t)return;this.dispose();const r=this.draw.getOriginalElementList(),s=this.position.getOriginalPositionList(),a=r[e];if(a.tableToolDisabled&&!this.draw.isDesignMode())return;const{scale:c,table:{overflow:d}}=this.options,R=s[e],{colgroup:u,trList:h}=a,{coordinate:{leftTop:g}}=R,f=this.draw.getHeight(),T=this.draw.getPageGap(),m=this.draw.getPageNo()*(f+T),p=g[0],I=g[1]+m,L=a.trList[n].tdList[i],P=L.rowIndex,O=L.colIndex,S=a.height*c,F=a.width*c,N=document.createElement("div");N.classList.add(`${z}-table-tool__select`),N.style.height=`${S*c}`,N.style.left=`${p}px`,N.style.top=`${I}px`,N.style.transform=`translate(-${this.TABLE_SELECT_OFFSET*c}px, ${-this.TABLE_SELECT_OFFSET*c}px)`,N.onclick=()=>{this.draw.getTableOperate().tableSelectAll()},this.container.append(N),this.toolTableSelectBtn=N;const V=h.map(y=>y.height),Y=document.createElement("div");Y.classList.add(`${z}-table-tool__row`),Y.style.transform=`translateX(-${this.ROW_COL_OFFSET*c}px)`;for(let y=0;y<V.length;y++){const b=V[y]*c,D=document.createElement("div");D.classList.add(`${z}-table-tool__row__item`),y===P&&D.classList.add("active"),D.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByRowIndex(h,y),G=Q[0],_=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:G.trIndex,tdIndex:G.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,G.tdIndex,_.tdIndex,G.trIndex,_.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(Y,y)};const U=document.createElement("div");U.classList.add(`${z}-table-tool__anchor`),U.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:y,order:me.ROW})},D.append(U),D.style.height=`${b}px`,Y.append(D)}Y.style.left=`${p}px`,Y.style.top=`${I}px`,this.container.append(Y),this.toolRowContainer=Y;const X=document.createElement("div");X.classList.add(`${z}-table-tool__quick__add`),X.style.height=`${S*c}`,X.style.left=`${p}px`,X.style.top=`${I+S}px`,X.style.transform=`translate(-${this.ROW_COL_QUICK_POSITION*c}px, ${this.ROW_COL_QUICK_OFFSET*c}px)`,X.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:h.length-1,tdIndex:0,tableId:a.id}),this.draw.getTableOperate().insertTableBottomRow()},this.container.append(X),this.toolRowAddBtn=X;const W=u.map(y=>y.width),E=document.createElement("div");E.classList.add(`${z}-table-tool__col`),E.style.transform=`translateY(-${this.ROW_COL_OFFSET*c}px)`;for(let y=0;y<W.length;y++){const b=W[y]*c,D=document.createElement("div");D.classList.add(`${z}-table-tool__col__item`),y===O&&D.classList.add("active"),D.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByColIndex(h,y),G=Q[0],_=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:G.trIndex,tdIndex:G.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,G.tdIndex,_.tdIndex,G.trIndex,_.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(E,y)};const U=document.createElement("div");U.classList.add(`${z}-table-tool__anchor`),U.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:y,order:me.COL})},D.append(U),D.style.width=`${b}px`,E.append(D)}E.style.left=`${p}px`,E.style.top=`${I}px`,this.container.append(E),this.toolColContainer=E;const C=document.createElement("div");C.classList.add(`${z}-table-tool__quick__add`),C.style.height=`${S*c}`,C.style.left=`${p+F}px`,C.style.top=`${I}px`,C.style.transform=`translate(${this.ROW_COL_QUICK_OFFSET*c}px, -${this.ROW_COL_QUICK_POSITION*c}px)`,C.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:0,tdIndex:h[0].tdList.length-1||0,tableId:a.id}),this.draw.getTableOperate().insertTableRightCol()},this.container.append(C),this.toolColAddBtn=C;const M=document.createElement("div");M.classList.add(`${z}-table-tool__border`),M.style.height=`${S}px`,M.style.width=`${F}px`,M.style.left=`${p}px`,M.style.top=`${I}px`;for(let y=0;y<h.length;y++){const b=h[y];for(let D=0;D<b.tdList.length;D++){const U=b.tdList[D],Q=document.createElement("div");Q.classList.add(`${z}-table-tool__border__row`),Q.style.width=`${U.width*c}px`,Q.style.height=`${this.BORDER_VALUE}px`,Q.style.top=`${(U.y+U.height)*c-this.BORDER_VALUE/2}px`,Q.style.left=`${U.x*c}px`,Q.onmousedown=_=>{this._mousedown({evt:_,element:a,index:U.rowIndex+U.rowspan-1,order:me.ROW})},M.appendChild(Q);const G=document.createElement("div");if(G.classList.add(`${z}-table-tool__border__col`),G.style.width=`${this.BORDER_VALUE}px`,G.style.height=`${U.height*c}px`,G.style.top=`${U.y*c}px`,G.style.left=`${(U.x+U.width)*c-this.BORDER_VALUE/2}px`,G.onmousedown=_=>{this._mousedown({evt:_,element:a,index:U.colIndex+U.colspan-1,order:me.COL})},M.appendChild(G),d&&U.colIndex===0){const _=document.createElement("div");_.classList.add(`${z}-table-tool__border__col`),_.style.width=`${this.BORDER_VALUE}px`,_.style.height=`${U.height*c}px`,_.style.top=`${U.y*c}px`,_.style.left=`${U.x*c-this.BORDER_VALUE/2}px`,_.onmousedown=j=>{this._mousedown({evt:j,element:a,index:0,isLeftStartBorder:!0,order:me.COL})},M.appendChild(_)}}}this.container.append(M),this.toolBorderContainer=M}_setAnchorActive(t,e){const n=t.children;for(let i=0;i<n.length;i++){const r=n[i];i===e?r.classList.add("active"):r.classList.remove("active")}}_mousedown(t){const{evt:e,index:n,order:i,element:r,isLeftStartBorder:s}=t;this.canvas=this.draw.getPage();const{scale:a,table:{overflow:c}}=this.options,d=this.draw.getWidth(),R=this.draw.getHeight(),u=this.draw.getPageGap(),h=this.draw.getPageNo()*(R+u),g=this.position.getPositionContext(),m=(this.position.getOriginalPositionList()[g.index]?.coordinate?.leftTop?.[0]||0)*a,p=this.draw.getMargins(),I=p[0],L=p[1],P=I,O=d-L;this.mousedownX=e.x,this.mousedownY=e.y;const S=e.target,F=this.canvas.getBoundingClientRect(),N=window.getComputedStyle(S).cursor;document.body.style.cursor=N,this.canvas.style.cursor=N;let V=0,Y=0;const X=document.createElement("div");X.classList.add(`${z}-table-anchor__line`),i===me.ROW?(X.classList.add(`${z}-table-anchor__line__row`),X.style.width=`${d}px`,V=0,Y=h+this.mousedownY-F.top):(X.classList.add(`${z}-table-anchor__line__col`),X.style.height=`${R}px`,V=this.mousedownX-F.left,Y=h),X.style.left=`${V}px`,X.style.top=`${Y}px`,this.container.append(X),this.anchorLine=X;let W=0,E=0;const C=M=>{const y=this._mousemove(M,i,V,Y);y&&(W=y.dx,E=y.dy)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",()=>{let M=!1;if(i===me.ROW){const y=r.trList,b=y[n]||y[n-1],{defaultTrMinHeight:D}=this.options.table;E<0&&b.height+E<D&&(E=D-b.height),E&&(b.height+=E,b.minHeight=b.height,M=!0)}else{const{colgroup:y}=r;if(y&&W)if(c&&s){y[n].width-W/a<=this.MIN_TD_WIDTH&&(W=(y[n].width-this.MIN_TD_WIDTH)*a);const b=m+(r.translateX||0)*a;b+W<P&&(W=P-b),y[n].width-=W/a,r.width-=W/a,r.translateX=(r.translateX||0)+W/a,M=!0}else{const b=y[n].width;W<0&&b*a+W<this.MIN_TD_WIDTH*a&&(W=this.MIN_TD_WIDTH*a-b*a);const D=y[n+1]?.width;if(W>0&&D&&D*a-W<this.MIN_TD_WIDTH*a&&(W=D*a-this.MIN_TD_WIDTH*a),n===y.length-1){const Q=m+(r.translateX||0)*a+r.width*a;Q+W>O&&(W=O-Q)}W&&(y.length-1!==n&&(y[n+1].width-=W/a),y[n].width+=W/a,M=!0)}}M&&this.draw.render({isSetCursor:!1}),X.remove(),document.removeEventListener("mousemove",C),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),e.preventDefault()}_mousemove(t,e,n,i){if(!this.anchorLine)return null;const r=t.x-this.mousedownX,s=t.y-this.mousedownY;return e===me.ROW?this.anchorLine.style.top=`${i+s}px`:this.anchorLine.style.left=`${n+r}px`,t.preventDefault(),{dx:r,dy:s}}}class rc{draw;options;container;hyperlinkPopupContainer;hyperlinkDom;constructor(t){this.draw=t,this.options=t.getOptions(),this.container=t.getContainer();const{hyperlinkPopupContainer:e,hyperlinkDom:n}=this._createHyperlinkPopupDom();this.hyperlinkDom=n,this.hyperlinkPopupContainer=e}_createHyperlinkPopupDom(){const t=document.createElement("div");t.classList.add(`${z}-hyperlink-popup`);const e=document.createElement("a");return e.target="_blank",e.rel="noopener",t.append(e),this.container.append(t),{hyperlinkPopupContainer:t,hyperlinkDom:e}}drawHyperlinkPopup(t,e){const{coordinate:{leftTop:[n,i]},lineHeight:r}=e,s=this.draw.getHeight(),a=this.draw.getPageGap(),c=this.draw.getPageNo()*(s+a);this.hyperlinkPopupContainer.style.display="block",this.hyperlinkPopupContainer.style.left=`${n}px`,this.hyperlinkPopupContainer.style.top=`${i+c+r}px`;const d=t.url||"#";this.hyperlinkDom.href=d,this.hyperlinkDom.title=d,this.hyperlinkDom.innerText=d}clearHyperlinkPopup(){this.hyperlinkPopupContainer.style.display="none"}openHyperlink(t){const e=window.open(t.url,"_blank");e&&(e.opener=null)}render(t,e,n,i){t.save(),t.font=e.style,e.color||(e.color=this.options.defaultHyperlinkColor),t.fillStyle=e.color,e.underline===void 0&&(e.underline=!0),t.fillText(e.value,n,i),t.restore()}}class lc{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:r,label:{defaultBackgroundColor:s,defaultColor:a,defaultBorderRadius:c,defaultPadding:d}}=this.options,R=e.label?.backgroundColor||s,u=e.label?.color||a,h=e.label?.borderRadius||c,g=e.label?.padding||d;t.save(),t.font=e.style;const{width:f,height:T,boundingBoxAscent:m}=e.metrics;t.fillStyle=R,this._drawRoundedRect(t,n,i-m,f,T+(g[0]+g[3])*r,h*r),t.fill(),t.fillStyle=u,t.fillText(e.value,n+g[3]*r,i),t.restore()}_drawRoundedRect(t,e,n,i,r,s){t.beginPath(),t.moveTo(e+s,n),t.lineTo(e+i-s,n),t.quadraticCurveTo(e+i,n,e+i,n+s),t.lineTo(e+i,n+r-s),t.quadraticCurveTo(e+i,n+r,e+i-s,n+r),t.lineTo(e+s,n+r),t.quadraticCurveTo(e,n+r,e,n+r-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+s,n),t.closePath()}}class ac{options;draw;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e,n,i){const r=this.draw.getMode(),s=e.macroConfig;if(e.type==="subTemplate"&&console.log("MacroParticle.render - 子模板元素:",e.type,"当前模式:",r,"label:",e.label),r===l.EditorMode.EDIT){const c=e.label||e.value||"";this._renderEditMode(t,e,n,i,c);return}if(e.type==="macro"){const c=e.label||"",d=e.value||`获取 ${c}`;this._renderPlainText(t,e,n,i,d);return}if(e.type==="customMacro"){const c=s?.type||"text",d=s?.value||"",R=e.label||"";if(r===l.EditorMode.FORM)c==="select"?this._renderSelectControl(t,e,n,i,d):this._renderTextControl(t,e,n,i,d);else{const u=d||`获取 ${R}`;this._renderPlainText(t,e,n,i,u)}return}if(e.type==="reusableItem"){const d=e.reusableItemConfig?.value||"",R=e.label||"";if(r===l.EditorMode.FORM)this._renderTextControl(t,e,n,i,d);else{const u=d||`获取 ${R}`;this._renderPlainText(t,e,n,i,u)}return}if(e.type==="subTemplate"){const c=e.label||"子模板";r===l.EditorMode.FORM?e.subTemplateExpanded||this._renderSubTemplateTag(t,e,n,i,c):this._renderPlainText(t,e,n,i,c);return}const a=e.value||e.label||"";this._renderPlainText(t,e,n,i,a)}_renderPlainText(t,e,n,i,r){t.save(),t.font=e.style,t.fillStyle=e.color||"#000000",t.textBaseline="alphabetic",t.fillText(r,n,i),t.restore()}_renderSubTemplateTag(t,e,n,i,r){const{scale:s}=this.options,a="#722ed1",c="#f9f0ff";t.save(),t.font=e.style;const d=t.measureText(r),R=d.actualBoundingBoxAscent+d.actualBoundingBoxDescent,u=8*s,h=4*s,g=4*s,f=d.width+u*2,T=R+h*2,m=e.metrics,p=n,I=i-m.boundingBoxAscent+(m.boundingBoxAscent+m.boundingBoxDescent-T)/2;t.fillStyle=c,this._drawRoundedRect(t,p,I,f,T,g),t.fill(),t.strokeStyle=a,t.lineWidth=1*s,t.setLineDash([4*s,2*s]),this._drawRoundedRect(t,p,I,f,T,g),t.stroke(),t.fillStyle=a,t.textBaseline="middle",t.fillText(r,n+u,I+T/2),t.restore()}_renderEditMode(t,e,n,i,r){const{scale:s}=this.options,a=e.type==="customMacro",c=e.type==="reusableItem",d=e.type==="subTemplate";let R,u;d?(R="#722ed1",u="#f9f0ff"):c?(R="#52c41a",u="#f6ffed"):a?(R="#fa8c16",u="#fff7e6"):(R="#1677ff",u="#e6f4ff"),t.save(),t.font=e.style;const h=t.measureText(r),g=h.actualBoundingBoxAscent+h.actualBoundingBoxDescent,f=8*s,T=4*s,m=4*s,p=h.width+f*2,I=g+T*2,L=e.metrics,P=n,O=i-L.boundingBoxAscent+(L.boundingBoxAscent+L.boundingBoxDescent-I)/2;t.fillStyle=u,this._drawRoundedRect(t,P,O,p,I,m),t.fill(),t.fillStyle=R,t.textBaseline="middle",t.fillText(r,n+f,O+I/2),t.restore()}_renderTextControl(t,e,n,i,r){const{scale:s,control:a,strikeoutColor:c}=this.options,{placeholderColor:d,bracketColor:R}=a;t.save(),t.font=e.style;const h=`请输入${e.label||""}`,g=r||h,T=t.measureText(g).width;t.fillStyle=R,t.textBaseline="alphabetic",t.fillText("[",n,i);const m=n+t.measureText("[").width;t.fillStyle=r?e.color||"#000000":d,t.fillText(g,m,i);const p=m+T;if(t.fillStyle=R,t.fillText("]",p,i),e.type==="reusableItem"){const I=t.measureText("[").width+T+t.measureText("]").width;if(t.lineWidth=s,this.draw.getMode()===l.EditorMode.PRINT?t.strokeStyle="transparent":t.strokeStyle=c||"red",e.strikeout){const L=i-3*s,P=i+3.5*s;t.beginPath(),t.moveTo(n,L),t.lineTo(n+I,L),t.stroke(),t.beginPath(),t.moveTo(n,P),t.lineTo(n+I,P),t.stroke()}else if(e.underline&&e.textDecoration?.style==="double"){const L=Math.floor(i+2*s)+.5,P=3*s;t.beginPath(),t.moveTo(n,L),t.lineTo(n+I,L),t.stroke(),t.beginPath(),t.moveTo(n,L+P),t.lineTo(n+I,L+P),t.stroke()}}t.restore()}_renderSelectControl(t,e,n,i,r){const{scale:s,control:a}=this.options,{placeholderColor:c,bracketColor:d}=a;t.save(),t.font=e.style;const u=`请选择${e.label||""}`,h=r||u,g=t.measureText(h),f=g.actualBoundingBoxAscent+g.actualBoundingBoxDescent;t.fillStyle=d,t.textBaseline="alphabetic",t.fillText("[",n,i);const T=n+t.measureText("[").width;t.fillStyle=r?e.color||"#000000":c,t.fillText(h,T,i);const m=T+g.width+2*s,p=i-f/2;t.beginPath(),t.moveTo(m,p-2*s),t.lineTo(m+5*s,p-2*s),t.lineTo(m+2.5*s,p+2*s),t.closePath(),t.fillStyle="#666666",t.fill();const I=m+6*s;t.fillStyle=d,t.fillText("]",I,i),t.restore()}_drawRoundedRect(t,e,n,i,r,s){t.beginPath(),t.moveTo(e+s,n),t.lineTo(e+i-s,n),t.quadraticCurveTo(e+i,n,e+i,n+s),t.lineTo(e+i,n+r-s),t.quadraticCurveTo(e+i,n+r,e+i-s,n+r),t.lineTo(e+s,n+r),t.quadraticCurveTo(e,n+r,e,n+r-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+s,n),t.closePath()}}class cc{draw;position;zone;options;elementList;rowList;positionList;constructor(t,e){this.draw=t,this.position=t.getPosition(),this.zone=t.getZone(),this.options=t.getOptions(),this.elementList=e||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(t){this.elementList=t}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const t=this.draw.getInnerWidth(),e=this.draw.getMargins(),n=vo(this.elementList);this.rowList=this.draw.computeRowList({startX:e[3],startY:this.getHeaderTop(),innerWidth:t,elementList:this.elementList,surroundElementList:n})}_computePositionList(){const t=this.getHeaderTop(),e=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],r=t;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:r,innerWidth:e,zone:l.EditorZone.HEADER})}getHeaderTop(){const{header:{top:t,disabled:e},scale:n}=this.options;return e?0:Math.floor(t*n)}getMaxHeight(){const{header:{maxHeightRadio:t}}=this.options,e=this.draw.getHeight();return Math.floor(e*Vi[t])}getHeight(){if(this.options.header.disabled)return 0;const t=this.getMaxHeight(),e=this.getRowHeight();return e>t?t:e}getRowHeight(){return this.rowList.reduce((t,e)=>t+e.height,0)}getExtraHeight(){const t=this.draw.getMargins(),e=this.getHeight(),i=this.getHeaderTop()+e-t[0];return i<=0?0:i}render(t,e){t.save(),t.globalAlpha=this.zone.isHeaderActive()?1:this.options.header.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),r=[];let s=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(s+c.height>i)break;r.push(c),s+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:r,pageNo:e,startIndex:0,innerWidth:n,zone:l.EditorZone.HEADER}),t.restore()}}class dc{getOffsetY(t){return-t.metrics.height/2}render(t,e,n,i){t.save(),t.font=e.style,e.color&&(t.fillStyle=e.color),t.fillText(e.value,n,i+this.getOffsetY(e)),t.restore()}}class Rc{getOffsetY(t){return t.metrics.height/2}render(t,e,n,i){t.save(),t.font=e.style,e.color&&(t.fillStyle=e.color),t.fillText(e.value,n,i+this.getOffsetY(e)),t.restore()}}class uc{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){t.save();const{scale:r,separator:{lineWidth:s,strokeStyle:a}}=this.options;t.lineWidth=(e.lineWidth||s)*r,t.strokeStyle=e.color||a,e.dashArray?.length&&t.setLineDash(e.dashArray);const c=Math.round(i);t.translate(0,t.lineWidth/2),t.beginPath(),t.moveTo(n,c),t.lineTo(n+e.width*r,c),t.stroke(),t.restore()}}class hc{draw;options;i18n;constructor(t){this.draw=t,this.options=t.getOptions(),this.i18n=t.getI18n()}render(t,e,n,i){const{pageBreak:{font:r,fontSize:s,lineDash:a}}=this.options,c=this.i18n.t("pageBreak.displayName"),{scale:d,defaultRowMargin:R}=this.options,u=s*d,h=e.width*d,g=this.draw.getDefaultBasicRowMarginHeight()*R;t.save(),t.font=`${u}px ${r}`;const f=t.measureText(c),T=(h-f.width)/2;t.setLineDash(a),t.translate(0,.5+g),t.beginPath(),t.moveTo(n,i),t.lineTo(n+T,i),t.moveTo(n+T+f.width,i),t.lineTo(n+h,i),t.stroke(),t.fillText(c,n+T,i+f.actualBoundingBoxAscent-u/2),t.restore()}}class gc{draw;options;imageCache;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map}renderText(t,e){const{watermark:{data:n,opacity:i,font:r,size:s,color:a,repeat:c,gap:d,numberType:R},scale:u}=this.options,h=this.draw.getWidth(),g=this.draw.getHeight();t.save(),t.globalAlpha=i,t.font=`${s*u}px ${r}`;let f=n;const T=new RegExp(Pn.PAGE_NO);T.test(f)&&(f=an.formatNumberPlaceholder(f,e+1,T,R));const m=new RegExp(Pn.PAGE_COUNT);m.test(f)&&(f=an.formatNumberPlaceholder(f,this.draw.getPageCount(),m,R));const p=t.measureText(f);if(c){const I=this.draw.getPagePixelRatio(),L=document.createElement("canvas"),P=L.getContext("2d"),O=p.width,S=p.actualBoundingBoxAscent+p.actualBoundingBoxDescent,F=Math.sqrt(Math.pow(O,2)+Math.pow(S,2)),N=F+2*d[0]*u,V=F+2*d[1]*u;L.width=N,L.height=V,L.style.width=`${N*I}px`,L.style.height=`${V*I}px`,P.translate(N/2,V/2),P.rotate(-45*Math.PI/180),P.translate(-N/2,-V/2),P.font=`${s*u}px ${r}`,P.fillStyle=a,P.fillText(f,(N-O)/2,(V-S)/2+p.actualBoundingBoxAscent);const Y=t.createPattern(L,"repeat");Y&&(t.fillStyle=Y,t.fillRect(0,0,h,g))}else{const I=h/2,L=g/2;t.fillStyle=a,t.translate(I,L),t.rotate(-45*Math.PI/180),t.fillText(f,-p.width/2,p.actualBoundingBoxAscent-s*u/2)}t.restore()}renderImage(t){const{watermark:{width:e,height:n,data:i,opacity:r,repeat:s,gap:a},scale:c}=this.options;if(!this.imageCache.has(i)){const g=new Image;g.setAttribute("crossOrigin","Anonymous"),g.src=i,g.onload=()=>{this.imageCache.set(i,g),this.draw.render({isCompute:!1,isSubmitHistory:!1})};return}const d=this.draw.getWidth(),R=this.draw.getHeight(),u=e*c,h=n*c;if(t.save(),t.globalAlpha=r,s){const g=this.draw.getPagePixelRatio(),f=document.createElement("canvas"),T=f.getContext("2d"),m=Math.sqrt(Math.pow(u,2)+Math.pow(h,2)),p=m+2*a[0]*c,I=m+2*a[1]*c;f.width=p,f.height=I,f.style.width=`${p*g}px`,f.style.height=`${I*g}px`,T.translate(p/2,I/2),T.rotate(-45*Math.PI/180),T.translate(-p/2,-I/2),T.drawImage(this.imageCache.get(i),(p-u)/2,(I-h)/2,u,h);const L=t.createPattern(f,"repeat");L&&(t.fillStyle=L,t.fillRect(0,0,d,R))}else{const g=d/2,f=R/2;t.translate(g,f),t.rotate(-45*Math.PI/180),t.drawImage(this.imageCache.get(i),-u/2,-h/2,u,h)}t.restore()}render(t,e){this.options.watermark.type===l.WatermarkType.IMAGE?this.renderImage(t):this.renderText(t,e)}}class fc{draw;control;options;highlightList;highlightMatchResult;constructor(t){this.draw=t.getDraw(),this.control=t,this.options=this.draw.getOptions(),this.highlightList=[],this.highlightMatchResult=[]}getControlHighlight(t,e){const{control:{activeBackgroundColor:n,disabledBackgroundColor:i,existValueBackgroundColor:r,noValueBackgroundColor:s}}=this.options,a=t[e],c=this.draw.isPrintMode(),d=this.control.getActiveControl()?.getElement();let R=!1,u=!1,h=!1,g=!1;return a.highlight||(R=!c&&!!n&&!!d&&a.controlId===d.controlId&&!this.control.getIsRangeInPostfix()),R||(u=!c&&!!i&&!!a.control?.disabled),u||(h=!c&&!!r&&!!a.controlId&&this.control.getIsExistValueByElementListIndex(t,e)),h||(g=!c&&!!s&&!!a.controlId&&!this.control.getIsExistValueByElementListIndex(t,e)),(R?n:"")||(u?i:"")||(h?r:"")||(g?s:"")}getHighlightMatchResult(){return this.highlightMatchResult}getHighlightList(){return this.highlightList}setHighlightList(t){this.highlightList=t}computeHighlightList(){const t=this.draw.getSearch(),e=(n,i)=>{let r=0;for(;r<n.length;){const s=n[r];if(r++,s.type===l.ElementType.TABLE){const f=s.trList;for(let T=0;T<f.length;T++){const m=f[T];for(let p=0;p<m.tdList.length;p++){const I=m.tdList[p],L={tableId:s.id,tableIndex:r-1,trIndex:T,tdIndex:p,tdId:I.id};e(I.value,L)}}}const a=s?.control;if(!a)continue;const c=this.highlightList.findIndex(f=>f.id===s.controlId||a.conceptId&&a.conceptId===f.conceptId);if(!~c)continue;const d=r;let R=r;for(;R<n.length&&n[R].controlId===s.controlId;)R++;r=R;const u=n.slice(d,R).map(f=>f.controlComponent===l.ControlComponent.VALUE?f:{value:H}),h=this.highlightList[c],{ruleList:g}=h;for(let f=0;f<g.length;f++){const T=g[f],m=t.getMatchList(T.keyword,u);this.highlightMatchResult.push(...m.map(p=>({...p,...T,...i,index:p.index+d})))}}};this.highlightMatchResult=[],e(this.draw.getOriginalMainElementList())}renderHighlightList(t,e){if(!this.highlightMatchResult?.length)return;const{searchMatchAlpha:n,searchMatchColor:i}=this.options,r=this.draw.getPosition().getOriginalPositionList(),s=this.draw.getOriginalElementList();t.save();for(let a=0;a<this.highlightMatchResult.length;a++){const c=this.highlightMatchResult[a];let d=null;if(c.tableId){const{tableIndex:I,trIndex:L,tdIndex:P,index:O}=c;d=s[I]?.trList[L].tdList[P]?.positionList[O]}else d=r[c.index];if(!d)continue;const{coordinate:{leftTop:R,leftBottom:u,rightTop:h},pageNo:g}=d;if(g!==e)continue;t.fillStyle=c.backgroundColor||i,t.globalAlpha=c.alpha||n;const f=R[0],T=R[1],m=h[0]-R[0],p=u[1]-R[1];t.fillRect(f,T,m,p)}t.restore()}}class Tc{borderRect;options;constructor(t){this.borderRect=this.clearBorderInfo(),this.options=t.getOptions()}clearBorderInfo(){return this.borderRect={x:0,y:0,width:0,height:0},this.borderRect}recordBorderInfo(t,e,n,i){!this.borderRect.width&&(this.borderRect.x=t,this.borderRect.y=e,this.borderRect.height=i),this.borderRect.width+=n}render(t){if(!this.borderRect.width)return;const{scale:e,control:{borderWidth:n,borderColor:i}}=this.options,{x:r,y:s,width:a,height:c}=this.borderRect;t.save(),t.translate(0,1*e),t.lineWidth=n*e,t.strokeStyle=i,t.beginPath(),t.rect(r,s,a,c),t.stroke(),t.restore(),this.clearBorderInfo()}}class On{draw;element;control;isPopup;selectDom;options;VALUE_DELIMITER=",";DEFAULT_MULTI_SELECT_DELIMITER=",";constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1,this.selectDom=null}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getCodes(){return this.element?.control?.code?this.element.control.code.split(","):[]}getText(t){if(!this.element?.control)return null;const e=this.element.control;if(!e.valueSets?.length)return null;const n=e?.multiSelectDelimiter||this.DEFAULT_MULTI_SELECT_DELIMITER,i=e.valueSets,r=[];return t.forEach(s=>{const a=i.find(c=>c.code===s);a&&!Qi(a.value)&&r.push(a.value)}),r.join(n)||null}getValue(t={}){const{elementList:e,range:n}=this.control.mergeControl(t),{startIndex:i}=n,r=e[i],s=[];let a=i;for(;a>=0;){const d=e[a];if(!d||d.controlId!==r.controlId||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT)break;d.controlComponent===l.ControlComponent.VALUE&&s.unshift(d),a--}let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==r.controlId||d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POST_TEXT)break;d.controlComponent===l.ControlComponent.VALUE&&s.push(d),c++}return s}setValue(t,e={},n={}){if(!this.element.control?.selectExclusiveOptions?.inputAble||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=r,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s):this.control.removePlaceholder(s,{elementList:i});const d=i[s],R=d.type&&!$t.includes(d.type)||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...Gt]):ie(d,["type"]),u=r.startIndex+1;for(let h=0;h<t.length;h++){const g={...R,...t[h],controlComponent:l.ControlComponent.VALUE};Ut(i,[g],s,{editorOptions:this.options}),c.spliceElementList(i,u+h,0,[g])}return u+t.length-1}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=e[i],a=e[r],c=this.element.control?.selectExclusiveOptions?.inputAble;if(t.key===l.KeyMap.Backspace)return i!==r?c?(this.draw.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect():s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):c?(this.draw.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1):this.clearSelect();if(t.key===l.KeyMap.Delete){if(i!==r)return c?(this.draw.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect();{const d=e[r+1];return(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT)&&d.controlComponent===l.ControlComponent.PLACEHOLDER||d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POST_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):c?(this.draw.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect()}}return r}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();return t===e?t:this.clearSelect()}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const r=t.elementList||this.control.getElementList(),{startIndex:s}=t.range||this.control.getRange(),a=r[s];let c=-1,d=-1,R=s;for(;R>0;){const g=r[R];if(g.controlId!==a.controlId||g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT){c=R;break}R--}let u=s+1;for(;u<r.length;){const g=r[u];if(g.controlId!==a.controlId||g.controlComponent===l.ControlComponent.POSTFIX||g.controlComponent===l.ControlComponent.POST_TEXT){d=u-1;break}u++}return!~c||!~d?-1:(this.control.getDraw().spliceElementList(r,c+1,d-c,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(R,t),this.control.setControlProperties({code:void 0},{elementList:r,range:{startIndex:R,endIndex:R}}),R)}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const i=e.elementList||this.control.getElementList(),r=e.range||this.control.getRange(),s=this.element.control,a=t?.split(this.VALUE_DELIMITER)||[],c=s.code,d=s.code?.split(this.VALUE_DELIMITER)||[],R=s.isMultiSelect;if(!R&&t===c||R&&Zi(d,a)){this.control.repaintControl({curIndex:r.startIndex,isCompute:!1,isSubmitHistory:!1}),this.destroy();return}const u=s.valueSets;if(!Array.isArray(u)||!u.length)return;const h=this.getText(a);if(!h){if(c){const P=this.clearSelect(e,{isIgnoreDeletedRule:n.isIgnoreDeletedRule});~P&&(this.control.repaintControl({curIndex:P}),this.control.emitControlContentChange({controlValue:[]}))}return}const g=this.getValue(e)[0],f=g?Dt(g,ue):Dt(i[r.startIndex],Gt),T=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~T)return;c||this.control.removePlaceholder(T,e);const m=ie(i[T],ue),p=T+1,I=ct(h),L=this.control.getDraw();for(let P=0;P<I.length;P++){const O={...f,...m,type:l.ElementType.TEXT,value:I[P],controlComponent:l.ControlComponent.VALUE};(O.color===this.options.control.bracketColor||O.color===this.options.control.placeholderColor)&&(O.color=this.options.defaultColor),Ut(i,[O],T,{editorOptions:this.options}),L.spliceElementList(i,p+P,0,[O])}if(this.control.setControlProperties({code:t},{elementList:i,range:{startIndex:T,endIndex:T}}),!e.range){const P=p+I.length-1;this.control.repaintControl({curIndex:P}),this.control.emitControlContentChange({context:e}),R||this.destroy()}}_createSelectPopupDom(){const t=this.element.control,e=t.valueSets;if(!Array.isArray(e)||!e.length)return;const n=this.control.getPosition();if(!n)return;const i=document.createElement("div");i.classList.add(`${z}-select-control-popup`),i.setAttribute(Re,l.EditorComponent.POPUP);const r=document.createElement("ul");let s=null;for(let h=0;h<e.length;h++){const g=e[h],f=document.createElement("li");let T=this.getCodes();T.includes(g.code)&&(f.classList.add("active"),s=f),f.onclick=()=>{const m=T.findIndex(p=>p===g.code);t.isMultiSelect?~m?T.splice(m,1):T.push(g.code):~m?T=[]:T=[g.code],this.setSelect(T.join(this.VALUE_DELIMITER))},f.append(document.createTextNode(g.value)),r.append(f)}i.append(r);const{coordinate:{leftTop:[a,c]},lineHeight:d}=n,R=this.control.getPreY();i.style.left=`${a}px`,i.style.top=`${c+R+d}px`,this.control.getContainer().append(i),this.selectDom=i,s&&Ki(i,s)}awake(){if(this.isPopup||this.control.getIsDisabledControl())return;const{startIndex:t}=this.control.getRange(),n=this.control.getElementList()[t];if(!n||n.controlId!==this.element.controlId)return;const i=n.controlComponent===l.ControlComponent.PREFIX||n.controlComponent===l.ControlComponent.PRE_TEXT||n.controlComponent===l.ControlComponent.POSTFIX||n.controlComponent===l.ControlComponent.POST_TEXT||n.controlComponent===l.ControlComponent.PLACEHOLDER;!this.control.getIsRangeWithinControl()&&!i||(this._createSelectPopupDom(),this.isPopup=!0)}destroy(){this.isPopup&&(this.selectDom?.remove(),this.isPopup=!1)}}var Ts;function q(){return Ts.apply(null,arguments)}function mc(o){Ts=o}function re(o){return o instanceof Array||Object.prototype.toString.call(o)==="[object Array]"}function Ae(o){return o!=null&&Object.prototype.toString.call(o)==="[object Object]"}function Mt(o,t){return Object.prototype.hasOwnProperty.call(o,t)}function Jo(o){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(o).length===0;var t;for(t in o)if(Mt(o,t))return!1;return!0}function kt(o){return o===void 0}function Oe(o){return typeof o=="number"||Object.prototype.toString.call(o)==="[object Number]"}function Cn(o){return o instanceof Date||Object.prototype.toString.call(o)==="[object Date]"}function ms(o,t){var e=[],n,i=o.length;for(n=0;n<i;++n)e.push(t(o[n],n));return e}function Ze(o,t){for(var e in t)Mt(t,e)&&(o[e]=t[e]);return Mt(t,"toString")&&(o.toString=t.toString),Mt(t,"valueOf")&&(o.valueOf=t.valueOf),o}function pe(o,t,e,n){return xs(o,t,e,n,!0).utc()}function pc(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Rt(o){return o._pf==null&&(o._pf=pc()),o._pf}var Bo;Array.prototype.some?Bo=Array.prototype.some:Bo=function(o){var t=Object(this),e=t.length>>>0,n;for(n=0;n<e;n++)if(n in t&&o.call(this,t[n],n,t))return!0;return!1};function $o(o){var t=null,e=!1,n=o._d&&!isNaN(o._d.getTime());if(n&&(t=Rt(o),e=Bo.call(t.parsedDateParts,function(i){return i!=null}),n=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&e),o._strict&&(n=n&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(o))o._isValid=n;else return n;return o._isValid}function Jn(o){var t=pe(NaN);return o!=null?Ze(Rt(t),o):Rt(t).userInvalidated=!0,t}var ps=q.momentProperties=[],zo=!1;function jo(o,t){var e,n,i,r=ps.length;if(kt(t._isAMomentObject)||(o._isAMomentObject=t._isAMomentObject),kt(t._i)||(o._i=t._i),kt(t._f)||(o._f=t._f),kt(t._l)||(o._l=t._l),kt(t._strict)||(o._strict=t._strict),kt(t._tzm)||(o._tzm=t._tzm),kt(t._isUTC)||(o._isUTC=t._isUTC),kt(t._offset)||(o._offset=t._offset),kt(t._pf)||(o._pf=Rt(t)),kt(t._locale)||(o._locale=t._locale),r>0)for(e=0;e<r;e++)n=ps[e],i=t[n],kt(i)||(o[n]=i);return o}function Sn(o){jo(this,o),this._d=new Date(o._d!=null?o._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),zo===!1&&(zo=!0,q.updateOffset(this),zo=!1)}function le(o){return o instanceof Sn||o!=null&&o._isAMomentObject!=null}function Ls(o){q.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+o)}function te(o,t){var e=!0;return Ze(function(){if(q.deprecationHandler!=null&&q.deprecationHandler(null,o),e){var n=[],i,r,s,a=arguments.length;for(r=0;r<a;r++){if(i="",typeof arguments[r]=="object"){i+=`
102
+ [`+r+"] ";for(s in arguments[0])Mt(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[r];n.push(i)}Ls(o+`
103
103
  Arguments: `+Array.prototype.slice.call(n).join("")+`
104
- `+new Error().stack),e=!1}return t.apply(this,arguments)},t)}var ms={};function ps(o,t){q.deprecationHandler!=null&&q.deprecationHandler(o,t),ms[o]||(Ts(t),ms[o]=!0)}q.suppressDeprecationWarnings=!1,q.deprecationHandler=null;function pe(o){return typeof Function<"u"&&o instanceof Function||Object.prototype.toString.call(o)==="[object Function]"}function Tc(o){var t,e;for(e in o)Mt(o,e)&&(t=o[e],pe(t)?this[e]=t:this["_"+e]=t);this._config=o,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function $o(o,t){var e=Ue({},o),n;for(n in t)Mt(t,n)&&(_e(o[n])&&_e(t[n])?(e[n]={},Ue(e[n],o[n]),Ue(e[n],t[n])):t[n]!=null?e[n]=t[n]:delete e[n]);for(n in o)Mt(o,n)&&!Mt(t,n)&&_e(o[n])&&(e[n]=Ue({},e[n]));return e}function zo(o){o!=null&&this.set(o)}var jo;Object.keys?jo=Object.keys:jo=function(o){var t,e=[];for(t in o)Mt(o,t)&&e.push(t);return e};var mc={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function pc(o,t,e){var n=this._calendar[o]||this._calendar.sameElse;return pe(n)?n.call(t,e):n}function Le(o,t,e){var n=""+Math.abs(o),i=t-n.length,r=o>=0;return(r?e?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var qo=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,An=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ti={},rn={};function rt(o,t,e,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),o&&(rn[o]=i),t&&(rn[t[0]]=function(){return Le(i.apply(this,arguments),t[1],t[2])}),e&&(rn[e]=function(){return this.localeData().ordinal(i.apply(this,arguments),o)})}function Lc(o){return o.match(/\[[\s\S]/)?o.replace(/^\[|\]$/g,""):o.replace(/\\/g,"")}function Ic(o){var t=o.match(qo),e,n;for(e=0,n=t.length;e<n;e++)rn[t[e]]?t[e]=rn[t[e]]:t[e]=Lc(t[e]);return function(i){var r="",s;for(s=0;s<n;s++)r+=pe(t[s])?t[s].call(i,o):t[s];return r}}function kn(o,t){return o.isValid()?(t=Ls(t,o.localeData()),ti[t]=ti[t]||Ic(t),ti[t](o)):o.localeData().invalidDate()}function Ls(o,t){var e=5;function n(i){return t.longDateFormat(i)||i}for(An.lastIndex=0;e>=0&&An.test(o);)o=o.replace(An,n),An.lastIndex=0,e-=1;return o}var Pc={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Mc(o){var t=this._longDateFormat[o],e=this._longDateFormat[o.toUpperCase()];return t||!e?t:(this._longDateFormat[o]=e.match(qo).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[o])}var Oc="Invalid date";function Cc(){return this._invalidDate}var Sc="%d",Ec=/\d{1,2}/;function Xc(o){return this._ordinal.replace("%d",o)}var Nc={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Fc(o,t,e,n){var i=this._relativeTime[e];return pe(i)?i(o,t,e,n):i.replace(/%d/i,o)}function yc(o,t){var e=this._relativeTime[o>0?"future":"past"];return pe(e)?e(t):e.replace(/%s/i,t)}var Is={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ee(o){return typeof o=="string"?Is[o]||Is[o.toLowerCase()]:void 0}function ei(o){var t={},e,n;for(n in o)Mt(o,n)&&(e=ee(n),e&&(t[e]=o[n]));return t}var Wc={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function bc(o){var t=[],e;for(e in o)Mt(o,e)&&t.push({unit:e,priority:Wc[e]});return t.sort(function(n,i){return n.priority-i.priority}),t}var Ps=/\d/,zt=/\d\d/,Ms=/\d{3}/,ni=/\d{4}/,Jn=/[+-]?\d{6}/,Nt=/\d\d?/,Os=/\d\d\d\d?/,Cs=/\d\d\d\d\d\d?/,Bn=/\d{1,3}/,oi=/\d{1,4}/,$n=/[+-]?\d{1,6}/,ln=/\d+/,zn=/[+-]?\d+/,Vc=/Z|[+-]\d\d:?\d\d/gi,jn=/Z|[+-]\d\d(?::?\d\d)?/gi,Yc=/[+-]?\d+(\.\d{1,3})?/,On=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,an=/^[1-9]\d?/,ii=/^([1-9]\d|\d)/,qn;qn={};function ot(o,t,e){qn[o]=pe(t)?t:function(n,i){return n&&e?e:t}}function Dc(o,t){return Mt(qn,o)?qn[o](t._strict,t._locale):new RegExp(Uc(o))}function Uc(o){return Oe(o.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,r){return e||n||i||r}))}function Oe(o){return o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ne(o){return o<0?Math.ceil(o)||0:Math.floor(o)}function ft(o){var t=+o,e=0;return t!==0&&isFinite(t)&&(e=ne(t)),e}var si={};function Et(o,t){var e,n=t,i;for(typeof o=="string"&&(o=[o]),Me(t)&&(n=function(r,s){s[t]=ft(r)}),i=o.length,e=0;e<i;e++)si[o[e]]=n}function Cn(o,t){Et(o,function(e,n,i,r){i._w=i._w||{},t(e,i._w,i,r)})}function wc(o,t,e){t!=null&&Mt(si,o)&&si[o](t,e._a,e,o)}function to(o){return o%4===0&&o%100!==0||o%400===0}var xt=0,Ce=1,Ie=2,vt=3,le=4,Se=5,xe=6,Zc=7,Qc=8;rt("Y",0,0,function(){var o=this.year();return o<=9999?Le(o,4):"+"+o}),rt(0,["YY",2],0,function(){return this.year()%100}),rt(0,["YYYY",4],0,"year"),rt(0,["YYYYY",5],0,"year"),rt(0,["YYYYYY",6,!0],0,"year"),ot("Y",zn),ot("YY",Nt,zt),ot("YYYY",oi,ni),ot("YYYYY",$n,Jn),ot("YYYYYY",$n,Jn),Et(["YYYYY","YYYYYY"],xt),Et("YYYY",function(o,t){t[xt]=o.length===2?q.parseTwoDigitYear(o):ft(o)}),Et("YY",function(o,t){t[xt]=q.parseTwoDigitYear(o)}),Et("Y",function(o,t){t[xt]=parseInt(o,10)});function Sn(o){return to(o)?366:365}q.parseTwoDigitYear=function(o){return ft(o)+(ft(o)>68?1900:2e3)};var Ss=cn("FullYear",!0);function vc(){return to(this.year())}function cn(o,t){return function(e){return e!=null?(Es(this,o,e),q.updateOffset(this,t),this):En(this,o)}}function En(o,t){if(!o.isValid())return NaN;var e=o._d,n=o._isUTC;switch(t){case"Milliseconds":return n?e.getUTCMilliseconds():e.getMilliseconds();case"Seconds":return n?e.getUTCSeconds():e.getSeconds();case"Minutes":return n?e.getUTCMinutes():e.getMinutes();case"Hours":return n?e.getUTCHours():e.getHours();case"Date":return n?e.getUTCDate():e.getDate();case"Day":return n?e.getUTCDay():e.getDay();case"Month":return n?e.getUTCMonth():e.getMonth();case"FullYear":return n?e.getUTCFullYear():e.getFullYear();default:return NaN}}function Es(o,t,e){var n,i,r,s,a;if(!(!o.isValid()||isNaN(e))){switch(n=o._d,i=o._isUTC,t){case"Milliseconds":return void(i?n.setUTCMilliseconds(e):n.setMilliseconds(e));case"Seconds":return void(i?n.setUTCSeconds(e):n.setSeconds(e));case"Minutes":return void(i?n.setUTCMinutes(e):n.setMinutes(e));case"Hours":return void(i?n.setUTCHours(e):n.setHours(e));case"Date":return void(i?n.setUTCDate(e):n.setDate(e));case"FullYear":break;default:return}r=e,s=o.month(),a=o.date(),a=a===29&&s===1&&!to(r)?28:a,i?n.setUTCFullYear(r,s,a):n.setFullYear(r,s,a)}}function Kc(o){return o=ee(o),pe(this[o])?this[o]():this}function Hc(o,t){if(typeof o=="object"){o=ei(o);var e=bc(o),n,i=e.length;for(n=0;n<i;n++)this[e[n].unit](o[e[n].unit])}else if(o=ee(o),pe(this[o]))return this[o](t);return this}function _c(o,t){return(o%t+t)%t}var wt;Array.prototype.indexOf?wt=Array.prototype.indexOf:wt=function(o){var t;for(t=0;t<this.length;++t)if(this[t]===o)return t;return-1};function ri(o,t){if(isNaN(o)||isNaN(t))return NaN;var e=_c(t,12);return o+=(t-e)/12,e===1?to(o)?29:28:31-e%7%2}rt("M",["MM",2],"Mo",function(){return this.month()+1}),rt("MMM",0,0,function(o){return this.localeData().monthsShort(this,o)}),rt("MMMM",0,0,function(o){return this.localeData().months(this,o)}),ot("M",Nt,an),ot("MM",Nt,zt),ot("MMM",function(o,t){return t.monthsShortRegex(o)}),ot("MMMM",function(o,t){return t.monthsRegex(o)}),Et(["M","MM"],function(o,t){t[Ce]=ft(o)-1}),Et(["MMM","MMMM"],function(o,t,e,n){var i=e._locale.monthsParse(o,n,e._strict);i!=null?t[Ce]=i:Rt(e).invalidMonth=o});var xc="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Xs="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ns=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Gc=On,Ac=On;function kc(o,t){return o?se(this._months)?this._months[o.month()]:this._months[(this._months.isFormat||Ns).test(t)?"format":"standalone"][o.month()]:se(this._months)?this._months:this._months.standalone}function Jc(o,t){return o?se(this._monthsShort)?this._monthsShort[o.month()]:this._monthsShort[Ns.test(t)?"format":"standalone"][o.month()]:se(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Bc(o,t,e){var n,i,r,s=o.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=me([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return e?t==="MMM"?(i=wt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=wt.call(this._longMonthsParse,s),i!==-1?i:null):t==="MMM"?(i=wt.call(this._shortMonthsParse,s),i!==-1?i:(i=wt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=wt.call(this._longMonthsParse,s),i!==-1?i:(i=wt.call(this._shortMonthsParse,s),i!==-1?i:null))}function $c(o,t,e){var n,i,r;if(this._monthsParseExact)return Bc.call(this,o,t,e);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=me([2e3,n]),e&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!e&&!this._monthsParse[n]&&(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),e&&t==="MMMM"&&this._longMonthsParse[n].test(o))return n;if(e&&t==="MMM"&&this._shortMonthsParse[n].test(o))return n;if(!e&&this._monthsParse[n].test(o))return n}}function Fs(o,t){if(!o.isValid())return o;if(typeof t=="string"){if(/^\d+$/.test(t))t=ft(t);else if(t=o.localeData().monthsParse(t),!Me(t))return o}var e=t,n=o.date();return n=n<29?n:Math.min(n,ri(o.year(),e)),o._isUTC?o._d.setUTCMonth(e,n):o._d.setMonth(e,n),o}function ys(o){return o!=null?(Fs(this,o),q.updateOffset(this,!0),this):En(this,"Month")}function zc(){return ri(this.year(),this.month())}function jc(o){return this._monthsParseExact?(Mt(this,"_monthsRegex")||Ws.call(this),o?this._monthsShortStrictRegex:this._monthsShortRegex):(Mt(this,"_monthsShortRegex")||(this._monthsShortRegex=Gc),this._monthsShortStrictRegex&&o?this._monthsShortStrictRegex:this._monthsShortRegex)}function qc(o){return this._monthsParseExact?(Mt(this,"_monthsRegex")||Ws.call(this),o?this._monthsStrictRegex:this._monthsRegex):(Mt(this,"_monthsRegex")||(this._monthsRegex=Ac),this._monthsStrictRegex&&o?this._monthsStrictRegex:this._monthsRegex)}function Ws(){function o(c,d){return d.length-c.length}var t=[],e=[],n=[],i,r,s,a;for(i=0;i<12;i++)r=me([2e3,i]),s=Oe(this.monthsShort(r,"")),a=Oe(this.months(r,"")),t.push(s),e.push(a),n.push(a),n.push(s);t.sort(o),e.sort(o),n.sort(o),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function td(o,t,e,n,i,r,s){var a;return o<100&&o>=0?(a=new Date(o+400,t,e,n,i,r,s),isFinite(a.getFullYear())&&a.setFullYear(o)):a=new Date(o,t,e,n,i,r,s),a}function Xn(o){var t,e;return o<100&&o>=0?(e=Array.prototype.slice.call(arguments),e[0]=o+400,t=new Date(Date.UTC.apply(null,e)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(o)):t=new Date(Date.UTC.apply(null,arguments)),t}function eo(o,t,e){var n=7+t-e,i=(7+Xn(o,0,n).getUTCDay()-t)%7;return-i+n-1}function bs(o,t,e,n,i){var r=(7+e-n)%7,s=eo(o,n,i),a=1+7*(t-1)+r+s,c,d;return a<=0?(c=o-1,d=Sn(c)+a):a>Sn(o)?(c=o+1,d=a-Sn(o)):(c=o,d=a),{year:c,dayOfYear:d}}function Nn(o,t,e){var n=eo(o.year(),t,e),i=Math.floor((o.dayOfYear()-n-1)/7)+1,r,s;return i<1?(s=o.year()-1,r=i+Ee(s,t,e)):i>Ee(o.year(),t,e)?(r=i-Ee(o.year(),t,e),s=o.year()+1):(s=o.year(),r=i),{week:r,year:s}}function Ee(o,t,e){var n=eo(o,t,e),i=eo(o+1,t,e);return(Sn(o)-n+i)/7}rt("w",["ww",2],"wo","week"),rt("W",["WW",2],"Wo","isoWeek"),ot("w",Nt,an),ot("ww",Nt,zt),ot("W",Nt,an),ot("WW",Nt,zt),Cn(["w","ww","W","WW"],function(o,t,e,n){t[n.substr(0,1)]=ft(o)});function ed(o){return Nn(o,this._week.dow,this._week.doy).week}var nd={dow:0,doy:6};function od(){return this._week.dow}function id(){return this._week.doy}function sd(o){var t=this.localeData().week(this);return o==null?t:this.add((o-t)*7,"d")}function rd(o){var t=Nn(this,1,4).week;return o==null?t:this.add((o-t)*7,"d")}rt("d",0,"do","day"),rt("dd",0,0,function(o){return this.localeData().weekdaysMin(this,o)}),rt("ddd",0,0,function(o){return this.localeData().weekdaysShort(this,o)}),rt("dddd",0,0,function(o){return this.localeData().weekdays(this,o)}),rt("e",0,0,"weekday"),rt("E",0,0,"isoWeekday"),ot("d",Nt),ot("e",Nt),ot("E",Nt),ot("dd",function(o,t){return t.weekdaysMinRegex(o)}),ot("ddd",function(o,t){return t.weekdaysShortRegex(o)}),ot("dddd",function(o,t){return t.weekdaysRegex(o)}),Cn(["dd","ddd","dddd"],function(o,t,e,n){var i=e._locale.weekdaysParse(o,n,e._strict);i!=null?t.d=i:Rt(e).invalidWeekday=o}),Cn(["d","e","E"],function(o,t,e,n){t[n]=ft(o)});function ld(o,t){return typeof o!="string"?o:isNaN(o)?(o=t.weekdaysParse(o),typeof o=="number"?o:null):parseInt(o,10)}function ad(o,t){return typeof o=="string"?t.weekdaysParse(o)%7||7:isNaN(o)?null:o}function li(o,t){return o.slice(t,7).concat(o.slice(0,t))}var cd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Vs="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),dd="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Rd=On,ud=On,hd=On;function gd(o,t){var e=se(this._weekdays)?this._weekdays:this._weekdays[o&&o!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return o===!0?li(e,this._week.dow):o?e[o.day()]:e}function fd(o){return o===!0?li(this._weekdaysShort,this._week.dow):o?this._weekdaysShort[o.day()]:this._weekdaysShort}function Td(o){return o===!0?li(this._weekdaysMin,this._week.dow):o?this._weekdaysMin[o.day()]:this._weekdaysMin}function md(o,t,e){var n,i,r,s=o.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=me([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return e?t==="dddd"?(i=wt.call(this._weekdaysParse,s),i!==-1?i:null):t==="ddd"?(i=wt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=wt.call(this._minWeekdaysParse,s),i!==-1?i:null):t==="dddd"?(i=wt.call(this._weekdaysParse,s),i!==-1||(i=wt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=wt.call(this._minWeekdaysParse,s),i!==-1?i:null)):t==="ddd"?(i=wt.call(this._shortWeekdaysParse,s),i!==-1||(i=wt.call(this._weekdaysParse,s),i!==-1)?i:(i=wt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=wt.call(this._minWeekdaysParse,s),i!==-1||(i=wt.call(this._weekdaysParse,s),i!==-1)?i:(i=wt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function pd(o,t,e){var n,i,r;if(this._weekdaysParseExact)return md.call(this,o,t,e);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=me([2e3,1]).day(n),e&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),e&&t==="dddd"&&this._fullWeekdaysParse[n].test(o))return n;if(e&&t==="ddd"&&this._shortWeekdaysParse[n].test(o))return n;if(e&&t==="dd"&&this._minWeekdaysParse[n].test(o))return n;if(!e&&this._weekdaysParse[n].test(o))return n}}function Ld(o){if(!this.isValid())return o!=null?this:NaN;var t=En(this,"Day");return o!=null?(o=ld(o,this.localeData()),this.add(o-t,"d")):t}function Id(o){if(!this.isValid())return o!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return o==null?t:this.add(o-t,"d")}function Pd(o){if(!this.isValid())return o!=null?this:NaN;if(o!=null){var t=ad(o,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Md(o){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||ai.call(this),o?this._weekdaysStrictRegex:this._weekdaysRegex):(Mt(this,"_weekdaysRegex")||(this._weekdaysRegex=Rd),this._weekdaysStrictRegex&&o?this._weekdaysStrictRegex:this._weekdaysRegex)}function Od(o){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||ai.call(this),o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Mt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ud),this._weekdaysShortStrictRegex&&o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Cd(o){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||ai.call(this),o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Mt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=hd),this._weekdaysMinStrictRegex&&o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ai(){function o(R,u){return u.length-R.length}var t=[],e=[],n=[],i=[],r,s,a,c,d;for(r=0;r<7;r++)s=me([2e3,1]).day(r),a=Oe(this.weekdaysMin(s,"")),c=Oe(this.weekdaysShort(s,"")),d=Oe(this.weekdays(s,"")),t.push(a),e.push(c),n.push(d),i.push(a),i.push(c),i.push(d);t.sort(o),e.sort(o),n.sort(o),i.sort(o),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ci(){return this.hours()%12||12}function Sd(){return this.hours()||24}rt("H",["HH",2],0,"hour"),rt("h",["hh",2],0,ci),rt("k",["kk",2],0,Sd),rt("hmm",0,0,function(){return""+ci.apply(this)+Le(this.minutes(),2)}),rt("hmmss",0,0,function(){return""+ci.apply(this)+Le(this.minutes(),2)+Le(this.seconds(),2)}),rt("Hmm",0,0,function(){return""+this.hours()+Le(this.minutes(),2)}),rt("Hmmss",0,0,function(){return""+this.hours()+Le(this.minutes(),2)+Le(this.seconds(),2)});function Ys(o,t){rt(o,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Ys("a",!0),Ys("A",!1);function Ds(o,t){return t._meridiemParse}ot("a",Ds),ot("A",Ds),ot("H",Nt,ii),ot("h",Nt,an),ot("k",Nt,an),ot("HH",Nt,zt),ot("hh",Nt,zt),ot("kk",Nt,zt),ot("hmm",Os),ot("hmmss",Cs),ot("Hmm",Os),ot("Hmmss",Cs),Et(["H","HH"],vt),Et(["k","kk"],function(o,t,e){var n=ft(o);t[vt]=n===24?0:n}),Et(["a","A"],function(o,t,e){e._isPm=e._locale.isPM(o),e._meridiem=o}),Et(["h","hh"],function(o,t,e){t[vt]=ft(o),Rt(e).bigHour=!0}),Et("hmm",function(o,t,e){var n=o.length-2;t[vt]=ft(o.substr(0,n)),t[le]=ft(o.substr(n)),Rt(e).bigHour=!0}),Et("hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[vt]=ft(o.substr(0,n)),t[le]=ft(o.substr(n,2)),t[Se]=ft(o.substr(i)),Rt(e).bigHour=!0}),Et("Hmm",function(o,t,e){var n=o.length-2;t[vt]=ft(o.substr(0,n)),t[le]=ft(o.substr(n))}),Et("Hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[vt]=ft(o.substr(0,n)),t[le]=ft(o.substr(n,2)),t[Se]=ft(o.substr(i))});function Ed(o){return(o+"").toLowerCase().charAt(0)==="p"}var Xd=/[ap]\.?m?\.?/i,Nd=cn("Hours",!0);function Fd(o,t,e){return o>11?e?"pm":"PM":e?"am":"AM"}var Us={calendar:mc,longDateFormat:Pc,invalidDate:Oc,ordinal:Sc,dayOfMonthOrdinalParse:Ec,relativeTime:Nc,months:xc,monthsShort:Xs,week:nd,weekdays:cd,weekdaysMin:dd,weekdaysShort:Vs,meridiemParse:Xd},Wt={},Fn={},yn;function yd(o,t){var e,n=Math.min(o.length,t.length);for(e=0;e<n;e+=1)if(o[e]!==t[e])return e;return n}function ws(o){return o&&o.toLowerCase().replace("_","-")}function Wd(o){for(var t=0,e,n,i,r;t<o.length;){for(r=ws(o[t]).split("-"),e=r.length,n=ws(o[t+1]),n=n?n.split("-"):null;e>0;){if(i=no(r.slice(0,e).join("-")),i)return i;if(n&&n.length>=e&&yd(r,n)>=e-1)break;e--}t++}return yn}function bd(o){return!!(o&&o.match("^[^/\\\\]*$"))}function no(o){var t=null,e;if(Wt[o]===void 0&&typeof module<"u"&&module&&module.exports&&bd(o))try{t=yn._abbr,e=require,e("./locale/"+o),we(t)}catch{Wt[o]=null}return Wt[o]}function we(o,t){var e;return o&&(kt(t)?e=Xe(o):e=di(o,t),e?yn=e:typeof console<"u"&&console.warn&&console.warn("Locale "+o+" not found. Did you forget to load it?")),yn._abbr}function di(o,t){if(t!==null){var e,n=Us;if(t.abbr=o,Wt[o]!=null)ps("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Wt[o]._config;else if(t.parentLocale!=null)if(Wt[t.parentLocale]!=null)n=Wt[t.parentLocale]._config;else if(e=no(t.parentLocale),e!=null)n=e._config;else return Fn[t.parentLocale]||(Fn[t.parentLocale]=[]),Fn[t.parentLocale].push({name:o,config:t}),null;return Wt[o]=new zo($o(n,t)),Fn[o]&&Fn[o].forEach(function(i){di(i.name,i.config)}),we(o),Wt[o]}else return delete Wt[o],null}function Vd(o,t){if(t!=null){var e,n,i=Us;Wt[o]!=null&&Wt[o].parentLocale!=null?Wt[o].set($o(Wt[o]._config,t)):(n=no(o),n!=null&&(i=n._config),t=$o(i,t),n==null&&(t.abbr=o),e=new zo(t),e.parentLocale=Wt[o],Wt[o]=e),we(o)}else Wt[o]!=null&&(Wt[o].parentLocale!=null?(Wt[o]=Wt[o].parentLocale,o===we()&&we(o)):Wt[o]!=null&&delete Wt[o]);return Wt[o]}function Xe(o){var t;if(o&&o._locale&&o._locale._abbr&&(o=o._locale._abbr),!o)return yn;if(!se(o)){if(t=no(o),t)return t;o=[o]}return Wd(o)}function Yd(){return jo(Wt)}function Ri(o){var t,e=o._a;return e&&Rt(o).overflow===-2&&(t=e[Ce]<0||e[Ce]>11?Ce:e[Ie]<1||e[Ie]>ri(e[xt],e[Ce])?Ie:e[vt]<0||e[vt]>24||e[vt]===24&&(e[le]!==0||e[Se]!==0||e[xe]!==0)?vt:e[le]<0||e[le]>59?le:e[Se]<0||e[Se]>59?Se:e[xe]<0||e[xe]>999?xe:-1,Rt(o)._overflowDayOfYear&&(t<xt||t>Ie)&&(t=Ie),Rt(o)._overflowWeeks&&t===-1&&(t=Zc),Rt(o)._overflowWeekday&&t===-1&&(t=Qc),Rt(o).overflow=t),o}var Dd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ud=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wd=/Z|[+-]\d\d(?::?\d\d)?/,oo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ui=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Zd=/^\/?Date\((-?\d+)/i,Qd=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,vd={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Zs(o){var t,e,n=o._i,i=Dd.exec(n)||Ud.exec(n),r,s,a,c,d=oo.length,R=ui.length;if(i){for(Rt(o).iso=!0,t=0,e=d;t<e;t++)if(oo[t][1].exec(i[1])){s=oo[t][0],r=oo[t][2]!==!1;break}if(s==null){o._isValid=!1;return}if(i[3]){for(t=0,e=R;t<e;t++)if(ui[t][1].exec(i[3])){a=(i[2]||" ")+ui[t][0];break}if(a==null){o._isValid=!1;return}}if(!r&&a!=null){o._isValid=!1;return}if(i[4])if(wd.exec(i[4]))c="Z";else{o._isValid=!1;return}o._f=s+(a||"")+(c||""),gi(o)}else o._isValid=!1}function Kd(o,t,e,n,i,r){var s=[Hd(o),Xs.indexOf(t),parseInt(e,10),parseInt(n,10),parseInt(i,10)];return r&&s.push(parseInt(r,10)),s}function Hd(o){var t=parseInt(o,10);return t<=49?2e3+t:t<=999?1900+t:t}function _d(o){return o.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function xd(o,t,e){if(o){var n=Vs.indexOf(o),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return Rt(e).weekdayMismatch=!0,e._isValid=!1,!1}return!0}function Gd(o,t,e){if(o)return vd[o];if(t)return 0;var n=parseInt(e,10),i=n%100,r=(n-i)/100;return r*60+i}function Qs(o){var t=Qd.exec(_d(o._i)),e;if(t){if(e=Kd(t[4],t[3],t[2],t[5],t[6],t[7]),!xd(t[1],e,o))return;o._a=e,o._tzm=Gd(t[8],t[9],t[10]),o._d=Xn.apply(null,o._a),o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),Rt(o).rfc2822=!0}else o._isValid=!1}function Ad(o){var t=Zd.exec(o._i);if(t!==null){o._d=new Date(+t[1]);return}if(Zs(o),o._isValid===!1)delete o._isValid;else return;if(Qs(o),o._isValid===!1)delete o._isValid;else return;o._strict?o._isValid=!1:q.createFromInputFallback(o)}q.createFromInputFallback=te("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(o){o._d=new Date(o._i+(o._useUTC?" UTC":""))});function dn(o,t,e){return o??t??e}function kd(o){var t=new Date(q.now());return o._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function hi(o){var t,e,n=[],i,r,s;if(!o._d){for(i=kd(o),o._w&&o._a[Ie]==null&&o._a[Ce]==null&&Jd(o),o._dayOfYear!=null&&(s=dn(o._a[xt],i[xt]),(o._dayOfYear>Sn(s)||o._dayOfYear===0)&&(Rt(o)._overflowDayOfYear=!0),e=Xn(s,0,o._dayOfYear),o._a[Ce]=e.getUTCMonth(),o._a[Ie]=e.getUTCDate()),t=0;t<3&&o._a[t]==null;++t)o._a[t]=n[t]=i[t];for(;t<7;t++)o._a[t]=n[t]=o._a[t]==null?t===2?1:0:o._a[t];o._a[vt]===24&&o._a[le]===0&&o._a[Se]===0&&o._a[xe]===0&&(o._nextDay=!0,o._a[vt]=0),o._d=(o._useUTC?Xn:td).apply(null,n),r=o._useUTC?o._d.getUTCDay():o._d.getDay(),o._tzm!=null&&o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),o._nextDay&&(o._a[vt]=24),o._w&&typeof o._w.d<"u"&&o._w.d!==r&&(Rt(o).weekdayMismatch=!0)}}function Jd(o){var t,e,n,i,r,s,a,c,d;t=o._w,t.GG!=null||t.W!=null||t.E!=null?(r=1,s=4,e=dn(t.GG,o._a[xt],Nn(Ft(),1,4).year),n=dn(t.W,1),i=dn(t.E,1),(i<1||i>7)&&(c=!0)):(r=o._locale._week.dow,s=o._locale._week.doy,d=Nn(Ft(),r,s),e=dn(t.gg,o._a[xt],d.year),n=dn(t.w,d.week),t.d!=null?(i=t.d,(i<0||i>6)&&(c=!0)):t.e!=null?(i=t.e+r,(t.e<0||t.e>6)&&(c=!0)):i=r),n<1||n>Ee(e,r,s)?Rt(o)._overflowWeeks=!0:c!=null?Rt(o)._overflowWeekday=!0:(a=bs(e,n,i,r,s),o._a[xt]=a.year,o._dayOfYear=a.dayOfYear)}q.ISO_8601=function(){},q.RFC_2822=function(){};function gi(o){if(o._f===q.ISO_8601){Zs(o);return}if(o._f===q.RFC_2822){Qs(o);return}o._a=[],Rt(o).empty=!0;var t=""+o._i,e,n,i,r,s,a=t.length,c=0,d,R;for(i=Ls(o._f,o._locale).match(qo)||[],R=i.length,e=0;e<R;e++)r=i[e],n=(t.match(Dc(r,o))||[])[0],n&&(s=t.substr(0,t.indexOf(n)),s.length>0&&Rt(o).unusedInput.push(s),t=t.slice(t.indexOf(n)+n.length),c+=n.length),rn[r]?(n?Rt(o).empty=!1:Rt(o).unusedTokens.push(r),wc(r,n,o)):o._strict&&!n&&Rt(o).unusedTokens.push(r);Rt(o).charsLeftOver=a-c,t.length>0&&Rt(o).unusedInput.push(t),o._a[vt]<=12&&Rt(o).bigHour===!0&&o._a[vt]>0&&(Rt(o).bigHour=void 0),Rt(o).parsedDateParts=o._a.slice(0),Rt(o).meridiem=o._meridiem,o._a[vt]=Bd(o._locale,o._a[vt],o._meridiem),d=Rt(o).era,d!==null&&(o._a[xt]=o._locale.erasConvertYear(d,o._a[xt])),hi(o),Ri(o)}function Bd(o,t,e){var n;return e==null?t:o.meridiemHour!=null?o.meridiemHour(t,e):(o.isPM!=null&&(n=o.isPM(e),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function $d(o){var t,e,n,i,r,s,a=!1,c=o._f.length;if(c===0){Rt(o).invalidFormat=!0,o._d=new Date(NaN);return}for(i=0;i<c;i++)r=0,s=!1,t=Bo({},o),o._useUTC!=null&&(t._useUTC=o._useUTC),t._f=o._f[i],gi(t),ko(t)&&(s=!0),r+=Rt(t).charsLeftOver,r+=Rt(t).unusedTokens.length*10,Rt(t).score=r,a?r<n&&(n=r,e=t):(n==null||r<n||s)&&(n=r,e=t,s&&(a=!0));Ue(o,e||t)}function zd(o){if(!o._d){var t=ei(o._i),e=t.day===void 0?t.date:t.day;o._a=gs([t.year,t.month,e,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),hi(o)}}function jd(o){var t=new Mn(Ri(vs(o)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function vs(o){var t=o._i,e=o._f;return o._locale=o._locale||Xe(o._l),t===null||e===void 0&&t===""?Gn({nullInput:!0}):(typeof t=="string"&&(o._i=t=o._locale.preparse(t)),re(t)?new Mn(Ri(t)):(Pn(t)?o._d=t:se(e)?$d(o):e?gi(o):qd(o),ko(o)||(o._d=null),o))}function qd(o){var t=o._i;kt(t)?o._d=new Date(q.now()):Pn(t)?o._d=new Date(t.valueOf()):typeof t=="string"?Ad(o):se(t)?(o._a=gs(t.slice(0),function(e){return parseInt(e,10)}),hi(o)):_e(t)?zd(o):Me(t)?o._d=new Date(t):q.createFromInputFallback(o)}function Ks(o,t,e,n,i){var r={};return(t===!0||t===!1)&&(n=t,t=void 0),(e===!0||e===!1)&&(n=e,e=void 0),(_e(o)&&Go(o)||se(o)&&o.length===0)&&(o=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=e,r._i=o,r._f=t,r._strict=n,jd(r)}function Ft(o,t,e,n){return Ks(o,t,e,n,!1)}var tR=te("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=Ft.apply(null,arguments);return this.isValid()&&o.isValid()?o<this?this:o:Gn()}),eR=te("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=Ft.apply(null,arguments);return this.isValid()&&o.isValid()?o>this?this:o:Gn()});function Hs(o,t){var e,n;if(t.length===1&&se(t[0])&&(t=t[0]),!t.length)return Ft();for(e=t[0],n=1;n<t.length;++n)(!t[n].isValid()||t[n][o](e))&&(e=t[n]);return e}function nR(){var o=[].slice.call(arguments,0);return Hs("isBefore",o)}function oR(){var o=[].slice.call(arguments,0);return Hs("isAfter",o)}var iR=function(){return Date.now?Date.now():+new Date},Wn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function sR(o){var t,e=!1,n,i=Wn.length;for(t in o)if(Mt(o,t)&&!(wt.call(Wn,t)!==-1&&(o[t]==null||!isNaN(o[t]))))return!1;for(n=0;n<i;++n)if(o[Wn[n]]){if(e)return!1;parseFloat(o[Wn[n]])!==ft(o[Wn[n]])&&(e=!0)}return!0}function rR(){return this._isValid}function lR(){return ae(NaN)}function io(o){var t=ei(o),e=t.year||0,n=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,s=t.day||0,a=t.hour||0,c=t.minute||0,d=t.second||0,R=t.millisecond||0;this._isValid=sR(t),this._milliseconds=+R+d*1e3+c*6e4+a*1e3*60*60,this._days=+s+r*7,this._months=+i+n*3+e*12,this._data={},this._locale=Xe(),this._bubble()}function so(o){return o instanceof io}function fi(o){return o<0?Math.round(-1*o)*-1:Math.round(o)}function aR(o,t,e){var n=Math.min(o.length,t.length),i=Math.abs(o.length-t.length),r=0,s;for(s=0;s<n;s++)ft(o[s])!==ft(t[s])&&r++;return r+i}function _s(o,t){rt(o,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+Le(~~(e/60),2)+t+Le(~~e%60,2)})}_s("Z",":"),_s("ZZ",""),ot("Z",jn),ot("ZZ",jn),Et(["Z","ZZ"],function(o,t,e){e._useUTC=!0,e._tzm=Ti(jn,o)});var cR=/([\+\-]|\d\d)/gi;function Ti(o,t){var e=(t||"").match(o),n,i,r;return e===null?null:(n=e[e.length-1]||[],i=(n+"").match(cR)||["-",0,0],r=+(i[1]*60)+ft(i[2]),r===0?0:i[0]==="+"?r:-r)}function mi(o,t){var e,n;return t._isUTC?(e=t.clone(),n=(re(o)||Pn(o)?o.valueOf():Ft(o).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+n),q.updateOffset(e,!1),e):Ft(o).local()}function pi(o){return-Math.round(o._d.getTimezoneOffset())}q.updateOffset=function(){};function dR(o,t,e){var n=this._offset||0,i;if(!this.isValid())return o!=null?this:NaN;if(o!=null){if(typeof o=="string"){if(o=Ti(jn,o),o===null)return this}else Math.abs(o)<16&&!e&&(o=o*60);return!this._isUTC&&t&&(i=pi(this)),this._offset=o,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==o&&(!t||this._changeInProgress?ks(this,ae(o-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,q.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:pi(this)}function RR(o,t){return o!=null?(typeof o!="string"&&(o=-o),this.utcOffset(o,t),this):-this.utcOffset()}function uR(o){return this.utcOffset(0,o)}function hR(o){return this._isUTC&&(this.utcOffset(0,o),this._isUTC=!1,o&&this.subtract(pi(this),"m")),this}function gR(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var o=Ti(Vc,this._i);o!=null?this.utcOffset(o):this.utcOffset(0,!0)}return this}function fR(o){return this.isValid()?(o=o?Ft(o).utcOffset():0,(this.utcOffset()-o)%60===0):!1}function TR(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function mR(){if(!kt(this._isDSTShifted))return this._isDSTShifted;var o={},t;return Bo(o,this),o=vs(o),o._a?(t=o._isUTC?me(o._a):Ft(o._a),this._isDSTShifted=this.isValid()&&aR(o._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function pR(){return this.isValid()?!this._isUTC:!1}function LR(){return this.isValid()?this._isUTC:!1}function xs(){return this.isValid()?this._isUTC&&this._offset===0:!1}var IR=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,PR=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ae(o,t){var e=o,n=null,i,r,s;return so(o)?e={ms:o._milliseconds,d:o._days,M:o._months}:Me(o)||!isNaN(+o)?(e={},t?e[t]=+o:e.milliseconds=+o):(n=IR.exec(o))?(i=n[1]==="-"?-1:1,e={y:0,d:ft(n[Ie])*i,h:ft(n[vt])*i,m:ft(n[le])*i,s:ft(n[Se])*i,ms:ft(fi(n[xe]*1e3))*i}):(n=PR.exec(o))?(i=n[1]==="-"?-1:1,e={y:Ge(n[2],i),M:Ge(n[3],i),w:Ge(n[4],i),d:Ge(n[5],i),h:Ge(n[6],i),m:Ge(n[7],i),s:Ge(n[8],i)}):e==null?e={}:typeof e=="object"&&("from"in e||"to"in e)&&(s=MR(Ft(e.from),Ft(e.to)),e={},e.ms=s.milliseconds,e.M=s.months),r=new io(e),so(o)&&Mt(o,"_locale")&&(r._locale=o._locale),so(o)&&Mt(o,"_isValid")&&(r._isValid=o._isValid),r}ae.fn=io.prototype,ae.invalid=lR;function Ge(o,t){var e=o&&parseFloat(o.replace(",","."));return(isNaN(e)?0:e)*t}function Gs(o,t){var e={};return e.months=t.month()-o.month()+(t.year()-o.year())*12,o.clone().add(e.months,"M").isAfter(t)&&--e.months,e.milliseconds=+t-+o.clone().add(e.months,"M"),e}function MR(o,t){var e;return o.isValid()&&t.isValid()?(t=mi(t,o),o.isBefore(t)?e=Gs(o,t):(e=Gs(t,o),e.milliseconds=-e.milliseconds,e.months=-e.months),e):{milliseconds:0,months:0}}function As(o,t){return function(e,n){var i,r;return n!==null&&!isNaN(+n)&&(ps(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=e,e=n,n=r),i=ae(e,n),ks(this,i,o),this}}function ks(o,t,e,n){var i=t._milliseconds,r=fi(t._days),s=fi(t._months);o.isValid()&&(n=n??!0,s&&Fs(o,En(o,"Month")+s*e),r&&Es(o,"Date",En(o,"Date")+r*e),i&&o._d.setTime(o._d.valueOf()+i*e),n&&q.updateOffset(o,r||s))}var OR=As(1,"add"),CR=As(-1,"subtract");function Js(o){return typeof o=="string"||o instanceof String}function SR(o){return re(o)||Pn(o)||Js(o)||Me(o)||XR(o)||ER(o)||o===null||o===void 0}function ER(o){var t=_e(o)&&!Go(o),e=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,r,s=n.length;for(i=0;i<s;i+=1)r=n[i],e=e||Mt(o,r);return t&&e}function XR(o){var t=se(o),e=!1;return t&&(e=o.filter(function(n){return!Me(n)&&Js(o)}).length===0),t&&e}function NR(o){var t=_e(o)&&!Go(o),e=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,r;for(i=0;i<n.length;i+=1)r=n[i],e=e||Mt(o,r);return t&&e}function FR(o,t){var e=o.diff(t,"days",!0);return e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"}function yR(o,t){arguments.length===1&&(arguments[0]?SR(arguments[0])?(o=arguments[0],t=void 0):NR(arguments[0])&&(t=arguments[0],o=void 0):(o=void 0,t=void 0));var e=o||Ft(),n=mi(e,this).startOf("day"),i=q.calendarFormat(this,n)||"sameElse",r=t&&(pe(t[i])?t[i].call(this,e):t[i]);return this.format(r||this.localeData().calendar(i,this,Ft(e)))}function WR(){return new Mn(this)}function bR(o,t){var e=re(o)?o:Ft(o);return this.isValid()&&e.isValid()?(t=ee(t)||"millisecond",t==="millisecond"?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf()):!1}function VR(o,t){var e=re(o)?o:Ft(o);return this.isValid()&&e.isValid()?(t=ee(t)||"millisecond",t==="millisecond"?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf()):!1}function YR(o,t,e,n){var i=re(o)?o:Ft(o),r=re(t)?t:Ft(t);return this.isValid()&&i.isValid()&&r.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,e):!this.isBefore(i,e))&&(n[1]===")"?this.isBefore(r,e):!this.isAfter(r,e))):!1}function DR(o,t){var e=re(o)?o:Ft(o),n;return this.isValid()&&e.isValid()?(t=ee(t)||"millisecond",t==="millisecond"?this.valueOf()===e.valueOf():(n=e.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf())):!1}function UR(o,t){return this.isSame(o,t)||this.isAfter(o,t)}function wR(o,t){return this.isSame(o,t)||this.isBefore(o,t)}function ZR(o,t,e){var n,i,r;if(!this.isValid())return NaN;if(n=mi(o,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,t=ee(t),t){case"year":r=ro(this,n)/12;break;case"month":r=ro(this,n);break;case"quarter":r=ro(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-i)/864e5;break;case"week":r=(this-n-i)/6048e5;break;default:r=this-n}return e?r:ne(r)}function ro(o,t){if(o.date()<t.date())return-ro(t,o);var e=(t.year()-o.year())*12+(t.month()-o.month()),n=o.clone().add(e,"months"),i,r;return t-n<0?(i=o.clone().add(e-1,"months"),r=(t-n)/(n-i)):(i=o.clone().add(e+1,"months"),r=(t-n)/(i-n)),-(e+r)||0}q.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",q.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function QR(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function vR(o){if(!this.isValid())return null;var t=o!==!0,e=t?this.clone().utc():this;return e.year()<0||e.year()>9999?kn(e,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):pe(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",kn(e,"Z")):kn(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function KR(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var o="moment",t="",e,n,i,r;return this.isLocal()||(o=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),e="["+o+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",r=t+'[")]',this.format(e+n+i+r)}function HR(o){o||(o=this.isUtc()?q.defaultFormatUtc:q.defaultFormat);var t=kn(this,o);return this.localeData().postformat(t)}function _R(o,t){return this.isValid()&&(re(o)&&o.isValid()||Ft(o).isValid())?ae({to:this,from:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function xR(o){return this.from(Ft(),o)}function GR(o,t){return this.isValid()&&(re(o)&&o.isValid()||Ft(o).isValid())?ae({from:this,to:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function AR(o){return this.to(Ft(),o)}function Bs(o){var t;return o===void 0?this._locale._abbr:(t=Xe(o),t!=null&&(this._locale=t),this)}var $s=te("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(o){return o===void 0?this.localeData():this.locale(o)});function zs(){return this._locale}var lo=1e3,Rn=60*lo,ao=60*Rn,js=(365*400+97)*24*ao;function un(o,t){return(o%t+t)%t}function qs(o,t,e){return o<100&&o>=0?new Date(o+400,t,e)-js:new Date(o,t,e).valueOf()}function tr(o,t,e){return o<100&&o>=0?Date.UTC(o+400,t,e)-js:Date.UTC(o,t,e)}function kR(o){var t,e;if(o=ee(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?tr:qs,o){case"year":t=e(this.year(),0,1);break;case"quarter":t=e(this.year(),this.month()-this.month()%3,1);break;case"month":t=e(this.year(),this.month(),1);break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=e(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=un(t+(this._isUTC?0:this.utcOffset()*Rn),ao);break;case"minute":t=this._d.valueOf(),t-=un(t,Rn);break;case"second":t=this._d.valueOf(),t-=un(t,lo);break}return this._d.setTime(t),q.updateOffset(this,!0),this}function JR(o){var t,e;if(o=ee(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?tr:qs,o){case"year":t=e(this.year()+1,0,1)-1;break;case"quarter":t=e(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=e(this.year(),this.month()+1,1)-1;break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=e(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ao-un(t+(this._isUTC?0:this.utcOffset()*Rn),ao)-1;break;case"minute":t=this._d.valueOf(),t+=Rn-un(t,Rn)-1;break;case"second":t=this._d.valueOf(),t+=lo-un(t,lo)-1;break}return this._d.setTime(t),q.updateOffset(this,!0),this}function BR(){return this._d.valueOf()-(this._offset||0)*6e4}function $R(){return Math.floor(this.valueOf()/1e3)}function zR(){return new Date(this.valueOf())}function jR(){var o=this;return[o.year(),o.month(),o.date(),o.hour(),o.minute(),o.second(),o.millisecond()]}function qR(){var o=this;return{years:o.year(),months:o.month(),date:o.date(),hours:o.hours(),minutes:o.minutes(),seconds:o.seconds(),milliseconds:o.milliseconds()}}function tu(){return this.isValid()?this.toISOString():null}function eu(){return ko(this)}function nu(){return Ue({},Rt(this))}function ou(){return Rt(this).overflow}function iu(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}rt("N",0,0,"eraAbbr"),rt("NN",0,0,"eraAbbr"),rt("NNN",0,0,"eraAbbr"),rt("NNNN",0,0,"eraName"),rt("NNNNN",0,0,"eraNarrow"),rt("y",["y",1],"yo","eraYear"),rt("y",["yy",2],0,"eraYear"),rt("y",["yyy",3],0,"eraYear"),rt("y",["yyyy",4],0,"eraYear"),ot("N",Li),ot("NN",Li),ot("NNN",Li),ot("NNNN",fu),ot("NNNNN",Tu),Et(["N","NN","NNN","NNNN","NNNNN"],function(o,t,e,n){var i=e._locale.erasParse(o,n,e._strict);i?Rt(e).era=i:Rt(e).invalidEra=o}),ot("y",ln),ot("yy",ln),ot("yyy",ln),ot("yyyy",ln),ot("yo",mu),Et(["y","yy","yyy","yyyy"],xt),Et(["yo"],function(o,t,e,n){var i;e._locale._eraYearOrdinalRegex&&(i=o.match(e._locale._eraYearOrdinalRegex)),e._locale.eraYearOrdinalParse?t[xt]=e._locale.eraYearOrdinalParse(o,i):t[xt]=parseInt(o,10)});function su(o,t){var e,n,i,r=this._eras||Xe("en")._eras;for(e=0,n=r.length;e<n;++e)switch(typeof r[e].since==="string"&&(i=q(r[e].since).startOf("day"),r[e].since=i.valueOf()),typeof r[e].until){case"undefined":r[e].until=1/0;break;case"string":i=q(r[e].until).startOf("day").valueOf(),r[e].until=i.valueOf();break}return r}function ru(o,t,e){var n,i,r=this.eras(),s,a,c;for(o=o.toUpperCase(),n=0,i=r.length;n<i;++n)if(s=r[n].name.toUpperCase(),a=r[n].abbr.toUpperCase(),c=r[n].narrow.toUpperCase(),e)switch(t){case"N":case"NN":case"NNN":if(a===o)return r[n];break;case"NNNN":if(s===o)return r[n];break;case"NNNNN":if(c===o)return r[n];break}else if([s,a,c].indexOf(o)>=0)return r[n]}function lu(o,t){var e=o.since<=o.until?1:-1;return t===void 0?q(o.since).year():q(o.since).year()+(t-o.offset)*e}function au(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].name;return""}function cu(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].narrow;return""}function du(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].abbr;return""}function Ru(){var o,t,e,n,i=this.localeData().eras();for(o=0,t=i.length;o<t;++o)if(e=i[o].since<=i[o].until?1:-1,n=this.clone().startOf("day").valueOf(),i[o].since<=n&&n<=i[o].until||i[o].until<=n&&n<=i[o].since)return(this.year()-q(i[o].since).year())*e+i[o].offset;return this.year()}function uu(o){return Mt(this,"_erasNameRegex")||Ii.call(this),o?this._erasNameRegex:this._erasRegex}function hu(o){return Mt(this,"_erasAbbrRegex")||Ii.call(this),o?this._erasAbbrRegex:this._erasRegex}function gu(o){return Mt(this,"_erasNarrowRegex")||Ii.call(this),o?this._erasNarrowRegex:this._erasRegex}function Li(o,t){return t.erasAbbrRegex(o)}function fu(o,t){return t.erasNameRegex(o)}function Tu(o,t){return t.erasNarrowRegex(o)}function mu(o,t){return t._eraYearOrdinalRegex||ln}function Ii(){var o=[],t=[],e=[],n=[],i,r,s,a,c,d=this.eras();for(i=0,r=d.length;i<r;++i)s=Oe(d[i].name),a=Oe(d[i].abbr),c=Oe(d[i].narrow),t.push(s),o.push(a),e.push(c),n.push(s),n.push(a),n.push(c);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+e.join("|")+")","i")}rt(0,["gg",2],0,function(){return this.weekYear()%100}),rt(0,["GG",2],0,function(){return this.isoWeekYear()%100});function co(o,t){rt(0,[o,o.length],0,t)}co("gggg","weekYear"),co("ggggg","weekYear"),co("GGGG","isoWeekYear"),co("GGGGG","isoWeekYear"),ot("G",zn),ot("g",zn),ot("GG",Nt,zt),ot("gg",Nt,zt),ot("GGGG",oi,ni),ot("gggg",oi,ni),ot("GGGGG",$n,Jn),ot("ggggg",$n,Jn),Cn(["gggg","ggggg","GGGG","GGGGG"],function(o,t,e,n){t[n.substr(0,2)]=ft(o)}),Cn(["gg","GG"],function(o,t,e,n){t[n]=q.parseTwoDigitYear(o)});function pu(o){return er.call(this,o,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Lu(o){return er.call(this,o,this.isoWeek(),this.isoWeekday(),1,4)}function Iu(){return Ee(this.year(),1,4)}function Pu(){return Ee(this.isoWeekYear(),1,4)}function Mu(){var o=this.localeData()._week;return Ee(this.year(),o.dow,o.doy)}function Ou(){var o=this.localeData()._week;return Ee(this.weekYear(),o.dow,o.doy)}function er(o,t,e,n,i){var r;return o==null?Nn(this,n,i).year:(r=Ee(o,n,i),t>r&&(t=r),Cu.call(this,o,t,e,n,i))}function Cu(o,t,e,n,i){var r=bs(o,t,e,n,i),s=Xn(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}rt("Q",0,"Qo","quarter"),ot("Q",Ps),Et("Q",function(o,t){t[Ce]=(ft(o)-1)*3});function Su(o){return o==null?Math.ceil((this.month()+1)/3):this.month((o-1)*3+this.month()%3)}rt("D",["DD",2],"Do","date"),ot("D",Nt,an),ot("DD",Nt,zt),ot("Do",function(o,t){return o?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Et(["D","DD"],Ie),Et("Do",function(o,t){t[Ie]=ft(o.match(Nt)[0])});var nr=cn("Date",!0);rt("DDD",["DDDD",3],"DDDo","dayOfYear"),ot("DDD",Bn),ot("DDDD",Ms),Et(["DDD","DDDD"],function(o,t,e){e._dayOfYear=ft(o)});function Eu(o){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return o==null?t:this.add(o-t,"d")}rt("m",["mm",2],0,"minute"),ot("m",Nt,ii),ot("mm",Nt,zt),Et(["m","mm"],le);var Xu=cn("Minutes",!1);rt("s",["ss",2],0,"second"),ot("s",Nt,ii),ot("ss",Nt,zt),Et(["s","ss"],Se);var Nu=cn("Seconds",!1);rt("S",0,0,function(){return~~(this.millisecond()/100)}),rt(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),rt(0,["SSS",3],0,"millisecond"),rt(0,["SSSS",4],0,function(){return this.millisecond()*10}),rt(0,["SSSSS",5],0,function(){return this.millisecond()*100}),rt(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),rt(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),rt(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),rt(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ot("S",Bn,Ps),ot("SS",Bn,zt),ot("SSS",Bn,Ms);var Ze,or;for(Ze="SSSS";Ze.length<=9;Ze+="S")ot(Ze,ln);function Fu(o,t){t[xe]=ft(("0."+o)*1e3)}for(Ze="S";Ze.length<=9;Ze+="S")Et(Ze,Fu);or=cn("Milliseconds",!1),rt("z",0,0,"zoneAbbr"),rt("zz",0,0,"zoneName");function yu(){return this._isUTC?"UTC":""}function Wu(){return this._isUTC?"Coordinated Universal Time":""}var k=Mn.prototype;k.add=OR,k.calendar=yR,k.clone=WR,k.diff=ZR,k.endOf=JR,k.format=HR,k.from=_R,k.fromNow=xR,k.to=GR,k.toNow=AR,k.get=Kc,k.invalidAt=ou,k.isAfter=bR,k.isBefore=VR,k.isBetween=YR,k.isSame=DR,k.isSameOrAfter=UR,k.isSameOrBefore=wR,k.isValid=eu,k.lang=$s,k.locale=Bs,k.localeData=zs,k.max=eR,k.min=tR,k.parsingFlags=nu,k.set=Hc,k.startOf=kR,k.subtract=CR,k.toArray=jR,k.toObject=qR,k.toDate=zR,k.toISOString=vR,k.inspect=KR,typeof Symbol<"u"&&Symbol.for!=null&&(k[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),k.toJSON=tu,k.toString=QR,k.unix=$R,k.valueOf=BR,k.creationData=iu,k.eraName=au,k.eraNarrow=cu,k.eraAbbr=du,k.eraYear=Ru,k.year=Ss,k.isLeapYear=vc,k.weekYear=pu,k.isoWeekYear=Lu,k.quarter=k.quarters=Su,k.month=ys,k.daysInMonth=zc,k.week=k.weeks=sd,k.isoWeek=k.isoWeeks=rd,k.weeksInYear=Mu,k.weeksInWeekYear=Ou,k.isoWeeksInYear=Iu,k.isoWeeksInISOWeekYear=Pu,k.date=nr,k.day=k.days=Ld,k.weekday=Id,k.isoWeekday=Pd,k.dayOfYear=Eu,k.hour=k.hours=Nd,k.minute=k.minutes=Xu,k.second=k.seconds=Nu,k.millisecond=k.milliseconds=or,k.utcOffset=dR,k.utc=uR,k.local=hR,k.parseZone=gR,k.hasAlignedHourOffset=fR,k.isDST=TR,k.isLocal=pR,k.isUtcOffset=LR,k.isUtc=xs,k.isUTC=xs,k.zoneAbbr=yu,k.zoneName=Wu,k.dates=te("dates accessor is deprecated. Use date instead.",nr),k.months=te("months accessor is deprecated. Use month instead",ys),k.years=te("years accessor is deprecated. Use year instead",Ss),k.zone=te("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",RR),k.isDSTShifted=te("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",mR);function bu(o){return Ft(o*1e3)}function Vu(){return Ft.apply(null,arguments).parseZone()}function ir(o){return o}var Ot=zo.prototype;Ot.calendar=pc,Ot.longDateFormat=Mc,Ot.invalidDate=Cc,Ot.ordinal=Xc,Ot.preparse=ir,Ot.postformat=ir,Ot.relativeTime=Fc,Ot.pastFuture=yc,Ot.set=Tc,Ot.eras=su,Ot.erasParse=ru,Ot.erasConvertYear=lu,Ot.erasAbbrRegex=hu,Ot.erasNameRegex=uu,Ot.erasNarrowRegex=gu,Ot.months=kc,Ot.monthsShort=Jc,Ot.monthsParse=$c,Ot.monthsRegex=qc,Ot.monthsShortRegex=jc,Ot.week=ed,Ot.firstDayOfYear=id,Ot.firstDayOfWeek=od,Ot.weekdays=gd,Ot.weekdaysMin=Td,Ot.weekdaysShort=fd,Ot.weekdaysParse=pd,Ot.weekdaysRegex=Md,Ot.weekdaysShortRegex=Od,Ot.weekdaysMinRegex=Cd,Ot.isPM=Ed,Ot.meridiem=Fd;function Ro(o,t,e,n){var i=Xe(),r=me().set(n,t);return i[e](r,o)}function sr(o,t,e){if(Me(o)&&(t=o,o=void 0),o=o||"",t!=null)return Ro(o,t,e,"month");var n,i=[];for(n=0;n<12;n++)i[n]=Ro(o,n,e,"month");return i}function Pi(o,t,e,n){typeof o=="boolean"?(Me(t)&&(e=t,t=void 0),t=t||""):(t=o,e=t,o=!1,Me(t)&&(e=t,t=void 0),t=t||"");var i=Xe(),r=o?i._week.dow:0,s,a=[];if(e!=null)return Ro(t,(e+r)%7,n,"day");for(s=0;s<7;s++)a[s]=Ro(t,(s+r)%7,n,"day");return a}function Yu(o,t){return sr(o,t,"months")}function Du(o,t){return sr(o,t,"monthsShort")}function Uu(o,t,e){return Pi(o,t,e,"weekdays")}function wu(o,t,e){return Pi(o,t,e,"weekdaysShort")}function Zu(o,t,e){return Pi(o,t,e,"weekdaysMin")}we("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(o){var t=o%10,e=ft(o%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return o+e}}),q.lang=te("moment.lang is deprecated. Use moment.locale instead.",we),q.langData=te("moment.langData is deprecated. Use moment.localeData instead.",Xe);var Ne=Math.abs;function Qu(){var o=this._data;return this._milliseconds=Ne(this._milliseconds),this._days=Ne(this._days),this._months=Ne(this._months),o.milliseconds=Ne(o.milliseconds),o.seconds=Ne(o.seconds),o.minutes=Ne(o.minutes),o.hours=Ne(o.hours),o.months=Ne(o.months),o.years=Ne(o.years),this}function rr(o,t,e,n){var i=ae(t,e);return o._milliseconds+=n*i._milliseconds,o._days+=n*i._days,o._months+=n*i._months,o._bubble()}function vu(o,t){return rr(this,o,t,1)}function Ku(o,t){return rr(this,o,t,-1)}function lr(o){return o<0?Math.floor(o):Math.ceil(o)}function Hu(){var o=this._milliseconds,t=this._days,e=this._months,n=this._data,i,r,s,a,c;return o>=0&&t>=0&&e>=0||o<=0&&t<=0&&e<=0||(o+=lr(Mi(e)+t)*864e5,t=0,e=0),n.milliseconds=o%1e3,i=ne(o/1e3),n.seconds=i%60,r=ne(i/60),n.minutes=r%60,s=ne(r/60),n.hours=s%24,t+=ne(s/24),c=ne(ar(t)),e+=c,t-=lr(Mi(c)),a=ne(e/12),e%=12,n.days=t,n.months=e,n.years=a,this}function ar(o){return o*4800/146097}function Mi(o){return o*146097/4800}function _u(o){if(!this.isValid())return NaN;var t,e,n=this._milliseconds;if(o=ee(o),o==="month"||o==="quarter"||o==="year")switch(t=this._days+n/864e5,e=this._months+ar(t),o){case"month":return e;case"quarter":return e/3;case"year":return e/12}else switch(t=this._days+Math.round(Mi(this._months)),o){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+o)}}function Fe(o){return function(){return this.as(o)}}var cr=Fe("ms"),xu=Fe("s"),Gu=Fe("m"),Au=Fe("h"),ku=Fe("d"),Ju=Fe("w"),Bu=Fe("M"),$u=Fe("Q"),zu=Fe("y"),ju=cr;function qu(){return ae(this)}function th(o){return o=ee(o),this.isValid()?this[o+"s"]():NaN}function Ae(o){return function(){return this.isValid()?this._data[o]:NaN}}var eh=Ae("milliseconds"),nh=Ae("seconds"),oh=Ae("minutes"),ih=Ae("hours"),sh=Ae("days"),rh=Ae("months"),lh=Ae("years");function ah(){return ne(this.days()/7)}var ye=Math.round,hn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ch(o,t,e,n,i){return i.relativeTime(t||1,!!e,o,n)}function dh(o,t,e,n){var i=ae(o).abs(),r=ye(i.as("s")),s=ye(i.as("m")),a=ye(i.as("h")),c=ye(i.as("d")),d=ye(i.as("M")),R=ye(i.as("w")),u=ye(i.as("y")),h=r<=e.ss&&["s",r]||r<e.s&&["ss",r]||s<=1&&["m"]||s<e.m&&["mm",s]||a<=1&&["h"]||a<e.h&&["hh",a]||c<=1&&["d"]||c<e.d&&["dd",c];return e.w!=null&&(h=h||R<=1&&["w"]||R<e.w&&["ww",R]),h=h||d<=1&&["M"]||d<e.M&&["MM",d]||u<=1&&["y"]||["yy",u],h[2]=t,h[3]=+o>0,h[4]=n,ch.apply(null,h)}function Rh(o){return o===void 0?ye:typeof o=="function"?(ye=o,!0):!1}function uh(o,t){return hn[o]===void 0?!1:t===void 0?hn[o]:(hn[o]=t,o==="s"&&(hn.ss=t-1),!0)}function hh(o,t){if(!this.isValid())return this.localeData().invalidDate();var e=!1,n=hn,i,r;return typeof o=="object"&&(t=o,o=!1),typeof o=="boolean"&&(e=o),typeof t=="object"&&(n=Object.assign({},hn,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),i=this.localeData(),r=dh(this,!e,n,i),e&&(r=i.pastFuture(+this,r)),i.postformat(r)}var Oi=Math.abs;function gn(o){return(o>0)-(o<0)||+o}function uo(){if(!this.isValid())return this.localeData().invalidDate();var o=Oi(this._milliseconds)/1e3,t=Oi(this._days),e=Oi(this._months),n,i,r,s,a=this.asSeconds(),c,d,R,u;return a?(n=ne(o/60),i=ne(n/60),o%=60,n%=60,r=ne(e/12),e%=12,s=o?o.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",d=gn(this._months)!==gn(a)?"-":"",R=gn(this._days)!==gn(a)?"-":"",u=gn(this._milliseconds)!==gn(a)?"-":"",c+"P"+(r?d+r+"Y":"")+(e?d+e+"M":"")+(t?R+t+"D":"")+(i||n||o?"T":"")+(i?u+i+"H":"")+(n?u+n+"M":"")+(o?u+s+"S":"")):"P0D"}var Lt=io.prototype;Lt.isValid=rR,Lt.abs=Qu,Lt.add=vu,Lt.subtract=Ku,Lt.as=_u,Lt.asMilliseconds=cr,Lt.asSeconds=xu,Lt.asMinutes=Gu,Lt.asHours=Au,Lt.asDays=ku,Lt.asWeeks=Ju,Lt.asMonths=Bu,Lt.asQuarters=$u,Lt.asYears=zu,Lt.valueOf=ju,Lt._bubble=Hu,Lt.clone=qu,Lt.get=th,Lt.milliseconds=eh,Lt.seconds=nh,Lt.minutes=oh,Lt.hours=ih,Lt.days=sh,Lt.weeks=ah,Lt.months=rh,Lt.years=lh,Lt.humanize=hh,Lt.toISOString=uo,Lt.toString=uo,Lt.toJSON=uo,Lt.locale=Bs,Lt.localeData=zs,Lt.toIsoString=te("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",uo),Lt.lang=$s,rt("X",0,0,"unix"),rt("x",0,0,"valueOf"),ot("x",zn),ot("X",Yc),Et("X",function(o,t,e){e._d=new Date(parseFloat(o)*1e3)}),Et("x",function(o,t,e){e._d=new Date(ft(o))});q.version="2.30.1",gc(Ft),q.fn=k,q.min=nR,q.max=oR,q.now=iR,q.utc=me,q.unix=bu,q.months=Yu,q.isDate=Pn,q.locale=we,q.invalid=Gn,q.duration=ae,q.isMoment=re,q.weekdays=Uu,q.parseZone=Vu,q.localeData=Xe,q.isDuration=so,q.monthsShort=Du,q.weekdaysMin=Zu,q.defineLocale=di,q.updateLocale=Vd,q.locales=Yd,q.weekdaysShort=wu,q.normalizeUnits=ee,q.relativeTimeRounding=Rh,q.relativeTimeThreshold=uh,q.calendarFormat=FR,q.prototype=k,q.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};class Ci{draws;ranges;element;control;options;position;constructor(t,e){const n=e.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.getOptions(),this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getValue(t={}){const e=t.elementList||this.control.getElementList();let{startIndex:n}=t.range||this.control.getRange();const i=this.control.getDraw(),r=t?null:i.getTd();n>=e.length&&(n=e.length-1);const s=e[n],a=[];let c=r,d=e,R=n;for(;;){if(R<0&&c?.linkTdPrevId){const T=i.getTdById(c.linkTdPrevId);if(T){d=T.value,R=d.length-1,c=T;continue}}if(R<0)break;const f=d[R];if(f.controlId!==s.controlId||f.controlComponent===l.ControlComponent.PREFIX||f.controlComponent===l.ControlComponent.PRE_TEXT)break;f.controlComponent===l.ControlComponent.VALUE&&a.unshift(f),R--}c=r;let u=e,h=n+1;for(;;){if(h>=u.length&&c?.linkTdNextId){const T=i.getTdById(c.linkTdNextId);if(T){u=T.value,h=0,c=T;continue}}const f=u[h];if(!f||f.controlId!==s.controlId||f.controlComponent===l.ControlComponent.POSTFIX||f.controlComponent===l.ControlComponent.POST_TEXT)break;f.controlComponent===l.ControlComponent.VALUE&&a.push(f),h++}return a.filter(f=>f.type!==l.ElementType.SPLIT_TAG)}removeNextControlElement(t,e){const n=this.control.getDraw();if(e=e??n.getTd()?.linkTdNextId,e){const i=n.getTdById(e);if(i){if(i.value.length){if(i.value[1].controlId===t)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(t,i.linkTdNextId)}}}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=r,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):this.control.removePlaceholder(s,{elementList:i});const d=i[s],R=d.controlId;this._removeControlPlaceholders(i,s);const u=d.type&&!$t.includes(d.type)||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...Gt]):ie(d,["type"]),h=!!this.element.control?.underline,g=this.options.mode===l.EditorMode.FORM&&this.options.modeRule.form.inputTraceEnabled&&!h,f=r.startIndex+1,T=[],p=m=>{const I=T.length?T:i,L=T.length?T.length-1:r.startIndex;Ut(I,[m],L,{editorOptions:this.options}),T.push(m)};for(let m=0;m<t.length;m++){const I=t[m];if(I.type===l.ElementType.CONTROL&&I.control){const L=I,P=L.controlId||lt(),O=L.control?.value||[],S=L.control?.type===l.ControlType.TEXTFIELD,F={...u,controlId:P,type:l.ElementType.CONTROL,control:L.control,originControlId:R},N=S?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,V=S?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX,Y=S?L.control?.preTextFix||this.options.control.preTextFix:L.control?.prefix||this.options.control.prefix;for(let b=0;b<Y.length;b++){const E={...F,value:Y[b],controlComponent:N};p(E)}for(let b=0;b<O.length;b++){const E=O[b],C={...F,...E,controlComponent:l.ControlComponent.VALUE};(C.color===this.options.control.bracketColor||C.color===this.options.control.placeholderColor)&&(C.color=this.options.defaultColor),p(C)}if(O.length===0){const b=L.control?.placeholder||"";for(let E=0;E<b.length;E++){const C={...F,value:b[E],controlComponent:l.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};p(C)}}const X=S?L.control?.postTextFix||this.options.control.postTextFix:L.control?.postfix||this.options.control.postfix;for(let b=0;b<X.length;b++){const E={...F,value:X[b],controlComponent:V};p(E)}}else if(I.type||I.value){(d.controlComponent===l.ControlComponent.PRE_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.POSTFIX)&&(u.color=this.options.defaultColor);const P={...u,...I,controlComponent:l.ControlComponent.VALUE};(P.color===this.options.control.bracketColor||P.color===this.options.control.placeholderColor||P.color===this.options.control.textFixColor)&&(P.color=this.options.defaultColor),P.strikeout&&delete P.strikeout,g&&(P.textDecoration={style:l.TextDecorationStyle.DOUBLE},P.underline=!0),p(P)}}return T.length&&c.spliceElementList(i,f,0,T),r.startIndex+T.length}_removeControlPlaceholders(t,e){const n=t[e];if(!n?.controlId)return;const i=a=>!!a&&a.controlId===n.controlId&&a.originControlId===n.originControlId;let r=e;for(;r>=0&&i(t[r]);)r--;let s=e+1;for(;s<t.length&&i(t[s]);)s++;for(let a=s-1;a>r;a--)t[a].controlComponent===l.ControlComponent.PLACEHOLDER&&t.splice(a,1)}clearValue(t={},e={}){if(!e.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),i=t.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:r,endIndex:s}=i;return this.control.getDraw().spliceElementList(n,r+1,s-r,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(r,t)),r}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=e[i],a=e[r],c=this.control.getDraw(),d=!!s.originControlId;if(t.key===l.KeyMap.Backspace)if(this.options.mode===l.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&!d){if(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER)return i;this.strikeout()}else{if(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER)return i;if(i!==r){c.spliceElementList(e,i+1,r-i);const u=e[i+1];return(u?.controlComponent===l.ControlComponent.POSTFIX||u?.controlComponent===l.ControlComponent.POST_TEXT||u?.controlComponent===l.ControlComponent.POSTTEXTFIX||u?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(i),i===0&&e[0].type===l.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i}else{const u=e[i+1];return u?.controlComponent===l.ControlComponent.POSTFIX||u?.controlComponent===l.ControlComponent.POST_TEXT||u?.controlComponent===l.ControlComponent.POSTTEXTFIX||u?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT?(c.spliceElementList(e,i,1),this.control.addPlaceholder(i-1),i-1):(c.spliceElementList(e,i,1),i===1&&e[0].type===l.ElementType.SPLIT_TAG||i===0?c.fixPosition(!0)??i-1:i-1)}}else if(t.key===l.KeyMap.Delete){const R=e[r+1],u=!!s.originControlId;if(this.options.mode===l.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&!u){if(a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT||a.controlComponent===l.ControlComponent.POSTTEXTFIX||a.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER)return r;if(R?.controlComponent===l.ControlComponent.POSTFIX||R?.controlComponent===l.ControlComponent.POST_TEXT||R?.controlComponent===l.ControlComponent.POSTTEXTFIX||R?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)return c.spliceElementList(e,i+1,1),this.control.addPlaceholder(i),i;this.strikeout()}else{const g=e[r+1];return s.controlComponent===l.ControlComponent.PLACEHOLDER?r:g?.controlComponent===l.ControlComponent.POSTFIX||g?.controlComponent===l.ControlComponent.POST_TEXT||g?.controlComponent===l.ControlComponent.POSTTEXTFIX||g?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT?(c.spliceElementList(e,i+1,1),this.control.addPlaceholder(i),i):i!==r?(c.spliceElementList(e,i+1,r-i),i===0&&e[0].type===l.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i):g?(c.spliceElementList(e,i+1,1),i===0&&e[0].type===l.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i):(c.getTd()?.linkTdNextId&&s.controlId&&this.removeNextControlElement(s.controlId),r)}}return r}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();n.spliceElementList(i,t+1,e-t);const r=i[t+1];return(r?.controlComponent===l.ControlComponent.POSTFIX||r?.controlComponent===l.ControlComponent.POST_TEXT||r?.controlComponent===l.ControlComponent.POSTTEXTFIX||r?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(t),t}strikeout(t){const e=this.control.getRange(),{endIndex:n}=e,{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return;const s=this.ranges.getSelectionElementList(),a=this.position.getCursorPosition(),c=q(new Date).format("YYYY-MM-DD HH:mm:ss");if(s?.length){if(!this.element.strikeout){const d=s.findIndex(R=>!R.strikeout);s.forEach(R=>{R.deletePerson="SWJ",R.deleteTime=c,R.strikeout=!!~d}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),setTimeout(()=>{this.strikeoute()},100)}}else{const d=this.control.getElementList()[a.index],R=this.control.getElementList();if(!this.control.getElementList()[a.index].strikeout&&d?.metrics.width>0){this.control.getElementList()[a.index].strikeout=!0,this.control.getElementList()[a.index].deletePerson="SWJ",this.control.getElementList()[a.index].deleteTime=c;const u=--a.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const g=u;this.draws.render({curIndex:g,isSetCursor:!0}),a.index=u,this.position.setCursorPosition(a),this.ranges.setRange(u,u)},100)}else n>=0&&n<R.length&&R[n]?.metrics?.width!==void 0&&R[n].metrics.width<=0&&!R[n]?.strikeout&&(setTimeout(()=>{R.splice(n,1)},100),setTimeout(()=>{const h=n-1;this.draws.render({curIndex:h,isSetCursor:!0}),a.index=h,delete a.value,this.position.setCursorPosition(a),this.ranges.setRange(h,h)},100))}}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:r}=this.ranges.getRange(),a=this.draws.getElementList()[r];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}class dr{draw;options;now;dom;renderOptions;isDatePicker;pickDate;lang;constructor(t,e={}){this.draw=t,this.options=e,this.lang=this._getLang(),this.now=new Date,this.dom=this._createDom(),this.renderOptions=null,this.isDatePicker=!0,this.pickDate=null,this._bindEvent()}_createDom(){const t=document.createElement("div");t.classList.add(`${z}-date-container`),t.setAttribute(de,l.EditorComponent.POPUP);const e=document.createElement("div");e.classList.add(`${z}-date-wrap`);const n=document.createElement("div");n.classList.add(`${z}-date-title`);const i=document.createElement("span");i.classList.add(`${z}-date-title__pre-year`),i.innerText="<<";const r=document.createElement("span");r.classList.add(`${z}-date-title__pre-month`),r.innerText="<";const s=document.createElement("span");s.classList.add(`${z}-date-title__now`);const a=document.createElement("span");a.classList.add(`${z}-date-title__next-month`),a.innerText=">";const c=document.createElement("span");c.classList.add(`${z}-date-title__next-year`),c.innerText=">>",n.append(i),n.append(r),n.append(s),n.append(a),n.append(c);const d=document.createElement("div");d.classList.add(`${z}-date-week`);const{weeks:{sun:R,mon:u,tue:h,wed:g,thu:f,fri:T,sat:p}}=this.lang;[R,u,h,g,f,T,p].forEach(b=>{const E=document.createElement("span");E.innerText=`${b}`,d.append(E)});const I=document.createElement("div");I.classList.add(`${z}-date-day`),e.append(n),e.append(d),e.append(I);const L=document.createElement("ul");L.classList.add(`${z}-time-wrap`);let P,O,S;[this.lang.hour,this.lang.minute,this.lang.second].forEach((b,E)=>{const C=document.createElement("li"),M=document.createElement("span");M.innerText=b,C.append(M);const y=document.createElement("ol"),W=E===0,D=E===1,U=W?24:60;for(let Q=0;Q<U;Q++){const G=document.createElement("li");G.innerText=`${String(Q).padStart(2,"0")}`,G.setAttribute("data-id",`${Q}`),y.append(G)}W?P=y:D?O=y:S=y,C.append(y),L.append(C)});const N=document.createElement("div");N.classList.add(`${z}-date-menu`);const V=document.createElement("button");V.classList.add(`${z}-date-menu__time`),V.innerText=this.lang.timeSelect;const Y=document.createElement("button");Y.classList.add(`${z}-date-menu__now`),Y.innerText=this.lang.now;const X=document.createElement("button");return X.classList.add(`${z}-date-menu__submit`),X.innerText=this.lang.confirm,N.append(V),N.append(Y),N.append(X),t.append(e),t.append(L),t.append(N),this.draw.getContainer().append(t),{container:t,dateWrap:e,datePickerWeek:d,timeWrap:L,title:{preYear:i,preMonth:r,now:s,nextMonth:a,nextYear:c},day:I,time:{hour:P,minute:O,second:S},menu:{time:V,now:Y,submit:X}}}_bindEvent(){this.dom.title.preYear.onclick=()=>{this._preYear()},this.dom.title.preMonth.onclick=()=>{this._preMonth()},this.dom.title.nextMonth.onclick=()=>{this._nextMonth()},this.dom.title.nextYear.onclick=()=>{this._nextYear()},this.dom.menu.time.onclick=()=>{this.isDatePicker=!this.isDatePicker,this._toggleDateTimePicker()},this.dom.menu.now.onclick=()=>{this._now(),this._submit()},this.dom.menu.submit.onclick=()=>{this.dispose(),this._submit()},this.dom.time.hour.onclick=t=>{if(!this.pickDate)return;const n=t.target.dataset.id;n&&(this.pickDate.setHours(Number(n)),this._setTimePick(!1))},this.dom.time.minute.onclick=t=>{if(!this.pickDate)return;const n=t.target.dataset.id;n&&(this.pickDate.setMinutes(Number(n)),this._setTimePick(!1))},this.dom.time.second.onclick=t=>{if(!this.pickDate)return;const n=t.target.dataset.id;n&&(this.pickDate.setSeconds(Number(n)),this._setTimePick(!1))}}_setPosition(){if(!this.renderOptions)return;const{position:{coordinate:{leftTop:[t,e]},lineHeight:n,pageNo:i}}=this.renderOptions,r=this.draw.getHeight(),s=this.draw.getPageGap(),c=(i??this.draw.getPageNo())*(r+s);this.dom.container.style.left=`${t}px`,this.dom.container.style.top=`${e+c+n}px`}isInvalidDate(t){return t.toDateString()==="Invalid Date"}_setValue(){const t=this.renderOptions?.value;if(t){const e=new Date(t);this.now=this.isInvalidDate(e)?new Date:e}else this.now=new Date;this.pickDate=new Date(this.now)}_getLang(){const t=this.draw.getI18n(),e=t.t.bind(t);return{now:e("datePicker.now"),confirm:e("datePicker.confirm"),return:e("datePicker.return"),timeSelect:e("datePicker.timeSelect"),weeks:{sun:e("datePicker.weeks.sun"),mon:e("datePicker.weeks.mon"),tue:e("datePicker.weeks.tue"),wed:e("datePicker.weeks.wed"),thu:e("datePicker.weeks.thu"),fri:e("datePicker.weeks.fri"),sat:e("datePicker.weeks.sat")},year:e("datePicker.year"),month:e("datePicker.month"),hour:e("datePicker.hour"),minute:e("datePicker.minute"),second:e("datePicker.second")}}_setLangChange(){this.dom.menu.time.innerText=this.lang.timeSelect,this.dom.menu.now.innerText=this.lang.now,this.dom.menu.submit.innerText=this.lang.confirm;const{weeks:{sun:t,mon:e,tue:n,wed:i,thu:r,fri:s,sat:a}}=this.lang,c=[t,e,n,i,r,s,a];this.dom.datePickerWeek.childNodes.forEach((h,g)=>{const f=h;f.innerText=c[g]});const d=this.dom.time.hour.previousElementSibling;d.innerText=this.lang.hour;const R=this.dom.time.minute.previousElementSibling;R.innerText=this.lang.minute;const u=this.dom.time.second.previousElementSibling;u.innerText=this.lang.second}_update(){const t=new Date,e=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();let r=null,s=null,a=null;this.pickDate&&(r=this.pickDate.getFullYear(),s=this.pickDate.getMonth()+1,a=this.pickDate.getDate());const c=this.now.getFullYear(),d=this.now.getMonth()+1;this.dom.title.now.innerText=`${c}${this.lang.year} ${String(d).padStart(2,"0")}${this.lang.month}`;const u=new Date(c,d,0).getDate();let h=new Date(c,d-1,1).getDay();h===0&&(h=7);const g=new Date(c,d-1,0).getDate();this.dom.day.innerHTML="";const f=g-h+1;for(let p=f;p<=g;p++){const m=document.createElement("div");m.classList.add("disable"),m.innerText=`${p}`,m.onclick=()=>{const I=d-2;this.now=new Date(c,I,p),this._setDatePick(c,I,p)},this.dom.day.append(m)}for(let p=1;p<=u;p++){const m=document.createElement("div");e===c&&n===d&&i===p&&m.classList.add("active"),this.pickDate&&r===c&&s===d&&a===p&&m.classList.add("select"),m.innerText=`${p}`,m.onclick=I=>{const L=d-1;this.now=new Date(c,L,p),this._setDatePick(c,L,p),I.stopPropagation()},this.dom.day.append(m)}const T=42-h-u;for(let p=1;p<=T;p++){const m=document.createElement("div");m.classList.add("disable"),m.innerText=`${p}`,m.onclick=()=>{this.now=new Date(c,d,p),this._setDatePick(c,d,p)},this.dom.day.append(m)}}_toggleDateTimePicker(){this.isDatePicker?(this.dom.dateWrap.classList.add("active"),this.dom.timeWrap.classList.remove("active"),this.dom.menu.time.innerText=this.lang.timeSelect):(this.dom.dateWrap.classList.remove("active"),this.dom.timeWrap.classList.add("active"),this.dom.menu.time.innerText=this.lang.return,this._setTimePick())}_setDatePick(t,e,n){this.now=new Date(t,e,n),this.pickDate?.setFullYear(t),this.pickDate?.setMonth(e),this.pickDate?.setDate(n),this._update()}_setTimePick(t=!0){const e=this.pickDate?.getHours()||0,n=this.pickDate?.getMinutes()||0,i=this.pickDate?.getSeconds()||0,{hour:r,minute:s,second:a}=this.dom.time;[r,s,a].forEach(R=>{R.querySelectorAll("li").forEach(u=>u.classList.remove("active"))}),[[r,e],[s,n],[a,i]].forEach(([R,u])=>{const h=R.querySelector(`[data-id='${u}']`);h.classList.add("active"),t&&Zi(R,h)})}_preMonth(){this.now.setMonth(this.now.getMonth()-1),this._update()}_nextMonth(){this.now.setMonth(this.now.getMonth()+1),this._update()}_preYear(){this.now.setFullYear(this.now.getFullYear()-1),this._update()}_nextYear(){this.now.setFullYear(this.now.getFullYear()+1),this._update()}_now(){this.pickDate=new Date,this.dispose()}_toggleVisible(t){t?this.dom.container.classList.add("active"):this.dom.container.classList.remove("active")}_submit(){if(this.options.onSubmit&&this.pickDate){const t=this.renderOptions?.dateFormat,e=this.formatDate(this.pickDate,t);this.options.onSubmit(e)}}formatDate(t,e="YYYY-MM-DD HH:mm:ss"){let n=e;const i=t.getFullYear().toString(),r=(t.getMonth()+1).toString(),s=t.getDate().toString(),a=t.getHours(),c=a%12===0?12:a%12,d=t.getMinutes().toString(),R=t.getSeconds().toString(),u=t.getMilliseconds().toString(),h={"y+":i,"Y+":i,"M+":r,"d+":s,"D+":s,"h+":c.toString(),"H+":a.toString(),"m+":d,"s+":R,"S+":u};for(const g in h){const f=new RegExp("("+g+")").exec(e),T=g;f&&(n=n.replace(f[1],f[1].length===1?h[T]:h[T].padStart(f[1].length,"0")))}return n}render(t){this.renderOptions=t,this.lang=this._getLang(),this._setLangChange(),this._setValue(),this._update(),this._setPosition(),this.isDatePicker=!0,this._toggleDateTimePicker(),this._toggleVisible(!0)}dispose(){this._toggleVisible(!1)}destroy(){this.dom.container.remove()}}class bn{draw;element;control;isPopup;datePicker;options;constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1,this.datePicker=null}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:r,endIndex:s}=n;for(let a=r;a<=s;a++){const c=e[a];c.controlComponent===l.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=r,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s):this.control.removePlaceholder(s,{elementList:i});const d=i[s],R=d.type&&!$t.includes(d.type)||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...Gt]):ie(d,["type"]),u=r.startIndex+1;for(let h=0;h<t.length;h++){const g={...R,...t[h],controlComponent:l.ControlComponent.VALUE};Ut(i,[g],s,{editorOptions:this.options}),c.spliceElementList(i,u+h,0,[g])}return u+t.length-1}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const r=this.control.getValueRange(t);if(!r)return-1;const{startIndex:s,endIndex:a}=r;if(!~s||!~a)return-1;const c=t.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(c,s+1,a-s,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(s,t),s}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const i=e.elementList||this.control.getElementList(),r=e.range||this.control.getRange(),s=this.getValue(e)[0],a=s?Dt(s,Re):Dt(i[r.startIndex],Gt),c=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~c)return;const d=ie(i[c],Re),R=c+1,u=this.control.getDraw();for(let h=0;h<t.length;h++){const g={...a,...d,type:l.ElementType.TEXT,value:t[h],controlComponent:l.ControlComponent.VALUE};(g.color===this.options.control.bracketColor||g.color===this.options.control.placeholderColor)&&(g.color=this.options.defaultColor),Ut(i,[g],c,{editorOptions:this.options}),u.spliceElementList(i,R+h,0,[g])}if(!e.range){const h=R+t.length-1;this.control.repaintControl({curIndex:h}),this.control.emitControlContentChange({context:e}),this.destroy()}}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=e[i],a=e[r],c=this.control.getDraw();if(t.key===l.KeyMap.Backspace)return i!==r?(c.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(t.key===l.KeyMap.Delete){if(i!==r)return c.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i;{const d=e[r+1];return(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT)&&d.controlComponent===l.ControlComponent.PLACEHOLDER||d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POST_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}}return r}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const t=this.control.getPosition();if(!t)return;const e=this.draw.getElementList(),{startIndex:n}=this.control.getRange();if(e[n+1]?.controlId!==this.element.controlId)return;this.datePicker=new dr(this.draw,{onSubmit:this._setDate.bind(this)});const i=this.getValue().map(s=>s.value).join("")||"",r=this.element.control?.dateFormat;this.datePicker.render({value:i,position:t,dateFormat:r}),this.isPopup=!0}destroy(){this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}_setDate(t){t?this.setSelect(t):this.clearSelect(),this.destroy()}}class Vn extends Ci{isPopup;inputPopup;constructor(t,e){super(t,e),this.isPopup=!1,this.inputPopup=null}getIsPopup(){return this.isPopup}setValue(t,e={},n={}){if(t.some(P=>!kl(P)||Qr.test(P.value)))return-1;const i=e.elementList||this.control.getElementList(),r=e.range||this.control.getRange();this.control.shrinkBoundary(e);const s=at(t),{startIndex:a,endIndex:c}=r,d=i[a];let R=null;for(let P=a;P>=0;P--)if(i[P].controlComponent===l.ControlComponent.PREFIX){R=i[P];break}const u=R?.control||this.element.control;if(this.control.getIsExistValueByElementListIndex(i,a)){let P=a;for(;P>0;){const S=i[P];if(S.controlId!==d.controlId||S.controlComponent===l.ControlComponent.PREFIX||S.controlComponent===l.ControlComponent.PRE_TEXT)break;s.unshift(S),P--}let O=c+1;for(;O<i.length;){const S=i[O];if(S.controlId!==d.controlId||S.controlComponent===l.ControlComponent.POSTFIX||S.controlComponent===l.ControlComponent.POST_TEXT)break;s.push(S),O++}}const h=$i(s);if(Number.isNaN(Number(h))||!Number.isFinite(Number(h)))return-1;const g=u?.numberExclusiveOptions,f=g?.maxLength??null,T=g?.decimalPlaces??null,p=h.replace(/[.-]/g,"").length;if(f!=null&&p>f||T!=null&&(h.split(".")[1]||"").length>T)return-1;const m=Number(h),I=g?.minValue,L=g?.maxValue;return I!=null&&m<I||L!=null&&m>L?-1:super.setValue(t,e,n)}_setNumberValue(t){const e=this.control.getElementList(),n=this.control.getRange(),{startIndex:i}=n;let r=null;for(let F=i;F>=0;F--)if(e[F].controlComponent===l.ControlComponent.PREFIX){r=e[F];break}const a=(r?.control||this.element.control)?.numberExclusiveOptions,c=a?.minValue,d=a?.maxValue,R=a?.decimalPlaces,u=a?.minLength,h=a?.maxLength;let g=t;R!=null&&(g=parseFloat(t.toFixed(R)));const f=g.toString(),T=f.replace(/[.-]/g,"").length;if(u!=null&&T<u||h!=null&&T>h||c!=null&&g<c||d!=null&&g>d)return!1;let p=i;for(let F=i;F>=0;F--)if(e[F].controlComponent===l.ControlComponent.PREFIX){p=F;break}let m=p+1;for(let F=p+1;F<e.length;F++)if(e[F].controlComponent===l.ControlComponent.POSTFIX){m=F;break}const I=this.options.mode===l.EditorMode.FORM,L=I&&this.options.modeRule.form.inputTraceEnabled,P=I&&this.options.modeRule.form.deleteTraceEnabled,O=q(new Date).format("YYYY-MM-DD HH:mm:ss");if(P)for(let F=p+1;F<m;F++){const N=e[F];N.controlComponent===l.ControlComponent.VALUE&&!N.strikeout&&N.value&&(N.strikeout=!0,N.deletePerson="SYSTEM",N.deleteTime=O),N.controlComponent===l.ControlComponent.PLACEHOLDER&&(this.control.getDraw().spliceElementList(e,F,1),m--,F--)}else{const F=p+1,N=m-F;N>0&&this.control.getDraw().spliceElementList(e,F,N),m=p+1}m=p+1;for(let F=p+1;F<e.length;F++)if(e[F].controlComponent===l.ControlComponent.POSTFIX){m=F;break}const S=[];for(let F=0;F<f.length;F++){const N={type:l.ElementType.TEXT,value:f[F],controlComponent:l.ControlComponent.VALUE,controlId:e[p].controlId};L&&(N.textDecoration={style:l.TextDecorationStyle.DOUBLE},N.underline=!0),S.push(N)}for(let F=0;F<S.length;F++)this.control.getDraw().spliceElementList(e,m+F,0,[S[F]]);return this.control.repaintControl({curIndex:m+S.length-1}),this.control.emitControlContentChange(),!0}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const t=this.control.getElementList(),e=this.control.getRange(),{startIndex:n}=e,i=t[n];if(!i||i.controlId!==this.element.controlId)return;let r=null;for(let f=n;f>=0;f--)if(t[f].controlComponent===l.ControlComponent.PREFIX){r=t[f];break}const s=r?.control||this.element.control,c=this.getValue().filter(f=>!f.strikeout),d=c.length>0?$i(c):"",R=s?.numberExclusiveOptions,u=R?.minValue,h=R?.maxValue,g=R?.decimalPlaces;this.inputPopup=new gh({control:this.control,currentValue:d,minValue:u,maxValue:h,decimalPlaces:g,onConfirm:f=>{if(!f||f.trim()==="")return this._clearNumberValue(),!0;const T=parseFloat(f);return Number.isNaN(T)||!Number.isFinite(T)?!1:this._setNumberValue(T)},onClose:()=>{this.destroy()}}),this.inputPopup.create(),this.isPopup=!0}_clearNumberValue(){const t=this.control.getElementList(),e=this.control.getRange(),{startIndex:n}=e;let i=n;for(let c=n;c>=0;c--)if(t[c].controlComponent===l.ControlComponent.PREFIX){i=c;break}let r=i+1;for(let c=i+1;c<t.length;c++)if(t[c].controlComponent===l.ControlComponent.POSTFIX){r=c;break}const s=i+1,a=r-s;a>0&&this.control.getDraw().spliceElementList(t,s,a),this.control.addPlaceholder(i),this.control.repaintControl({curIndex:i}),this.control.emitControlContentChange()}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=e[i],a=e[r],c=this.control.getDraw();if(t.key==="Backspace")return s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT?i:i!==r?(c.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(t.key==="Delete"){const R=e[r+1];return s.controlComponent===l.ControlComponent.PLACEHOLDER||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT?this.control.removeControl(i):s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||R?.controlComponent===l.ControlComponent.POSTFIX||R?.controlComponent===l.ControlComponent.POST_TEXT?r:i!==r?(c.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}return t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey?(t.preventDefault(),this.awake(),null):r}destroy(){this.inputPopup&&(this.inputPopup.destroy(),this.inputPopup=null),this.isPopup=!1}}class gh{options;popupDom;constructor(t){this.options=t,this.popupDom=null}create(){const{currentValue:t,minValue:e,maxValue:n,decimalPlaces:i,onConfirm:r,onClose:s}=this.options,a=document.createElement("div");a.classList.add(`${z}-number-input-modal`),a.setAttribute(de,l.EditorComponent.POPUP);const c=document.createElement("div");c.classList.add(`${z}-number-input-modal__content`);const d=document.createElement("div");if(d.classList.add(`${z}-number-input-modal__title`),d.textContent="请输入数值",c.appendChild(d),e!==void 0||n!==void 0){const p=document.createElement("div");p.classList.add(`${z}-number-input-modal__hint`);let m="有效范围:";e!==void 0&&n!==void 0?m+=`${e} ~ ${n}`:e!==void 0?m+=`≥ ${e}`:m+=`≤ ${n}`,i!=null&&(m+=`,保留${i}位小数`),p.textContent=m,c.appendChild(p)}const R=document.createElement("input");R.classList.add(`${z}-number-input-modal__input`),R.type="number",R.value=t,R.placeholder="请输入数值",e!==void 0&&(R.min=String(e)),n!==void 0&&(R.max=String(n)),i!=null&&(R.step=(1/Math.pow(10,i)).toString()),setTimeout(()=>{R.focus(),R.select()},100),c.appendChild(R);const u=document.createElement("div");u.classList.add(`${z}-number-input-modal__error`),u.style.display="none",c.appendChild(u);const h=document.createElement("div");h.classList.add(`${z}-number-input-modal__buttons`);const g=document.createElement("button");g.classList.add(`${z}-number-input-modal__cancel`),g.textContent="取消",g.onclick=()=>{s()},h.appendChild(g);const f=document.createElement("button");f.classList.add(`${z}-number-input-modal__confirm`),f.textContent="确定",f.onclick=()=>{const p=R.value.trim();if(!p){r("")&&s();return}const m=parseFloat(p);if(Number.isNaN(m)||!Number.isFinite(m)){u.textContent="请输入有效的数值",u.style.display="block";return}if(i!=null&&(p.split(".")[1]||"").length>i){u.textContent=`小数位数不能超过${i}位`,u.style.display="block";return}if(e!==void 0&&m<e){u.textContent=`数值不能小于 ${e}`,u.style.display="block";return}if(n!==void 0&&m>n){u.textContent=`数值不能大于 ${n}`,u.style.display="block";return}r(p)&&s()},h.appendChild(f),c.appendChild(h),a.appendChild(c),R.onkeydown=p=>{p.key==="Enter"?f.click():p.key==="Escape"&&s()},this.options.control.getContainer().appendChild(a),this.popupDom=a}destroy(){this.popupDom&&(this.popupDom.remove(),this.popupDom=null)}}class fh{options;mask;container;inputList;optionItemContainers;data;constructor(t){this.options=t,this.mask=null,this.container=null,this.inputList=[],this.optionItemContainers=[],this.data=t.data,this._render()}_getFieldValue(t){const e=this.inputList.filter(n=>n.name===t);if(e.length!==0){for(const n of e)if(n instanceof HTMLInputElement&&n.type==="radio"&&n.checked)return n.value;return e[0].value}}_updateFieldVisibility(){this.data.forEach((t,e)=>{if(t.visibleWhen){const{field:n,value:i}=t.visibleWhen,r=this._getFieldValue(n),s=this.optionItemContainers[e];if(s){const a=r===i;s.style.display=a?"":"none"}}})}_render(){const{title:t,onClose:e,onCancel:n,onConfirm:i}=this.options,r=document.createElement("div");r.classList.add("dialog-mask"),r.setAttribute(de,l.EditorComponent.COMPONENT),document.body.append(r);const s=document.createElement("div");s.classList.add("dialog-container"),s.setAttribute(de,l.EditorComponent.COMPONENT);const a=document.createElement("div");a.classList.add("dialog"),s.append(a);const c=document.createElement("div");c.classList.add("dialog-title");const d=document.createElement("span");d.append(document.createTextNode(t));const R=document.createElement("i");R.onclick=()=>{e&&e(),this._dispose()},c.append(d),c.append(R),a.append(c);const u=document.createElement("div");u.classList.add("dialog-option");for(let T=0;T<this.data.length;T++){const p=this.data[T],m=document.createElement("div");if(m.classList.add("dialog-option__item"),p.visible===!1&&(m.style.display="none"),p.label){const I=document.createElement("span");I.append(document.createTextNode(p.label)),m.append(I),p.required&&I.classList.add("dialog-option__item--require")}if(p.type==="radio"){const I=document.createElement("div");I.classList.add("dialog-radio-group"),p.horizontal&&I.classList.add("dialog-radio-group--horizontal"),p.options?.forEach(L=>{const P=document.createElement("label");P.classList.add("dialog-radio-item");const O=document.createElement("input");O.type="radio",O.name=p.name,O.value=L.value,L.value===(p.value||"")&&(O.checked=!0);const S=document.createElement("span");S.textContent=L.label,P.append(O),P.append(S),I.append(P),O.addEventListener("change",()=>{this._updateFieldVisibility()}),this.inputList.push(O)}),m.append(I)}else if(p.type==="select"){const I=document.createElement("select"),L=p.value||"";p.options?.forEach(P=>{const O=document.createElement("option");O.value=P.value,O.label=P.label,P.value===L&&(O.selected=!0),I.append(O)}),I.name=p.name,I.value=L,I.addEventListener("change",()=>{this._updateFieldVisibility()}),p.width&&(I.style.width=`${p.width}px`),m.append(I),this.inputList.push(I)}else if(p.type==="textarea"){const I=document.createElement("textarea");I.name=p.name,I.value=p.value||"",I.placeholder=p.placeholder||"",p.width&&(I.style.width=`${p.width}px`),p.height&&(I.style.height=`${p.height}px`),m.append(I),this.inputList.push(I)}else{const I=document.createElement("input");I.type=p.type,I.name=p.name,I.value=p.value||"",I.placeholder=p.placeholder||"",p.width&&(I.style.width=`${p.width}px`),p.height&&(I.style.height=`${p.height}px`),m.append(I),this.inputList.push(I)}u.append(m),this.optionItemContainers.push(m)}a.append(u);const h=document.createElement("div");h.classList.add("dialog-menu");const g=document.createElement("button");g.classList.add("dialog-menu__cancel"),g.append(document.createTextNode("取消")),g.type="button",g.onclick=()=>{n&&n(),this._dispose()},h.append(g);const f=document.createElement("button");f.append(document.createTextNode("确定")),f.type="submit",f.onclick=()=>{if(i){const T=new Set,p=[];for(const m of this.inputList)if(!T.has(m.name))if(m instanceof HTMLInputElement&&m.type==="radio"){const I=this.inputList.find(L=>L.name===m.name&&L instanceof HTMLInputElement&&L.checked);I&&(p.push({name:m.name,value:I.value}),T.add(m.name))}else p.push({name:m.name,value:m.value}),T.add(m.name);i(p)}this._dispose()},h.append(f),a.append(h),document.body.append(s),this.container=s,this.mask=r,this._updateFieldVisibility()}_dispose(){this.mask?.remove(),this.container?.remove()}}class ke{draw;element;control;isPopup;datePicker;options;range;static isDeleting=!1;inputModal=null;constructor(t,e){const n=e.getDraw();this.draw=n,this.range=n.getRange(),this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1,this.datePicker=null}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(){return[]}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e),s=this.control.getDraw(),{startIndex:a}=r,d=i[a].controlId;let R=a;for(let m=a;m>=0;m--){const I=i[m];if(I.controlId!==d)break;if(I.controlComponent===l.ControlComponent.PREFIX){R=m;break}}let u=a;for(let m=a;m<i.length;m++){const I=i[m];if(I.controlId!==d){u=m;break}if(I.controlComponent===l.ControlComponent.POSTFIX){u=m;break}}const h=R+1,g=u-1;g>=h&&s.spliceElementList(i,h,g-h+1);const f=i[R],T=Dt(f,["control","controlId",...Gt]),p=R+1;for(let m=0;m<t.length;m++){const I={...T,...t[m],controlComponent:l.ControlComponent.VALUE};I.color="#fff",I.highlight="#1677FF",Ut(i,[I],R,{editorOptions:this.options}),s.spliceElementList(i,p+m,0,[I])}return p+t.length-1}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const r=this.control.getValueRange(t);if(!r)return-1;const{startIndex:s,endIndex:a}=r;if(!~s||!~a)return-1;const c=t.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(c,s+1,a-s,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(s,t),s}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{endIndex:i}=n,r=e[i];return!!r?.originControlId&&!!r?.controlId&&r.originControlId!==r.controlId&&r.control?.type===l.ControlType.BUTTON&&!r.control?.buttonText&&(t.key===l.KeyMap.Backspace||t.key===l.KeyMap.Delete)?this.control.removeControl(i):r?.controlComponent==="value"&&r.control?.type==="button"&&r.control?.buttonText?t.key===l.KeyMap.Backspace||t.key===l.KeyMap.Delete?(r.controlId&&this.removeByValue(e,r.controlId),i):null:(t.key===l.KeyMap.Backspace&&r?.controlComponent==="value"&&r.control?.type==="button"&&!r.control?.buttonText,null)}removeByValue(t,e){return ke.isDeleting=!0,new Promise(n=>{for(let c=t.length-1;c>=0;c--)(t[c].type=="control"||t[c].type=="text")&&t[c].controlId===e&&t.splice(c,1);const{startIndex:i,endIndex:r}=this.range.getRange(),s=!0,a=r;this.draw.render({curIndex:a,isSetCursor:s}),setTimeout(()=>{ke.isDeleting=!1},300),n(!0)})}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl()||ke.isDeleting||!this.control.getPosition())return;const e=this.draw.getElementList(),{startIndex:n}=this.control.getRange();if(e[n]?.controlId!==this.element?.controlId)return;const i=this.control.getDraw().getPosition().getPositionContext();if(!i.isDirectHit||i.index!==n||e[i.index]?.controlId!==this.element?.controlId)return;const r=e[n]?.controlId,s=e[n]?.control;if(!(r?.endsWith("_text")||s?.buttonText)){if(this.options.mode=="form"){const a=e[n].controlId;if(!a)return;const c=e.filter(d=>d.controlId==a);c[0].control.buttonText||this.showInputModal(c)}else if(this.options.mode=="edit"){const a=e[n].controlId,c=e.filter(d=>d.controlId==a);this.showEditModal(c)}}}showInputModal(t){if(this.inputModal){this.closeInputModal();return}this.isPopup=!0,this.inputModal=document.createElement("div"),this.inputModal.classList.add(`${z}-button-input-modal`),this.inputModal.setAttribute(de,l.EditorComponent.POPUP),this.inputModal.oncontextmenu=c=>{c.preventDefault(),c.stopPropagation()};const e=document.createElement("div");e.classList.add(`${z}-button-input-modal__content`),e.oncontextmenu=c=>{c.preventDefault(),c.stopPropagation()};const n=document.createElement("div");n.classList.add(`${z}-button-input-modal__title`),n.innerText="请输入按钮展开文字(用逗号分隔)";const i=document.createElement("textarea");i.classList.add(`${z}-button-input-modal__textarea`),i.placeholder="例如:选项1,选项2,选项3",i.rows=5;const r=document.createElement("div");r.classList.add(`${z}-button-input-modal__buttons`);const s=document.createElement("button");s.classList.add(`${z}-button-input-modal__cancel`),s.innerText="取消",s.onclick=()=>this.closeInputModal();const a=document.createElement("button");a.classList.add(`${z}-button-input-modal__confirm`),a.innerText="确认",a.onclick=()=>{const c=i.value.trim();if(c){const d=c.split(/[,,]/).map((R,u)=>({value:R.trim(),code:String(u+1)})).filter(R=>R.value);if(d.length>0&&t[0]?.controlId){const R={controlId:t[0].controlId,element:[{...t[0],newButtonValue:d}]};this.draw.getCommand().executeButton(R)}}this.closeInputModal()},r.appendChild(s),r.appendChild(a),e.appendChild(n),e.appendChild(i),e.appendChild(r),this.inputModal.appendChild(e),this.draw.getContainer().appendChild(this.inputModal),setTimeout(()=>i.focus(),100),this.inputModal.onclick=c=>{c.target===this.inputModal&&this.closeInputModal()}}closeInputModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}showEditModal(t){const e=t[0]?.control||{},n=e.buttonLabel||e.label||"按钮",i=e.code||"";this.isPopup=!0,new fh({title:"修改按钮属性",data:[{type:"text",label:"按钮标签",name:"buttonLabel",required:!0,placeholder:"请输入按钮标签",value:n},{type:"text",label:"按钮代码",name:"code",placeholder:"请输入按钮代码",value:i}],onClose:()=>{this.isPopup=!1},onCancel:()=>{this.isPopup=!1},onConfirm:r=>{const s=r.find(h=>h.name==="buttonLabel")?.value?.trim()||"按钮",a=r.find(h=>h.name==="code")?.value?.trim()||"",c=this.control.getElementList(),d=t[0]?.controlId;if(d)for(let h=0;h<c.length;h++){const g=c[h];g.controlId===d&&g.control&&(g.control.buttonLabel=s,g.control.label=s,g.control.code=a)}const R=[];for(let h=0;h<s.length;h++)R.push({value:s[h],controlComponent:l.ControlComponent.VALUE});const u=this.setValue(R);u!==-1&&this.control.repaintControl({curIndex:u}),this.isPopup=!1}})}destroy(){this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}}class Rr{draws;ranges;element;control;options;position;constructor(t,e){const n=e.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.getOptions(),this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getValue(t={}){const e=t.elementList||this.control.getElementList();let{startIndex:n}=t.range||this.control.getRange();const i=this.control.getDraw(),r=t?null:i.getTd();n>=e.length&&(n=e.length-1);const s=e[n],a=[];let c=r;if(s.controlComponent===l.ControlComponent.PRETEXTFIX||s.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){let f=n+1;for(;f<e.length;){const T=e[f];if(T.controlId!==s.controlId||T.controlComponent!==l.ControlComponent.PRETEXTFIX&&T.controlComponent!==l.ControlComponent.PRETEXTFIX_TEXT){n=f-1;break}f++}}let d=e,R=n;for(;;){if(R<0&&c?.linkTdPrevId){const T=i.getTdById(c.linkTdPrevId);if(T){d=T.value,R=d.length-1,c=T;continue}}if(R<0)break;const f=d[R];if(f.controlId!==s.controlId||f.controlComponent===l.ControlComponent.PRETEXTFIX||f.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||f.controlComponent===l.ControlComponent.TEXTFIXLABEL)break;f.controlComponent===l.ControlComponent.VALUE&&a.unshift(f),R--}c=r;let u=e,h=n+1;for(;;){if(h>=u.length&&c?.linkTdNextId){const T=i.getTdById(c.linkTdNextId);if(T){u=T.value,h=0,c=T;continue}}const f=u[h];if(!f||f.controlId!==s.controlId||f.controlComponent===l.ControlComponent.POSTTEXTFIX||f.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||f.controlComponent===l.ControlComponent.TEXTFIXLABEL)break;f.controlComponent===l.ControlComponent.VALUE&&a.push(f),h++}return a.filter(f=>f.type!==l.ElementType.SPLIT_TAG)}removeNextControlElement(t,e){const n=this.control.getDraw();if(e=e??n.getTd()?.linkTdNextId,e){const i=n.getTdById(e);if(i){if(i.value.length){if(i.value[1].controlId===t)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(t,i.linkTdNextId)}}}setValue(t,e={},n={}){if(this.options.mode===l.EditorMode.FORM||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=r,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):this.control.removePlaceholder(s,{elementList:i});const d=i[s],R=i[s+1];let u=d.originControlId||d.controlId,h=d.originControlId&&(d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT);if(!h&&d.controlId&&(d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT)&&R?.controlId&&R.controlId!==d.controlId)if(R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX)for(let m=s;m>=0;m--){const I=i[m];if(I.controlId===d.controlId&&(I.controlComponent===l.ControlComponent.PREFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let L=m-1;L>=0;L--){const P=i[L];if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===l.ControlComponent.PRETEXTFIX||P.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||P.controlComponent===l.ControlComponent.PREFIX||P.controlComponent===l.ControlComponent.PRE_TEXT)){u=P.controlId,h=!0;break}if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===l.ControlComponent.POSTFIX||P.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}else(R.controlComponent===l.ControlComponent.POSTFIX||R.controlComponent===l.ControlComponent.POSTTEXTFIX)&&(u=R.controlId,h=!0);if(!h&&d.controlId&&(d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT))for(let m=s;m>=0;m--){const I=i[m];if(I.controlId===d.controlId&&(I.controlComponent===l.ControlComponent.PREFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let L=m-1;L>=0;L--){const P=i[L];if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===l.ControlComponent.PRETEXTFIX||P.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||P.controlComponent===l.ControlComponent.PREFIX||P.controlComponent===l.ControlComponent.PRE_TEXT)){u=P.controlId,h=!0;break}if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===l.ControlComponent.POSTFIX||P.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}const g=d.type&&!$t.includes(d.type)||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT?Dt(d,["control","controlId",...Gt]):ie(d,["type"]);h&&(g.controlId=u,delete g.originControlId);const f=r.startIndex+1,T=[],p=m=>{const I=T.length?T:i,L=T.length?T.length-1:r.startIndex;Ut(I,[m],L,{editorOptions:this.options}),T.push(m)};for(let m=0;m<t.length;m++){const I=t[m];if(I.type===l.ElementType.CONTROL&&I.control){const L=I,P=L.controlId||lt(),O=L.control?.value||[],S=L.control?.type===l.ControlType.TEXTFIELD,F={...g,controlId:P,type:l.ElementType.CONTROL,control:L.control,originControlId:u},N=S?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,V=S?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX,Y=S?L.control?.preTextFix||this.options.control.preTextFix:L.control?.prefix||this.options.control.prefix;for(let b=0;b<Y.length;b++){const E={...F,value:Y[b],controlComponent:N};p(E)}for(let b=0;b<O.length;b++){const E=O[b],C={...F,...E,controlComponent:l.ControlComponent.VALUE,type:E.type};(C.color===this.options.control.textFixColor||C.color===this.options.control.placeholderColor)&&(C.color=this.options.defaultColor),p(C)}if(O.length===0){const b=L.control?.placeholder||"";for(let E=0;E<b.length;E++){const C={...F,value:b[E],controlComponent:l.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};p(C)}}const X=S?L.control?.postTextFix||this.options.control.postTextFix:L.control?.postfix||this.options.control.postfix;for(let b=0;b<X.length;b++){const E={...F,value:X[b],controlComponent:V};p(E)}}else if(I.type||I.value){g.color=this.options.defaultColor;const L={...g,...I,controlComponent:l.ControlComponent.VALUE};(L.color===this.options.control.textFixColor||L.color===this.options.control.placeholderColor)&&(L.color=this.options.defaultColor),p(L)}}return T.length&&c.spliceElementList(i,f,0,T),r.startIndex+T.length}clearValue(t={},e={}){if(!e.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),i=t.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:r,endIndex:s}=i;return this.control.getDraw().spliceElementList(n,r+1,s-r,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(r,t)),r}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange(),i=n.startIndex,r=n.endIndex;if(t.key===l.KeyMap.Backspace&&i===r&&i>0){const p=e[i-1],m=p?.controlComponent===l.ControlComponent.POSTFIX||p?.controlComponent===l.ControlComponent.POSTTEXTFIX,I=p?.controlComponent===l.ControlComponent.PLACEHOLDER,L=!!p?.controlId,O=this.draws.getPosition().getPositionList(),S=O[i],F=O[i-1],N=S&&F&&S.rowIndex===F.rowIndex;if((m||I)&&L&&N)return this.control.removeControl(i-1)}this.control.shrinkBoundary();const{startIndex:s,endIndex:a}=n,c=e[s],d=this.control.getDraw(),R=e[a+1],u=!!c?.originControlId&&!!c?.controlId&&c.originControlId!==c.controlId,h=u&&(c.controlComponent===l.ControlComponent.PREFIX||c.controlComponent===l.ControlComponent.PRE_TEXT||c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===l.ControlComponent.POSTFIX||c.controlComponent===l.ControlComponent.POST_TEXT||c.controlComponent===l.ControlComponent.POSTTEXTFIX||c.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===l.ControlComponent.PLACEHOLDER||c.controlComponent===l.ControlComponent.TEXTFIXLABEL),g=u&&c.control?.type===l.ControlType.BUTTON&&c.controlComponent===l.ControlComponent.VALUE,f=!!R?.originControlId&&!!R?.controlId&&R.originControlId!==R.controlId&&(R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT||R.controlComponent===l.ControlComponent.PRETEXTFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||R.controlComponent===l.ControlComponent.PLACEHOLDER||R.controlComponent===l.ControlComponent.TEXTFIXLABEL),T=!!R?.originControlId&&!!R?.controlId&&R.originControlId!==R.controlId&&R.control?.type===l.ControlType.BUTTON;if(t.key===l.KeyMap.Backspace){if(s===a&&(h||g))return this.control.removeControl(s);if(this.options.mode===l.EditorMode.FORM)this.strikeout();else return s!==a?e.slice(s,a+1).some(I=>I.controlComponent===l.ControlComponent.POSTTEXTFIX||I.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)?s:(d.spliceElementList(e,s+1,a-s),this.getValue().length||this.control.addPlaceholder(s),s===0&&e[0].type===l.ElementType.SPLIT_TAG?d.fixPosition(!0)??s:s):c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===l.ControlComponent.POSTTEXTFIX||c.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===l.ControlComponent.TEXTFIXLABEL||c.controlComponent===l.ControlComponent.PLACEHOLDER?s:(d.spliceElementList(e,s,1),this.getValue().length||this.control.addPlaceholder(s-1),s===1&&e[0].type===l.ElementType.SPLIT_TAG||s===0?d.fixPosition(!0)??s-1:s-1)}else if(t.key===l.KeyMap.Delete){if(s===a&&(h||g))return this.control.removeControl(s);if(s===a&&(f||T))return this.control.removeControl(a+1);if(this.options.mode===l.EditorMode.FORM)this.strikeout();else return s!==a?(d.spliceElementList(e,s+1,a-s),this.getValue().length||this.control.addPlaceholder(s),s===0&&e[0].type===l.ElementType.SPLIT_TAG?d.fixPosition(!0)??s:s):(R||d.getTd()?.linkTdNextId&&c.controlId&&this.removeNextControlElement(c.controlId),R&&((c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)&&(R.controlComponent===l.ControlComponent.PLACEHOLDER||R.controlComponent===l.ControlComponent.TEXTFIXLABEL)||R.controlComponent===l.ControlComponent.POSTTEXTFIX||R.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===l.ControlComponent.PLACEHOLDER||c.controlComponent===l.ControlComponent.TEXTFIXLABEL)?s:(d.spliceElementList(e,s+1,1),this.getValue().length||this.control.addPlaceholder(s),s===0&&e[0].type===l.ElementType.SPLIT_TAG?d.fixPosition(!0)??s:s))}return a}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}strikeout(t,e={},n={}){const{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return;const s=this.ranges.getSelectionElementList(),a=this.position.getCursorPosition(),c=q(new Date).format("YYYY-MM-DD HH:mm:ss");if(s?.length){if(!this.element.strikeout){const d=s.findIndex(R=>!R.strikeout);s.forEach(R=>{R.deletePerson="SWJ",R.deleteTime=c,R.strikeout=!!~d}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),setTimeout(()=>{this.strikeoute()},100)}}else{const d=this.control.getElementList()[a.index];if(!this.control.getElementList()[a.index].strikeout&&d?.metrics.width>0){this.control.getElementList()[a.index].strikeout=!0,this.control.getElementList()[a.index].deletePerson="SWJ",this.control.getElementList()[a.index].deleteTime=c;const R=--a.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const h=R;this.draws.render({curIndex:h,isSetCursor:!0}),a.index=R,this.position.setCursorPosition(a),this.ranges.setRange(R,R)},100)}else{const{elementList:R,range:u}=this.control.mergeControl(n),h=u.startIndex;if(h>=0&&h<R.length&&R[h]?.metrics?.width!==void 0&&R[h].metrics.width<=0&&!R[h]?.strikeout){this.draws.spliceElementList(R,u.startIndex,1,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule});const g=!0,f=u.startIndex-1;this.draws.render({curIndex:f,isSetCursor:g}),a.index=f,delete a.value,this.position.setCursorPosition(a),this.ranges.setRange(f,f)}}}}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:r}=this.ranges.getRange(),a=this.draws.getElementList()[r];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}const Th={indent:"        ",divider:"────────────────"};class ur{draw;element;control;options;isPopup;inputModal=null;constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:r,endIndex:s}=n;for(let a=r;a<=s;a++){const c=e[a];c.controlComponent===l.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e),s=this.control.getDraw(),{startIndex:a}=r,d=i[a].controlId;let R=a;for(let m=a;m>=0;m--){const I=i[m];if(I.controlId!==d)break;if(I.controlComponent===l.ControlComponent.PREFIX){R=m;break}}let u=a;for(let m=a;m<i.length;m++){const I=i[m];if(I.controlId!==d){u=m;break}if(I.controlComponent===l.ControlComponent.POSTFIX){u=m;break}}const h=R+1,g=u-1;g>=h&&s.spliceElementList(i,h,g-h+1);const f=i[R],T=Dt(f,["control","controlId",...Gt]),p=R+1;for(let m=0;m<t.length;m++){const I={...T,...t[m],value:t[m].value===`
105
- `?_:t[m].value,controlComponent:l.ControlComponent.VALUE};(I.color===this.options.control.bracketColor||I.color===this.options.control.placeholderColor)&&(I.color=this.options.defaultColor),Ut(i,[I],R,{editorOptions:this.options}),s.spliceElementList(i,p+m,0,[I])}return p+t.length-1}keydown(t){if(this.control.getIsDisabledControl()||this.options.mode===l.EditorMode.FORM)return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i}=n,r=e[i];if(t.key===l.KeyMap.Backspace||t.key===l.KeyMap.Delete){const s=r.controlId;let a=i,c=i;for(;a>0&&e[a-1].controlId===s;)a--;for(;c<e.length-1&&e[c+1].controlId===s;)c++;return this.draw.spliceElementList(e,a,c-a+1),a>0?a-1:0}return null}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}awake(){if(this.options.mode===l.EditorMode.PRINT||this.isPopup||this.control.getIsDisabledControl())return;let t=!1;const e=this.control.getElementList(),n=this.element.controlId;for(let i=0;i<e.length;i++){const r=e[i];r.controlId===n&&r.control&&r.control._justCreated&&(t=!0,delete r.control._justCreated)}t||this.showMenstrualHistoryDialog()}generateDisplayText(t){const{indent:e,divider:n}=Th,{isMenopause:i,periodMin:r,periodMax:s,menarcheAge:a,cycleMin:c,cycleMax:d}=t,R=`${e}月经持续${r}~${s}天`,u=`${e}生理周期持续${c}~${d}天${_}`;let h;return i?h=`初潮年龄${a}岁${n}闭经年龄${t.menopauseAge||"_"}岁`:h=`初潮年龄${a}岁${n}末次日期${t.lastPeriod||"____-__-__"}`,`${_} ${R}
104
+ `+new Error().stack),e=!1}return t.apply(this,arguments)},t)}var Is={};function Ps(o,t){q.deprecationHandler!=null&&q.deprecationHandler(o,t),Is[o]||(Ls(t),Is[o]=!0)}q.suppressDeprecationWarnings=!1,q.deprecationHandler=null;function Le(o){return typeof Function<"u"&&o instanceof Function||Object.prototype.toString.call(o)==="[object Function]"}function Lc(o){var t,e;for(e in o)Mt(o,e)&&(t=o[e],Le(t)?this[e]=t:this["_"+e]=t);this._config=o,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function qo(o,t){var e=Ze({},o),n;for(n in t)Mt(t,n)&&(Ae(o[n])&&Ae(t[n])?(e[n]={},Ze(e[n],o[n]),Ze(e[n],t[n])):t[n]!=null?e[n]=t[n]:delete e[n]);for(n in o)Mt(o,n)&&!Mt(t,n)&&Ae(o[n])&&(e[n]=Ze({},e[n]));return e}function ti(o){o!=null&&this.set(o)}var ei;Object.keys?ei=Object.keys:ei=function(o){var t,e=[];for(t in o)Mt(o,t)&&e.push(t);return e};var Ic={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Pc(o,t,e){var n=this._calendar[o]||this._calendar.sameElse;return Le(n)?n.call(t,e):n}function Ie(o,t,e){var n=""+Math.abs(o),i=t-n.length,r=o>=0;return(r?e?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var ni=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Bn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,oi={},cn={};function rt(o,t,e,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),o&&(cn[o]=i),t&&(cn[t[0]]=function(){return Ie(i.apply(this,arguments),t[1],t[2])}),e&&(cn[e]=function(){return this.localeData().ordinal(i.apply(this,arguments),o)})}function Mc(o){return o.match(/\[[\s\S]/)?o.replace(/^\[|\]$/g,""):o.replace(/\\/g,"")}function Oc(o){var t=o.match(ni),e,n;for(e=0,n=t.length;e<n;e++)cn[t[e]]?t[e]=cn[t[e]]:t[e]=Mc(t[e]);return function(i){var r="",s;for(s=0;s<n;s++)r+=Le(t[s])?t[s].call(i,o):t[s];return r}}function $n(o,t){return o.isValid()?(t=Ms(t,o.localeData()),oi[t]=oi[t]||Oc(t),oi[t](o)):o.localeData().invalidDate()}function Ms(o,t){var e=5;function n(i){return t.longDateFormat(i)||i}for(Bn.lastIndex=0;e>=0&&Bn.test(o);)o=o.replace(Bn,n),Bn.lastIndex=0,e-=1;return o}var Cc={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Sc(o){var t=this._longDateFormat[o],e=this._longDateFormat[o.toUpperCase()];return t||!e?t:(this._longDateFormat[o]=e.match(ni).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[o])}var Ec="Invalid date";function Xc(){return this._invalidDate}var Nc="%d",Fc=/\d{1,2}/;function yc(o){return this._ordinal.replace("%d",o)}var bc={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Wc(o,t,e,n){var i=this._relativeTime[e];return Le(i)?i(o,t,e,n):i.replace(/%d/i,o)}function Vc(o,t){var e=this._relativeTime[o>0?"future":"past"];return Le(e)?e(t):e.replace(/%s/i,t)}var Os={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ee(o){return typeof o=="string"?Os[o]||Os[o.toLowerCase()]:void 0}function ii(o){var t={},e,n;for(n in o)Mt(o,n)&&(e=ee(n),e&&(t[e]=o[n]));return t}var Yc={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Dc(o){var t=[],e;for(e in o)Mt(o,e)&&t.push({unit:e,priority:Yc[e]});return t.sort(function(n,i){return n.priority-i.priority}),t}var Cs=/\d/,zt=/\d\d/,Ss=/\d{3}/,si=/\d{4}/,zn=/[+-]?\d{6}/,Nt=/\d\d?/,Es=/\d\d\d\d?/,Xs=/\d\d\d\d\d\d?/,jn=/\d{1,3}/,ri=/\d{1,4}/,qn=/[+-]?\d{1,6}/,dn=/\d+/,to=/[+-]?\d+/,Uc=/Z|[+-]\d\d:?\d\d/gi,eo=/Z|[+-]\d\d(?::?\d\d)?/gi,wc=/[+-]?\d+(\.\d{1,3})?/,En=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Rn=/^[1-9]\d?/,li=/^([1-9]\d|\d)/,no;no={};function ot(o,t,e){no[o]=Le(t)?t:function(n,i){return n&&e?e:t}}function Zc(o,t){return Mt(no,o)?no[o](t._strict,t._locale):new RegExp(Qc(o))}function Qc(o){return Ce(o.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,r){return e||n||i||r}))}function Ce(o){return o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ne(o){return o<0?Math.ceil(o)||0:Math.floor(o)}function ft(o){var t=+o,e=0;return t!==0&&isFinite(t)&&(e=ne(t)),e}var ai={};function Et(o,t){var e,n=t,i;for(typeof o=="string"&&(o=[o]),Oe(t)&&(n=function(r,s){s[t]=ft(r)}),i=o.length,e=0;e<i;e++)ai[o[e]]=n}function Xn(o,t){Et(o,function(e,n,i,r){i._w=i._w||{},t(e,i._w,i,r)})}function vc(o,t,e){t!=null&&Mt(ai,o)&&ai[o](t,e._a,e,o)}function oo(o){return o%4===0&&o%100!==0||o%400===0}var xt=0,Se=1,Pe=2,vt=3,ae=4,Ee=5,ke=6,Kc=7,Hc=8;rt("Y",0,0,function(){var o=this.year();return o<=9999?Ie(o,4):"+"+o}),rt(0,["YY",2],0,function(){return this.year()%100}),rt(0,["YYYY",4],0,"year"),rt(0,["YYYYY",5],0,"year"),rt(0,["YYYYYY",6,!0],0,"year"),ot("Y",to),ot("YY",Nt,zt),ot("YYYY",ri,si),ot("YYYYY",qn,zn),ot("YYYYYY",qn,zn),Et(["YYYYY","YYYYYY"],xt),Et("YYYY",function(o,t){t[xt]=o.length===2?q.parseTwoDigitYear(o):ft(o)}),Et("YY",function(o,t){t[xt]=q.parseTwoDigitYear(o)}),Et("Y",function(o,t){t[xt]=parseInt(o,10)});function Nn(o){return oo(o)?366:365}q.parseTwoDigitYear=function(o){return ft(o)+(ft(o)>68?1900:2e3)};var Ns=un("FullYear",!0);function _c(){return oo(this.year())}function un(o,t){return function(e){return e!=null?(Fs(this,o,e),q.updateOffset(this,t),this):Fn(this,o)}}function Fn(o,t){if(!o.isValid())return NaN;var e=o._d,n=o._isUTC;switch(t){case"Milliseconds":return n?e.getUTCMilliseconds():e.getMilliseconds();case"Seconds":return n?e.getUTCSeconds():e.getSeconds();case"Minutes":return n?e.getUTCMinutes():e.getMinutes();case"Hours":return n?e.getUTCHours():e.getHours();case"Date":return n?e.getUTCDate():e.getDate();case"Day":return n?e.getUTCDay():e.getDay();case"Month":return n?e.getUTCMonth():e.getMonth();case"FullYear":return n?e.getUTCFullYear():e.getFullYear();default:return NaN}}function Fs(o,t,e){var n,i,r,s,a;if(!(!o.isValid()||isNaN(e))){switch(n=o._d,i=o._isUTC,t){case"Milliseconds":return void(i?n.setUTCMilliseconds(e):n.setMilliseconds(e));case"Seconds":return void(i?n.setUTCSeconds(e):n.setSeconds(e));case"Minutes":return void(i?n.setUTCMinutes(e):n.setMinutes(e));case"Hours":return void(i?n.setUTCHours(e):n.setHours(e));case"Date":return void(i?n.setUTCDate(e):n.setDate(e));case"FullYear":break;default:return}r=e,s=o.month(),a=o.date(),a=a===29&&s===1&&!oo(r)?28:a,i?n.setUTCFullYear(r,s,a):n.setFullYear(r,s,a)}}function xc(o){return o=ee(o),Le(this[o])?this[o]():this}function Gc(o,t){if(typeof o=="object"){o=ii(o);var e=Dc(o),n,i=e.length;for(n=0;n<i;n++)this[e[n].unit](o[e[n].unit])}else if(o=ee(o),Le(this[o]))return this[o](t);return this}function Ac(o,t){return(o%t+t)%t}var wt;Array.prototype.indexOf?wt=Array.prototype.indexOf:wt=function(o){var t;for(t=0;t<this.length;++t)if(this[t]===o)return t;return-1};function ci(o,t){if(isNaN(o)||isNaN(t))return NaN;var e=Ac(t,12);return o+=(t-e)/12,e===1?oo(o)?29:28:31-e%7%2}rt("M",["MM",2],"Mo",function(){return this.month()+1}),rt("MMM",0,0,function(o){return this.localeData().monthsShort(this,o)}),rt("MMMM",0,0,function(o){return this.localeData().months(this,o)}),ot("M",Nt,Rn),ot("MM",Nt,zt),ot("MMM",function(o,t){return t.monthsShortRegex(o)}),ot("MMMM",function(o,t){return t.monthsRegex(o)}),Et(["M","MM"],function(o,t){t[Se]=ft(o)-1}),Et(["MMM","MMMM"],function(o,t,e,n){var i=e._locale.monthsParse(o,n,e._strict);i!=null?t[Se]=i:Rt(e).invalidMonth=o});var kc="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ys="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),bs=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Jc=En,Bc=En;function $c(o,t){return o?re(this._months)?this._months[o.month()]:this._months[(this._months.isFormat||bs).test(t)?"format":"standalone"][o.month()]:re(this._months)?this._months:this._months.standalone}function zc(o,t){return o?re(this._monthsShort)?this._monthsShort[o.month()]:this._monthsShort[bs.test(t)?"format":"standalone"][o.month()]:re(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function jc(o,t,e){var n,i,r,s=o.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=pe([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return e?t==="MMM"?(i=wt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=wt.call(this._longMonthsParse,s),i!==-1?i:null):t==="MMM"?(i=wt.call(this._shortMonthsParse,s),i!==-1?i:(i=wt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=wt.call(this._longMonthsParse,s),i!==-1?i:(i=wt.call(this._shortMonthsParse,s),i!==-1?i:null))}function qc(o,t,e){var n,i,r;if(this._monthsParseExact)return jc.call(this,o,t,e);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=pe([2e3,n]),e&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!e&&!this._monthsParse[n]&&(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),e&&t==="MMMM"&&this._longMonthsParse[n].test(o))return n;if(e&&t==="MMM"&&this._shortMonthsParse[n].test(o))return n;if(!e&&this._monthsParse[n].test(o))return n}}function Ws(o,t){if(!o.isValid())return o;if(typeof t=="string"){if(/^\d+$/.test(t))t=ft(t);else if(t=o.localeData().monthsParse(t),!Oe(t))return o}var e=t,n=o.date();return n=n<29?n:Math.min(n,ci(o.year(),e)),o._isUTC?o._d.setUTCMonth(e,n):o._d.setMonth(e,n),o}function Vs(o){return o!=null?(Ws(this,o),q.updateOffset(this,!0),this):Fn(this,"Month")}function td(){return ci(this.year(),this.month())}function ed(o){return this._monthsParseExact?(Mt(this,"_monthsRegex")||Ys.call(this),o?this._monthsShortStrictRegex:this._monthsShortRegex):(Mt(this,"_monthsShortRegex")||(this._monthsShortRegex=Jc),this._monthsShortStrictRegex&&o?this._monthsShortStrictRegex:this._monthsShortRegex)}function nd(o){return this._monthsParseExact?(Mt(this,"_monthsRegex")||Ys.call(this),o?this._monthsStrictRegex:this._monthsRegex):(Mt(this,"_monthsRegex")||(this._monthsRegex=Bc),this._monthsStrictRegex&&o?this._monthsStrictRegex:this._monthsRegex)}function Ys(){function o(c,d){return d.length-c.length}var t=[],e=[],n=[],i,r,s,a;for(i=0;i<12;i++)r=pe([2e3,i]),s=Ce(this.monthsShort(r,"")),a=Ce(this.months(r,"")),t.push(s),e.push(a),n.push(a),n.push(s);t.sort(o),e.sort(o),n.sort(o),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function od(o,t,e,n,i,r,s){var a;return o<100&&o>=0?(a=new Date(o+400,t,e,n,i,r,s),isFinite(a.getFullYear())&&a.setFullYear(o)):a=new Date(o,t,e,n,i,r,s),a}function yn(o){var t,e;return o<100&&o>=0?(e=Array.prototype.slice.call(arguments),e[0]=o+400,t=new Date(Date.UTC.apply(null,e)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(o)):t=new Date(Date.UTC.apply(null,arguments)),t}function io(o,t,e){var n=7+t-e,i=(7+yn(o,0,n).getUTCDay()-t)%7;return-i+n-1}function Ds(o,t,e,n,i){var r=(7+e-n)%7,s=io(o,n,i),a=1+7*(t-1)+r+s,c,d;return a<=0?(c=o-1,d=Nn(c)+a):a>Nn(o)?(c=o+1,d=a-Nn(o)):(c=o,d=a),{year:c,dayOfYear:d}}function bn(o,t,e){var n=io(o.year(),t,e),i=Math.floor((o.dayOfYear()-n-1)/7)+1,r,s;return i<1?(s=o.year()-1,r=i+Xe(s,t,e)):i>Xe(o.year(),t,e)?(r=i-Xe(o.year(),t,e),s=o.year()+1):(s=o.year(),r=i),{week:r,year:s}}function Xe(o,t,e){var n=io(o,t,e),i=io(o+1,t,e);return(Nn(o)-n+i)/7}rt("w",["ww",2],"wo","week"),rt("W",["WW",2],"Wo","isoWeek"),ot("w",Nt,Rn),ot("ww",Nt,zt),ot("W",Nt,Rn),ot("WW",Nt,zt),Xn(["w","ww","W","WW"],function(o,t,e,n){t[n.substr(0,1)]=ft(o)});function id(o){return bn(o,this._week.dow,this._week.doy).week}var sd={dow:0,doy:6};function rd(){return this._week.dow}function ld(){return this._week.doy}function ad(o){var t=this.localeData().week(this);return o==null?t:this.add((o-t)*7,"d")}function cd(o){var t=bn(this,1,4).week;return o==null?t:this.add((o-t)*7,"d")}rt("d",0,"do","day"),rt("dd",0,0,function(o){return this.localeData().weekdaysMin(this,o)}),rt("ddd",0,0,function(o){return this.localeData().weekdaysShort(this,o)}),rt("dddd",0,0,function(o){return this.localeData().weekdays(this,o)}),rt("e",0,0,"weekday"),rt("E",0,0,"isoWeekday"),ot("d",Nt),ot("e",Nt),ot("E",Nt),ot("dd",function(o,t){return t.weekdaysMinRegex(o)}),ot("ddd",function(o,t){return t.weekdaysShortRegex(o)}),ot("dddd",function(o,t){return t.weekdaysRegex(o)}),Xn(["dd","ddd","dddd"],function(o,t,e,n){var i=e._locale.weekdaysParse(o,n,e._strict);i!=null?t.d=i:Rt(e).invalidWeekday=o}),Xn(["d","e","E"],function(o,t,e,n){t[n]=ft(o)});function dd(o,t){return typeof o!="string"?o:isNaN(o)?(o=t.weekdaysParse(o),typeof o=="number"?o:null):parseInt(o,10)}function Rd(o,t){return typeof o=="string"?t.weekdaysParse(o)%7||7:isNaN(o)?null:o}function di(o,t){return o.slice(t,7).concat(o.slice(0,t))}var ud="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Us="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),hd="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),gd=En,fd=En,Td=En;function md(o,t){var e=re(this._weekdays)?this._weekdays:this._weekdays[o&&o!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return o===!0?di(e,this._week.dow):o?e[o.day()]:e}function pd(o){return o===!0?di(this._weekdaysShort,this._week.dow):o?this._weekdaysShort[o.day()]:this._weekdaysShort}function Ld(o){return o===!0?di(this._weekdaysMin,this._week.dow):o?this._weekdaysMin[o.day()]:this._weekdaysMin}function Id(o,t,e){var n,i,r,s=o.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=pe([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return e?t==="dddd"?(i=wt.call(this._weekdaysParse,s),i!==-1?i:null):t==="ddd"?(i=wt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=wt.call(this._minWeekdaysParse,s),i!==-1?i:null):t==="dddd"?(i=wt.call(this._weekdaysParse,s),i!==-1||(i=wt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=wt.call(this._minWeekdaysParse,s),i!==-1?i:null)):t==="ddd"?(i=wt.call(this._shortWeekdaysParse,s),i!==-1||(i=wt.call(this._weekdaysParse,s),i!==-1)?i:(i=wt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=wt.call(this._minWeekdaysParse,s),i!==-1||(i=wt.call(this._weekdaysParse,s),i!==-1)?i:(i=wt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function Pd(o,t,e){var n,i,r;if(this._weekdaysParseExact)return Id.call(this,o,t,e);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=pe([2e3,1]).day(n),e&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),e&&t==="dddd"&&this._fullWeekdaysParse[n].test(o))return n;if(e&&t==="ddd"&&this._shortWeekdaysParse[n].test(o))return n;if(e&&t==="dd"&&this._minWeekdaysParse[n].test(o))return n;if(!e&&this._weekdaysParse[n].test(o))return n}}function Md(o){if(!this.isValid())return o!=null?this:NaN;var t=Fn(this,"Day");return o!=null?(o=dd(o,this.localeData()),this.add(o-t,"d")):t}function Od(o){if(!this.isValid())return o!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return o==null?t:this.add(o-t,"d")}function Cd(o){if(!this.isValid())return o!=null?this:NaN;if(o!=null){var t=Rd(o,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Sd(o){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||Ri.call(this),o?this._weekdaysStrictRegex:this._weekdaysRegex):(Mt(this,"_weekdaysRegex")||(this._weekdaysRegex=gd),this._weekdaysStrictRegex&&o?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ed(o){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||Ri.call(this),o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Mt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=fd),this._weekdaysShortStrictRegex&&o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Xd(o){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||Ri.call(this),o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Mt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Td),this._weekdaysMinStrictRegex&&o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ri(){function o(R,u){return u.length-R.length}var t=[],e=[],n=[],i=[],r,s,a,c,d;for(r=0;r<7;r++)s=pe([2e3,1]).day(r),a=Ce(this.weekdaysMin(s,"")),c=Ce(this.weekdaysShort(s,"")),d=Ce(this.weekdays(s,"")),t.push(a),e.push(c),n.push(d),i.push(a),i.push(c),i.push(d);t.sort(o),e.sort(o),n.sort(o),i.sort(o),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ui(){return this.hours()%12||12}function Nd(){return this.hours()||24}rt("H",["HH",2],0,"hour"),rt("h",["hh",2],0,ui),rt("k",["kk",2],0,Nd),rt("hmm",0,0,function(){return""+ui.apply(this)+Ie(this.minutes(),2)}),rt("hmmss",0,0,function(){return""+ui.apply(this)+Ie(this.minutes(),2)+Ie(this.seconds(),2)}),rt("Hmm",0,0,function(){return""+this.hours()+Ie(this.minutes(),2)}),rt("Hmmss",0,0,function(){return""+this.hours()+Ie(this.minutes(),2)+Ie(this.seconds(),2)});function ws(o,t){rt(o,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}ws("a",!0),ws("A",!1);function Zs(o,t){return t._meridiemParse}ot("a",Zs),ot("A",Zs),ot("H",Nt,li),ot("h",Nt,Rn),ot("k",Nt,Rn),ot("HH",Nt,zt),ot("hh",Nt,zt),ot("kk",Nt,zt),ot("hmm",Es),ot("hmmss",Xs),ot("Hmm",Es),ot("Hmmss",Xs),Et(["H","HH"],vt),Et(["k","kk"],function(o,t,e){var n=ft(o);t[vt]=n===24?0:n}),Et(["a","A"],function(o,t,e){e._isPm=e._locale.isPM(o),e._meridiem=o}),Et(["h","hh"],function(o,t,e){t[vt]=ft(o),Rt(e).bigHour=!0}),Et("hmm",function(o,t,e){var n=o.length-2;t[vt]=ft(o.substr(0,n)),t[ae]=ft(o.substr(n)),Rt(e).bigHour=!0}),Et("hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[vt]=ft(o.substr(0,n)),t[ae]=ft(o.substr(n,2)),t[Ee]=ft(o.substr(i)),Rt(e).bigHour=!0}),Et("Hmm",function(o,t,e){var n=o.length-2;t[vt]=ft(o.substr(0,n)),t[ae]=ft(o.substr(n))}),Et("Hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[vt]=ft(o.substr(0,n)),t[ae]=ft(o.substr(n,2)),t[Ee]=ft(o.substr(i))});function Fd(o){return(o+"").toLowerCase().charAt(0)==="p"}var yd=/[ap]\.?m?\.?/i,bd=un("Hours",!0);function Wd(o,t,e){return o>11?e?"pm":"PM":e?"am":"AM"}var Qs={calendar:Ic,longDateFormat:Cc,invalidDate:Ec,ordinal:Nc,dayOfMonthOrdinalParse:Fc,relativeTime:bc,months:kc,monthsShort:ys,week:sd,weekdays:ud,weekdaysMin:hd,weekdaysShort:Us,meridiemParse:yd},Wt={},Wn={},Vn;function Vd(o,t){var e,n=Math.min(o.length,t.length);for(e=0;e<n;e+=1)if(o[e]!==t[e])return e;return n}function vs(o){return o&&o.toLowerCase().replace("_","-")}function Yd(o){for(var t=0,e,n,i,r;t<o.length;){for(r=vs(o[t]).split("-"),e=r.length,n=vs(o[t+1]),n=n?n.split("-"):null;e>0;){if(i=so(r.slice(0,e).join("-")),i)return i;if(n&&n.length>=e&&Vd(r,n)>=e-1)break;e--}t++}return Vn}function Dd(o){return!!(o&&o.match("^[^/\\\\]*$"))}function so(o){var t=null,e;if(Wt[o]===void 0&&typeof module<"u"&&module&&module.exports&&Dd(o))try{t=Vn._abbr,e=require,e("./locale/"+o),Qe(t)}catch{Wt[o]=null}return Wt[o]}function Qe(o,t){var e;return o&&(kt(t)?e=Ne(o):e=hi(o,t),e?Vn=e:typeof console<"u"&&console.warn&&console.warn("Locale "+o+" not found. Did you forget to load it?")),Vn._abbr}function hi(o,t){if(t!==null){var e,n=Qs;if(t.abbr=o,Wt[o]!=null)Ps("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Wt[o]._config;else if(t.parentLocale!=null)if(Wt[t.parentLocale]!=null)n=Wt[t.parentLocale]._config;else if(e=so(t.parentLocale),e!=null)n=e._config;else return Wn[t.parentLocale]||(Wn[t.parentLocale]=[]),Wn[t.parentLocale].push({name:o,config:t}),null;return Wt[o]=new ti(qo(n,t)),Wn[o]&&Wn[o].forEach(function(i){hi(i.name,i.config)}),Qe(o),Wt[o]}else return delete Wt[o],null}function Ud(o,t){if(t!=null){var e,n,i=Qs;Wt[o]!=null&&Wt[o].parentLocale!=null?Wt[o].set(qo(Wt[o]._config,t)):(n=so(o),n!=null&&(i=n._config),t=qo(i,t),n==null&&(t.abbr=o),e=new ti(t),e.parentLocale=Wt[o],Wt[o]=e),Qe(o)}else Wt[o]!=null&&(Wt[o].parentLocale!=null?(Wt[o]=Wt[o].parentLocale,o===Qe()&&Qe(o)):Wt[o]!=null&&delete Wt[o]);return Wt[o]}function Ne(o){var t;if(o&&o._locale&&o._locale._abbr&&(o=o._locale._abbr),!o)return Vn;if(!re(o)){if(t=so(o),t)return t;o=[o]}return Yd(o)}function wd(){return ei(Wt)}function gi(o){var t,e=o._a;return e&&Rt(o).overflow===-2&&(t=e[Se]<0||e[Se]>11?Se:e[Pe]<1||e[Pe]>ci(e[xt],e[Se])?Pe:e[vt]<0||e[vt]>24||e[vt]===24&&(e[ae]!==0||e[Ee]!==0||e[ke]!==0)?vt:e[ae]<0||e[ae]>59?ae:e[Ee]<0||e[Ee]>59?Ee:e[ke]<0||e[ke]>999?ke:-1,Rt(o)._overflowDayOfYear&&(t<xt||t>Pe)&&(t=Pe),Rt(o)._overflowWeeks&&t===-1&&(t=Kc),Rt(o)._overflowWeekday&&t===-1&&(t=Hc),Rt(o).overflow=t),o}var Zd=/^\s*((?:[+-]\d{6}|\d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P][SD]T)|([Zz])|([+-]\d{4}))$/,_d={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ks(o){var t,e,n=o._i,i=Zd.exec(n)||Qd.exec(n),r,s,a,c,d=ro.length,R=fi.length;if(i){for(Rt(o).iso=!0,t=0,e=d;t<e;t++)if(ro[t][1].exec(i[1])){s=ro[t][0],r=ro[t][2]!==!1;break}if(s==null){o._isValid=!1;return}if(i[3]){for(t=0,e=R;t<e;t++)if(fi[t][1].exec(i[3])){a=(i[2]||" ")+fi[t][0];break}if(a==null){o._isValid=!1;return}}if(!r&&a!=null){o._isValid=!1;return}if(i[4])if(vd.exec(i[4]))c="Z";else{o._isValid=!1;return}o._f=s+(a||"")+(c||""),mi(o)}else o._isValid=!1}function xd(o,t,e,n,i,r){var s=[Gd(o),ys.indexOf(t),parseInt(e,10),parseInt(n,10),parseInt(i,10)];return r&&s.push(parseInt(r,10)),s}function Gd(o){var t=parseInt(o,10);return t<=49?2e3+t:t<=999?1900+t:t}function Ad(o){return o.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function kd(o,t,e){if(o){var n=Us.indexOf(o),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return Rt(e).weekdayMismatch=!0,e._isValid=!1,!1}return!0}function Jd(o,t,e){if(o)return _d[o];if(t)return 0;var n=parseInt(e,10),i=n%100,r=(n-i)/100;return r*60+i}function Hs(o){var t=Hd.exec(Ad(o._i)),e;if(t){if(e=xd(t[4],t[3],t[2],t[5],t[6],t[7]),!kd(t[1],e,o))return;o._a=e,o._tzm=Jd(t[8],t[9],t[10]),o._d=yn.apply(null,o._a),o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),Rt(o).rfc2822=!0}else o._isValid=!1}function Bd(o){var t=Kd.exec(o._i);if(t!==null){o._d=new Date(+t[1]);return}if(Ks(o),o._isValid===!1)delete o._isValid;else return;if(Hs(o),o._isValid===!1)delete o._isValid;else return;o._strict?o._isValid=!1:q.createFromInputFallback(o)}q.createFromInputFallback=te("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(o){o._d=new Date(o._i+(o._useUTC?" UTC":""))});function hn(o,t,e){return o??t??e}function $d(o){var t=new Date(q.now());return o._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ti(o){var t,e,n=[],i,r,s;if(!o._d){for(i=$d(o),o._w&&o._a[Pe]==null&&o._a[Se]==null&&zd(o),o._dayOfYear!=null&&(s=hn(o._a[xt],i[xt]),(o._dayOfYear>Nn(s)||o._dayOfYear===0)&&(Rt(o)._overflowDayOfYear=!0),e=yn(s,0,o._dayOfYear),o._a[Se]=e.getUTCMonth(),o._a[Pe]=e.getUTCDate()),t=0;t<3&&o._a[t]==null;++t)o._a[t]=n[t]=i[t];for(;t<7;t++)o._a[t]=n[t]=o._a[t]==null?t===2?1:0:o._a[t];o._a[vt]===24&&o._a[ae]===0&&o._a[Ee]===0&&o._a[ke]===0&&(o._nextDay=!0,o._a[vt]=0),o._d=(o._useUTC?yn:od).apply(null,n),r=o._useUTC?o._d.getUTCDay():o._d.getDay(),o._tzm!=null&&o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),o._nextDay&&(o._a[vt]=24),o._w&&typeof o._w.d<"u"&&o._w.d!==r&&(Rt(o).weekdayMismatch=!0)}}function zd(o){var t,e,n,i,r,s,a,c,d;t=o._w,t.GG!=null||t.W!=null||t.E!=null?(r=1,s=4,e=hn(t.GG,o._a[xt],bn(Ft(),1,4).year),n=hn(t.W,1),i=hn(t.E,1),(i<1||i>7)&&(c=!0)):(r=o._locale._week.dow,s=o._locale._week.doy,d=bn(Ft(),r,s),e=hn(t.gg,o._a[xt],d.year),n=hn(t.w,d.week),t.d!=null?(i=t.d,(i<0||i>6)&&(c=!0)):t.e!=null?(i=t.e+r,(t.e<0||t.e>6)&&(c=!0)):i=r),n<1||n>Xe(e,r,s)?Rt(o)._overflowWeeks=!0:c!=null?Rt(o)._overflowWeekday=!0:(a=Ds(e,n,i,r,s),o._a[xt]=a.year,o._dayOfYear=a.dayOfYear)}q.ISO_8601=function(){},q.RFC_2822=function(){};function mi(o){if(o._f===q.ISO_8601){Ks(o);return}if(o._f===q.RFC_2822){Hs(o);return}o._a=[],Rt(o).empty=!0;var t=""+o._i,e,n,i,r,s,a=t.length,c=0,d,R;for(i=Ms(o._f,o._locale).match(ni)||[],R=i.length,e=0;e<R;e++)r=i[e],n=(t.match(Zc(r,o))||[])[0],n&&(s=t.substr(0,t.indexOf(n)),s.length>0&&Rt(o).unusedInput.push(s),t=t.slice(t.indexOf(n)+n.length),c+=n.length),cn[r]?(n?Rt(o).empty=!1:Rt(o).unusedTokens.push(r),vc(r,n,o)):o._strict&&!n&&Rt(o).unusedTokens.push(r);Rt(o).charsLeftOver=a-c,t.length>0&&Rt(o).unusedInput.push(t),o._a[vt]<=12&&Rt(o).bigHour===!0&&o._a[vt]>0&&(Rt(o).bigHour=void 0),Rt(o).parsedDateParts=o._a.slice(0),Rt(o).meridiem=o._meridiem,o._a[vt]=jd(o._locale,o._a[vt],o._meridiem),d=Rt(o).era,d!==null&&(o._a[xt]=o._locale.erasConvertYear(d,o._a[xt])),Ti(o),gi(o)}function jd(o,t,e){var n;return e==null?t:o.meridiemHour!=null?o.meridiemHour(t,e):(o.isPM!=null&&(n=o.isPM(e),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function qd(o){var t,e,n,i,r,s,a=!1,c=o._f.length;if(c===0){Rt(o).invalidFormat=!0,o._d=new Date(NaN);return}for(i=0;i<c;i++)r=0,s=!1,t=jo({},o),o._useUTC!=null&&(t._useUTC=o._useUTC),t._f=o._f[i],mi(t),$o(t)&&(s=!0),r+=Rt(t).charsLeftOver,r+=Rt(t).unusedTokens.length*10,Rt(t).score=r,a?r<n&&(n=r,e=t):(n==null||r<n||s)&&(n=r,e=t,s&&(a=!0));Ze(o,e||t)}function tR(o){if(!o._d){var t=ii(o._i),e=t.day===void 0?t.date:t.day;o._a=ms([t.year,t.month,e,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),Ti(o)}}function eR(o){var t=new Sn(gi(_s(o)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function _s(o){var t=o._i,e=o._f;return o._locale=o._locale||Ne(o._l),t===null||e===void 0&&t===""?Jn({nullInput:!0}):(typeof t=="string"&&(o._i=t=o._locale.preparse(t)),le(t)?new Sn(gi(t)):(Cn(t)?o._d=t:re(e)?qd(o):e?mi(o):nR(o),$o(o)||(o._d=null),o))}function nR(o){var t=o._i;kt(t)?o._d=new Date(q.now()):Cn(t)?o._d=new Date(t.valueOf()):typeof t=="string"?Bd(o):re(t)?(o._a=ms(t.slice(0),function(e){return parseInt(e,10)}),Ti(o)):Ae(t)?tR(o):Oe(t)?o._d=new Date(t):q.createFromInputFallback(o)}function xs(o,t,e,n,i){var r={};return(t===!0||t===!1)&&(n=t,t=void 0),(e===!0||e===!1)&&(n=e,e=void 0),(Ae(o)&&Jo(o)||re(o)&&o.length===0)&&(o=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=e,r._i=o,r._f=t,r._strict=n,eR(r)}function Ft(o,t,e,n){return xs(o,t,e,n,!1)}var oR=te("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=Ft.apply(null,arguments);return this.isValid()&&o.isValid()?o<this?this:o:Jn()}),iR=te("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=Ft.apply(null,arguments);return this.isValid()&&o.isValid()?o>this?this:o:Jn()});function Gs(o,t){var e,n;if(t.length===1&&re(t[0])&&(t=t[0]),!t.length)return Ft();for(e=t[0],n=1;n<t.length;++n)(!t[n].isValid()||t[n][o](e))&&(e=t[n]);return e}function sR(){var o=[].slice.call(arguments,0);return Gs("isBefore",o)}function rR(){var o=[].slice.call(arguments,0);return Gs("isAfter",o)}var lR=function(){return Date.now?Date.now():+new Date},Yn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function aR(o){var t,e=!1,n,i=Yn.length;for(t in o)if(Mt(o,t)&&!(wt.call(Yn,t)!==-1&&(o[t]==null||!isNaN(o[t]))))return!1;for(n=0;n<i;++n)if(o[Yn[n]]){if(e)return!1;parseFloat(o[Yn[n]])!==ft(o[Yn[n]])&&(e=!0)}return!0}function cR(){return this._isValid}function dR(){return ce(NaN)}function lo(o){var t=ii(o),e=t.year||0,n=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,s=t.day||0,a=t.hour||0,c=t.minute||0,d=t.second||0,R=t.millisecond||0;this._isValid=aR(t),this._milliseconds=+R+d*1e3+c*6e4+a*1e3*60*60,this._days=+s+r*7,this._months=+i+n*3+e*12,this._data={},this._locale=Ne(),this._bubble()}function ao(o){return o instanceof lo}function pi(o){return o<0?Math.round(-1*o)*-1:Math.round(o)}function RR(o,t,e){var n=Math.min(o.length,t.length),i=Math.abs(o.length-t.length),r=0,s;for(s=0;s<n;s++)ft(o[s])!==ft(t[s])&&r++;return r+i}function As(o,t){rt(o,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+Ie(~~(e/60),2)+t+Ie(~~e%60,2)})}As("Z",":"),As("ZZ",""),ot("Z",eo),ot("ZZ",eo),Et(["Z","ZZ"],function(o,t,e){e._useUTC=!0,e._tzm=Li(eo,o)});var uR=/([\+\-]|\d\d)/gi;function Li(o,t){var e=(t||"").match(o),n,i,r;return e===null?null:(n=e[e.length-1]||[],i=(n+"").match(uR)||["-",0,0],r=+(i[1]*60)+ft(i[2]),r===0?0:i[0]==="+"?r:-r)}function Ii(o,t){var e,n;return t._isUTC?(e=t.clone(),n=(le(o)||Cn(o)?o.valueOf():Ft(o).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+n),q.updateOffset(e,!1),e):Ft(o).local()}function Pi(o){return-Math.round(o._d.getTimezoneOffset())}q.updateOffset=function(){};function hR(o,t,e){var n=this._offset||0,i;if(!this.isValid())return o!=null?this:NaN;if(o!=null){if(typeof o=="string"){if(o=Li(eo,o),o===null)return this}else Math.abs(o)<16&&!e&&(o=o*60);return!this._isUTC&&t&&(i=Pi(this)),this._offset=o,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==o&&(!t||this._changeInProgress?$s(this,ce(o-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,q.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:Pi(this)}function gR(o,t){return o!=null?(typeof o!="string"&&(o=-o),this.utcOffset(o,t),this):-this.utcOffset()}function fR(o){return this.utcOffset(0,o)}function TR(o){return this._isUTC&&(this.utcOffset(0,o),this._isUTC=!1,o&&this.subtract(Pi(this),"m")),this}function mR(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var o=Li(Uc,this._i);o!=null?this.utcOffset(o):this.utcOffset(0,!0)}return this}function pR(o){return this.isValid()?(o=o?Ft(o).utcOffset():0,(this.utcOffset()-o)%60===0):!1}function LR(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function IR(){if(!kt(this._isDSTShifted))return this._isDSTShifted;var o={},t;return jo(o,this),o=_s(o),o._a?(t=o._isUTC?pe(o._a):Ft(o._a),this._isDSTShifted=this.isValid()&&RR(o._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function PR(){return this.isValid()?!this._isUTC:!1}function MR(){return this.isValid()?this._isUTC:!1}function ks(){return this.isValid()?this._isUTC&&this._offset===0:!1}var OR=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,CR=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ce(o,t){var e=o,n=null,i,r,s;return ao(o)?e={ms:o._milliseconds,d:o._days,M:o._months}:Oe(o)||!isNaN(+o)?(e={},t?e[t]=+o:e.milliseconds=+o):(n=OR.exec(o))?(i=n[1]==="-"?-1:1,e={y:0,d:ft(n[Pe])*i,h:ft(n[vt])*i,m:ft(n[ae])*i,s:ft(n[Ee])*i,ms:ft(pi(n[ke]*1e3))*i}):(n=CR.exec(o))?(i=n[1]==="-"?-1:1,e={y:Je(n[2],i),M:Je(n[3],i),w:Je(n[4],i),d:Je(n[5],i),h:Je(n[6],i),m:Je(n[7],i),s:Je(n[8],i)}):e==null?e={}:typeof e=="object"&&("from"in e||"to"in e)&&(s=SR(Ft(e.from),Ft(e.to)),e={},e.ms=s.milliseconds,e.M=s.months),r=new lo(e),ao(o)&&Mt(o,"_locale")&&(r._locale=o._locale),ao(o)&&Mt(o,"_isValid")&&(r._isValid=o._isValid),r}ce.fn=lo.prototype,ce.invalid=dR;function Je(o,t){var e=o&&parseFloat(o.replace(",","."));return(isNaN(e)?0:e)*t}function Js(o,t){var e={};return e.months=t.month()-o.month()+(t.year()-o.year())*12,o.clone().add(e.months,"M").isAfter(t)&&--e.months,e.milliseconds=+t-+o.clone().add(e.months,"M"),e}function SR(o,t){var e;return o.isValid()&&t.isValid()?(t=Ii(t,o),o.isBefore(t)?e=Js(o,t):(e=Js(t,o),e.milliseconds=-e.milliseconds,e.months=-e.months),e):{milliseconds:0,months:0}}function Bs(o,t){return function(e,n){var i,r;return n!==null&&!isNaN(+n)&&(Ps(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=e,e=n,n=r),i=ce(e,n),$s(this,i,o),this}}function $s(o,t,e,n){var i=t._milliseconds,r=pi(t._days),s=pi(t._months);o.isValid()&&(n=n??!0,s&&Ws(o,Fn(o,"Month")+s*e),r&&Fs(o,"Date",Fn(o,"Date")+r*e),i&&o._d.setTime(o._d.valueOf()+i*e),n&&q.updateOffset(o,r||s))}var ER=Bs(1,"add"),XR=Bs(-1,"subtract");function zs(o){return typeof o=="string"||o instanceof String}function NR(o){return le(o)||Cn(o)||zs(o)||Oe(o)||yR(o)||FR(o)||o===null||o===void 0}function FR(o){var t=Ae(o)&&!Jo(o),e=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,r,s=n.length;for(i=0;i<s;i+=1)r=n[i],e=e||Mt(o,r);return t&&e}function yR(o){var t=re(o),e=!1;return t&&(e=o.filter(function(n){return!Oe(n)&&zs(o)}).length===0),t&&e}function bR(o){var t=Ae(o)&&!Jo(o),e=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,r;for(i=0;i<n.length;i+=1)r=n[i],e=e||Mt(o,r);return t&&e}function WR(o,t){var e=o.diff(t,"days",!0);return e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"}function VR(o,t){arguments.length===1&&(arguments[0]?NR(arguments[0])?(o=arguments[0],t=void 0):bR(arguments[0])&&(t=arguments[0],o=void 0):(o=void 0,t=void 0));var e=o||Ft(),n=Ii(e,this).startOf("day"),i=q.calendarFormat(this,n)||"sameElse",r=t&&(Le(t[i])?t[i].call(this,e):t[i]);return this.format(r||this.localeData().calendar(i,this,Ft(e)))}function YR(){return new Sn(this)}function DR(o,t){var e=le(o)?o:Ft(o);return this.isValid()&&e.isValid()?(t=ee(t)||"millisecond",t==="millisecond"?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf()):!1}function UR(o,t){var e=le(o)?o:Ft(o);return this.isValid()&&e.isValid()?(t=ee(t)||"millisecond",t==="millisecond"?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf()):!1}function wR(o,t,e,n){var i=le(o)?o:Ft(o),r=le(t)?t:Ft(t);return this.isValid()&&i.isValid()&&r.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,e):!this.isBefore(i,e))&&(n[1]===")"?this.isBefore(r,e):!this.isAfter(r,e))):!1}function ZR(o,t){var e=le(o)?o:Ft(o),n;return this.isValid()&&e.isValid()?(t=ee(t)||"millisecond",t==="millisecond"?this.valueOf()===e.valueOf():(n=e.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf())):!1}function QR(o,t){return this.isSame(o,t)||this.isAfter(o,t)}function vR(o,t){return this.isSame(o,t)||this.isBefore(o,t)}function KR(o,t,e){var n,i,r;if(!this.isValid())return NaN;if(n=Ii(o,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,t=ee(t),t){case"year":r=co(this,n)/12;break;case"month":r=co(this,n);break;case"quarter":r=co(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-i)/864e5;break;case"week":r=(this-n-i)/6048e5;break;default:r=this-n}return e?r:ne(r)}function co(o,t){if(o.date()<t.date())return-co(t,o);var e=(t.year()-o.year())*12+(t.month()-o.month()),n=o.clone().add(e,"months"),i,r;return t-n<0?(i=o.clone().add(e-1,"months"),r=(t-n)/(n-i)):(i=o.clone().add(e+1,"months"),r=(t-n)/(i-n)),-(e+r)||0}q.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",q.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function HR(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function _R(o){if(!this.isValid())return null;var t=o!==!0,e=t?this.clone().utc():this;return e.year()<0||e.year()>9999?$n(e,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Le(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",$n(e,"Z")):$n(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function xR(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var o="moment",t="",e,n,i,r;return this.isLocal()||(o=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),e="["+o+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",r=t+'[")]',this.format(e+n+i+r)}function GR(o){o||(o=this.isUtc()?q.defaultFormatUtc:q.defaultFormat);var t=$n(this,o);return this.localeData().postformat(t)}function AR(o,t){return this.isValid()&&(le(o)&&o.isValid()||Ft(o).isValid())?ce({to:this,from:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function kR(o){return this.from(Ft(),o)}function JR(o,t){return this.isValid()&&(le(o)&&o.isValid()||Ft(o).isValid())?ce({from:this,to:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function BR(o){return this.to(Ft(),o)}function js(o){var t;return o===void 0?this._locale._abbr:(t=Ne(o),t!=null&&(this._locale=t),this)}var qs=te("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(o){return o===void 0?this.localeData():this.locale(o)});function tr(){return this._locale}var Ro=1e3,gn=60*Ro,uo=60*gn,er=(365*400+97)*24*uo;function fn(o,t){return(o%t+t)%t}function nr(o,t,e){return o<100&&o>=0?new Date(o+400,t,e)-er:new Date(o,t,e).valueOf()}function or(o,t,e){return o<100&&o>=0?Date.UTC(o+400,t,e)-er:Date.UTC(o,t,e)}function $R(o){var t,e;if(o=ee(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?or:nr,o){case"year":t=e(this.year(),0,1);break;case"quarter":t=e(this.year(),this.month()-this.month()%3,1);break;case"month":t=e(this.year(),this.month(),1);break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=e(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fn(t+(this._isUTC?0:this.utcOffset()*gn),uo);break;case"minute":t=this._d.valueOf(),t-=fn(t,gn);break;case"second":t=this._d.valueOf(),t-=fn(t,Ro);break}return this._d.setTime(t),q.updateOffset(this,!0),this}function zR(o){var t,e;if(o=ee(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?or:nr,o){case"year":t=e(this.year()+1,0,1)-1;break;case"quarter":t=e(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=e(this.year(),this.month()+1,1)-1;break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=e(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=uo-fn(t+(this._isUTC?0:this.utcOffset()*gn),uo)-1;break;case"minute":t=this._d.valueOf(),t+=gn-fn(t,gn)-1;break;case"second":t=this._d.valueOf(),t+=Ro-fn(t,Ro)-1;break}return this._d.setTime(t),q.updateOffset(this,!0),this}function jR(){return this._d.valueOf()-(this._offset||0)*6e4}function qR(){return Math.floor(this.valueOf()/1e3)}function tu(){return new Date(this.valueOf())}function eu(){var o=this;return[o.year(),o.month(),o.date(),o.hour(),o.minute(),o.second(),o.millisecond()]}function nu(){var o=this;return{years:o.year(),months:o.month(),date:o.date(),hours:o.hours(),minutes:o.minutes(),seconds:o.seconds(),milliseconds:o.milliseconds()}}function ou(){return this.isValid()?this.toISOString():null}function iu(){return $o(this)}function su(){return Ze({},Rt(this))}function ru(){return Rt(this).overflow}function lu(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}rt("N",0,0,"eraAbbr"),rt("NN",0,0,"eraAbbr"),rt("NNN",0,0,"eraAbbr"),rt("NNNN",0,0,"eraName"),rt("NNNNN",0,0,"eraNarrow"),rt("y",["y",1],"yo","eraYear"),rt("y",["yy",2],0,"eraYear"),rt("y",["yyy",3],0,"eraYear"),rt("y",["yyyy",4],0,"eraYear"),ot("N",Mi),ot("NN",Mi),ot("NNN",Mi),ot("NNNN",pu),ot("NNNNN",Lu),Et(["N","NN","NNN","NNNN","NNNNN"],function(o,t,e,n){var i=e._locale.erasParse(o,n,e._strict);i?Rt(e).era=i:Rt(e).invalidEra=o}),ot("y",dn),ot("yy",dn),ot("yyy",dn),ot("yyyy",dn),ot("yo",Iu),Et(["y","yy","yyy","yyyy"],xt),Et(["yo"],function(o,t,e,n){var i;e._locale._eraYearOrdinalRegex&&(i=o.match(e._locale._eraYearOrdinalRegex)),e._locale.eraYearOrdinalParse?t[xt]=e._locale.eraYearOrdinalParse(o,i):t[xt]=parseInt(o,10)});function au(o,t){var e,n,i,r=this._eras||Ne("en")._eras;for(e=0,n=r.length;e<n;++e)switch(typeof r[e].since==="string"&&(i=q(r[e].since).startOf("day"),r[e].since=i.valueOf()),typeof r[e].until){case"undefined":r[e].until=1/0;break;case"string":i=q(r[e].until).startOf("day").valueOf(),r[e].until=i.valueOf();break}return r}function cu(o,t,e){var n,i,r=this.eras(),s,a,c;for(o=o.toUpperCase(),n=0,i=r.length;n<i;++n)if(s=r[n].name.toUpperCase(),a=r[n].abbr.toUpperCase(),c=r[n].narrow.toUpperCase(),e)switch(t){case"N":case"NN":case"NNN":if(a===o)return r[n];break;case"NNNN":if(s===o)return r[n];break;case"NNNNN":if(c===o)return r[n];break}else if([s,a,c].indexOf(o)>=0)return r[n]}function du(o,t){var e=o.since<=o.until?1:-1;return t===void 0?q(o.since).year():q(o.since).year()+(t-o.offset)*e}function Ru(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].name;return""}function uu(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].narrow;return""}function hu(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].abbr;return""}function gu(){var o,t,e,n,i=this.localeData().eras();for(o=0,t=i.length;o<t;++o)if(e=i[o].since<=i[o].until?1:-1,n=this.clone().startOf("day").valueOf(),i[o].since<=n&&n<=i[o].until||i[o].until<=n&&n<=i[o].since)return(this.year()-q(i[o].since).year())*e+i[o].offset;return this.year()}function fu(o){return Mt(this,"_erasNameRegex")||Oi.call(this),o?this._erasNameRegex:this._erasRegex}function Tu(o){return Mt(this,"_erasAbbrRegex")||Oi.call(this),o?this._erasAbbrRegex:this._erasRegex}function mu(o){return Mt(this,"_erasNarrowRegex")||Oi.call(this),o?this._erasNarrowRegex:this._erasRegex}function Mi(o,t){return t.erasAbbrRegex(o)}function pu(o,t){return t.erasNameRegex(o)}function Lu(o,t){return t.erasNarrowRegex(o)}function Iu(o,t){return t._eraYearOrdinalRegex||dn}function Oi(){var o=[],t=[],e=[],n=[],i,r,s,a,c,d=this.eras();for(i=0,r=d.length;i<r;++i)s=Ce(d[i].name),a=Ce(d[i].abbr),c=Ce(d[i].narrow),t.push(s),o.push(a),e.push(c),n.push(s),n.push(a),n.push(c);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+e.join("|")+")","i")}rt(0,["gg",2],0,function(){return this.weekYear()%100}),rt(0,["GG",2],0,function(){return this.isoWeekYear()%100});function ho(o,t){rt(0,[o,o.length],0,t)}ho("gggg","weekYear"),ho("ggggg","weekYear"),ho("GGGG","isoWeekYear"),ho("GGGGG","isoWeekYear"),ot("G",to),ot("g",to),ot("GG",Nt,zt),ot("gg",Nt,zt),ot("GGGG",ri,si),ot("gggg",ri,si),ot("GGGGG",qn,zn),ot("ggggg",qn,zn),Xn(["gggg","ggggg","GGGG","GGGGG"],function(o,t,e,n){t[n.substr(0,2)]=ft(o)}),Xn(["gg","GG"],function(o,t,e,n){t[n]=q.parseTwoDigitYear(o)});function Pu(o){return ir.call(this,o,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Mu(o){return ir.call(this,o,this.isoWeek(),this.isoWeekday(),1,4)}function Ou(){return Xe(this.year(),1,4)}function Cu(){return Xe(this.isoWeekYear(),1,4)}function Su(){var o=this.localeData()._week;return Xe(this.year(),o.dow,o.doy)}function Eu(){var o=this.localeData()._week;return Xe(this.weekYear(),o.dow,o.doy)}function ir(o,t,e,n,i){var r;return o==null?bn(this,n,i).year:(r=Xe(o,n,i),t>r&&(t=r),Xu.call(this,o,t,e,n,i))}function Xu(o,t,e,n,i){var r=Ds(o,t,e,n,i),s=yn(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}rt("Q",0,"Qo","quarter"),ot("Q",Cs),Et("Q",function(o,t){t[Se]=(ft(o)-1)*3});function Nu(o){return o==null?Math.ceil((this.month()+1)/3):this.month((o-1)*3+this.month()%3)}rt("D",["DD",2],"Do","date"),ot("D",Nt,Rn),ot("DD",Nt,zt),ot("Do",function(o,t){return o?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Et(["D","DD"],Pe),Et("Do",function(o,t){t[Pe]=ft(o.match(Nt)[0])});var sr=un("Date",!0);rt("DDD",["DDDD",3],"DDDo","dayOfYear"),ot("DDD",jn),ot("DDDD",Ss),Et(["DDD","DDDD"],function(o,t,e){e._dayOfYear=ft(o)});function Fu(o){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return o==null?t:this.add(o-t,"d")}rt("m",["mm",2],0,"minute"),ot("m",Nt,li),ot("mm",Nt,zt),Et(["m","mm"],ae);var yu=un("Minutes",!1);rt("s",["ss",2],0,"second"),ot("s",Nt,li),ot("ss",Nt,zt),Et(["s","ss"],Ee);var bu=un("Seconds",!1);rt("S",0,0,function(){return~~(this.millisecond()/100)}),rt(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),rt(0,["SSS",3],0,"millisecond"),rt(0,["SSSS",4],0,function(){return this.millisecond()*10}),rt(0,["SSSSS",5],0,function(){return this.millisecond()*100}),rt(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),rt(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),rt(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),rt(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ot("S",jn,Cs),ot("SS",jn,zt),ot("SSS",jn,Ss);var ve,rr;for(ve="SSSS";ve.length<=9;ve+="S")ot(ve,dn);function Wu(o,t){t[ke]=ft(("0."+o)*1e3)}for(ve="S";ve.length<=9;ve+="S")Et(ve,Wu);rr=un("Milliseconds",!1),rt("z",0,0,"zoneAbbr"),rt("zz",0,0,"zoneName");function Vu(){return this._isUTC?"UTC":""}function Yu(){return this._isUTC?"Coordinated Universal Time":""}var k=Sn.prototype;k.add=ER,k.calendar=VR,k.clone=YR,k.diff=KR,k.endOf=zR,k.format=GR,k.from=AR,k.fromNow=kR,k.to=JR,k.toNow=BR,k.get=xc,k.invalidAt=ru,k.isAfter=DR,k.isBefore=UR,k.isBetween=wR,k.isSame=ZR,k.isSameOrAfter=QR,k.isSameOrBefore=vR,k.isValid=iu,k.lang=qs,k.locale=js,k.localeData=tr,k.max=iR,k.min=oR,k.parsingFlags=su,k.set=Gc,k.startOf=$R,k.subtract=XR,k.toArray=eu,k.toObject=nu,k.toDate=tu,k.toISOString=_R,k.inspect=xR,typeof Symbol<"u"&&Symbol.for!=null&&(k[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),k.toJSON=ou,k.toString=HR,k.unix=qR,k.valueOf=jR,k.creationData=lu,k.eraName=Ru,k.eraNarrow=uu,k.eraAbbr=hu,k.eraYear=gu,k.year=Ns,k.isLeapYear=_c,k.weekYear=Pu,k.isoWeekYear=Mu,k.quarter=k.quarters=Nu,k.month=Vs,k.daysInMonth=td,k.week=k.weeks=ad,k.isoWeek=k.isoWeeks=cd,k.weeksInYear=Su,k.weeksInWeekYear=Eu,k.isoWeeksInYear=Ou,k.isoWeeksInISOWeekYear=Cu,k.date=sr,k.day=k.days=Md,k.weekday=Od,k.isoWeekday=Cd,k.dayOfYear=Fu,k.hour=k.hours=bd,k.minute=k.minutes=yu,k.second=k.seconds=bu,k.millisecond=k.milliseconds=rr,k.utcOffset=hR,k.utc=fR,k.local=TR,k.parseZone=mR,k.hasAlignedHourOffset=pR,k.isDST=LR,k.isLocal=PR,k.isUtcOffset=MR,k.isUtc=ks,k.isUTC=ks,k.zoneAbbr=Vu,k.zoneName=Yu,k.dates=te("dates accessor is deprecated. Use date instead.",sr),k.months=te("months accessor is deprecated. Use month instead",Vs),k.years=te("years accessor is deprecated. Use year instead",Ns),k.zone=te("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",gR),k.isDSTShifted=te("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",IR);function Du(o){return Ft(o*1e3)}function Uu(){return Ft.apply(null,arguments).parseZone()}function lr(o){return o}var Ot=ti.prototype;Ot.calendar=Pc,Ot.longDateFormat=Sc,Ot.invalidDate=Xc,Ot.ordinal=yc,Ot.preparse=lr,Ot.postformat=lr,Ot.relativeTime=Wc,Ot.pastFuture=Vc,Ot.set=Lc,Ot.eras=au,Ot.erasParse=cu,Ot.erasConvertYear=du,Ot.erasAbbrRegex=Tu,Ot.erasNameRegex=fu,Ot.erasNarrowRegex=mu,Ot.months=$c,Ot.monthsShort=zc,Ot.monthsParse=qc,Ot.monthsRegex=nd,Ot.monthsShortRegex=ed,Ot.week=id,Ot.firstDayOfYear=ld,Ot.firstDayOfWeek=rd,Ot.weekdays=md,Ot.weekdaysMin=Ld,Ot.weekdaysShort=pd,Ot.weekdaysParse=Pd,Ot.weekdaysRegex=Sd,Ot.weekdaysShortRegex=Ed,Ot.weekdaysMinRegex=Xd,Ot.isPM=Fd,Ot.meridiem=Wd;function go(o,t,e,n){var i=Ne(),r=pe().set(n,t);return i[e](r,o)}function ar(o,t,e){if(Oe(o)&&(t=o,o=void 0),o=o||"",t!=null)return go(o,t,e,"month");var n,i=[];for(n=0;n<12;n++)i[n]=go(o,n,e,"month");return i}function Ci(o,t,e,n){typeof o=="boolean"?(Oe(t)&&(e=t,t=void 0),t=t||""):(t=o,e=t,o=!1,Oe(t)&&(e=t,t=void 0),t=t||"");var i=Ne(),r=o?i._week.dow:0,s,a=[];if(e!=null)return go(t,(e+r)%7,n,"day");for(s=0;s<7;s++)a[s]=go(t,(s+r)%7,n,"day");return a}function wu(o,t){return ar(o,t,"months")}function Zu(o,t){return ar(o,t,"monthsShort")}function Qu(o,t,e){return Ci(o,t,e,"weekdays")}function vu(o,t,e){return Ci(o,t,e,"weekdaysShort")}function Ku(o,t,e){return Ci(o,t,e,"weekdaysMin")}Qe("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(o){var t=o%10,e=ft(o%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return o+e}}),q.lang=te("moment.lang is deprecated. Use moment.locale instead.",Qe),q.langData=te("moment.langData is deprecated. Use moment.localeData instead.",Ne);var Fe=Math.abs;function Hu(){var o=this._data;return this._milliseconds=Fe(this._milliseconds),this._days=Fe(this._days),this._months=Fe(this._months),o.milliseconds=Fe(o.milliseconds),o.seconds=Fe(o.seconds),o.minutes=Fe(o.minutes),o.hours=Fe(o.hours),o.months=Fe(o.months),o.years=Fe(o.years),this}function cr(o,t,e,n){var i=ce(t,e);return o._milliseconds+=n*i._milliseconds,o._days+=n*i._days,o._months+=n*i._months,o._bubble()}function _u(o,t){return cr(this,o,t,1)}function xu(o,t){return cr(this,o,t,-1)}function dr(o){return o<0?Math.floor(o):Math.ceil(o)}function Gu(){var o=this._milliseconds,t=this._days,e=this._months,n=this._data,i,r,s,a,c;return o>=0&&t>=0&&e>=0||o<=0&&t<=0&&e<=0||(o+=dr(Si(e)+t)*864e5,t=0,e=0),n.milliseconds=o%1e3,i=ne(o/1e3),n.seconds=i%60,r=ne(i/60),n.minutes=r%60,s=ne(r/60),n.hours=s%24,t+=ne(s/24),c=ne(Rr(t)),e+=c,t-=dr(Si(c)),a=ne(e/12),e%=12,n.days=t,n.months=e,n.years=a,this}function Rr(o){return o*4800/146097}function Si(o){return o*146097/4800}function Au(o){if(!this.isValid())return NaN;var t,e,n=this._milliseconds;if(o=ee(o),o==="month"||o==="quarter"||o==="year")switch(t=this._days+n/864e5,e=this._months+Rr(t),o){case"month":return e;case"quarter":return e/3;case"year":return e/12}else switch(t=this._days+Math.round(Si(this._months)),o){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+o)}}function ye(o){return function(){return this.as(o)}}var ur=ye("ms"),ku=ye("s"),Ju=ye("m"),Bu=ye("h"),$u=ye("d"),zu=ye("w"),ju=ye("M"),qu=ye("Q"),th=ye("y"),eh=ur;function nh(){return ce(this)}function oh(o){return o=ee(o),this.isValid()?this[o+"s"]():NaN}function Be(o){return function(){return this.isValid()?this._data[o]:NaN}}var ih=Be("milliseconds"),sh=Be("seconds"),rh=Be("minutes"),lh=Be("hours"),ah=Be("days"),ch=Be("months"),dh=Be("years");function Rh(){return ne(this.days()/7)}var be=Math.round,Tn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function uh(o,t,e,n,i){return i.relativeTime(t||1,!!e,o,n)}function hh(o,t,e,n){var i=ce(o).abs(),r=be(i.as("s")),s=be(i.as("m")),a=be(i.as("h")),c=be(i.as("d")),d=be(i.as("M")),R=be(i.as("w")),u=be(i.as("y")),h=r<=e.ss&&["s",r]||r<e.s&&["ss",r]||s<=1&&["m"]||s<e.m&&["mm",s]||a<=1&&["h"]||a<e.h&&["hh",a]||c<=1&&["d"]||c<e.d&&["dd",c];return e.w!=null&&(h=h||R<=1&&["w"]||R<e.w&&["ww",R]),h=h||d<=1&&["M"]||d<e.M&&["MM",d]||u<=1&&["y"]||["yy",u],h[2]=t,h[3]=+o>0,h[4]=n,uh.apply(null,h)}function gh(o){return o===void 0?be:typeof o=="function"?(be=o,!0):!1}function fh(o,t){return Tn[o]===void 0?!1:t===void 0?Tn[o]:(Tn[o]=t,o==="s"&&(Tn.ss=t-1),!0)}function Th(o,t){if(!this.isValid())return this.localeData().invalidDate();var e=!1,n=Tn,i,r;return typeof o=="object"&&(t=o,o=!1),typeof o=="boolean"&&(e=o),typeof t=="object"&&(n=Object.assign({},Tn,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),i=this.localeData(),r=hh(this,!e,n,i),e&&(r=i.pastFuture(+this,r)),i.postformat(r)}var Ei=Math.abs;function mn(o){return(o>0)-(o<0)||+o}function fo(){if(!this.isValid())return this.localeData().invalidDate();var o=Ei(this._milliseconds)/1e3,t=Ei(this._days),e=Ei(this._months),n,i,r,s,a=this.asSeconds(),c,d,R,u;return a?(n=ne(o/60),i=ne(n/60),o%=60,n%=60,r=ne(e/12),e%=12,s=o?o.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",d=mn(this._months)!==mn(a)?"-":"",R=mn(this._days)!==mn(a)?"-":"",u=mn(this._milliseconds)!==mn(a)?"-":"",c+"P"+(r?d+r+"Y":"")+(e?d+e+"M":"")+(t?R+t+"D":"")+(i||n||o?"T":"")+(i?u+i+"H":"")+(n?u+n+"M":"")+(o?u+s+"S":"")):"P0D"}var Lt=lo.prototype;Lt.isValid=cR,Lt.abs=Hu,Lt.add=_u,Lt.subtract=xu,Lt.as=Au,Lt.asMilliseconds=ur,Lt.asSeconds=ku,Lt.asMinutes=Ju,Lt.asHours=Bu,Lt.asDays=$u,Lt.asWeeks=zu,Lt.asMonths=ju,Lt.asQuarters=qu,Lt.asYears=th,Lt.valueOf=eh,Lt._bubble=Gu,Lt.clone=nh,Lt.get=oh,Lt.milliseconds=ih,Lt.seconds=sh,Lt.minutes=rh,Lt.hours=lh,Lt.days=ah,Lt.weeks=Rh,Lt.months=ch,Lt.years=dh,Lt.humanize=Th,Lt.toISOString=fo,Lt.toString=fo,Lt.toJSON=fo,Lt.locale=js,Lt.localeData=tr,Lt.toIsoString=te("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",fo),Lt.lang=qs,rt("X",0,0,"unix"),rt("x",0,0,"valueOf"),ot("x",to),ot("X",wc),Et("X",function(o,t,e){e._d=new Date(parseFloat(o)*1e3)}),Et("x",function(o,t,e){e._d=new Date(ft(o))});q.version="2.30.1",mc(Ft),q.fn=k,q.min=sR,q.max=rR,q.now=lR,q.utc=pe,q.unix=Du,q.months=wu,q.isDate=Cn,q.locale=Qe,q.invalid=Jn,q.duration=ce,q.isMoment=le,q.weekdays=Qu,q.parseZone=Uu,q.localeData=Ne,q.isDuration=ao,q.monthsShort=Zu,q.weekdaysMin=Ku,q.defineLocale=hi,q.updateLocale=Ud,q.locales=wd,q.weekdaysShort=vu,q.normalizeUnits=ee,q.relativeTimeRounding=gh,q.relativeTimeThreshold=fh,q.calendarFormat=WR,q.prototype=k,q.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};class Xi{draws;ranges;element;control;options;position;constructor(t,e){const n=e.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.getOptions(),this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getValue(t={}){const e=t.elementList||this.control.getElementList();let{startIndex:n}=t.range||this.control.getRange();const i=this.control.getDraw(),r=t?null:i.getTd();n>=e.length&&(n=e.length-1);const s=e[n],a=[];let c=r,d=e,R=n;for(;;){if(R<0&&c?.linkTdPrevId){const T=i.getTdById(c.linkTdPrevId);if(T){d=T.value,R=d.length-1,c=T;continue}}if(R<0)break;const f=d[R];if(f.controlId!==s.controlId||f.controlComponent===l.ControlComponent.PREFIX||f.controlComponent===l.ControlComponent.PRE_TEXT)break;f.controlComponent===l.ControlComponent.VALUE&&a.unshift(f),R--}c=r;let u=e,h=n+1;for(;;){if(h>=u.length&&c?.linkTdNextId){const T=i.getTdById(c.linkTdNextId);if(T){u=T.value,h=0,c=T;continue}}const f=u[h];if(!f||f.controlId!==s.controlId||f.controlComponent===l.ControlComponent.POSTFIX||f.controlComponent===l.ControlComponent.POST_TEXT)break;f.controlComponent===l.ControlComponent.VALUE&&a.push(f),h++}return a.filter(f=>f.type!==l.ElementType.SPLIT_TAG)}removeNextControlElement(t,e){const n=this.control.getDraw();if(e=e??n.getTd()?.linkTdNextId,e){const i=n.getTdById(e);if(i){if(i.value.length){if(i.value[1].controlId===t)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(t,i.linkTdNextId)}}}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=r,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):this.control.removePlaceholder(s,{elementList:i});const d=i[s],R=d.controlId;this._removeControlPlaceholders(i,s);const u=d.type&&!$t.includes(d.type)||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...Gt]):ie(d,["type"]),h=!!this.element.control?.underline,g=this.options.mode===l.EditorMode.FORM&&this.options.modeRule.form.inputTraceEnabled&&!h,f=r.startIndex+1,T=[],m=p=>{const I=T.length?T:i,L=T.length?T.length-1:r.startIndex;Ut(I,[p],L,{editorOptions:this.options}),T.push(p)};for(let p=0;p<t.length;p++){const I=t[p];if(I.type===l.ElementType.CONTROL&&I.control){const L=I,P=L.controlId||lt(),O=L.control?.value||[],S=L.control?.type===l.ControlType.TEXTFIELD,F={...u,controlId:P,type:l.ElementType.CONTROL,control:L.control,originControlId:R},N=S?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,V=S?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX,Y=S?L.control?.preTextFix||this.options.control.preTextFix:L.control?.prefix||this.options.control.prefix;for(let W=0;W<Y.length;W++){const E={...F,value:Y[W],controlComponent:N};m(E)}for(let W=0;W<O.length;W++){const E=O[W],C={...F,...E,controlComponent:l.ControlComponent.VALUE};(C.color===this.options.control.bracketColor||C.color===this.options.control.placeholderColor)&&(C.color=this.options.defaultColor),m(C)}if(O.length===0){const W=L.control?.placeholder||"";for(let E=0;E<W.length;E++){const C={...F,value:W[E],controlComponent:l.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};m(C)}}const X=S?L.control?.postTextFix||this.options.control.postTextFix:L.control?.postfix||this.options.control.postfix;for(let W=0;W<X.length;W++){const E={...F,value:X[W],controlComponent:V};m(E)}}else if(I.type||I.value){(d.controlComponent===l.ControlComponent.PRE_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.POSTFIX)&&(u.color=this.options.defaultColor);const P={...u,...I,controlComponent:l.ControlComponent.VALUE};(P.color===this.options.control.bracketColor||P.color===this.options.control.placeholderColor||P.color===this.options.control.textFixColor)&&(P.color=this.options.defaultColor),P.strikeout&&delete P.strikeout,g&&(P.textDecoration={style:l.TextDecorationStyle.DOUBLE},P.underline=!0),m(P)}}return T.length&&c.spliceElementList(i,f,0,T),r.startIndex+T.length}_removeControlPlaceholders(t,e){const n=t[e];if(!n?.controlId)return;const i=a=>!!a&&a.controlId===n.controlId&&a.originControlId===n.originControlId;let r=e;for(;r>=0&&i(t[r]);)r--;let s=e+1;for(;s<t.length&&i(t[s]);)s++;for(let a=s-1;a>r;a--)t[a].controlComponent===l.ControlComponent.PLACEHOLDER&&t.splice(a,1)}clearValue(t={},e={}){if(!e.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),i=t.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:r,endIndex:s}=i;return this.control.getDraw().spliceElementList(n,r+1,s-r,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(r,t)),r}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=e[i],a=e[r],c=this.control.getDraw(),d=!!s.originControlId;if(t.key===l.KeyMap.Backspace)if(this.options.mode===l.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&!d){if(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER)return i;this.strikeout()}else{if(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER)return i;if(i!==r){c.spliceElementList(e,i+1,r-i);const u=e[i+1];return(u?.controlComponent===l.ControlComponent.POSTFIX||u?.controlComponent===l.ControlComponent.POST_TEXT||u?.controlComponent===l.ControlComponent.POSTTEXTFIX||u?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(i),i===0&&e[0].type===l.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i}else{const u=e[i+1];return u?.controlComponent===l.ControlComponent.POSTFIX||u?.controlComponent===l.ControlComponent.POST_TEXT||u?.controlComponent===l.ControlComponent.POSTTEXTFIX||u?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT?(c.spliceElementList(e,i,1),this.control.addPlaceholder(i-1),i-1):(c.spliceElementList(e,i,1),i===1&&e[0].type===l.ElementType.SPLIT_TAG||i===0?c.fixPosition(!0)??i-1:i-1)}}else if(t.key===l.KeyMap.Delete){const R=e[r+1],u=!!s.originControlId;if(this.options.mode===l.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&!u){if(a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT||a.controlComponent===l.ControlComponent.POSTTEXTFIX||a.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER)return r;if(R?.controlComponent===l.ControlComponent.POSTFIX||R?.controlComponent===l.ControlComponent.POST_TEXT||R?.controlComponent===l.ControlComponent.POSTTEXTFIX||R?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)return c.spliceElementList(e,i+1,1),this.control.addPlaceholder(i),i;this.strikeout()}else{const g=e[r+1];return s.controlComponent===l.ControlComponent.PLACEHOLDER?r:g?.controlComponent===l.ControlComponent.POSTFIX||g?.controlComponent===l.ControlComponent.POST_TEXT||g?.controlComponent===l.ControlComponent.POSTTEXTFIX||g?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT?(c.spliceElementList(e,i+1,1),this.control.addPlaceholder(i),i):i!==r?(c.spliceElementList(e,i+1,r-i),i===0&&e[0].type===l.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i):g?(c.spliceElementList(e,i+1,1),i===0&&e[0].type===l.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i):(c.getTd()?.linkTdNextId&&s.controlId&&this.removeNextControlElement(s.controlId),r)}}return r}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();n.spliceElementList(i,t+1,e-t);const r=i[t+1];return(r?.controlComponent===l.ControlComponent.POSTFIX||r?.controlComponent===l.ControlComponent.POST_TEXT||r?.controlComponent===l.ControlComponent.POSTTEXTFIX||r?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(t),t}strikeout(t){const e=this.control.getRange(),{endIndex:n}=e,{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return;const s=this.ranges.getSelectionElementList(),a=this.position.getCursorPosition(),c=q(new Date).format("YYYY-MM-DD HH:mm:ss");if(s?.length){if(!this.element.strikeout){const d=s.findIndex(R=>!R.strikeout);s.forEach(R=>{R.deletePerson="SWJ",R.deleteTime=c,R.strikeout=!!~d}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),setTimeout(()=>{this.strikeoute()},100)}}else{const d=this.control.getElementList()[a.index],R=this.control.getElementList();if(!this.control.getElementList()[a.index].strikeout&&d?.metrics.width>0){this.control.getElementList()[a.index].strikeout=!0,this.control.getElementList()[a.index].deletePerson="SWJ",this.control.getElementList()[a.index].deleteTime=c;const u=--a.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const g=u;this.draws.render({curIndex:g,isSetCursor:!0}),a.index=u,this.position.setCursorPosition(a),this.ranges.setRange(u,u)},100)}else n>=0&&n<R.length&&R[n]?.metrics?.width!==void 0&&R[n].metrics.width<=0&&!R[n]?.strikeout&&(setTimeout(()=>{R.splice(n,1)},100),setTimeout(()=>{const h=n-1;this.draws.render({curIndex:h,isSetCursor:!0}),a.index=h,delete a.value,this.position.setCursorPosition(a),this.ranges.setRange(h,h)},100))}}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:r}=this.ranges.getRange(),a=this.draws.getElementList()[r];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}class hr{draw;options;now;dom;renderOptions;isDatePicker;pickDate;lang;constructor(t,e={}){this.draw=t,this.options=e,this.lang=this._getLang(),this.now=new Date,this.dom=this._createDom(),this.renderOptions=null,this.isDatePicker=!0,this.pickDate=null,this._bindEvent()}_createDom(){const t=document.createElement("div");t.classList.add(`${z}-date-container`),t.setAttribute(Re,l.EditorComponent.POPUP);const e=document.createElement("div");e.classList.add(`${z}-date-wrap`);const n=document.createElement("div");n.classList.add(`${z}-date-title`);const i=document.createElement("span");i.classList.add(`${z}-date-title__pre-year`),i.innerText="<<";const r=document.createElement("span");r.classList.add(`${z}-date-title__pre-month`),r.innerText="<";const s=document.createElement("span");s.classList.add(`${z}-date-title__now`);const a=document.createElement("span");a.classList.add(`${z}-date-title__next-month`),a.innerText=">";const c=document.createElement("span");c.classList.add(`${z}-date-title__next-year`),c.innerText=">>",n.append(i),n.append(r),n.append(s),n.append(a),n.append(c);const d=document.createElement("div");d.classList.add(`${z}-date-week`);const{weeks:{sun:R,mon:u,tue:h,wed:g,thu:f,fri:T,sat:m}}=this.lang;[R,u,h,g,f,T,m].forEach(W=>{const E=document.createElement("span");E.innerText=`${W}`,d.append(E)});const I=document.createElement("div");I.classList.add(`${z}-date-day`),e.append(n),e.append(d),e.append(I);const L=document.createElement("ul");L.classList.add(`${z}-time-wrap`);let P,O,S;[this.lang.hour,this.lang.minute,this.lang.second].forEach((W,E)=>{const C=document.createElement("li"),M=document.createElement("span");M.innerText=W,C.append(M);const y=document.createElement("ol"),b=E===0,D=E===1,U=b?24:60;for(let Q=0;Q<U;Q++){const G=document.createElement("li");G.innerText=`${String(Q).padStart(2,"0")}`,G.setAttribute("data-id",`${Q}`),y.append(G)}b?P=y:D?O=y:S=y,C.append(y),L.append(C)});const N=document.createElement("div");N.classList.add(`${z}-date-menu`);const V=document.createElement("button");V.classList.add(`${z}-date-menu__time`),V.innerText=this.lang.timeSelect;const Y=document.createElement("button");Y.classList.add(`${z}-date-menu__now`),Y.innerText=this.lang.now;const X=document.createElement("button");return X.classList.add(`${z}-date-menu__submit`),X.innerText=this.lang.confirm,N.append(V),N.append(Y),N.append(X),t.append(e),t.append(L),t.append(N),this.draw.getContainer().append(t),{container:t,dateWrap:e,datePickerWeek:d,timeWrap:L,title:{preYear:i,preMonth:r,now:s,nextMonth:a,nextYear:c},day:I,time:{hour:P,minute:O,second:S},menu:{time:V,now:Y,submit:X}}}_bindEvent(){this.dom.title.preYear.onclick=()=>{this._preYear()},this.dom.title.preMonth.onclick=()=>{this._preMonth()},this.dom.title.nextMonth.onclick=()=>{this._nextMonth()},this.dom.title.nextYear.onclick=()=>{this._nextYear()},this.dom.menu.time.onclick=()=>{this.isDatePicker=!this.isDatePicker,this._toggleDateTimePicker()},this.dom.menu.now.onclick=()=>{this._now(),this._submit()},this.dom.menu.submit.onclick=()=>{this.dispose(),this._submit()},this.dom.time.hour.onclick=t=>{if(!this.pickDate)return;const n=t.target.dataset.id;n&&(this.pickDate.setHours(Number(n)),this._setTimePick(!1))},this.dom.time.minute.onclick=t=>{if(!this.pickDate)return;const n=t.target.dataset.id;n&&(this.pickDate.setMinutes(Number(n)),this._setTimePick(!1))},this.dom.time.second.onclick=t=>{if(!this.pickDate)return;const n=t.target.dataset.id;n&&(this.pickDate.setSeconds(Number(n)),this._setTimePick(!1))}}_setPosition(){if(!this.renderOptions)return;const{position:{coordinate:{leftTop:[t,e]},lineHeight:n,pageNo:i}}=this.renderOptions,r=this.draw.getHeight(),s=this.draw.getPageGap(),c=(i??this.draw.getPageNo())*(r+s);this.dom.container.style.left=`${t}px`,this.dom.container.style.top=`${e+c+n}px`}isInvalidDate(t){return t.toDateString()==="Invalid Date"}_setValue(){const t=this.renderOptions?.value;if(t){const e=new Date(t);this.now=this.isInvalidDate(e)?new Date:e}else this.now=new Date;this.pickDate=new Date(this.now)}_getLang(){const t=this.draw.getI18n(),e=t.t.bind(t);return{now:e("datePicker.now"),confirm:e("datePicker.confirm"),return:e("datePicker.return"),timeSelect:e("datePicker.timeSelect"),weeks:{sun:e("datePicker.weeks.sun"),mon:e("datePicker.weeks.mon"),tue:e("datePicker.weeks.tue"),wed:e("datePicker.weeks.wed"),thu:e("datePicker.weeks.thu"),fri:e("datePicker.weeks.fri"),sat:e("datePicker.weeks.sat")},year:e("datePicker.year"),month:e("datePicker.month"),hour:e("datePicker.hour"),minute:e("datePicker.minute"),second:e("datePicker.second")}}_setLangChange(){this.dom.menu.time.innerText=this.lang.timeSelect,this.dom.menu.now.innerText=this.lang.now,this.dom.menu.submit.innerText=this.lang.confirm;const{weeks:{sun:t,mon:e,tue:n,wed:i,thu:r,fri:s,sat:a}}=this.lang,c=[t,e,n,i,r,s,a];this.dom.datePickerWeek.childNodes.forEach((h,g)=>{const f=h;f.innerText=c[g]});const d=this.dom.time.hour.previousElementSibling;d.innerText=this.lang.hour;const R=this.dom.time.minute.previousElementSibling;R.innerText=this.lang.minute;const u=this.dom.time.second.previousElementSibling;u.innerText=this.lang.second}_update(){const t=new Date,e=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();let r=null,s=null,a=null;this.pickDate&&(r=this.pickDate.getFullYear(),s=this.pickDate.getMonth()+1,a=this.pickDate.getDate());const c=this.now.getFullYear(),d=this.now.getMonth()+1;this.dom.title.now.innerText=`${c}${this.lang.year} ${String(d).padStart(2,"0")}${this.lang.month}`;const u=new Date(c,d,0).getDate();let h=new Date(c,d-1,1).getDay();h===0&&(h=7);const g=new Date(c,d-1,0).getDate();this.dom.day.innerHTML="";const f=g-h+1;for(let m=f;m<=g;m++){const p=document.createElement("div");p.classList.add("disable"),p.innerText=`${m}`,p.onclick=()=>{const I=d-2;this.now=new Date(c,I,m),this._setDatePick(c,I,m)},this.dom.day.append(p)}for(let m=1;m<=u;m++){const p=document.createElement("div");e===c&&n===d&&i===m&&p.classList.add("active"),this.pickDate&&r===c&&s===d&&a===m&&p.classList.add("select"),p.innerText=`${m}`,p.onclick=I=>{const L=d-1;this.now=new Date(c,L,m),this._setDatePick(c,L,m),I.stopPropagation()},this.dom.day.append(p)}const T=42-h-u;for(let m=1;m<=T;m++){const p=document.createElement("div");p.classList.add("disable"),p.innerText=`${m}`,p.onclick=()=>{this.now=new Date(c,d,m),this._setDatePick(c,d,m)},this.dom.day.append(p)}}_toggleDateTimePicker(){this.isDatePicker?(this.dom.dateWrap.classList.add("active"),this.dom.timeWrap.classList.remove("active"),this.dom.menu.time.innerText=this.lang.timeSelect):(this.dom.dateWrap.classList.remove("active"),this.dom.timeWrap.classList.add("active"),this.dom.menu.time.innerText=this.lang.return,this._setTimePick())}_setDatePick(t,e,n){this.now=new Date(t,e,n),this.pickDate?.setFullYear(t),this.pickDate?.setMonth(e),this.pickDate?.setDate(n),this._update()}_setTimePick(t=!0){const e=this.pickDate?.getHours()||0,n=this.pickDate?.getMinutes()||0,i=this.pickDate?.getSeconds()||0,{hour:r,minute:s,second:a}=this.dom.time;[r,s,a].forEach(R=>{R.querySelectorAll("li").forEach(u=>u.classList.remove("active"))}),[[r,e],[s,n],[a,i]].forEach(([R,u])=>{const h=R.querySelector(`[data-id='${u}']`);h.classList.add("active"),t&&Ki(R,h)})}_preMonth(){this.now.setMonth(this.now.getMonth()-1),this._update()}_nextMonth(){this.now.setMonth(this.now.getMonth()+1),this._update()}_preYear(){this.now.setFullYear(this.now.getFullYear()-1),this._update()}_nextYear(){this.now.setFullYear(this.now.getFullYear()+1),this._update()}_now(){this.pickDate=new Date,this.dispose()}_toggleVisible(t){t?this.dom.container.classList.add("active"):this.dom.container.classList.remove("active")}_submit(){if(this.options.onSubmit&&this.pickDate){const t=this.renderOptions?.dateFormat,e=this.formatDate(this.pickDate,t);this.options.onSubmit(e)}}formatDate(t,e="YYYY-MM-DD HH:mm:ss"){let n=e;const i=t.getFullYear().toString(),r=(t.getMonth()+1).toString(),s=t.getDate().toString(),a=t.getHours(),c=a%12===0?12:a%12,d=t.getMinutes().toString(),R=t.getSeconds().toString(),u=t.getMilliseconds().toString(),h={"y+":i,"Y+":i,"M+":r,"d+":s,"D+":s,"h+":c.toString(),"H+":a.toString(),"m+":d,"s+":R,"S+":u};for(const g in h){const f=new RegExp("("+g+")").exec(e),T=g;f&&(n=n.replace(f[1],f[1].length===1?h[T]:h[T].padStart(f[1].length,"0")))}return n}render(t){this.renderOptions=t,this.lang=this._getLang(),this._setLangChange(),this._setValue(),this._update(),this._setPosition(),this.isDatePicker=!0,this._toggleDateTimePicker(),this._toggleVisible(!0)}dispose(){this._toggleVisible(!1)}destroy(){this.dom.container.remove()}}class Dn{draw;element;control;isPopup;datePicker;options;constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1,this.datePicker=null}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:r,endIndex:s}=n;for(let a=r;a<=s;a++){const c=e[a];c.controlComponent===l.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=r,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s):this.control.removePlaceholder(s,{elementList:i});const d=i[s],R=d.type&&!$t.includes(d.type)||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...Gt]):ie(d,["type"]),u=r.startIndex+1;for(let h=0;h<t.length;h++){const g={...R,...t[h],controlComponent:l.ControlComponent.VALUE};Ut(i,[g],s,{editorOptions:this.options}),c.spliceElementList(i,u+h,0,[g])}return u+t.length-1}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const r=this.control.getValueRange(t);if(!r)return-1;const{startIndex:s,endIndex:a}=r;if(!~s||!~a)return-1;const c=t.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(c,s+1,a-s,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(s,t),s}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const i=e.elementList||this.control.getElementList(),r=e.range||this.control.getRange(),s=this.getValue(e)[0],a=s?Dt(s,ue):Dt(i[r.startIndex],Gt),c=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~c)return;const d=ie(i[c],ue),R=c+1,u=this.control.getDraw();for(let h=0;h<t.length;h++){const g={...a,...d,type:l.ElementType.TEXT,value:t[h],controlComponent:l.ControlComponent.VALUE};(g.color===this.options.control.bracketColor||g.color===this.options.control.placeholderColor)&&(g.color=this.options.defaultColor),Ut(i,[g],c,{editorOptions:this.options}),u.spliceElementList(i,R+h,0,[g])}if(!e.range){const h=R+t.length-1;this.control.repaintControl({curIndex:h}),this.control.emitControlContentChange({context:e}),this.destroy()}}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=e[i],a=e[r],c=this.control.getDraw();if(t.key===l.KeyMap.Backspace)return i!==r?(c.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(t.key===l.KeyMap.Delete){if(i!==r)return c.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i;{const d=e[r+1];return(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT)&&d.controlComponent===l.ControlComponent.PLACEHOLDER||d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POST_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}}return r}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const t=this.control.getPosition();if(!t)return;const e=this.draw.getElementList(),{startIndex:n}=this.control.getRange();if(e[n+1]?.controlId!==this.element.controlId)return;this.datePicker=new hr(this.draw,{onSubmit:this._setDate.bind(this)});const i=this.getValue().map(s=>s.value).join("")||"",r=this.element.control?.dateFormat;this.datePicker.render({value:i,position:t,dateFormat:r}),this.isPopup=!0}destroy(){this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}_setDate(t){t?this.setSelect(t):this.clearSelect(),this.destroy()}}class Un extends Xi{isPopup;inputPopup;constructor(t,e){super(t,e),this.isPopup=!1,this.inputPopup=null}getIsPopup(){return this.isPopup}setValue(t,e={},n={}){if(t.some(P=>!$l(P)||Hr.test(P.value)))return-1;const i=e.elementList||this.control.getElementList(),r=e.range||this.control.getRange();this.control.shrinkBoundary(e);const s=at(t),{startIndex:a,endIndex:c}=r,d=i[a];let R=null;for(let P=a;P>=0;P--)if(i[P].controlComponent===l.ControlComponent.PREFIX){R=i[P];break}const u=R?.control||this.element.control;if(this.control.getIsExistValueByElementListIndex(i,a)){let P=a;for(;P>0;){const S=i[P];if(S.controlId!==d.controlId||S.controlComponent===l.ControlComponent.PREFIX||S.controlComponent===l.ControlComponent.PRE_TEXT)break;s.unshift(S),P--}let O=c+1;for(;O<i.length;){const S=i[O];if(S.controlId!==d.controlId||S.controlComponent===l.ControlComponent.POSTFIX||S.controlComponent===l.ControlComponent.POST_TEXT)break;s.push(S),O++}}const h=qi(s);if(Number.isNaN(Number(h))||!Number.isFinite(Number(h)))return-1;const g=u?.numberExclusiveOptions,f=g?.maxLength??null,T=g?.decimalPlaces??null,m=h.replace(/[.-]/g,"").length;if(f!=null&&m>f||T!=null&&(h.split(".")[1]||"").length>T)return-1;const p=Number(h),I=g?.minValue,L=g?.maxValue;return I!=null&&p<I||L!=null&&p>L?-1:super.setValue(t,e,n)}_setNumberValue(t){const e=this.control.getElementList(),n=this.control.getRange(),{startIndex:i}=n;let r=null;for(let F=i;F>=0;F--)if(e[F].controlComponent===l.ControlComponent.PREFIX){r=e[F];break}const a=(r?.control||this.element.control)?.numberExclusiveOptions,c=a?.minValue,d=a?.maxValue,R=a?.decimalPlaces,u=a?.minLength,h=a?.maxLength;let g=t;R!=null&&(g=parseFloat(t.toFixed(R)));const f=g.toString(),T=f.replace(/[.-]/g,"").length;if(u!=null&&T<u||h!=null&&T>h||c!=null&&g<c||d!=null&&g>d)return!1;let m=i;for(let F=i;F>=0;F--)if(e[F].controlComponent===l.ControlComponent.PREFIX){m=F;break}let p=m+1;for(let F=m+1;F<e.length;F++)if(e[F].controlComponent===l.ControlComponent.POSTFIX){p=F;break}const I=this.options.mode===l.EditorMode.FORM,L=I&&this.options.modeRule.form.inputTraceEnabled,P=I&&this.options.modeRule.form.deleteTraceEnabled,O=q(new Date).format("YYYY-MM-DD HH:mm:ss");if(P)for(let F=m+1;F<p;F++){const N=e[F];N.controlComponent===l.ControlComponent.VALUE&&!N.strikeout&&N.value&&(N.strikeout=!0,N.deletePerson="SYSTEM",N.deleteTime=O),N.controlComponent===l.ControlComponent.PLACEHOLDER&&(this.control.getDraw().spliceElementList(e,F,1),p--,F--)}else{const F=m+1,N=p-F;N>0&&this.control.getDraw().spliceElementList(e,F,N),p=m+1}p=m+1;for(let F=m+1;F<e.length;F++)if(e[F].controlComponent===l.ControlComponent.POSTFIX){p=F;break}const S=[];for(let F=0;F<f.length;F++){const N={type:l.ElementType.TEXT,value:f[F],controlComponent:l.ControlComponent.VALUE,controlId:e[m].controlId};L&&(N.textDecoration={style:l.TextDecorationStyle.DOUBLE},N.underline=!0),S.push(N)}for(let F=0;F<S.length;F++)this.control.getDraw().spliceElementList(e,p+F,0,[S[F]]);return this.control.repaintControl({curIndex:p+S.length-1}),this.control.emitControlContentChange(),!0}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const t=this.control.getElementList(),e=this.control.getRange(),{startIndex:n}=e,i=t[n];if(!i||i.controlId!==this.element.controlId)return;let r=null;for(let f=n;f>=0;f--)if(t[f].controlComponent===l.ControlComponent.PREFIX){r=t[f];break}const s=r?.control||this.element.control,c=this.getValue().filter(f=>!f.strikeout),d=c.length>0?qi(c):"",R=s?.numberExclusiveOptions,u=R?.minValue,h=R?.maxValue,g=R?.decimalPlaces;this.inputPopup=new mh({control:this.control,currentValue:d,minValue:u,maxValue:h,decimalPlaces:g,onConfirm:f=>{if(!f||f.trim()==="")return this._clearNumberValue(),!0;const T=parseFloat(f);return Number.isNaN(T)||!Number.isFinite(T)?!1:this._setNumberValue(T)},onClose:()=>{this.destroy()}}),this.inputPopup.create(),this.isPopup=!0}_clearNumberValue(){const t=this.control.getElementList(),e=this.control.getRange(),{startIndex:n}=e;let i=n;for(let c=n;c>=0;c--)if(t[c].controlComponent===l.ControlComponent.PREFIX){i=c;break}let r=i+1;for(let c=i+1;c<t.length;c++)if(t[c].controlComponent===l.ControlComponent.POSTFIX){r=c;break}const s=i+1,a=r-s;a>0&&this.control.getDraw().spliceElementList(t,s,a),this.control.addPlaceholder(i),this.control.repaintControl({curIndex:i}),this.control.emitControlContentChange()}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=e[i],a=e[r],c=this.control.getDraw();if(t.key==="Backspace")return s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||s.controlComponent===l.ControlComponent.PLACEHOLDER?this.control.removeControl(i):a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT?i:i!==r?(c.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(t.key==="Delete"){const R=e[r+1];return s.controlComponent===l.ControlComponent.PLACEHOLDER||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT?this.control.removeControl(i):s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRE_TEXT||R?.controlComponent===l.ControlComponent.POSTFIX||R?.controlComponent===l.ControlComponent.POST_TEXT?r:i!==r?(c.spliceElementList(e,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}return t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey?(t.preventDefault(),this.awake(),null):r}destroy(){this.inputPopup&&(this.inputPopup.destroy(),this.inputPopup=null),this.isPopup=!1}}class mh{options;popupDom;constructor(t){this.options=t,this.popupDom=null}create(){const{currentValue:t,minValue:e,maxValue:n,decimalPlaces:i,onConfirm:r,onClose:s}=this.options,a=document.createElement("div");a.classList.add(`${z}-number-input-modal`),a.setAttribute(Re,l.EditorComponent.POPUP);const c=document.createElement("div");c.classList.add(`${z}-number-input-modal__content`);const d=document.createElement("div");if(d.classList.add(`${z}-number-input-modal__title`),d.textContent="请输入数值",c.appendChild(d),e!==void 0||n!==void 0){const m=document.createElement("div");m.classList.add(`${z}-number-input-modal__hint`);let p="有效范围:";e!==void 0&&n!==void 0?p+=`${e} ~ ${n}`:e!==void 0?p+=`≥ ${e}`:p+=`≤ ${n}`,i!=null&&(p+=`,保留${i}位小数`),m.textContent=p,c.appendChild(m)}const R=document.createElement("input");R.classList.add(`${z}-number-input-modal__input`),R.type="number",R.value=t,R.placeholder="请输入数值",e!==void 0&&(R.min=String(e)),n!==void 0&&(R.max=String(n)),i!=null&&(R.step=(1/Math.pow(10,i)).toString()),setTimeout(()=>{R.focus(),R.select()},100),c.appendChild(R);const u=document.createElement("div");u.classList.add(`${z}-number-input-modal__error`),u.style.display="none",c.appendChild(u);const h=document.createElement("div");h.classList.add(`${z}-number-input-modal__buttons`);const g=document.createElement("button");g.classList.add(`${z}-number-input-modal__cancel`),g.textContent="取消",g.onclick=()=>{s()},h.appendChild(g);const f=document.createElement("button");f.classList.add(`${z}-number-input-modal__confirm`),f.textContent="确定",f.onclick=()=>{const m=R.value.trim();if(!m){r("")&&s();return}const p=parseFloat(m);if(Number.isNaN(p)||!Number.isFinite(p)){u.textContent="请输入有效的数值",u.style.display="block";return}if(i!=null&&(m.split(".")[1]||"").length>i){u.textContent=`小数位数不能超过${i}位`,u.style.display="block";return}if(e!==void 0&&p<e){u.textContent=`数值不能小于 ${e}`,u.style.display="block";return}if(n!==void 0&&p>n){u.textContent=`数值不能大于 ${n}`,u.style.display="block";return}r(m)&&s()},h.appendChild(f),c.appendChild(h),a.appendChild(c),R.onkeydown=m=>{m.key==="Enter"?f.click():m.key==="Escape"&&s()},this.options.control.getContainer().appendChild(a),this.popupDom=a}destroy(){this.popupDom&&(this.popupDom.remove(),this.popupDom=null)}}class ph{options;mask;container;inputList;optionItemContainers;data;constructor(t){this.options=t,this.mask=null,this.container=null,this.inputList=[],this.optionItemContainers=[],this.data=t.data,this._render()}_getFieldValue(t){const e=this.inputList.filter(n=>n.name===t);if(e.length!==0){for(const n of e)if(n instanceof HTMLInputElement&&n.type==="radio"&&n.checked)return n.value;return e[0].value}}_updateFieldVisibility(){this.data.forEach((t,e)=>{if(t.visibleWhen){const{field:n,value:i}=t.visibleWhen,r=this._getFieldValue(n),s=this.optionItemContainers[e];if(s){const a=r===i;s.style.display=a?"":"none"}}})}_render(){const{title:t,onClose:e,onCancel:n,onConfirm:i}=this.options,r=document.createElement("div");r.classList.add("dialog-mask"),r.setAttribute(Re,l.EditorComponent.COMPONENT),document.body.append(r);const s=document.createElement("div");s.classList.add("dialog-container"),s.setAttribute(Re,l.EditorComponent.COMPONENT);const a=document.createElement("div");a.classList.add("dialog"),s.append(a);const c=document.createElement("div");c.classList.add("dialog-title");const d=document.createElement("span");d.append(document.createTextNode(t));const R=document.createElement("i");R.onclick=()=>{e&&e(),this._dispose()},c.append(d),c.append(R),a.append(c);const u=document.createElement("div");u.classList.add("dialog-option");for(let T=0;T<this.data.length;T++){const m=this.data[T],p=document.createElement("div");if(p.classList.add("dialog-option__item"),m.visible===!1&&(p.style.display="none"),m.label){const I=document.createElement("span");I.append(document.createTextNode(m.label)),p.append(I),m.required&&I.classList.add("dialog-option__item--require")}if(m.type==="radio"){const I=document.createElement("div");I.classList.add("dialog-radio-group"),m.horizontal&&I.classList.add("dialog-radio-group--horizontal"),m.options?.forEach(L=>{const P=document.createElement("label");P.classList.add("dialog-radio-item");const O=document.createElement("input");O.type="radio",O.name=m.name,O.value=L.value,L.value===(m.value||"")&&(O.checked=!0);const S=document.createElement("span");S.textContent=L.label,P.append(O),P.append(S),I.append(P),O.addEventListener("change",()=>{this._updateFieldVisibility()}),this.inputList.push(O)}),p.append(I)}else if(m.type==="select"){const I=document.createElement("select"),L=m.value||"";m.options?.forEach(P=>{const O=document.createElement("option");O.value=P.value,O.label=P.label,P.value===L&&(O.selected=!0),I.append(O)}),I.name=m.name,I.value=L,I.addEventListener("change",()=>{this._updateFieldVisibility()}),m.width&&(I.style.width=`${m.width}px`),p.append(I),this.inputList.push(I)}else if(m.type==="textarea"){const I=document.createElement("textarea");I.name=m.name,I.value=m.value||"",I.placeholder=m.placeholder||"",m.width&&(I.style.width=`${m.width}px`),m.height&&(I.style.height=`${m.height}px`),p.append(I),this.inputList.push(I)}else{const I=document.createElement("input");I.type=m.type,I.name=m.name,I.value=m.value||"",I.placeholder=m.placeholder||"",m.width&&(I.style.width=`${m.width}px`),m.height&&(I.style.height=`${m.height}px`),p.append(I),this.inputList.push(I)}u.append(p),this.optionItemContainers.push(p)}a.append(u);const h=document.createElement("div");h.classList.add("dialog-menu");const g=document.createElement("button");g.classList.add("dialog-menu__cancel"),g.append(document.createTextNode("取消")),g.type="button",g.onclick=()=>{n&&n(),this._dispose()},h.append(g);const f=document.createElement("button");f.append(document.createTextNode("确定")),f.type="submit",f.onclick=()=>{if(i){const T=new Set,m=[];for(const p of this.inputList)if(!T.has(p.name))if(p instanceof HTMLInputElement&&p.type==="radio"){const I=this.inputList.find(L=>L.name===p.name&&L instanceof HTMLInputElement&&L.checked);I&&(m.push({name:p.name,value:I.value}),T.add(p.name))}else m.push({name:p.name,value:p.value}),T.add(p.name);i(m)}this._dispose()},h.append(f),a.append(h),document.body.append(s),this.container=s,this.mask=r,this._updateFieldVisibility()}_dispose(){this.mask?.remove(),this.container?.remove()}}class $e{draw;element;control;isPopup;datePicker;options;range;static isDeleting=!1;inputModal=null;constructor(t,e){const n=e.getDraw();this.draw=n,this.range=n.getRange(),this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1,this.datePicker=null}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(){return[]}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e),s=this.control.getDraw(),{startIndex:a}=r,d=i[a].controlId;let R=a;for(let p=a;p>=0;p--){const I=i[p];if(I.controlId!==d)break;if(I.controlComponent===l.ControlComponent.PREFIX){R=p;break}}let u=a;for(let p=a;p<i.length;p++){const I=i[p];if(I.controlId!==d){u=p;break}if(I.controlComponent===l.ControlComponent.POSTFIX){u=p;break}}const h=R+1,g=u-1;g>=h&&s.spliceElementList(i,h,g-h+1);const f=i[R],T=Dt(f,["control","controlId",...Gt]),m=R+1;for(let p=0;p<t.length;p++){const I={...T,...t[p],controlComponent:l.ControlComponent.VALUE};I.color="#fff",I.highlight="#1677FF",Ut(i,[I],R,{editorOptions:this.options}),s.spliceElementList(i,m+p,0,[I])}return m+t.length-1}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const r=this.control.getValueRange(t);if(!r)return-1;const{startIndex:s,endIndex:a}=r;if(!~s||!~a)return-1;const c=t.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(c,s+1,a-s,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(s,t),s}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{endIndex:i}=n,r=e[i];return!!r?.originControlId&&!!r?.controlId&&r.originControlId!==r.controlId&&r.control?.type===l.ControlType.BUTTON&&!r.control?.buttonText&&(t.key===l.KeyMap.Backspace||t.key===l.KeyMap.Delete)?this.control.removeControl(i):r?.controlComponent==="value"&&r.control?.type==="button"&&r.control?.buttonText?t.key===l.KeyMap.Backspace||t.key===l.KeyMap.Delete?(r.controlId&&this.removeByValue(e,r.controlId),i):null:(t.key===l.KeyMap.Backspace&&r?.controlComponent==="value"&&r.control?.type==="button"&&!r.control?.buttonText,null)}removeByValue(t,e){return $e.isDeleting=!0,new Promise(n=>{for(let c=t.length-1;c>=0;c--)(t[c].type=="control"||t[c].type=="text")&&t[c].controlId===e&&t.splice(c,1);const{startIndex:i,endIndex:r}=this.range.getRange(),s=!0,a=r;this.draw.render({curIndex:a,isSetCursor:s}),setTimeout(()=>{$e.isDeleting=!1},300),n(!0)})}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl()||$e.isDeleting||!this.control.getPosition())return;const e=this.draw.getElementList(),{startIndex:n}=this.control.getRange();if(e[n]?.controlId!==this.element?.controlId)return;const i=this.control.getDraw().getPosition().getPositionContext();if(!i.isDirectHit||i.index!==n||e[i.index]?.controlId!==this.element?.controlId)return;const r=e[n]?.controlId,s=e[n]?.control;if(!(r?.endsWith("_text")||s?.buttonText)){if(this.options.mode=="form"){const a=e[n].controlId;if(!a)return;const c=e.filter(d=>d.controlId==a);c[0].control.buttonText||this.showInputModal(c)}else if(this.options.mode=="edit"){const a=e[n].controlId,c=e.filter(d=>d.controlId==a);this.showEditModal(c)}}}showInputModal(t){if(this.inputModal){this.closeInputModal();return}this.isPopup=!0,this.inputModal=document.createElement("div"),this.inputModal.classList.add(`${z}-button-input-modal`),this.inputModal.setAttribute(Re,l.EditorComponent.POPUP),this.inputModal.oncontextmenu=c=>{c.preventDefault(),c.stopPropagation()};const e=document.createElement("div");e.classList.add(`${z}-button-input-modal__content`),e.oncontextmenu=c=>{c.preventDefault(),c.stopPropagation()};const n=document.createElement("div");n.classList.add(`${z}-button-input-modal__title`),n.innerText="请输入按钮展开文字(用逗号分隔)";const i=document.createElement("textarea");i.classList.add(`${z}-button-input-modal__textarea`),i.placeholder="例如:选项1,选项2,选项3",i.rows=5;const r=document.createElement("div");r.classList.add(`${z}-button-input-modal__buttons`);const s=document.createElement("button");s.classList.add(`${z}-button-input-modal__cancel`),s.innerText="取消",s.onclick=()=>this.closeInputModal();const a=document.createElement("button");a.classList.add(`${z}-button-input-modal__confirm`),a.innerText="确认",a.onclick=()=>{const c=i.value.trim();if(c){const d=c.split(/[,,]/).map((R,u)=>({value:R.trim(),code:String(u+1)})).filter(R=>R.value);if(d.length>0&&t[0]?.controlId){const R={controlId:t[0].controlId,element:[{...t[0],newButtonValue:d}]};this.draw.getCommand().executeButton(R)}}this.closeInputModal()},r.appendChild(s),r.appendChild(a),e.appendChild(n),e.appendChild(i),e.appendChild(r),this.inputModal.appendChild(e),this.draw.getContainer().appendChild(this.inputModal),setTimeout(()=>i.focus(),100),this.inputModal.onclick=c=>{c.target===this.inputModal&&this.closeInputModal()}}closeInputModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}showEditModal(t){const e=t[0]?.control||{},n=e.buttonLabel||e.label||"按钮",i=e.code||"";this.isPopup=!0,new ph({title:"修改按钮属性",data:[{type:"text",label:"按钮标签",name:"buttonLabel",required:!0,placeholder:"请输入按钮标签",value:n},{type:"text",label:"按钮代码",name:"code",placeholder:"请输入按钮代码",value:i}],onClose:()=>{this.isPopup=!1},onCancel:()=>{this.isPopup=!1},onConfirm:r=>{const s=r.find(h=>h.name==="buttonLabel")?.value?.trim()||"按钮",a=r.find(h=>h.name==="code")?.value?.trim()||"",c=this.control.getElementList(),d=t[0]?.controlId;if(d)for(let h=0;h<c.length;h++){const g=c[h];g.controlId===d&&g.control&&(g.control.buttonLabel=s,g.control.label=s,g.control.code=a)}const R=[];for(let h=0;h<s.length;h++)R.push({value:s[h],controlComponent:l.ControlComponent.VALUE});const u=this.setValue(R);u!==-1&&this.control.repaintControl({curIndex:u}),this.isPopup=!1}})}destroy(){this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}}class gr{draws;ranges;element;control;options;position;constructor(t,e){const n=e.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.getOptions(),this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getValue(t={}){const e=t.elementList||this.control.getElementList();let{startIndex:n}=t.range||this.control.getRange();const i=this.control.getDraw(),r=t?null:i.getTd();n>=e.length&&(n=e.length-1);const s=e[n],a=[];let c=r;if(s.controlComponent===l.ControlComponent.PRETEXTFIX||s.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){let f=n+1;for(;f<e.length;){const T=e[f];if(T.controlId!==s.controlId||T.controlComponent!==l.ControlComponent.PRETEXTFIX&&T.controlComponent!==l.ControlComponent.PRETEXTFIX_TEXT){n=f-1;break}f++}}let d=e,R=n;for(;;){if(R<0&&c?.linkTdPrevId){const T=i.getTdById(c.linkTdPrevId);if(T){d=T.value,R=d.length-1,c=T;continue}}if(R<0)break;const f=d[R];if(f.controlId!==s.controlId||f.controlComponent===l.ControlComponent.PRETEXTFIX||f.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||f.controlComponent===l.ControlComponent.TEXTFIXLABEL)break;f.controlComponent===l.ControlComponent.VALUE&&a.unshift(f),R--}c=r;let u=e,h=n+1;for(;;){if(h>=u.length&&c?.linkTdNextId){const T=i.getTdById(c.linkTdNextId);if(T){u=T.value,h=0,c=T;continue}}const f=u[h];if(!f||f.controlId!==s.controlId||f.controlComponent===l.ControlComponent.POSTTEXTFIX||f.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||f.controlComponent===l.ControlComponent.TEXTFIXLABEL)break;f.controlComponent===l.ControlComponent.VALUE&&a.push(f),h++}return a.filter(f=>f.type!==l.ElementType.SPLIT_TAG)}removeNextControlElement(t,e){const n=this.control.getDraw();if(e=e??n.getTd()?.linkTdNextId,e){const i=n.getTdById(e);if(i){if(i.value.length){if(i.value[1].controlId===t)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(t,i.linkTdNextId)}}}setValue(t,e={},n={}){if(this.options.mode===l.EditorMode.FORM||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=r,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):this.control.removePlaceholder(s,{elementList:i});const d=i[s],R=i[s+1];let u=d.originControlId||d.controlId,h=d.originControlId&&(d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT);if(!h&&d.controlId&&(d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT)&&R?.controlId&&R.controlId!==d.controlId)if(R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX)for(let p=s;p>=0;p--){const I=i[p];if(I.controlId===d.controlId&&(I.controlComponent===l.ControlComponent.PREFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let L=p-1;L>=0;L--){const P=i[L];if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===l.ControlComponent.PRETEXTFIX||P.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||P.controlComponent===l.ControlComponent.PREFIX||P.controlComponent===l.ControlComponent.PRE_TEXT)){u=P.controlId,h=!0;break}if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===l.ControlComponent.POSTFIX||P.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}else(R.controlComponent===l.ControlComponent.POSTFIX||R.controlComponent===l.ControlComponent.POSTTEXTFIX)&&(u=R.controlId,h=!0);if(!h&&d.controlId&&(d.controlComponent===l.ControlComponent.POSTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX||d.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===l.ControlComponent.POST_TEXT))for(let p=s;p>=0;p--){const I=i[p];if(I.controlId===d.controlId&&(I.controlComponent===l.ControlComponent.PREFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let L=p-1;L>=0;L--){const P=i[L];if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===l.ControlComponent.PRETEXTFIX||P.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||P.controlComponent===l.ControlComponent.PREFIX||P.controlComponent===l.ControlComponent.PRE_TEXT)){u=P.controlId,h=!0;break}if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===l.ControlComponent.POSTFIX||P.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}const g=d.type&&!$t.includes(d.type)||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT?Dt(d,["control","controlId",...Gt]):ie(d,["type"]);h&&(g.controlId=u,delete g.originControlId);const f=r.startIndex+1,T=[],m=p=>{const I=T.length?T:i,L=T.length?T.length-1:r.startIndex;Ut(I,[p],L,{editorOptions:this.options}),T.push(p)};for(let p=0;p<t.length;p++){const I=t[p];if(I.type===l.ElementType.CONTROL&&I.control){const L=I,P=L.controlId||lt(),O=L.control?.value||[],S=L.control?.type===l.ControlType.TEXTFIELD,F={...g,controlId:P,type:l.ElementType.CONTROL,control:L.control,originControlId:u},N=S?l.ControlComponent.PRETEXTFIX:l.ControlComponent.PREFIX,V=S?l.ControlComponent.POSTTEXTFIX:l.ControlComponent.POSTFIX,Y=S?L.control?.preTextFix||this.options.control.preTextFix:L.control?.prefix||this.options.control.prefix;for(let W=0;W<Y.length;W++){const E={...F,value:Y[W],controlComponent:N};m(E)}for(let W=0;W<O.length;W++){const E=O[W],C={...F,...E,controlComponent:l.ControlComponent.VALUE,type:E.type};(C.color===this.options.control.textFixColor||C.color===this.options.control.placeholderColor)&&(C.color=this.options.defaultColor),m(C)}if(O.length===0){const W=L.control?.placeholder||"";for(let E=0;E<W.length;E++){const C={...F,value:W[E],controlComponent:l.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};m(C)}}const X=S?L.control?.postTextFix||this.options.control.postTextFix:L.control?.postfix||this.options.control.postfix;for(let W=0;W<X.length;W++){const E={...F,value:X[W],controlComponent:V};m(E)}}else if(I.type||I.value){g.color=this.options.defaultColor;const L={...g,...I,controlComponent:l.ControlComponent.VALUE};(L.color===this.options.control.textFixColor||L.color===this.options.control.placeholderColor)&&(L.color=this.options.defaultColor),m(L)}}return T.length&&c.spliceElementList(i,f,0,T),r.startIndex+T.length}clearValue(t={},e={}){if(!e.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),i=t.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:r,endIndex:s}=i;return this.control.getDraw().spliceElementList(n,r+1,s-r,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(r,t)),r}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange(),i=n.startIndex,r=n.endIndex;if(t.key===l.KeyMap.Backspace&&i===r&&i>0){const m=e[i-1],p=m?.controlComponent===l.ControlComponent.POSTFIX||m?.controlComponent===l.ControlComponent.POSTTEXTFIX,I=m?.controlComponent===l.ControlComponent.PLACEHOLDER,L=!!m?.controlId,O=this.draws.getPosition().getPositionList(),S=O[i],F=O[i-1],N=S&&F&&S.rowIndex===F.rowIndex;if((p||I)&&L&&N)return this.control.removeControl(i-1)}this.control.shrinkBoundary();const{startIndex:s,endIndex:a}=n,c=e[s],d=this.control.getDraw(),R=e[a+1],u=!!c?.originControlId&&!!c?.controlId&&c.originControlId!==c.controlId,h=u&&(c.controlComponent===l.ControlComponent.PREFIX||c.controlComponent===l.ControlComponent.PRE_TEXT||c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===l.ControlComponent.POSTFIX||c.controlComponent===l.ControlComponent.POST_TEXT||c.controlComponent===l.ControlComponent.POSTTEXTFIX||c.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===l.ControlComponent.PLACEHOLDER||c.controlComponent===l.ControlComponent.TEXTFIXLABEL),g=u&&c.control?.type===l.ControlType.BUTTON&&c.controlComponent===l.ControlComponent.VALUE,f=!!R?.originControlId&&!!R?.controlId&&R.originControlId!==R.controlId&&(R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT||R.controlComponent===l.ControlComponent.PRETEXTFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||R.controlComponent===l.ControlComponent.PLACEHOLDER||R.controlComponent===l.ControlComponent.TEXTFIXLABEL),T=!!R?.originControlId&&!!R?.controlId&&R.originControlId!==R.controlId&&R.control?.type===l.ControlType.BUTTON;if(t.key===l.KeyMap.Backspace){if(s===a&&(h||g))return this.control.removeControl(s);if(this.options.mode===l.EditorMode.FORM)this.strikeout();else return s!==a?e.slice(s,a+1).some(I=>I.controlComponent===l.ControlComponent.POSTTEXTFIX||I.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)?s:(d.spliceElementList(e,s+1,a-s),this.getValue().length||this.control.addPlaceholder(s),s===0&&e[0].type===l.ElementType.SPLIT_TAG?d.fixPosition(!0)??s:s):c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===l.ControlComponent.POSTTEXTFIX||c.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===l.ControlComponent.TEXTFIXLABEL||c.controlComponent===l.ControlComponent.PLACEHOLDER?s:(d.spliceElementList(e,s,1),this.getValue().length||this.control.addPlaceholder(s-1),s===1&&e[0].type===l.ElementType.SPLIT_TAG||s===0?d.fixPosition(!0)??s-1:s-1)}else if(t.key===l.KeyMap.Delete){if(s===a&&(h||g))return this.control.removeControl(s);if(s===a&&(f||T))return this.control.removeControl(a+1);if(this.options.mode===l.EditorMode.FORM)this.strikeout();else return s!==a?(d.spliceElementList(e,s+1,a-s),this.getValue().length||this.control.addPlaceholder(s),s===0&&e[0].type===l.ElementType.SPLIT_TAG?d.fixPosition(!0)??s:s):(R||d.getTd()?.linkTdNextId&&c.controlId&&this.removeNextControlElement(c.controlId),R&&((c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)&&(R.controlComponent===l.ControlComponent.PLACEHOLDER||R.controlComponent===l.ControlComponent.TEXTFIXLABEL)||R.controlComponent===l.ControlComponent.POSTTEXTFIX||R.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===l.ControlComponent.PLACEHOLDER||c.controlComponent===l.ControlComponent.TEXTFIXLABEL)?s:(d.spliceElementList(e,s+1,1),this.getValue().length||this.control.addPlaceholder(s),s===0&&e[0].type===l.ElementType.SPLIT_TAG?d.fixPosition(!0)??s:s))}return a}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}strikeout(t,e={},n={}){const{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return;const s=this.ranges.getSelectionElementList(),a=this.position.getCursorPosition(),c=q(new Date).format("YYYY-MM-DD HH:mm:ss");if(s?.length){if(!this.element.strikeout){const d=s.findIndex(R=>!R.strikeout);s.forEach(R=>{R.deletePerson="SWJ",R.deleteTime=c,R.strikeout=!!~d}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),setTimeout(()=>{this.strikeoute()},100)}}else{const d=this.control.getElementList()[a.index];if(!this.control.getElementList()[a.index].strikeout&&d?.metrics.width>0){this.control.getElementList()[a.index].strikeout=!0,this.control.getElementList()[a.index].deletePerson="SWJ",this.control.getElementList()[a.index].deleteTime=c;const R=--a.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const h=R;this.draws.render({curIndex:h,isSetCursor:!0}),a.index=R,this.position.setCursorPosition(a),this.ranges.setRange(R,R)},100)}else{const{elementList:R,range:u}=this.control.mergeControl(n),h=u.startIndex;if(h>=0&&h<R.length&&R[h]?.metrics?.width!==void 0&&R[h].metrics.width<=0&&!R[h]?.strikeout){this.draws.spliceElementList(R,u.startIndex,1,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule});const g=!0,f=u.startIndex-1;this.draws.render({curIndex:f,isSetCursor:g}),a.index=f,delete a.value,this.position.setCursorPosition(a),this.ranges.setRange(f,f)}}}}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:r}=this.ranges.getRange(),a=this.draws.getElementList()[r];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}const Lh={indent:"        ",divider:"────────────────"};class fr{draw;element;control;options;isPopup;inputModal=null;constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:r,endIndex:s}=n;for(let a=r;a<=s;a++){const c=e[a];c.controlComponent===l.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:r}=this.control.mergeControl(e),s=this.control.getDraw(),{startIndex:a}=r,d=i[a].controlId;let R=a;for(let p=a;p>=0;p--){const I=i[p];if(I.controlId!==d)break;if(I.controlComponent===l.ControlComponent.PREFIX){R=p;break}}let u=a;for(let p=a;p<i.length;p++){const I=i[p];if(I.controlId!==d){u=p;break}if(I.controlComponent===l.ControlComponent.POSTFIX){u=p;break}}const h=R+1,g=u-1;g>=h&&s.spliceElementList(i,h,g-h+1);const f=i[R],T=Dt(f,["control","controlId",...Gt]),m=R+1;for(let p=0;p<t.length;p++){const I={...T,...t[p],value:t[p].value===`
105
+ `?H:t[p].value,controlComponent:l.ControlComponent.VALUE};(I.color===this.options.control.bracketColor||I.color===this.options.control.placeholderColor)&&(I.color=this.options.defaultColor),Ut(i,[I],R,{editorOptions:this.options}),s.spliceElementList(i,m+p,0,[I])}return m+t.length-1}keydown(t){if(this.control.getIsDisabledControl()||this.options.mode===l.EditorMode.FORM)return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i}=n,r=e[i];if(t.key===l.KeyMap.Backspace||t.key===l.KeyMap.Delete){const s=r.controlId;let a=i,c=i;for(;a>0&&e[a-1].controlId===s;)a--;for(;c<e.length-1&&e[c+1].controlId===s;)c++;return this.draw.spliceElementList(e,a,c-a+1),a>0?a-1:0}return null}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}awake(){if(this.options.mode===l.EditorMode.PRINT||this.isPopup||this.control.getIsDisabledControl())return;let t=!1;const e=this.control.getElementList(),n=this.element.controlId;for(let i=0;i<e.length;i++){const r=e[i];r.controlId===n&&r.control&&r.control._justCreated&&(t=!0,delete r.control._justCreated)}t||this.showMenstrualHistoryDialog()}generateDisplayText(t){const{indent:e,divider:n}=Lh,{isMenopause:i,periodMin:r,periodMax:s,menarcheAge:a,cycleMin:c,cycleMax:d}=t,R=`${e}月经持续${r}~${s}天`,u=`${e}生理周期持续${c}~${d}天${H}`;let h;return i?h=`初潮年龄${a}岁${n}闭经年龄${t.menopauseAge||"_"}岁`:h=`初潮年龄${a}岁${n}末次日期${t.lastPeriod||"____-__-__"}`,`${H} ${R}
106
106
  ${h}
107
107
  ${u} `}textToElements(t){const e=[],n=t.split(`
108
- `);return n.forEach((i,r)=>{for(let s=0;s<i.length;s++)e.push({value:i[s],controlComponent:l.ControlComponent.VALUE});r<n.length-1&&e.push({value:_,controlComponent:l.ControlComponent.VALUE})}),e}showMenstrualHistoryDialog(){this.inputModal&&this.closeModal(),this.isPopup=!0;const t=this.element.control?.menstrualData;this.inputModal=document.createElement("div"),this.inputModal.className="menstrual-history-edit-modal",this.inputModal.setAttribute("editor-component","menstrual-history-edit-modal"),this.inputModal.innerHTML=`
108
+ `);return n.forEach((i,r)=>{for(let s=0;s<i.length;s++)e.push({value:i[s],controlComponent:l.ControlComponent.VALUE});r<n.length-1&&e.push({value:H,controlComponent:l.ControlComponent.VALUE})}),e}showMenstrualHistoryDialog(){this.inputModal&&this.closeModal(),this.isPopup=!0;const t=this.element.control?.menstrualData;this.inputModal=document.createElement("div"),this.inputModal.className="menstrual-history-edit-modal",this.inputModal.setAttribute("editor-component","menstrual-history-edit-modal"),this.inputModal.innerHTML=`
109
109
  <div class="menstrual-history-modal__mask"></div>
110
110
  <div class="menstrual-history-modal__container">
111
111
  <div class="menstrual-history-modal__header">
@@ -181,8 +181,8 @@ ${u} `}textToElements(t){const e=[],n=t.split(`
181
181
  <button class="btn-confirm">确认</button>
182
182
  </div>
183
183
  </div>
184
- `,document.body.appendChild(this.inputModal);const e=this.inputModal.querySelector(".menstrual-history-modal__mask"),n=this.inputModal.querySelector(".menstrual-history-modal__container"),i=this.inputModal.querySelector(".menstrual-history-modal__close"),r=this.inputModal.querySelector(".btn-cancel"),s=this.inputModal.querySelector(".btn-confirm"),a=this.inputModal.querySelector("#mh-edit-notMenopause"),c=this.inputModal.querySelector("#mh-edit-isMenopauseForm"),d=this.inputModal.querySelectorAll('input[name="mh-edit-isMenopause"]'),R=()=>{this.closeModal()};n.addEventListener("click",u=>{u.stopPropagation()}),e.addEventListener("click",R),i.addEventListener("click",R),r.addEventListener("click",R),d.forEach(u=>{u.addEventListener("change",()=>{const h=u.value==="true";a.style.display=h?"none":"block",c.style.display=h?"block":"none"})}),s.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation();const h=this.inputModal;if(!h)return;const g=h.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let f;g?f={isMenopause:!0,periodMin:h.querySelector("#mh-edit-periodMin2")?.value||"_",periodMax:h.querySelector("#mh-edit-periodMax2")?.value||"_",menarcheAge:h.querySelector("#mh-edit-menarcheAge2")?.value||"_",menopauseAge:h.querySelector("#mh-edit-menopauseAge")?.value||"_",cycleMin:h.querySelector("#mh-edit-cycleMin2")?.value||"_",cycleMax:h.querySelector("#mh-edit-cycleMax2")?.value||"_"}:f={isMenopause:!1,periodMin:h.querySelector("#mh-edit-periodMin")?.value||"_",periodMax:h.querySelector("#mh-edit-periodMax")?.value||"_",menarcheAge:h.querySelector("#mh-edit-menarcheAge1")?.value||"_",lastPeriod:h.querySelector("#mh-edit-lastPeriod")?.value||"____-__-__",cycleMin:h.querySelector("#mh-edit-cycleMin")?.value||"_",cycleMax:h.querySelector("#mh-edit-cycleMax")?.value||"_"};const T=this.control.getElementList(),p=this.element.controlId;for(let P=0;P<T.length;P++){const O=T[P];O.controlId===p&&O.control&&(O.control.menstrualData=f)}const m=this.generateDisplayText(f),I=this.textToElements(m);this.closeModal();const L=this.setValue(I);L!==-1&&(this.control.repaintControl({curIndex:L}),this.control.emitControlContentChange({}))})}closeModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}destroy(){this.closeModal()}}class mh{controlBorder;textFieldUnderline;draw;range;listener;eventBus;controlSearch;options;controlOptions;activeControl;activeControlValue;preElement;constructor(t){this.controlBorder=new hc(t),this.textFieldUnderline=new ph(t),this.draw=t,this.range=t.getRange(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.controlSearch=new uc(this),this.options=t.getOptions(),this.controlOptions=this.options.control,this.activeControl=null,this.activeControlValue=[],this.preElement=null}setHighlightList(t){this.controlSearch.setHighlightList(t)}computeHighlightList(){this.controlSearch.getHighlightList().length&&this.controlSearch.computeHighlightList()}renderHighlightList(t,e){this.controlSearch.getHighlightMatchResult().length&&this.controlSearch.renderHighlightList(t,e)}getDraw(){return this.draw}filterAssistElement(t){return t.filter((e,n)=>{if(e.type===l.ElementType.TABLE){const i=e.trList;for(let r=0;r<i.length;r++){const s=i[r];for(let a=0;a<s.tdList.length;a++){const c=s.tdList[a];c.value=this.filterAssistElement(c.value)}}}if(!e.controlId)return!0;if(e.control?.type===l.ControlType.MENSTRUAL_HISTORY&&this.options.mode===l.EditorMode.PRINT&&(e.controlComponent===l.ControlComponent.PREFIX||e.controlComponent===l.ControlComponent.POSTFIX)||e.control?.type===l.ControlType.SELECT&&this.options.mode===l.EditorMode.PRINT&&(e.controlComponent===l.ControlComponent.PREFIX||e.controlComponent===l.ControlComponent.POSTFIX)||e.control?.type===l.ControlType.NUMBER&&this.options.mode===l.EditorMode.PRINT&&(e.controlComponent===l.ControlComponent.PREFIX||e.controlComponent===l.ControlComponent.POSTFIX)||e.control?.type===l.ControlType.TEXT&&this.options.mode===l.EditorMode.PRINT&&e.strikeout&&e.deletePerson)return!1;if(e.control?.minWidth){if(e.controlComponent===l.ControlComponent.PREFIX||e.controlComponent===l.ControlComponent.POSTFIX)return e.value="",!0}else{const i=this.options.mode===l.EditorMode.FORM;if(e.control?.preText&&e.controlComponent===l.ControlComponent.PRE_TEXT){if(i)return!0;let r=!1,s=n+1;for(;s<t.length;){const a=t[s];if(e.controlId!==a.controlId)break;if(a.controlComponent===l.ControlComponent.VALUE){r=!0;break}s++}return r}if(e.control?.postText&&e.controlComponent===l.ControlComponent.POST_TEXT){if(i)return!0;let r=!1,s=n-1;for(;s<t.length;){const a=t[s];if(e.controlId!==a.controlId)break;if(a.controlComponent===l.ControlComponent.VALUE){r=!0;break}s--}return r}}if(e.control?.preTextFix&&e.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT){let i=!1,r=n+1;for(;r<t.length;){const s=t[r];if(e.controlId!==s.controlId)break;if(s.controlComponent===l.ControlComponent.VALUE){i=!0;break}r++}return i}if(e.control?.postTextFix&&e.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT){let i=!1,r=n-1;for(;r<t.length;){const s=t[r];if(e.controlId!==s.controlId)break;if(s.controlComponent===l.ControlComponent.VALUE){i=!0;break}r--}return i}return e.controlComponent!==l.ControlComponent.PREFIX&&e.controlComponent!==l.ControlComponent.POSTFIX&&e.controlComponent!==l.ControlComponent.PLACEHOLDER&&e.controlComponent!==l.ControlComponent.PRETEXTFIX&&e.controlComponent!==l.ControlComponent.POSTTEXTFIX&&e.controlComponent!==l.ControlComponent.TEXTFIXLABEL})}getIsRangeCanCaptureEvent(){if(!this.activeControl)return!1;const{startIndex:t,endIndex:e}=this.getRange();if(!~t&&!~e)return!1;const n=this.getElementList(),i=n[t];if(i.controlComponent===l.ControlComponent.PLACEHOLDER)return!1;if(t===e&&t>0){const s=n[t-1],a=s?.controlComponent===l.ControlComponent.POSTFIX||s?.controlComponent===l.ControlComponent.POSTTEXTFIX,c=s?.controlComponent===l.ControlComponent.PLACEHOLDER,d=!!s?.controlId,R=!!s?.originControlId;let u=!1;if(R){const m=s.originControlId;for(let I=t;I<n.length;I++){const L=n[I];if(L.controlId===m&&!L.originControlId){u=!0;break}if(L.controlId&&L.controlId!==m&&L.originControlId!==m)break}}const g=this.draw.getPosition().getPositionList(),f=g[t],T=g[t-1],p=f&&T&&f.rowIndex===T.rowIndex;if((a||c)&&d&&p&&!u)return!1}if(t===e&&(i.controlComponent===l.ControlComponent.POSTFIX||i.controlComponent===l.ControlComponent.POSTTEXTFIX))return!0;const r=n[e];return!!(i.controlId&&i.controlId===r.controlId&&r.controlComponent!==l.ControlComponent.POSTFIX&&r.controlComponent!==l.ControlComponent.POSTTEXTFIX)}getIsRangeInPostfix(){if(!this.activeControl)return!1;const{startIndex:t,endIndex:e}=this.getRange();if(t!==e)return!1;const i=this.getElementList()[t];return i.controlComponent===l.ControlComponent.POSTFIX||i.controlComponent===l.ControlComponent.POSTTEXTFIX}getIsRangeWithinControl(){const{range:{startIndex:t,endIndex:e},elementList:n}=this.range.getRangeElement();if(!~t&&!~e)return!1;const i=n[t],r=n[e];if(i?.controlId&&i.controlId===r.controlId&&r.controlComponent!==l.ControlComponent.POSTFIX&&r.controlComponent!==l.ControlComponent.POSTTEXTFIX&&r.controlComponent!==l.ControlComponent.POSTTEXTFIX_TEXT&&r.controlComponent!==l.ControlComponent.POST_TEXT)return!0;if(r?.originControlId&&(r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX)){const s=r.originControlId;for(let a=e+1;a<n.length;a++){const c=n[a];if(c.controlId===s)return!0;if(c.controlId&&c.controlId!==s&&c.originControlId!==s)break}}if(!r?.originControlId&&r?.controlId&&(r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX)){const s=n[e+1];if(s?.controlId&&s.controlId!==r.controlId&&(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRETEXTFIX))return!0;if(s?.controlId&&s.controlId!==r.controlId&&(s.controlComponent===l.ControlComponent.POSTFIX||s.controlComponent===l.ControlComponent.POSTTEXTFIX))return s.originControlId,!0;for(let a=e;a>=0;a--){const c=n[a];if(c.controlId===r.controlId&&(c.controlComponent===l.ControlComponent.PREFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let d=a-1;d>=0;d--){const R=n[d];if(R.controlId&&R.controlId!==r.controlId&&(R.controlComponent===l.ControlComponent.PRETEXTFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT))return!0;if(R.controlId&&R.controlId!==r.controlId&&(R.controlComponent===l.ControlComponent.POSTFIX||R.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}}if(r?.originControlId){const s=r.originControlId;for(let a=e+1;a<n.length;a++){const c=n[a];if(c.controlId===s)return!0;if(c.controlId&&c.controlId!==s&&c.originControlId!==s)break}}if(!i?.controlId&&this.activeControl){const a=this.activeControl.getElement()?.controlId;if(a)for(let c=t;c>=0;c--){const d=n[c];if(d.controlId===a&&!d.originControlId){if(d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT)for(let R=e;R<n.length;R++){const u=n[R];if(u.controlId===a&&!u.originControlId){if(u.controlComponent===l.ControlComponent.POSTTEXTFIX||u.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||u.controlComponent===l.ControlComponent.POSTFIX||u.controlComponent===l.ControlComponent.POST_TEXT)return!0;break}}break}}}return!1}getIsElementListContainFullControl(t){if(!t.some(i=>i.controlId))return!1;let e=0,n=0;for(let i=0;i<t.length;i++){const r=t[i];r.controlComponent===l.ControlComponent.PREFIX||r.controlComponent===l.ControlComponent.PRETEXTFIX?e++:(r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX)&&n++}return!e||!n?!1:e===n}getIsDisabledControl(t={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:e,endIndex:n}=t.range||this.range.getRange();if(e===n&&~e&&~n){const r=(t.elementList||this.getElementList())[e];if(r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX)return!1}return!!this.activeControl.getElement()?.control?.disabled}getIsDisabledPasteControl(t={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:e,endIndex:n}=t.range||this.range.getRange();return e===n&&~e&&~n&&(t.elementList||this.getElementList())[e].controlComponent===l.ControlComponent.POSTFIX?!1:!!this.activeControl.getElement()?.control?.pasteDisabled}getIsExistValueByElementListIndex(t,e){const n=t[e];if(!n.controlId)return!1;if(n.control?.type===l.ControlType.CHECKBOX||n.control?.type===l.ControlType.RADIO)return!!n.control?.code;if(n.controlComponent===l.ControlComponent.VALUE)return!0;if(n.controlComponent===l.ControlComponent.PLACEHOLDER)return!1;if(n.controlComponent===l.ControlComponent.PREFIX||n.controlComponent===l.ControlComponent.PRE_TEXT){let i=e+1;for(;i<t.length;){const r=t[i];if(r.controlId!==n.controlId)return!1;if(r.controlComponent===l.ControlComponent.VALUE)return!0;if(r.controlComponent===l.ControlComponent.PLACEHOLDER)return!1;i++}}if(n.controlComponent===l.ControlComponent.PRETEXTFIX||n.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){let i=e+1;for(;i<t.length;){const r=t[i];if(r.controlId!==n.controlId)return!1;if(r.controlComponent===l.ControlComponent.VALUE)return!0;if(r.controlComponent===l.ControlComponent.PLACEHOLDER||r.controlComponent===l.ControlComponent.TEXTFIXLABEL)return!1;i++}}if(n.controlComponent===l.ControlComponent.POSTFIX||n.controlComponent===l.ControlComponent.POSTTEXTFIX){let i=e-1;for(;i>=0;){const r=t[i];if(r.controlId!==n.controlId)return!1;if(r.controlComponent===l.ControlComponent.VALUE)return!0;if(r.controlComponent===l.ControlComponent.PLACEHOLDER)return!1;i--}}return!1}getControlHighlight(t,e){return this.controlSearch.getControlHighlight(t,e)}getContainer(){return this.draw.getContainer()}getElementList(){return this.draw.getElementList()}getPosition(){const t=this.draw.getPosition().getPositionList(),{endIndex:e}=this.range.getRange();return t[e]||null}getPreY(){const t=this.draw.getHeight(),e=this.draw.getPageGap();return(this.getPosition()?.pageNo??this.draw.getPageNo())*(t+e)}getRange(){return this.range.getRange()}getValueRange(t={}){const e=t.elementList||this.getElementList(),{startIndex:n}=t.range||this.getRange(),i=e[n];let r=n;for(;r>0;){const a=e[r];if(a.controlId!==i.controlId||a.controlComponent===l.ControlComponent.PREFIX||a.controlComponent===l.ControlComponent.PRE_TEXT||a.controlComponent===l.ControlComponent.PRETEXTFIX||a.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)break;r--}let s=n+1;for(;s<e.length;){const a=e[s];if(a.controlId!==i.controlId||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT||a.controlComponent===l.ControlComponent.POSTTEXTFIX||a.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)break;s++}return r===s?null:{startIndex:r,endIndex:s-1}}shrinkBoundary(t={}){this.range.shrinkBoundary(t)}getActiveControl(){return this.activeControl}getActiveTextControlLimit(){if(!this.activeControl)return null;const t=this.activeControl.getElement(),e=t?.controlId,n=t?.originControlId||null;if(!e||t.control?.type!==l.ControlType.TEXT)return null;const i=this.getElementList(),r=n||null;let s=-1,a=-1,c=-1,d=-1;for(let h=0;h<i.length;h++){const g=i[h];g.controlId!==e||(n?g.originControlId!==n:g.originControlId)||(s===-1&&(s=h),a=h,(g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT||g.controlComponent===l.ControlComponent.PRETEXTFIX||g.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)&&(c=h),d===-1&&(g.controlComponent===l.ControlComponent.POSTFIX||g.controlComponent===l.ControlComponent.POST_TEXT||g.controlComponent===l.ControlComponent.POSTTEXTFIX||g.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)&&(d=h))}if(s===-1)return null;const R=c!==-1?c:s,u=d!==-1?d-1:a;return{controlId:e,originControlId:n,parentControlId:r,startIndex:R,endIndex:u<R?R:u}}getActiveNestedTextLimit(){const t=this.getActiveTextControlLimit();return!t?.parentControlId||!this.getElementList().some(n=>n.controlId===t.parentControlId&&!n.originControlId&&n.control?.type===l.ControlType.TEXTFIELD)?null:{controlId:t.controlId,parentControlId:t.parentControlId,startIndex:t.startIndex,endIndex:t.endIndex}}getControlElementList(t={}){const e=t.elementList||this.getElementList(),{startIndex:n}=t.range||this.getRange(),i=e[n];if(!i?.controlId)return[];const r=[];let s=n;for(;s>0;){const c=e[s];if(c.controlId!==i.controlId)break;r.unshift(c),s--}let a=n+1;for(;a<e.length;){const c=e[a];if(c.controlId!==i.controlId)break;r.push(c),a++}return r}updateActiveControlValue(){this.activeControl&&(this.activeControlValue=this.getControlElementList())}emitControlChange(t){if(!this.activeControl)return;const e=this.eventBus.isSubscribe("controlChange");if(!this.listener.controlChange&&!e)return;let n;const i=this.activeControlValue,r=this.activeControl.getElement();i?.length?n=i[0].control:(n=De(at(r)).control,n.value=[]);const s={state:t,control:n,controlId:r.controlId};this.listener.controlChange?.(s),e&&this.eventBus.emit("controlChange",s)}initControl(){const t=this.getElementList(),e=this.getRange(),n=t[e.startIndex];if(this.activeControl){if(this.activeControl instanceof In||this.activeControl instanceof bn||this.activeControl instanceof Vn||this.activeControl instanceof ke){const R=this.activeControl.getElement();n?.controlId!==R?.controlId?this.destroyControl():n.controlComponent===l.ControlComponent.POSTFIX?this.activeControl.destroy():this.activeControl.awake()}if(this.activeControl){const R=this.activeControl.getElement(),u=n.controlId,h=R.controlId;if(u&&u===h){this.updateActiveControlValue(),this.preElement=n;return}if(n.originControlId&&n.originControlId===h&&!(this.activeControl.getElement()?.control?.type===l.ControlType.TEXTFIELD&&n.controlId!==h)){this.updateActiveControlValue(),this.preElement=n;return}if(n.originControlId&&n.controlId&&n.controlId,!n.originControlId&&n.controlId&&n.controlId!==h&&(this.activeControl.getElement()?.originControlId,n.controlId),n.controlId&&n.controlId===h&&n.originControlId){this.updateActiveControlValue(),this.preElement=n;return}if(!u){const g=this.getElementList(),f=this.getRange(),{startIndex:T}=f;let p=null;for(let m=T;m>=0;m--){const I=g[m];if(I.controlComponent===l.ControlComponent.PRETEXTFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||I.controlComponent===l.ControlComponent.PREFIX||I.controlComponent===l.ControlComponent.PRE_TEXT){p=I.controlId||null;break}if(I.controlId&&I.controlId!==h||I.controlComponent===l.ControlComponent.POSTTEXTFIX||I.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||I.controlComponent===l.ControlComponent.POSTFIX||I.controlComponent===l.ControlComponent.POST_TEXT)break}if(p===h){this.updateActiveControlValue(),this.preElement=n;return}}}}if(this.destroyControl(),this.draw.isReadonly())return;let r=n.control,s=n;if(n.originControlId&&!r){const R=n.originControlId;for(let u=this.range.getRange().startIndex;u>=0;u--){const h=t[u];if(h.controlId===R&&!h.originControlId&&h.control){r=h.control,s=h;break}if(h.controlId===R&&!h.originControlId&&(h.controlComponent===l.ControlComponent.PRETEXTFIX||h.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||h.controlComponent===l.ControlComponent.PREFIX||h.controlComponent===l.ControlComponent.PRE_TEXT)){h.control&&(r=h.control,s=h);break}}}else if(!r&&n.controlId){const R=this.getElementList();for(let u=this.range.getRange().startIndex;u>=0;u--){const h=R[u];if(h.controlId!==n.controlId)break;if(h.control){r=h.control,s=h;break}if(h.controlComponent===l.ControlComponent.PRETEXTFIX||h.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||h.controlComponent===l.ControlComponent.PREFIX||h.controlComponent===l.ControlComponent.PRE_TEXT)break}}if(!r)return;if(r?.type===l.ControlType.TEXTFIELD&&this.draw.getMode()!==l.EditorMode.EDIT)if(n.originControlId){const R=n.controlId;for(let u=this.range.getRange().startIndex;u>=0;u--){const h=t[u];if(h.controlId===R&&h.originControlId===n.originControlId&&h.control&&h.control.type!==l.ControlType.TEXTFIELD){r=h.control,s=h;break}if(h.controlComponent===l.ControlComponent.PREFIX||h.controlComponent===l.ControlComponent.PRETEXTFIX)break}if(r?.type===l.ControlType.TEXTFIELD)return}else return;const a=this.draw.getPosition().getPositionContext(),c=this.range.getRange().startIndex,d=!!(a.isDirectHit&&a.index===c&&t[a.index]?.controlId===s.controlId);if(r?.type===l.ControlType.TEXTFIELD)this.activeControl=new Rr(s,this);else if(r.type===l.ControlType.TEXT)this.activeControl=new Ci(s,this);else if(r.type===l.ControlType.SELECT){const R=new In(s,this);this.activeControl=R,(d||this.draw.getMode()===l.EditorMode.FORM)&&R.awake()}else if(r.type===l.ControlType.CHECKBOX)this.activeControl=new Hn(s,this);else if(r.type===l.ControlType.RADIO)this.activeControl=new vo(s,this);else if(r.type===l.ControlType.DATE){const R=new bn(s,this);this.activeControl=R,R.awake()}else if(r.type===l.ControlType.NUMBER){const R=new Vn(s,this);this.activeControl=R,d&&R.awake()}else if(r.type===l.ControlType.BUTTON){const R=new ke(s,this);if(this.activeControl=R,d){R.awake();return}}else if(r.type===l.ControlType.MENSTRUAL_HISTORY){const R=new ur(s,this);this.activeControl=R,R.awake()}this.updateActiveControlValue(),this.preElement=s,s.controlComponent!==l.ControlComponent.POSTFIX&&s.controlComponent!==l.ControlComponent.POSTTEXTFIX&&this.emitControlChange(l.ControlState.ACTIVE)}destroyControl(t={}){if(!this.activeControl)return;const{isEmitEvent:e=!0}=t;(this.activeControl instanceof In||this.activeControl instanceof bn||this.activeControl instanceof Vn||this.activeControl instanceof ur)&&this.activeControl.destroy(),e&&this.preElement?.controlComponent!==l.ControlComponent.POSTFIX&&this.preElement?.controlComponent!==l.ControlComponent.POSTTEXTFIX&&this.emitControlChange(l.ControlState.INACTIVE),this.preElement=null,this.activeControl=null,this.activeControlValue=[]}repaintControl(t={}){const{curIndex:e,isCompute:n=!0,isSubmitHistory:i=!0,isSetCursor:r=!0}=t;e===void 0?(this.range.clearRange(),this.draw.render({isCompute:n,isSubmitHistory:i,isSetCursor:!1})):(this.range.setRange(e,e),this.draw.render({curIndex:e,isCompute:n,isSetCursor:r,isSubmitHistory:i}))}emitControlContentChange(t){const e=this.eventBus.isSubscribe("controlContentChange");if(!e&&!this.listener.controlContentChange)return;const n=t?.controlElement||this.activeControl?.getElement();if(!n)return;const i=t?.context?.elementList||this.getElementList(),{startIndex:r}=t?.context?.range||this.getRange();if(!i[r]?.controlId)return;const s=t?.controlValue||this.getControlElementList(t?.context);let a;if(s?.length?a=Pt(s)[0].control:(a=n.control,a.value=[]),!a)return;const c={control:a,controlId:n.controlId};this.listener.controlContentChange?.(c),e&&this.eventBus.emit("controlContentChange",c)}reAwakeControl(){if(!this.activeControl)return;const t=this.getElementList(),e=this.getRange(),n=t[e.startIndex];this.activeControl.setElement(n),(this.activeControl instanceof bn||this.activeControl instanceof In)&&this.activeControl.getIsPopup()&&(this.activeControl.destroy(),this.activeControl.awake())}selectValue(){const t=this.getElementList(),{startIndex:e}=this.getRange(),n=t[e];if(!n?.controlId||n.controlComponent!==l.ControlComponent.VALUE&&t[e+1]?.controlComponent===l.ControlComponent.VALUE)return!1;let i=e;for(;i>0&&t[i].controlComponent===l.ControlComponent.VALUE;)i--;let r=e+1;for(;r<t.length;){if(t[r].controlComponent!==l.ControlComponent.VALUE){r--;break}r++}if(i!==r){const s=this.range.getRange();return this.range.replaceRange({...s,startIndex:i,endIndex:r}),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),!0}return!1}moveCursor(t){const{index:e,trIndex:n,tdIndex:i,tdValueIndex:r}=t;let s=this.draw.getOriginalElementList(),a;const c=t.isTable?r:e;if(t.isTable?(s=s[e].trList[n].tdList[i].value,a=s[r]):a=s[e],a.control?.hide||a.area?.hide){const d=Ln(s,c);return{newIndex:d,newElement:s[d]}}if(a.controlComponent===l.ControlComponent.VALUE)return{newIndex:c,newElement:a};if(a.controlComponent===l.ControlComponent.POSTFIX){let d=c+1;for(;d<s.length;){if(s[d].controlId!==a.controlId)return{newIndex:d-1,newElement:s[d-1]};if(d===s.length-1)return{newIndex:d,newElement:s[d]};d++}}else if(a.controlComponent===l.ControlComponent.PREFIX||a.controlComponent===l.ControlComponent.PRE_TEXT){let d=c+1;for(;d<s.length;){const R=s[d];if(R.controlId!==a.controlId||R.controlComponent!==l.ControlComponent.PREFIX&&R.controlComponent!==l.ControlComponent.PRE_TEXT)return{newIndex:d-1,newElement:s[d-1]};d++}}else if(a.controlComponent===l.ControlComponent.PLACEHOLDER){let d=c-1;for(;d>0;){const R=s[d];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.VALUE||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT||R.controlComponent===l.ControlComponent.PRETEXTFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:s[d]};d--}}else if(a.controlComponent===l.ControlComponent.POST_TEXT||a.controlComponent===l.ControlComponent.TEXTFIXLABEL||a.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT){let d=c-1;for(;d>0;){const R=s[d];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.VALUE||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT||R.controlComponent===l.ControlComponent.PRETEXTFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:s[d]};d--}}else if(a.controlComponent===l.ControlComponent.POSTTEXTFIX){let d=c+1;for(;d<s.length;){if(s[d].controlId!==a.controlId)return{newIndex:d-1,newElement:s[d-1]};if(d===s.length-1)return{newIndex:d,newElement:s[d]};d++}}else if(a.controlComponent===l.ControlComponent.PRETEXTFIX||a.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){let d=c+1;for(;d<s.length;){const R=s[d];if(R.controlId!==a.controlId||R.controlComponent!==l.ControlComponent.PRETEXTFIX&&R.controlComponent!==l.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d-1,newElement:s[d-1]};d++}}return{newIndex:c,newElement:a}}removeControl(t,e={}){const n=e.elementList||this.getElementList(),i=n[t];if(!this.draw.isDesignMode()&&!i?.control?.hide&&!i?.area?.hide){const{deletable:L=!0}=i.control;if(!L)return null;const P=this.draw.getMode();if(P===l.EditorMode.FORM&&this.options.modeRule[P].controlDeletableDisabled)return null}let r=-1,s=-1;const a=!!i.originControlId,c=i.controlId,d=i.originControlId,R=i.control?.type===l.ControlType.BUTTON&&!i.control?.buttonText?`${c}_text`:"";let u=t;for(;u>=0;){const L=n[u];let P=!1;if(a?P=L.controlId===c&&L.originControlId===d:P=L.controlId===c&&!L.originControlId,!P){r=u;break}u--}let h=t;for(;h<n.length;){const L=n[h];let P=!1;if(a?P=L.controlId===c&&L.originControlId===d:P=L.controlId===c&&!L.originControlId,!P){s=h-1;break}h++}if(h===n.length&&(s=h-1),!~r&&!~s)return t;r=~r?r:0;const g=n[r+1],f=g.control,T=f?.type&&[l.ControlType.TEXT,l.ControlType.TEXTFIELD,l.ControlType.DATE,l.ControlType.NUMBER,l.ControlType.SELECT,l.ControlType.BUTTON].includes(f.type);let p=n[0]?.type===l.ElementType.SPLIT_TAG;if(!e.removeNext&&T&&!a&&g.controlComponent!==l.ControlComponent.PREFIX&&g.type!==l.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const L=this.draw.getTd();L&&this.createRemoveControlHandler(L,i.controlId,!0)}if(!e.removeNext&&T&&!a&&g.controlComponent!==l.ControlComponent.PRETEXTFIX&&g.type!==l.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const L=this.draw.getTd();L&&this.createRemoveControlHandler(L,i.controlId,!0)}if(!e.removePrev&&T&&!a&&n[s].controlComponent!==l.ControlComponent.POSTFIX)if(e.removeNext)e.removeNext();else{const L=this.draw.getTd();p=!!L?.linkTdNextId,L&&this.createRemoveControlHandler(L,i.controlId,!1)}if(!e.removePrev&&T&&!a&&n[s].controlComponent!==l.ControlComponent.POSTTEXTFIX)if(e.removeNext)e.removeNext();else{const L=this.draw.getTd();p=!!L?.linkTdNextId,L&&this.createRemoveControlHandler(L,i.controlId,!1)}this.draw.spliceElementList(n,r+1,s-r);let m=0;if(R)for(let L=n.length-1;L>=0;L--)n[L].controlId===R&&(L<=r&&m++,n.splice(L,1));const I=r-m;return!e.elementList&&p&&r===0?this.draw.fixPosition(!0)??I:I}createRemoveControlHandler(t,e,n){if(n){const i=this.draw.getTdById(t.linkTdPrevId);i&&i.value.splice(-1)[0]?.controlId===e&&this.removeControl(i.value.length-1,{elementList:i.value,removePrev:()=>{this.createRemoveControlHandler(i,e,n)}})}else{const i=this.draw.getTdById(t.linkTdNextId);i&&i.value[1]?.controlId===e&&this.removeControl(1,{elementList:i.value,removeNext:()=>{this.createRemoveControlHandler(i,e,n)}})}}removePlaceholder(t,e={}){const n=e.elementList||this.getElementList(),i=n[t],r=n[t+1];if(i.controlComponent===l.ControlComponent.PLACEHOLDER||i.controlComponent===l.ControlComponent.TEXTFIXLABEL||r?.controlComponent===l.ControlComponent.PLACEHOLDER||r?.controlComponent===l.ControlComponent.TEXTFIXLABEL){let s=!1,a=t;for(;a<n.length;){const c=n[a];if(c.controlId!==i.controlId)break;c.controlComponent===l.ControlComponent.PLACEHOLDER||c.controlComponent===l.ControlComponent.TEXTFIXLABEL?(s||(s=!0,this.draw.getHistoryManager().popUndo(),this.draw.submitHistory(t)),n.splice(a,1)):a++}}}addPlaceholder(t,e={}){const n=e.elementList||this.getElementList(),i=n[t],r=i.control;if(!r.placeholder)return;let s=t;for(;s>=0;){const g=n[s];if(g.controlId!==i.controlId){s++;break}if(g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT||g.controlComponent===l.ControlComponent.PRETEXTFIX||g.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)break;s--}s<0&&(s=0);const a=s+1;if(a<n.length){const g=n[a];if(g.controlId===i.controlId&&(g.controlComponent===l.ControlComponent.PLACEHOLDER||g.controlComponent===l.ControlComponent.VALUE))return}let c=!1,d=s+1;for(;d<n.length;){const g=n[d];if(g.controlId===i.controlId){if(g.controlComponent===l.ControlComponent.POSTFIX||g.controlComponent===l.ControlComponent.POST_TEXT||g.controlComponent===l.ControlComponent.POSTTEXTFIX||g.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)break}else if(g.controlId!==i.controlId&&(g.controlComponent===l.ControlComponent.VALUE||g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT)){c=!0;break}d++}if(c)return;const R=ct(r.placeholder),u=Dt(i,Gt),h=s+1;for(let g=0;g<R.length;g++){const f=R[g],T={...u,value:f===`
185
- `?_:f,controlId:i.controlId,type:l.ElementType.CONTROL,control:i.control,controlComponent:l.ControlComponent.PLACEHOLDER,color:this.controlOptions.placeholderColor};Ut(n,[T],s,{editorOptions:this.options}),this.draw.spliceElementList(n,h+g,0,[T])}}setValue(t){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.setValue(t)}setControlProperties(t,e={}){const n=e.elementList||this.getElementList(),{startIndex:i}=e.range||this.getRange(),r=n[i];let s=i;for(;s>0;){const c=n[s];if(c.controlId!==r.controlId)break;c.control={...c.control,...t},s--}let a=i+1;for(;a<n.length;){const c=n[a];if(c.controlId!==r.controlId)break;c.control={...c.control,...t},a++}}keydown(t){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.keydown(t)}cut(){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.cut()}getValueById(t){const{id:e,groupId:n,conceptId:i,areaId:r}=t,s=[];if(!e&&!i&&!n)return s;const a=new Set,c=(R,u)=>{let h=0;for(;h<R.length;){const g=R[h];if(h++,g.type===l.ElementType.TABLE){const P=g.trList;for(let O=0;O<P.length;O++){const S=P[O];for(let F=0;F<S.tdList.length;F++){const N=S.tdList[F],V=N.originalId??N.id;a.has(V)||(a.add(V),N.linkTdNextId?c(this.draw.getSplitTdValues(V),u):c(N.value,u))}}}if(!g.control||n&&g.control.groupId!==n||e&&g.controlId!==e||i&&g.control.conceptId!==i||r&&g.areaId!==r)continue;const{type:f,code:T,valueSets:p}=g.control;let m=h,I="";const L=[];for(;m<R.length;){const P=R[m];if(P.controlId!==g.controlId)break;(f===l.ControlType.TEXT||f===l.ControlType.TEXTFIELD||f===l.ControlType.DATE||f===l.ControlType.NUMBER)&&P.controlComponent===l.ControlComponent.VALUE&&(I+=P.value,L.push(ie(P,Xo))),m++}if(f===l.ControlType.TEXT||f===l.ControlType.TEXTFIELD||f===l.ControlType.DATE||f===l.ControlType.NUMBER)s.push({...g.control,zone:u,value:I||null,innerText:I||null,elementList:Pt(L)});else if(f===l.ControlType.SELECT||f===l.ControlType.CHECKBOX||f===l.ControlType.RADIO){const P=T?.split(",").map(O=>p?.find(S=>S.code===O)?.value).filter(Boolean).join("");s.push({...g.control,zone:u,value:T||null,innerText:P||null})}h=m}},d=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:R,elementList:u}of d)c(u,R);return s}setValueListById(t){if(!t.length)return;let e=!1,n=!1;const i=(s,a)=>{let c=0;for(;c<s.length;){const d=s[c];if(c++,d.type===l.ElementType.TABLE){const L=d.trList;for(let P=0;P<L.length;P++){const O=L[P];for(let S=0;S<O.tdList.length;S++){const F=O.tdList[S];i(F.value,F.id)}}}if(!d.control||d.type===l.ElementType.SPLIT_TAG)continue;const R=t.find(L=>(!L.groupId||L.groupId===d.control?.groupId)&&(L.id&&d.controlId===L.id||L.conceptId&&d.control.conceptId===L.conceptId||L.areaId&&d.areaId===L.areaId));if(!R)continue;const{value:u,isSubmitHistory:h=!0}=R;e=!0,h&&(n=!0);const{type:g}=d.control,{range:f,fullRange:T}=this.mergeControl({elementList:s,range:{startIndex:c,endIndex:c},tdId:a}),p={range:T??f,elementList:s,tdId:a},m={isIgnoreDisabledRule:!0,isIgnoreDeletedRule:!0};if(g===l.ControlType.TEXTFIELD){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&Vt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new Rr(d,this);this.activeControl=P,L.length?P.setValue(L,p,m):P.clearValue(p,m)}else if(g===l.ControlType.TEXT){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&Vt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new Ci(d,this);this.activeControl=P,L.length?P.setValue(L,p,m):P.clearValue(p,m)}else if(g===l.ControlType.SELECT){if(Array.isArray(u))continue;const L=new In(d,this);this.activeControl=L,u?L.setSelect(u,p,m):L.clearSelect(p,m)}else if(g===l.ControlType.CHECKBOX){if(Array.isArray(u))continue;const L=new Hn(d,this);this.activeControl=L;const P=u?u.split(","):[];L.setSelect(P,p,m)}else if(g===l.ControlType.RADIO){if(Array.isArray(u))continue;const L=new vo(d,this);this.activeControl=L;const P=u?[u]:[];L.setSelect(P,p,m)}else if(g===l.ControlType.DATE){const L=new bn(d,this);this.activeControl=L,Po(u)?(u.length&&Vt(u,{isHandleFirstElement:!1,editorOptions:this.options}),L.setValue(u,p,m)):Gr(u)?L.setSelect(u,p,m):L.clearSelect(p,m)}else if(g===l.ControlType.NUMBER){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&Vt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new Vn(d,this);this.activeControl=P,L.length?P.setValue(L,p,m):P.clearValue(p,m)}else if(g===l.ControlType.BUTTON){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&Vt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new ke(d,this);this.activeControl=P,L.length?P.setValue(L,p,m):P.clearSelect(p,m)}this.emitControlContentChange({context:p}),this.activeControl=null;let I=c;for(;I<s.length&&s[I].controlId===d.controlId;)I++;c=I}};this.destroyControl({isEmitEvent:!1});const r=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const s of r)i(s);e&&(n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1}))}setExtensionListById(t){if(!t.length)return;const e=i=>{let r=0;for(;r<i.length;){const s=i[r];if(r++,s.type===l.ElementType.TABLE){const R=s.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];e(f.value)}}}if(!s.control)continue;const a=t.find(R=>R.id&&s.controlId===R.id||R.conceptId&&s.control.conceptId===R.conceptId||R.areaId&&s.areaId===R.areaId);if(!a)continue;const{extension:c}=a;this.setControlProperties({extension:c},{elementList:i,range:{startIndex:r,endIndex:r}});let d=r;for(;d<i.length&&i[d].controlId===s.controlId;)d++;r=d}},n=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const i of n)e(i)}setPropertiesListById(t){if(!t.length)return;let e=!1,n=!1;const i=s=>{let a=0;for(;a<s.length;){const c=s[a];if(a++,c.type===l.ElementType.TABLE){const g=c.trList;for(let f=0;f<g.length;f++){const T=g[f];for(let p=0;p<T.tdList.length;p++){const m=T.tdList[p];i(m.value)}}}if(!c.control)continue;const d=t.find(g=>g.id&&c.controlId===g.id||g.conceptId&&c.control.conceptId===g.conceptId||g.areaId&&c.areaId===g.areaId);if(!d)continue;const{properties:R,isSubmitHistory:u=!0}=d;if(e=!0,u&&(n=!0),this.setControlProperties({...c.control,...R,value:c.control.value},{elementList:s,range:{startIndex:a-1,endIndex:a-1}}),Gt.forEach(g=>{const f=R[g];f&&Reflect.set(c,g,f)}),c.control?.type===l.ControlType.NUMBER&&R.numberExclusiveOptions){const g={...c.control.numberExclusiveOptions,...R.numberExclusiveOptions},f=g?.minValue,T=g?.maxValue,p=new Vn(c,this),m=p.getValue({elementList:s,range:{startIndex:a-1,endIndex:a-1}});if(m.length>0){const I=m.map(P=>P.value).join(""),L=Number(I);!Number.isNaN(L)&&Number.isFinite(L)&&(f!=null&&L<f||T!=null&&L>T)&&p.clearValue({elementList:s,range:{startIndex:a-1,endIndex:a-1}},{isAddPlaceholder:!0})}}let h=a;for(;h<s.length&&s[h].controlId===c.controlId;)h++;a=h}},r={header:this.draw.getHeaderElementList(),main:this.draw.getOriginalMainElementList(),footer:this.draw.getFooterElementList()};for(const s in r){const a=r[s];i(a)}if(e){for(const s in r){const a=s,c=Pt(r[a],{isClassifyArea:!0,extraPickAttrs:["id","controlId"]});r[a]=c,Vt(c,{editorOptions:this.options,isForceCompensation:!0})}this.draw.setEditorData(r),n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1})}}getList(){const t=[];function e(i){for(let r=0;r<i.length;r++){const s=i[r];if(s.type===l.ElementType.TABLE){const a=s.trList;for(let c=0;c<a.length;c++){const d=a[c];for(let R=0;R<d.tdList.length;R++){const h=d.tdList[R].value;e(h)}}}if(s.controlId){const a=ie(s,[...Eo,...mn]);t.push(a)}}}const n=[this.draw.getHeader().getElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooter().getElementList()];for(const i of n)e(i);return Pt(t,{extraPickAttrs:["controlId"]})}recordBorderInfo(t,e,n,i){this.controlBorder.recordBorderInfo(t,e,n,i)}drawBorder(t){this.controlBorder.render(t)}startTextFieldUnderline(t,e,n){this.textFieldUnderline.startTextFieldValue(t,e,n)}recordTextFieldUnderlineWidth(t){this.textFieldUnderline.recordValueWidth(t)}drawTextFieldUnderline(t){this.textFieldUnderline.endTextFieldValue(t)}getPreControlContext(){if(!this.activeControl)return null;const e=this.draw.getPosition().getPositionContext();if(!e)return null;const n=this.activeControl.getElement();function i(c,d){for(let R=d;R>0;R--){const u=c[R];if(u.type===l.ElementType.TABLE){const g=u.trList||[];for(let f=g.length-1;f>=0;f--){const T=g[f],p=T.tdList;for(let m=p.length-1;m>=0;m--){const I=p[m],L=i(I.value,I.value.length-1);if(L)return{positionContext:{isTable:!0,index:R,trIndex:f,tdIndex:m,tdId:I.id,trId:T.id,tableId:u.id},nextIndex:L.nextIndex}}}}if(!u.controlId||u.controlId===n.controlId)continue;let h=R;for(;h>0;){const g=c[h];if(g.controlComponent===l.ControlComponent.VALUE||g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT||g.controlComponent===l.ControlComponent.PRETEXTFIX||g.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)break;h--}return{positionContext:{isTable:!1},nextIndex:h}}return null}const{startIndex:r}=this.range.getRange(),s=this.getElementList(),a=i(s,r);if(a)return{positionContext:e.isTable?e:a.positionContext,nextIndex:a.nextIndex};if(n.tableId){const c=this.draw.getOriginalElementList(),{index:d,trIndex:R,tdIndex:u}=e,h=c[d].trList;for(let f=R;f>=0;f--){const T=h[f],p=T.tdList;for(let m=p.length-1;m>=0;m--){if(R===f&&m>=u)continue;const I=p[m],L=i(I.value,I.value.length-1);if(L)return{positionContext:{isTable:!0,index:e.index,trIndex:f,tdIndex:m,tdId:I.id,trId:T.id,tableId:n.tableId},nextIndex:L.nextIndex}}}const g=i(c,d-1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}getNextControlContext(){if(!this.activeControl)return null;const e=this.draw.getPosition().getPositionContext();if(!e)return null;const n=this.activeControl.getElement();function i(c,d){for(let R=d;R<c.length;R++){const u=c[R];if(u.type===l.ElementType.TABLE){const h=u.trList||[];for(let g=0;g<h.length;g++){const f=h[g],T=f.tdList;for(let p=0;p<T.length;p++){const m=T[p],I=i(m.value,0);if(I)return{positionContext:{isTable:!0,index:R,trIndex:g,tdIndex:p,tdId:m.id,trId:f.id,tableId:u.id},nextIndex:I.nextIndex}}}}if(!(!u.controlId||u.controlId===n.controlId||c[R+1]?.controlComponent===l.ControlComponent.PREFIX||c[R+1]?.controlComponent===l.ControlComponent.PRE_TEXT||c[R+1]?.controlComponent===l.ControlComponent.PRETEXTFIX||c[R+1]?.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT))return{positionContext:{isTable:!1},nextIndex:R}}return null}const{endIndex:r}=this.range.getRange(),s=this.getElementList(),a=i(s,r);if(a)return{positionContext:e.isTable?e:a.positionContext,nextIndex:a.nextIndex};if(n.tableId){const c=this.draw.getOriginalElementList(),{index:d,trIndex:R,tdIndex:u}=e,h=c[d].trList;for(let f=R;f<h.length;f++){const T=h[f],p=T.tdList;for(let m=0;m<p.length;m++){if(R===f&&m<=u)continue;const I=p[m],L=i(I.value,0);if(L)return{positionContext:{isTable:!0,index:e.index,trIndex:f,tdIndex:m,tdId:I.id,trId:T.id,tableId:n.tableId},nextIndex:L.nextIndex}}}const g=i(c,d+1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}initNextControl(t={}){const{direction:e=Zt.DOWN}=t;let n=null;if(e===Zt.UP?n=this.getPreControlContext():n=this.getNextControlContext(),!n)return;const{nextIndex:i,positionContext:r}=n,s=this.draw.getPosition();s.setPositionContext(r),this.draw.getRange().replaceRange({startIndex:i,endIndex:i}),this.draw.render({curIndex:i,isCompute:!1,isSetCursor:!0,isSubmitHistory:!1});const a=s.getPositionList();this.draw.getCursor().moveCursorToVisible({cursorPosition:a[i],direction:e})}setMinWidthControlInfo(t){const{row:e,rowElement:n,controlRealWidth:i,availableWidth:r}=t;if(!n.control?.minWidth)return;const{scale:s}=this.options,a=n.control.minWidth*s;let c=null;if(n.control?.minWidth&&(n.control?.rowFlex===l.RowFlex.CENTER||n.control?.rowFlex===l.RowFlex.RIGHT)){let R=n.metrics.width,u=e.elementList.length-1;for(;u>=0;){const h=e.elementList[u];if(R+=h.metrics.width,e.elementList[u-1]?.controlComponent===l.ControlComponent.PREFIX){c=h;break}u--}c&&R<a&&(n.control.rowFlex===l.RowFlex.CENTER?c.left=(a-R)/2:n.control.rowFlex===l.RowFlex.RIGHT&&(c.left=a-R-n.metrics.width))}const d=a-i;if(d>0){const R=c?.left||0,u=r-e.width-n.metrics.width,h=Math.min(u,d);n.left=h-R,e.width+=h-R}}mergeControl(t={}){const e=t.elementList||this.getElementList(),n=t.range||this.getRange(),{startIndex:i}=n,r=t.tdId??this.draw.getPosition().getPositionContext().tdId,s=r?this.draw.getTdById(r):void 0,a=e[i];if(!a?.controlId)return{range:n,elementList:[],tdId:r};const c={startIndex:i,endIndex:i},d=[];let R=!1,u=i,h=s,g=e;for(;u>=0;){const m=g[u];if(m.controlId!==a.controlId)break;if(m.type!==l.ElementType.SPLIT_TAG&&(d.unshift(m),R&&(g.splice(u,1),e[0].type===l.ElementType.SPLIT_TAG?e.splice(0,1):(n.startIndex++,n.endIndex++),e.unshift(m)),c.startIndex=u),u===0&&m.controlComponent!==l.ControlComponent.PREFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){g=h.value,u=h.value.length-1,R=!0;continue}if(u===0&&m.controlComponent!==l.ControlComponent.PRETEXTFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){g=h.value,u=h.value.length-1,R=!0;continue}u--}R=!1;let f=i+1,T=s,p=e;for(;f<p.length;){const m=p[f];if(m.controlId!==a.controlId)break;if(m.type!==l.ElementType.SPLIT_TAG&&(d.push(m),R&&(p.splice(f,1),e.push(m),f--)),f===p.length-1&&m.controlComponent!==l.ControlComponent.POSTFIX&&T?.linkTdNextId&&(T=this.draw.getTdById(T.linkTdNextId),T)){p=T.value,f=0,R=!0;continue}if(f===p.length-1&&m.controlComponent!==l.ControlComponent.POSTTEXTFIX&&T?.linkTdNextId&&(T=this.draw.getTdById(T.linkTdNextId),T)){p=T.value,f=0,R=!0;continue}f++}return c.endIndex=c.startIndex+d.length,{range:n,elementList:e,tdId:r,fullRange:{startIndex:c.startIndex,endIndex:c.endIndex-2}}}}class ph{options;currentTextFieldId=null;valueStartX=0;valueWidth=0;valueY=0;constructor(t){this.options=t.getOptions()}startTextFieldValue(t,e,n){this.currentTextFieldId=t,this.valueStartX=e,this.valueY=n,this.valueWidth=0}recordValueWidth(t){this.valueWidth+=t}endTextFieldValue(t){if(!this.currentTextFieldId||this.valueWidth<=0){this.reset();return}const{scale:e}=this.options;t.save(),t.strokeStyle=this.options.defaultColor,t.lineWidth=e,t.beginPath();const n=this.valueY-.5*e;t.moveTo(this.valueStartX,n),t.lineTo(this.valueStartX+this.valueWidth,n),t.stroke(),t.restore(),this.reset()}reset(){this.currentTextFieldId=null,this.valueStartX=0,this.valueWidth=0,this.valueY=0}}class Lh{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}setSelect(t){const{checkbox:e}=t;e?e.value=!e.value:t.checkbox={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(t){const{ctx:e,x:n,index:i,row:r}=t;let{y:s}=t;const{checkbox:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:R,verticalAlign:u},scale:h}=this.options,{metrics:g,checkbox:f}=r.elementList[i];if(u===l.VerticalAlign.TOP||u===l.VerticalAlign.MIDDLE){let L=i+1,P=null;for(;L<r.elementList.length&&(P=r.elementList[L],!(P.value!==_&&P.value!==fo));)L++;if(P){const{metrics:{boundingBoxAscent:O,boundingBoxDescent:S}}=P,F=O+S;F>g.height&&(u===l.VerticalAlign.TOP?s-=O-g.height:u===l.VerticalAlign.MIDDLE&&(s-=(F-g.height)/2))}}const T=Math.round(n+a*h),p=Math.round(s-g.height+c),m=g.width-a*2*h,I=g.height;e.save(),e.beginPath(),e.translate(.5,.5),f?.value?(e.lineWidth=c,e.strokeStyle=d,e.rect(T,p,m,I),e.stroke(),e.beginPath(),e.fillStyle=d,e.fillRect(T,p,m,I),e.beginPath(),e.strokeStyle=R,e.lineWidth=c*2*h,e.moveTo(T+2*h,p+I/2),e.lineTo(T+m/2,p+I-3*h),e.lineTo(T+m-2*h,p+3*h),e.stroke()):(e.lineWidth=c,e.rect(T,p,m,I),e.stroke()),e.closePath(),e.restore()}}class Ih{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}setSelect(t){const{radio:e}=t;e?e.value=!e.value:t.radio={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(t){const{ctx:e,x:n,index:i,row:r}=t;let{y:s}=t;const{radio:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:R,verticalAlign:u},scale:h}=this.options,{metrics:g,radio:f}=r.elementList[i];if(u===l.VerticalAlign.TOP||u===l.VerticalAlign.MIDDLE){let L=i+1,P=null;for(;L<r.elementList.length&&(P=r.elementList[L],!(P.value!==_&&P.value!==fo));)L++;if(P){const{metrics:{boundingBoxAscent:O,boundingBoxDescent:S}}=P,F=O+S;F>g.height&&(u===l.VerticalAlign.TOP?s-=O-g.height:u===l.VerticalAlign.MIDDLE&&(s-=(F-g.height)/2))}}const T=Math.round(n+a*h),p=Math.round(s-g.height+c),m=g.width-a*2*h,I=g.height;e.save(),e.beginPath(),e.translate(.5,.5),e.strokeStyle=f?.value?d:R,e.lineWidth=c,e.arc(T+m/2,p+I/2,m/2,0,Math.PI*2),e.stroke(),f?.value&&(e.beginPath(),e.fillStyle=d,e.arc(T+m/2,p+I/2,m/3,0,Math.PI*2),e.fill()),e.closePath(),e.restore()}}const ho={fontSize:11,smallFontSize:9,lineHeight:12,dividerWidth:40,gap:4,totalHeight:36};class Ph{draw;options;inputModal=null;isPopup=!1;constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=ho,n=this.options.scale,i=e.fontSize*n,r=e.smallFontSize*n,s=e.gap*n,a=e.dividerWidth*n,d=document.createElement("canvas").getContext("2d"),R=t.menstrualData;d.font=`${i}px "Microsoft YaHei", sans-serif`;let u=a;d.font=`${r}px "Microsoft YaHei", sans-serif`;let h=0;if(R){const f=this.getValue(R.menarcheAge);d.font=`${i}px "Microsoft YaHei", sans-serif`,f&&(u+=d.measureText(`${f}岁`).width+s);let T="";if(R.isMenopause){const P=this.getValue(R.menopauseAge);P&&(T=`${P}岁`)}else{const P=this.getValue(R.lastPeriod);P&&(T=P)}T&&(u+=d.measureText(T).width+s),d.font=`${r}px "Microsoft YaHei", sans-serif`;const p=this.getValue(R.periodMin),m=this.getValue(R.periodMax);if(p||m){const P=`${p||""}~${m||""}`;h=Math.max(h,d.measureText(P).width)}const I=this.getValue(R.cycleMin),L=this.getValue(R.cycleMax);if(I||L){const P=`${I||""}~${L||""}`;h=Math.max(h,d.measureText(P).width)}}else d.font=`${i}px "Microsoft YaHei", sans-serif`,h=d.measureText("~").width;return{width:Math.max(u,h),height:e.totalHeight*n}}getValue(t){return!t||t===""||t==="_"||t==="____-__-__"?"":t}render(t){const{ctx:e,x:n,y:i,element:r}=t,s=r.menstrualData,a=this.options.scale;e.save(),e.font=`${ho.fontSize*a}px "Microsoft YaHei", sans-serif`,e.fillStyle=this.options.defaultColor,e.textBaseline="bottom",s?this.renderWithData(e,n,i,s,a):this.renderEmpty(e,n,i,a),e.restore()}renderEmpty(t,e,n,i){const r=ho,s=r.fontSize*i,a=r.lineHeight*i,c=r.dividerWidth*i,d=n-a*1.5,R=e+c/2;t.font=`${s}px "Microsoft YaHei", sans-serif`;const u=t.measureText("~").width,h=R-u/2;t.fillText("~",h,d+a);const g=d+a*2;this.drawDivider(t,e,g-s/2,c,i),t.fillText("~",h,g+a)}renderWithData(t,e,n,i,r){const s=ho,a=s.fontSize*r,c=s.smallFontSize*r,d=s.lineHeight*r,R=s.gap*r,u=s.dividerWidth*r,h=n-d*2,g=h+d*2;t.font=`${a}px "Microsoft YaHei", sans-serif`;const f=this.getValue(i.menarcheAge);let T=e;if(f){const C=`${f}岁`;t.fillText(C,e,g),T=e+t.measureText(C).width+R}const p=T+u/2,m=h+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const I=this.getValue(i.periodMin),L=this.getValue(i.periodMax);let P="";I||L?P=`${I||""}~${L||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,P="~");const O=t.measureText(P).width,S=p-O/2;t.fillText(P,S,m),this.drawDivider(t,T,g-a/2,u,r),t.font=`${a}px "Microsoft YaHei", sans-serif`;let F="";if(i.isMenopause){const C=this.getValue(i.menopauseAge);C&&(F=`${C}岁`)}else{const C=this.getValue(i.lastPeriod);C&&(F=C)}F&&t.fillText(F,T+u+R,g);const N=g+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const V=this.getValue(i.cycleMin),Y=this.getValue(i.cycleMax);let X="";V||Y?X=`${V||""}~${Y||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,X="~");const b=t.measureText(X).width,E=p-b/2;t.fillText(X,E,N)}drawDivider(t,e,n,i,r){t.save(),t.beginPath(),t.strokeStyle=this.options.defaultColor,t.lineWidth=.5*r,t.moveTo(e,n),t.lineTo(e+i,n),t.stroke(),t.restore()}clearMenstrualHistoryEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderMenstrualHistoryEditor(t,e){if(this.options.mode===l.EditorMode.PRINT)return;(this.isPopup||this.inputModal)&&this.clearMenstrualHistoryEditor(),this.isPopup=!0;const n=t.menstrualData;this.inputModal=document.createElement("div"),this.inputModal.className="menstrual-history-edit-modal",this.inputModal.setAttribute("editor-component","menstrual-history-edit-modal"),this.inputModal.innerHTML=`
184
+ `,document.body.appendChild(this.inputModal);const e=this.inputModal.querySelector(".menstrual-history-modal__mask"),n=this.inputModal.querySelector(".menstrual-history-modal__container"),i=this.inputModal.querySelector(".menstrual-history-modal__close"),r=this.inputModal.querySelector(".btn-cancel"),s=this.inputModal.querySelector(".btn-confirm"),a=this.inputModal.querySelector("#mh-edit-notMenopause"),c=this.inputModal.querySelector("#mh-edit-isMenopauseForm"),d=this.inputModal.querySelectorAll('input[name="mh-edit-isMenopause"]'),R=()=>{this.closeModal()};n.addEventListener("click",u=>{u.stopPropagation()}),e.addEventListener("click",R),i.addEventListener("click",R),r.addEventListener("click",R),d.forEach(u=>{u.addEventListener("change",()=>{const h=u.value==="true";a.style.display=h?"none":"block",c.style.display=h?"block":"none"})}),s.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation();const h=this.inputModal;if(!h)return;const g=h.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let f;g?f={isMenopause:!0,periodMin:h.querySelector("#mh-edit-periodMin2")?.value||"_",periodMax:h.querySelector("#mh-edit-periodMax2")?.value||"_",menarcheAge:h.querySelector("#mh-edit-menarcheAge2")?.value||"_",menopauseAge:h.querySelector("#mh-edit-menopauseAge")?.value||"_",cycleMin:h.querySelector("#mh-edit-cycleMin2")?.value||"_",cycleMax:h.querySelector("#mh-edit-cycleMax2")?.value||"_"}:f={isMenopause:!1,periodMin:h.querySelector("#mh-edit-periodMin")?.value||"_",periodMax:h.querySelector("#mh-edit-periodMax")?.value||"_",menarcheAge:h.querySelector("#mh-edit-menarcheAge1")?.value||"_",lastPeriod:h.querySelector("#mh-edit-lastPeriod")?.value||"____-__-__",cycleMin:h.querySelector("#mh-edit-cycleMin")?.value||"_",cycleMax:h.querySelector("#mh-edit-cycleMax")?.value||"_"};const T=this.control.getElementList(),m=this.element.controlId;for(let P=0;P<T.length;P++){const O=T[P];O.controlId===m&&O.control&&(O.control.menstrualData=f)}const p=this.generateDisplayText(f),I=this.textToElements(p);this.closeModal();const L=this.setValue(I);L!==-1&&(this.control.repaintControl({curIndex:L}),this.control.emitControlContentChange({}))})}closeModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}destroy(){this.closeModal()}}class Ih{controlBorder;textFieldUnderline;draw;range;listener;eventBus;controlSearch;options;controlOptions;activeControl;activeControlValue;preElement;constructor(t){this.controlBorder=new Tc(t),this.textFieldUnderline=new Ph(t),this.draw=t,this.range=t.getRange(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.controlSearch=new fc(this),this.options=t.getOptions(),this.controlOptions=this.options.control,this.activeControl=null,this.activeControlValue=[],this.preElement=null}setHighlightList(t){this.controlSearch.setHighlightList(t)}computeHighlightList(){this.controlSearch.getHighlightList().length&&this.controlSearch.computeHighlightList()}renderHighlightList(t,e){this.controlSearch.getHighlightMatchResult().length&&this.controlSearch.renderHighlightList(t,e)}getDraw(){return this.draw}filterAssistElement(t){return t.filter((e,n)=>{if(e.type===l.ElementType.TABLE){const i=e.trList;for(let r=0;r<i.length;r++){const s=i[r];for(let a=0;a<s.tdList.length;a++){const c=s.tdList[a];c.value=this.filterAssistElement(c.value)}}}if(!e.controlId)return!0;if(e.control?.type===l.ControlType.MENSTRUAL_HISTORY&&this.options.mode===l.EditorMode.PRINT&&(e.controlComponent===l.ControlComponent.PREFIX||e.controlComponent===l.ControlComponent.POSTFIX)||e.control?.type===l.ControlType.SELECT&&this.options.mode===l.EditorMode.PRINT&&(e.controlComponent===l.ControlComponent.PREFIX||e.controlComponent===l.ControlComponent.POSTFIX)||e.control?.type===l.ControlType.NUMBER&&this.options.mode===l.EditorMode.PRINT&&(e.controlComponent===l.ControlComponent.PREFIX||e.controlComponent===l.ControlComponent.POSTFIX)||e.control?.type===l.ControlType.TEXT&&this.options.mode===l.EditorMode.PRINT&&e.strikeout&&e.deletePerson)return!1;if(e.control?.minWidth){if(e.controlComponent===l.ControlComponent.PREFIX||e.controlComponent===l.ControlComponent.POSTFIX)return e.value="",!0}else{const i=this.options.mode===l.EditorMode.FORM;if(e.control?.preText&&e.controlComponent===l.ControlComponent.PRE_TEXT){if(i)return!0;let r=!1,s=n+1;for(;s<t.length;){const a=t[s];if(e.controlId!==a.controlId)break;if(a.controlComponent===l.ControlComponent.VALUE){r=!0;break}s++}return r}if(e.control?.postText&&e.controlComponent===l.ControlComponent.POST_TEXT){if(i)return!0;let r=!1,s=n-1;for(;s<t.length;){const a=t[s];if(e.controlId!==a.controlId)break;if(a.controlComponent===l.ControlComponent.VALUE){r=!0;break}s--}return r}}if(e.control?.preTextFix&&e.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT){let i=!1,r=n+1;for(;r<t.length;){const s=t[r];if(e.controlId!==s.controlId)break;if(s.controlComponent===l.ControlComponent.VALUE){i=!0;break}r++}return i}if(e.control?.postTextFix&&e.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT){let i=!1,r=n-1;for(;r<t.length;){const s=t[r];if(e.controlId!==s.controlId)break;if(s.controlComponent===l.ControlComponent.VALUE){i=!0;break}r--}return i}return e.controlComponent!==l.ControlComponent.PREFIX&&e.controlComponent!==l.ControlComponent.POSTFIX&&e.controlComponent!==l.ControlComponent.PLACEHOLDER&&e.controlComponent!==l.ControlComponent.PRETEXTFIX&&e.controlComponent!==l.ControlComponent.POSTTEXTFIX&&e.controlComponent!==l.ControlComponent.TEXTFIXLABEL})}getIsRangeCanCaptureEvent(){if(!this.activeControl)return!1;const{startIndex:t,endIndex:e}=this.getRange();if(!~t&&!~e)return!1;const n=this.getElementList(),i=n[t];if(i.controlComponent===l.ControlComponent.PLACEHOLDER)return!1;if(t===e&&t>0){const s=n[t-1],a=s?.controlComponent===l.ControlComponent.POSTFIX||s?.controlComponent===l.ControlComponent.POSTTEXTFIX,c=s?.controlComponent===l.ControlComponent.PLACEHOLDER,d=!!s?.controlId,R=!!s?.originControlId;let u=!1;if(R){const p=s.originControlId;for(let I=t;I<n.length;I++){const L=n[I];if(L.controlId===p&&!L.originControlId){u=!0;break}if(L.controlId&&L.controlId!==p&&L.originControlId!==p)break}}const g=this.draw.getPosition().getPositionList(),f=g[t],T=g[t-1],m=f&&T&&f.rowIndex===T.rowIndex;if((a||c)&&d&&m&&!u)return!1}if(t===e&&(i.controlComponent===l.ControlComponent.POSTFIX||i.controlComponent===l.ControlComponent.POSTTEXTFIX))return!0;const r=n[e];return!!(i.controlId&&i.controlId===r.controlId&&r.controlComponent!==l.ControlComponent.POSTFIX&&r.controlComponent!==l.ControlComponent.POSTTEXTFIX)}getIsRangeInPostfix(){if(!this.activeControl)return!1;const{startIndex:t,endIndex:e}=this.getRange();if(t!==e)return!1;const i=this.getElementList()[t];return i.controlComponent===l.ControlComponent.POSTFIX||i.controlComponent===l.ControlComponent.POSTTEXTFIX}getIsRangeWithinControl(){const{range:{startIndex:t,endIndex:e},elementList:n}=this.range.getRangeElement();if(!~t&&!~e)return!1;const i=n[t],r=n[e];if(i?.controlId&&i.controlId===r.controlId&&r.controlComponent!==l.ControlComponent.POSTFIX&&r.controlComponent!==l.ControlComponent.POSTTEXTFIX&&r.controlComponent!==l.ControlComponent.POSTTEXTFIX_TEXT&&r.controlComponent!==l.ControlComponent.POST_TEXT)return!0;if(r?.originControlId&&(r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX)){const s=r.originControlId;for(let a=e+1;a<n.length;a++){const c=n[a];if(c.controlId===s)return!0;if(c.controlId&&c.controlId!==s&&c.originControlId!==s)break}}if(!r?.originControlId&&r?.controlId&&(r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX)){const s=n[e+1];if(s?.controlId&&s.controlId!==r.controlId&&(s.controlComponent===l.ControlComponent.PREFIX||s.controlComponent===l.ControlComponent.PRETEXTFIX))return!0;if(s?.controlId&&s.controlId!==r.controlId&&(s.controlComponent===l.ControlComponent.POSTFIX||s.controlComponent===l.ControlComponent.POSTTEXTFIX))return s.originControlId,!0;for(let a=e;a>=0;a--){const c=n[a];if(c.controlId===r.controlId&&(c.controlComponent===l.ControlComponent.PREFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let d=a-1;d>=0;d--){const R=n[d];if(R.controlId&&R.controlId!==r.controlId&&(R.controlComponent===l.ControlComponent.PRETEXTFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT))return!0;if(R.controlId&&R.controlId!==r.controlId&&(R.controlComponent===l.ControlComponent.POSTFIX||R.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}}if(r?.originControlId){const s=r.originControlId;for(let a=e+1;a<n.length;a++){const c=n[a];if(c.controlId===s)return!0;if(c.controlId&&c.controlId!==s&&c.originControlId!==s)break}}if(!i?.controlId&&this.activeControl){const a=this.activeControl.getElement()?.controlId;if(a)for(let c=t;c>=0;c--){const d=n[c];if(d.controlId===a&&!d.originControlId){if(d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT)for(let R=e;R<n.length;R++){const u=n[R];if(u.controlId===a&&!u.originControlId){if(u.controlComponent===l.ControlComponent.POSTTEXTFIX||u.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||u.controlComponent===l.ControlComponent.POSTFIX||u.controlComponent===l.ControlComponent.POST_TEXT)return!0;break}}break}}}return!1}getIsElementListContainFullControl(t){if(!t.some(i=>i.controlId))return!1;let e=0,n=0;for(let i=0;i<t.length;i++){const r=t[i];r.controlComponent===l.ControlComponent.PREFIX||r.controlComponent===l.ControlComponent.PRETEXTFIX?e++:(r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX)&&n++}return!e||!n?!1:e===n}getIsDisabledControl(t={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:e,endIndex:n}=t.range||this.range.getRange();if(e===n&&~e&&~n){const r=(t.elementList||this.getElementList())[e];if(r.controlComponent===l.ControlComponent.POSTFIX||r.controlComponent===l.ControlComponent.POSTTEXTFIX)return!1}return!!this.activeControl.getElement()?.control?.disabled}getIsDisabledPasteControl(t={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:e,endIndex:n}=t.range||this.range.getRange();return e===n&&~e&&~n&&(t.elementList||this.getElementList())[e].controlComponent===l.ControlComponent.POSTFIX?!1:!!this.activeControl.getElement()?.control?.pasteDisabled}getIsExistValueByElementListIndex(t,e){const n=t[e];if(!n.controlId)return!1;if(n.control?.type===l.ControlType.CHECKBOX||n.control?.type===l.ControlType.RADIO)return!!n.control?.code;if(n.controlComponent===l.ControlComponent.VALUE)return!0;if(n.controlComponent===l.ControlComponent.PLACEHOLDER)return!1;if(n.controlComponent===l.ControlComponent.PREFIX||n.controlComponent===l.ControlComponent.PRE_TEXT){let i=e+1;for(;i<t.length;){const r=t[i];if(r.controlId!==n.controlId)return!1;if(r.controlComponent===l.ControlComponent.VALUE)return!0;if(r.controlComponent===l.ControlComponent.PLACEHOLDER)return!1;i++}}if(n.controlComponent===l.ControlComponent.PRETEXTFIX||n.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){let i=e+1;for(;i<t.length;){const r=t[i];if(r.controlId!==n.controlId)return!1;if(r.controlComponent===l.ControlComponent.VALUE)return!0;if(r.controlComponent===l.ControlComponent.PLACEHOLDER||r.controlComponent===l.ControlComponent.TEXTFIXLABEL)return!1;i++}}if(n.controlComponent===l.ControlComponent.POSTFIX||n.controlComponent===l.ControlComponent.POSTTEXTFIX){let i=e-1;for(;i>=0;){const r=t[i];if(r.controlId!==n.controlId)return!1;if(r.controlComponent===l.ControlComponent.VALUE)return!0;if(r.controlComponent===l.ControlComponent.PLACEHOLDER)return!1;i--}}return!1}getControlHighlight(t,e){return this.controlSearch.getControlHighlight(t,e)}getContainer(){return this.draw.getContainer()}getElementList(){return this.draw.getElementList()}getPosition(){const t=this.draw.getPosition().getPositionList(),{endIndex:e}=this.range.getRange();return t[e]||null}getPreY(){const t=this.draw.getHeight(),e=this.draw.getPageGap();return(this.getPosition()?.pageNo??this.draw.getPageNo())*(t+e)}getRange(){return this.range.getRange()}getValueRange(t={}){const e=t.elementList||this.getElementList(),{startIndex:n}=t.range||this.getRange(),i=e[n];let r=n;for(;r>0;){const a=e[r];if(a.controlId!==i.controlId||a.controlComponent===l.ControlComponent.PREFIX||a.controlComponent===l.ControlComponent.PRE_TEXT||a.controlComponent===l.ControlComponent.PRETEXTFIX||a.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)break;r--}let s=n+1;for(;s<e.length;){const a=e[s];if(a.controlId!==i.controlId||a.controlComponent===l.ControlComponent.POSTFIX||a.controlComponent===l.ControlComponent.POST_TEXT||a.controlComponent===l.ControlComponent.POSTTEXTFIX||a.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)break;s++}return r===s?null:{startIndex:r,endIndex:s-1}}shrinkBoundary(t={}){this.range.shrinkBoundary(t)}getActiveControl(){return this.activeControl}getActiveTextControlLimit(){if(!this.activeControl)return null;const t=this.activeControl.getElement(),e=t?.controlId,n=t?.originControlId||null;if(!e||t.control?.type!==l.ControlType.TEXT)return null;const i=this.getElementList(),r=n||null;let s=-1,a=-1,c=-1,d=-1;for(let h=0;h<i.length;h++){const g=i[h];g.controlId!==e||(n?g.originControlId!==n:g.originControlId)||(s===-1&&(s=h),a=h,(g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT||g.controlComponent===l.ControlComponent.PRETEXTFIX||g.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)&&(c=h),d===-1&&(g.controlComponent===l.ControlComponent.POSTFIX||g.controlComponent===l.ControlComponent.POST_TEXT||g.controlComponent===l.ControlComponent.POSTTEXTFIX||g.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)&&(d=h))}if(s===-1)return null;const R=c!==-1?c:s,u=d!==-1?d-1:a;return{controlId:e,originControlId:n,parentControlId:r,startIndex:R,endIndex:u<R?R:u}}getActiveNestedTextLimit(){const t=this.getActiveTextControlLimit();return!t?.parentControlId||!this.getElementList().some(n=>n.controlId===t.parentControlId&&!n.originControlId&&n.control?.type===l.ControlType.TEXTFIELD)?null:{controlId:t.controlId,parentControlId:t.parentControlId,startIndex:t.startIndex,endIndex:t.endIndex}}getControlElementList(t={}){const e=t.elementList||this.getElementList(),{startIndex:n}=t.range||this.getRange(),i=e[n];if(!i?.controlId)return[];const r=[];let s=n;for(;s>0;){const c=e[s];if(c.controlId!==i.controlId)break;r.unshift(c),s--}let a=n+1;for(;a<e.length;){const c=e[a];if(c.controlId!==i.controlId)break;r.push(c),a++}return r}updateActiveControlValue(){this.activeControl&&(this.activeControlValue=this.getControlElementList())}emitControlChange(t){if(!this.activeControl)return;const e=this.eventBus.isSubscribe("controlChange");if(!this.listener.controlChange&&!e)return;let n;const i=this.activeControlValue,r=this.activeControl.getElement();i?.length?n=i[0].control:(n=Ue(at(r)).control,n.value=[]);const s={state:t,control:n,controlId:r.controlId};this.listener.controlChange?.(s),e&&this.eventBus.emit("controlChange",s)}initControl(){const t=this.getElementList(),e=this.getRange(),n=t[e.startIndex];if(this.activeControl){if(this.activeControl instanceof On||this.activeControl instanceof Dn||this.activeControl instanceof Un||this.activeControl instanceof $e){const R=this.activeControl.getElement();n?.controlId!==R?.controlId?this.destroyControl():n.controlComponent===l.ControlComponent.POSTFIX?this.activeControl.destroy():this.activeControl.awake()}if(this.activeControl){const R=this.activeControl.getElement(),u=n.controlId,h=R.controlId;if(u&&u===h){this.updateActiveControlValue(),this.preElement=n;return}if(n.originControlId&&n.originControlId===h&&!(this.activeControl.getElement()?.control?.type===l.ControlType.TEXTFIELD&&n.controlId!==h)){this.updateActiveControlValue(),this.preElement=n;return}if(n.originControlId&&n.controlId&&n.controlId,!n.originControlId&&n.controlId&&n.controlId!==h&&(this.activeControl.getElement()?.originControlId,n.controlId),n.controlId&&n.controlId===h&&n.originControlId){this.updateActiveControlValue(),this.preElement=n;return}if(!u){const g=this.getElementList(),f=this.getRange(),{startIndex:T}=f;let m=null;for(let p=T;p>=0;p--){const I=g[p];if(I.controlComponent===l.ControlComponent.PRETEXTFIX||I.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||I.controlComponent===l.ControlComponent.PREFIX||I.controlComponent===l.ControlComponent.PRE_TEXT){m=I.controlId||null;break}if(I.controlId&&I.controlId!==h||I.controlComponent===l.ControlComponent.POSTTEXTFIX||I.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||I.controlComponent===l.ControlComponent.POSTFIX||I.controlComponent===l.ControlComponent.POST_TEXT)break}if(m===h){this.updateActiveControlValue(),this.preElement=n;return}}}}if(this.destroyControl(),this.draw.isReadonly())return;let r=n.control,s=n;if(n.originControlId&&!r){const R=n.originControlId;for(let u=this.range.getRange().startIndex;u>=0;u--){const h=t[u];if(h.controlId===R&&!h.originControlId&&h.control){r=h.control,s=h;break}if(h.controlId===R&&!h.originControlId&&(h.controlComponent===l.ControlComponent.PRETEXTFIX||h.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||h.controlComponent===l.ControlComponent.PREFIX||h.controlComponent===l.ControlComponent.PRE_TEXT)){h.control&&(r=h.control,s=h);break}}}else if(!r&&n.controlId){const R=this.getElementList();for(let u=this.range.getRange().startIndex;u>=0;u--){const h=R[u];if(h.controlId!==n.controlId)break;if(h.control){r=h.control,s=h;break}if(h.controlComponent===l.ControlComponent.PRETEXTFIX||h.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||h.controlComponent===l.ControlComponent.PREFIX||h.controlComponent===l.ControlComponent.PRE_TEXT)break}}if(!r)return;if(r?.type===l.ControlType.TEXTFIELD&&this.draw.getMode()!==l.EditorMode.EDIT)if(n.originControlId){const R=n.controlId;for(let u=this.range.getRange().startIndex;u>=0;u--){const h=t[u];if(h.controlId===R&&h.originControlId===n.originControlId&&h.control&&h.control.type!==l.ControlType.TEXTFIELD){r=h.control,s=h;break}if(h.controlComponent===l.ControlComponent.PREFIX||h.controlComponent===l.ControlComponent.PRETEXTFIX)break}if(r?.type===l.ControlType.TEXTFIELD)return}else return;const a=this.draw.getPosition().getPositionContext(),c=this.range.getRange().startIndex,d=!!(a.isDirectHit&&a.index===c&&t[a.index]?.controlId===s.controlId);if(r?.type===l.ControlType.TEXTFIELD)this.activeControl=new gr(s,this);else if(r.type===l.ControlType.TEXT)this.activeControl=new Xi(s,this);else if(r.type===l.ControlType.SELECT){const R=new On(s,this);this.activeControl=R,(d||this.draw.getMode()===l.EditorMode.FORM)&&R.awake()}else if(r.type===l.ControlType.CHECKBOX)this.activeControl=new Gn(s,this);else if(r.type===l.ControlType.RADIO)this.activeControl=new _o(s,this);else if(r.type===l.ControlType.DATE){const R=new Dn(s,this);this.activeControl=R,R.awake()}else if(r.type===l.ControlType.NUMBER){const R=new Un(s,this);this.activeControl=R,d&&R.awake()}else if(r.type===l.ControlType.BUTTON){const R=new $e(s,this);if(this.activeControl=R,d){R.awake();return}}else if(r.type===l.ControlType.MENSTRUAL_HISTORY){const R=new fr(s,this);this.activeControl=R,R.awake()}this.updateActiveControlValue(),this.preElement=s,s.controlComponent!==l.ControlComponent.POSTFIX&&s.controlComponent!==l.ControlComponent.POSTTEXTFIX&&this.emitControlChange(l.ControlState.ACTIVE)}destroyControl(t={}){if(!this.activeControl)return;const{isEmitEvent:e=!0}=t;(this.activeControl instanceof On||this.activeControl instanceof Dn||this.activeControl instanceof Un||this.activeControl instanceof fr)&&this.activeControl.destroy(),e&&this.preElement?.controlComponent!==l.ControlComponent.POSTFIX&&this.preElement?.controlComponent!==l.ControlComponent.POSTTEXTFIX&&this.emitControlChange(l.ControlState.INACTIVE),this.preElement=null,this.activeControl=null,this.activeControlValue=[]}repaintControl(t={}){const{curIndex:e,isCompute:n=!0,isSubmitHistory:i=!0,isSetCursor:r=!0}=t;e===void 0?(this.range.clearRange(),this.draw.render({isCompute:n,isSubmitHistory:i,isSetCursor:!1})):(this.range.setRange(e,e),this.draw.render({curIndex:e,isCompute:n,isSetCursor:r,isSubmitHistory:i}))}emitControlContentChange(t){const e=this.eventBus.isSubscribe("controlContentChange");if(!e&&!this.listener.controlContentChange)return;const n=t?.controlElement||this.activeControl?.getElement();if(!n)return;const i=t?.context?.elementList||this.getElementList(),{startIndex:r}=t?.context?.range||this.getRange();if(!i[r]?.controlId)return;const s=t?.controlValue||this.getControlElementList(t?.context);let a;if(s?.length?a=Pt(s)[0].control:(a=n.control,a.value=[]),!a)return;const c={control:a,controlId:n.controlId};this.listener.controlContentChange?.(c),e&&this.eventBus.emit("controlContentChange",c)}reAwakeControl(){if(!this.activeControl)return;const t=this.getElementList(),e=this.getRange(),n=t[e.startIndex];this.activeControl.setElement(n),(this.activeControl instanceof Dn||this.activeControl instanceof On)&&this.activeControl.getIsPopup()&&(this.activeControl.destroy(),this.activeControl.awake())}selectValue(){const t=this.getElementList(),{startIndex:e}=this.getRange(),n=t[e];if(!n?.controlId||n.controlComponent!==l.ControlComponent.VALUE&&t[e+1]?.controlComponent===l.ControlComponent.VALUE)return!1;let i=e;for(;i>0&&t[i].controlComponent===l.ControlComponent.VALUE;)i--;let r=e+1;for(;r<t.length;){if(t[r].controlComponent!==l.ControlComponent.VALUE){r--;break}r++}if(i!==r){const s=this.range.getRange();return this.range.replaceRange({...s,startIndex:i,endIndex:r}),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),!0}return!1}moveCursor(t){const{index:e,trIndex:n,tdIndex:i,tdValueIndex:r}=t;let s=this.draw.getOriginalElementList(),a;const c=t.isTable?r:e;if(t.isTable?(s=s[e].trList[n].tdList[i].value,a=s[r]):a=s[e],a.control?.hide||a.area?.hide){const d=Mn(s,c);return{newIndex:d,newElement:s[d]}}if(a.controlComponent===l.ControlComponent.VALUE)return{newIndex:c,newElement:a};if(a.controlComponent===l.ControlComponent.POSTFIX){let d=c+1;for(;d<s.length;){if(s[d].controlId!==a.controlId)return{newIndex:d-1,newElement:s[d-1]};if(d===s.length-1)return{newIndex:d,newElement:s[d]};d++}}else if(a.controlComponent===l.ControlComponent.PREFIX||a.controlComponent===l.ControlComponent.PRE_TEXT){let d=c+1;for(;d<s.length;){const R=s[d];if(R.controlId!==a.controlId||R.controlComponent!==l.ControlComponent.PREFIX&&R.controlComponent!==l.ControlComponent.PRE_TEXT)return{newIndex:d-1,newElement:s[d-1]};d++}}else if(a.controlComponent===l.ControlComponent.PLACEHOLDER){let d=c-1;for(;d>0;){const R=s[d];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.VALUE||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT||R.controlComponent===l.ControlComponent.PRETEXTFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:s[d]};d--}}else if(a.controlComponent===l.ControlComponent.POST_TEXT||a.controlComponent===l.ControlComponent.TEXTFIXLABEL||a.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT){let d=c-1;for(;d>0;){const R=s[d];if(R.controlId!==a.controlId||R.controlComponent===l.ControlComponent.VALUE||R.controlComponent===l.ControlComponent.PREFIX||R.controlComponent===l.ControlComponent.PRE_TEXT||R.controlComponent===l.ControlComponent.PRETEXTFIX||R.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:s[d]};d--}}else if(a.controlComponent===l.ControlComponent.POSTTEXTFIX){let d=c+1;for(;d<s.length;){if(s[d].controlId!==a.controlId)return{newIndex:d-1,newElement:s[d-1]};if(d===s.length-1)return{newIndex:d,newElement:s[d]};d++}}else if(a.controlComponent===l.ControlComponent.PRETEXTFIX||a.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){let d=c+1;for(;d<s.length;){const R=s[d];if(R.controlId!==a.controlId||R.controlComponent!==l.ControlComponent.PRETEXTFIX&&R.controlComponent!==l.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d-1,newElement:s[d-1]};d++}}return{newIndex:c,newElement:a}}removeControl(t,e={}){const n=e.elementList||this.getElementList(),i=n[t];if(!this.draw.isDesignMode()&&we(i)){const{deletable:L=!0}=i.control;if(!L)return null;const P=this.draw.getMode();if(P===l.EditorMode.FORM&&this.options.modeRule[P].controlDeletableDisabled)return null}let r=-1,s=-1;const a=!!i.originControlId,c=i.controlId,d=i.originControlId,R=i.control?.type===l.ControlType.BUTTON&&!i.control?.buttonText?`${c}_text`:"";let u=t;for(;u>=0;){const L=n[u];let P=!1;if(a?P=L.controlId===c&&L.originControlId===d:P=L.controlId===c&&!L.originControlId,!P){r=u;break}u--}let h=t;for(;h<n.length;){const L=n[h];let P=!1;if(a?P=L.controlId===c&&L.originControlId===d:P=L.controlId===c&&!L.originControlId,!P){s=h-1;break}h++}if(h===n.length&&(s=h-1),!~r&&!~s)return t;r=~r?r:0;const g=n[r+1],f=g.control,T=f?.type&&[l.ControlType.TEXT,l.ControlType.TEXTFIELD,l.ControlType.DATE,l.ControlType.NUMBER,l.ControlType.SELECT,l.ControlType.BUTTON].includes(f.type);let m=n[0]?.type===l.ElementType.SPLIT_TAG;if(!e.removeNext&&T&&!a&&g.controlComponent!==l.ControlComponent.PREFIX&&g.type!==l.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const L=this.draw.getTd();L&&this.createRemoveControlHandler(L,i.controlId,!0)}if(!e.removeNext&&T&&!a&&g.controlComponent!==l.ControlComponent.PRETEXTFIX&&g.type!==l.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const L=this.draw.getTd();L&&this.createRemoveControlHandler(L,i.controlId,!0)}if(!e.removePrev&&T&&!a&&n[s].controlComponent!==l.ControlComponent.POSTFIX)if(e.removeNext)e.removeNext();else{const L=this.draw.getTd();m=!!L?.linkTdNextId,L&&this.createRemoveControlHandler(L,i.controlId,!1)}if(!e.removePrev&&T&&!a&&n[s].controlComponent!==l.ControlComponent.POSTTEXTFIX)if(e.removeNext)e.removeNext();else{const L=this.draw.getTd();m=!!L?.linkTdNextId,L&&this.createRemoveControlHandler(L,i.controlId,!1)}this.draw.spliceElementList(n,r+1,s-r);let p=0;if(R)for(let L=n.length-1;L>=0;L--)n[L].controlId===R&&(L<=r&&p++,n.splice(L,1));const I=r-p;return!e.elementList&&m&&r===0?this.draw.fixPosition(!0)??I:I}createRemoveControlHandler(t,e,n){if(n){const i=this.draw.getTdById(t.linkTdPrevId);i&&i.value.splice(-1)[0]?.controlId===e&&this.removeControl(i.value.length-1,{elementList:i.value,removePrev:()=>{this.createRemoveControlHandler(i,e,n)}})}else{const i=this.draw.getTdById(t.linkTdNextId);i&&i.value[1]?.controlId===e&&this.removeControl(1,{elementList:i.value,removeNext:()=>{this.createRemoveControlHandler(i,e,n)}})}}removePlaceholder(t,e={}){const n=e.elementList||this.getElementList(),i=n[t],r=n[t+1];if(i.controlComponent===l.ControlComponent.PLACEHOLDER||i.controlComponent===l.ControlComponent.TEXTFIXLABEL||r?.controlComponent===l.ControlComponent.PLACEHOLDER||r?.controlComponent===l.ControlComponent.TEXTFIXLABEL){let s=!1,a=t;for(;a<n.length;){const c=n[a];if(c.controlId!==i.controlId)break;c.controlComponent===l.ControlComponent.PLACEHOLDER||c.controlComponent===l.ControlComponent.TEXTFIXLABEL?(s||(s=!0,this.draw.getHistoryManager().popUndo(),this.draw.submitHistory(t)),n.splice(a,1)):a++}}}addPlaceholder(t,e={}){const n=e.elementList||this.getElementList(),i=n[t],r=i.control;if(!r.placeholder)return;let s=t;for(;s>=0;){const g=n[s];if(g.controlId!==i.controlId){s++;break}if(g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT||g.controlComponent===l.ControlComponent.PRETEXTFIX||g.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)break;s--}s<0&&(s=0);const a=s+1;if(a<n.length){const g=n[a];if(g.controlId===i.controlId&&(g.controlComponent===l.ControlComponent.PLACEHOLDER||g.controlComponent===l.ControlComponent.VALUE))return}let c=!1,d=s+1;for(;d<n.length;){const g=n[d];if(g.controlId===i.controlId){if(g.controlComponent===l.ControlComponent.POSTFIX||g.controlComponent===l.ControlComponent.POST_TEXT||g.controlComponent===l.ControlComponent.POSTTEXTFIX||g.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT)break}else if(g.controlId!==i.controlId&&(g.controlComponent===l.ControlComponent.VALUE||g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT)){c=!0;break}d++}if(c)return;const R=ct(r.placeholder),u=Dt(i,Gt),h=s+1;for(let g=0;g<R.length;g++){const f=R[g],T={...u,value:f===`
185
+ `?H:f,controlId:i.controlId,type:l.ElementType.CONTROL,control:i.control,controlComponent:l.ControlComponent.PLACEHOLDER,color:this.controlOptions.placeholderColor};Ut(n,[T],s,{editorOptions:this.options}),this.draw.spliceElementList(n,h+g,0,[T])}}setValue(t){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.setValue(t)}setControlProperties(t,e={}){const n=e.elementList||this.getElementList(),{startIndex:i}=e.range||this.getRange(),r=n[i];let s=i;for(;s>0;){const c=n[s];if(c.controlId!==r.controlId)break;c.control={...c.control,...t},s--}let a=i+1;for(;a<n.length;){const c=n[a];if(c.controlId!==r.controlId)break;c.control={...c.control,...t},a++}}keydown(t){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.keydown(t)}cut(){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.cut()}getValueById(t){const{id:e,groupId:n,conceptId:i,areaId:r}=t,s=[];if(!e&&!i&&!n)return s;const a=new Set,c=(R,u)=>{let h=0;for(;h<R.length;){const g=R[h];if(h++,g.type===l.ElementType.TABLE){const P=g.trList;for(let O=0;O<P.length;O++){const S=P[O];for(let F=0;F<S.tdList.length;F++){const N=S.tdList[F],V=N.originalId??N.id;a.has(V)||(a.add(V),N.linkTdNextId?c(this.draw.getSplitTdValues(V),u):c(N.value,u))}}}if(!g.control||n&&g.control.groupId!==n||e&&g.controlId!==e||i&&g.control.conceptId!==i||r&&g.areaId!==r)continue;const{type:f,code:T,valueSets:m}=g.control;let p=h,I="";const L=[];for(;p<R.length;){const P=R[p];if(P.controlId!==g.controlId)break;(f===l.ControlType.TEXT||f===l.ControlType.TEXTFIELD||f===l.ControlType.DATE||f===l.ControlType.NUMBER)&&P.controlComponent===l.ControlComponent.VALUE&&(I+=P.value,L.push(ie(P,yo))),p++}if(f===l.ControlType.TEXT||f===l.ControlType.TEXTFIELD||f===l.ControlType.DATE||f===l.ControlType.NUMBER)s.push({...g.control,zone:u,value:I||null,innerText:I||null,elementList:Pt(L)});else if(f===l.ControlType.SELECT||f===l.ControlType.CHECKBOX||f===l.ControlType.RADIO){const P=T?.split(",").map(O=>m?.find(S=>S.code===O)?.value).filter(Boolean).join("");s.push({...g.control,zone:u,value:T||null,innerText:P||null})}h=p}},d=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:R,elementList:u}of d)c(u,R);return s}setValueListById(t){if(!t.length)return;let e=!1,n=!1;const i=(s,a)=>{let c=0;for(;c<s.length;){const d=s[c];if(c++,d.type===l.ElementType.TABLE){const L=d.trList;for(let P=0;P<L.length;P++){const O=L[P];for(let S=0;S<O.tdList.length;S++){const F=O.tdList[S];i(F.value,F.id)}}}if(!d.control||d.type===l.ElementType.SPLIT_TAG)continue;const R=t.find(L=>(!L.groupId||L.groupId===d.control?.groupId)&&(L.id&&d.controlId===L.id||L.conceptId&&d.control.conceptId===L.conceptId||L.areaId&&d.areaId===L.areaId));if(!R)continue;const{value:u,isSubmitHistory:h=!0}=R;e=!0,h&&(n=!0);const{type:g}=d.control,{range:f,fullRange:T}=this.mergeControl({elementList:s,range:{startIndex:c,endIndex:c},tdId:a}),m={range:T??f,elementList:s,tdId:a},p={isIgnoreDisabledRule:!0,isIgnoreDeletedRule:!0};if(g===l.ControlType.TEXTFIELD){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&bt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new gr(d,this);this.activeControl=P,L.length?P.setValue(L,m,p):P.clearValue(m,p)}else if(g===l.ControlType.TEXT){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&bt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new Xi(d,this);this.activeControl=P,L.length?P.setValue(L,m,p):P.clearValue(m,p)}else if(g===l.ControlType.SELECT){if(Array.isArray(u))continue;const L=new On(d,this);this.activeControl=L,u?L.setSelect(u,m,p):L.clearSelect(m,p)}else if(g===l.ControlType.CHECKBOX){if(Array.isArray(u))continue;const L=new Gn(d,this);this.activeControl=L;const P=u?u.split(","):[];L.setSelect(P,m,p)}else if(g===l.ControlType.RADIO){if(Array.isArray(u))continue;const L=new _o(d,this);this.activeControl=L;const P=u?[u]:[];L.setSelect(P,m,p)}else if(g===l.ControlType.DATE){const L=new Dn(d,this);this.activeControl=L,Co(u)?(u.length&&bt(u,{isHandleFirstElement:!1,editorOptions:this.options}),L.setValue(u,m,p)):Jr(u)?L.setSelect(u,m,p):L.clearSelect(m,p)}else if(g===l.ControlType.NUMBER){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&bt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new Un(d,this);this.activeControl=P,L.length?P.setValue(L,m,p):P.clearValue(m,p)}else if(g===l.ControlType.BUTTON){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&bt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new $e(d,this);this.activeControl=P,L.length?P.setValue(L,m,p):P.clearSelect(m,p)}this.emitControlContentChange({context:m}),this.activeControl=null;let I=c;for(;I<s.length&&s[I].controlId===d.controlId;)I++;c=I}};this.destroyControl({isEmitEvent:!1});const r=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const s of r)i(s);e&&(n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1}))}setExtensionListById(t){if(!t.length)return;const e=i=>{let r=0;for(;r<i.length;){const s=i[r];if(r++,s.type===l.ElementType.TABLE){const R=s.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];e(f.value)}}}if(!s.control)continue;const a=t.find(R=>R.id&&s.controlId===R.id||R.conceptId&&s.control.conceptId===R.conceptId||R.areaId&&s.areaId===R.areaId);if(!a)continue;const{extension:c}=a;this.setControlProperties({extension:c},{elementList:i,range:{startIndex:r,endIndex:r}});let d=r;for(;d<i.length&&i[d].controlId===s.controlId;)d++;r=d}},n=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const i of n)e(i)}setPropertiesListById(t){if(!t.length)return;let e=!1,n=!1;const i=s=>{let a=0;for(;a<s.length;){const c=s[a];if(a++,c.type===l.ElementType.TABLE){const g=c.trList;for(let f=0;f<g.length;f++){const T=g[f];for(let m=0;m<T.tdList.length;m++){const p=T.tdList[m];i(p.value)}}}if(!c.control)continue;const d=t.find(g=>g.id&&c.controlId===g.id||g.conceptId&&c.control.conceptId===g.conceptId||g.areaId&&c.areaId===g.areaId);if(!d)continue;const{properties:R,isSubmitHistory:u=!0}=d;if(e=!0,u&&(n=!0),this.setControlProperties({...c.control,...R,value:c.control.value},{elementList:s,range:{startIndex:a-1,endIndex:a-1}}),Gt.forEach(g=>{const f=R[g];f&&Reflect.set(c,g,f)}),c.control?.type===l.ControlType.NUMBER&&R.numberExclusiveOptions){const g={...c.control.numberExclusiveOptions,...R.numberExclusiveOptions},f=g?.minValue,T=g?.maxValue,m=new Un(c,this),p=m.getValue({elementList:s,range:{startIndex:a-1,endIndex:a-1}});if(p.length>0){const I=p.map(P=>P.value).join(""),L=Number(I);!Number.isNaN(L)&&Number.isFinite(L)&&(f!=null&&L<f||T!=null&&L>T)&&m.clearValue({elementList:s,range:{startIndex:a-1,endIndex:a-1}},{isAddPlaceholder:!0})}}let h=a;for(;h<s.length&&s[h].controlId===c.controlId;)h++;a=h}},r={header:this.draw.getHeaderElementList(),main:this.draw.getOriginalMainElementList(),footer:this.draw.getFooterElementList()};for(const s in r){const a=r[s];i(a)}if(e){for(const s in r){const a=s,c=Pt(r[a],{isClassifyArea:!0,extraPickAttrs:["id","controlId"]});r[a]=c,bt(c,{editorOptions:this.options,isForceCompensation:!0})}this.draw.setEditorData(r),n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1})}}getList(){const t=[];function e(i){for(let r=0;r<i.length;r++){const s=i[r];if(s.type===l.ElementType.TABLE){const a=s.trList;for(let c=0;c<a.length;c++){const d=a[c];for(let R=0;R<d.tdList.length;R++){const h=d.tdList[R].value;e(h)}}}if(s.controlId){const a=ie(s,[...Fo,...In]);t.push(a)}}}const n=[this.draw.getHeader().getElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooter().getElementList()];for(const i of n)e(i);return Pt(t,{extraPickAttrs:["controlId"]})}recordBorderInfo(t,e,n,i){this.controlBorder.recordBorderInfo(t,e,n,i)}drawBorder(t){this.controlBorder.render(t)}startTextFieldUnderline(t,e,n){this.textFieldUnderline.startTextFieldValue(t,e,n)}recordTextFieldUnderlineWidth(t){this.textFieldUnderline.recordValueWidth(t)}drawTextFieldUnderline(t){this.textFieldUnderline.endTextFieldValue(t)}getPreControlContext(){if(!this.activeControl)return null;const e=this.draw.getPosition().getPositionContext();if(!e)return null;const n=this.activeControl.getElement();function i(c,d){for(let R=d;R>0;R--){const u=c[R];if(u.type===l.ElementType.TABLE){const g=u.trList||[];for(let f=g.length-1;f>=0;f--){const T=g[f],m=T.tdList;for(let p=m.length-1;p>=0;p--){const I=m[p],L=i(I.value,I.value.length-1);if(L)return{positionContext:{isTable:!0,index:R,trIndex:f,tdIndex:p,tdId:I.id,trId:T.id,tableId:u.id},nextIndex:L.nextIndex}}}}if(!u.controlId||u.controlId===n.controlId)continue;let h=R;for(;h>0;){const g=c[h];if(g.controlComponent===l.ControlComponent.VALUE||g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT||g.controlComponent===l.ControlComponent.PRETEXTFIX||g.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)break;h--}return{positionContext:{isTable:!1},nextIndex:h}}return null}const{startIndex:r}=this.range.getRange(),s=this.getElementList(),a=i(s,r);if(a)return{positionContext:e.isTable?e:a.positionContext,nextIndex:a.nextIndex};if(n.tableId){const c=this.draw.getOriginalElementList(),{index:d,trIndex:R,tdIndex:u}=e,h=c[d].trList;for(let f=R;f>=0;f--){const T=h[f],m=T.tdList;for(let p=m.length-1;p>=0;p--){if(R===f&&p>=u)continue;const I=m[p],L=i(I.value,I.value.length-1);if(L)return{positionContext:{isTable:!0,index:e.index,trIndex:f,tdIndex:p,tdId:I.id,trId:T.id,tableId:n.tableId},nextIndex:L.nextIndex}}}const g=i(c,d-1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}getNextControlContext(){if(!this.activeControl)return null;const e=this.draw.getPosition().getPositionContext();if(!e)return null;const n=this.activeControl.getElement();function i(c,d){for(let R=d;R<c.length;R++){const u=c[R];if(u.type===l.ElementType.TABLE){const h=u.trList||[];for(let g=0;g<h.length;g++){const f=h[g],T=f.tdList;for(let m=0;m<T.length;m++){const p=T[m],I=i(p.value,0);if(I)return{positionContext:{isTable:!0,index:R,trIndex:g,tdIndex:m,tdId:p.id,trId:f.id,tableId:u.id},nextIndex:I.nextIndex}}}}if(!(!u.controlId||u.controlId===n.controlId||c[R+1]?.controlComponent===l.ControlComponent.PREFIX||c[R+1]?.controlComponent===l.ControlComponent.PRE_TEXT||c[R+1]?.controlComponent===l.ControlComponent.PRETEXTFIX||c[R+1]?.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT))return{positionContext:{isTable:!1},nextIndex:R}}return null}const{endIndex:r}=this.range.getRange(),s=this.getElementList(),a=i(s,r);if(a)return{positionContext:e.isTable?e:a.positionContext,nextIndex:a.nextIndex};if(n.tableId){const c=this.draw.getOriginalElementList(),{index:d,trIndex:R,tdIndex:u}=e,h=c[d].trList;for(let f=R;f<h.length;f++){const T=h[f],m=T.tdList;for(let p=0;p<m.length;p++){if(R===f&&p<=u)continue;const I=m[p],L=i(I.value,0);if(L)return{positionContext:{isTable:!0,index:e.index,trIndex:f,tdIndex:p,tdId:I.id,trId:T.id,tableId:n.tableId},nextIndex:L.nextIndex}}}const g=i(c,d+1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}initNextControl(t={}){const{direction:e=Zt.DOWN}=t;let n=null;if(e===Zt.UP?n=this.getPreControlContext():n=this.getNextControlContext(),!n)return;const{nextIndex:i,positionContext:r}=n,s=this.draw.getPosition();s.setPositionContext(r),this.draw.getRange().replaceRange({startIndex:i,endIndex:i}),this.draw.render({curIndex:i,isCompute:!1,isSetCursor:!0,isSubmitHistory:!1});const a=s.getPositionList();this.draw.getCursor().moveCursorToVisible({cursorPosition:a[i],direction:e})}setMinWidthControlInfo(t){const{row:e,rowElement:n,controlRealWidth:i,availableWidth:r}=t;if(!n.control?.minWidth)return;const{scale:s}=this.options,a=n.control.minWidth*s;let c=null;if(n.control?.minWidth&&(n.control?.rowFlex===l.RowFlex.CENTER||n.control?.rowFlex===l.RowFlex.RIGHT)){let R=n.metrics.width,u=e.elementList.length-1;for(;u>=0;){const h=e.elementList[u];if(R+=h.metrics.width,e.elementList[u-1]?.controlComponent===l.ControlComponent.PREFIX){c=h;break}u--}c&&R<a&&(n.control.rowFlex===l.RowFlex.CENTER?c.left=(a-R)/2:n.control.rowFlex===l.RowFlex.RIGHT&&(c.left=a-R-n.metrics.width))}const d=a-i;if(d>0){const R=c?.left||0,u=r-e.width-n.metrics.width,h=Math.min(u,d);n.left=h-R,e.width+=h-R}}mergeControl(t={}){const e=t.elementList||this.getElementList(),n=t.range||this.getRange(),{startIndex:i}=n,r=t.tdId??this.draw.getPosition().getPositionContext().tdId,s=r?this.draw.getTdById(r):void 0,a=e[i];if(!a?.controlId)return{range:n,elementList:[],tdId:r};const c={startIndex:i,endIndex:i},d=[];let R=!1,u=i,h=s,g=e;for(;u>=0;){const p=g[u];if(p.controlId!==a.controlId)break;if(p.type!==l.ElementType.SPLIT_TAG&&(d.unshift(p),R&&(g.splice(u,1),e[0].type===l.ElementType.SPLIT_TAG?e.splice(0,1):(n.startIndex++,n.endIndex++),e.unshift(p)),c.startIndex=u),u===0&&p.controlComponent!==l.ControlComponent.PREFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){g=h.value,u=h.value.length-1,R=!0;continue}if(u===0&&p.controlComponent!==l.ControlComponent.PRETEXTFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){g=h.value,u=h.value.length-1,R=!0;continue}u--}R=!1;let f=i+1,T=s,m=e;for(;f<m.length;){const p=m[f];if(p.controlId!==a.controlId)break;if(p.type!==l.ElementType.SPLIT_TAG&&(d.push(p),R&&(m.splice(f,1),e.push(p),f--)),f===m.length-1&&p.controlComponent!==l.ControlComponent.POSTFIX&&T?.linkTdNextId&&(T=this.draw.getTdById(T.linkTdNextId),T)){m=T.value,f=0,R=!0;continue}if(f===m.length-1&&p.controlComponent!==l.ControlComponent.POSTTEXTFIX&&T?.linkTdNextId&&(T=this.draw.getTdById(T.linkTdNextId),T)){m=T.value,f=0,R=!0;continue}f++}return c.endIndex=c.startIndex+d.length,{range:n,elementList:e,tdId:r,fullRange:{startIndex:c.startIndex,endIndex:c.endIndex-2}}}}class Ph{options;currentTextFieldId=null;valueStartX=0;valueWidth=0;valueY=0;constructor(t){this.options=t.getOptions()}startTextFieldValue(t,e,n){this.currentTextFieldId=t,this.valueStartX=e,this.valueY=n,this.valueWidth=0}recordValueWidth(t){this.valueWidth+=t}endTextFieldValue(t){if(!this.currentTextFieldId||this.valueWidth<=0){this.reset();return}const{scale:e}=this.options;t.save(),t.strokeStyle=this.options.defaultColor,t.lineWidth=e,t.beginPath();const n=this.valueY-.5*e;t.moveTo(this.valueStartX,n),t.lineTo(this.valueStartX+this.valueWidth,n),t.stroke(),t.restore(),this.reset()}reset(){this.currentTextFieldId=null,this.valueStartX=0,this.valueWidth=0,this.valueY=0}}const Mh=[l.EditorMode.FORM,l.EditorMode.PRINT];function Ke(o,t){for(const e of o){if(t(e),e.type===l.ElementType.TABLE){const n=e.trList||[];for(const i of n)for(const r of i.tdList)Ke(r.value,t)}e.valueList?.length&&Ke(e.valueList,t)}}function Oh(o,t){Ke(o,e=>{e.logicTemplateId=t.logicTemplateId,e.logicTemplateName=t.logicTemplateName,e.logicTemplateTemplateId=t.logicTemplateTemplateId,e.logicTemplateDisplayRule=t.logicTemplateDisplayRule})}function Ch(o){const t=new Map;return Ke(o,e=>{e.logicTemplateId&&(t.has(e.logicTemplateId)||t.set(e.logicTemplateId,{logicTemplateId:e.logicTemplateId,logicTemplateName:e.logicTemplateName,logicTemplateTemplateId:e.logicTemplateTemplateId,logicTemplateDisplayRule:e.logicTemplateDisplayRule}))}),Array.from(t.values())}function Sh(o,t){return(o?.modes?.length?o.modes:[...Mh]).includes(t)}class Eh{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}setSelect(t){const{checkbox:e}=t;e?e.value=!e.value:t.checkbox={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(t){const{ctx:e,x:n,index:i,row:r}=t;let{y:s}=t;const{checkbox:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:R,verticalAlign:u},scale:h}=this.options,{metrics:g,checkbox:f}=r.elementList[i];if(u===l.VerticalAlign.TOP||u===l.VerticalAlign.MIDDLE){let L=i+1,P=null;for(;L<r.elementList.length&&(P=r.elementList[L],!(P.value!==H&&P.value!==po));)L++;if(P){const{metrics:{boundingBoxAscent:O,boundingBoxDescent:S}}=P,F=O+S;F>g.height&&(u===l.VerticalAlign.TOP?s-=O-g.height:u===l.VerticalAlign.MIDDLE&&(s-=(F-g.height)/2))}}const T=Math.round(n+a*h),m=Math.round(s-g.height+c),p=g.width-a*2*h,I=g.height;e.save(),e.beginPath(),e.translate(.5,.5),f?.value?(e.lineWidth=c,e.strokeStyle=d,e.rect(T,m,p,I),e.stroke(),e.beginPath(),e.fillStyle=d,e.fillRect(T,m,p,I),e.beginPath(),e.strokeStyle=R,e.lineWidth=c*2*h,e.moveTo(T+2*h,m+I/2),e.lineTo(T+p/2,m+I-3*h),e.lineTo(T+p-2*h,m+3*h),e.stroke()):(e.lineWidth=c,e.rect(T,m,p,I),e.stroke()),e.closePath(),e.restore()}}class Xh{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}setSelect(t){const{radio:e}=t;e?e.value=!e.value:t.radio={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(t){const{ctx:e,x:n,index:i,row:r}=t;let{y:s}=t;const{radio:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:R,verticalAlign:u},scale:h}=this.options,{metrics:g,radio:f}=r.elementList[i];if(u===l.VerticalAlign.TOP||u===l.VerticalAlign.MIDDLE){let L=i+1,P=null;for(;L<r.elementList.length&&(P=r.elementList[L],!(P.value!==H&&P.value!==po));)L++;if(P){const{metrics:{boundingBoxAscent:O,boundingBoxDescent:S}}=P,F=O+S;F>g.height&&(u===l.VerticalAlign.TOP?s-=O-g.height:u===l.VerticalAlign.MIDDLE&&(s-=(F-g.height)/2))}}const T=Math.round(n+a*h),m=Math.round(s-g.height+c),p=g.width-a*2*h,I=g.height;e.save(),e.beginPath(),e.translate(.5,.5),e.strokeStyle=f?.value?d:R,e.lineWidth=c,e.arc(T+p/2,m+I/2,p/2,0,Math.PI*2),e.stroke(),f?.value&&(e.beginPath(),e.fillStyle=d,e.arc(T+p/2,m+I/2,p/3,0,Math.PI*2),e.fill()),e.closePath(),e.restore()}}const To={fontSize:11,smallFontSize:9,lineHeight:12,dividerWidth:40,gap:4,totalHeight:36};class Nh{draw;options;inputModal=null;isPopup=!1;constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=To,n=this.options.scale,i=e.fontSize*n,r=e.smallFontSize*n,s=e.gap*n,a=e.dividerWidth*n,d=document.createElement("canvas").getContext("2d"),R=t.menstrualData;d.font=`${i}px "Microsoft YaHei", sans-serif`;let u=a;d.font=`${r}px "Microsoft YaHei", sans-serif`;let h=0;if(R){const f=this.getValue(R.menarcheAge);d.font=`${i}px "Microsoft YaHei", sans-serif`,f&&(u+=d.measureText(`${f}岁`).width+s);let T="";if(R.isMenopause){const P=this.getValue(R.menopauseAge);P&&(T=`${P}岁`)}else{const P=this.getValue(R.lastPeriod);P&&(T=P)}T&&(u+=d.measureText(T).width+s),d.font=`${r}px "Microsoft YaHei", sans-serif`;const m=this.getValue(R.periodMin),p=this.getValue(R.periodMax);if(m||p){const P=`${m||""}~${p||""}`;h=Math.max(h,d.measureText(P).width)}const I=this.getValue(R.cycleMin),L=this.getValue(R.cycleMax);if(I||L){const P=`${I||""}~${L||""}`;h=Math.max(h,d.measureText(P).width)}}else d.font=`${i}px "Microsoft YaHei", sans-serif`,h=d.measureText("~").width;return{width:Math.max(u,h),height:e.totalHeight*n}}getValue(t){return!t||t===""||t==="_"||t==="____-__-__"?"":t}render(t){const{ctx:e,x:n,y:i,element:r}=t,s=r.menstrualData,a=this.options.scale;e.save(),e.font=`${To.fontSize*a}px "Microsoft YaHei", sans-serif`,e.fillStyle=this.options.defaultColor,e.textBaseline="bottom",s?this.renderWithData(e,n,i,s,a):this.renderEmpty(e,n,i,a),e.restore()}renderEmpty(t,e,n,i){const r=To,s=r.fontSize*i,a=r.lineHeight*i,c=r.dividerWidth*i,d=n-a*1.5,R=e+c/2;t.font=`${s}px "Microsoft YaHei", sans-serif`;const u=t.measureText("~").width,h=R-u/2;t.fillText("~",h,d+a);const g=d+a*2;this.drawDivider(t,e,g-s/2,c,i),t.fillText("~",h,g+a)}renderWithData(t,e,n,i,r){const s=To,a=s.fontSize*r,c=s.smallFontSize*r,d=s.lineHeight*r,R=s.gap*r,u=s.dividerWidth*r,h=n-d*2,g=h+d*2;t.font=`${a}px "Microsoft YaHei", sans-serif`;const f=this.getValue(i.menarcheAge);let T=e;if(f){const C=`${f}岁`;t.fillText(C,e,g),T=e+t.measureText(C).width+R}const m=T+u/2,p=h+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const I=this.getValue(i.periodMin),L=this.getValue(i.periodMax);let P="";I||L?P=`${I||""}~${L||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,P="~");const O=t.measureText(P).width,S=m-O/2;t.fillText(P,S,p),this.drawDivider(t,T,g-a/2,u,r),t.font=`${a}px "Microsoft YaHei", sans-serif`;let F="";if(i.isMenopause){const C=this.getValue(i.menopauseAge);C&&(F=`${C}岁`)}else{const C=this.getValue(i.lastPeriod);C&&(F=C)}F&&t.fillText(F,T+u+R,g);const N=g+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const V=this.getValue(i.cycleMin),Y=this.getValue(i.cycleMax);let X="";V||Y?X=`${V||""}~${Y||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,X="~");const W=t.measureText(X).width,E=m-W/2;t.fillText(X,E,N)}drawDivider(t,e,n,i,r){t.save(),t.beginPath(),t.strokeStyle=this.options.defaultColor,t.lineWidth=.5*r,t.moveTo(e,n),t.lineTo(e+i,n),t.stroke(),t.restore()}clearMenstrualHistoryEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderMenstrualHistoryEditor(t,e){if(this.options.mode===l.EditorMode.PRINT)return;(this.isPopup||this.inputModal)&&this.clearMenstrualHistoryEditor(),this.isPopup=!0;const n=t.menstrualData;this.inputModal=document.createElement("div"),this.inputModal.className="menstrual-history-edit-modal",this.inputModal.setAttribute("editor-component","menstrual-history-edit-modal"),this.inputModal.innerHTML=`
186
186
  <div class="menstrual-history-modal__mask"></div>
187
187
  <div class="menstrual-history-modal__container">
188
188
  <div class="menstrual-history-modal__header">
@@ -258,7 +258,7 @@ ${u} `}textToElements(t){const e=[],n=t.split(`
258
258
  <button class="btn-confirm">确认</button>
259
259
  </div>
260
260
  </div>
261
- `,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".menstrual-history-modal__mask"),r=this.inputModal.querySelector(".menstrual-history-modal__container"),s=this.inputModal.querySelector(".menstrual-history-modal__close"),a=this.inputModal.querySelector(".btn-cancel"),c=this.inputModal.querySelector(".btn-confirm"),d=this.inputModal.querySelector("#mh-edit-notMenopause"),R=this.inputModal.querySelector("#mh-edit-isMenopauseForm"),u=this.inputModal.querySelectorAll('input[name="mh-edit-isMenopause"]'),h=()=>{this.clearMenstrualHistoryEditor()};r.addEventListener("click",g=>{g.stopPropagation()}),i.addEventListener("click",h),s.addEventListener("click",h),a.addEventListener("click",h),u.forEach(g=>{g.addEventListener("change",()=>{const f=g.value==="true";d.style.display=f?"none":"block",R.style.display=f?"block":"none"})}),c.addEventListener("click",g=>{g.preventDefault(),g.stopPropagation();const f=this.inputModal;if(!f)return;const T=f.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let p;T?p={isMenopause:!0,periodMin:f.querySelector("#mh-edit-periodMin2")?.value||"",periodMax:f.querySelector("#mh-edit-periodMax2")?.value||"",menarcheAge:f.querySelector("#mh-edit-menarcheAge2")?.value||"",menopauseAge:f.querySelector("#mh-edit-menopauseAge")?.value||"",cycleMin:f.querySelector("#mh-edit-cycleMin2")?.value||"",cycleMax:f.querySelector("#mh-edit-cycleMax2")?.value||""}:p={isMenopause:!1,periodMin:f.querySelector("#mh-edit-periodMin")?.value||"",periodMax:f.querySelector("#mh-edit-periodMax")?.value||"",menarcheAge:f.querySelector("#mh-edit-menarcheAge1")?.value||"",lastPeriod:f.querySelector("#mh-edit-lastPeriod")?.value||"",cycleMin:f.querySelector("#mh-edit-cycleMin")?.value||"",cycleMax:f.querySelector("#mh-edit-cycleMax")?.value||""},this.clearMenstrualHistoryEditor();const m=this.draw.getElementList(),I=e.index;this.draw.spliceElementList(m,I,1);const L={type:"menstrualHistory",value:"",menstrualData:p};this.draw.spliceElementList(m,I,0,[L]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}}const hr={fontSize:16,totalWidth:85,totalHeight:75,symbolGap:12,lineGap:20};class Mh{draw;options;inputModal=null;isPopup=!1;constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=hr,n=this.options.scale;return{width:e.totalWidth*n,height:e.totalHeight*n}}render(t){const{ctx:e,x:n,y:i,element:r}=t,s=r.fetalHeartData,a=this.options.scale;e.save();const c=hr,d=c.fontSize*a,R=c.symbolGap*a,u=c.lineGap*a,h=c.totalHeight*a,g=n+c.totalWidth*a/2,T=i-h/2;e.font=`${d}px "Microsoft YaHei", sans-serif`,e.fillStyle=this.options.defaultColor,e.textBaseline="middle",e.textAlign="center";const p=h/4,m=T+p*.7,I=T+p*1.7,L=T+p*2.7,P=T+h-p*.3;this.drawVerticalLine(e,g,T,P-T,a);const O=g-R,S=g+R;this.drawSymbol(e,O,m,s?.a,d),this.drawSymbol(e,S,m,s?.b,d);const F=O-u,N=S+u;e.fillText("-",F,I),this.drawSymbol(e,O,I,s?.c,d),this.drawSymbol(e,S,I,s?.d,d),e.fillText("-",N,I),this.drawSymbol(e,O,L,s?.e,d),this.drawSymbol(e,S,L,s?.f,d),e.restore()}drawSymbol(t,e,n,i,r){const s=i?"+":"-";t.fillText(s,e,n)}drawVerticalLine(t,e,n,i,r){t.save(),t.beginPath(),t.strokeStyle=this.options.defaultColor,t.lineWidth=.5*r,t.moveTo(e,n),t.lineTo(e,n+i),t.stroke(),t.restore()}clearFetalHeartPositionEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderFetalHeartPositionEditor(t,e){if(this.options.mode===l.EditorMode.PRINT)return;(this.isPopup||this.inputModal)&&this.clearFetalHeartPositionEditor(),this.isPopup=!0;const n=t.fetalHeartData;this.inputModal=document.createElement("div"),this.inputModal.className="fetal-heart-position-edit-modal",this.inputModal.setAttribute("editor-component","fetal-heart-position-edit-modal"),this.inputModal.innerHTML=`
261
+ `,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".menstrual-history-modal__mask"),r=this.inputModal.querySelector(".menstrual-history-modal__container"),s=this.inputModal.querySelector(".menstrual-history-modal__close"),a=this.inputModal.querySelector(".btn-cancel"),c=this.inputModal.querySelector(".btn-confirm"),d=this.inputModal.querySelector("#mh-edit-notMenopause"),R=this.inputModal.querySelector("#mh-edit-isMenopauseForm"),u=this.inputModal.querySelectorAll('input[name="mh-edit-isMenopause"]'),h=()=>{this.clearMenstrualHistoryEditor()};r.addEventListener("click",g=>{g.stopPropagation()}),i.addEventListener("click",h),s.addEventListener("click",h),a.addEventListener("click",h),u.forEach(g=>{g.addEventListener("change",()=>{const f=g.value==="true";d.style.display=f?"none":"block",R.style.display=f?"block":"none"})}),c.addEventListener("click",g=>{g.preventDefault(),g.stopPropagation();const f=this.inputModal;if(!f)return;const T=f.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let m;T?m={isMenopause:!0,periodMin:f.querySelector("#mh-edit-periodMin2")?.value||"",periodMax:f.querySelector("#mh-edit-periodMax2")?.value||"",menarcheAge:f.querySelector("#mh-edit-menarcheAge2")?.value||"",menopauseAge:f.querySelector("#mh-edit-menopauseAge")?.value||"",cycleMin:f.querySelector("#mh-edit-cycleMin2")?.value||"",cycleMax:f.querySelector("#mh-edit-cycleMax2")?.value||""}:m={isMenopause:!1,periodMin:f.querySelector("#mh-edit-periodMin")?.value||"",periodMax:f.querySelector("#mh-edit-periodMax")?.value||"",menarcheAge:f.querySelector("#mh-edit-menarcheAge1")?.value||"",lastPeriod:f.querySelector("#mh-edit-lastPeriod")?.value||"",cycleMin:f.querySelector("#mh-edit-cycleMin")?.value||"",cycleMax:f.querySelector("#mh-edit-cycleMax")?.value||""},this.clearMenstrualHistoryEditor();const p=this.draw.getElementList(),I=e.index;this.draw.spliceElementList(p,I,1);const L={type:"menstrualHistory",value:"",menstrualData:m};this.draw.spliceElementList(p,I,0,[L]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}}const Tr={fontSize:16,totalWidth:85,totalHeight:75,symbolGap:12,lineGap:20};class Fh{draw;options;inputModal=null;isPopup=!1;constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=Tr,n=this.options.scale;return{width:e.totalWidth*n,height:e.totalHeight*n}}render(t){const{ctx:e,x:n,y:i,element:r}=t,s=r.fetalHeartData,a=this.options.scale;e.save();const c=Tr,d=c.fontSize*a,R=c.symbolGap*a,u=c.lineGap*a,h=c.totalHeight*a,g=n+c.totalWidth*a/2,T=i-h/2;e.font=`${d}px "Microsoft YaHei", sans-serif`,e.fillStyle=this.options.defaultColor,e.textBaseline="middle",e.textAlign="center";const m=h/4,p=T+m*.7,I=T+m*1.7,L=T+m*2.7,P=T+h-m*.3;this.drawVerticalLine(e,g,T,P-T,a);const O=g-R,S=g+R;this.drawSymbol(e,O,p,s?.a,d),this.drawSymbol(e,S,p,s?.b,d);const F=O-u,N=S+u;e.fillText("-",F,I),this.drawSymbol(e,O,I,s?.c,d),this.drawSymbol(e,S,I,s?.d,d),e.fillText("-",N,I),this.drawSymbol(e,O,L,s?.e,d),this.drawSymbol(e,S,L,s?.f,d),e.restore()}drawSymbol(t,e,n,i,r){const s=i?"+":"-";t.fillText(s,e,n)}drawVerticalLine(t,e,n,i,r){t.save(),t.beginPath(),t.strokeStyle=this.options.defaultColor,t.lineWidth=.5*r,t.moveTo(e,n),t.lineTo(e,n+i),t.stroke(),t.restore()}clearFetalHeartPositionEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderFetalHeartPositionEditor(t,e){if(this.options.mode===l.EditorMode.PRINT)return;(this.isPopup||this.inputModal)&&this.clearFetalHeartPositionEditor(),this.isPopup=!0;const n=t.fetalHeartData;this.inputModal=document.createElement("div"),this.inputModal.className="fetal-heart-position-edit-modal",this.inputModal.setAttribute("editor-component","fetal-heart-position-edit-modal"),this.inputModal.innerHTML=`
262
262
  <div class="fetal-heart-position-modal__mask"></div>
263
263
  <div class="fetal-heart-position-modal__container">
264
264
  <div class="fetal-heart-position-modal__header">
@@ -304,7 +304,7 @@ ${u} `}textToElements(t){const e=[],n=t.split(`
304
304
  <button class="btn-confirm">确认</button>
305
305
  </div>
306
306
  </div>
307
- `,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".fetal-heart-position-modal__mask"),r=this.inputModal.querySelector(".fetal-heart-position-modal__container"),s=this.inputModal.querySelector(".fetal-heart-position-modal__close"),a=this.inputModal.querySelector(".btn-cancel"),c=this.inputModal.querySelector(".btn-confirm"),d=()=>{this.clearFetalHeartPositionEditor()};r.addEventListener("click",R=>{R.stopPropagation()}),i.addEventListener("click",d),s.addEventListener("click",d),a.addEventListener("click",d),c.addEventListener("click",R=>{R.preventDefault(),R.stopPropagation();const u=this.inputModal;if(!u)return;const h={a:u.querySelector("#fh-a")?.checked||!1,b:u.querySelector("#fh-b")?.checked||!1,c:u.querySelector("#fh-c")?.checked||!1,d:u.querySelector("#fh-d")?.checked||!1,e:u.querySelector("#fh-e")?.checked||!1,f:u.querySelector("#fh-f")?.checked||!1};this.clearFetalHeartPositionEditor();const g=this.draw.getElementList(),f=e.index;this.draw.spliceElementList(g,f,1);const T={type:"fetalHeartPosition",value:"",fetalHeartData:h};this.draw.spliceElementList(g,f,0,[T]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}}const We={fontSize:12,deciduousFontSize:10,smallFontSize:9,totalHeight:60,toothGap:2,halfGap:8,minLineHalfWidth:50,maxLineHalfWidth:85},gr=["La","B","F","M","I","D","L","P"];class Oh{draw;options;inputModal=null;isPopup=!1;finallyAdd=null;toothSurfaceMap={};supernumeraryToothMap={};constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=We,n=this.options.scale,i=t.toothPositionData,s=this.calculateLineHalfWidth(i,n)*2;return{width:Math.min(s,this.draw.getInnerWidth()),height:e.totalHeight*n}}calculateLineHalfWidth(t,e){const{minLineHalfWidth:n,maxLineHalfWidth:i,fontSize:r,deciduousFontSize:s,smallFontSize:a,toothGap:c}=We,d=(T,p,m)=>{let I=0;const L=(P,O)=>`${P}-${O}`;return p.forEach(P=>{const O=L(m,P),S=t?.toothSurfaceMap?.[O]||[],F=t?.supernumeraryToothMap?.[O];I+=s*e*.6,S.length>0&&(I+=a*e*S.length*.5),F&&(I+=s*e*.4),I+=c*e}),T.forEach(P=>{const O=L(m,P),S=t?.toothSurfaceMap?.[O]||[],F=t?.supernumeraryToothMap?.[O];I+=r*e*.6,S.length>0&&(I+=a*e*S.length*.5),F&&(I+=r*e*.4),I+=c*e}),I},R=Math.max(d(t?.upperLeft||[],t?.upperLeftLetter||[],"upperLeft"),d(t?.lowerLeft||[],t?.lowerLeftLetter||[],"lowerLeft")),u=Math.max(d(t?.upperRight||[],t?.upperRightLetter||[],"upperRight"),d(t?.lowerRight||[],t?.lowerRightLetter||[],"lowerRight")),g=Math.max(R,u)/e+We.halfGap;return Math.max(n,Math.min(i,g))*e}render(t){const{ctx:e,x:n,y:i,element:r}=t,s=r.toothPositionData,a=this.options.scale;e.save();const c=We.fontSize*a,d=We.deciduousFontSize*a,R=We.smallFontSize*a,u=We.toothGap*a,h=We.totalHeight*a,g=We.halfGap*a,f=2*a,T=(S,F)=>`${S}-${F}`,p=this.calculateLineHalfWidth(s,a),m=p*2,I=n+p,L=i;e.beginPath(),e.rect(I-p,L-h/2,m,h),e.clip(),e.beginPath(),e.strokeStyle=this.options.defaultColor,e.lineWidth=1*a,e.moveTo(I,L-h/2+10*a),e.lineTo(I,L+h/2-10*a),e.stroke(),e.beginPath(),e.moveTo(I-p,L),e.lineTo(I+p,L),e.stroke();const P=(S,F,N,V,Y)=>{const X=T(S,F),b=s?.toothSurfaceMap?.[X]||[],E=gr.filter(U=>b.includes(U)),C=s?.supernumeraryToothMap?.[X],M=F.toString(),W=typeof F=="string"?d:c;e.font=`${W}px "Microsoft YaHei", sans-serif`,e.textBaseline="middle";let D=N;if(C){e.font=`${W}px "Microsoft YaHei", sans-serif`;const H=e.measureText("(").width,j=e.measureText(M).width;e.font=`${R}px "Microsoft YaHei", sans-serif`;const st=e.measureText("S").width;let it=H+j+H;it+=st+f;let nt=0,et="";return E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,et=E.join(","),nt=e.measureText(et).width+f/2),Y==="right"?(D=N-it,E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText(et,D-nt-f/2,V-W*.4)),e.font=`${W}px "Microsoft YaHei", sans-serif`,e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText("(",D,V),D+=H,e.font=`${R}px "Microsoft YaHei", sans-serif`,C==="Si"&&(e.fillText("S",D,V-W*.4),D+=st+f),e.font=`${W}px "Microsoft YaHei", sans-serif`,e.fillText(M,D,V),D+=j,C==="iS"&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText("S",D,V-W*.4),D+=st),e.font=`${W}px "Microsoft YaHei", sans-serif`,e.fillText(")",D,V),N-it-nt-u):(e.font=`${W}px "Microsoft YaHei", sans-serif`,e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText("(",D,V),D+=H,e.font=`${R}px "Microsoft YaHei", sans-serif`,C==="Si"&&(e.fillText("S",D,V-W*.4),D+=st+f),e.font=`${W}px "Microsoft YaHei", sans-serif`,e.fillText(M,D,V),D+=j,C==="iS"&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText("S",D,V-W*.4),D+=st),e.font=`${W}px "Microsoft YaHei", sans-serif`,e.fillText(")",D,V),D+=H,E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText(et,D+f/2,V-W*.4),D+=nt),D+u)}else{e.font=`${W}px "Microsoft YaHei", sans-serif`;const U=e.measureText(M).width;let Q=0,G="";return E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,G=E.join(","),Q=e.measureText(G).width+f/2,e.font=`${W}px "Microsoft YaHei", sans-serif`),Y==="right"?(D=N-U,E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText(G,D-Q-f/2,V-W*.4),e.font=`${W}px "Microsoft YaHei", sans-serif`),e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText(M,D,V),N-U-Q-u):(e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText(M,D,V),D+=U,E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText(G,D+f/2,V-W*.4),D+=Q),D+u)}},O=(S,F,N,V,Y,X)=>{let b=V;X==="right"?([...F].reverse().forEach(M=>{b=P(N,M,b,Y,X)}),[...S].reverse().forEach(M=>{b=P(N,M,b,Y,X)})):(F.forEach(E=>{b=P(N,E,b,Y,X)}),S.forEach(E=>{b=P(N,E,b,Y,X)}))};O(s?.upperLeft||[],s?.upperLeftLetter||[],"upperLeft",I-g,L-h/4,"right"),O(s?.upperRight||[],s?.upperRightLetter||[],"upperRight",I+g,L-h/4,"left"),O(s?.lowerLeft||[],s?.lowerLeftLetter||[],"lowerLeft",I-g,L+h/4,"right"),O(s?.lowerRight||[],s?.lowerRightLetter||[],"lowerRight",I+g,L+h/4,"left"),e.restore()}clearToothPositionEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderToothPositionEditor(t,e){if(this.options.mode===l.EditorMode.PRINT)return;(this.isPopup||this.inputModal)&&this.clearToothPositionEditor(),this.isPopup=!0,this.finallyAdd=null,this.toothSurfaceMap={},this.supernumeraryToothMap={};const n=t.toothPositionData;this.inputModal=document.createElement("div"),this.inputModal.className="tooth-position-edit-modal",this.inputModal.setAttribute("editor-component","tooth-position-edit-modal"),this.inputModal.innerHTML=`
307
+ `,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".fetal-heart-position-modal__mask"),r=this.inputModal.querySelector(".fetal-heart-position-modal__container"),s=this.inputModal.querySelector(".fetal-heart-position-modal__close"),a=this.inputModal.querySelector(".btn-cancel"),c=this.inputModal.querySelector(".btn-confirm"),d=()=>{this.clearFetalHeartPositionEditor()};r.addEventListener("click",R=>{R.stopPropagation()}),i.addEventListener("click",d),s.addEventListener("click",d),a.addEventListener("click",d),c.addEventListener("click",R=>{R.preventDefault(),R.stopPropagation();const u=this.inputModal;if(!u)return;const h={a:u.querySelector("#fh-a")?.checked||!1,b:u.querySelector("#fh-b")?.checked||!1,c:u.querySelector("#fh-c")?.checked||!1,d:u.querySelector("#fh-d")?.checked||!1,e:u.querySelector("#fh-e")?.checked||!1,f:u.querySelector("#fh-f")?.checked||!1};this.clearFetalHeartPositionEditor();const g=this.draw.getElementList(),f=e.index;this.draw.spliceElementList(g,f,1);const T={type:"fetalHeartPosition",value:"",fetalHeartData:h};this.draw.spliceElementList(g,f,0,[T]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}}const We={fontSize:12,deciduousFontSize:10,smallFontSize:9,totalHeight:60,toothGap:2,halfGap:8,minLineHalfWidth:50,maxLineHalfWidth:85},mr=["La","B","F","M","I","D","L","P"];class yh{draw;options;inputModal=null;isPopup=!1;finallyAdd=null;toothSurfaceMap={};supernumeraryToothMap={};constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=We,n=this.options.scale,i=t.toothPositionData,s=this.calculateLineHalfWidth(i,n)*2;return{width:Math.min(s,this.draw.getInnerWidth()),height:e.totalHeight*n}}calculateLineHalfWidth(t,e){const{minLineHalfWidth:n,maxLineHalfWidth:i,fontSize:r,deciduousFontSize:s,smallFontSize:a,toothGap:c}=We,d=(T,m,p)=>{let I=0;const L=(P,O)=>`${P}-${O}`;return m.forEach(P=>{const O=L(p,P),S=t?.toothSurfaceMap?.[O]||[],F=t?.supernumeraryToothMap?.[O];I+=s*e*.6,S.length>0&&(I+=a*e*S.length*.5),F&&(I+=s*e*.4),I+=c*e}),T.forEach(P=>{const O=L(p,P),S=t?.toothSurfaceMap?.[O]||[],F=t?.supernumeraryToothMap?.[O];I+=r*e*.6,S.length>0&&(I+=a*e*S.length*.5),F&&(I+=r*e*.4),I+=c*e}),I},R=Math.max(d(t?.upperLeft||[],t?.upperLeftLetter||[],"upperLeft"),d(t?.lowerLeft||[],t?.lowerLeftLetter||[],"lowerLeft")),u=Math.max(d(t?.upperRight||[],t?.upperRightLetter||[],"upperRight"),d(t?.lowerRight||[],t?.lowerRightLetter||[],"lowerRight")),g=Math.max(R,u)/e+We.halfGap;return Math.max(n,Math.min(i,g))*e}render(t){const{ctx:e,x:n,y:i,element:r}=t,s=r.toothPositionData,a=this.options.scale;e.save();const c=We.fontSize*a,d=We.deciduousFontSize*a,R=We.smallFontSize*a,u=We.toothGap*a,h=We.totalHeight*a,g=We.halfGap*a,f=2*a,T=(S,F)=>`${S}-${F}`,m=this.calculateLineHalfWidth(s,a),p=m*2,I=n+m,L=i;e.beginPath(),e.rect(I-m,L-h/2,p,h),e.clip(),e.beginPath(),e.strokeStyle=this.options.defaultColor,e.lineWidth=1*a,e.moveTo(I,L-h/2+10*a),e.lineTo(I,L+h/2-10*a),e.stroke(),e.beginPath(),e.moveTo(I-m,L),e.lineTo(I+m,L),e.stroke();const P=(S,F,N,V,Y)=>{const X=T(S,F),W=s?.toothSurfaceMap?.[X]||[],E=mr.filter(U=>W.includes(U)),C=s?.supernumeraryToothMap?.[X],M=F.toString(),b=typeof F=="string"?d:c;e.font=`${b}px "Microsoft YaHei", sans-serif`,e.textBaseline="middle";let D=N;if(C){e.font=`${b}px "Microsoft YaHei", sans-serif`;const _=e.measureText("(").width,j=e.measureText(M).width;e.font=`${R}px "Microsoft YaHei", sans-serif`;const st=e.measureText("S").width;let it=_+j+_;it+=st+f;let nt=0,et="";return E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,et=E.join(","),nt=e.measureText(et).width+f/2),Y==="right"?(D=N-it,E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText(et,D-nt-f/2,V-b*.4)),e.font=`${b}px "Microsoft YaHei", sans-serif`,e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText("(",D,V),D+=_,e.font=`${R}px "Microsoft YaHei", sans-serif`,C==="Si"&&(e.fillText("S",D,V-b*.4),D+=st+f),e.font=`${b}px "Microsoft YaHei", sans-serif`,e.fillText(M,D,V),D+=j,C==="iS"&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText("S",D,V-b*.4),D+=st),e.font=`${b}px "Microsoft YaHei", sans-serif`,e.fillText(")",D,V),N-it-nt-u):(e.font=`${b}px "Microsoft YaHei", sans-serif`,e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText("(",D,V),D+=_,e.font=`${R}px "Microsoft YaHei", sans-serif`,C==="Si"&&(e.fillText("S",D,V-b*.4),D+=st+f),e.font=`${b}px "Microsoft YaHei", sans-serif`,e.fillText(M,D,V),D+=j,C==="iS"&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText("S",D,V-b*.4),D+=st),e.font=`${b}px "Microsoft YaHei", sans-serif`,e.fillText(")",D,V),D+=_,E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText(et,D+f/2,V-b*.4),D+=nt),D+u)}else{e.font=`${b}px "Microsoft YaHei", sans-serif`;const U=e.measureText(M).width;let Q=0,G="";return E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,G=E.join(","),Q=e.measureText(G).width+f/2,e.font=`${b}px "Microsoft YaHei", sans-serif`),Y==="right"?(D=N-U,E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText(G,D-Q-f/2,V-b*.4),e.font=`${b}px "Microsoft YaHei", sans-serif`),e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText(M,D,V),N-U-Q-u):(e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText(M,D,V),D+=U,E.length>0&&(e.font=`${R}px "Microsoft YaHei", sans-serif`,e.fillText(G,D+f/2,V-b*.4),D+=Q),D+u)}},O=(S,F,N,V,Y,X)=>{let W=V;X==="right"?([...F].reverse().forEach(M=>{W=P(N,M,W,Y,X)}),[...S].reverse().forEach(M=>{W=P(N,M,W,Y,X)})):(F.forEach(E=>{W=P(N,E,W,Y,X)}),S.forEach(E=>{W=P(N,E,W,Y,X)}))};O(s?.upperLeft||[],s?.upperLeftLetter||[],"upperLeft",I-g,L-h/4,"right"),O(s?.upperRight||[],s?.upperRightLetter||[],"upperRight",I+g,L-h/4,"left"),O(s?.lowerLeft||[],s?.lowerLeftLetter||[],"lowerLeft",I-g,L+h/4,"right"),O(s?.lowerRight||[],s?.lowerRightLetter||[],"lowerRight",I+g,L+h/4,"left"),e.restore()}clearToothPositionEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderToothPositionEditor(t,e){if(this.options.mode===l.EditorMode.PRINT)return;(this.isPopup||this.inputModal)&&this.clearToothPositionEditor(),this.isPopup=!0,this.finallyAdd=null,this.toothSurfaceMap={},this.supernumeraryToothMap={};const n=t.toothPositionData;this.inputModal=document.createElement("div"),this.inputModal.className="tooth-position-edit-modal",this.inputModal.setAttribute("editor-component","tooth-position-edit-modal"),this.inputModal.innerHTML=`
308
308
  <div class="tooth-position-modal__mask"></div>
309
309
  <div class="tooth-position-modal__container">
310
310
  <div class="tooth-position-modal__header">
@@ -488,24 +488,24 @@ ${u} `}textToElements(t){const e=[],n=t.split(`
488
488
  <button class="btn-confirm">确认</button>
489
489
  </div>
490
490
  </div>
491
- `,document.body.appendChild(this.inputModal),this.drawDividerLines(),this.initSelectedState(n),this.drawPreview(n),this.bindQuickButtons(),this.bindClickEvents(),this.bindExtraPanelEvents();const i=this.inputModal.querySelector(".tooth-position-modal__mask"),r=this.inputModal.querySelector(".tooth-position-modal__container"),s=this.inputModal.querySelector(".tooth-position-modal__close"),a=this.inputModal.querySelector(".btn-cancel"),c=this.inputModal.querySelector(".btn-confirm"),d=()=>{this.clearToothPositionEditor()};r.addEventListener("click",R=>{R.stopPropagation()}),i.addEventListener("click",d),s.addEventListener("click",d),a.addEventListener("click",d),c.addEventListener("click",R=>{R.preventDefault(),R.stopPropagation();const u=this.inputModal;if(!u)return;const h=this.collectData(u);this.clearToothPositionEditor();const g=this.draw.getElementList(),f=e.index;this.draw.spliceElementList(g,f,1);const T={type:"toothPosition",value:"",toothPositionData:h};this.draw.spliceElementList(g,f,0,[T]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}drawDividerLines(){const t=this.inputModal?.querySelector(".tooth-divider-canvas-h");if(t){const n=t.getContext("2d");n&&(n.strokeStyle="#000",n.lineWidth=2,n.beginPath(),n.moveTo(0,1),n.lineTo(900,1),n.stroke())}const e=this.inputModal?.querySelector(".tooth-divider-canvas-v");if(e){const n=e.getContext("2d");n&&(n.strokeStyle="#000",n.lineWidth=2,n.beginPath(),n.moveTo(1,0),n.lineTo(1,110),n.stroke())}}initSelectedState(t){if(!t)return;const e=this.inputModal;if(!e)return;if(["upperLeft","upperRight","lowerLeft","lowerRight"].forEach(r=>{const s=t[r];s&&s.length>0&&s.forEach(a=>{const c=e.querySelector(`.tooth-grid-number-item[data-position="${r}"][data-value="${a}"]`);c&&c.classList.add("selected")})}),["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"].forEach(r=>{const s=t[r];s&&s.length>0&&s.forEach(a=>{const c=e.querySelector(`.tooth-grid-letter-item[data-position="${r}"][data-value="${a}"]`);c&&c.classList.add("selected")})}),t.toothSurfaceMap&&(this.toothSurfaceMap={...t.toothSurfaceMap}),t.supernumeraryToothMap&&(this.supernumeraryToothMap={...t.supernumeraryToothMap}),t.finallyAdd)this.finallyAdd=t.finallyAdd;else{const r=e.querySelectorAll(".tooth-grid-number-item.selected"),s=e.querySelectorAll(".tooth-grid-letter-item.selected");if(r.length>0){const a=r[r.length-1];this.finallyAdd={position:a.dataset.position||"",value:a.dataset.value||""}}else if(s.length>0){const a=s[s.length-1];this.finallyAdd={position:a.dataset.position||"",value:a.dataset.value||""}}}this.updateExtraPanelSelection()}bindQuickButtons(){const t=this.inputModal;if(!t)return;t.querySelectorAll(".tooth-quick-btn").forEach(n=>{n.addEventListener("click",()=>{const i=n.dataset.action;if(i==="clear"){t.querySelectorAll(".tooth-grid-number-item.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-grid-letter-item.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-quick-btn.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-grid-letter-row").forEach(a=>{a.classList.remove("hidden")}),t.querySelectorAll(".tooth-grid-number-row").forEach(a=>{a.classList.remove("hidden")}),this.finallyAdd=null,this.toothSurfaceMap={},this.supernumeraryToothMap={},t.querySelectorAll(".tooth-surface-item.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-supernumerary-item.selected").forEach(a=>{a.classList.remove("selected")}),this.updatePreview();return}t.querySelectorAll(".tooth-quick-btn.selected").forEach(a=>{a.dataset.action!=="clear"&&a.classList.remove("selected")}),n.classList.add("selected"),t.querySelectorAll(".tooth-grid-number-item.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-grid-letter-item.selected").forEach(a=>{a.classList.remove("selected")}),this.selectByAction(i||""),this.updateVisibilityAfterQuickSelect();const r=t.querySelectorAll(".tooth-grid-number-item.selected"),s=t.querySelectorAll(".tooth-grid-letter-item.selected");if(r.length>0){const a=r[r.length-1];this.finallyAdd={position:a.dataset.position||"",value:a.dataset.value||""}}else if(s.length>0){const a=s[s.length-1];this.finallyAdd={position:a.dataset.position||"",value:a.dataset.value||""}}this.updateExtraPanelSelection(),this.updatePreview()})})}selectByAction(t){const e=this.inputModal;if(!e)return;const n=r=>{r.forEach(s=>{for(let a=1;a<=8;a++){const c=e.querySelector(`.tooth-grid-number-item[data-position="${s}"][data-value="${a}"]`);c&&c.classList.add("selected")}})},i=r=>{const s=["A","B","C","D","E"];r.forEach(a=>{s.forEach(c=>{const d=e.querySelector(`.tooth-grid-letter-item[data-position="${a}"][data-value="${c}"]`);d&&d.classList.add("selected")})})};switch(t){case"allPermanent":n(["upperLeft","upperRight","lowerLeft","lowerRight"]);break;case"upperPermanent":n(["upperLeft","upperRight"]);break;case"lowerPermanent":n(["lowerLeft","lowerRight"]);break;case"upperLeftPermanent":n(["upperLeft"]);break;case"lowerLeftPermanent":n(["lowerLeft"]);break;case"upperRightPermanent":n(["upperRight"]);break;case"lowerRightPermanent":n(["lowerRight"]);break;case"allDeciduous":i(["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"]);break;case"upperDeciduous":i(["upperLeftLetter","upperRightLetter"]);break;case"lowerDeciduous":i(["lowerLeftLetter","lowerRightLetter"]);break;case"upperLeftDeciduous":i(["upperLeftLetter"]);break;case"lowerLeftDeciduous":i(["lowerLeftLetter"]);break;case"upperRightDeciduous":i(["upperRightLetter"]);break;case"lowerRightDeciduous":i(["lowerRightLetter"]);break}}updateVisibilityAfterQuickSelect(){const t=this.inputModal;if(!t)return;const e=t.querySelectorAll(".tooth-grid-number-item.selected"),n=t.querySelectorAll(".tooth-grid-letter-item.selected"),i=t.querySelectorAll(".tooth-grid-letter-row"),r=t.querySelectorAll(".tooth-grid-number-row");e.length>0&&n.length===0?(i.forEach(s=>s.classList.add("hidden")),r.forEach(s=>s.classList.remove("hidden"))):n.length>0&&e.length===0?(r.forEach(s=>s.classList.add("hidden")),i.forEach(s=>s.classList.remove("hidden"))):(i.forEach(s=>s.classList.remove("hidden")),r.forEach(s=>s.classList.remove("hidden")))}bindClickEvents(){const t=this.inputModal;if(!t)return;let e=null;const n=()=>{const a=t.querySelectorAll(".tooth-grid-number-item.selected"),c=t.querySelectorAll(".tooth-grid-letter-item.selected");return a.length>0&&c.length===0?"number":c.length>0&&a.length===0?"letter":a.length>0&&c.length>0?e:null},i=()=>{const a=t.querySelectorAll(".tooth-grid-letter-row"),c=t.querySelectorAll(".tooth-grid-number-row");e==="number"?(a.forEach(d=>d.classList.add("hidden")),c.forEach(d=>d.classList.remove("hidden"))):e==="letter"?(c.forEach(d=>d.classList.add("hidden")),a.forEach(d=>d.classList.remove("hidden"))):(a.forEach(d=>d.classList.remove("hidden")),c.forEach(d=>d.classList.remove("hidden")))};t.querySelectorAll(".tooth-grid-number-item").forEach(a=>{a.addEventListener("click",()=>{const c=a.dataset.position||"",d=a.dataset.value||"";if(a.classList.toggle("selected"),a.classList.contains("selected"))this.finallyAdd={position:c,value:d};else if(this.finallyAdd&&this.finallyAdd.position===c&&this.finallyAdd.value===d){const u=t.querySelectorAll(".tooth-grid-number-item.selected");if(u.length>0){const h=u[u.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const R=n();R!==null?e=R:e=null,e==="number"&&t.querySelectorAll(".tooth-grid-letter-item.selected").forEach(h=>h.classList.remove("selected")),i(),this.updateExtraPanelSelection(),this.updatePreview()})}),t.querySelectorAll(".tooth-grid-letter-item").forEach(a=>{a.addEventListener("click",()=>{const c=a.dataset.position||"",d=a.dataset.value||"";if(a.classList.toggle("selected"),a.classList.contains("selected"))this.finallyAdd={position:c,value:d};else if(this.finallyAdd&&this.finallyAdd.position===c&&this.finallyAdd.value===d){const u=t.querySelectorAll(".tooth-grid-letter-item.selected");if(u.length>0){const h=u[u.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const R=n();R!==null?e=R:e=null,e==="letter"&&t.querySelectorAll(".tooth-grid-number-item.selected").forEach(h=>h.classList.remove("selected")),i(),this.updateExtraPanelSelection(),this.updatePreview()})})}updatePreview(){const t=this.inputModal;if(!t)return;const e=this.collectData(t);this.drawPreview(e)}collectData(t){const e={upperLeft:[],upperRight:[],lowerLeft:[],lowerRight:[],upperLeftLetter:[],upperRightLetter:[],lowerLeftLetter:[],lowerRightLetter:[]};return["upperLeft","upperRight","lowerLeft","lowerRight"].forEach(r=>{t.querySelectorAll(`.tooth-grid-number-item[data-position="${r}"].selected`).forEach(a=>{const c=parseInt(a.dataset.value||"0");c>0&&e[r].push(c)})}),["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"].forEach(r=>{t.querySelectorAll(`.tooth-grid-letter-item[data-position="${r}"].selected`).forEach(a=>{const c=a.dataset.value;c&&e[r].push(c)})}),this.finallyAdd&&(e.finallyAdd=this.finallyAdd),Object.keys(this.toothSurfaceMap).length>0&&(e.toothSurfaceMap={...this.toothSurfaceMap}),Object.keys(this.supernumeraryToothMap).length>0&&(e.supernumeraryToothMap={...this.supernumeraryToothMap}),e}drawPreview(t){const e=this.inputModal?.querySelector(".tooth-preview-grid");if(!e)return;const n=(R,u)=>`${R}-${u}`,i=(R,u)=>{const h=n(R,u),g=this.toothSurfaceMap[h]||[],f=gr.filter(P=>g.includes(P)),T=this.supernumeraryToothMap[h],p=u.toString(),I=typeof u=="string"?"tooth-preview-tooth-value tooth-preview-tooth-value--deciduous":"tooth-preview-tooth-value",L=f.length>0?`<sup class="tooth-preview-surface">${f.join(",")}</sup>`:"";if(T){const P='<sup class="tooth-preview-supernumerary">S</sup>';return T==="Si"?`<span class="tooth-preview-tooth">
491
+ `,document.body.appendChild(this.inputModal),this.drawDividerLines(),this.initSelectedState(n),this.drawPreview(n),this.bindQuickButtons(),this.bindClickEvents(),this.bindExtraPanelEvents();const i=this.inputModal.querySelector(".tooth-position-modal__mask"),r=this.inputModal.querySelector(".tooth-position-modal__container"),s=this.inputModal.querySelector(".tooth-position-modal__close"),a=this.inputModal.querySelector(".btn-cancel"),c=this.inputModal.querySelector(".btn-confirm"),d=()=>{this.clearToothPositionEditor()};r.addEventListener("click",R=>{R.stopPropagation()}),i.addEventListener("click",d),s.addEventListener("click",d),a.addEventListener("click",d),c.addEventListener("click",R=>{R.preventDefault(),R.stopPropagation();const u=this.inputModal;if(!u)return;const h=this.collectData(u);this.clearToothPositionEditor();const g=this.draw.getElementList(),f=e.index;this.draw.spliceElementList(g,f,1);const T={type:"toothPosition",value:"",toothPositionData:h};this.draw.spliceElementList(g,f,0,[T]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}drawDividerLines(){const t=this.inputModal?.querySelector(".tooth-divider-canvas-h");if(t){const n=t.getContext("2d");n&&(n.strokeStyle="#000",n.lineWidth=2,n.beginPath(),n.moveTo(0,1),n.lineTo(900,1),n.stroke())}const e=this.inputModal?.querySelector(".tooth-divider-canvas-v");if(e){const n=e.getContext("2d");n&&(n.strokeStyle="#000",n.lineWidth=2,n.beginPath(),n.moveTo(1,0),n.lineTo(1,110),n.stroke())}}initSelectedState(t){if(!t)return;const e=this.inputModal;if(!e)return;if(["upperLeft","upperRight","lowerLeft","lowerRight"].forEach(r=>{const s=t[r];s&&s.length>0&&s.forEach(a=>{const c=e.querySelector(`.tooth-grid-number-item[data-position="${r}"][data-value="${a}"]`);c&&c.classList.add("selected")})}),["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"].forEach(r=>{const s=t[r];s&&s.length>0&&s.forEach(a=>{const c=e.querySelector(`.tooth-grid-letter-item[data-position="${r}"][data-value="${a}"]`);c&&c.classList.add("selected")})}),t.toothSurfaceMap&&(this.toothSurfaceMap={...t.toothSurfaceMap}),t.supernumeraryToothMap&&(this.supernumeraryToothMap={...t.supernumeraryToothMap}),t.finallyAdd)this.finallyAdd=t.finallyAdd;else{const r=e.querySelectorAll(".tooth-grid-number-item.selected"),s=e.querySelectorAll(".tooth-grid-letter-item.selected");if(r.length>0){const a=r[r.length-1];this.finallyAdd={position:a.dataset.position||"",value:a.dataset.value||""}}else if(s.length>0){const a=s[s.length-1];this.finallyAdd={position:a.dataset.position||"",value:a.dataset.value||""}}}this.updateExtraPanelSelection()}bindQuickButtons(){const t=this.inputModal;if(!t)return;t.querySelectorAll(".tooth-quick-btn").forEach(n=>{n.addEventListener("click",()=>{const i=n.dataset.action;if(i==="clear"){t.querySelectorAll(".tooth-grid-number-item.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-grid-letter-item.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-quick-btn.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-grid-letter-row").forEach(a=>{a.classList.remove("hidden")}),t.querySelectorAll(".tooth-grid-number-row").forEach(a=>{a.classList.remove("hidden")}),this.finallyAdd=null,this.toothSurfaceMap={},this.supernumeraryToothMap={},t.querySelectorAll(".tooth-surface-item.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-supernumerary-item.selected").forEach(a=>{a.classList.remove("selected")}),this.updatePreview();return}t.querySelectorAll(".tooth-quick-btn.selected").forEach(a=>{a.dataset.action!=="clear"&&a.classList.remove("selected")}),n.classList.add("selected"),t.querySelectorAll(".tooth-grid-number-item.selected").forEach(a=>{a.classList.remove("selected")}),t.querySelectorAll(".tooth-grid-letter-item.selected").forEach(a=>{a.classList.remove("selected")}),this.selectByAction(i||""),this.updateVisibilityAfterQuickSelect();const r=t.querySelectorAll(".tooth-grid-number-item.selected"),s=t.querySelectorAll(".tooth-grid-letter-item.selected");if(r.length>0){const a=r[r.length-1];this.finallyAdd={position:a.dataset.position||"",value:a.dataset.value||""}}else if(s.length>0){const a=s[s.length-1];this.finallyAdd={position:a.dataset.position||"",value:a.dataset.value||""}}this.updateExtraPanelSelection(),this.updatePreview()})})}selectByAction(t){const e=this.inputModal;if(!e)return;const n=r=>{r.forEach(s=>{for(let a=1;a<=8;a++){const c=e.querySelector(`.tooth-grid-number-item[data-position="${s}"][data-value="${a}"]`);c&&c.classList.add("selected")}})},i=r=>{const s=["A","B","C","D","E"];r.forEach(a=>{s.forEach(c=>{const d=e.querySelector(`.tooth-grid-letter-item[data-position="${a}"][data-value="${c}"]`);d&&d.classList.add("selected")})})};switch(t){case"allPermanent":n(["upperLeft","upperRight","lowerLeft","lowerRight"]);break;case"upperPermanent":n(["upperLeft","upperRight"]);break;case"lowerPermanent":n(["lowerLeft","lowerRight"]);break;case"upperLeftPermanent":n(["upperLeft"]);break;case"lowerLeftPermanent":n(["lowerLeft"]);break;case"upperRightPermanent":n(["upperRight"]);break;case"lowerRightPermanent":n(["lowerRight"]);break;case"allDeciduous":i(["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"]);break;case"upperDeciduous":i(["upperLeftLetter","upperRightLetter"]);break;case"lowerDeciduous":i(["lowerLeftLetter","lowerRightLetter"]);break;case"upperLeftDeciduous":i(["upperLeftLetter"]);break;case"lowerLeftDeciduous":i(["lowerLeftLetter"]);break;case"upperRightDeciduous":i(["upperRightLetter"]);break;case"lowerRightDeciduous":i(["lowerRightLetter"]);break}}updateVisibilityAfterQuickSelect(){const t=this.inputModal;if(!t)return;const e=t.querySelectorAll(".tooth-grid-number-item.selected"),n=t.querySelectorAll(".tooth-grid-letter-item.selected"),i=t.querySelectorAll(".tooth-grid-letter-row"),r=t.querySelectorAll(".tooth-grid-number-row");e.length>0&&n.length===0?(i.forEach(s=>s.classList.add("hidden")),r.forEach(s=>s.classList.remove("hidden"))):n.length>0&&e.length===0?(r.forEach(s=>s.classList.add("hidden")),i.forEach(s=>s.classList.remove("hidden"))):(i.forEach(s=>s.classList.remove("hidden")),r.forEach(s=>s.classList.remove("hidden")))}bindClickEvents(){const t=this.inputModal;if(!t)return;let e=null;const n=()=>{const a=t.querySelectorAll(".tooth-grid-number-item.selected"),c=t.querySelectorAll(".tooth-grid-letter-item.selected");return a.length>0&&c.length===0?"number":c.length>0&&a.length===0?"letter":a.length>0&&c.length>0?e:null},i=()=>{const a=t.querySelectorAll(".tooth-grid-letter-row"),c=t.querySelectorAll(".tooth-grid-number-row");e==="number"?(a.forEach(d=>d.classList.add("hidden")),c.forEach(d=>d.classList.remove("hidden"))):e==="letter"?(c.forEach(d=>d.classList.add("hidden")),a.forEach(d=>d.classList.remove("hidden"))):(a.forEach(d=>d.classList.remove("hidden")),c.forEach(d=>d.classList.remove("hidden")))};t.querySelectorAll(".tooth-grid-number-item").forEach(a=>{a.addEventListener("click",()=>{const c=a.dataset.position||"",d=a.dataset.value||"";if(a.classList.toggle("selected"),a.classList.contains("selected"))this.finallyAdd={position:c,value:d};else if(this.finallyAdd&&this.finallyAdd.position===c&&this.finallyAdd.value===d){const u=t.querySelectorAll(".tooth-grid-number-item.selected");if(u.length>0){const h=u[u.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const R=n();R!==null?e=R:e=null,e==="number"&&t.querySelectorAll(".tooth-grid-letter-item.selected").forEach(h=>h.classList.remove("selected")),i(),this.updateExtraPanelSelection(),this.updatePreview()})}),t.querySelectorAll(".tooth-grid-letter-item").forEach(a=>{a.addEventListener("click",()=>{const c=a.dataset.position||"",d=a.dataset.value||"";if(a.classList.toggle("selected"),a.classList.contains("selected"))this.finallyAdd={position:c,value:d};else if(this.finallyAdd&&this.finallyAdd.position===c&&this.finallyAdd.value===d){const u=t.querySelectorAll(".tooth-grid-letter-item.selected");if(u.length>0){const h=u[u.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const R=n();R!==null?e=R:e=null,e==="letter"&&t.querySelectorAll(".tooth-grid-number-item.selected").forEach(h=>h.classList.remove("selected")),i(),this.updateExtraPanelSelection(),this.updatePreview()})})}updatePreview(){const t=this.inputModal;if(!t)return;const e=this.collectData(t);this.drawPreview(e)}collectData(t){const e={upperLeft:[],upperRight:[],lowerLeft:[],lowerRight:[],upperLeftLetter:[],upperRightLetter:[],lowerLeftLetter:[],lowerRightLetter:[]};return["upperLeft","upperRight","lowerLeft","lowerRight"].forEach(r=>{t.querySelectorAll(`.tooth-grid-number-item[data-position="${r}"].selected`).forEach(a=>{const c=parseInt(a.dataset.value||"0");c>0&&e[r].push(c)})}),["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"].forEach(r=>{t.querySelectorAll(`.tooth-grid-letter-item[data-position="${r}"].selected`).forEach(a=>{const c=a.dataset.value;c&&e[r].push(c)})}),this.finallyAdd&&(e.finallyAdd=this.finallyAdd),Object.keys(this.toothSurfaceMap).length>0&&(e.toothSurfaceMap={...this.toothSurfaceMap}),Object.keys(this.supernumeraryToothMap).length>0&&(e.supernumeraryToothMap={...this.supernumeraryToothMap}),e}drawPreview(t){const e=this.inputModal?.querySelector(".tooth-preview-grid");if(!e)return;const n=(R,u)=>`${R}-${u}`,i=(R,u)=>{const h=n(R,u),g=this.toothSurfaceMap[h]||[],f=mr.filter(P=>g.includes(P)),T=this.supernumeraryToothMap[h],m=u.toString(),I=typeof u=="string"?"tooth-preview-tooth-value tooth-preview-tooth-value--deciduous":"tooth-preview-tooth-value",L=f.length>0?`<sup class="tooth-preview-surface">${f.join(",")}</sup>`:"";if(T){const P='<sup class="tooth-preview-supernumerary">S</sup>';return T==="Si"?`<span class="tooth-preview-tooth">
492
492
  <span class="tooth-preview-tooth-bracket">(</span>
493
493
  ${P}
494
- <span class="${I}">${p}</span>
494
+ <span class="${I}">${m}</span>
495
495
  <span class="tooth-preview-tooth-bracket">)</span>
496
496
  ${L}
497
497
  </span>`:`<span class="tooth-preview-tooth">
498
498
  <span class="tooth-preview-tooth-bracket">(</span>
499
- <span class="${I}">${p}</span>
499
+ <span class="${I}">${m}</span>
500
500
  ${P}
501
501
  <span class="tooth-preview-tooth-bracket">)</span>
502
502
  ${L}
503
503
  </span>`}else return`<span class="tooth-preview-tooth">
504
- <span class="${I}">${p}</span>
504
+ <span class="${I}">${m}</span>
505
505
  ${L}
506
- </span>`},r=(R,u,h)=>{const g=[];return u.forEach(f=>{g.push(i(h,f))}),R.forEach(f=>{g.push(i(h,f))}),g.join(" ")},s=e.querySelector(".tooth-preview-upper-left"),a=e.querySelector(".tooth-preview-upper-right"),c=e.querySelector(".tooth-preview-lower-left"),d=e.querySelector(".tooth-preview-lower-right");s&&(s.innerHTML=r(t?.upperLeft||[],t?.upperLeftLetter||[],"upperLeft")),a&&(a.innerHTML=r(t?.upperRight||[],t?.upperRightLetter||[],"upperRight")),c&&(c.innerHTML=r(t?.lowerLeft||[],t?.lowerLeftLetter||[],"lowerLeft")),d&&(d.innerHTML=r(t?.lowerRight||[],t?.lowerRightLetter||[],"lowerRight"))}bindExtraPanelEvents(){const t=this.inputModal;if(!t)return;t.querySelectorAll(".tooth-surface-item").forEach(i=>{i.addEventListener("click",()=>{if(!this.finallyAdd)return;const r=i.dataset.surface;if(!r)return;const s=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.toothSurfaceMap[s]||(this.toothSurfaceMap[s]=[]);const a=this.toothSurfaceMap[s],c=a.indexOf(r);c>-1?(a.splice(c,1),i.classList.remove("selected")):(a.push(r),i.classList.add("selected")),this.updatePreview()})}),t.querySelectorAll(".tooth-supernumerary-item").forEach(i=>{i.addEventListener("click",()=>{if(!this.finallyAdd)return;const r=i.dataset.supernumerary;if(!r)return;const s=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.supernumeraryToothMap[s]===r?(delete this.supernumeraryToothMap[s],i.classList.remove("selected")):(t.querySelectorAll(".tooth-supernumerary-item").forEach(a=>a.classList.remove("selected")),this.supernumeraryToothMap[s]=r,i.classList.add("selected")),this.updatePreview()})}),this.updateExtraPanelSelection()}updateExtraPanelSelection(){const t=this.inputModal;if(!t||!this.finallyAdd)return;const e=`${this.finallyAdd.position}-${this.finallyAdd.value}`,n=this.toothSurfaceMap[e]||[];t.querySelectorAll(".tooth-surface-item").forEach(r=>{const s=r.dataset.surface;n.includes(s||"")?r.classList.add("selected"):r.classList.remove("selected")});const i=this.supernumeraryToothMap[e];t.querySelectorAll(".tooth-supernumerary-item").forEach(r=>{r.dataset.supernumerary===i?r.classList.add("selected"):r.classList.remove("selected")})}}const fr='(function(){"use strict";function f(i){let s="",n=0;for(;n<i.length;){const t=i[n];if(t.type==="table"){if(t.trList)for(let l=0;l<t.trList.length;l++){const o=t.trList[l];for(let e=0;e<o.tdList.length;e++){const r=o.tdList[e];s+=f(r.value)}}}else if(t.type==="hyperlink"){const l=t.hyperlinkId,o=[];for(;n<i.length;){const e=i[n];if(l!==e.hyperlinkId){n--;break}delete e.type,o.push(e),n++}s+=f(o)}else if(t.controlId){if(!t.control?.hide){const l=t.controlId,o=[];for(;n<i.length;){const e=i[n];if(l!==e.controlId){n--;break}e.controlComponent==="value"&&(delete e.controlId,o.push(e)),n++}s+=f(o)}}else(!t.type||t.type==="text")&&!t.area?.hide&&(s+=t.value);n++}return s}function p(i){const s=[],n=/[0-9]/,t=/[A-Za-z]/,l=/\\s/;let o=!1,e=!1,r="";function a(){r&&(s.push(r),r="")}for(const c of i)t.test(c)?(o||a(),r+=c,o=!0,e=!1):n.test(c)?(e||a(),r+=c,o=!1,e=!0):(a(),o=!1,e=!1,l.test(c)||s.push(c));return a(),s}onmessage=i=>{const s=i.data,t=f(s).replace(new RegExp("^​"),"").replace(new RegExp("​","g"),`\n`),l=p(t);postMessage(l.length)}})();\n',Tr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",fr],{type:"text/javascript;charset=utf-8"});function Ch(o){let t;try{if(t=Tr&&(self.URL||self.webkitURL).createObjectURL(Tr),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(fr),{name:o?.name})}}const mr=`(function(){"use strict";const v={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6},E=["text","hyperlink","subscript","superscript","control","date","label"],L="​";function m(c){return!c.type||E.includes(c.type)}function I(c){const{elementList:r,positionList:d}=c,p=[];let u=0;for(;u<r.length;){const t=r[u],l=(e,n,s)=>{const g=e.titleId,a={type:"title",value:"",level:e.level,titleId:g,pageNo:d[u].pageNo},o=[];for(;s<n.length;){const i=n[s];if(g!==i.titleId){s--;break}o.push(i),s++}return a.value=o.filter(i=>m(i)).map(i=>i.value).join("").replace(new RegExp(L,"g"),""),{position:s,titleElement:a}};if(t.titleId){const{position:e,titleElement:n}=l(t,r,u);u=e,p.push(n)}if(t.type==="table"){const e=t.trList;for(let n=0;n<e.length;n++){const s=e[n];for(let g=0;g<s.tdList.length;g++){const a=s.tdList[g].value;if(a.length>1){let o=1;for(;o<a.length;){if(a[o]?.titleId){const{titleElement:i,position:N}=l(a[o],a,o);p.push(i),o=N}o++}}}}}u++}if(!p.length)return null;const f=(t,l)=>{const e=l.subCatalog[l.subCatalog.length-1],n=v[e?.level],s=v[t.level];e&&s>n?f(t,e):l.subCatalog.push({id:t.titleId,name:t.value,level:t.level,pageNo:t.pageNo,subCatalog:[]})},h=[];for(let t=0;t<p.length;t++){const l=p[t],e=h[h.length-1],n=v[e?.level],s=v[l.level];e&&s>n?f(l,e):h.push({id:l.titleId,name:l.value,level:l.level,pageNo:l.pageNo,subCatalog:[]})}return h}onmessage=c=>{const r=c.data,d=I(r);postMessage(d)}})();
507
- `,pr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",mr],{type:"text/javascript;charset=utf-8"});function Sh(o){let t;try{if(t=pr&&(self.URL||self.webkitURL).createObjectURL(pr),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(mr),{name:o?.name})}}const Lr=`(function(){"use strict";function u(e){const t=[];for(const s of e){if(s.type==="table"){const o=s.trList;for(let n=0;n<o.length;n++){const c=o[n];for(let r=0;r<c.tdList.length;r++){const i=c.tdList[r];t.push(...u(i.value))}}}if(s.groupIds)for(const o of s.groupIds)t.includes(o)||t.push(o)}return t}onmessage=e=>{const t=e.data,s=u(t);postMessage(s)}})();
508
- `,Ir=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Lr],{type:"text/javascript;charset=utf-8"});function Eh(o){let t;try{if(t=Ir&&(self.URL||self.webkitURL).createObjectURL(Ir),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Lr),{name:o?.name})}}const Pr='(function(){"use strict";var m=(e=>(e.HALF="half",e.ONE_THIRD="one-third",e.QUARTER="quarter",e))(m||{}),M=(e=>(e.ARABIC="arabic",e.CHINESE="chinese",e))(M||{});const K="​";m.HALF+"",1/2,m.ONE_THIRD+"",1/3,m.QUARTER+"",1/4;function F(e){if(typeof structuredClone=="function")return structuredClone(e);if(!e||typeof e!="object")return e;let I={};return Array.isArray(e)?I=e.map(f=>F(f)):Object.keys(e).forEach(f=>{I[f]=F(e[f])}),I}function D(e,I){const f={};for(const L in e)I.includes(L)&&(f[L]=e[L]);return f}function ee(e,I){return e.length!==I.length?!1:!e.some(f=>!I.includes(f))}var o=(e=>(e.TEXT="text",e.TEXTFIELD="TextField",e.BUTTON="button",e.IMAGE="image",e.TABLE="table",e.HYPERLINK="hyperlink",e.SUPERSCRIPT="superscript",e.SUBSCRIPT="subscript",e.SEPARATOR="separator",e.PAGE_BREAK="pageBreak",e.CONTROL="control",e.AREA="area",e.CHECKBOX="checkbox",e.RADIO="radio",e.LATEX="latex",e.TAB="tab",e.DATE="date",e.BLOCK="block",e.TITLE="title",e.LIST="list",e.SPLIT_TAG="splitTag",e.LABEL="label",e.MENSTRUAL_HISTORY="menstrualHistory",e.FETAL_HEART_POSITION="fetalHeartPosition",e.TOOTH_POSITION="toothPosition",e.SPECIAL_SYMBOLS="specialSymbols",e.MACRO="macro",e.CUSTOM_MACRO="customMacro",e.REUSABLE_ITEM="reusableItem",e.SUB_TEMPLATE="subTemplate",e))(o||{});const y=["rowFlex","rowMargin"],te=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","rowMargin","dashArray","trList","tdPadding","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig","templateId","subTemplateExpanded"],oe=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],w=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"];o.TEXT,o.HYPERLINK,o.SUBSCRIPT,o.SUPERSCRIPT,o.CONTROL,o.DATE,o.IMAGE,o.LATEX,o.BLOCK,o.PAGE_BREAK,o.SEPARATOR,o.TABLE,o.TITLE,o.LIST;var Y=(e=>(e.UL="ul",e.OL="ol",e))(Y||{}),k=(e=>(e.DISC="disc",e.CIRCLE="circle",e.SQUARE="square",e.CHECKBOX="checkbox",e))(k||{}),_=(e=>(e.DISC="disc",e.CIRCLE="circle",e.SQUARE="square",e.DECIMAL="decimal",e.CHECKBOX="checkbox",e))(_||{});k.DISC+"",k.CIRCLE+"",k.SQUARE+"",k.CHECKBOX+"",Y.OL+"",Y.UL+"",_.DISC+"",_.CIRCLE+"",_.SQUARE+"",_.DECIMAL+"",_.CHECKBOX+"";var R=(e=>(e.FIRST="first",e.SECOND="second",e.THIRD="third",e.FOURTH="fourth",e.FIFTH="fifth",e.SIXTH="sixth",e))(R||{});R.FIRST+"",R.SECOND+"",R.THIRD+"",R.FOURTH+"",R.FIFTH+"",R.SIXTH+"",R.FIRST+"",R.SECOND+"",R.THIRD+"",R.FOURTH+"",R.FIFTH+"",R.SIXTH+"",R.FIRST,R.SECOND,R.THIRD,R.FOURTH,R.FIFTH,R.SIXTH;var v=(e=>(e.TEXT="text",e.SELECT="select",e.CHECKBOX="checkbox",e.RADIO="radio",e.DATE="date",e.NUMBER="number",e.TEXTFIELD="TextField",e.BUTTON="button",e.MENSTRUAL_HISTORY="menstrualHistory",e))(v||{}),c=(e=>(e.PREFIX="prefix",e.POSTFIX="postfix",e.PRE_TEXT="preText",e.PRETEXTFIX="preTextFix",e.PRETEXTFIX_TEXT="preTextFixText",e.POSTTEXTFIX="postTextFix",e.POSTTEXTFIX_TEXT="postTextFixText",e.POST_TEXT="postText",e.PLACEHOLDER="placeholder",e.TEXTFIXLABEL="textFixLabel",e.VALUE="value",e.DELETEPERSON="deletePerson",e.CHECKBOX="checkbox",e.RADIO="radio",e.UNDERLINE="underline",e))(c||{}),Q=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e.ALIGNMENT="alignment",e.JUSTIFY="justify",e))(Q||{}),q=(e=>(e.CONTAIN="contain",e.COVER="cover",e))(q||{}),W=(e=>(e.REPEAT="repeat",e.NO_REPEAT="no-repeat",e.REPEAT_X="repeat-x",e.REPEAT_Y="repeat-y",e))(W||{});q.COVER,W.NO_REPEAT;var z=(e=>(e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom",e))(z||{});z.BOTTOM,m.HALF,m.HALF,Q.CENTER,M.ARABIC,z.BOTTOM;var Z=(e=>(e.TEXT="text",e.IMAGE="image",e))(Z||{});Z.TEXT,M.ARABIC;var j=(e=>(e.PAGE="page",e.CONTINUITY="continuity",e))(j||{});j.CONTINUITY;function ne(e,I){const f=Object.keys(e),L=Object.keys(I);if(f.length!==L.length)return!1;for(let S=0;S<f.length;S++){const C=f[S];if(C!=="value"&&!(C==="groupIds"&&Array.isArray(e[C])&&Array.isArray(I[C])&&ee(e[C],I[C]))&&e[C]!==I[C])return!1}return!0}function N(e,I={}){const{extraPickAttrs:f}=I,L=[...te];f&&L.push(...f);const S={value:e?.value===K?`\n`:e?.value};return e&&L.forEach(C=>{const T=e[C];T!==void 0&&(S[C]=T)}),S}function P(e,I={}){const{extraPickAttrs:f,isClassifyArea:L=!1,isClone:S=!0,editorOptions:C}=I,T=(S?F(e):e).filter(t=>t.type!==o.SPLIT_TAG),B=[];let l=0;for(;l<T.length;){let t=T[l];if(l===0&&t.value===K&&!t.listId&&(!t.type||t.type===o.TEXT)){l++;continue}if(t.areaId){const r=t.areaId,O=t.area,E=[];for(;l<T.length;){const i=T[l];if(r!==i.areaId){l--;break}delete i.area,delete i.areaId,E.push(i),l++}const a=P(E,I);if(L){const i={type:o.AREA,value:"",areaId:r,area:O};i.valueList=a,t=i}else{B.splice(l,0,...a);continue}}else if(t.titleId&&t.level){const r=t.titleId;if(r){const O=t.level,E={type:o.TITLE,title:t.title,titleId:r,value:"",level:O},a=[];for(;l<T.length;){const i=T[l];if(r!==i.titleId){l--;break}delete i.level,delete i.title,a.push(i),l++}E.valueList=P(a,I),t=E}}else if(t.listId&&t.listType){const r=t.listId;if(r){const O=t.listType,E=t.listStyle,a=t?.label,i={type:o.LIST,value:"",label:a||"",listId:r,listType:O,listStyle:E},d=[];for(;l<T.length;){const s=T[l];if(r!==s.listId){l--;break}delete s.listType,delete s.listStyle,d.push(s),l++}i.valueList=P(d,I),t=i}}else if(t.type===o.TABLE){if(t.pagingId){let r=l+1,O=0;for(;r<T.length;){const E=T[r];if(E.pagingId===t.pagingId){t.height+=E.height;const a=E.trList.filter(i=>!i.pagingRepeat).filter(i=>(i.tdList=i.tdList.filter(d=>{if(d.originalId){for(let s=0;s<t.trList.length;s++){const u=t.trList[s].tdList.find(({id:n})=>n===d.originalId);if(u){d.value[0]?.type===o.SPLIT_TAG&&d.value.splice(0,1),u.value.push(...d.value),u.rowspan=u.originalRowspan??u.rowspan;break}}return!1}return!0}),!i.originalId));t.trList.push(...a),t.trList?.forEach(i=>i.minHeight=i.originalMinHeight??i.minHeight),r++,O++}else break}l+=O}if(t.trList)for(let r=0;r<t.trList.length;r++){const O=t.trList[r];delete O.id;for(let E=0;E<O.tdList.length;E++){const a=O.tdList[E],i={colspan:a.colspan,rowspan:a.rowspan,value:P(a.value,{...I,isClassifyArea:!1})};oe.forEach(d=>{const s=a[d];s!==void 0&&(i[d]=s)}),O.tdList[E]=i}}}else if(t.type===o.HYPERLINK){const r=t.hyperlinkId;if(r){const O={type:o.HYPERLINK,value:"",url:t.url},E=[];for(;l<T.length;){const a=T[l];if(r!==a.hyperlinkId){l--;break}delete a.type,delete a.url,E.push(a),l++}O.valueList=P(E,I),t=O}}else if(t.type===o.DATE){const r=t.dateId;if(r){const O={type:o.DATE,value:"",dateFormat:t.dateFormat},E=[];for(;l<T.length;){const a=T[l];if(r!==a.dateId){l--;break}delete a.type,delete a.dateFormat,E.push(a),l++}O.valueList=P(E,I),t=O}}else if(t.type!==o.BUTTON){if(t.controlId){const r=t.controlId;if(!(t.controlComponent===c.PREFIX||t.controlComponent===c.PRETEXTFIX||t.controlComponent===c.PRETEXTFIX_TEXT)&&t.controlComponent===c.VALUE){if(t.type===o.MENSTRUAL_HISTORY||t.type===o.FETAL_HEART_POSITION||t.type===o.TOOTH_POSITION||t.type===o.MACRO||t.type===o.CUSTOM_MACRO||t.type===o.REUSABLE_ITEM||t.type===o.LIST||t.type===o.SPECIAL_SYMBOLS){let d=!1;for(let s=l-1;s>=0;s--){const p=T[s],u=p.controlComponent===c.PREFIX||p.controlComponent===c.PRETEXTFIX||p.controlComponent===c.PRETEXTFIX_TEXT;if(p.controlId===r&&u){d=!0;break}if(p.controlId!==r)break}if(!d){const s=F(t);delete s.controlId,delete s.control,delete s.controlComponent,delete s.originControlId,B.push(s),l++;continue}}l++;continue}if(t.controlComponent===c.PLACEHOLDER||t.controlComponent===c.POSTFIX||t.controlComponent===c.POSTTEXTFIX||t.controlComponent===c.POSTTEXTFIX_TEXT||t.controlComponent===c.POST_TEXT||t.controlComponent===c.PRE_TEXT||t.controlComponent===c.CHECKBOX||t.controlComponent===c.RADIO){l++;continue}const E=(i,d,s,p)=>{if(p===v.CHECKBOX||p===v.RADIO){let n=-1;for(let g=i;g<T.length&&T[g].controlId===d;g++)n=g;return n}const u=s?[c.POSTTEXTFIX,c.POSTTEXTFIX_TEXT]:[c.POSTFIX];for(let n=i;n<T.length;n++){const g=T[n];if(g.controlId===d&&u.includes(g.controlComponent))return n}return-1},a=(i,d,s)=>{const p=[];let u=i;for(;u<=d;){const n=T[u];if(n.controlId&&n.controlId!==s&&n.control){const A=n.control?.type,x=A===v.TEXTFIELD,h=x?c.PRETEXTFIX:c.PREFIX,H=n.controlComponent===h,b=A===v.CHECKBOX||A===v.RADIO;if(H||b&&(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO)){const X=E(u+1,n.controlId,x,A);if(X!==-1){const V=T.slice(u,X+1).map(le=>{const $=F(le);return delete $.originControlId,$}),U=P(V,I);U.length>0&&p.push(U[0]),u=X+1;continue}}}if(!(n.controlId===s&&(n.controlComponent===c.VALUE||!n.controlComponent)&&(!n.originControlId||n.originControlId===s)||n.originControlId===s&&n.controlComponent===c.VALUE||n.controlId===s&&(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO)&&!n.originControlId)){u++;continue}if(n.type===o.MENSTRUAL_HISTORY||n.type===o.FETAL_HEART_POSITION||n.type===o.TOOTH_POSITION||n.type===o.MACRO||n.type===o.CUSTOM_MACRO||n.type===o.REUSABLE_ITEM||n.type===o.LIST||n.type===o.SPECIAL_SYMBOLS){const A=F(n);delete A.controlId,delete A.control,delete A.controlComponent,delete A.originControlId,p.push(A),u++;continue}if(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO){p.push(F(n)),u++;continue}const J=t.control?.type;if(J===v.CHECKBOX||J===v.RADIO){let A=u-1,x=!1;for(;A>=i-1;){const h=T[A];if(h.controlId===s&&!h.originControlId)if(h.controlComponent===c.CHECKBOX){x=h.checkbox?.value===!0;break}else if(h.controlComponent===c.RADIO){x=h.radio?.value===!0;break}else if(h.controlComponent===c.VALUE){A--;continue}else break;A--}if(x){const h={value:n.value||""},H=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const b of H){const X=n[b];if(X!==void 0){if(b==="color"&&C){const V=C.control?.bracketColor,U=C.control?.placeholderColor;if(X===V||X===U)continue}h[b]=X}}p.push(h)}}else{const A={value:n.value||""},x=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const h of x){const H=n[h];if(H!==void 0){if(h==="color"&&C){const b=C.control?.bracketColor,X=C.control?.placeholderColor;if(H===b||H===X)continue}A[h]=H}}p.push(A)}u++}return p};if(t.controlComponent===c.PREFIX){const i=t.control?.type===v.TEXTFIELD,d=E(l+1,r,i);if(d!==-1){const s=a(l+1,d-1,r),p=D(t,w),u={...t.control,...p,value:s},n={...D(t,y),type:o.CONTROL,value:"",control:u,controlId:r};t=N(n,{extraPickAttrs:f}),l=d}}if(t.controlComponent===c.PRETEXTFIX){const i=E(l+1,r,!0);if(i!==-1){const d=a(l+1,i-1,r),s=D(t,w),p={...t.control,...s,value:d},u={...D(t,y),type:o.CONTROL,value:"",control:p,controlId:r};t=N(u,{extraPickAttrs:f}),l=i}}if(t.controlComponent===c.PRETEXTFIX_TEXT){const i=E(l+1,r,!0);if(i!==-1){const d=a(l+1,i-1,r),s=D(t,w),p={...t.control,...s,value:d},u={...D(t,y),type:o.CONTROL,value:"",control:p,controlId:r};t=N(u,{extraPickAttrs:f}),l=i}}}}const G=N(t,{extraPickAttrs:f});if(!t.type||t.type===o.TEXT||t.type===o.SUBSCRIPT||t.type===o.SUPERSCRIPT)for(;l<T.length;){const r=T[l+1];if(l++,r&&ne(G,N(r,{extraPickAttrs:f}))){const O=r.value===K?`\n`:r.value;G.value+=O}else break}else l++;B.push(G)}return B}onmessage=e=>{const I=e.data,{options:f,data:L}=I,{extraPickAttrs:S=[]}=f||{},C={header:P(L.header,{extraPickAttrs:S,isClone:!1}),main:P(L.main,{extraPickAttrs:S,isClassifyArea:!0,isClone:!1}),footer:P(L.footer,{extraPickAttrs:S,isClone:!1})};postMessage(C)}})();\n',Mr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Pr],{type:"text/javascript;charset=utf-8"});function Xh(o){let t;try{if(t=Mr&&(self.URL||self.webkitURL).createObjectURL(Mr),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Pr),{name:o?.name})}}class Nh{draw;wordCountWorker;catalogWorker;groupWorker;valueWorker;constructor(t){this.draw=t,this.wordCountWorker=new Ch,this.catalogWorker=new Sh,this.groupWorker=new Eh,this.valueWorker=new Xh}getWordCount(){return new Promise((t,e)=>{this.wordCountWorker.onmessage=i=>{t(i.data)},this.wordCountWorker.onerror=i=>{e(i)};const n=this.draw.getOriginalMainElementList();this.wordCountWorker.postMessage(n)})}getCatalog(){return new Promise((t,e)=>{this.catalogWorker.onmessage=r=>{t(r.data)},this.catalogWorker.onerror=r=>{e(r)};const n=this.draw.getOriginalMainElementList(),i=this.draw.getPosition().getOriginalMainPositionList();this.catalogWorker.postMessage({elementList:n,positionList:i})})}getGroupIds(){return new Promise((t,e)=>{this.groupWorker.onmessage=i=>{t(i.data)},this.groupWorker.onerror=i=>{e(i)};const n=this.draw.getOriginalMainElementList();this.groupWorker.postMessage(n)})}getValue(t){return new Promise((e,n)=>{this.valueWorker.onmessage=i=>{e({version:Qe,data:i.data,options:at(this.draw.getOptions())})},this.valueWorker.onerror=i=>{n(i)},this.valueWorker.postMessage({data:this.draw.getOriginValue(t),options:t})})}}class Fh{container;canvas;draw;options;curElement;curElementSrc;previewerDrawOption;curPosition;eventBus;imageList;curShowElement;imageCount;imagePre;imageNext;resizerSelection;resizerHandleList;resizerImageContainer;resizerImage;resizerSize;width;height;mousedownX;mousedownY;curHandleIndex;previewerContainer;previewerImage;constructor(t){this.container=t.getContainer(),this.canvas=t.getPage(),this.draw=t,this.options=t.getOptions(),this.curElement=null,this.curElementSrc="",this.previewerDrawOption={},this.curPosition=null,this.eventBus=t.getEventBus(),this.imageList=[],this.curShowElement=null,this.imageCount=null,this.imagePre=null,this.imageNext=null;const{resizerSelection:e,resizerHandleList:n,resizerImageContainer:i,resizerImage:r,resizerSize:s}=this._createResizerDom();this.resizerSelection=e,this.resizerHandleList=n,this.resizerImageContainer=i,this.resizerImage=r,this.resizerSize=s,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.previewerContainer=null,this.previewerImage=null}_getElementPosition(t,e=null){const{scale:n}=this.options;let i=0,r=0;const s=this.draw.getHeight(),a=this.draw.getPageGap(),d=(e?.pageNo??this.draw.getPageNo())*(s+a);if(t.imgFloatPosition)i=t.imgFloatPosition.x*n,r=t.imgFloatPosition.y*n+d;else if(e){const{coordinate:{leftTop:[R,u]},ascent:h}=e;i=R,r=u+d+h}return{x:i,y:r}}_createResizerDom(){const{scale:t}=this.options,e=document.createElement("div");e.classList.add(`${z}-resizer-selection`),e.style.display="none",e.style.borderColor=this.options.resizerColor,e.style.borderWidth=`${t}px`;const n=[];for(let c=0;c<8;c++){const d=document.createElement("div");d.style.background=this.options.resizerColor,d.classList.add("resizer-handle"),d.classList.add(`handle-${c}`),d.setAttribute("data-index",String(c)),d.onmousedown=this._mousedown.bind(this),e.append(d),n.push(d)}this.container.append(e);const i=document.createElement("div");i.classList.add(`${z}-resizer-size-view`);const r=document.createElement("span");i.append(r),e.append(i);const s=document.createElement("div");s.classList.add(`${z}-resizer-image`),s.style.display="none";const a=document.createElement("img");return s.append(a),this.container.append(s),{resizerSelection:e,resizerHandleList:n,resizerImageContainer:s,resizerImage:a,resizerSize:r}}_keydown=()=>{this.resizerSelection.style.display==="block"&&(this.clearResizer(),document.removeEventListener("keydown",this._keydown))};_mousedown(t){if(this.canvas=this.draw.getPage(),!this.curElement)return;const{scale:e}=this.options;this.mousedownX=t.x,this.mousedownY=t.y;const n=t.target;this.curHandleIndex=Number(n.dataset.index);const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,this.canvas.style.cursor=i,this.resizerImage.src=this.curElementSrc,this.resizerImageContainer.style.display="block";const{x:r,y:s}=this._getElementPosition(this.curElement,this.curPosition);this.resizerImageContainer.style.left=`${r}px`,this.resizerImageContainer.style.top=`${s}px`,this.resizerImage.style.width=`${this.curElement.width*e}px`,this.resizerImage.style.height=`${this.curElement.height*e}px`;const a=this._mousemove.bind(this);document.addEventListener("mousemove",a),document.addEventListener("mouseup",()=>{this.curElement&&!this.previewerDrawOption.dragDisable&&(this.curElement.width=this.width,this.curElement.height=this.height,this.draw.render({isSetCursor:!0,curIndex:this.curPosition?.index})),this.resizerImageContainer.style.display="none",document.removeEventListener("mousemove",a),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),t.preventDefault()}_mousemove(t){if(!this.curElement||this.previewerDrawOption.dragDisable)return;const{scale:e}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const d=this.mousedownX-t.x,R=this.mousedownY-t.y;n=Math.cbrt(d**3+R**3),i=this.curElement.height*n/this.curElement.width}break;case 1:i=this.mousedownY-t.y;break;case 2:{const d=t.x-this.mousedownX,R=this.mousedownY-t.y;n=Math.cbrt(d**3+R**3),i=this.curElement.height*n/this.curElement.width}break;case 4:{const d=t.x-this.mousedownX,R=t.y-this.mousedownY;n=Math.cbrt(d**3+R**3),i=this.curElement.height*n/this.curElement.width}break;case 3:n=t.x-this.mousedownX;break;case 5:i=t.y-this.mousedownY;break;case 6:{const d=this.mousedownX-t.x,R=t.y-this.mousedownY;n=Math.cbrt(d**3+R**3),i=this.curElement.height*n/this.curElement.width}break;case 7:n=this.mousedownX-t.x;break}const r=this.curElement.width+n/e,s=this.curElement.height+i/e;if(r<=0||s<=0)return;this.width=r,this.height=s;const a=r*e,c=s*e;this.resizerImage.style.width=`${a}px`,this.resizerImage.style.height=`${c}px`,this._updateResizerRect(a,c),this._updateResizerSizeView(a,c),t.preventDefault(),this.eventBus.isSubscribe("imageSizeChange")&&this.eventBus.emit("imageSizeChange",{element:this.curElement})}_drawPreviewer(){const t=document.createElement("div");t.classList.add(`${z}-image-previewer`);const e=document.createElement("i");e.classList.add("image-close"),e.onclick=()=>{this._clearPreviewer()},t.append(e);const n=document.createElement("div");n.classList.add(`${z}-image-container`);const i=document.createElement("img");i.src=this.curElementSrc,i.draggable=!1,n.append(i),this.previewerImage=i,t.append(n);let r=0,s=0,a=1,c=0;const d=document.createElement("div");d.classList.add(`${z}-image-menu`);const R=document.createElement("div");R.classList.add("image-navigate");const u=document.createElement("i");u.classList.add("image-pre"),u.onclick=()=>{const S=this.imageList.findIndex(F=>F.id===this.curShowElement?.id);S<=0||(this.curShowElement=this.imageList[S-1],i.src=this.curShowElement.value,this._updateImageNavigate())},R.append(u),this.imagePre=u;const h=document.createElement("span");h.classList.add("image-count"),this.imageCount=h,R.append(h);const g=document.createElement("i");g.classList.add("image-next"),g.onclick=()=>{const S=this.imageList.findIndex(F=>F.id===this.curShowElement?.id);S>=this.imageList.length-1||(this.curShowElement=this.imageList[S+1],i.src=this.curShowElement.value,this._updateImageNavigate())},this.imageNext=g,R.append(g),d.append(R);const f=document.createElement("i");f.classList.add("zoom-in"),f.onclick=()=>{a+=.1,this._setPreviewerTransform(a,c,r,s)},d.append(f);const T=document.createElement("i");T.onclick=()=>{a-.1<=.1||(a-=.1,this._setPreviewerTransform(a,c,r,s))},T.classList.add("zoom-out"),d.append(T);const p=document.createElement("i");p.classList.add("rotate"),p.onclick=()=>{c+=1,this._setPreviewerTransform(a,c,r,s)},d.append(p);const m=document.createElement("i");m.classList.add("original-size"),m.onclick=()=>{r=0,s=0,a=1,c=0,this._setPreviewerTransform(a,c,r,s)},d.append(m);const I=document.createElement("i");I.classList.add("image-download"),I.onclick=()=>{const{mime:S}=this.previewerDrawOption;bi(i.src,`${this.curElement?.id}.${S||"png"}`)},d.append(I),t.append(d),this.previewerContainer=t,document.body.append(t);let L=0,P=0,O=!1;i.onmousedown=S=>{O=!0,L=S.x,P=S.y,t.style.cursor="move"},t.onmousemove=S=>{O&&(r+=S.x-L,s+=S.y-P,L=S.x,P=S.y,this._setPreviewerTransform(a,c,r,s))},t.onmouseup=()=>{O=!1,t.style.cursor="auto"},t.onwheel=S=>{if(S.preventDefault(),S.stopPropagation(),S.deltaY<0)a+=.1;else{if(a-.1<=.1)return;a-=.1}this._setPreviewerTransform(a,c,r,s)},this._updateImageNavigate()}_updateImageNavigate(){const t=this.imageList.findIndex(e=>e.id===this.curShowElement?.id);this.imageCount.innerText=`${t+1} / ${this.imageList.length}`,t<=0?this.imagePre.classList.add("disabled"):this.imagePre.classList.remove("disabled"),t>=this.imageList.length-1?this.imageNext.classList.add("disabled"):this.imageNext.classList.remove("disabled")}_setPreviewerTransform(t,e,n,i){this.previewerImage&&(this.previewerImage.style.left=`${n}px`,this.previewerImage.style.top=`${i}px`,this.previewerImage.style.transform=`scale(${t}) rotate(${e*90}deg)`)}_clearPreviewer(){this.previewerContainer?.remove(),this.previewerContainer=null,document.body.style.overflow="auto"}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options,r=this.draw.isReadonly();this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let s=0;s<8;s++){const a=s===0||s===6||s===7?-n:s===1||s===5?t/2:t-n,c=s===0||s===1||s===2?-n:s===3||s===7?e/2-n:e-n;this.resizerHandleList[s].style.transform=`scale(${i})`,this.resizerHandleList[s].style.left=`${a}px`,this.resizerHandleList[s].style.top=`${c}px`,this.resizerHandleList[s].style.display=r?"none":"block"}}_updateResizerSizeView(t,e){this.resizerSize.innerText=`${Math.round(t)} × ${Math.round(e)}`}render(){const t=this.draw.getMode();!this.curElement||this.curElement.imgToolDisabled&&!this.draw.isDesignMode()||t===l.EditorMode.PRINT&&this.options.modeRule[l.EditorMode.PRINT]?.imagePreviewerDisabled||t===l.EditorMode.READONLY&&this.options.modeRule[l.EditorMode.READONLY]?.imagePreviewerDisabled||(this.imageList=this.draw.getImageParticle().getOriginalMainImageList(),this.curShowElement=this.curElement,this._drawPreviewer(),document.body.style.overflow="hidden")}drawResizer(t,e=null,n={}){const i=this.draw.getMode();t.imgToolDisabled&&!this.draw.isDesignMode()||i===l.EditorMode.PRINT&&this.options.modeRule[l.EditorMode.PRINT]?.imagePreviewerDisabled||i===l.EditorMode.READONLY&&this.options.modeRule[l.EditorMode.READONLY]?.imagePreviewerDisabled||(this.previewerDrawOption=n,this.curElementSrc=t[n.srcKey||"value"]||"",this.updateResizer(t,e),document.addEventListener("keydown",this._keydown))}updateResizer(t,e=null){const{scale:n}=this.options,i=t.width*n,r=t.height*n;this._updateResizerSizeView(i,r);const{x:s,y:a}=this._getElementPosition(t,e);this.resizerSelection.style.left=`${s}px`,this.resizerSelection.style.top=`${a}px`,this.resizerSelection.style.borderWidth=`${n}px`,this._updateResizerRect(i,r),this.resizerSelection.style.display="block",this.curElement=t,this.curPosition=e,this.width=i,this.height=r}clearResizer(){this.resizerSelection.style.display="none",document.removeEventListener("keydown",this._keydown)}}class yh{draw;range;datePicker;options;constructor(t){this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.datePicker=new dr(t,{onSubmit:this._setValue.bind(this)})}_setValue(t){if(!t)return;const e=this.getDateElementRange();if(!e)return;const[n,i]=e,r=this.draw.getElementList(),s=r[n+1];this.draw.spliceElementList(r,n+1,i-n),this.range.setRange(n,n);const a={type:l.ElementType.DATE,value:"",dateFormat:s.dateFormat,valueList:[{value:t}]};Ut(r,[a],n,{editorOptions:this.options}),this.draw.insertElementList([a])}getDateElementRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList(),s=r[n];if(s.type!==l.ElementType.DATE)return null;let a=n;for(;a>=0;){if(r[a].dateId!==s.dateId){t=a;break}a--}let c=n+1;for(;c<r.length;){if(r[c].dateId!==s.dateId){e=c-1;break}c++}return c===r.length&&(e=c-1),!~t||!~e?null:[t,e]}clearDatePicker(){this.datePicker.dispose()}renderDatePicker(t,e){const n=this.draw.getElementList(),i=this.getDateElementRange(),r=i?n.slice(i[0]+1,i[1]+1).map(s=>s.value).join(""):"";this.datePicker.render({value:r,position:e,dateFormat:t.dateFormat})}}class Or{element;videoCache;constructor(t){this.element=t,this.videoCache=new Map}snapshot(t,e,n){return new Promise((i,r)=>{const s=this.element.block?.videoBlock?.src||"";if(this.videoCache.has(s)){const a=this.videoCache.get(s);t.drawImage(a,e,n,this.element.metrics.width,this.element.metrics.height),i(this.element)}else{const a=document.createElement("video");a.src=s,a.muted=!0,a.crossOrigin="anonymous",a.onloadeddata=()=>{t.drawImage(a,e,n,this.element.metrics.width,this.element.metrics.height),this.videoCache.set(s,a),i(this.element)},a.onerror=c=>{r(c)},a.play().then(()=>{a.pause()})}})}render(t){const e=this.element.block,n=document.createElement("video");n.style.width="100%",n.style.height="100%",n.style.objectFit="contain",n.src=e.videoBlock?.src||"",n.controls=!0,t.append(n)}}class Wh{draw;options;element;block;blockContainer;blockItem;blockCache;resizerMask;resizerSelection;resizerHandleList;width;height;mousedownX;mousedownY;curHandleIndex;isAllowResize;constructor(t,e){this.draw=t.getDraw(),this.options=this.draw.getOptions(),this.blockContainer=t.getBlockContainer(),this.element=e,this.block=null;const{blockItem:n,resizerMask:i,resizerSelection:r,resizerHandleList:s}=this._createBlockItem();this.blockItem=n,this.blockContainer.append(this.blockItem),this.blockCache=new Map,this.resizerMask=i,this.resizerSelection=r,this.resizerHandleList=s,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.isAllowResize=!1}getBlockElement(){return this.element}getBlockWidth(){return this.element.width||this.element.metrics.width}_createBlockItem(){const{scale:t,resizerColor:e}=this.options,n=document.createElement("div");n.classList.add(`${z}-block-item`);const i=document.createElement("div");i.style.display="none",i.classList.add(`${z}-resizer-selection`),i.style.borderColor=e,i.style.borderWidth=`${t}px`;const r=[];for(let a=0;a<8;a++){const c=document.createElement("div");c.style.background=e,c.classList.add("resizer-handle"),c.classList.add(`handle-${a}`),c.setAttribute("data-index",String(a)),c.onmousedown=this._mousedown.bind(this),i.append(c),r.push(c)}const s=document.createElement("div");return s.classList.add(`${z}-resizer-mask`),s.style.display="none",n.append(s),n.onmouseenter=()=>{if(this.draw.isReadonly())return;const{width:c,height:d}=this.element.metrics;this._updateResizerRect(c,d),i.style.display="block"},n.onmouseleave=()=>{this.isAllowResize||(i.style.display="none")},n.append(i),{blockItem:n,resizerMask:s,resizerSelection:i,resizerHandleList:r}}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options;this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let r=0;r<8;r++){const s=r===0||r===6||r===7?-n:r===1||r===5?t/2:t-n,a=r===0||r===1||r===2?-n:r===3||r===7?e/2-n:e-n;this.resizerHandleList[r].style.transform=`scale(${i})`,this.resizerHandleList[r].style.left=`${s}px`,this.resizerHandleList[r].style.top=`${a}px`}}_mousedown(t){const e=this.draw.getPage();this.mousedownX=t.x,this.mousedownY=t.y,this.isAllowResize=!0;const n=t.target;this.curHandleIndex=Number(n.dataset.index),this.resizerMask.style.display="block";const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,e.style.cursor=i;const r=this._mousemove.bind(this);document.addEventListener("mousemove",r),document.addEventListener("mouseup",()=>{this.element.width=Math.min(this.width,this.draw.getInnerWidth()),this.element.height=this.height,this.isAllowResize=!1,this.resizerSelection.style.display="none",this.resizerMask.style.display="none",document.removeEventListener("mousemove",r),document.body.style.cursor="",e.style.cursor="text",this.draw.render()},{once:!0}),t.preventDefault()}_mousemove(t){if(!this.isAllowResize)return;const{scale:e}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const d=this.mousedownX-t.x,R=this.mousedownY-t.y;n=Math.cbrt(d**3+R**3),i=this.element.height*n/this.getBlockWidth()}break;case 1:i=this.mousedownY-t.y;break;case 2:{const d=t.x-this.mousedownX,R=this.mousedownY-t.y;n=Math.cbrt(d**3+R**3),i=this.element.height*n/this.getBlockWidth()}break;case 4:{const d=t.x-this.mousedownX,R=t.y-this.mousedownY;n=Math.cbrt(d**3+R**3),i=this.element.height*n/this.getBlockWidth()}break;case 3:n=t.x-this.mousedownX;break;case 5:i=t.y-this.mousedownY;break;case 6:{const d=this.mousedownX-t.x,R=t.y-this.mousedownY;n=Math.cbrt(d**3+R**3),i=this.element.height*n/this.getBlockWidth()}break;case 7:n=this.mousedownX-t.x;break}const r=this.getBlockWidth()+n/e,s=this.element.height+i/e;if(r<=0||s<=0)return;this.width=r,this.height=s;const a=r*e,c=s*e;this._updateResizerRect(a,c),this.blockItem.style.width=`${a}px`,this.blockItem.style.height=`${c}px`,t.preventDefault()}snapshot(t,e,n){if(this.element.block.type===l.BlockType.VIDEO)if(this.blockItem.style.display="none",this.blockCache.has(this.element.id))this.blockCache.get(this.element.id).snapshot(t,e,n);else{this.block=new Or(this.element);const r=this.block.snapshot(t,e,n);this.draw.getImageObserver().add(r),this.blockCache.set(this.element.id,this.block)}}render(){const t=this.element.block;t.type===l.BlockType.IFRAME?(this.block=new $e(this.element),this.block.render(this.blockItem)):t.type===l.BlockType.VIDEO&&(this.block=new Or(this.element),this.block.render(this.blockItem))}setClientRects(t,e,n){const i=this.draw.getHeight(),r=this.draw.getPageGap(),s=t*(i+r),{metrics:a}=this.element;this.blockItem.style.display="block",this.blockItem.style.width=`${a.width}px`,this.blockItem.style.height=`${a.height}px`,this.blockItem.style.left=`${e}px`,this.blockItem.style.top=`${s+n}px`}remove(){this.blockItem.remove()}}class bh{draw;container;blockContainer;blockMap;constructor(t){this.draw=t,this.container=t.getContainer(),this.blockMap=new Map,this.blockContainer=this._createBlockContainer(),this.container.append(this.blockContainer)}_createBlockContainer(){const t=document.createElement("div");return t.classList.add(`${z}-block-container`),t}getDraw(){return this.draw}getBlockContainer(){return this.blockContainer}render(t,e,n,i,r){const s=n.id;let a=this.blockMap.get(s);a||(a=new Wh(this,n),a.render(),this.blockMap.set(s,a)),this.draw.isPrintMode()?a.snapshot(t,i,r):a.setClientRects(e,i,r)}clear(){if(!this.blockMap.size)return;const t=this.draw.getOriginalMainElementList(),e=[];for(let n=0;n<t.length;n++){const i=t[n];i.type===l.ElementType.BLOCK&&e.push(i.id)}this.blockMap.forEach(n=>{const i=n.getBlockElement().id;e.includes(i)||(n.remove(),this.blockMap.delete(i))})}}const Si={contextmenu:{global:{cut:"剪切",copy:"复制",paste:"粘贴",selectAll:"全选",print:"打印",cancel:"取消"},control:{delete:"删除控件",editAttribute:"修改元素配置",addExpression:"添加表达式",addMenstrualHistory:"月经史",addFetalHeartPosition:"胎心位置"},hyperlink:{delete:"删除链接",cancel:"取消链接",edit:"编辑链接"},image:{change:"更改图片",saveAs:"另存为图片",textWrap:"文字环绕",textWrapType:{embed:"嵌入型",upDown:"上下型环绕",surround:"四周型环绕",floatTop:"浮于文字上方",floatBottom:"衬于文字下方"}},table:{insertRowCol:"插入行列",insertTopRow:"上方插入1行",insertBottomRow:"下方插入1行",insertLeftCol:"左侧插入1列",insertRightCol:"右侧插入1列",deleteRowCol:"删除行列",deleteRow:"删除1行",deleteCol:"删除1列",deleteTable:"删除整个表格",mergeCell:"合并单元格",mergeCancelCell:"取消合并",verticalAlign:"垂直对齐",verticalAlignTop:"顶端对齐",verticalAlignMiddle:"垂直居中",verticalAlignBottom:"底端对齐",border:"表格边框",borderAll:"所有框线",borderEmpty:"无框线",borderDash:"虚框线",borderExternal:"外侧框线",borderInternal:"内侧框线",borderTd:"单元格边框",borderTdTop:"上边框",borderTdRight:"右边框",borderTdBottom:"下边框",borderTdLeft:"左边框",borderTdForward:"正斜线",borderTdBack:"反斜线",tableProperties:"表格属性"}},datePicker:{now:"此刻",confirm:"确定",return:"返回日期",timeSelect:"时间选择",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},year:"年",month:"月",hour:"时",minute:"分",second:"秒"},frame:{header:"页眉",footer:"页脚"},pageBreak:{displayName:"分页符"},zone:{headerTip:"双击编辑页眉",footerTip:"双击编辑页脚"}},Vh={contextmenu:{global:{cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select all",print:"Print",cancel:"Cancel"},control:{delete:"Delete control",editAttribute:"Edit control config",addExpression:"Add expression",addMenstrualHistory:"Menstrual History",addFetalHeartPosition:"Fetal Heart Position"},hyperlink:{delete:"Delete hyperlink",cancel:"Cancel hyperlink",edit:"Edit hyperlink"},image:{change:"Change image",saveAs:"Save as image",textWrap:"Text wrap",textWrapType:{embed:"Embed",upDown:"Up down",surround:"Surround",floatTop:"Float above text",floatBottom:"Float below text"}},table:{insertRowCol:"Insert row col",insertTopRow:"Insert top 1 row",insertBottomRow:"Insert bottom 1 row",insertLeftCol:"Insert left 1 col",insertRightCol:"Insert right 1 col",deleteRowCol:"Delete row col",deleteRow:"Delete 1 row",deleteCol:"Delete 1 col",deleteTable:"Delete table",mergeCell:"Merge cell",mergeCancelCell:"Cancel merge cell",verticalAlign:"Vertical align",verticalAlignTop:"Top",verticalAlignMiddle:"Middle",verticalAlignBottom:"Bottom",border:"Table border",borderAll:"All",borderEmpty:"Empty",borderDash:"Dash",borderExternal:"External",borderInternal:"Internal",borderTd:"Table cell border",borderTdTop:"Top",borderTdRight:"Right",borderTdBottom:"Bottom",borderTdLeft:"Left",borderTdForward:"Forward",borderTdBack:"Back",tableProperties:"Table Properties"}},datePicker:{now:"Now",confirm:"Confirm",return:"Return",timeSelect:"Time select",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},year:" ",month:" ",hour:"Hour",minute:"Minute",second:"Second"},frame:{header:"Header",footer:"Footer"},pageBreak:{displayName:"Page Break"},zone:{headerTip:"Double click to edit header",footerTip:"Double click to edit footer"}};class Yh{currentLocale;langMap=new Map([["zhCN",Si],["en",Vh]]);constructor(t){this.currentLocale=t}registerLangMap(t,e){const n=this.langMap.get(t);this.langMap.set(t,Vi(n||Si,e))}getLocale(){return this.currentLocale}setLocale(t){this.currentLocale=t}getLang(){return this.langMap.get(this.currentLocale)||Si}t(t){const e=t.split(".");let n="",i=this.getLang();for(let r=0;r<e.length;r++){const s=e[r],a=Reflect.get(i,s);if(a)n=i=a;else return""}return n}}class Dh{promiseList;constructor(){this.promiseList=[]}add(t){this.promiseList.push(t)}clearAll(){this.promiseList=[]}allSettled(){return Promise.allSettled(this.promiseList)}}class Uh{draw;zone;i18n;container;pageContainer;isDisableMouseMove;tipContainer;tipContent;currentMoveZone;constructor(t,e){this.draw=t,this.zone=e,this.i18n=t.getI18n(),this.container=t.getContainer(),this.pageContainer=t.getPageContainer();const{tipContainer:n,tipContent:i}=this._drawZoneTip();this.tipContainer=n,this.tipContent=i,this.isDisableMouseMove=!0,this.currentMoveZone=l.EditorZone.MAIN;const r=[],{header:s,footer:a}=t.getOptions();s.disabled||r.push(l.EditorZone.HEADER),a.disabled||r.push(l.EditorZone.FOOTER),r.length&&this._watchMouseMoveZoneChange(r)}_watchMouseMoveZoneChange(t){this.pageContainer.addEventListener("mousemove",Hr(e=>{if(!(this.isDisableMouseMove||!this.draw.getIsPagingMode())){if(this.draw.getMode()!==l.EditorMode.EDIT){this._updateZoneTip(!1);return}if(e.offsetY)if(e.target instanceof HTMLCanvasElement){const n=this.zone.getZoneByY(e.offsetY);if(!t.includes(n)){this._updateZoneTip(!1);return}this.currentMoveZone=n,this._updateZoneTip(this.zone.getZone()===l.EditorZone.MAIN&&(n===l.EditorZone.HEADER||n===l.EditorZone.FOOTER),e.x,e.y)}else this._updateZoneTip(!1)}},250)),this.pageContainer.addEventListener("mouseenter",()=>{this.isDisableMouseMove=!1}),this.pageContainer.addEventListener("mouseleave",()=>{this.isDisableMouseMove=!0,this._updateZoneTip(!1)})}_drawZoneTip(){const t=document.createElement("div");t.classList.add(`${z}-zone-tip`);const e=document.createElement("span");return t.append(e),this.container.append(t),{tipContainer:t,tipContent:e}}_updateZoneTip(t,e,n){t?(this.tipContainer.classList.add("show"),this.tipContainer.style.left=`${e}px`,this.tipContainer.style.top=`${n}px`,this.tipContent.innerText=this.i18n.t(`zone.${this.currentMoveZone===l.EditorZone.HEADER?"headerTip":"footerTip"}`)):this.tipContainer.classList.remove("show")}}class wh{INDICATOR_PADDING=2;INDICATOR_TITLE_TRANSLATE=[20,5];draw;options;i18n;container;currentZone;indicatorContainer;constructor(t){this.draw=t,this.i18n=t.getI18n(),this.options=t.getOptions(),this.container=t.getContainer(),this.currentZone=l.EditorZone.MAIN,this.indicatorContainer=null,this.options.zone.tipDisabled||new Uh(t,this)}isHeaderActive(){return this.getZone()===l.EditorZone.HEADER}isMainActive(){return this.getZone()===l.EditorZone.MAIN}isFooterActive(){return this.getZone()===l.EditorZone.FOOTER}getZone(){return this.currentZone}setZone(t){const{header:e,footer:n}=this.options;!e.editable&&t===l.EditorZone.HEADER||!n.editable&&t===l.EditorZone.FOOTER||this.currentZone!==t&&(this.currentZone=t,this.draw.getRange().clearRange(),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),this.drawZoneIndicator(),Oo(()=>{const i=this.draw.getListener();i.zoneChange&&i.zoneChange(t);const r=this.draw.getEventBus();r.isSubscribe("zoneChange")&&r.emit("zoneChange",t)}))}getZoneByY(t){const e=this.draw.getHeader(),n=e.getHeaderTop()+e.getHeight(),i=this.draw.getFooter(),s=this.draw.getHeight()-(i.getFooterBottom()+i.getHeight());return t<n?l.EditorZone.HEADER:t>s?l.EditorZone.FOOTER:l.EditorZone.MAIN}drawZoneIndicator(){if(this._clearZoneIndicator(),!this.isHeaderActive()&&!this.isFooterActive())return;const{scale:t}=this.options,e=this.isHeaderActive(),[n,i]=this.INDICATOR_TITLE_TRANSLATE,r=this.draw.getPageList(),s=this.draw.getMargins(),a=this.draw.getInnerWidth(),c=this.draw.getHeight(),d=this.draw.getPageGap(),R=c+d;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${z}-zone-indicator`);const u=this.draw.getHeader(),h=this.draw.getFooter(),g=e?u.getHeight():h.getHeight(),f=e?u.getHeaderTop():c-h.getFooterBottom()-g;for(let T=0;T<r.length;T++){const p=R*T+f,m=s[3]-this.INDICATOR_PADDING,I=s[3]+a+this.INDICATOR_PADDING,L=e?p-this.INDICATOR_PADDING:p+g+this.INDICATOR_PADDING,P=e?p+g+this.INDICATOR_PADDING:p-this.INDICATOR_PADDING,O=document.createElement("div");O.innerText=this.i18n.t(`frame.${e?"header":"footer"}`),O.style.top=`${P}px`,O.style.transform=`translate(${n*t}px, ${i*t}px) scale(${t})`,this.indicatorContainer.append(O);const S=document.createElement("span");S.classList.add(`${z}-zone-indicator-border__top`),S.style.top=`${L}px`,S.style.width=`${a}px`,S.style.marginLeft=`${s[3]}px`,this.indicatorContainer.append(S);const F=document.createElement("span");F.classList.add(`${z}-zone-indicator-border__left`),F.style.top=`${p}px`,F.style.height=`${g}px`,F.style.left=`${m}px`,this.indicatorContainer.append(F);const N=document.createElement("span");N.classList.add(`${z}-zone-indicator-border__bottom`),N.style.top=`${P}px`,this.indicatorContainer.append(N);const V=document.createElement("span");V.classList.add(`${z}-zone-indicator-border__right`),V.style.top=`${p}px`,V.style.height=`${g}px`,V.style.left=`${I}px`,this.indicatorContainer.append(V)}this.container.append(this.indicatorContainer)}_clearZoneIndicator(){this.indicatorContainer?.remove(),this.indicatorContainer=null}}class Zh{draw;position;zone;options;elementList;rowList;positionList;constructor(t,e){this.draw=t,this.position=t.getPosition(),this.zone=t.getZone(),this.options=t.getOptions(),this.elementList=e||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(t){this.elementList=t}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const t=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:t,elementList:this.elementList})}_computePositionList(){const t=this.getFooterBottom(),e=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],r=this.draw.getHeight(),s=this.getHeight(),a=r-t-s;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:a,innerWidth:e,zone:l.EditorZone.FOOTER})}getFooterBottom(){const{footer:{bottom:t,disabled:e},scale:n}=this.options;return e?0:Math.floor(t*n)}getMaxHeight(){const{footer:{maxHeightRadio:t}}=this.options,e=this.draw.getHeight();return Math.floor(e*yi[t])}getHeight(){if(this.options.footer.disabled)return 0;const t=this.getMaxHeight(),e=this.getRowHeight();return e>t?t:e}getRowHeight(){return this.rowList.reduce((t,e)=>t+e.height,0)}getExtraHeight(){const t=this.draw.getMargins(),e=this.getHeight(),i=this.getFooterBottom()+e-t[2];return i<=0?0:i}render(t,e){t.save(),t.globalAlpha=this.zone.isFooterActive()?1:this.options.footer.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),r=[];let s=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(s+c.height>i)break;r.push(c),s+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:r,pageNo:e,startIndex:0,innerWidth:n,zone:l.EditorZone.FOOTER}),t.restore()}}class Qh{draw;range;options;UN_COUNT_STYLE_WIDTH=20;MEASURE_BASE_TEXT="0";LIST_GAP=10;constructor(t){this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}setList(t,e){if(this.draw.isReadonly())return;const{startIndex:i,endIndex:r}=this.range.getRange();if(!~i&&!~r)return;const s=this.range.getRangeParagraphElementList();if(!s||!s.length)return;if(s.find(u=>u.listType===t&&u.listStyle===e)||!t){this.unsetList();return}const c=lt();s.forEach(u=>{u.listId=c,u.listType=t,u.listStyle=e});const d=i===r,R=d?r:i;this.draw.render({curIndex:R,isSetCursor:d})}unsetList(){if(this.draw.isReadonly())return;const{startIndex:e,endIndex:n}=this.range.getRange();if(!~e&&!~n)return;const i=this.range.getRangeParagraphElementList()?.filter(d=>d.listId);if(!i||!i.length)return;const r=this.draw.getElementList(),s=r[n];if(s.listId){let d=n+1;for(;d<r.length;){const R=r[d];if(R.value===_&&!R.listWrap)break;if(R.listId!==s.listId){this.draw.spliceElementList(r,d,0,[{value:_}]);break}d++}}i.forEach(d=>{delete d.listId,delete d.listType,delete d.listStyle,delete d.listWrap});const a=e===n,c=a?n:e;this.draw.render({curIndex:c,isSetCursor:a})}computeListStyle(t,e){const n=new Map;let i=0,r=e[i]?.listId,s=[];const a=e.length;for(;i<a;){const c=e[i];if(r&&r===c.listId)s.push(c);else if(c.listId&&c.listId!==r){if(s.length){const d=this.getListStyleWidth(t,s);n.set(r,d)}r=c.listId,s=r?[c]:[]}i++}if(s.length){const c=this.getListStyleWidth(t,s);n.set(r,c)}return n}findStyledElement(t){let e=t[0];for(let n=1;n<t.length;n++){const i=t[n];if(i.font||i.size||i.bold||i.italic){e=i;break}}return e}getListFontStyle(t,e){if(this.options.list.inheritStyle){const n=this.findStyledElement(t);return this.draw.getElementFont(n,e)}else{const{defaultFont:n,defaultSize:i}=this.options;return`${i*e}px ${n}`}}getListStyleWidth(t,e){const{scale:n,checkbox:i}=this.options,r=e[0];if(r.listStyle&&r.listStyle!==l.ListStyle.DECIMAL)return r.listStyle===l.ListStyle.CHECKBOX?(i.width+this.LIST_GAP)*n:this.UN_COUNT_STYLE_WIDTH*n;const s=e.reduce((d,R)=>(R.value===_&&(d+=1),d),0);if(!s)return 0;t.save(),t.font=this.getListFontStyle(e,n);const a=`${this.MEASURE_BASE_TEXT.repeat(String(s).length)}${l.KeyMap.PERIOD}`,c=t.measureText(a);return t.restore(),Math.ceil((c.width+this.LIST_GAP)*n)}drawListStyle(t,e,n){const{elementList:i,offsetX:r,listIndex:s,ascent:a}=e,c=i[0];if(c.value!==_||c.listWrap)return;let d=0;const{defaultTabWidth:R,scale:u}=this.options;for(let p=1;p<i.length&&i[p]?.type===l.ElementType.TAB;p++)d+=R*u;const{coordinate:{leftTop:[h,g]}}=n,f=h-r+d,T=g+a;if(c.listStyle===l.ListStyle.CHECKBOX){const{width:p,height:m,gap:I}=this.options.checkbox,L={...c,checkbox:{value:!!c.checkbox?.value},metrics:{...c.metrics,width:(p+I*2)*u,height:m*u}};this.draw.getCheckboxParticle().render({ctx:t,x:f-I*u,y:T,index:0,row:{...e,elementList:[L,...e.elementList]}})}else{let p="";if(c.listType===l.ListType.UL?p=Wo[c.listStyle]||Wo[He.DISC]:p=`${s+1}${l.KeyMap.PERIOD}`,!p)return;t.save(),t.font=this.getListFontStyle(i,u),t.fillText(p,f,T),t.restore()}}}class Yn{options;static WIDTH=12;static HEIGHT=9;static GAP=3;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:r,lineBreak:{color:s,lineWidth:a}}=this.options;t.save(),t.beginPath();const c=i-Yn.HEIGHT*r/2,d=n+e.metrics.width;t.translate(d,c),t.scale(r,r),t.strokeStyle=s,t.lineWidth=a,t.lineCap="round",t.lineJoin="round",t.beginPath(),t.moveTo(8,0),t.lineTo(12,0),t.lineTo(12,6),t.lineTo(3,6),t.moveTo(3,6),t.lineTo(6,3),t.moveTo(3,6),t.lineTo(6,9),t.stroke(),t.closePath(),t.restore()}}class Cr{draw;position;options;elementList;rowList;positionList;constructor(t){this.draw=t,this.position=t.getPosition(),this.options=t.getOptions(),this.elementList=[],this.rowList=[],this.positionList=[]}_recovery(){this.elementList=[],this.rowList=[],this.positionList=[]}_compute(t){this._computeRowList(),this._computePositionList(t)}_computeRowList(){const t=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:t,elementList:this.elementList})}_computePositionList(t){const{lineBreak:e,scale:n}=this.options,i=this.draw.getHeader().getExtraHeight(),r=this.draw.getInnerWidth(),s=this.draw.getMargins();let a=s[3];e.disabled||(a+=(Yn.WIDTH+Yn.GAP)*n);const c=t?.startY||s[0]+i;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:a,startY:c,innerWidth:r})}render(t,e){const{placeholder:n=this.options.placeholder}=e||{},{data:i,font:r,size:s,color:a,opacity:c}=n;this._recovery(),this.elementList=[{value:i,font:r,size:s,color:a}],Vt(this.elementList,{editorOptions:this.options,isForceCompensation:!0}),this._compute(e);const d=this.draw.getInnerWidth();t.save(),t.globalAlpha=c,this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:this.rowList,pageNo:0,startIndex:0,innerWidth:d,isDrawLineBreak:!1}),t.restore()}}class vh{draw;options;range;fillRectMap;constructor(t){this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.fillRectMap=new Map}setGroup(){if(this.draw.isReadonly()||this.draw.getZone().getZone()!==l.EditorZone.MAIN)return null;const t=this.range.getSelection();if(!t)return null;const e=lt();return t.forEach(n=>{Array.isArray(n.groupIds)||(n.groupIds=[]),n.groupIds.push(e)}),this.draw.render({isSetCursor:!1,isCompute:!1}),e}getElementListByGroupId(t,e){const n=[];for(let i=0;i<t.length;i++){const r=t[i];if(r.type===l.ElementType.TABLE){const s=r.trList;for(let a=0;a<s.length;a++){const c=s[a];for(let d=0;d<c.tdList.length;d++){const R=c.tdList[d],u=this.getElementListByGroupId(R.value,e);if(u.length)return n.push(...u),n}}}if(r?.groupIds?.includes(e)&&(n.push(r),!t[i+1]?.groupIds?.includes(e)))break}return n}deleteGroup(t){if(this.draw.isReadonly())return;const e=this.draw.getOriginalMainElementList(),n=this.getElementListByGroupId(e,t);if(n.length){for(let i=0;i<n.length;i++){const r=n[i],s=r.groupIds,a=s.findIndex(c=>c===t);s.splice(a,1),s.length||delete r.groupIds}this.draw.render({isSetCursor:!1,isCompute:!1})}}getContextByGroupId(t,e){for(let n=0;n<t.length;n++){const i=t[n];if(i.type===l.ElementType.TABLE){const s=i.trList;for(let a=0;a<s.length;a++){const c=s[a];for(let d=0;d<c.tdList.length;d++){const R=c.tdList[d],u=this.getContextByGroupId(R.value,e);if(u)return{...u,isTable:!0,index:n,trIndex:a,tdIndex:d,tdId:R.id,trId:c.id,tableId:i.tableId}}}}const r=t[n+1];if(i.groupIds?.includes(e)&&!r?.groupIds?.includes(e))return{isTable:!1,startIndex:n,endIndex:n}}return null}clearFillInfo(){this.fillRectMap.clear()}recordFillInfo(t,e,n,i,r){const s=t.groupIds;if(s)for(const a of s){const c=this.fillRectMap.get(a);c?c.width+=i:this.fillRectMap.set(a,{x:e,y:n,width:i,height:r})}}render(t){if(!this.fillRectMap.size)return;const e=this.range.getRange(),i=this.draw.getElementList()[e.endIndex]?.groupIds,{group:{backgroundColor:r,opacity:s,activeOpacity:a,activeBackgroundColor:c}}=this.options;t.save(),this.fillRectMap.forEach((d,R)=>{const{x:u,y:h,width:g,height:f}=d;i?.includes(R)?(t.globalAlpha=a,t.fillStyle=c):(t.globalAlpha=s,t.fillStyle=r),t.fillRect(u,h,g,f)}),t.restore(),this.clearFillInfo()}}class Kh{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:r,whiteSpace:{color:s,radius:a}}=this.options,c=e.metrics;t.save(),t.fillStyle=s,t.beginPath(),t.arc(n+c.width/2,i,a*r,0,Math.PI*2),t.fill(),t.closePath(),t.restore()}}class Hh{draw;eventBus;pageContainer;constructor(t){this.draw=t,this.eventBus=this.draw.getEventBus(),this.pageContainer=this.draw.getPageContainer(),this.pageContainer.addEventListener("mousemove",this._mousemove.bind(this)),this.pageContainer.addEventListener("mouseenter",this._mouseenter.bind(this)),this.pageContainer.addEventListener("mouseleave",this._mouseleave.bind(this)),this.pageContainer.addEventListener("mousedown",this._mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this._mouseup.bind(this)),this.pageContainer.addEventListener("click",this._click.bind(this))}_mousemove(t){this.eventBus.isSubscribe("mousemove")&&this.eventBus.emit("mousemove",t)}_mouseenter(t){this.eventBus.isSubscribe("mouseenter")&&this.eventBus.emit("mouseenter",t)}_mouseleave(t){this.eventBus.isSubscribe("mouseleave")&&this.eventBus.emit("mouseleave",t)}_mousedown(t){this.eventBus.isSubscribe("mousedown")&&this.eventBus.emit("mousedown",t)}_mouseup(t){this.eventBus.isSubscribe("mouseup")&&this.eventBus.emit("mouseup",t)}_click(t){this.eventBus.isSubscribe("click")&&this.eventBus.emit("click",t)}}class _h{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{scale:n,lineNumber:{color:i,size:r,font:s,right:a,type:c}}=this.options,d=this.draw.getTextParticle(),R=this.draw.getMargins(),u=this.draw.getPosition().getOriginalMainPositionList(),g=this.draw.getPageRowList()[e];t.save(),t.fillStyle=i,t.font=`${r*n}px ${s}`;for(let f=0;f<g.length;f++){const T=g[f],{coordinate:{leftBottom:p}}=u[T.startIndex],m=c===l.LineNumberType.PAGE?f+1:T.rowIndex+1,I=d.measureText(t,{value:`${m}`}),L=R[3]-(I.width+a)*n,P=p[1]-I.actualBoundingBoxAscent*n;t.fillText(`${m}`,L,P)}t.restore()}}class xh{draw;header;footer;options;constructor(t){this.draw=t,this.header=t.getHeader(),this.footer=t.getFooter(),this.options=t.getOptions()}render(t){const{scale:e,pageBorder:{color:n,lineWidth:i,padding:r}}=this.options;t.save(),t.translate(.5,.5),t.strokeStyle=n,t.lineWidth=i*e;const s=this.draw.getMargins(),a=s[3]-r[3]*e,c=s[0]+this.header.getExtraHeight()-r[0]*e,d=this.draw.getInnerWidth()+(r[1]+r[3])*e,R=this.draw.getHeight()-c-this.footer.getExtraHeight()-s[2]+r[2]*e;t.rect(a,c,d,R),t.stroke(),t.restore()}}function Gh(o,t){const{value:e,oldValue:n}=t;n.isTable&&!e.isTable&&o.getTableTool().dispose()}class Ah{draw;eventBus;constructor(t){this.draw=t,this.eventBus=t.getEventBus(),this.execute()}execute(){this.eventBus.on("positionContextChange",t=>{Gh(this.draw,t)})}}class kh{draw;range;position;tableTool;tableParticle;options;constructor(t){this.draw=t,this.range=t.getRange(),this.position=t.getPosition(),this.tableTool=t.getTableTool(),this.tableParticle=t.getTableParticle(),this.options=t.getOptions()}insertTable(t,e){const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const{defaultTrMinHeight:r}=this.options.table,s=this.draw.getElementList();let a=0;if(s[n]?.listId){const f=this.position.getPositionList(),{rowIndex:T}=f[n];a=this.draw.getRowList()[T]?.offsetX||0}const c=this.draw.getContextInnerWidth()-a,d=[],R=c/e;for(let f=0;f<e;f++)d.push({width:R});const u=[];for(let f=0;f<t;f++){const T=[],p={height:r,tdList:T};for(let m=0;m<e;m++)T.push({colspan:1,rowspan:1,value:[]});u.push(p)}const h={type:l.ElementType.TABLE,value:"",colgroup:d,trList:u};Vt([h],{editorOptions:this.options}),Ut(s,[h],n,{editorOptions:this.options});const g=n+1;this.draw.spliceElementList(s,g,n===i?0:i-n,[h]),this.range.setRange(g,g),this.draw.render({curIndex:g,isSetCursor:!1})}insertTableTopRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tableId:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=a[n];if(c.tdList.length<s.colgroup.length){const u=c.tdList[0].rowIndex;for(let h=0;h<n;h++){const g=a[h];for(let f=0;f<g.tdList.length;f++){const T=g.tdList[f];T.rowspan>1&&T.rowIndex+T.rowspan>=u+1&&(T.rowspan+=1)}}}const d=lt(),R={height:c.height,id:d,tdList:[]};for(let u=0;u<c.tdList.length;u++){const h=c.tdList[u],g=lt();R.tdList.push({id:g,rowspan:1,colspan:h.colspan,value:[{value:_,size:16,tableId:i,trId:d,tdId:g}]})}a.splice(n,0,R),this.position.setPositionContext({isTable:!0,index:e,trIndex:n,tdIndex:0,tdId:R.tdList[0].id,trId:R.id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableBottomRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tableId:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=a[n],d=a.length-1===n?c:a[n+1];if(d.tdList.length<s.colgroup.length){const h=d.tdList[0].rowIndex;for(let g=0;g<n+1;g++){const f=a[g];for(let T=0;T<f.tdList.length;T++){const p=f.tdList[T];p.rowspan>1&&p.rowIndex+p.rowspan>=h+1&&(p.rowspan+=1)}}}const R=lt(),u={height:d.height,id:R,tdList:[]};for(let h=0;h<d.tdList.length;h++){const g=d.tdList[h],f=lt();u.tdList.push({id:f,rowspan:1,colspan:g.colspan,value:[{value:_,size:16,tableId:i,trId:R,tdId:f}]})}a.splice(n+1,0,u),this.position.setPositionContext({isTable:!0,index:e,trIndex:n+1,tdIndex:0,tdId:u.tdList[0].id,trId:u.id,tableId:s.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}adjustColWidth(t){if(t.type!==l.ElementType.TABLE)return;const{defaultColMinWidth:e}=this.options.table,n=t.colgroup,i=n.reduce((s,a)=>s+a.width,0),r=this.draw.getOriginalInnerWidth();if(i>r){const s=n.filter(c=>c.width>e),a=(i-r)/s.length;for(let c=0;c<n.length;c++){const d=n[c];d.width-a>=e&&(d.width-=a)}}}insertTableLeftCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,tableId:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=n;for(let u=0;u<a.length;u++){const h=a[u],g=lt();h.tdList.splice(c,0,{id:g,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:i,trId:h.id,tdId:g}]})}const{defaultColMinWidth:d}=this.options.table;s.colgroup.splice(c,0,{width:d}),this.adjustColWidth(s),this.position.setPositionContext({isTable:!0,index:e,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableRightCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,tableId:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=n+1;for(let u=0;u<a.length;u++){const h=a[u],g=lt();h.tdList.splice(c,0,{id:g,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:i,trId:h.id,tdId:g}]})}const{defaultColMinWidth:d}=this.options.table;s.colgroup.splice(c,0,{width:d}),this.adjustColWidth(s),this.position.setPositionContext({isTable:!0,index:e,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:s.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}deleteTableRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tdIndex:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=a[n],d=c.tdList[i].rowIndex;if(a.length<=1&&s.pagingIndex===0){this.deleteTable();return}for(let R=0;R<d;R++){const h=a[R].tdList;for(let g=0;g<h.length;g++){const f=h[g];f.rowIndex+f.rowspan>d&&f.rowspan--}}for(let R=0;R<c.tdList.length;R++){const u=c.tdList[R];if(u.rowspan>1){const h=lt(),g=a[n+1];g.tdList.splice(R,0,{id:h,rowspan:u.rowspan-1,colspan:u.colspan,value:[{value:_,size:16,tableId:s.id,trId:g.id,tdId:h}]})}}a.splice(n,1),this.position.setPositionContext({isTable:!1}),this.range.clearRange(),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTableCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,trIndex:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,d=a[i].tdList[n].colIndex;if(!a.find(u=>u.tdList.length>1)){this.deleteTable();return}for(let u=0;u<a.length;u++){const h=a[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];f.colIndex<=d&&f.colIndex+f.colspan>d&&(f.colspan>1?f.colspan--:h.tdList.splice(g,1))}}s.colgroup?.splice(d,1),this.position.setPositionContext({isTable:!1}),this.range.setRange(0,0),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTable(){const t=this.position.getPositionContext();if(!t.isTable)return;const e=this.draw.getOriginalElementList(),n=e[t.index];let i=1,r=t.index;if(n.pagingId){r=t.index-n.pagingIndex;for(let a=r+1;a<e.length&&e[a].pagingId===n.pagingId;a++)i++}e.splice(r,i);const s=r-1;this.position.setPositionContext({isTable:!1,index:s}),this.range.setRange(s,s),this.draw.render({curIndex:s}),this.tableTool.dispose()}mergeTableCell(){const t=this.position.getPositionContext();if(!t.isTable)return;const{isCrossRowCol:e,startTdIndex:n,endTdIndex:i,startTrIndex:r,endTrIndex:s}=this.range.getRange();if(!e)return;const{index:a}=t,R=this.draw.getOriginalElementList()[a].trList;let u=R[r].tdList[n],h=R[s].tdList[i];(u.x>h.x||u.y>h.y)&&([u,h]=[h,u]);const g=u.colIndex,f=h.colIndex+(h.colspan-1),T=u.rowIndex,p=h.rowIndex+(h.rowspan-1),m=[];for(let E=0;E<R.length;E++){const C=R[E],M=[];for(let y=0;y<C.tdList.length;y++){const W=C.tdList[y],D=W.colIndex,U=W.rowIndex;D>=g&&D<=f&&U>=T&&U<=p&&M.push(W)}M.length&&m.push(M)}if(!m.length)return;const I=m[m.length-1],L=m[0][0],P=I[I.length-1],O=L.x,S=L.y,F=P.x+P.width,N=P.y+P.height;for(let E=0;E<m.length;E++){const C=m[E];for(let M=0;M<C.length;M++){const y=C[M],W=y.x,D=y.y,U=W+y.width,Q=D+y.height;if(O>W||S>D||F<U||N<Q)return}}const V=[],Y=m[0][0],X=Y.value[0];for(let E=0;E<m.length;E++){const C=m[E];for(let M=0;M<C.length;M++){const y=C[M];if(!(E===0&&M===0)){V.push(y.id);const D=y.value.length>1?0:1;for(let U=D;U<y.value.length;U++){const Q=y.value[U];Ye(Be,X,Q),Y.value.push(Q)}}E===0&&M!==0&&(Y.colspan+=y.colspan),E!==0&&Y.colIndex===y.colIndex&&(Y.rowspan+=y.rowspan)}}for(let E=0;E<R.length;E++){const C=R[E];let M=0;for(;M<C.tdList.length;){const y=C.tdList[M];V.includes(y.id)&&(C.tdList.splice(M,1),M--),M++}}this.position.setPositionContext({...t,trIndex:Y.trIndex,tdIndex:Y.tdIndex});const b=Y.value.length-1;this.range.setRange(b,b),this.draw.render(),this.tableTool.render()}cancelMergeTableCell(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,trIndex:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=a[i],d=c.tdList[n];if(d.rowspan===1&&d.colspan===1)return;const R=d.colspan;if(d.colspan>1){for(let h=1;h<d.colspan;h++){const g=lt();c.tdList.splice(n+h,0,{id:g,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:s.id,trId:c.id,tdId:g}]})}d.colspan=1}if(d.rowspan>1){for(let h=1;h<d.rowspan;h++){const g=a[i+h];for(let f=0;f<R;f++){const T=lt();g.tdList.splice(d.colIndex,0,{id:T,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:s.id,trId:g.id,tdId:T}]})}}d.rowspan=1}const u=d.value.length-1;this.range.setRange(u,u),this.draw.render(),this.tableTool.render()}splitVerticalTableCell(){const t=this.position.getPositionContext();if(!t.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:r}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,d=c[r],R=d.tdList[i];a.colgroup.splice(i+1,0,{width:this.options.table.defaultColMinWidth});for(let u=0;u<c.length;u++){const h=c[u];let g=0;for(;g<h.tdList.length;){const f=h.tdList[g];if(f.rowIndex!==R.rowIndex)f.colIndex<=R.colIndex&&f.colIndex+f.colspan>R.colIndex&&f.colspan++;else if(f.id===R.id){const T=lt();d.tdList.splice(g+R.colspan,0,{id:T,rowspan:R.rowspan,colspan:1,value:[{value:_,size:16,tableId:a.id,trId:h.id,tdId:T}]}),g++}g++}}this.draw.render(),this.tableTool.render()}splitHorizontalTableCell(){const t=this.position.getPositionContext();if(!t.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:r}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,R=c[r].tdList[i];let u=-1,h=0;for(;h<c.length;){if(h===u){h++;continue}const g=c[h];let f=0;for(;f<g.tdList.length;){const T=g.tdList[f];if(T.id===R.id){const p=lt(),m=lt();c.splice(h+R.rowspan,0,{id:p,height:this.options.table.defaultTrMinHeight,tdList:[{id:m,rowspan:1,colspan:R.colspan,value:[{value:_,size:16,tableId:a.id,trId:p,tdId:m}]}]}),u=h+R.rowspan}else T.rowIndex>=R.rowIndex&&T.rowIndex<R.rowIndex+R.rowspan&&T.rowIndex+T.rowspan>=R.rowIndex+R.rowspan&&T.rowspan++;f++}h++}this.draw.render(),this.tableTool.render()}tableTdVerticalAlign(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i<e.length;i++){const r=e[i];for(let s=0;s<r.length;s++){const a=r[s];!a||a.verticalAlign===t||!a.verticalAlign&&t===l.VerticalAlign.TOP||(a.verticalAlign=t)}}const{endIndex:n}=this.range.getRange();this.draw.render({curIndex:n})}tableBorderType(t){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:n}=e,r=this.draw.getOriginalElementList()[n];if(!r.borderType&&t===l.TableBorder.ALL||r.borderType===t)return;r.borderType=t;const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s})}tableBorderColor(t){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:n}=e,r=this.draw.getOriginalElementList()[n];if(!r.borderColor&&t===this.options.table.defaultBorderColor||r.borderColor===t)return;r.borderColor=t;const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s,isCompute:!1})}tableTdBorderType(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;const n=e.flat(),i=n.some(s=>!s.borderTypes?.includes(t));n.forEach(s=>{s.borderTypes||(s.borderTypes=[]);const a=s.borderTypes.findIndex(c=>c===t);i?~a||s.borderTypes.push(t):~a&&s.borderTypes.splice(a,1),s.borderTypes.length||delete s.borderTypes});const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableTdSlashType(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;const n=e.flat(),i=n.some(s=>!s.slashTypes?.includes(t));n.forEach(s=>{s.slashTypes||(s.slashTypes=[]);const a=s.slashTypes.findIndex(c=>c===t);i?~a||s.slashTypes.push(t):~a&&s.slashTypes.splice(a,1),s.slashTypes.length||delete s.slashTypes});const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableTdBackgroundColor(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i<e.length;i++){const r=e[i];for(let s=0;s<r.length;s++){const a=r[s];a.backgroundColor=t}}const{endIndex:n}=this.range.getRange();this.range.setRange(n,n),this.draw.render({isCompute:!1})}tableSelectAll(){const t=this.position.getPositionContext(),{index:e,tableId:n,isTable:i}=t;if(!i||!n)return;const{startIndex:r,endIndex:s}=this.range.getRange(),c=this.draw.getOriginalElementList()[e].trList,d=c.length-1,R=c[d].tdList.length-1;this.range.replaceRange({startIndex:r,endIndex:s,tableId:n,startTdIndex:0,endTdIndex:R,startTrIndex:0,endTrIndex:d}),this.draw.render({isSetCursor:!1,isCompute:!1,isSubmitHistory:!1})}tableProperties(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e}=t,i=this.draw.getOriginalElementList()[e],r=this.draw.getOptions().table.tdPadding,s=i.tdPadding||r,a=document.createElement("div");a.className="table-properties-modal",a.setAttribute("editor-component","table-properties-modal"),a.innerHTML=`
506
+ </span>`},r=(R,u,h)=>{const g=[];return u.forEach(f=>{g.push(i(h,f))}),R.forEach(f=>{g.push(i(h,f))}),g.join(" ")},s=e.querySelector(".tooth-preview-upper-left"),a=e.querySelector(".tooth-preview-upper-right"),c=e.querySelector(".tooth-preview-lower-left"),d=e.querySelector(".tooth-preview-lower-right");s&&(s.innerHTML=r(t?.upperLeft||[],t?.upperLeftLetter||[],"upperLeft")),a&&(a.innerHTML=r(t?.upperRight||[],t?.upperRightLetter||[],"upperRight")),c&&(c.innerHTML=r(t?.lowerLeft||[],t?.lowerLeftLetter||[],"lowerLeft")),d&&(d.innerHTML=r(t?.lowerRight||[],t?.lowerRightLetter||[],"lowerRight"))}bindExtraPanelEvents(){const t=this.inputModal;if(!t)return;t.querySelectorAll(".tooth-surface-item").forEach(i=>{i.addEventListener("click",()=>{if(!this.finallyAdd)return;const r=i.dataset.surface;if(!r)return;const s=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.toothSurfaceMap[s]||(this.toothSurfaceMap[s]=[]);const a=this.toothSurfaceMap[s],c=a.indexOf(r);c>-1?(a.splice(c,1),i.classList.remove("selected")):(a.push(r),i.classList.add("selected")),this.updatePreview()})}),t.querySelectorAll(".tooth-supernumerary-item").forEach(i=>{i.addEventListener("click",()=>{if(!this.finallyAdd)return;const r=i.dataset.supernumerary;if(!r)return;const s=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.supernumeraryToothMap[s]===r?(delete this.supernumeraryToothMap[s],i.classList.remove("selected")):(t.querySelectorAll(".tooth-supernumerary-item").forEach(a=>a.classList.remove("selected")),this.supernumeraryToothMap[s]=r,i.classList.add("selected")),this.updatePreview()})}),this.updateExtraPanelSelection()}updateExtraPanelSelection(){const t=this.inputModal;if(!t||!this.finallyAdd)return;const e=`${this.finallyAdd.position}-${this.finallyAdd.value}`,n=this.toothSurfaceMap[e]||[];t.querySelectorAll(".tooth-surface-item").forEach(r=>{const s=r.dataset.surface;n.includes(s||"")?r.classList.add("selected"):r.classList.remove("selected")});const i=this.supernumeraryToothMap[e];t.querySelectorAll(".tooth-supernumerary-item").forEach(r=>{r.dataset.supernumerary===i?r.classList.add("selected"):r.classList.remove("selected")})}}const pr='(function(){"use strict";function f(i){let s="",n=0;for(;n<i.length;){const t=i[n];if(t.type==="table"){if(t.trList)for(let l=0;l<t.trList.length;l++){const o=t.trList[l];for(let e=0;e<o.tdList.length;e++){const r=o.tdList[e];s+=f(r.value)}}}else if(t.type==="hyperlink"){const l=t.hyperlinkId,o=[];for(;n<i.length;){const e=i[n];if(l!==e.hyperlinkId){n--;break}delete e.type,o.push(e),n++}s+=f(o)}else if(t.controlId){if(!t.control?.hide){const l=t.controlId,o=[];for(;n<i.length;){const e=i[n];if(l!==e.controlId){n--;break}e.controlComponent==="value"&&(delete e.controlId,o.push(e)),n++}s+=f(o)}}else(!t.type||t.type==="text")&&!t.area?.hide&&(s+=t.value);n++}return s}function p(i){const s=[],n=/[0-9]/,t=/[A-Za-z]/,l=/\\s/;let o=!1,e=!1,r="";function a(){r&&(s.push(r),r="")}for(const c of i)t.test(c)?(o||a(),r+=c,o=!0,e=!1):n.test(c)?(e||a(),r+=c,o=!1,e=!0):(a(),o=!1,e=!1,l.test(c)||s.push(c));return a(),s}onmessage=i=>{const s=i.data,t=f(s).replace(new RegExp("^​"),"").replace(new RegExp("​","g"),`\n`),l=p(t);postMessage(l.length)}})();\n',Lr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",pr],{type:"text/javascript;charset=utf-8"});function bh(o){let t;try{if(t=Lr&&(self.URL||self.webkitURL).createObjectURL(Lr),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(pr),{name:o?.name})}}const Ir=`(function(){"use strict";const v={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6},E=["text","hyperlink","subscript","superscript","control","date","label"],L="​";function m(c){return!c.type||E.includes(c.type)}function I(c){const{elementList:r,positionList:d}=c,p=[];let u=0;for(;u<r.length;){const t=r[u],l=(e,n,s)=>{const g=e.titleId,a={type:"title",value:"",level:e.level,titleId:g,pageNo:d[u].pageNo},o=[];for(;s<n.length;){const i=n[s];if(g!==i.titleId){s--;break}o.push(i),s++}return a.value=o.filter(i=>m(i)).map(i=>i.value).join("").replace(new RegExp(L,"g"),""),{position:s,titleElement:a}};if(t.titleId){const{position:e,titleElement:n}=l(t,r,u);u=e,p.push(n)}if(t.type==="table"){const e=t.trList;for(let n=0;n<e.length;n++){const s=e[n];for(let g=0;g<s.tdList.length;g++){const a=s.tdList[g].value;if(a.length>1){let o=1;for(;o<a.length;){if(a[o]?.titleId){const{titleElement:i,position:N}=l(a[o],a,o);p.push(i),o=N}o++}}}}}u++}if(!p.length)return null;const f=(t,l)=>{const e=l.subCatalog[l.subCatalog.length-1],n=v[e?.level],s=v[t.level];e&&s>n?f(t,e):l.subCatalog.push({id:t.titleId,name:t.value,level:t.level,pageNo:t.pageNo,subCatalog:[]})},h=[];for(let t=0;t<p.length;t++){const l=p[t],e=h[h.length-1],n=v[e?.level],s=v[l.level];e&&s>n?f(l,e):h.push({id:l.titleId,name:l.value,level:l.level,pageNo:l.pageNo,subCatalog:[]})}return h}onmessage=c=>{const r=c.data,d=I(r);postMessage(d)}})();
507
+ `,Pr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Ir],{type:"text/javascript;charset=utf-8"});function Wh(o){let t;try{if(t=Pr&&(self.URL||self.webkitURL).createObjectURL(Pr),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Ir),{name:o?.name})}}const Mr=`(function(){"use strict";function u(e){const t=[];for(const s of e){if(s.type==="table"){const o=s.trList;for(let n=0;n<o.length;n++){const c=o[n];for(let r=0;r<c.tdList.length;r++){const i=c.tdList[r];t.push(...u(i.value))}}}if(s.groupIds)for(const o of s.groupIds)t.includes(o)||t.push(o)}return t}onmessage=e=>{const t=e.data,s=u(t);postMessage(s)}})();
508
+ `,Or=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Mr],{type:"text/javascript;charset=utf-8"});function Vh(o){let t;try{if(t=Or&&(self.URL||self.webkitURL).createObjectURL(Or),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Mr),{name:o?.name})}}const Cr='(function(){"use strict";var b=(e=>(e.HALF="half",e.ONE_THIRD="one-third",e.QUARTER="quarter",e))(b||{}),M=(e=>(e.ARABIC="arabic",e.CHINESE="chinese",e))(M||{});const K="​";b.HALF+"",1/2,b.ONE_THIRD+"",1/3,b.QUARTER+"",1/4;function H(e){if(typeof structuredClone=="function")return structuredClone(e);if(!e||typeof e!="object")return e;let I={};return Array.isArray(e)?I=e.map(f=>H(f)):Object.keys(e).forEach(f=>{I[f]=H(e[f])}),I}function D(e,I){const f={};for(const L in e)I.includes(L)&&(f[L]=e[L]);return f}function ee(e,I){return e.length!==I.length?!1:!e.some(f=>!I.includes(f))}var o=(e=>(e.TEXT="text",e.TEXTFIELD="TextField",e.BUTTON="button",e.IMAGE="image",e.TABLE="table",e.HYPERLINK="hyperlink",e.SUPERSCRIPT="superscript",e.SUBSCRIPT="subscript",e.SEPARATOR="separator",e.PAGE_BREAK="pageBreak",e.CONTROL="control",e.AREA="area",e.CHECKBOX="checkbox",e.RADIO="radio",e.LATEX="latex",e.TAB="tab",e.DATE="date",e.BLOCK="block",e.TITLE="title",e.LIST="list",e.SPLIT_TAG="splitTag",e.LABEL="label",e.MENSTRUAL_HISTORY="menstrualHistory",e.FETAL_HEART_POSITION="fetalHeartPosition",e.TOOTH_POSITION="toothPosition",e.SPECIAL_SYMBOLS="specialSymbols",e.MACRO="macro",e.CUSTOM_MACRO="customMacro",e.REUSABLE_ITEM="reusableItem",e.SUB_TEMPLATE="subTemplate",e))(o||{});const y=["rowFlex","rowMargin"],te=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","rowMargin","dashArray","trList","tdPadding","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig","templateId","subTemplateExpanded","logicTemplateId","logicTemplateName","logicTemplateTemplateId","logicTemplateDisplayRule"],oe=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],w=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"];o.TEXT,o.HYPERLINK,o.SUBSCRIPT,o.SUPERSCRIPT,o.CONTROL,o.DATE,o.IMAGE,o.LATEX,o.BLOCK,o.PAGE_BREAK,o.SEPARATOR,o.TABLE,o.TITLE,o.LIST;var Y=(e=>(e.UL="ul",e.OL="ol",e))(Y||{}),N=(e=>(e.DISC="disc",e.CIRCLE="circle",e.SQUARE="square",e.CHECKBOX="checkbox",e))(N||{}),_=(e=>(e.DISC="disc",e.CIRCLE="circle",e.SQUARE="square",e.DECIMAL="decimal",e.CHECKBOX="checkbox",e))(_||{});N.DISC+"",N.CIRCLE+"",N.SQUARE+"",N.CHECKBOX+"",Y.OL+"",Y.UL+"",_.DISC+"",_.CIRCLE+"",_.SQUARE+"",_.DECIMAL+"",_.CHECKBOX+"";var R=(e=>(e.FIRST="first",e.SECOND="second",e.THIRD="third",e.FOURTH="fourth",e.FIFTH="fifth",e.SIXTH="sixth",e))(R||{});R.FIRST+"",R.SECOND+"",R.THIRD+"",R.FOURTH+"",R.FIFTH+"",R.SIXTH+"",R.FIRST+"",R.SECOND+"",R.THIRD+"",R.FOURTH+"",R.FIFTH+"",R.SIXTH+"",R.FIRST,R.SECOND,R.THIRD,R.FOURTH,R.FIFTH,R.SIXTH;var v=(e=>(e.TEXT="text",e.SELECT="select",e.CHECKBOX="checkbox",e.RADIO="radio",e.DATE="date",e.NUMBER="number",e.TEXTFIELD="TextField",e.BUTTON="button",e.MENSTRUAL_HISTORY="menstrualHistory",e))(v||{}),c=(e=>(e.PREFIX="prefix",e.POSTFIX="postfix",e.PRE_TEXT="preText",e.PRETEXTFIX="preTextFix",e.PRETEXTFIX_TEXT="preTextFixText",e.POSTTEXTFIX="postTextFix",e.POSTTEXTFIX_TEXT="postTextFixText",e.POST_TEXT="postText",e.PLACEHOLDER="placeholder",e.TEXTFIXLABEL="textFixLabel",e.VALUE="value",e.DELETEPERSON="deletePerson",e.CHECKBOX="checkbox",e.RADIO="radio",e.UNDERLINE="underline",e))(c||{}),Q=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e.ALIGNMENT="alignment",e.JUSTIFY="justify",e))(Q||{}),q=(e=>(e.CONTAIN="contain",e.COVER="cover",e))(q||{}),W=(e=>(e.REPEAT="repeat",e.NO_REPEAT="no-repeat",e.REPEAT_X="repeat-x",e.REPEAT_Y="repeat-y",e))(W||{});q.COVER,W.NO_REPEAT;var z=(e=>(e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom",e))(z||{});z.BOTTOM,b.HALF,b.HALF,Q.CENTER,M.ARABIC,z.BOTTOM;var Z=(e=>(e.TEXT="text",e.IMAGE="image",e))(Z||{});Z.TEXT,M.ARABIC;var j=(e=>(e.PAGE="page",e.CONTINUITY="continuity",e))(j||{});j.CONTINUITY;function ne(e,I){const f=Object.keys(e),L=Object.keys(I);if(f.length!==L.length)return!1;for(let S=0;S<f.length;S++){const C=f[S];if(C!=="value"&&!(C==="groupIds"&&Array.isArray(e[C])&&Array.isArray(I[C])&&ee(e[C],I[C]))&&e[C]!==I[C])return!1}return!0}function k(e,I={}){const{extraPickAttrs:f}=I,L=[...te];f&&L.push(...f);const S={value:e?.value===K?`\n`:e?.value};return e&&L.forEach(C=>{const T=e[C];T!==void 0&&(S[C]=T)}),S}function P(e,I={}){const{extraPickAttrs:f,isClassifyArea:L=!1,isClone:S=!0,editorOptions:C}=I,T=(S?H(e):e).filter(t=>t.type!==o.SPLIT_TAG),B=[];let l=0;for(;l<T.length;){let t=T[l];if(l===0&&t.value===K&&!t.listId&&(!t.type||t.type===o.TEXT)){l++;continue}if(t.areaId){const r=t.areaId,p=t.area,E=[];for(;l<T.length;){const i=T[l];if(r!==i.areaId){l--;break}delete i.area,delete i.areaId,E.push(i),l++}const a=P(E,I);if(L){const i={type:o.AREA,value:"",areaId:r,area:p};i.valueList=a,t=i}else{B.splice(l,0,...a);continue}}else if(t.titleId&&t.level){const r=t.titleId;if(r){const p=t.level,E={type:o.TITLE,title:t.title,titleId:r,value:"",level:p},a=[];for(;l<T.length;){const i=T[l];if(r!==i.titleId){l--;break}delete i.level,delete i.title,a.push(i),l++}E.valueList=P(a,I),t=E}}else if(t.listId&&t.listType){const r=t.listId;if(r){const p=t.listType,E=t.listStyle,a=t?.label,i={type:o.LIST,value:"",label:a||"",listId:r,listType:p,listStyle:E},d=[];for(;l<T.length;){const s=T[l];if(r!==s.listId){l--;break}delete s.listType,delete s.listStyle,d.push(s),l++}i.valueList=P(d,I),t=i}}else if(t.type===o.TABLE){if(t.pagingId){let r=l+1,p=0;for(;r<T.length;){const E=T[r];if(E.pagingId===t.pagingId){t.height+=E.height;const a=E.trList.filter(i=>!i.pagingRepeat).filter(i=>(i.tdList=i.tdList.filter(d=>{if(d.originalId){for(let s=0;s<t.trList.length;s++){const u=t.trList[s].tdList.find(({id:n})=>n===d.originalId);if(u){d.value[0]?.type===o.SPLIT_TAG&&d.value.splice(0,1),u.value.push(...d.value),u.rowspan=u.originalRowspan??u.rowspan;break}}return!1}return!0}),!i.originalId));t.trList.push(...a),t.trList?.forEach(i=>i.minHeight=i.originalMinHeight??i.minHeight),r++,p++}else break}l+=p}if(t.trList)for(let r=0;r<t.trList.length;r++){const p=t.trList[r];delete p.id;for(let E=0;E<p.tdList.length;E++){const a=p.tdList[E],i={colspan:a.colspan,rowspan:a.rowspan,value:P(a.value,{...I,isClassifyArea:!1})};oe.forEach(d=>{const s=a[d];s!==void 0&&(i[d]=s)}),p.tdList[E]=i}}}else if(t.type===o.HYPERLINK){const r=t.hyperlinkId;if(r){const p={type:o.HYPERLINK,value:"",url:t.url},E=[];for(;l<T.length;){const a=T[l];if(r!==a.hyperlinkId){l--;break}delete a.type,delete a.url,E.push(a),l++}p.valueList=P(E,I),t=p}}else if(t.type===o.DATE){const r=t.dateId;if(r){const p={type:o.DATE,value:"",dateFormat:t.dateFormat},E=[];for(;l<T.length;){const a=T[l];if(r!==a.dateId){l--;break}delete a.type,delete a.dateFormat,E.push(a),l++}p.valueList=P(E,I),t=p}}else if(t.type!==o.BUTTON){if(t.controlId){const r=t.controlId;if(!(t.controlComponent===c.PREFIX||t.controlComponent===c.PRETEXTFIX||t.controlComponent===c.PRETEXTFIX_TEXT)&&t.controlComponent===c.VALUE){if(t.type===o.MENSTRUAL_HISTORY||t.type===o.FETAL_HEART_POSITION||t.type===o.TOOTH_POSITION||t.type===o.MACRO||t.type===o.CUSTOM_MACRO||t.type===o.REUSABLE_ITEM||t.type===o.LIST||t.type===o.SPECIAL_SYMBOLS){let d=!1;for(let s=l-1;s>=0;s--){const O=T[s],u=O.controlComponent===c.PREFIX||O.controlComponent===c.PRETEXTFIX||O.controlComponent===c.PRETEXTFIX_TEXT;if(O.controlId===r&&u){d=!0;break}if(O.controlId!==r)break}if(!d){const s=H(t);delete s.controlId,delete s.control,delete s.controlComponent,delete s.originControlId,B.push(s),l++;continue}}l++;continue}if(t.controlComponent===c.PLACEHOLDER||t.controlComponent===c.POSTFIX||t.controlComponent===c.POSTTEXTFIX||t.controlComponent===c.POSTTEXTFIX_TEXT||t.controlComponent===c.POST_TEXT||t.controlComponent===c.PRE_TEXT||t.controlComponent===c.CHECKBOX||t.controlComponent===c.RADIO){l++;continue}const E=(i,d,s,O)=>{if(O===v.CHECKBOX||O===v.RADIO){let n=-1;for(let g=i;g<T.length&&T[g].controlId===d;g++)n=g;return n}const u=s?[c.POSTTEXTFIX,c.POSTTEXTFIX_TEXT]:[c.POSTFIX];for(let n=i;n<T.length;n++){const g=T[n];if(g.controlId===d&&u.includes(g.controlComponent))return n}return-1},a=(i,d,s)=>{const O=[];let u=i;for(;u<=d;){const n=T[u];if(n.controlId&&n.controlId!==s&&n.control){const A=n.control?.type,m=A===v.TEXTFIELD,h=m?c.PRETEXTFIX:c.PREFIX,x=n.controlComponent===h,F=A===v.CHECKBOX||A===v.RADIO;if(x||F&&(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO)){const X=E(u+1,n.controlId,m,A);if(X!==-1){const V=T.slice(u,X+1).map(le=>{const $=H(le);return delete $.originControlId,$}),U=P(V,I);U.length>0&&O.push(U[0]),u=X+1;continue}}}if(!(n.controlId===s&&(n.controlComponent===c.VALUE||!n.controlComponent)&&(!n.originControlId||n.originControlId===s)||n.originControlId===s&&n.controlComponent===c.VALUE||n.controlId===s&&(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO)&&!n.originControlId)){u++;continue}if(n.type===o.MENSTRUAL_HISTORY||n.type===o.FETAL_HEART_POSITION||n.type===o.TOOTH_POSITION||n.type===o.MACRO||n.type===o.CUSTOM_MACRO||n.type===o.REUSABLE_ITEM||n.type===o.LIST||n.type===o.SPECIAL_SYMBOLS){const A=H(n);delete A.controlId,delete A.control,delete A.controlComponent,delete A.originControlId,O.push(A),u++;continue}if(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO){O.push(H(n)),u++;continue}const J=t.control?.type;if(J===v.CHECKBOX||J===v.RADIO){let A=u-1,m=!1;for(;A>=i-1;){const h=T[A];if(h.controlId===s&&!h.originControlId)if(h.controlComponent===c.CHECKBOX){m=h.checkbox?.value===!0;break}else if(h.controlComponent===c.RADIO){m=h.radio?.value===!0;break}else if(h.controlComponent===c.VALUE){A--;continue}else break;A--}if(m){const h={value:n.value||""},x=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const F of x){const X=n[F];if(X!==void 0){if(F==="color"&&C){const V=C.control?.bracketColor,U=C.control?.placeholderColor;if(X===V||X===U)continue}h[F]=X}}O.push(h)}}else{const A={value:n.value||""},m=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const h of m){const x=n[h];if(x!==void 0){if(h==="color"&&C){const F=C.control?.bracketColor,X=C.control?.placeholderColor;if(x===F||x===X)continue}A[h]=x}}O.push(A)}u++}return O};if(t.controlComponent===c.PREFIX){const i=t.control?.type===v.TEXTFIELD,d=E(l+1,r,i);if(d!==-1){const s=a(l+1,d-1,r),O=D(t,w),u={...t.control,...O,value:s},n={...D(t,y),type:o.CONTROL,value:"",control:u,controlId:r};t=k(n,{extraPickAttrs:f}),l=d}}if(t.controlComponent===c.PRETEXTFIX){const i=E(l+1,r,!0);if(i!==-1){const d=a(l+1,i-1,r),s=D(t,w),O={...t.control,...s,value:d},u={...D(t,y),type:o.CONTROL,value:"",control:O,controlId:r};t=k(u,{extraPickAttrs:f}),l=i}}if(t.controlComponent===c.PRETEXTFIX_TEXT){const i=E(l+1,r,!0);if(i!==-1){const d=a(l+1,i-1,r),s=D(t,w),O={...t.control,...s,value:d},u={...D(t,y),type:o.CONTROL,value:"",control:O,controlId:r};t=k(u,{extraPickAttrs:f}),l=i}}}}const G=k(t,{extraPickAttrs:f});if(!t.type||t.type===o.TEXT||t.type===o.SUBSCRIPT||t.type===o.SUPERSCRIPT)for(;l<T.length;){const r=T[l+1];if(l++,r&&ne(G,k(r,{extraPickAttrs:f}))){const p=r.value===K?`\n`:r.value;G.value+=p}else break}else l++;B.push(G)}return B}onmessage=e=>{const I=e.data,{options:f,data:L}=I,{extraPickAttrs:S=[]}=f||{},C={header:P(L.header,{extraPickAttrs:S,isClone:!1}),main:P(L.main,{extraPickAttrs:S,isClassifyArea:!0,isClone:!1}),footer:P(L.footer,{extraPickAttrs:S,isClone:!1})};postMessage(C)}})();\n',Sr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Cr],{type:"text/javascript;charset=utf-8"});function Yh(o){let t;try{if(t=Sr&&(self.URL||self.webkitURL).createObjectURL(Sr),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Cr),{name:o?.name})}}class Dh{draw;wordCountWorker;catalogWorker;groupWorker;valueWorker;constructor(t){this.draw=t,this.wordCountWorker=new bh,this.catalogWorker=new Wh,this.groupWorker=new Vh,this.valueWorker=new Yh}getWordCount(){return new Promise((t,e)=>{this.wordCountWorker.onmessage=i=>{t(i.data)},this.wordCountWorker.onerror=i=>{e(i)};const n=this.draw.getOriginalMainElementList();this.wordCountWorker.postMessage(n)})}getCatalog(){return new Promise((t,e)=>{this.catalogWorker.onmessage=r=>{t(r.data)},this.catalogWorker.onerror=r=>{e(r)};const n=this.draw.getOriginalMainElementList(),i=this.draw.getPosition().getOriginalMainPositionList();this.catalogWorker.postMessage({elementList:n,positionList:i})})}getGroupIds(){return new Promise((t,e)=>{this.groupWorker.onmessage=i=>{t(i.data)},this.groupWorker.onerror=i=>{e(i)};const n=this.draw.getOriginalMainElementList();this.groupWorker.postMessage(n)})}getValue(t){return new Promise((e,n)=>{this.valueWorker.onmessage=i=>{e({version:He,data:i.data,options:at(this.draw.getOptions())})},this.valueWorker.onerror=i=>{n(i)},this.valueWorker.postMessage({data:this.draw.getOriginValue(t),options:t})})}}class Uh{container;canvas;draw;options;curElement;curElementSrc;previewerDrawOption;curPosition;eventBus;imageList;curShowElement;imageCount;imagePre;imageNext;resizerSelection;resizerHandleList;resizerImageContainer;resizerImage;resizerSize;width;height;mousedownX;mousedownY;curHandleIndex;previewerContainer;previewerImage;constructor(t){this.container=t.getContainer(),this.canvas=t.getPage(),this.draw=t,this.options=t.getOptions(),this.curElement=null,this.curElementSrc="",this.previewerDrawOption={},this.curPosition=null,this.eventBus=t.getEventBus(),this.imageList=[],this.curShowElement=null,this.imageCount=null,this.imagePre=null,this.imageNext=null;const{resizerSelection:e,resizerHandleList:n,resizerImageContainer:i,resizerImage:r,resizerSize:s}=this._createResizerDom();this.resizerSelection=e,this.resizerHandleList=n,this.resizerImageContainer=i,this.resizerImage=r,this.resizerSize=s,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.previewerContainer=null,this.previewerImage=null}_getElementPosition(t,e=null){const{scale:n}=this.options;let i=0,r=0;const s=this.draw.getHeight(),a=this.draw.getPageGap(),d=(e?.pageNo??this.draw.getPageNo())*(s+a);if(t.imgFloatPosition)i=t.imgFloatPosition.x*n,r=t.imgFloatPosition.y*n+d;else if(e){const{coordinate:{leftTop:[R,u]},ascent:h}=e;i=R,r=u+d+h}return{x:i,y:r}}_createResizerDom(){const{scale:t}=this.options,e=document.createElement("div");e.classList.add(`${z}-resizer-selection`),e.style.display="none",e.style.borderColor=this.options.resizerColor,e.style.borderWidth=`${t}px`;const n=[];for(let c=0;c<8;c++){const d=document.createElement("div");d.style.background=this.options.resizerColor,d.classList.add("resizer-handle"),d.classList.add(`handle-${c}`),d.setAttribute("data-index",String(c)),d.onmousedown=this._mousedown.bind(this),e.append(d),n.push(d)}this.container.append(e);const i=document.createElement("div");i.classList.add(`${z}-resizer-size-view`);const r=document.createElement("span");i.append(r),e.append(i);const s=document.createElement("div");s.classList.add(`${z}-resizer-image`),s.style.display="none";const a=document.createElement("img");return s.append(a),this.container.append(s),{resizerSelection:e,resizerHandleList:n,resizerImageContainer:s,resizerImage:a,resizerSize:r}}_keydown=()=>{this.resizerSelection.style.display==="block"&&(this.clearResizer(),document.removeEventListener("keydown",this._keydown))};_mousedown(t){if(this.canvas=this.draw.getPage(),!this.curElement)return;const{scale:e}=this.options;this.mousedownX=t.x,this.mousedownY=t.y;const n=t.target;this.curHandleIndex=Number(n.dataset.index);const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,this.canvas.style.cursor=i,this.resizerImage.src=this.curElementSrc,this.resizerImageContainer.style.display="block";const{x:r,y:s}=this._getElementPosition(this.curElement,this.curPosition);this.resizerImageContainer.style.left=`${r}px`,this.resizerImageContainer.style.top=`${s}px`,this.resizerImage.style.width=`${this.curElement.width*e}px`,this.resizerImage.style.height=`${this.curElement.height*e}px`;const a=this._mousemove.bind(this);document.addEventListener("mousemove",a),document.addEventListener("mouseup",()=>{this.curElement&&!this.previewerDrawOption.dragDisable&&(this.curElement.width=this.width,this.curElement.height=this.height,this.draw.render({isSetCursor:!0,curIndex:this.curPosition?.index})),this.resizerImageContainer.style.display="none",document.removeEventListener("mousemove",a),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),t.preventDefault()}_mousemove(t){if(!this.curElement||this.previewerDrawOption.dragDisable)return;const{scale:e}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const d=this.mousedownX-t.x,R=this.mousedownY-t.y;n=Math.cbrt(d**3+R**3),i=this.curElement.height*n/this.curElement.width}break;case 1:i=this.mousedownY-t.y;break;case 2:{const d=t.x-this.mousedownX,R=this.mousedownY-t.y;n=Math.cbrt(d**3+R**3),i=this.curElement.height*n/this.curElement.width}break;case 4:{const d=t.x-this.mousedownX,R=t.y-this.mousedownY;n=Math.cbrt(d**3+R**3),i=this.curElement.height*n/this.curElement.width}break;case 3:n=t.x-this.mousedownX;break;case 5:i=t.y-this.mousedownY;break;case 6:{const d=this.mousedownX-t.x,R=t.y-this.mousedownY;n=Math.cbrt(d**3+R**3),i=this.curElement.height*n/this.curElement.width}break;case 7:n=this.mousedownX-t.x;break}const r=this.curElement.width+n/e,s=this.curElement.height+i/e;if(r<=0||s<=0)return;this.width=r,this.height=s;const a=r*e,c=s*e;this.resizerImage.style.width=`${a}px`,this.resizerImage.style.height=`${c}px`,this._updateResizerRect(a,c),this._updateResizerSizeView(a,c),t.preventDefault(),this.eventBus.isSubscribe("imageSizeChange")&&this.eventBus.emit("imageSizeChange",{element:this.curElement})}_drawPreviewer(){const t=document.createElement("div");t.classList.add(`${z}-image-previewer`);const e=document.createElement("i");e.classList.add("image-close"),e.onclick=()=>{this._clearPreviewer()},t.append(e);const n=document.createElement("div");n.classList.add(`${z}-image-container`);const i=document.createElement("img");i.src=this.curElementSrc,i.draggable=!1,n.append(i),this.previewerImage=i,t.append(n);let r=0,s=0,a=1,c=0;const d=document.createElement("div");d.classList.add(`${z}-image-menu`);const R=document.createElement("div");R.classList.add("image-navigate");const u=document.createElement("i");u.classList.add("image-pre"),u.onclick=()=>{const S=this.imageList.findIndex(F=>F.id===this.curShowElement?.id);S<=0||(this.curShowElement=this.imageList[S-1],i.src=this.curShowElement.value,this._updateImageNavigate())},R.append(u),this.imagePre=u;const h=document.createElement("span");h.classList.add("image-count"),this.imageCount=h,R.append(h);const g=document.createElement("i");g.classList.add("image-next"),g.onclick=()=>{const S=this.imageList.findIndex(F=>F.id===this.curShowElement?.id);S>=this.imageList.length-1||(this.curShowElement=this.imageList[S+1],i.src=this.curShowElement.value,this._updateImageNavigate())},this.imageNext=g,R.append(g),d.append(R);const f=document.createElement("i");f.classList.add("zoom-in"),f.onclick=()=>{a+=.1,this._setPreviewerTransform(a,c,r,s)},d.append(f);const T=document.createElement("i");T.onclick=()=>{a-.1<=.1||(a-=.1,this._setPreviewerTransform(a,c,r,s))},T.classList.add("zoom-out"),d.append(T);const m=document.createElement("i");m.classList.add("rotate"),m.onclick=()=>{c+=1,this._setPreviewerTransform(a,c,r,s)},d.append(m);const p=document.createElement("i");p.classList.add("original-size"),p.onclick=()=>{r=0,s=0,a=1,c=0,this._setPreviewerTransform(a,c,r,s)},d.append(p);const I=document.createElement("i");I.classList.add("image-download"),I.onclick=()=>{const{mime:S}=this.previewerDrawOption;Di(i.src,`${this.curElement?.id}.${S||"png"}`)},d.append(I),t.append(d),this.previewerContainer=t,document.body.append(t);let L=0,P=0,O=!1;i.onmousedown=S=>{O=!0,L=S.x,P=S.y,t.style.cursor="move"},t.onmousemove=S=>{O&&(r+=S.x-L,s+=S.y-P,L=S.x,P=S.y,this._setPreviewerTransform(a,c,r,s))},t.onmouseup=()=>{O=!1,t.style.cursor="auto"},t.onwheel=S=>{if(S.preventDefault(),S.stopPropagation(),S.deltaY<0)a+=.1;else{if(a-.1<=.1)return;a-=.1}this._setPreviewerTransform(a,c,r,s)},this._updateImageNavigate()}_updateImageNavigate(){const t=this.imageList.findIndex(e=>e.id===this.curShowElement?.id);this.imageCount.innerText=`${t+1} / ${this.imageList.length}`,t<=0?this.imagePre.classList.add("disabled"):this.imagePre.classList.remove("disabled"),t>=this.imageList.length-1?this.imageNext.classList.add("disabled"):this.imageNext.classList.remove("disabled")}_setPreviewerTransform(t,e,n,i){this.previewerImage&&(this.previewerImage.style.left=`${n}px`,this.previewerImage.style.top=`${i}px`,this.previewerImage.style.transform=`scale(${t}) rotate(${e*90}deg)`)}_clearPreviewer(){this.previewerContainer?.remove(),this.previewerContainer=null,document.body.style.overflow="auto"}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options,r=this.draw.isReadonly();this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let s=0;s<8;s++){const a=s===0||s===6||s===7?-n:s===1||s===5?t/2:t-n,c=s===0||s===1||s===2?-n:s===3||s===7?e/2-n:e-n;this.resizerHandleList[s].style.transform=`scale(${i})`,this.resizerHandleList[s].style.left=`${a}px`,this.resizerHandleList[s].style.top=`${c}px`,this.resizerHandleList[s].style.display=r?"none":"block"}}_updateResizerSizeView(t,e){this.resizerSize.innerText=`${Math.round(t)} × ${Math.round(e)}`}render(){const t=this.draw.getMode();!this.curElement||this.curElement.imgToolDisabled&&!this.draw.isDesignMode()||t===l.EditorMode.PRINT&&this.options.modeRule[l.EditorMode.PRINT]?.imagePreviewerDisabled||t===l.EditorMode.READONLY&&this.options.modeRule[l.EditorMode.READONLY]?.imagePreviewerDisabled||(this.imageList=this.draw.getImageParticle().getOriginalMainImageList(),this.curShowElement=this.curElement,this._drawPreviewer(),document.body.style.overflow="hidden")}drawResizer(t,e=null,n={}){const i=this.draw.getMode();t.imgToolDisabled&&!this.draw.isDesignMode()||i===l.EditorMode.PRINT&&this.options.modeRule[l.EditorMode.PRINT]?.imagePreviewerDisabled||i===l.EditorMode.READONLY&&this.options.modeRule[l.EditorMode.READONLY]?.imagePreviewerDisabled||(this.previewerDrawOption=n,this.curElementSrc=t[n.srcKey||"value"]||"",this.updateResizer(t,e),document.addEventListener("keydown",this._keydown))}updateResizer(t,e=null){const{scale:n}=this.options,i=t.width*n,r=t.height*n;this._updateResizerSizeView(i,r);const{x:s,y:a}=this._getElementPosition(t,e);this.resizerSelection.style.left=`${s}px`,this.resizerSelection.style.top=`${a}px`,this.resizerSelection.style.borderWidth=`${n}px`,this._updateResizerRect(i,r),this.resizerSelection.style.display="block",this.curElement=t,this.curPosition=e,this.width=i,this.height=r}clearResizer(){this.resizerSelection.style.display="none",document.removeEventListener("keydown",this._keydown)}}class wh{draw;range;datePicker;options;constructor(t){this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.datePicker=new hr(t,{onSubmit:this._setValue.bind(this)})}_setValue(t){if(!t)return;const e=this.getDateElementRange();if(!e)return;const[n,i]=e,r=this.draw.getElementList(),s=r[n+1];this.draw.spliceElementList(r,n+1,i-n),this.range.setRange(n,n);const a={type:l.ElementType.DATE,value:"",dateFormat:s.dateFormat,valueList:[{value:t}]};Ut(r,[a],n,{editorOptions:this.options}),this.draw.insertElementList([a])}getDateElementRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList(),s=r[n];if(s.type!==l.ElementType.DATE)return null;let a=n;for(;a>=0;){if(r[a].dateId!==s.dateId){t=a;break}a--}let c=n+1;for(;c<r.length;){if(r[c].dateId!==s.dateId){e=c-1;break}c++}return c===r.length&&(e=c-1),!~t||!~e?null:[t,e]}clearDatePicker(){this.datePicker.dispose()}renderDatePicker(t,e){const n=this.draw.getElementList(),i=this.getDateElementRange(),r=i?n.slice(i[0]+1,i[1]+1).map(s=>s.value).join(""):"";this.datePicker.render({value:r,position:e,dateFormat:t.dateFormat})}}class Er{element;videoCache;constructor(t){this.element=t,this.videoCache=new Map}snapshot(t,e,n){return new Promise((i,r)=>{const s=this.element.block?.videoBlock?.src||"";if(this.videoCache.has(s)){const a=this.videoCache.get(s);t.drawImage(a,e,n,this.element.metrics.width,this.element.metrics.height),i(this.element)}else{const a=document.createElement("video");a.src=s,a.muted=!0,a.crossOrigin="anonymous",a.onloadeddata=()=>{t.drawImage(a,e,n,this.element.metrics.width,this.element.metrics.height),this.videoCache.set(s,a),i(this.element)},a.onerror=c=>{r(c)},a.play().then(()=>{a.pause()})}})}render(t){const e=this.element.block,n=document.createElement("video");n.style.width="100%",n.style.height="100%",n.style.objectFit="contain",n.src=e.videoBlock?.src||"",n.controls=!0,t.append(n)}}class Zh{draw;options;element;block;blockContainer;blockItem;blockCache;resizerMask;resizerSelection;resizerHandleList;width;height;mousedownX;mousedownY;curHandleIndex;isAllowResize;constructor(t,e){this.draw=t.getDraw(),this.options=this.draw.getOptions(),this.blockContainer=t.getBlockContainer(),this.element=e,this.block=null;const{blockItem:n,resizerMask:i,resizerSelection:r,resizerHandleList:s}=this._createBlockItem();this.blockItem=n,this.blockContainer.append(this.blockItem),this.blockCache=new Map,this.resizerMask=i,this.resizerSelection=r,this.resizerHandleList=s,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.isAllowResize=!1}getBlockElement(){return this.element}getBlockWidth(){return this.element.width||this.element.metrics.width}_createBlockItem(){const{scale:t,resizerColor:e}=this.options,n=document.createElement("div");n.classList.add(`${z}-block-item`);const i=document.createElement("div");i.style.display="none",i.classList.add(`${z}-resizer-selection`),i.style.borderColor=e,i.style.borderWidth=`${t}px`;const r=[];for(let a=0;a<8;a++){const c=document.createElement("div");c.style.background=e,c.classList.add("resizer-handle"),c.classList.add(`handle-${a}`),c.setAttribute("data-index",String(a)),c.onmousedown=this._mousedown.bind(this),i.append(c),r.push(c)}const s=document.createElement("div");return s.classList.add(`${z}-resizer-mask`),s.style.display="none",n.append(s),n.onmouseenter=()=>{if(this.draw.isReadonly())return;const{width:c,height:d}=this.element.metrics;this._updateResizerRect(c,d),i.style.display="block"},n.onmouseleave=()=>{this.isAllowResize||(i.style.display="none")},n.append(i),{blockItem:n,resizerMask:s,resizerSelection:i,resizerHandleList:r}}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options;this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let r=0;r<8;r++){const s=r===0||r===6||r===7?-n:r===1||r===5?t/2:t-n,a=r===0||r===1||r===2?-n:r===3||r===7?e/2-n:e-n;this.resizerHandleList[r].style.transform=`scale(${i})`,this.resizerHandleList[r].style.left=`${s}px`,this.resizerHandleList[r].style.top=`${a}px`}}_mousedown(t){const e=this.draw.getPage();this.mousedownX=t.x,this.mousedownY=t.y,this.isAllowResize=!0;const n=t.target;this.curHandleIndex=Number(n.dataset.index),this.resizerMask.style.display="block";const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,e.style.cursor=i;const r=this._mousemove.bind(this);document.addEventListener("mousemove",r),document.addEventListener("mouseup",()=>{this.element.width=Math.min(this.width,this.draw.getInnerWidth()),this.element.height=this.height,this.isAllowResize=!1,this.resizerSelection.style.display="none",this.resizerMask.style.display="none",document.removeEventListener("mousemove",r),document.body.style.cursor="",e.style.cursor="text",this.draw.render()},{once:!0}),t.preventDefault()}_mousemove(t){if(!this.isAllowResize)return;const{scale:e}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const d=this.mousedownX-t.x,R=this.mousedownY-t.y;n=Math.cbrt(d**3+R**3),i=this.element.height*n/this.getBlockWidth()}break;case 1:i=this.mousedownY-t.y;break;case 2:{const d=t.x-this.mousedownX,R=this.mousedownY-t.y;n=Math.cbrt(d**3+R**3),i=this.element.height*n/this.getBlockWidth()}break;case 4:{const d=t.x-this.mousedownX,R=t.y-this.mousedownY;n=Math.cbrt(d**3+R**3),i=this.element.height*n/this.getBlockWidth()}break;case 3:n=t.x-this.mousedownX;break;case 5:i=t.y-this.mousedownY;break;case 6:{const d=this.mousedownX-t.x,R=t.y-this.mousedownY;n=Math.cbrt(d**3+R**3),i=this.element.height*n/this.getBlockWidth()}break;case 7:n=this.mousedownX-t.x;break}const r=this.getBlockWidth()+n/e,s=this.element.height+i/e;if(r<=0||s<=0)return;this.width=r,this.height=s;const a=r*e,c=s*e;this._updateResizerRect(a,c),this.blockItem.style.width=`${a}px`,this.blockItem.style.height=`${c}px`,t.preventDefault()}snapshot(t,e,n){if(this.element.block.type===l.BlockType.VIDEO)if(this.blockItem.style.display="none",this.blockCache.has(this.element.id))this.blockCache.get(this.element.id).snapshot(t,e,n);else{this.block=new Er(this.element);const r=this.block.snapshot(t,e,n);this.draw.getImageObserver().add(r),this.blockCache.set(this.element.id,this.block)}}render(){const t=this.element.block;t.type===l.BlockType.IFRAME?(this.block=new qe(this.element),this.block.render(this.blockItem)):t.type===l.BlockType.VIDEO&&(this.block=new Er(this.element),this.block.render(this.blockItem))}setClientRects(t,e,n){const i=this.draw.getHeight(),r=this.draw.getPageGap(),s=t*(i+r),{metrics:a}=this.element;this.blockItem.style.display="block",this.blockItem.style.width=`${a.width}px`,this.blockItem.style.height=`${a.height}px`,this.blockItem.style.left=`${e}px`,this.blockItem.style.top=`${s+n}px`}remove(){this.blockItem.remove()}}class Qh{draw;container;blockContainer;blockMap;constructor(t){this.draw=t,this.container=t.getContainer(),this.blockMap=new Map,this.blockContainer=this._createBlockContainer(),this.container.append(this.blockContainer)}_createBlockContainer(){const t=document.createElement("div");return t.classList.add(`${z}-block-container`),t}getDraw(){return this.draw}getBlockContainer(){return this.blockContainer}render(t,e,n,i,r){const s=n.id;let a=this.blockMap.get(s);a||(a=new Zh(this,n),a.render(),this.blockMap.set(s,a)),this.draw.isPrintMode()?a.snapshot(t,i,r):a.setClientRects(e,i,r)}clear(){if(!this.blockMap.size)return;const t=this.draw.getOriginalMainElementList(),e=[];for(let n=0;n<t.length;n++){const i=t[n];i.type===l.ElementType.BLOCK&&e.push(i.id)}this.blockMap.forEach(n=>{const i=n.getBlockElement().id;e.includes(i)||(n.remove(),this.blockMap.delete(i))})}}const Ni={contextmenu:{global:{cut:"剪切",copy:"复制",paste:"粘贴",selectAll:"全选",print:"打印",cancel:"取消"},control:{delete:"删除控件",editAttribute:"修改元素配置",addExpression:"添加表达式",addMenstrualHistory:"月经史",addFetalHeartPosition:"胎心位置"},hyperlink:{delete:"删除链接",cancel:"取消链接",edit:"编辑链接"},image:{change:"更改图片",saveAs:"另存为图片",textWrap:"文字环绕",textWrapType:{embed:"嵌入型",upDown:"上下型环绕",surround:"四周型环绕",floatTop:"浮于文字上方",floatBottom:"衬于文字下方"}},table:{insertRowCol:"插入行列",insertTopRow:"上方插入1行",insertBottomRow:"下方插入1行",insertLeftCol:"左侧插入1列",insertRightCol:"右侧插入1列",deleteRowCol:"删除行列",deleteRow:"删除1行",deleteCol:"删除1列",deleteTable:"删除整个表格",mergeCell:"合并单元格",mergeCancelCell:"取消合并",verticalAlign:"垂直对齐",verticalAlignTop:"顶端对齐",verticalAlignMiddle:"垂直居中",verticalAlignBottom:"底端对齐",border:"表格边框",borderAll:"所有框线",borderEmpty:"无框线",borderDash:"虚框线",borderExternal:"外侧框线",borderInternal:"内侧框线",borderTd:"单元格边框",borderTdTop:"上边框",borderTdRight:"右边框",borderTdBottom:"下边框",borderTdLeft:"左边框",borderTdForward:"正斜线",borderTdBack:"反斜线",tableProperties:"表格属性"}},datePicker:{now:"此刻",confirm:"确定",return:"返回日期",timeSelect:"时间选择",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},year:"年",month:"月",hour:"时",minute:"分",second:"秒"},frame:{header:"页眉",footer:"页脚"},pageBreak:{displayName:"分页符"},zone:{headerTip:"双击编辑页眉",footerTip:"双击编辑页脚"}},vh={contextmenu:{global:{cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select all",print:"Print",cancel:"Cancel"},control:{delete:"Delete control",editAttribute:"Edit control config",addExpression:"Add expression",addMenstrualHistory:"Menstrual History",addFetalHeartPosition:"Fetal Heart Position"},hyperlink:{delete:"Delete hyperlink",cancel:"Cancel hyperlink",edit:"Edit hyperlink"},image:{change:"Change image",saveAs:"Save as image",textWrap:"Text wrap",textWrapType:{embed:"Embed",upDown:"Up down",surround:"Surround",floatTop:"Float above text",floatBottom:"Float below text"}},table:{insertRowCol:"Insert row col",insertTopRow:"Insert top 1 row",insertBottomRow:"Insert bottom 1 row",insertLeftCol:"Insert left 1 col",insertRightCol:"Insert right 1 col",deleteRowCol:"Delete row col",deleteRow:"Delete 1 row",deleteCol:"Delete 1 col",deleteTable:"Delete table",mergeCell:"Merge cell",mergeCancelCell:"Cancel merge cell",verticalAlign:"Vertical align",verticalAlignTop:"Top",verticalAlignMiddle:"Middle",verticalAlignBottom:"Bottom",border:"Table border",borderAll:"All",borderEmpty:"Empty",borderDash:"Dash",borderExternal:"External",borderInternal:"Internal",borderTd:"Table cell border",borderTdTop:"Top",borderTdRight:"Right",borderTdBottom:"Bottom",borderTdLeft:"Left",borderTdForward:"Forward",borderTdBack:"Back",tableProperties:"Table Properties"}},datePicker:{now:"Now",confirm:"Confirm",return:"Return",timeSelect:"Time select",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},year:" ",month:" ",hour:"Hour",minute:"Minute",second:"Second"},frame:{header:"Header",footer:"Footer"},pageBreak:{displayName:"Page Break"},zone:{headerTip:"Double click to edit header",footerTip:"Double click to edit footer"}};class Kh{currentLocale;langMap=new Map([["zhCN",Ni],["en",vh]]);constructor(t){this.currentLocale=t}registerLangMap(t,e){const n=this.langMap.get(t);this.langMap.set(t,Ui(n||Ni,e))}getLocale(){return this.currentLocale}setLocale(t){this.currentLocale=t}getLang(){return this.langMap.get(this.currentLocale)||Ni}t(t){const e=t.split(".");let n="",i=this.getLang();for(let r=0;r<e.length;r++){const s=e[r],a=Reflect.get(i,s);if(a)n=i=a;else return""}return n}}class Hh{promiseList;constructor(){this.promiseList=[]}add(t){this.promiseList.push(t)}clearAll(){this.promiseList=[]}allSettled(){return Promise.allSettled(this.promiseList)}}class _h{draw;zone;i18n;container;pageContainer;isDisableMouseMove;tipContainer;tipContent;currentMoveZone;constructor(t,e){this.draw=t,this.zone=e,this.i18n=t.getI18n(),this.container=t.getContainer(),this.pageContainer=t.getPageContainer();const{tipContainer:n,tipContent:i}=this._drawZoneTip();this.tipContainer=n,this.tipContent=i,this.isDisableMouseMove=!0,this.currentMoveZone=l.EditorZone.MAIN;const r=[],{header:s,footer:a}=t.getOptions();s.disabled||r.push(l.EditorZone.HEADER),a.disabled||r.push(l.EditorZone.FOOTER),r.length&&this._watchMouseMoveZoneChange(r)}_watchMouseMoveZoneChange(t){this.pageContainer.addEventListener("mousemove",Gr(e=>{if(!(this.isDisableMouseMove||!this.draw.getIsPagingMode())){if(this.draw.getMode()!==l.EditorMode.EDIT){this._updateZoneTip(!1);return}if(e.offsetY)if(e.target instanceof HTMLCanvasElement){const n=this.zone.getZoneByY(e.offsetY);if(!t.includes(n)){this._updateZoneTip(!1);return}this.currentMoveZone=n,this._updateZoneTip(this.zone.getZone()===l.EditorZone.MAIN&&(n===l.EditorZone.HEADER||n===l.EditorZone.FOOTER),e.x,e.y)}else this._updateZoneTip(!1)}},250)),this.pageContainer.addEventListener("mouseenter",()=>{this.isDisableMouseMove=!1}),this.pageContainer.addEventListener("mouseleave",()=>{this.isDisableMouseMove=!0,this._updateZoneTip(!1)})}_drawZoneTip(){const t=document.createElement("div");t.classList.add(`${z}-zone-tip`);const e=document.createElement("span");return t.append(e),this.container.append(t),{tipContainer:t,tipContent:e}}_updateZoneTip(t,e,n){t?(this.tipContainer.classList.add("show"),this.tipContainer.style.left=`${e}px`,this.tipContainer.style.top=`${n}px`,this.tipContent.innerText=this.i18n.t(`zone.${this.currentMoveZone===l.EditorZone.HEADER?"headerTip":"footerTip"}`)):this.tipContainer.classList.remove("show")}}class xh{INDICATOR_PADDING=2;INDICATOR_TITLE_TRANSLATE=[20,5];draw;options;i18n;container;currentZone;indicatorContainer;constructor(t){this.draw=t,this.i18n=t.getI18n(),this.options=t.getOptions(),this.container=t.getContainer(),this.currentZone=l.EditorZone.MAIN,this.indicatorContainer=null,this.options.zone.tipDisabled||new _h(t,this)}isHeaderActive(){return this.getZone()===l.EditorZone.HEADER}isMainActive(){return this.getZone()===l.EditorZone.MAIN}isFooterActive(){return this.getZone()===l.EditorZone.FOOTER}getZone(){return this.currentZone}setZone(t){const{header:e,footer:n}=this.options;!e.editable&&t===l.EditorZone.HEADER||!n.editable&&t===l.EditorZone.FOOTER||this.currentZone!==t&&(this.currentZone=t,this.draw.getRange().clearRange(),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),this.drawZoneIndicator(),Eo(()=>{const i=this.draw.getListener();i.zoneChange&&i.zoneChange(t);const r=this.draw.getEventBus();r.isSubscribe("zoneChange")&&r.emit("zoneChange",t)}))}getZoneByY(t){const e=this.draw.getHeader(),n=e.getHeaderTop()+e.getHeight(),i=this.draw.getFooter(),s=this.draw.getHeight()-(i.getFooterBottom()+i.getHeight());return t<n?l.EditorZone.HEADER:t>s?l.EditorZone.FOOTER:l.EditorZone.MAIN}drawZoneIndicator(){if(this._clearZoneIndicator(),!this.isHeaderActive()&&!this.isFooterActive())return;const{scale:t}=this.options,e=this.isHeaderActive(),[n,i]=this.INDICATOR_TITLE_TRANSLATE,r=this.draw.getPageList(),s=this.draw.getMargins(),a=this.draw.getInnerWidth(),c=this.draw.getHeight(),d=this.draw.getPageGap(),R=c+d;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${z}-zone-indicator`);const u=this.draw.getHeader(),h=this.draw.getFooter(),g=e?u.getHeight():h.getHeight(),f=e?u.getHeaderTop():c-h.getFooterBottom()-g;for(let T=0;T<r.length;T++){const m=R*T+f,p=s[3]-this.INDICATOR_PADDING,I=s[3]+a+this.INDICATOR_PADDING,L=e?m-this.INDICATOR_PADDING:m+g+this.INDICATOR_PADDING,P=e?m+g+this.INDICATOR_PADDING:m-this.INDICATOR_PADDING,O=document.createElement("div");O.innerText=this.i18n.t(`frame.${e?"header":"footer"}`),O.style.top=`${P}px`,O.style.transform=`translate(${n*t}px, ${i*t}px) scale(${t})`,this.indicatorContainer.append(O);const S=document.createElement("span");S.classList.add(`${z}-zone-indicator-border__top`),S.style.top=`${L}px`,S.style.width=`${a}px`,S.style.marginLeft=`${s[3]}px`,this.indicatorContainer.append(S);const F=document.createElement("span");F.classList.add(`${z}-zone-indicator-border__left`),F.style.top=`${m}px`,F.style.height=`${g}px`,F.style.left=`${p}px`,this.indicatorContainer.append(F);const N=document.createElement("span");N.classList.add(`${z}-zone-indicator-border__bottom`),N.style.top=`${P}px`,this.indicatorContainer.append(N);const V=document.createElement("span");V.classList.add(`${z}-zone-indicator-border__right`),V.style.top=`${m}px`,V.style.height=`${g}px`,V.style.left=`${I}px`,this.indicatorContainer.append(V)}this.container.append(this.indicatorContainer)}_clearZoneIndicator(){this.indicatorContainer?.remove(),this.indicatorContainer=null}}class Gh{draw;position;zone;options;elementList;rowList;positionList;constructor(t,e){this.draw=t,this.position=t.getPosition(),this.zone=t.getZone(),this.options=t.getOptions(),this.elementList=e||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(t){this.elementList=t}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const t=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:t,elementList:this.elementList})}_computePositionList(){const t=this.getFooterBottom(),e=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],r=this.draw.getHeight(),s=this.getHeight(),a=r-t-s;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:a,innerWidth:e,zone:l.EditorZone.FOOTER})}getFooterBottom(){const{footer:{bottom:t,disabled:e},scale:n}=this.options;return e?0:Math.floor(t*n)}getMaxHeight(){const{footer:{maxHeightRadio:t}}=this.options,e=this.draw.getHeight();return Math.floor(e*Vi[t])}getHeight(){if(this.options.footer.disabled)return 0;const t=this.getMaxHeight(),e=this.getRowHeight();return e>t?t:e}getRowHeight(){return this.rowList.reduce((t,e)=>t+e.height,0)}getExtraHeight(){const t=this.draw.getMargins(),e=this.getHeight(),i=this.getFooterBottom()+e-t[2];return i<=0?0:i}render(t,e){t.save(),t.globalAlpha=this.zone.isFooterActive()?1:this.options.footer.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),r=[];let s=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(s+c.height>i)break;r.push(c),s+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:r,pageNo:e,startIndex:0,innerWidth:n,zone:l.EditorZone.FOOTER}),t.restore()}}class Ah{draw;range;options;UN_COUNT_STYLE_WIDTH=20;MEASURE_BASE_TEXT="0";LIST_GAP=10;constructor(t){this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}setList(t,e){if(this.draw.isReadonly())return;const{startIndex:i,endIndex:r}=this.range.getRange();if(!~i&&!~r)return;const s=this.range.getRangeParagraphElementList();if(!s||!s.length)return;if(s.find(u=>u.listType===t&&u.listStyle===e)||!t){this.unsetList();return}const c=lt();s.forEach(u=>{u.listId=c,u.listType=t,u.listStyle=e});const d=i===r,R=d?r:i;this.draw.render({curIndex:R,isSetCursor:d})}unsetList(){if(this.draw.isReadonly())return;const{startIndex:e,endIndex:n}=this.range.getRange();if(!~e&&!~n)return;const i=this.range.getRangeParagraphElementList()?.filter(d=>d.listId);if(!i||!i.length)return;const r=this.draw.getElementList(),s=r[n];if(s.listId){let d=n+1;for(;d<r.length;){const R=r[d];if(R.value===H&&!R.listWrap)break;if(R.listId!==s.listId){this.draw.spliceElementList(r,d,0,[{value:H}]);break}d++}}i.forEach(d=>{delete d.listId,delete d.listType,delete d.listStyle,delete d.listWrap});const a=e===n,c=a?n:e;this.draw.render({curIndex:c,isSetCursor:a})}computeListStyle(t,e){const n=new Map;let i=0,r=e[i]?.listId,s=[];const a=e.length;for(;i<a;){const c=e[i];if(r&&r===c.listId)s.push(c);else if(c.listId&&c.listId!==r){if(s.length){const d=this.getListStyleWidth(t,s);n.set(r,d)}r=c.listId,s=r?[c]:[]}i++}if(s.length){const c=this.getListStyleWidth(t,s);n.set(r,c)}return n}findStyledElement(t){let e=t[0];for(let n=1;n<t.length;n++){const i=t[n];if(i.font||i.size||i.bold||i.italic){e=i;break}}return e}getListFontStyle(t,e){if(this.options.list.inheritStyle){const n=this.findStyledElement(t);return this.draw.getElementFont(n,e)}else{const{defaultFont:n,defaultSize:i}=this.options;return`${i*e}px ${n}`}}getListStyleWidth(t,e){const{scale:n,checkbox:i}=this.options,r=e[0];if(r.listStyle&&r.listStyle!==l.ListStyle.DECIMAL)return r.listStyle===l.ListStyle.CHECKBOX?(i.width+this.LIST_GAP)*n:this.UN_COUNT_STYLE_WIDTH*n;const s=e.reduce((d,R)=>(R.value===H&&(d+=1),d),0);if(!s)return 0;t.save(),t.font=this.getListFontStyle(e,n);const a=`${this.MEASURE_BASE_TEXT.repeat(String(s).length)}${l.KeyMap.PERIOD}`,c=t.measureText(a);return t.restore(),Math.ceil((c.width+this.LIST_GAP)*n)}drawListStyle(t,e,n){const{elementList:i,offsetX:r,listIndex:s,ascent:a}=e,c=i[0];if(c.value!==H||c.listWrap)return;let d=0;const{defaultTabWidth:R,scale:u}=this.options;for(let m=1;m<i.length&&i[m]?.type===l.ElementType.TAB;m++)d+=R*u;const{coordinate:{leftTop:[h,g]}}=n,f=h-r+d,T=g+a;if(c.listStyle===l.ListStyle.CHECKBOX){const{width:m,height:p,gap:I}=this.options.checkbox,L={...c,checkbox:{value:!!c.checkbox?.value},metrics:{...c.metrics,width:(m+I*2)*u,height:p*u}};this.draw.getCheckboxParticle().render({ctx:t,x:f-I*u,y:T,index:0,row:{...e,elementList:[L,...e.elementList]}})}else{let m="";if(c.listType===l.ListType.UL?m=Yo[c.listStyle]||Yo[Ge.DISC]:m=`${s+1}${l.KeyMap.PERIOD}`,!m)return;t.save(),t.font=this.getListFontStyle(i,u),t.fillText(m,f,T),t.restore()}}}class wn{options;static WIDTH=12;static HEIGHT=9;static GAP=3;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:r,lineBreak:{color:s,lineWidth:a}}=this.options;t.save(),t.beginPath();const c=i-wn.HEIGHT*r/2,d=n+e.metrics.width;t.translate(d,c),t.scale(r,r),t.strokeStyle=s,t.lineWidth=a,t.lineCap="round",t.lineJoin="round",t.beginPath(),t.moveTo(8,0),t.lineTo(12,0),t.lineTo(12,6),t.lineTo(3,6),t.moveTo(3,6),t.lineTo(6,3),t.moveTo(3,6),t.lineTo(6,9),t.stroke(),t.closePath(),t.restore()}}class Xr{draw;position;options;elementList;rowList;positionList;constructor(t){this.draw=t,this.position=t.getPosition(),this.options=t.getOptions(),this.elementList=[],this.rowList=[],this.positionList=[]}_recovery(){this.elementList=[],this.rowList=[],this.positionList=[]}_compute(t){this._computeRowList(),this._computePositionList(t)}_computeRowList(){const t=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:t,elementList:this.elementList})}_computePositionList(t){const{lineBreak:e,scale:n}=this.options,i=this.draw.getHeader().getExtraHeight(),r=this.draw.getInnerWidth(),s=this.draw.getMargins();let a=s[3];e.disabled||(a+=(wn.WIDTH+wn.GAP)*n);const c=t?.startY||s[0]+i;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:a,startY:c,innerWidth:r})}render(t,e){const{placeholder:n=this.options.placeholder}=e||{},{data:i,font:r,size:s,color:a,opacity:c}=n;this._recovery(),this.elementList=[{value:i,font:r,size:s,color:a}],bt(this.elementList,{editorOptions:this.options,isForceCompensation:!0}),this._compute(e);const d=this.draw.getInnerWidth();t.save(),t.globalAlpha=c,this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:this.rowList,pageNo:0,startIndex:0,innerWidth:d,isDrawLineBreak:!1}),t.restore()}}class kh{draw;options;range;fillRectMap;constructor(t){this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.fillRectMap=new Map}setGroup(){if(this.draw.isReadonly()||this.draw.getZone().getZone()!==l.EditorZone.MAIN)return null;const t=this.range.getSelection();if(!t)return null;const e=lt();return t.forEach(n=>{Array.isArray(n.groupIds)||(n.groupIds=[]),n.groupIds.push(e)}),this.draw.render({isSetCursor:!1,isCompute:!1}),e}getElementListByGroupId(t,e){const n=[];for(let i=0;i<t.length;i++){const r=t[i];if(r.type===l.ElementType.TABLE){const s=r.trList;for(let a=0;a<s.length;a++){const c=s[a];for(let d=0;d<c.tdList.length;d++){const R=c.tdList[d],u=this.getElementListByGroupId(R.value,e);if(u.length)return n.push(...u),n}}}if(r?.groupIds?.includes(e)&&(n.push(r),!t[i+1]?.groupIds?.includes(e)))break}return n}deleteGroup(t){if(this.draw.isReadonly())return;const e=this.draw.getOriginalMainElementList(),n=this.getElementListByGroupId(e,t);if(n.length){for(let i=0;i<n.length;i++){const r=n[i],s=r.groupIds,a=s.findIndex(c=>c===t);s.splice(a,1),s.length||delete r.groupIds}this.draw.render({isSetCursor:!1,isCompute:!1})}}getContextByGroupId(t,e){for(let n=0;n<t.length;n++){const i=t[n];if(i.type===l.ElementType.TABLE){const s=i.trList;for(let a=0;a<s.length;a++){const c=s[a];for(let d=0;d<c.tdList.length;d++){const R=c.tdList[d],u=this.getContextByGroupId(R.value,e);if(u)return{...u,isTable:!0,index:n,trIndex:a,tdIndex:d,tdId:R.id,trId:c.id,tableId:i.tableId}}}}const r=t[n+1];if(i.groupIds?.includes(e)&&!r?.groupIds?.includes(e))return{isTable:!1,startIndex:n,endIndex:n}}return null}clearFillInfo(){this.fillRectMap.clear()}recordFillInfo(t,e,n,i,r){const s=t.groupIds;if(s)for(const a of s){const c=this.fillRectMap.get(a);c?c.width+=i:this.fillRectMap.set(a,{x:e,y:n,width:i,height:r})}}render(t){if(!this.fillRectMap.size)return;const e=this.range.getRange(),i=this.draw.getElementList()[e.endIndex]?.groupIds,{group:{backgroundColor:r,opacity:s,activeOpacity:a,activeBackgroundColor:c}}=this.options;t.save(),this.fillRectMap.forEach((d,R)=>{const{x:u,y:h,width:g,height:f}=d;i?.includes(R)?(t.globalAlpha=a,t.fillStyle=c):(t.globalAlpha=s,t.fillStyle=r),t.fillRect(u,h,g,f)}),t.restore(),this.clearFillInfo()}}class Jh{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:r,whiteSpace:{color:s,radius:a}}=this.options,c=e.metrics;t.save(),t.fillStyle=s,t.beginPath(),t.arc(n+c.width/2,i,a*r,0,Math.PI*2),t.fill(),t.closePath(),t.restore()}}class Bh{draw;eventBus;pageContainer;constructor(t){this.draw=t,this.eventBus=this.draw.getEventBus(),this.pageContainer=this.draw.getPageContainer(),this.pageContainer.addEventListener("mousemove",this._mousemove.bind(this)),this.pageContainer.addEventListener("mouseenter",this._mouseenter.bind(this)),this.pageContainer.addEventListener("mouseleave",this._mouseleave.bind(this)),this.pageContainer.addEventListener("mousedown",this._mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this._mouseup.bind(this)),this.pageContainer.addEventListener("click",this._click.bind(this))}_mousemove(t){this.eventBus.isSubscribe("mousemove")&&this.eventBus.emit("mousemove",t)}_mouseenter(t){this.eventBus.isSubscribe("mouseenter")&&this.eventBus.emit("mouseenter",t)}_mouseleave(t){this.eventBus.isSubscribe("mouseleave")&&this.eventBus.emit("mouseleave",t)}_mousedown(t){this.eventBus.isSubscribe("mousedown")&&this.eventBus.emit("mousedown",t)}_mouseup(t){this.eventBus.isSubscribe("mouseup")&&this.eventBus.emit("mouseup",t)}_click(t){this.eventBus.isSubscribe("click")&&this.eventBus.emit("click",t)}}class $h{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{scale:n,lineNumber:{color:i,size:r,font:s,right:a,type:c}}=this.options,d=this.draw.getTextParticle(),R=this.draw.getMargins(),u=this.draw.getPosition().getOriginalMainPositionList(),g=this.draw.getPageRowList()[e];t.save(),t.fillStyle=i,t.font=`${r*n}px ${s}`;for(let f=0;f<g.length;f++){const T=g[f],{coordinate:{leftBottom:m}}=u[T.startIndex],p=c===l.LineNumberType.PAGE?f+1:T.rowIndex+1,I=d.measureText(t,{value:`${p}`}),L=R[3]-(I.width+a)*n,P=m[1]-I.actualBoundingBoxAscent*n;t.fillText(`${p}`,L,P)}t.restore()}}class zh{draw;header;footer;options;constructor(t){this.draw=t,this.header=t.getHeader(),this.footer=t.getFooter(),this.options=t.getOptions()}render(t){const{scale:e,pageBorder:{color:n,lineWidth:i,padding:r}}=this.options;t.save(),t.translate(.5,.5),t.strokeStyle=n,t.lineWidth=i*e;const s=this.draw.getMargins(),a=s[3]-r[3]*e,c=s[0]+this.header.getExtraHeight()-r[0]*e,d=this.draw.getInnerWidth()+(r[1]+r[3])*e,R=this.draw.getHeight()-c-this.footer.getExtraHeight()-s[2]+r[2]*e;t.rect(a,c,d,R),t.stroke(),t.restore()}}function jh(o,t){const{value:e,oldValue:n}=t;n.isTable&&!e.isTable&&o.getTableTool().dispose()}class qh{draw;eventBus;constructor(t){this.draw=t,this.eventBus=t.getEventBus(),this.execute()}execute(){this.eventBus.on("positionContextChange",t=>{jh(this.draw,t)})}}class tg{draw;range;position;tableTool;tableParticle;options;constructor(t){this.draw=t,this.range=t.getRange(),this.position=t.getPosition(),this.tableTool=t.getTableTool(),this.tableParticle=t.getTableParticle(),this.options=t.getOptions()}insertTable(t,e){const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const{defaultTrMinHeight:r}=this.options.table,s=this.draw.getElementList();let a=0;if(s[n]?.listId){const f=this.position.getPositionList(),{rowIndex:T}=f[n];a=this.draw.getRowList()[T]?.offsetX||0}const c=this.draw.getContextInnerWidth()-a,d=[],R=c/e;for(let f=0;f<e;f++)d.push({width:R});const u=[];for(let f=0;f<t;f++){const T=[],m={height:r,tdList:T};for(let p=0;p<e;p++)T.push({colspan:1,rowspan:1,value:[]});u.push(m)}const h={type:l.ElementType.TABLE,value:"",colgroup:d,trList:u};bt([h],{editorOptions:this.options}),Ut(s,[h],n,{editorOptions:this.options});const g=n+1;this.draw.spliceElementList(s,g,n===i?0:i-n,[h]),this.range.setRange(g,g),this.draw.render({curIndex:g,isSetCursor:!1})}insertTableTopRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tableId:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=a[n];if(c.tdList.length<s.colgroup.length){const u=c.tdList[0].rowIndex;for(let h=0;h<n;h++){const g=a[h];for(let f=0;f<g.tdList.length;f++){const T=g.tdList[f];T.rowspan>1&&T.rowIndex+T.rowspan>=u+1&&(T.rowspan+=1)}}}const d=lt(),R={height:c.height,id:d,tdList:[]};for(let u=0;u<c.tdList.length;u++){const h=c.tdList[u],g=lt();R.tdList.push({id:g,rowspan:1,colspan:h.colspan,value:[{value:H,size:16,tableId:i,trId:d,tdId:g}]})}a.splice(n,0,R),this.position.setPositionContext({isTable:!0,index:e,trIndex:n,tdIndex:0,tdId:R.tdList[0].id,trId:R.id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableBottomRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tableId:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=a[n],d=a.length-1===n?c:a[n+1];if(d.tdList.length<s.colgroup.length){const h=d.tdList[0].rowIndex;for(let g=0;g<n+1;g++){const f=a[g];for(let T=0;T<f.tdList.length;T++){const m=f.tdList[T];m.rowspan>1&&m.rowIndex+m.rowspan>=h+1&&(m.rowspan+=1)}}}const R=lt(),u={height:d.height,id:R,tdList:[]};for(let h=0;h<d.tdList.length;h++){const g=d.tdList[h],f=lt();u.tdList.push({id:f,rowspan:1,colspan:g.colspan,value:[{value:H,size:16,tableId:i,trId:R,tdId:f}]})}a.splice(n+1,0,u),this.position.setPositionContext({isTable:!0,index:e,trIndex:n+1,tdIndex:0,tdId:u.tdList[0].id,trId:u.id,tableId:s.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}adjustColWidth(t){if(t.type!==l.ElementType.TABLE)return;const{defaultColMinWidth:e}=this.options.table,n=t.colgroup,i=n.reduce((s,a)=>s+a.width,0),r=this.draw.getOriginalInnerWidth();if(i>r){const s=n.filter(c=>c.width>e),a=(i-r)/s.length;for(let c=0;c<n.length;c++){const d=n[c];d.width-a>=e&&(d.width-=a)}}}insertTableLeftCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,tableId:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=n;for(let u=0;u<a.length;u++){const h=a[u],g=lt();h.tdList.splice(c,0,{id:g,rowspan:1,colspan:1,value:[{value:H,size:16,tableId:i,trId:h.id,tdId:g}]})}const{defaultColMinWidth:d}=this.options.table;s.colgroup.splice(c,0,{width:d}),this.adjustColWidth(s),this.position.setPositionContext({isTable:!0,index:e,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableRightCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,tableId:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=n+1;for(let u=0;u<a.length;u++){const h=a[u],g=lt();h.tdList.splice(c,0,{id:g,rowspan:1,colspan:1,value:[{value:H,size:16,tableId:i,trId:h.id,tdId:g}]})}const{defaultColMinWidth:d}=this.options.table;s.colgroup.splice(c,0,{width:d}),this.adjustColWidth(s),this.position.setPositionContext({isTable:!0,index:e,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:s.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}deleteTableRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tdIndex:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=a[n],d=c.tdList[i].rowIndex;if(a.length<=1&&s.pagingIndex===0){this.deleteTable();return}for(let R=0;R<d;R++){const h=a[R].tdList;for(let g=0;g<h.length;g++){const f=h[g];f.rowIndex+f.rowspan>d&&f.rowspan--}}for(let R=0;R<c.tdList.length;R++){const u=c.tdList[R];if(u.rowspan>1){const h=lt(),g=a[n+1];g.tdList.splice(R,0,{id:h,rowspan:u.rowspan-1,colspan:u.colspan,value:[{value:H,size:16,tableId:s.id,trId:g.id,tdId:h}]})}}a.splice(n,1),this.position.setPositionContext({isTable:!1}),this.range.clearRange(),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTableCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,trIndex:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,d=a[i].tdList[n].colIndex;if(!a.find(u=>u.tdList.length>1)){this.deleteTable();return}for(let u=0;u<a.length;u++){const h=a[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];f.colIndex<=d&&f.colIndex+f.colspan>d&&(f.colspan>1?f.colspan--:h.tdList.splice(g,1))}}s.colgroup?.splice(d,1),this.position.setPositionContext({isTable:!1}),this.range.setRange(0,0),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTable(){const t=this.position.getPositionContext();if(!t.isTable)return;const e=this.draw.getOriginalElementList(),n=e[t.index];let i=1,r=t.index;if(n.pagingId){r=t.index-n.pagingIndex;for(let a=r+1;a<e.length&&e[a].pagingId===n.pagingId;a++)i++}e.splice(r,i);const s=r-1;this.position.setPositionContext({isTable:!1,index:s}),this.range.setRange(s,s),this.draw.render({curIndex:s}),this.tableTool.dispose()}mergeTableCell(){const t=this.position.getPositionContext();if(!t.isTable)return;const{isCrossRowCol:e,startTdIndex:n,endTdIndex:i,startTrIndex:r,endTrIndex:s}=this.range.getRange();if(!e)return;const{index:a}=t,R=this.draw.getOriginalElementList()[a].trList;let u=R[r].tdList[n],h=R[s].tdList[i];(u.x>h.x||u.y>h.y)&&([u,h]=[h,u]);const g=u.colIndex,f=h.colIndex+(h.colspan-1),T=u.rowIndex,m=h.rowIndex+(h.rowspan-1),p=[];for(let E=0;E<R.length;E++){const C=R[E],M=[];for(let y=0;y<C.tdList.length;y++){const b=C.tdList[y],D=b.colIndex,U=b.rowIndex;D>=g&&D<=f&&U>=T&&U<=m&&M.push(b)}M.length&&p.push(M)}if(!p.length)return;const I=p[p.length-1],L=p[0][0],P=I[I.length-1],O=L.x,S=L.y,F=P.x+P.width,N=P.y+P.height;for(let E=0;E<p.length;E++){const C=p[E];for(let M=0;M<C.length;M++){const y=C[M],b=y.x,D=y.y,U=b+y.width,Q=D+y.height;if(O>b||S>D||F<U||N<Q)return}}const V=[],Y=p[0][0],X=Y.value[0];for(let E=0;E<p.length;E++){const C=p[E];for(let M=0;M<C.length;M++){const y=C[M];if(!(E===0&&M===0)){V.push(y.id);const D=y.value.length>1?0:1;for(let U=D;U<y.value.length;U++){const Q=y.value[U];De(je,X,Q),Y.value.push(Q)}}E===0&&M!==0&&(Y.colspan+=y.colspan),E!==0&&Y.colIndex===y.colIndex&&(Y.rowspan+=y.rowspan)}}for(let E=0;E<R.length;E++){const C=R[E];let M=0;for(;M<C.tdList.length;){const y=C.tdList[M];V.includes(y.id)&&(C.tdList.splice(M,1),M--),M++}}this.position.setPositionContext({...t,trIndex:Y.trIndex,tdIndex:Y.tdIndex});const W=Y.value.length-1;this.range.setRange(W,W),this.draw.render(),this.tableTool.render()}cancelMergeTableCell(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,trIndex:i}=t,s=this.draw.getOriginalElementList()[e],a=s.trList,c=a[i],d=c.tdList[n];if(d.rowspan===1&&d.colspan===1)return;const R=d.colspan;if(d.colspan>1){for(let h=1;h<d.colspan;h++){const g=lt();c.tdList.splice(n+h,0,{id:g,rowspan:1,colspan:1,value:[{value:H,size:16,tableId:s.id,trId:c.id,tdId:g}]})}d.colspan=1}if(d.rowspan>1){for(let h=1;h<d.rowspan;h++){const g=a[i+h];for(let f=0;f<R;f++){const T=lt();g.tdList.splice(d.colIndex,0,{id:T,rowspan:1,colspan:1,value:[{value:H,size:16,tableId:s.id,trId:g.id,tdId:T}]})}}d.rowspan=1}const u=d.value.length-1;this.range.setRange(u,u),this.draw.render(),this.tableTool.render()}splitVerticalTableCell(){const t=this.position.getPositionContext();if(!t.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:r}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,d=c[r],R=d.tdList[i];a.colgroup.splice(i+1,0,{width:this.options.table.defaultColMinWidth});for(let u=0;u<c.length;u++){const h=c[u];let g=0;for(;g<h.tdList.length;){const f=h.tdList[g];if(f.rowIndex!==R.rowIndex)f.colIndex<=R.colIndex&&f.colIndex+f.colspan>R.colIndex&&f.colspan++;else if(f.id===R.id){const T=lt();d.tdList.splice(g+R.colspan,0,{id:T,rowspan:R.rowspan,colspan:1,value:[{value:H,size:16,tableId:a.id,trId:h.id,tdId:T}]}),g++}g++}}this.draw.render(),this.tableTool.render()}splitHorizontalTableCell(){const t=this.position.getPositionContext();if(!t.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:r}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,R=c[r].tdList[i];let u=-1,h=0;for(;h<c.length;){if(h===u){h++;continue}const g=c[h];let f=0;for(;f<g.tdList.length;){const T=g.tdList[f];if(T.id===R.id){const m=lt(),p=lt();c.splice(h+R.rowspan,0,{id:m,height:this.options.table.defaultTrMinHeight,tdList:[{id:p,rowspan:1,colspan:R.colspan,value:[{value:H,size:16,tableId:a.id,trId:m,tdId:p}]}]}),u=h+R.rowspan}else T.rowIndex>=R.rowIndex&&T.rowIndex<R.rowIndex+R.rowspan&&T.rowIndex+T.rowspan>=R.rowIndex+R.rowspan&&T.rowspan++;f++}h++}this.draw.render(),this.tableTool.render()}tableTdVerticalAlign(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i<e.length;i++){const r=e[i];for(let s=0;s<r.length;s++){const a=r[s];!a||a.verticalAlign===t||!a.verticalAlign&&t===l.VerticalAlign.TOP||(a.verticalAlign=t)}}const{endIndex:n}=this.range.getRange();this.draw.render({curIndex:n})}tableBorderType(t){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:n}=e,r=this.draw.getOriginalElementList()[n];if(!r.borderType&&t===l.TableBorder.ALL||r.borderType===t)return;r.borderType=t;const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s})}tableBorderColor(t){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:n}=e,r=this.draw.getOriginalElementList()[n];if(!r.borderColor&&t===this.options.table.defaultBorderColor||r.borderColor===t)return;r.borderColor=t;const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s,isCompute:!1})}tableTdBorderType(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;const n=e.flat(),i=n.some(s=>!s.borderTypes?.includes(t));n.forEach(s=>{s.borderTypes||(s.borderTypes=[]);const a=s.borderTypes.findIndex(c=>c===t);i?~a||s.borderTypes.push(t):~a&&s.borderTypes.splice(a,1),s.borderTypes.length||delete s.borderTypes});const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableTdSlashType(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;const n=e.flat(),i=n.some(s=>!s.slashTypes?.includes(t));n.forEach(s=>{s.slashTypes||(s.slashTypes=[]);const a=s.slashTypes.findIndex(c=>c===t);i?~a||s.slashTypes.push(t):~a&&s.slashTypes.splice(a,1),s.slashTypes.length||delete s.slashTypes});const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableTdBackgroundColor(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i<e.length;i++){const r=e[i];for(let s=0;s<r.length;s++){const a=r[s];a.backgroundColor=t}}const{endIndex:n}=this.range.getRange();this.range.setRange(n,n),this.draw.render({isCompute:!1})}tableSelectAll(){const t=this.position.getPositionContext(),{index:e,tableId:n,isTable:i}=t;if(!i||!n)return;const{startIndex:r,endIndex:s}=this.range.getRange(),c=this.draw.getOriginalElementList()[e].trList,d=c.length-1,R=c[d].tdList.length-1;this.range.replaceRange({startIndex:r,endIndex:s,tableId:n,startTdIndex:0,endTdIndex:R,startTrIndex:0,endTrIndex:d}),this.draw.render({isSetCursor:!1,isCompute:!1,isSubmitHistory:!1})}tableProperties(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e}=t,i=this.draw.getOriginalElementList()[e],r=this.draw.getOptions().table.tdPadding,s=i.tdPadding||r,a=document.createElement("div");a.className="table-properties-modal",a.setAttribute("editor-component","table-properties-modal"),a.innerHTML=`
509
509
  <div class="table-properties-modal__mask"></div>
510
510
  <div class="table-properties-modal__container">
511
511
  <div class="table-properties-modal__header">
@@ -535,7 +535,7 @@ ${u} `}textToElements(t){const e=[],n=t.split(`
535
535
  <button class="btn-confirm">确定</button>
536
536
  </div>
537
537
  </div>
538
- `,document.body.appendChild(a);const c=a.querySelector(".table-properties-modal__mask"),d=a.querySelector(".table-properties-modal__close"),R=a.querySelector(".btn-cancel"),u=a.querySelector(".btn-confirm"),h=()=>{a.remove()};c.addEventListener("click",h),d.addEventListener("click",h),R.addEventListener("click",h),u.addEventListener("click",()=>{const g=parseInt(a.querySelector("#tdPaddingTop").value)||0,f=parseInt(a.querySelector("#tdPaddingRight").value)||0,T=parseInt(a.querySelector("#tdPaddingBottom").value)||0,p=parseInt(a.querySelector("#tdPaddingLeft").value)||0;i.tdPadding=[g,f,T,p],h();const{endIndex:m}=this.range.getRange();this.draw.render({curIndex:m,isCompute:!0})})}}l.AreaMode=void 0,(function(o){o.EDIT="edit",o.READONLY="readonly",o.FORM="form"})(l.AreaMode||(l.AreaMode={}));class Jh{draw;zone;range;position;options;areaInfoMap=new Map;constructor(t){this.draw=t,this.options=t.getOptions(),this.zone=t.getZone(),this.range=t.getRange(),this.position=t.getPosition()}getAreaInfo(){return this.areaInfoMap}getActiveAreaId(){if(!this.areaInfoMap.size)return null;const{startIndex:t}=this.range.getRange();return this.draw.getElementList()[t]?.areaId||null}getActiveAreaInfo(){const t=this.getActiveAreaId();return t&&this.areaInfoMap.get(t)||null}isReadonly(){const t=this.getActiveAreaInfo();if(!t?.area)return!1;switch(t.area.mode){case l.AreaMode.EDIT:return!1;case l.AreaMode.READONLY:return!0;case l.AreaMode.FORM:return!this.draw.getControl().getIsRangeWithinControl();default:return!1}}insertArea(t){const{id:e,value:n,area:i,position:r,range:s}=t;if(this.zone.getZone()!==l.EditorZone.MAIN&&this.zone.setZone(l.EditorZone.MAIN),this.draw.getPosition().setPositionContext({isTable:!1}),s&&!this.getActiveAreaId()){const{startIndex:c,endIndex:d}=s,R=this.draw.getOriginalMainElementList();if(!R[c]||!R[d])return null;this.range.setRange(s.startIndex,s.endIndex)}else if(r===l.LocationPosition.BEFORE)this.range.setRange(0,0);else{const d=this.draw.getOriginalMainElementList().length-1;this.range.setRange(d,d)}const a=e||lt();return this.draw.insertElementList([{type:l.ElementType.AREA,value:"",areaId:a,valueList:n,area:at(i)}]),a}render(t,e){if(!this.areaInfoMap.size)return;t.save();const n=this.draw.getMargins(),i=this.draw.getInnerWidth();for(const r of this.areaInfoMap){const{area:s,positionList:a}=r[1];if(s?.hide||!s?.backgroundColor&&!s?.borderColor&&!s?.placeholder)continue;const c=a.filter(f=>f.pageNo===e);if(!c.length)continue;t.translate(.5,.5);const d=c[0],R=c[c.length-1],u=n[3],h=Math.ceil(d.coordinate.leftTop[1]),g=Math.ceil(R.coordinate.rightBottom[1]-h);t.textBaseline="middle",s.backgroundColor&&(t.fillStyle=s.backgroundColor,t.fillRect(u,h,i,g)),s.borderColor&&(t.strokeStyle=s.borderColor,t.strokeRect(u,h,i,g)),s.placeholder&&a.length<=1&&new Cr(this.draw).render(t,{placeholder:{...Ai,...s.placeholder},startY:d.coordinate.leftTop[1]}),t.translate(-.5,-.5)}t.restore()}compute(){this.areaInfoMap.clear();const t=this.draw.getOriginalMainElementList(),e=this.position.getOriginalMainPositionList();for(let n=0;n<t.length;n++){const i=t[n],r=i.areaId;if(r){const s=this.areaInfoMap.get(r);s?(s.elementList.push(i),s.positionList.push(e[n])):this.areaInfoMap.set(r,{id:r,area:i.area,elementList:[i],positionList:[e[n]]})}}}getAreaValue(t={}){const e=t.id||this.getActiveAreaId();if(!e)return null;const n=this.areaInfoMap.get(e);return n?{area:n.area,id:n.id,startPageNo:n.positionList[0].pageNo,endPageNo:n.positionList[n.positionList.length-1].pageNo,value:Pt(n.elementList)}:null}getContextByAreaId(t,e){const n=this.draw.getOriginalMainElementList();for(let i=0;i<n.length;i++){const r=n[i];if(e?.position===l.LocationPosition.OUTER_BEFORE){if(n[i+1]?.areaId!==t)continue}else if(e?.position===l.LocationPosition.AFTER){if(!(r.areaId===t&&n[i+1]?.areaId!==t))continue}else if(e?.position===l.LocationPosition.OUTER_AFTER){if(!(r.areaId!==t&&n[i-1]?.areaId===t))continue}else if(r.areaId!==t)continue;const s=this.position.getOriginalMainPositionList();return{range:{startIndex:i,endIndex:i},elementPosition:s[i]}}return null}setAreaProperties(t){const e=t.id||this.getActiveAreaId();if(!e)return;const n=this.areaInfoMap.get(e);if(!n)return;n.area||(n.area={});let i=!1;const r=["top","hide"];Object.entries(t.properties).forEach(([s,a])=>{if(Ui(a))return;const c=s;n.area[c]=a,r.includes(c)&&(i=!0)}),this.draw.render({isCompute:i,isSetCursor:!1})}setAreaValue(t){const e=t.id||this.getActiveAreaId();if(!e)return;const n=this.areaInfoMap.get(e);if(!n)return;const{positionList:i}=n,r=this.draw.getOriginalMainElementList(),s=t.value;Vt([{type:l.ElementType.AREA,value:"",valueList:s,areaId:n.id,area:n.area}],{editorOptions:this.options}),this.draw.spliceElementList(r,i[0].index,i.length,s,{isIgnoreDeletedRule:!0}),this.draw.render({isSetCursor:!1})}}class Bh{draw;options;imageCache;mainBadge;areaBadgeMap;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map,this.mainBadge=null,this.areaBadgeMap=new Map}setMainBadge(t){this.mainBadge=t}setAreaBadgeMap(t){this.areaBadgeMap.clear(),t.forEach(e=>{this.areaBadgeMap.set(e.areaId,e.badge)})}_drawImage(t,e,n,i,r,s){if(this.imageCache.has(s)){const a=this.imageCache.get(s);t.drawImage(a,e,n,i,r)}else{const a=new Image;a.setAttribute("crossOrigin","Anonymous"),a.src=s,a.onload=()=>{this.imageCache.set(s,a),t.drawImage(a,e,n,i,r)}}}render(t,e){if(e===0&&this.mainBadge){const{scale:n,badge:i}=this.options,{left:r,top:s,width:a,height:c,value:d}=this.mainBadge,R=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),u=(r||i.left)*n,h=(s||i.top)*n+R;this._drawImage(t,u,h,a*n,c*n,d)}if(this.areaBadgeMap.size){const n=this.draw.getArea().getAreaInfo();if(n.size){const{scale:i,badge:r}=this.options;for(const s of n){const{positionList:a}=s[1],c=a[0];if(c.pageNo!==e)continue;const d=this.areaBadgeMap.get(s[0]);if(!d)continue;const{left:R,top:u,width:h,height:g,value:f}=d,T=(R||r.left)*i,p=(u||r.top)*i+c.coordinate.leftTop[1];this._drawImage(t,T,p,h*i,g*i,f)}}}}}class $h{draw;options;data;pageContainer;isDrawing=!1;startStroke=null;constructor(t,e){this.draw=t,this.options=t.getOptions(),this.data=e||[],this.pageContainer=t.getPageContainer(),this.register()}register(){this.pageContainer.addEventListener("mousedown",this.start.bind(this)),this.pageContainer.addEventListener("mouseup",this.stop.bind(this)),this.pageContainer.addEventListener("mouseleave",this.stop.bind(this)),this.pageContainer.addEventListener("mousemove",this.drawing.bind(this))}start(t){if(!this.draw.isGraffitiMode())return;this.isDrawing=!0;const{scale:e}=this.options;this.startStroke={lineColor:this.options.graffiti.defaultLineColor,lineWidth:this.options.graffiti.defaultLineWidth,points:[t.offsetX/e,t.offsetY/e]}}stop(){this.isDrawing=!1}drawing(t){if(!this.isDrawing||!this.draw.isGraffitiMode())return;const{offsetX:e,offsetY:n}=t,i=2;if(this.startStroke&&Math.abs(this.startStroke.points[0]-e)<i&&Math.abs(this.startStroke.points[1]-n)<i)return;const r=this.draw.getPageNo();let s=this.data.find(d=>d.pageNo===r);if(this.startStroke&&(s||(s={pageNo:r,strokes:[]},this.data.push(s)),s.strokes.push(this.startStroke),this.startStroke=null),!s?.strokes?.length)return;const{scale:a}=this.options;s.strokes[s.strokes.length-1].points.push(e/a,n/a),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}getValue(){return this.data}compute(){const t=this.draw.getPageRowList().length;for(let e=this.data.length-1;e>=0;e--)this.data[e].pageNo>t-1&&this.data.splice(e,1)}clear(){this.data=[]}render(t,e){const n=this.data.find(a=>a.pageNo===e)?.strokes;if(!n?.length)return;const{graffiti:{defaultLineColor:i,defaultLineWidth:r},scale:s}=this.options;t.save();for(let a=0;a<n.length;a++){const c=n[a];t.beginPath(),t.strokeStyle=c.lineColor||i,t.lineWidth=(c.lineWidth||r)*s,t.moveTo(c.points[0]*s,c.points[1]*s);for(let d=2;d<c.points.length;d+=2)t.lineTo(c.points[d]*s,c.points[d+1]*s);t.stroke()}t.restore()}}const Sr=1024,zh=['[aria-modal="true"]','[role="dialog"]','[data-overlay-active="true"]',".ant-modal-root",".ant-modal-wrap",".ant-modal",".ant-drawer",".ant-select-dropdown",".ant-picker-dropdown",".ant-dropdown",".ant-popover",".ant-tooltip",".ant-cascader-dropdown",".ant-mentions-dropdown"].join(", ");function Er(o,t,e){for(let n=0;n<e.length;n+=Sr){const i=e.slice(n,n+Sr);o.splice(t+n,0,...i)}}class jh{container;pageContainer;pageList;ctxList;pageNo;renderCount;pagePixelRatio;mode;options;position;zone;elementList;listener;eventBus;override;i18n;canvasEvent;globalEvent;cursor;range;margin;background;badge;search;group;area;underline;strikeout;highlight;historyManager;previewer;imageParticle;laTexParticle;textParticle;tableParticle;tableTool;tableOperate;pageNumber;lineNumber;waterMark;placeholder;header;footer;hyperlinkParticle;labelParticle;macroParticle;dateParticle;separatorParticle;pageBreakParticle;superscriptParticle;subscriptParticle;checkboxParticle;radioParticle;menstrualHistoryParticle;fetalHeartPositionParticle;toothPositionParticle;blockParticle;listParticle;lineBreakParticle;whiteSpaceParticle;control;pageBorder;workerManager;scrollObserver;selectionObserver;imageObserver;graffiti;command;interactionPaused;overlayActiveCount;globalShortcutSuspended;LETTER_REG;WORD_LIKE_REG;rowList;pageRowList;painterStyle;painterOptions;visiblePageNoList;intersectionPageNo;lazyRenderIntersectionObserver;printModeData;splitTdValueMap=new Map;tdMap=new Map;constructor(t,e,n,i,r,s){this.container=this._wrapContainer(t),this.pageList=[],this.ctxList=[],this.pageNo=0,this.renderCount=0,this.pagePixelRatio=null,this.mode=e.mode,this.options=e,this.elementList=n.main,this.listener=i,this.eventBus=r,this.override=s,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new Yh(e.locale),this.historyManager=new _a(this),this.position=new xa(this),this.zone=new wh(this),this.range=new Ga(this),this.margin=new Ja(this),this.background=new Aa(this),this.badge=new Bh(this),this.search=new Ba(this),this.group=new vh(this),this.area=new Jh(this),this.underline=new za(this),this.strikeout=new $a(this),this.highlight=new ka(this),this.previewer=new Fh(this),this.imageParticle=new Qi(this),this.laTexParticle=new Hi(this),this.textParticle=new ja(this),this.tableParticle=new ec(this),this.tableTool=new nc(this),this.tableOperate=new kh(this),this.pageNumber=new sn(this),this.lineNumber=new _h(this),this.waterMark=new Rc(this),this.placeholder=new Cr(this),this.header=new rc(this,n.header),this.footer=new Zh(this,n.footer),this.hyperlinkParticle=new oc(this),this.labelParticle=new ic(this),this.macroParticle=new sc(this),this.dateParticle=new yh(this),this.separatorParticle=new cc(this),this.pageBreakParticle=new dc(this),this.superscriptParticle=new lc,this.subscriptParticle=new ac,this.checkboxParticle=new Lh(this),this.radioParticle=new Ih(this),this.menstrualHistoryParticle=new Ph(this),this.fetalHeartPositionParticle=new Mh(this),this.toothPositionParticle=new Oh(this),this.blockParticle=new bh(this),this.listParticle=new Qh(this),this.lineBreakParticle=new Yn(this),this.whiteSpaceParticle=new Kh(this),this.control=new mh(this),this.pageBorder=new xh(this),this.graffiti=new $h(this,n.graffiti),this.scrollObserver=new qa(this),this.selectionObserver=new tc(this),this.imageObserver=new Dh,new Hh(this),this.canvasEvent=new Ka(this),this.cursor=new la(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new Ha(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new Nh(this),new Ah(this);const{letterClass:a}=e;this.LETTER_REG=new RegExp(`[${a.join("")}]`),this.WORD_LIKE_REG=new RegExp(`${a.map(c=>`[^${c}][${c}]`).join("|")}`),this.rowList=[],this.pageRowList=[],this.painterStyle=null,this.painterOptions=null,this.visiblePageNoList=[],this.intersectionPageNo=0,this.lazyRenderIntersectionObserver=null,this.printModeData=null,this.interactionPaused=!1,this.overlayActiveCount=0,this.globalShortcutSuspended=!1,this.mode===l.EditorMode.PRINT&&this.setPrintData(),this.mode,l.EditorMode.FORM,this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}setPrintData(){this.printModeData={header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()};const t=at(this.printModeData);["header","main","footer"].forEach(r=>{t[r]=this.control.filterAssistElement(t[r])});const n=t,i=this.removeStrikeout(n);t.main=i.main.filter(r=>!r.strikeout),this.setEditorData(i)}removeStrikeout(t){if(Array.isArray(t))return t.map(e=>this.removeStrikeout(e)).filter(e=>!(e&&typeof e=="object"&&"strikeout"in e&&e.strikeout===!0));if(t&&typeof t=="object"){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=this.removeStrikeout(t[n]));return e}return t}clearPrintData(){this.printModeData&&(this.setEditorData(this.printModeData),this.printModeData=null)}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}setMode(t){if(this.mode===t)return;this.mode=t,this.options.mode=t;const e=new Map,n=r=>{r.forEach(s=>{s.controlId&&(s.controlComponent==="value"&&e.set(s.controlId,!0),s.checked&&e.set(s.controlId,!0))})};n(this.elementList),this.elementList.forEach(r=>{r.type==="table"&&r.trList?.forEach(s=>{s.tdList?.forEach(a=>{n(a.value)})})});const i=r=>{r.forEach(s=>{if(!(!s.control&&!s.controlId)&&(s.controlComponent==="value"&&s.strikeout&&(t===l.EditorMode.PRINT?s.hide=!0:s.hide=!1),!!s.control&&!(s.type!=="control"&&s.control.type!=="button"))){if(s.control.type==="TextField"&&(s.controlComponent==="placeholder"||s.controlComponent==="preTextFix"||s.controlComponent==="preTextFixText"||s.controlComponent==="postTextFix"||s.controlComponent==="postTextFixText"||s.controlComponent==="textFixLabel")&&(t===l.EditorMode.EDIT?s.hide=!1:s.hide=!0),s.control.type==="text"&&(s.controlComponent==="placeholder"||s.controlComponent==="prefix"||s.controlComponent==="postfix")&&(t===l.EditorMode.EDIT||t===l.EditorMode.FORM?s.hide=!1:s.hide=!0),s.control.type==="number"||s.control.type==="select"||s.control.type==="date"||s.control.type==="checkbox"||s.control.type==="radio"){if(s.controlComponent==="placeholder"||s.controlComponent==="prefix"||s.controlComponent==="postfix"){const c=e.get(s.controlId);s.control.type==="select"&&t===l.EditorMode.PRINT||t===l.EditorMode.PRINT&&!c?s.hide=!0:s.hide=!1}s.control.type==="number"&&s.controlComponent==="value"&&(t===l.EditorMode.PRINT&&s.strikeout?s.hide=!0:t!==l.EditorMode.PRINT&&s.strikeout&&(s.hide=!1))}s.control.type==="button"&&(s.hide=!1,s.control.hide=!1),s.control.type==="menstrualHistory"&&(s.controlComponent==="prefix"||s.controlComponent==="postfix")&&(t===l.EditorMode.PRINT?s.hide=!0:s.hide=!1)}})};i(this.elementList),this.elementList.forEach(r=>{r.type==="table"&&r.trList.forEach(s=>{s.tdList.forEach(a=>{i(a.value)})})}),t===l.EditorMode.FORM?(this.elementList.filter(r=>r.type==="control").map(r=>{r.control?.type==="button"&&r.control.buttonText&&(r.color="#1677FF",r.highlight="transparent")}),this.hideTextFieldWhitespace(this.elementList,!0),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):t===l.EditorMode.EDIT?(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!1,!0)),t===l.EditorMode.PRINT?(this.elementList.filter(r=>r?.control?.type==="button").map(r=>{(r?.controlComponent==="prefix"||r?.controlComponent==="postfix")&&(r.color="transparent",r.highlight="transparent"),r?.controlComponent==="value"&&!r.control.buttonText&&(r.color="transparent",r.highlight="transparent")}),this.setPrintData()):(this.clearPrintData(),this.elementList.filter(r=>r?.control?.type==="button").map(r=>{(r?.controlComponent==="prefix"||r?.controlComponent==="postfix")&&!r.control.buttonText&&r.type==="control"&&(r.color="transparent",r.highlight="#1677FF"),r?.controlComponent==="value"&&!r.control.buttonText&&(r.color="#fff",r.highlight="#1677FF"),r?.type==="text"&&r.control.buttonText&&(r.color="#000"),r?.type==="control"&&r?.controlComponent==="value"&&r.control.buttonText&&(r.color="#000",r.highlight="transparent")})),this.mode===l.EditorMode.PRINT&&this.clearPrintData(),this.clearSideEffect(),this.control.destroyControl(),this.range.clearRange(),this.render({isSetCursor:!1,isSubmitHistory:!1})}hideTextFieldWhitespace(t,e){const n=r=>r?/^[\s\u00A0\u2000-\u200B\u3000\n\r\t]+$/.test(r):!1;(r=>{for(let s=0;s<r.length;s++){const a=r[s];if(a.type===l.ElementType.TABLE&&a.trList)for(const c of a.trList)for(const d of c.tdList)this.hideTextFieldWhitespace(d.value,e);a.control?.type===l.ControlType.TEXTFIELD&&a.controlComponent===l.ControlComponent.VALUE&&n(a.value)&&(a.hide=e)}})(t)}updateTextFieldPlaceholderVisibility(t,e,n){const i=[l.ControlType.TEXT,l.ControlType.TEXTFIELD,l.ControlType.SELECT,l.ControlType.DATE,l.ControlType.CHECKBOX,l.ControlType.RADIO,l.ControlType.NUMBER];(s=>{let a=0;for(;a<s.length;){const c=s[a];if(c.type===l.ElementType.TABLE&&c.trList)for(const d of c.trList)for(const R of d.tdList)this.updateTextFieldPlaceholderVisibility(R.value,e,n);if(c.control?.type&&i.includes(c.control.type)&&(c.controlComponent===l.ControlComponent.PREFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===l.ControlComponent.PRE_TEXT)){const d=c.controlId,R=c.control.type;let u=!1,h=!1,g=!1;const f=[],T=[],p=[];let m=-1,I=a;for(;I<s.length;){const L=s[I];if(L.controlId!==d)break;if((L.controlComponent===l.ControlComponent.PREFIX||L.controlComponent===l.ControlComponent.PRETEXTFIX||L.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)&&T.push(I),L.controlComponent===l.ControlComponent.VALUE&&L.value&&L.value.trim()&&(u=!0),L.controlComponent===l.ControlComponent.VALUE&&(L.type===l.ElementType.MENSTRUAL_HISTORY||L.type===l.ElementType.FETAL_HEART_POSITION||L.type===l.ElementType.TOOTH_POSITION||L.type===l.ElementType.MACRO||L.type===l.ElementType.CUSTOM_MACRO)&&(u=!0),L.controlComponent===l.ControlComponent.VALUE&&L.control&&L.control.type!==R&&(h=!0),L.controlComponent===l.ControlComponent.PLACEHOLDER&&(g=!0,f.push(I)),L.controlComponent===l.ControlComponent.POSTFIX||L.controlComponent===l.ControlComponent.POSTTEXTFIX||L.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT){p.push(I),m=I;break}I++}if(!u&&!h)if(g&&f.length>0)for(const L of f)s[L].hide=!e;else e&&c.control?.placeholder&&(m>0?this.control.addPlaceholder(m-1):this.control.addPlaceholder(a));if(n)if(e&&u){for(const L of T)s[L].hide=!0;for(const L of p)s[L].hide=!0}else if(e){for(const L of T)s[L].hide=!1;for(const L of p)s[L].hide=!1}else{for(const L of T)s[L].hide=!0;for(const L of p)s[L].hide=!0}else{for(const L of T)s[L].hide=!1;for(const L of p)s[L].hide=!1}a=I}a++}})(t)}isReadonly(){if(this.area.getActiveAreaInfo()?.area?.mode)return this.area.isReadonly();switch(this.mode){case l.EditorMode.DESIGN:return!1;case l.EditorMode.READONLY:case l.EditorMode.PRINT:case l.EditorMode.GRAFFITI:return!0;case l.EditorMode.FORM:if(this.control.getIsRangeWithinControl()){const t=this.getElementList(),{startIndex:e}=this.range.getRange();if(t[e]?.control?.type===l.ControlType.TEXTFIELD)return!0}return!this.control.getIsRangeWithinControl();default:return!1}}isDisabled(){if(this.mode===l.EditorMode.DESIGN)return!1;const{startIndex:t,endIndex:e}=this.range.getRange(),n=this.getElementList();if(this.getTd()?.disabled)return!0;if(t===e){const r=n[t],s=n[t+1];return!!(r?.title?.disabled&&s?.title?.disabled&&r.titleId===s.titleId||r?.control?.disabled&&s?.control?.disabled&&r.controlId===s.controlId)}return n.slice(t+1,e+1).some(r=>r.title?.disabled||r.control?.disabled)}isDesignMode(){return this.mode===l.EditorMode.DESIGN}isPrintMode(){return this.mode===l.EditorMode.PRINT}isGraffitiMode(){return this.mode===l.EditorMode.GRAFFITI}getOriginalWidth(){const{paperDirection:t,width:e,height:n}=this.options;return t===l.PaperDirection.VERTICAL?e:n}getOriginalHeight(){const{paperDirection:t,width:e,height:n}=this.options;return t===l.PaperDirection.VERTICAL?n:e}getWidth(){return Math.floor(this.getOriginalWidth()*this.options.scale)}getHeight(){return Math.floor(this.getOriginalHeight()*this.options.scale)}getMainHeight(){return this.getHeight()-this.getMainOuterHeight()}getMainOuterHeight(){const t=this.getMargins(),e=this.header.getExtraHeight(),n=this.footer.getExtraHeight();return t[0]+t[2]+e+n}getCanvasWidth(t=-1){return this.getPage(t).width}getCanvasHeight(t=-1){return this.getPage(t).height}getInnerWidth(){const t=this.getWidth(),e=this.getMargins();return t-e[1]-e[3]}getOriginalInnerWidth(){const t=this.getOriginalWidth(),e=this.getOriginalMargins();return t-e[1]-e[3]}getContextInnerWidth(){const t=this.position.getPositionContext();if(t.isTable){const{index:e,trIndex:n,tdIndex:i}=t,s=this.getOriginalElementList()[e],a=s.trList[n].tdList[i],c=this.getTdPadding(s);return a.width-c[1]-c[3]}return this.getOriginalInnerWidth()}getMargins(){return this.getOriginalMargins().map(t=>t*this.options.scale)}getOriginalMargins(){const{margins:t,paperDirection:e}=this.options;return e===l.PaperDirection.VERTICAL?t:[t[1],t[2],t[3],t[0]]}getPageGap(){return this.options.pageGap*this.options.scale}getOriginalPageGap(){return this.options.pageGap}getPageNumberBottom(){const{pageNumber:{bottom:t},scale:e}=this.options;return t*e}getMarginIndicatorSize(){return this.options.marginIndicatorSize*this.options.scale}getDefaultBasicRowMarginHeight(){return this.options.defaultBasicRowMarginHeight*this.options.scale}getHighlightMarginHeight(){return this.options.highlightMarginHeight*this.options.scale}getTdPadding(t){const{table:{tdPadding:e},scale:n}=this.options;return(t?.tdPadding||e).map(r=>r*n)}getContainer(){return this.container}getPageContainer(){return this.pageContainer}getEventTarget(t){return t instanceof Element?t:t instanceof Node?t.parentElement:null}isTargetInsideEditor(t){const e=this.getEventTarget(t);return e?this.container.contains(e)?!0:!!Wi(e,n=>!!n&&n.nodeType===1&&!!n.getAttribute(de)):!1}isTargetInsideExternalOverlay(t){const e=this.getEventTarget(t);return!e||this.isTargetInsideEditor(e)?!1:!!e.closest(zh)}pauseInteraction(){this.interactionPaused=!0,this.cursor?.getAgentDom().blur(),this.globalEvent?.resetSideEffect()}resumeInteraction(){this.interactionPaused=!1}setOverlayActive(t){this.overlayActiveCount=t?1:0,t&&(this.cursor?.getAgentDom().blur(),this.globalEvent?.resetSideEffect())}suspendGlobalShortcut(t){this.globalShortcutSuspended=t}isInteractionSuspended(){return this.interactionPaused||this.overlayActiveCount>0}isGlobalShortcutActive(){return!this.globalShortcutSuspended&&!this.isInteractionSuspended()}getVisiblePageNoList(){return this.visiblePageNoList}setVisiblePageNoList(t){this.visiblePageNoList=t,this.listener.visiblePageNoListChange&&this.listener.visiblePageNoListChange(this.visiblePageNoList),this.eventBus.isSubscribe("visiblePageNoListChange")&&this.eventBus.emit("visiblePageNoListChange",this.visiblePageNoList)}getIntersectionPageNo(){return this.intersectionPageNo}setIntersectionPageNo(t){this.intersectionPageNo=t,this.listener.intersectionPageNoChange&&this.listener.intersectionPageNoChange(this.intersectionPageNo),this.eventBus.isSubscribe("intersectionPageNoChange")&&this.eventBus.emit("intersectionPageNoChange",this.intersectionPageNo)}getPageNo(){return this.pageNo}setPageNo(t){this.pageNo=t}getRenderCount(){return this.renderCount}getPage(t=-1){return this.pageList[~t?t:this.pageNo]}getPageList(){return this.pageList}getPageCount(){return this.pageList.length}getTableRowList(t){const e=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:r}=e;return t[n].trList[i].tdList[r].rowList}getOriginalRowList(){const t=this.getZone();return t.isHeaderActive()?this.header.getRowList():t.isFooterActive()?this.footer.getRowList():this.rowList}getRowList(){return this.position.getPositionContext().isTable?this.getTableRowList(this.getOriginalElementList()):this.getOriginalRowList()}getPageRowList(){return this.pageRowList}getCtx(){return this.ctxList[this.pageNo]}getOptions(){return this.options}getSearch(){return this.search}getGroup(){return this.group}getArea(){return this.area}getBadge(){return this.badge}getHistoryManager(){return this.historyManager}getPosition(){return this.position}getZone(){return this.zone}getRange(){return this.range}getLineBreakParticle(){return this.lineBreakParticle}getTextParticle(){return this.textParticle}getHeaderElementList(){return this.header.getElementList()}getTableElementList(t){const e=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:r}=e;return t[n]?.trList?.[i].tdList[r].value||[]}getElementList(){const t=this.position.getPositionContext(),e=this.getOriginalElementList();return t.isTable?this.getTableElementList(e):e}getMainElementList(){return this.position.getPositionContext().isTable?this.getTableElementList(this.elementList):this.elementList}getOriginalElementList(){const t=this.getZone();return t.isHeaderActive()?this.getHeaderElementList():t.isFooterActive()?this.getFooterElementList():this.elementList}getOriginalMainElementList(){return this.elementList}getFooterElementList(){return this.footer.getElementList()}getTd(){const t=this.position.getPositionContext(),{index:e,trIndex:n,tdIndex:i,isTable:r}=t;return r?this.getOriginalElementList()[e].trList[n].tdList[i]:null}getTdByPosition(t){const{index:e,trIndex:n,tdIndex:i,isTable:r}=t;return r?this.getOriginalElementList()[e].trList[n].tdList[i]:null}insertElementTextField(t,e={}){if(!t.length||!this.range.getIsCanInput())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.getElementList(),{isSubmitHistory:s=!0}=e;Vt(t,{isHandleFirstElement:!1,editorOptions:this.options});let a=-1,c=this.control.getActiveControl();if(!c&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),c=this.control.getActiveControl()),c&&this.control.getIsRangeWithinControl()){const d=n===i,R=n+1;d||this.newSpliceElementList(r,R,i-n),this.newSpliceElementList(r,R,0,t),a=n+t.length}else{const d=n===i,R=n+1;d||this.newSpliceElementList(r,R,i-n),this.newSpliceElementList(r,R,0,t),a=n+t.length;const u=r[R-1];t[0].listId&&u&&!u.listId&&u?.value===_&&(!u.type||u.type===l.ElementType.TEXTFIELD)&&(r.splice(n,1),a-=1)}this.control.destroyControl(),~a&&(this.range.setRange(a,a),this.render({curIndex:a,isSubmitHistory:s}))}insertElementList(t,e={}){if(!t.length||!this.range.getIsCanInput())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const{isSubmitHistory:r=!0}=e;Vt(t,{isHandleFirstElement:!1,editorOptions:this.options});let s=-1,a=this.control.getActiveControl();if(!a&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),a=this.control.getActiveControl()),a&&this.control.getIsRangeWithinControl()){const c=this.getElementList(),d=n===i,R=n+1,u=c[n];if(u?.controlComponent===l.ControlComponent.PRE_TEXT||u?.controlComponent===l.ControlComponent.POST_TEXT||u?.controlComponent===l.ControlComponent.PREFIX||u?.controlComponent===l.ControlComponent.POSTFIX)for(let f=0;f<t.length;f++)t[f].control||(t[f].color=this.options.defaultColor);d&&(c[n]?.control?.type===l.ControlType.TEXTFIELD||c[n]?.control?.type===l.ControlType.TEXT)&&this.control.removePlaceholder(n),d||this.newSpliceElementList(c,R,i-n);const g=c[n]?.controlId||c[n-1]?.controlId||c[n+1]?.controlId;for(let f=0;f<t.length;f++){if(t[f]?.control?.type=="button"&&!t[f]?.control?.buttonText&&(t[f]?.controlComponent==="prefix"||t[f]?.controlComponent==="postfix"?(t[f].color="transparent",t[f].highlight="#1677FF"):(t[f].color="#fff",t[f].highlight="#1677FF")),t[f]?.type===l.ElementType.MENSTRUAL_HISTORY||t[f]?.type===l.ElementType.FETAL_HEART_POSITION||t[f]?.type===l.ElementType.TOOTH_POSITION||t[f]?.type===l.ElementType.MACRO||t[f]?.type===l.ElementType.CUSTOM_MACRO||t[f]?.type===l.ElementType.REUSABLE_ITEM||t[f]?.type===l.ElementType.SUB_TEMPLATE||t[f]?.type===l.ElementType.SPECIAL_SYMBOLS){t[f].controlComponent=l.ControlComponent.VALUE;let T=c[n]?.controlId;T||(T=c[n-1]?.controlId),T||(T=c[n+1]?.controlId),!t[f].controlId&&T&&(t[f].controlId=T)}g&&t[f]?.control&&t[f].controlId&&t[f].controlId!==g&&(t[f].originControlId=g)}this.newSpliceElementList(c,R,0,t),s=n+t.length}else{const c=this.getElementList(),d=n===i,R=n+1;if(c[R]?.control?.type=="TextField"||c[n]?.control?.type=="TextField"){d||this.newSpliceElementList(c,R,i-n);for(let u=0;u<t.length;u++)if(t[u]?.type===l.ElementType.MENSTRUAL_HISTORY||t[u]?.type===l.ElementType.FETAL_HEART_POSITION||t[u]?.type===l.ElementType.TOOTH_POSITION||t[u]?.type===l.ElementType.MACRO||t[u]?.type===l.ElementType.CUSTOM_MACRO||t[u]?.type===l.ElementType.REUSABLE_ITEM||t[u]?.type===l.ElementType.SUB_TEMPLATE||t[u]?.type===l.ElementType.SPECIAL_SYMBOLS){t[u].controlComponent=l.ControlComponent.VALUE;const h=c[n]?.controlId||c[R]?.controlId;!t[u].controlId&&h&&(t[u].controlId=h)}this.newSpliceElementList(c,R,0,t),s=n+t.length}else{d||this.spliceElementList(c,R,i-n);for(let h=0;h<t.length;h++)t[h]?.control?.type=="button"&&!t[h]?.control?.buttonText&&(t[h]?.controlComponent==="prefix"||t[h]?.controlComponent==="postfix"?(t[h].color="transparent",t[h].highlight="#1677FF"):(t[h].color="#fff",t[h].highlight="#1677FF"));this.spliceElementList(c,R,0,t),s=n+t.length;const u=c[R-1];t[0].listId&&u&&!u.listId&&u?.value===_&&(!u.type||u.type===l.ElementType.TEXT)&&(c.splice(n,1),s-=1)}}~s&&(this.range.setRange(s,s),this.render({curIndex:s,isSubmitHistory:r}))}appendElementList(t,e={}){if(!t.length)return;Vt(t,{isHandleFirstElement:!1,editorOptions:this.options});let n;const{isPrepend:i,isSubmitHistory:r=!0}=e;i?(this.elementList.splice(1,0,...t),n=t.length):(this.elementList.push(...t),n=this.elementList.length-1),this.range.setRange(n,n),this.render({curIndex:n,isSubmitHistory:r})}spliceElementList(t,e,n,i,r){const{isIgnoreDeletedRule:s=!1}=r||{},{group:a,modeRule:c}=this.options;if(n>0){const d=e+n,u=t[d]?.listId;if(u&&t[e-1]?.listId!==u){let h=d;for(;h<t.length;){const g=t[h];if(g.listId!==u||g.value===_)break;delete g.listId,delete g.listType,delete g.listStyle,h++}}if(!s&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const h=this.getTd()?.deletable;let g=d-1;for(;g>=e;){const f=t[g];(f?.hide||f?.control?.hide||f?.area?.hide||h!==!1&&f?.control?.deletable!==!1&&(!f.controlId||this.mode!==l.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&f?.title?.deletable!==!1&&(a.deletable!==!1||!f.groupIds?.length)&&(f?.area?.deletable!==!1||f?.areaIndex!==0))&&t.splice(g,1),g--}}else t.splice(e,n)}if(i?.length){let d=t[e];for(let R=0;R<i.length;R++)!i[R].controlComponent&&d?.controlComponent&&(i[R].controlId=d.controlId,i[R].control=d.control,i[R].controlComponent=d.controlComponent),d=i[R];Er(t,e,i)}}newSpliceElementList(t,e,n,i,r){const{isIgnoreDeletedRule:s=!1}=r||{},{group:a,modeRule:c}=this.options;if(n>0){const R=e+n,h=t[R]?.listId;if(h&&t[e-1]?.listId!==h){let g=R;for(;g<t.length;){const f=t[g];if(f.listId!==h||f.value===_)break;delete f.listId,delete f.listType,delete f.listStyle,g++}}if(!s&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const g=this.getTd()?.deletable;let f=R-1;for(;f>=e;){const T=t[f];(T?.hide||T?.control?.hide||T?.area?.hide||g!==!1&&T?.control?.deletable!==!1&&(!T.controlId||this.mode!==l.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&T?.title?.deletable!==!1&&(a.deletable!==!1||!T.groupIds?.length)&&(T?.area?.deletable!==!1||T?.areaIndex!==0))&&t.splice(f,1),f--}}else t.splice(e,n)}const d=t[e]?.controlId;if(i?.length){for(let R=0;R<i.length;R++)d&&(i[R].originControlId=d);Er(t,e,i)}}getCanvasEvent(){return this.canvasEvent}getGlobalEvent(){return this.globalEvent}getListener(){return this.listener}getEventBus(){return this.eventBus}getOverride(){return this.override}getCursor(){return this.cursor}getPreviewer(){return this.previewer}getImageParticle(){return this.imageParticle}getTableTool(){return this.tableTool}getTableOperate(){return this.tableOperate}getTableParticle(){return this.tableParticle}getHeader(){return this.header}getFooter(){return this.footer}getHyperlinkParticle(){return this.hyperlinkParticle}getMacroParticle(){return this.macroParticle}getDateParticle(){return this.dateParticle}getListParticle(){return this.listParticle}getCheckboxParticle(){return this.checkboxParticle}getRadioParticle(){return this.radioParticle}getMenstrualHistoryParticle(){return this.menstrualHistoryParticle}getFetalHeartPositionParticle(){return this.fetalHeartPositionParticle}getToothPositionParticle(){return this.toothPositionParticle}getControl(){return this.control}getWorkerManager(){return this.workerManager}getImageObserver(){return this.imageObserver}getI18n(){return this.i18n}getGraffiti(){return this.graffiti}setCommand(t){this.command=t}getCommand(){return this.command}getRowCount(){return this.getRowList().length}async getDataURL(t={}){const{pixelRatio:e,mode:n}=t;e&&this.setPagePixelRatio(e);const i=this.mode,r=!!n&&i!==n;r&&this.setMode(n),this.render({isLazy:!1,isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),await this.imageObserver.allSettled();const s=this.pageList.map(a=>a.toDataURL());return e&&this.setPagePixelRatio(null),r&&this.setMode(i),s}getPainterStyle(){return this.painterStyle&&Object.keys(this.painterStyle).length?this.painterStyle:null}getPainterOptions(){return this.painterOptions}setPainterStyle(t,e){this.painterStyle=t,this.painterOptions=e||null,this.getPainterStyle()&&this.pageList.forEach(n=>n.style.cursor="copy")}setDefaultRange(){this.elementList.length&&setTimeout(()=>{const t=this.elementList.length-1;this.range.setRange(t,t),this.range.setRangeStyle()})}getIsPagingMode(){return this.options.pageMode===l.PageMode.PAGING}setPageMode(t){if(!t||this.options.pageMode===t)return;if(this.options.pageMode=t,t===l.PageMode.PAGING){const{height:i}=this.options,r=this.getPagePixelRatio(),s=this.pageList[0];s.style.height=`${i}px`,s.height=i*r,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(l.EditorZone.MAIN);const{startIndex:e}=this.range.getRange(),n=this.range.getIsCollapsed();this.render({isSetCursor:!0,curIndex:e,isSubmitHistory:!1}),n||this.cursor.drawCursor({isShow:!1}),setTimeout(()=>{this.listener.pageModeChange&&this.listener.pageModeChange(t),this.eventBus.isSubscribe("pageModeChange")&&this.eventBus.emit("pageModeChange",t)})}setPageScale(t){const e=this.getPagePixelRatio();this.options.scale=t;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((s,a)=>{s.width=n*e,s.height=i*e,s.style.width=`${n}px`,s.style.height=`${i}px`,s.style.marginBottom=`${this.getPageGap()}px`,this._initPageContext(this.ctxList[a])});const r=this.position.getCursorPosition();this.render({isSubmitHistory:!1,isSetCursor:!!r,curIndex:r?.index}),this.listener.pageScaleChange&&this.listener.pageScaleChange(t),this.eventBus.isSubscribe("pageScaleChange")&&this.eventBus.emit("pageScaleChange",t)}getPagePixelRatio(){return this.pagePixelRatio||window.devicePixelRatio}setPagePixelRatio(t){!this.pagePixelRatio&&t===window.devicePixelRatio||t===this.pagePixelRatio||(this.pagePixelRatio=t,this.setPageDevicePixel())}setPageDevicePixel(){const t=this.getPagePixelRatio(),e=this.getWidth(),n=this.getHeight();this.pageList.forEach((i,r)=>{i.width=e*t,i.height=n*t,this._initPageContext(this.ctxList[r])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperSize(t,e){this.options.width=t,this.options.height=e;const n=this.getPagePixelRatio(),i=this.getWidth(),r=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((s,a)=>{s.width=i*n,s.height=r*n,s.style.width=`${i}px`,s.style.height=`${r}px`,this._initPageContext(this.ctxList[a])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperDirection(t){const e=this.getPagePixelRatio();this.options.paperDirection=t;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((r,s)=>{r.width=n*e,r.height=i*e,r.style.width=`${n}px`,r.style.height=`${i}px`,this._initPageContext(this.ctxList[s])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperMargin(t){this.options.margins=t,this.render({isSubmitHistory:!1,isSetCursor:!1})}getOriginValue(t={}){const{pageNo:e}=t;let n=this.elementList;return Number.isInteger(e)&&e>=0&&e<this.pageRowList.length&&(n=this.pageRowList[e].flatMap(r=>r.elementList)),{header:this.getHeaderElementList(),main:n,footer:this.getFooterElementList(),graffiti:this.graffiti.getValue()}}getValue(t={}){const e=this.getOriginValue(t);console.log(this.elementList,"所有元素");const{extraPickAttrs:n}=t,i={header:Pt(e.header,{extraPickAttrs:n,editorOptions:this.options}),main:Pt(e.main,{extraPickAttrs:n,isClassifyArea:!0,editorOptions:this.options}),footer:Pt(e.footer,{extraPickAttrs:n,editorOptions:this.options}),graffiti:e.graffiti};return{version:Qe,data:i,options:at(this.options)}}setValue(t,e){const{header:n,main:i,footer:r}=at(t);if(!n&&!i&&!r)return;const{isSetCursor:s=!1}=e||{};[n,i,r].forEach(d=>{d&&Vt(d,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:n,main:i,footer:r}),this.historyManager.recovery();const c=s?i?.length?i.length-1:0:void 0;c!==void 0&&this.range.setRange(c,c),this.render({curIndex:c,isSetCursor:s,isFirstRender:!0})}setEditorData(t){const{header:e,main:n,footer:i}=t;e&&this.header.setElementList(e),n&&(this.elementList=n),i&&this.footer.setElementList(i)}_wrapContainer(t){const e=document.createElement("div");return t.append(e),e}_formatContainer(){this.container.style.position="relative",this.container.style.width=`${this.getWidth()}px`,this.container.setAttribute(de,l.EditorComponent.MAIN)}_createPageContainer(){const t=document.createElement("div");return t.classList.add(`${z}-page-container`),this.container.append(t),t}_createPage(t){const e=this.getWidth(),n=this.getHeight(),i=document.createElement("canvas");i.style.width=`${e}px`,i.style.height=`${n}px`,i.style.display="block",i.style.backgroundColor="#ffffff",i.style.marginBottom=`${this.getPageGap()}px`,i.setAttribute("data-index",String(t)),this.pageContainer.append(i);const r=this.getPagePixelRatio();i.width=e*r,i.height=n*r,i.style.cursor="text";const s=i.getContext("2d");this._initPageContext(s),this.pageList.push(i),this.ctxList.push(s)}_initPageContext(t){const e=this.getPagePixelRatio();t.scale(e,e),t.letterSpacing="0px",t.wordSpacing="0px",t.direction="ltr"}getElementFont(t,e=1){const{defaultSize:n,defaultFont:i}=this.options,r=t.font||i,s=t.actualSize||t.size||n;return`${t.italic?"italic ":""}${t.bold?"bold ":""}${s*e}px ${r}`}getElementSize(t){return t.actualSize||t.size||this.options.defaultSize}getElementRowMargin(t){const{defaultSize:e,defaultBasicRowMarginHeight:n,defaultRowMargin:i,scale:r}=this.options,s=t.size||e;let a=1;return s<12?a=s/12:s>30&&(a=1+(s-30)/30),n*a*(t.rowMargin??i)*r}computeRowList(t){const{innerWidth:e,elementList:n,isPagingMode:i=!1,isFromTable:r=!1,startX:s=0,startY:a=0,pageHeight:c=0,mainOuterHeight:d=0,surroundElementList:R=[]}=t,{defaultSize:u,scale:h,imgCaption:g,table:{tdPadding:f,defaultTrMinHeight:T},defaultTabWidth:p}=this.options,m=this.getDefaultBasicRowMarginHeight(),L=document.createElement("canvas").getContext("2d"),P=this.listParticle.computeListStyle(L,n),O=[],S=this._collectTextControlValueSet(n);n.length&&O.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:n?.[0]?.rowFlex||n?.[1]?.rowFlex});let F=s,N=a,V=0,Y,X=0,b=0;for(let E=0;E<n.length;E++){const C=O[O.length-1],M=n[E];this.clearElementEffect(M);const y=this.getElementRowMargin(M),W={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},D=C.offsetX||M.listId&&P.get(M.listId)||0,U=e-D,Q=C.elementList.length===1;if(F+=Q?D:0,N+=Q&&C.offsetY||0,(M.control?.type===l.ControlType.TEXTFIELD||M.control?.type===l.ControlType.TEXT)&&!this.isDesignMode()&&(M.controlComponent===l.ControlComponent.PRETEXTFIX||M.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||M.controlComponent===l.ControlComponent.POSTTEXTFIX||M.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||M.controlComponent===l.ControlComponent.TEXTFIXLABEL||M.controlComponent===l.ControlComponent.PLACEHOLDER||M.controlComponent===l.ControlComponent.PREFIX||M.controlComponent===l.ControlComponent.POSTFIX)){const v=M.control?.type===l.ControlType.TEXTFIELD,K=M.controlId,w=!!K&&!!S?.has(K);v?this.mode===l.EditorMode.EDIT?M.hide=!1:M.hide=!0:this.mode===l.EditorMode.EDIT?M.hide=!1:this.mode===l.EditorMode.FORM?M.controlComponent===l.ControlComponent.PLACEHOLDER||M.controlComponent===l.ControlComponent.TEXTFIXLABEL?M.hide=w:M.hide=!1:M.hide=!0}if((M.hide||M.control?.hide||M.area?.hide)&&!this.isDesignMode()){const v=C.elementList[C.elementList.length-1];W.height=v?.metrics.height||this.options.defaultSize*h,W.boundingBoxAscent=v?.metrics.boundingBoxAscent||0,W.boundingBoxDescent=v?.metrics.boundingBoxDescent||0}else if(M.type===l.ElementType.IMAGE||M.type===l.ElementType.LATEX)if(M.imgDisplay===l.ImageDisplay.SURROUND||M.imgDisplay===l.ImageDisplay.FLOAT_TOP||M.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)W.width=0,W.height=0,W.boundingBoxDescent=0;else{const v=M.width*h,K=M.height*h;if(v>U){const w=K*U/v;M.width=U/h,M.height=w/h,W.width=U,W.height=w,W.boundingBoxDescent=w}else W.width=v,W.height=K,W.boundingBoxDescent=K;if(M.imgCaption?.value){const w=M.imgCaption.size||g.size,Z=M.imgCaption.top??g.top,J=(w+Z)*h;W.boundingBoxAscent+=J}}else if(M.type===l.ElementType.TABLE){const v=M.tdPadding||f;if(M.pagingId){let x=E+1,A=0;for(;x<n.length;){const $=n[x];if($.pagingId===M.pagingId){const B=$.trList.filter(Ct=>!Ct.pagingRepeat).filter(Ct=>(Ct.tdList=Ct.tdList.filter(Xt=>{if(Xt.originalId){for(let pt=0;pt<M.trList.length;pt++){const yt=M.trList[pt],Yt=yt.tdList.find(({id:St})=>St===Xt.originalId);if(Yt){Xt.value[0]?.type===l.ElementType.SPLIT_TAG&&Xt.value.splice(0,1),Yt.value.push(...Xt.value.map(St=>this.updateElementTableInfo(St,M,yt,Yt))),Yt.rowspan=Yt.originalRowspan??Yt.rowspan;break}}return!1}return!0}),!Ct.originalId));M.trList.push(...B),M.height+=$.height,x++,A++}else break}A&&n.splice(E+1,A)}M.pagingIndex=M.pagingIndex??0,this.tableParticle.computeTrHeight(M,x=>this.computeRowList({innerWidth:(x.width-(v[1]+v[3]))*h,elementList:x.value,isFromTable:!0,isPagingMode:i})),M.trList?.forEach(x=>{x.tdList.forEach(A=>{this.tdMap.set(A.id,A)})});const K=this.tableParticle.getTableHeight(M),w=this.tableParticle.getTableWidth(M);M.width=w,M.height=K;const Z=w*h,J=K*h;if(W.width=Z,W.height=J,W.boundingBoxDescent=J,W.boundingBoxAscent=-y,n[E+1]?.type===l.ElementType.TABLE&&(W.boundingBoxAscent-=y),i){const x=this.getHeight(),A=this.getMainOuterHeight();let $=A;for(let pt=0;pt<O.length;pt++){const yt=O[pt],Yt=yt.offsetY||0;yt.height+$+Yt>x||O[pt-1]?.isPageBreak?$=A+yt.height+Yt:$+=yt.height+Yt}const B=y*2,Ct=M.trList[0].height*h;($+Ct+B>x||M.pagingIndex!==0&&M.trList[0].pagingRepeat||n[E-1]?.type===l.ElementType.PAGE_BREAK)&&($=A);let Xt=x-($+B);if(J>Xt){const pt=M.trList;let yt=0,Yt=0,St=0;for(let Tt=0;Tt<pt.length;Tt++){const It=pt[Tt],Kt=It.height*h;if($+B+St+Kt>x){const Qt=It;let be=0;const jt={...at(Qt),id:lt(),originalId:Qt.originalId??Qt.id,minHeight:void 0,tdList:M.colgroup.map((mt,oe)=>{if(be--,be>0)return;const Ht=Qt.tdList.find(Ve=>Ve.colIndex===oe),Jt=Ht??this.tableParticle.findPreRowSpanTd(pt,Tt,oe);Ht&&(be=Ht.colspan);const Je=lt();return Jt.originalRowspan=Jt.rowspan,Ht?{...Ht,id:Je,originalId:Ht.originalId??Ht.id,linkTdPrevId:Ht.id,tdIndex:oe,original:Jt}:{id:Je,originalId:Jt.originalId??Jt.id,linkTdPrevId:Jt.id,tdIndex:oe,colIndex:oe,colspan:1,rowspan:1,value:[],rowList:[],original:Jt}}).filter(mt=>!!mt)},ce=jt.tdList,_t=ce.map(mt=>mt.original);_t.forEach((mt,oe)=>{const Ht=[];let Jt=Xt;if(mt.rowspan>1){const Ve=pt.slice(mt.trIndex,mt.trIndex+Tt-mt.trIndex);Jt+=Ve.reduce((ff,Tf)=>Tf.height*h+ff,0)}for(;mt.mainHeight*h>Jt&&mt.rowList?.length;){const Ve=mt.rowList.pop();mt.value.splice(mt.value.length-Ve.elementList.length),Ht.unshift(Ve),mt.mainHeight-=Ve.height}const Je=ce[oe];Je.rowList=Ht,Je.value=Ht.map(Ve=>Ve.elementList).flat()});let Pe=!0;const Ei=Qt.tdList.some(mt=>mt.rowList?.length),br=jt.tdList.some(mt=>mt.rowList?.length),Xi=Qt.minHeight>Xt;if(br||Xi){(Ei||!br&&Xi)&&(Xi&&(Qt.originalMinHeight=Qt.minHeight,Qt.minHeight=Xt,jt.minHeight=Math.max(Qt.originalMinHeight-Xt,T)),jt.tdList.forEach(mt=>{mt.original.linkTdNextId=mt.id,mt.value.length&&mt.value[0].value!==_&&mt.value.unshift({...mt.original.value.slice(-1).pop(),value:_,type:l.ElementType.SPLIT_TAG})}),pt.splice(yt+1,0,jt),yt+=1,Yt=pt.length-yt,Pe=!1),_t.forEach(mt=>{if(mt.rowspan>1){const oe=mt.rowspan-(Tt-mt.trIndex);mt.rowspan=Tt-mt.trIndex+(Ei?1:0);const Ht=jt.tdList.find(Jt=>Jt.colIndex===mt.colIndex);Ei?Ht.rowspan=oe:(Ht.original.linkTdNextId=Ht.id,Qt.tdList.push({...mt,...Ht,rowspan:oe}),Qt.tdList.sort((Jt,Je)=>Jt.colIndex-Je.colIndex),Ht.value=[])}}),Pe&&_t.forEach((mt,oe)=>{mt.value.push(...ce[oe].value)});break}}yt=Tt+1,Yt=pt.length-yt,St+=Kt,Xt-=Kt}if(Yt){const Tt=pt.splice(yt,Yt),It=M.pagingId||lt();M.pagingId=It;const Kt=at(M);Kt.originalId=M.originalId??M.id,Kt.pagingId=It,Kt.pagingIndex=M.pagingIndex+1;const Qt=pt.filter(ce=>ce.pagingRepeat);if(Qt.length){const ce=at(Qt);ce.forEach(_t=>_t.id=lt()),Tt.unshift(...ce)}Kt.trList=Tt,Kt.id=lt(),Kt.trList?.forEach(ce=>{ce.tdList.forEach(_t=>{if(delete _t.valueStartIndex,_t.linkTdPrevId){const Pe=this.getTdById(_t.linkTdPrevId);_t.valueStartIndex=Pe?(Pe.valueStartIndex??0)+Pe.value.length:0,this.splitTdValueMap.has(_t.originalId)?this.splitTdValueMap.get(_t.originalId).push(..._t.value):Pe&&this.splitTdValueMap.set(_t.originalId,[...Pe.value,..._t.value])}_t.value.forEach(Pe=>this.updateElementTableInfo(Pe,Kt,ce,_t))})}),this.spliceElementList(n,E+1,0,[Kt]),this.tableParticle.computeTrHeight(M);const be=this.tableParticle.getTableHeight(M),jt=be*h;M.height=be,W.height=jt,W.boundingBoxDescent=jt}}if(M.pagingId){const pt=this.position.getPositionContext();if(pt.isTable){let yt=-1,Yt=-1,St=E;for(;St<n.length;){const Tt=n[St];if(Tt.pagingId!==M.pagingId)break;const It=Tt.trList.findIndex(Kt=>Kt.id===pt.trId);if(~It){yt=St,Yt=It;break}St++}~yt&&(pt.index=yt,pt.trIndex=Yt,this.position.setPositionContext(pt))}}}this.initTableElementIndex(M,E)}else if(M.type===l.ElementType.SEPARATOR){const{separator:{lineWidth:v}}=this.options,K=M.lineWidth||v;M.width=U/h,W.width=U,W.height=K*h,W.boundingBoxAscent=-y,W.boundingBoxDescent=-y+W.height}else if(M.type===l.ElementType.PAGE_BREAK)M.width=U/h,W.width=U,W.height=u;else if(M.type===l.ElementType.RADIO||M.controlComponent===l.ControlComponent.RADIO){const{width:v,height:K,gap:w}=this.options.radio,Z=v+w*2;M.width=Z,W.width=Z*h,W.height=K*h}else if(M.type===l.ElementType.CHECKBOX||M.controlComponent===l.ControlComponent.CHECKBOX){const{width:v,height:K,gap:w}=this.options.checkbox,Z=v+w*2;M.width=Z,W.width=Z*h,W.height=K*h}else if(M.type===l.ElementType.MENSTRUAL_HISTORY){const v=this.menstrualHistoryParticle.computeSize(M);M.width=v.width/h,W.width=v.width,W.height=v.height,W.boundingBoxAscent=v.height,W.boundingBoxDescent=0}else if(M.type===l.ElementType.FETAL_HEART_POSITION){const v=this.fetalHeartPositionParticle.computeSize(M);M.width=v.width/h,W.width=v.width,W.height=v.height,W.boundingBoxAscent=v.height/2,W.boundingBoxDescent=v.height/2}else if(M.type===l.ElementType.TOOTH_POSITION){const v=this.toothPositionParticle.computeSize(M);M.width=v.width/h,W.width=v.width,W.height=v.height,W.boundingBoxAscent=v.height/2,W.boundingBoxDescent=v.height/2}else if(M.type===l.ElementType.TAB)W.width=p*h,W.height=u*h,W.boundingBoxDescent=0,W.boundingBoxAscent=this.textParticle.getBasisWordBoundingBoxAscent(L,L.font);else if(M.type===l.ElementType.BLOCK){if(!M.width)W.width=U;else{const v=M.width*h;W.width=Math.min(v,U)}W.height=M.height*h,W.boundingBoxDescent=W.height,W.boundingBoxAscent=0}else if(M.type===l.ElementType.LABEL){const{defaultSize:v,label:{defaultPadding:K}}=this.options;L.font=this.getElementFont(M);const w=this.textParticle.measureText(L,M);W.width=(w.width+K[1]+K[3])*h,W.height=(M.size||v)*h,W.boundingBoxDescent=0,W.boundingBoxAscent=(K[0]+w.actualBoundingBoxAscent)*h}else if(M.type===l.ElementType.MACRO||M.type===l.ElementType.CUSTOM_MACRO||M.type===l.ElementType.REUSABLE_ITEM||M.type===l.ElementType.SUB_TEMPLATE){const{defaultSize:v}=this.options;L.font=this.getElementFont(M);const K=this.getMode(),w=K==="edit",Z=K==="form";if(w){const J=M.label||M.value||"";L.font=this.getElementFont(M);const x=L.measureText(J),A=8*h,$=4*h;W.width=x.width+A*2;const B=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;W.height=B+$*2;const Ct=this.textParticle.measureBasisWord(L,this.getElementFont(M));W.boundingBoxAscent=Ct.actualBoundingBoxAscent*h,W.boundingBoxDescent=Ct.actualBoundingBoxDescent*h}else if(M.type===l.ElementType.CUSTOM_MACRO){const J=M.macroConfig,x=J?.value||"";if(Z){const A=J?.type||"text",$=this.textParticle.measureText(L,M),B=M.label||"";if(A==="select"){const Ct=x||`请选择${B}`,Xt=L.measureText(Ct),pt=L.measureText("[").width,yt=6*h+2*h;W.width=pt+Xt.width+yt+pt}else{const Ct=x||`请输入${B}`,Xt=L.measureText(Ct),pt=L.measureText("[").width;W.width=pt+Xt.width+pt}W.height=(M.size||v)*h,W.boundingBoxDescent=$.actualBoundingBoxDescent*h,W.boundingBoxAscent=$.actualBoundingBoxAscent*h}else{const A=M.label||"",$=x||`请输入${A}`,B=L.measureText($);W.width=B.width,W.height=(M.size||v)*h,W.boundingBoxDescent=B.actualBoundingBoxDescent,W.boundingBoxAscent=B.actualBoundingBoxAscent}}else if(M.type===l.ElementType.REUSABLE_ITEM){const x=M.reusableItemConfig?.value||"",A=M.label||"";if(Z){const $=this.textParticle.measureText(L,M),B=x||`获取 ${A}`,Ct=L.measureText(B),Xt=L.measureText("[").width;W.width=Xt+Ct.width+Xt,W.height=(M.size||v)*h,W.boundingBoxDescent=$.actualBoundingBoxDescent*h,W.boundingBoxAscent=$.actualBoundingBoxAscent*h}else{const $=x||`获取 ${A}`,B=L.measureText($);W.width=B.width,W.height=(M.size||v)*h,W.boundingBoxDescent=B.actualBoundingBoxDescent,W.boundingBoxAscent=B.actualBoundingBoxAscent}}else if(M.type===l.ElementType.SUB_TEMPLATE){const J=M.label||"子模板";if(Z){const x=this.textParticle.measureText(L,M),A=L.measureText(J),$=8*h;W.width=A.width+$*2,W.height=(M.size||v)*h,W.boundingBoxDescent=x.actualBoundingBoxDescent*h,W.boundingBoxAscent=x.actualBoundingBoxAscent*h}else{const x=L.measureText(J);W.width=x.width,W.height=(M.size||v)*h,W.boundingBoxDescent=x.actualBoundingBoxDescent,W.boundingBoxAscent=x.actualBoundingBoxAscent}}else{const J=M.label||"",x=M.value||`获取 ${J}`,A=L.measureText(x);W.width=A.width,W.height=(M.size||v)*h,W.boundingBoxDescent=A.actualBoundingBoxDescent,W.boundingBoxAscent=A.actualBoundingBoxAscent}}else{const v=M.size||u;(M.type===l.ElementType.SUPERSCRIPT||M.type===l.ElementType.SUBSCRIPT)&&(M.actualSize=Math.ceil(v*.6)),W.height=(M.actualSize||v)*h,L.font=this.getElementFont(M);const K=this.textParticle.measureText(L,M);W.width=K.width*h,M.letterSpacing&&(W.width+=M.letterSpacing*h);const w=this.textParticle.measureBasisWord(L,M.font);W.boundingBoxAscent=w.actualBoundingBoxAscent*h,W.boundingBoxDescent=w.actualBoundingBoxDescent*h,M.type===l.ElementType.SUPERSCRIPT?W.boundingBoxAscent+=W.height/2:M.type===l.ElementType.SUBSCRIPT&&(W.boundingBoxDescent+=W.height/2)}const G=!M.hide&&(M.imgDisplay!==l.ImageDisplay.INLINE&&M.type===l.ElementType.IMAGE||M.type===l.ElementType.LATEX)?W.height+y:W.boundingBoxAscent+y,H=y+W.boundingBoxAscent+W.boundingBoxDescent+y,j=Object.assign(M,{metrics:W,left:0,style:this.getElementFont(M,h)});j.control?.minWidth&&(j.controlComponent&&(b+=W.width),j.controlComponent===l.ControlComponent.POSTFIX&&(this.control.setMinWidthControlInfo({row:C,rowElement:j,availableWidth:U,controlRealWidth:b}),b=0));const st=n[E-1];let it=n[E+1],nt=C.width+W.width;if(this.options.wordBreak===l.WordBreak.BREAK_WORD&&(!st?.type||st?.type===l.ElementType.TEXT)&&(!M.type||M.type===l.ElementType.TEXT)){const v=`${st?.value||""}${M.value}`;if(this.WORD_LIKE_REG.test(v)){const{width:w,endElement:Z}=this.textParticle.measureWord(L,n,E),J=w*h;Z&&J<=U?(nt+=J,it=Z):st&&(nt+=J)}const K=this.textParticle.measurePunctuationWidth(L,it);nt+=K*h}M.listId&&(M.listId!==Y?X=0:M.value===_&&!M.listWrap&&X++),Y=M.listId;const et=this.position.setSurroundPosition({pageNo:V,rowElement:j,row:C,rowElementRect:{x:F,y:N,height:H,width:W.width},availableWidth:U,surroundElementList:R});F=et.x,nt+=et.rowIncreaseWidth,F+=W.width;let dt=!1;if(this.mode===l.EditorMode.FORM&&M.control?.type===l.ControlType.BUTTON&&M.controlComponent===l.ControlComponent.PREFIX&&C.elementList.filter(v=>v.controlId!==M.controlId).length>0){const v=M.controlId;if(n.some(w=>w.controlId===`${v}_text`&&w.control?.type===l.ControlType.BUTTON)){let w=0;for(let Z=E;Z<n.length;Z++){const J=n[Z];if(J.controlId!==v)break;L.font=this.getElementFont(J);const x=this.textParticle.measureText(L,J);if(w+=x.width*h,J.controlComponent===l.ControlComponent.POSTFIX)break}for(let Z=0;Z<n.length;Z++){const J=n[Z];if(J.controlId===`${v}_text`){L.font=this.getElementFont(J);const x=this.textParticle.measureText(L,J);w+=x.width*h}}dt=C.width+w>U}}const tt=M.type===l.ElementType.SEPARATOR||M.type===l.ElementType.TABLE||st?.type===l.ElementType.TABLE||st?.type===l.ElementType.BLOCK||M.type===l.ElementType.BLOCK||st?.imgDisplay===l.ImageDisplay.INLINE||M.imgDisplay===l.ImageDisplay.INLINE||st?.listId!==M.listId||st?.areaId!==M.areaId&&!M.area?.hide||M.control?.flexDirection===l.FlexDirection.COLUMN&&(M.controlComponent===l.ControlComponent.CHECKBOX||M.controlComponent===l.ControlComponent.RADIO)&&st?.controlComponent===l.ControlComponent.VALUE||E!==0&&M.value===_&&!M.area?.hide||dt,ht=nt>U,ut=tt||ht;if(ut){const v={width:W.width,height:H,startIndex:E,elementList:[j],ascent:G,rowIndex:C.rowIndex+1,rowFlex:n[E]?.rowFlex||n[E+1]?.rowFlex,isPageBreak:M.type===l.ElementType.PAGE_BREAK};if(j.controlComponent!==l.ControlComponent.PREFIX&&j.control?.indentation===l.ControlIndentation.VALUE_START){const K=C.elementList.findIndex(w=>w.controlId===j.controlId&&w.controlComponent!==l.ControlComponent.PREFIX);if(~K){const Z=this.position.computeRowPosition({row:C,innerWidth:this.getInnerWidth()})[K];Z&&(v.offsetX=Z.coordinate.leftTop[0])}}M.listId&&(v.isList=!0,v.offsetX=P.get(M.listId),v.listIndex=X),v.offsetY=!r&&M.area?.top&&M.areaId!==n[E-1]?.areaId?M.area.top*h:0,O.push(v)}else C.width+=W.width,E===0&&(nn(n[1])||n[1]?.areaId)?(C.height=m,C.ascent=m):C.height<H&&(C.height=H,C.ascent=G),C.elementList.push(j);if((ut||E===n.length-1)&&(C.isWidthNotEnough=ht&&!tt,!C.isSurround&&(st?.rowFlex===l.RowFlex.JUSTIFY||st?.rowFlex===l.RowFlex.ALIGNMENT&&C.isWidthNotEnough))){const v=C.elementList[0]?.value===_?C.elementList.slice(1):C.elementList,K=(U-C.width)/(v.length-1);for(let w=0;w<v.length-1;w++){const Z=v[w];Z.metrics.width+=K}C.width=U}if(ut){F=s,N+=C.height,i&&!r&&c&&(N-a+d+H>c||M.type===l.ElementType.PAGE_BREAK)&&(N=a,jl(R,V),V+=1),j.left=0;const v=O[O.length-1];F=this.position.setSurroundPosition({pageNo:V,rowElement:j,row:v,rowElementRect:{x:F,y:N,height:H,width:W.width},availableWidth:U,surroundElementList:R}).x,F+=W.width}}return O}_collectTextControlValueSet(t){if(this.isDesignMode()||this.mode===l.EditorMode.EDIT)return null;const e=new Set;for(let i=0;i<t.length;i++){const r=t[i];r.controlId&&(r.control?.type===l.ControlType.TEXT||r.control?.type===l.ControlType.TEXTFIELD)&&e.add(r.controlId)}const n=new Set;for(let i=0;i<t.length;i++){const r=t[i];r.controlId&&r.controlComponent===l.ControlComponent.VALUE&&e.has(r.controlId)&&n.add(r.controlId)}return n}_computePageList(){const t=[[]],{pageMode:e,pageNumber:{maxPageNo:n}}=this.options,i=this.getHeight(),r=this.getMainOuterHeight();let s=r,a=0;if(e===l.PageMode.CONTINUITY){t[0]=this.rowList,s+=this.rowList.reduce((u,h)=>u+h.height+(h.offsetY||0),0);const c=this.getPagePixelRatio(),d=this.pageList[0],R=Number(d.style.height.replace("px",""));if(s>R)d.style.height=`${s}px`,d.height=s*c;else{const u=s<i?i:s;d.style.height=`${u}px`,d.height=u*c}this._initPageContext(this.ctxList[0])}else for(let c=0;c<this.rowList.length;c++){const d=this.rowList[c],R=d.offsetY||0;if(d.height+R+s>i||this.rowList[c-1]?.isPageBreak){if(Number.isInteger(n)&&a>=n){this.elementList=this.elementList.slice(0,d.startIndex);break}s=r+d.height+R,t.push([d]),a++}else s+=d.height+R,t[a].push(d)}return t}_drawHighlight(t,e){const{rowList:n,positionList:i,elementList:r}=e,s=this.getDefaultBasicRowMarginHeight(),a=this.getHighlightMarginHeight();for(let c=0;c<n.length;c++){const d=n[c];for(let R=0;R<d.elementList.length;R++){const u=d.elementList[R],h=d.elementList[R-1],g=u.highlight||this.control.getControlHighlight(r,d.startIndex+R);if(g){h&&h.highlight&&h.highlight!==u.highlight&&this.highlight.render(t);const{coordinate:{leftTop:[f,T]}}=i[d.startIndex+R],p=u.left||0;this.highlight.recordFillInfo(t,f-p,T+s-a,u.metrics.width+p,d.height-2*s+2*a,g)}else h?.highlight&&this.highlight.render(t)}this.highlight.render(t)}}validateNumber(t){return/^\d+$/.test(t)}drawRow(t,e){this._drawHighlight(t,e);const{scale:n,table:{tdPadding:i},group:r,lineBreak:s,whiteSpace:a}=this.options,{rowList:c,pageNo:d,elementList:R,positionList:u,startIndex:h,zone:g,isDrawLineBreak:f=!s.disabled,td:T,isDrawWhiteSpace:p=!a.disabled}=e,m=this.isPrintMode(),I=this.isGraffitiMode(),{isCrossRowCol:L,tableId:P}=this.range.getRange();let O=h;for(let S=0;S<c.length;S++){const F=c[S],N={x:0,y:0,width:0,height:0};let V=null;for(let Y=0;Y<F.elementList.length;Y++){const X=F.elementList[Y],b=X.metrics,{ascent:E,coordinate:{leftTop:[C,M]}}=u[F.startIndex+Y],y=F.elementList[Y-1];if((X.hide||X.control?.hide||X.area?.hide)&&!this.isDesignMode())this.textParticle.complete();else if(X.type===l.ElementType.IMAGE)this.textParticle.complete(),X.imgDisplay!==l.ImageDisplay.SURROUND&&X.imgDisplay!==l.ImageDisplay.FLOAT_TOP&&X.imgDisplay!==l.ImageDisplay.FLOAT_BOTTOM&&this.imageParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.LATEX)this.textParticle.complete(),this.laTexParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.TABLE)L&&(N.x=C,N.y=M,V=X),this.tableParticle.render(t,X,C,M);else if(X.type===l.ElementType.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.LABEL)this.textParticle.complete(),this.labelParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.MACRO||X.type===l.ElementType.CUSTOM_MACRO||X.type===l.ElementType.REUSABLE_ITEM||X.type===l.ElementType.SUB_TEMPLATE)this.textParticle.complete(),this.macroParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.DATE){const H=F.elementList[Y+1];(!y||y.dateId!==X.dateId)&&this.textParticle.complete(),this.textParticle.record(t,X,C,M+E),(!H||H.dateId!==X.dateId)&&this.textParticle.complete()}else X.type===l.ElementType.SUPERSCRIPT?(this.textParticle.complete(),this.superscriptParticle.render(t,X,C,M+E)):X.type===l.ElementType.SUBSCRIPT?(this.underline.render(t),this.textParticle.complete(),this.subscriptParticle.render(t,X,C,M+E)):X.type===l.ElementType.SEPARATOR?this.separatorParticle.render(t,X,C,M):X.type===l.ElementType.PAGE_BREAK?this.mode!==l.EditorMode.CLEAN&&!m&&this.pageBreakParticle.render(t,X,C,M):X.type===l.ElementType.CHECKBOX||X.controlComponent===l.ControlComponent.CHECKBOX?(this.textParticle.complete(),this.checkboxParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F})):X.type===l.ElementType.RADIO||X.controlComponent===l.ControlComponent.RADIO?(this.textParticle.complete(),this.radioParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F})):X.type===l.ElementType.MENSTRUAL_HISTORY?(this.textParticle.complete(),this.menstrualHistoryParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F,element:X})):X.type===l.ElementType.FETAL_HEART_POSITION?(this.textParticle.complete(),this.fetalHeartPositionParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F,element:X})):X.type===l.ElementType.TOOTH_POSITION?(this.textParticle.complete(),this.toothPositionParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F,element:X})):X.type===l.ElementType.TAB?this.textParticle.complete():X.rowFlex===l.RowFlex.ALIGNMENT||X.rowFlex===l.RowFlex.JUSTIFY?(this.textParticle.record(t,X,C,M+E),this.textParticle.complete()):X.type===l.ElementType.BLOCK?(this.textParticle.complete(),this.blockParticle.render(t,d,X,C,M+E)):(X.left&&this.textParticle.complete(),this.textParticle.record(t,X,C,M+E),(X.width||X.letterSpacing||Zr.test(X.value))&&this.textParticle.complete());if(f&&!m&&this.mode!==l.EditorMode.CLEAN&&!F.isWidthNotEnough&&Y===F.elementList.length-1&&this.lineBreakParticle.render(t,X,C,M+F.height/2),p&&vr.test(X.value)&&this.whiteSpaceParticle.render(t,X,C,M+F.height/2),X.control?.border){y?.control?.border&&y.controlId!==X.controlId&&this.control.drawBorder(t);const H=this.getElementRowMargin(X);this.control.recordBorderInfo(C,M+H,X.metrics.width,F.height-2*H)}else y?.control?.border&&this.control.drawBorder(t);if(X.control?.type===l.ControlType.TEXT){const H=X.controlComponent===l.ControlComponent.VALUE,j=X.controlComponent===l.ControlComponent.POSTFIX||X.controlComponent===l.ControlComponent.POST_TEXT;H&&X.control?.underline&&((!y||y.controlId!==X.controlId||y.controlComponent!==l.ControlComponent.VALUE&&y.controlComponent!==l.ControlComponent.PLACEHOLDER)&&this.control.startTextFieldUnderline(X.controlId,C,M+F.height),this.control.recordTextFieldUnderlineWidth(X.metrics.width)),j&&this.control.drawTextFieldUnderline(t)}else y?.control?.type===l.ControlType.TEXT&&this.control.drawTextFieldUnderline(t);if((X.underline||X.control?.underline)&&X.controlComponent!==l.ControlComponent.PLACEHOLDER&&!(X.control?.type===l.ControlType.TEXT&&X.control?.underline)){y?.type===l.ElementType.SUBSCRIPT&&X.type!==l.ElementType.SUBSCRIPT&&this.underline.render(t);const H=this.getElementRowMargin(X),j=X.left||0;let st=0;X.type===l.ElementType.SUBSCRIPT&&(st=this.subscriptParticle.getOffsetY(X));const it=X.control?.underline?this.options.underlineColor:X.color;this.underline.recordFillInfo(t,C-j,M+F.height-H+st,b.width+j,0,it,X.textDecoration?.style)}else(y?.underline||y?.control?.underline)&&(y?.control?.type===l.ControlType.TEXT&&y?.control?.underline||this.underline.render(t));if(X.strikeout){if(!X.type||$t.includes(X.type)){y&&(y.type===l.ElementType.SUBSCRIPT&&X.type!==l.ElementType.SUBSCRIPT||y.type===l.ElementType.SUPERSCRIPT&&X.type!==l.ElementType.SUPERSCRIPT||this.getElementSize(y)!==this.getElementSize(X))&&this.strikeout.render(t);const H=this.textParticle.measureBasisWord(t,this.getElementFont(X));let j=M+E+H.actualBoundingBoxDescent*n-b.height/2;X.type===l.ElementType.SUBSCRIPT?j+=this.subscriptParticle.getOffsetY(X):X.type===l.ElementType.SUPERSCRIPT&&(j+=this.superscriptParticle.getOffsetY(X)),this.strikeout.recordFillInfo(t,C,j,b.width)}}else y?.strikeout&&this.strikeout.render(t);const{zone:W,splitTdRange:D}=this.range.getRange();let{startIndex:U,endIndex:Q}=this.range.getRange(),G=!1;if(T&&D&&[T.originalId,T.id].includes(D.originalId)&&(G=!0,U=D.startIndex-(T.valueStartIndex??0),Q=D.endIndex-(T.valueStartIndex??0)),W===g&&U!==Q&&U<=O&&O<=Q){const H=this.position.getPositionContext();if(!H.isTable&&!X.tdId||H.tdId===X.tdId||G)if(U===O){const j=R[U+1];j&&j.value===_&&(N.x=C+b.width,N.y=M,N.height=F.height,N.width+=this.options.rangeMinWidth)}else{let j=b.width;j===0&&F.elementList.length===1&&(j=this.options.rangeMinWidth),N.width||(N.x=C,N.y=M,N.height=F.height),N.width+=j}}if(!r.disabled&&X.groupIds&&this.group.recordFillInfo(X,C,M,b.width,F.height),O++,X.type===l.ElementType.TABLE&&!X.hide){const H=X.tdPadding||i,j=H[1]+H[3];for(let st=0;st<X.trList.length;st++){const it=X.trList[st];for(let nt=0;nt<it.tdList.length;nt++){const et=it.tdList[nt];this.drawRow(t,{elementList:et.value,positionList:et.positionList,rowList:et.rowList,pageNo:d,startIndex:0,innerWidth:(et.width-j)*n,zone:g,isDrawLineBreak:f,td:et})}}}}if(F.isList&&this.listParticle.drawListStyle(t,F,u[F.startIndex]),this.textParticle.complete(),this.control.drawBorder(t),this.underline.render(t),this.strikeout.render(t),this.group.render(t),!m&&!I){if(N.width&&N.height){const{x:Y,y:X,width:b,height:E}=N;this.range.render(t,Y,X,b,E)}if(L&&V&&V.id===P){const{coordinate:{leftTop:[Y,X]}}=u[F.startIndex];this.tableParticle.drawRange(t,V,Y,X)}}}}_drawFloat(t,e){const{scale:n}=this.options,i=this.position.getFloatPositionList(),{imgDisplays:r,pageNo:s}=e;for(let a=0;a<i.length;a++){const c=i[a],d=c.element;if((s===c.pageNo||c.zone===l.EditorZone.HEADER||c.zone==l.EditorZone.FOOTER)&&d.imgDisplay&&r.includes(d.imgDisplay)&&d.type===l.ElementType.IMAGE){const R=d.imgFloatPosition;this.imageParticle.render(t,d,R.x*n,R.y*n)}}}_clearPage(t){const e=this.ctxList[t],n=this.pageList[t];e.clearRect(0,0,Math.max(n.width,this.getWidth()),Math.max(n.height,this.getHeight())),this.blockParticle.clear()}_drawPage(t){const{elementList:e,positionList:n,rowList:i,pageNo:r}=t,{inactiveAlpha:s,pageMode:a,header:c,footer:d,pageNumber:R,lineNumber:u,pageBorder:h}=this.options,g=this.mode===l.EditorMode.PRINT,f=this.getInnerWidth(),T=this.ctxList[r];T.globalAlpha=this.zone.isMainActive()?1:s,this._clearPage(r),(!g||!this.options.modeRule[l.EditorMode.PRINT]?.backgroundDisabled)&&this.background.render(T,r),g||this.area.render(T,r),a!==l.PageMode.CONTINUITY&&this.options.watermark.data&&this.waterMark.render(T,r),g||this.margin.render(T,r),this._drawFloat(T,{pageNo:r,imgDisplays:[l.ImageDisplay.FLOAT_BOTTOM]}),g||this.control.renderHighlightList(T,r);const p=i[0]?.startIndex;this.drawRow(T,{elementList:e,positionList:n,rowList:i,pageNo:r,startIndex:p,innerWidth:f,zone:l.EditorZone.MAIN}),this.getIsPagingMode()&&(c.disabled||this.header.render(T,r),R.disabled||this.pageNumber.render(T,r),d.disabled||this.footer.render(T,r)),this._drawFloat(T,{pageNo:r,imgDisplays:[l.ImageDisplay.FLOAT_TOP,l.ImageDisplay.SURROUND]}),!g&&this.search.getSearchKeyword()&&this.search.render(T,r),this.elementList.length<=1&&!this.elementList[0]?.listId&&this.placeholder.render(T),u.disabled||this.lineNumber.render(T,r),h.disabled||this.pageBorder.render(T),this.badge.render(T,r),this.isGraffitiMode()&&this.graffiti.render(T,r)}_disconnectLazyRender(){this.lazyRenderIntersectionObserver?.disconnect()}_lazyRender(){const t=this.position.getOriginalMainPositionList(),e=this.getOriginalMainElementList();this._disconnectLazyRender(),this.lazyRenderIntersectionObserver=new IntersectionObserver(n=>{n.forEach(i=>{if(i.isIntersecting){const r=Number(i.target.dataset.index);this._drawPage({elementList:e,positionList:t,rowList:this.pageRowList[r],pageNo:r})}})}),this.pageList.forEach(n=>{this.lazyRenderIntersectionObserver.observe(n)})}_immediateRender(){const t=this.position.getOriginalMainPositionList(),e=this.getOriginalMainElementList();for(let n=0;n<this.pageRowList.length;n++)this._drawPage({elementList:e,positionList:t,rowList:this.pageRowList[n],pageNo:n})}render(t){const e=bt(),n=[],i=(b,E)=>{n.push({label:b,duration:bt()-E})};this.renderCount++;let r;const{endIndex:s,isCrossRowCol:a}=this.range.getRange(),c=this.position.getPositionContext();if(a)r=this.getOriginalElementList()[c.index];else{const b=~s?s:0,E=this.getElementList();r=je(E,b)}const{header:d,footer:R}=this.options,{isSubmitHistory:u=!0,isSetCursor:h=!0,isCompute:g=!0,isLazy:f=!0,isInit:T=!1,isSourceHistory:p=!1,isFirstRender:m=!1,isDel:I=!1}=t||{};let{curIndex:L}=t||{};const{traceLabel:P}=t||{},O=this.getInnerWidth(),S=this.getIsPagingMode(),F=this.pageRowList.length;if(g){if(this.splitTdValueMap.clear(),this.tdMap.clear(),this.position.setFloatPositionList([]),S){if(!d.disabled){const j=bt();this.header.compute(),i("header.compute",j)}if(!R.disabled){const j=bt();this.footer.compute(),i("footer.compute",j)}}const b=this.getMargins(),E=this.getHeight(),C=this.header.getExtraHeight(),M=this.getMainOuterHeight(),y=b[3],W=b[0]+C,D=wo(this.elementList),U=bt();this.rowList=this.computeRowList({startX:y,startY:W,pageHeight:E,mainOuterHeight:M,isPagingMode:S,innerWidth:O,surroundElementList:D,elementList:this.elementList}),i("computeRowList",U);const Q=bt();this.pageRowList=this._computePageList(),i("computePageList",Q);const G=bt();this.position.computePositionList(),i("computePositionList",G);const H=bt();if(this.area.compute(),i("area.compute",H),!this.isPrintMode()){const j=this.search.getSearchKeyword();if(j){const it=bt();this.search.compute(j),i("search.compute",it)}const st=bt();this.control.computeHighlightList(),i("control.computeHighlightList",st)}if(this.isGraffitiMode()){const j=bt();this.graffiti.compute(),i("graffiti.compute",j)}}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let b=0;b<this.pageRowList.length;b++)this.pageList[b]||this._createPage(b);const N=this.pageRowList.length,V=this.pageList.length;if(V>N){const b=V-N;this.ctxList.splice(N,b),this.pageList.splice(N,b).forEach(E=>E.remove())}const Y=bt();if(f&&S?this._lazyRender():this._immediateRender(),i(f&&S?"lazyRender":"immediateRender",Y),h){if(g&&r?.tableId){const{index:b}=c,C=this.getOriginalElementList()[b];if(r.tableId!==C?.id){const y=this.findTableChildrenElement(!0,r.tableId,r);y&&c.index!==y.originalIndex&&(c.index=y.originalIndex,c.tableId=y.table.id,c.trIndex=y.trIndex,c.trId=y.tr.id,c.tdIndex=y.tdIndex,c.tdId=y.td.id,L=y.elementIndex,this.position.setPositionContext(c),this.range.setRange(L,L),this.updateTableTool())}const M=this.getElementList();M[s]!==r&&(L=M.findIndex(y=>y===r))}L=this.setCursor(L)}else this.range.getIsSelection()&&this.cursor.focus();if(I){let b;const E=this.position.getPositionContext();b=this.range.getRange().startIndex-1,E.index=b}(u&&!m||L!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(L);const X=bt();Oo(()=>{const b=bt();this.range.setRangeStyle(),g&&this.control.getActiveControl()&&this.control.reAwakeControl(),g&&!this.isReadonly()&&this.getMode()!==l.EditorMode.FORM&&c.isTable&&this.getOriginalElementList()[c.index].type===l.ElementType.TABLE&&this.tableTool.render(),g&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),F!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(u||p)&&!T&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"));const E=bt();Co(this.options,P||"render",E-e,[...n,{label:"nextTick.wait",duration:b-X},{label:"nextTick.callback",duration:E-b}],{isCompute:g,pageCount:this.pageRowList.length})}),h&&this.fixPosition()}fixPosition(t=!1){let e;const n=this.position.getPositionContext();if(n.isTable){const i=this.getElementList(),r=this.range.getRange().startIndex;if(t||r>=i.length){const s=this.getTd(),a=n.index+(t?-1:1),d=this.getOriginalElementList()[a];if(!d?.trList)return;e=r-i.length;for(let R=0;R<d.trList.length;R++){const u=d.trList[R],h=u.tdList.find(g=>t?s?.linkTdPrevId===g.id:s?.id===g.linkTdPrevId);if(h){n.index=a,n.trIndex=R,n.tableId=d.id,n.trId=u.id,n.tdId=h?.id,e=t?h.value.length-1:e+(h.value[0]?.type===l.ElementType.SPLIT_TAG?1:0);break}}if(this.position.setPositionContext(n),this.range.setRange(e,e),this.setCursor(e),e===0)return this.fixPosition(t);this.updateTableTool()}}return e}setCursor(t){const e=this.position.getPositionContext(),n=this.position.getPositionList(),i=this.getElementList();if(e.isTable){const{index:s,trIndex:a,tdIndex:c}=e,R=this.getOriginalElementList()[s].trList?.[a].tdList[c].positionList;t===void 0&&R&&(t=R.length-1);const u=R?.[t];this.position.setCursorPosition(u||null)}else t!==void 0&&t>=n.length&&(t=n.length-1),this.position.setCursorPosition(t!==void 0&&t>=0?n[t]:null);let r=!0;if(t!==void 0&&e.isImage&&e.isDirectHit){const s=i[t];if(s&&rl.includes(s.type)){r=!1;const a=this.position.getCursorPosition();this.previewer.updateResizer(s,a)}}return this.cursor.drawCursor({isShow:r}),t}submitHistory(t){const e=this.position.getPositionContext(),n=Uo(this.elementList),i=Uo(this.header.getElementList()),r=Uo(this.footer.getElementList()),s=at(this.range.getRange()),a=this.pageNo,c=at(e),d=this.zone.getZone();this.historyManager.execute(()=>{this.zone.setZone(d),this.setPageNo(a),this.position.setPositionContext(at(c)),this.header.setElementList(at(i)),this.footer.setElementList(at(r)),this.elementList=at(n),this.range.replaceRange(at(s)),this.render({curIndex:t,isSubmitHistory:!1,isSourceHistory:!0})})}destroy(){this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getPreviewer().clearResizer(),this.getTableTool().dispose(),this.getHyperlinkParticle().clearHyperlinkPopup(),this.getDateParticle().clearDatePicker()}updateTableTool(){if(this.getMode()===l.EditorMode.FORM){this.getTableTool().dispose();return}if(this.position.getPositionContext().isTable){const t=this.position.getPositionList();t.length&&(this.setPageNo(t[0].pageNo),this.getTableTool().render())}}initTableElementIndex(t,e){t.trList?.forEach((n,i)=>{n.tdList.forEach((r,s)=>{r.tableIndex=e,r.tableId=t.id,r.trIndex=i,r.trId=n.id,r.tdIndex=s,this.tdMap.set(r.id,r)})})}clearElementEffect(t){t.trList?.forEach(e=>{e.minHeight=e.originalMinHeight??e.minHeight,delete e.originalMinHeight,e.tdList.forEach(n=>{delete n.linkTdNextId})})}updateElementTableInfo(t,e,n,i){return t.tableId=e.id,t.trId=n.id,t.tdId=i.id,t}findTableChildrenElement(t,e,n){const i=this.position.getPositionContext(),{index:r}=i,s=this.getOriginalElementList();let a=r;t&&(a=r>s.length?s.length-1:r);for(let c=a;t?c>=0:c<s.length;t?c--:c++){const d=s[c];if(d&&[d.originalId,d.id].includes(e))for(const[R,u]of d.trList.entries())for(const[h,g]of u.tdList.entries()){const f=g.value.findIndex(typeof n=="function"?n:T=>T===n);if(f>=0)return{originalIndex:c,table:d,tr:u,trIndex:R,td:g,tdIndex:h,elementIndex:f}}}}getTdById(t){return this.tdMap.get(t)}getLinkTdPrevHasValue(t){const e=this.getTdById(t);if(e)return e.value.length?e:this.getLinkTdPrevHasValue(e.linkTdPrevId)}getFirstLinkTd(t){const e=this.getTdById(t);return e?.linkTdPrevId?this.getLastLinkTd(e.linkTdPrevId):e}getLastLinkTd(t){const e=this.getTdById(t);return e?.linkTdNextId?this.getLastLinkTd(e.linkTdNextId):e}removeLinkTd(t,e){const n=this.getTdById(e);if(n){if(n.linkTdPrevId){const i=this.getTdById(n.linkTdPrevId);i&&(delete i.linkTdNextId,this.removeLinkTd(t,n.linkTdPrevId))}if(n.linkTdNextId){const i=this.getTdById(n.linkTdNextId);i&&(delete i.linkTdPrevId,this.removeLinkTd(t,n.linkTdNextId))}t[n.tableIndex].trList[n.trIndex].tdList.splice(n.tdIndex,1),this.initTableElementIndex(t[n.tableIndex],n.tableIndex)}}removeLinkTdControl(t,e){const n=this.getTdById(t);if(n){for(let i=0;i<n.value.length;i++)n.value[i].control===e&&(n.value.splice(i,1),i--);n.linkTdNextId&&this.removeLinkTdControl(n.linkTdNextId,e)}}isSplitTd(t,e){return(!!t?.originalId||!!e?.originalId)&&(t?.originalId===e?.originalId||t?.id===e?.originalId||t?.originalId===e?.id)}getSplitTdValues(t){return this.splitTdValueMap.get(t)}removeSplitTdOtherRangeElements(){const{splitTdRange:t}=this.range.getRange();if(!t)return;const{startIndex:e,endIndex:n}=t;let i=this.getTd();if(i)if((i.valueStartIndex??0)>=e){let r=-1;for(;r<0;){const s=this.getTdById(i.linkTdPrevId);if(s){r=e-(s.valueStartIndex??0);const a=Math.max(0,r);this.spliceElementList(s.value,a+1,s.value.length-a-1),i=s}else r=0}}else{let r=1;for(;r>0;){const s=this.getTdById(i.linkTdNextId);if(s){const a=s.valueStartIndex??0;r=n-(a+s.value.length);const c=Math.min(s.value.length,n-a+1);this.spliceElementList(s.value,0,c),i=s}else r=0}}}getTablesByPagingId(t,e,n){const i=[],r=[];if(t[n].pagingId===e){i.push(n),r.push(t[n]);for(let s=n-1;s>=0&&t[s].pagingId===e;s--)r.unshift(t[s]),i.push(s);for(let s=n+1;s<t.length&&t[s].pagingId===e;s++)r.push(t[s]),i.push(s)}return{list:r,startIndex:i.sort()[0]}}}class Xr{executeMode;executeCut;executeCopy;executePaste;executeSelectAll;executeBackspace;executeSetRange;executeReplaceRange;executeSetPositionContext;executeForceUpdate;executeBlur;executeHideCursor;executeUndo;executeRedo;executePainter;executeApplyPainterStyle;executeFormat;executeFont;executeButton;executeEditElementAttribute;executeTriggerControlEditAttribute;executeCopyControl;executePasteControl;executeSize;executeSizeAdd;executeSizeMinus;executeBold;executeItalic;executeUnderline;executeStrikeout;executeSuperscript;executeSubscript;executeColor;executeHighlight;executeTitle;executeList;executeRowFlex;executeVertical;executeRowMargin;executeInsertTable;executeInsertTableTopRow;executeInsertTableBottomRow;executeInsertTableLeftCol;executeInsertTableRightCol;executeDeleteTableRow;executeDeleteTableCol;executeDeleteTable;executeMergeTableCell;executeCancelMergeTableCell;executeSplitVerticalTableCell;executeSplitHorizontalTableCell;executeTableTdVerticalAlign;executeTableBorderType;executeTableBorderColor;executeTableTdBorderType;executeTableTdSlashType;executeTableTdBackgroundColor;executeTableSelectAll;executeTableProperties;executeImage;executeHyperlink;executeDeleteHyperlink;executeCancelHyperlink;executeEditHyperlink;executeSeparator;executePageBreak;executeAddWatermark;executeDeleteWatermark;executeSearch;executeSearchNavigatePre;executeSearchNavigateNext;executeReplace;executePrint;executeReplaceImageElement;executeSaveAsImageElement;executeSetImageCrop;executeSetImageCaption;executeChangeImageDisplay;executePageMode;executePageScale;executePageScaleRecovery;executePageScaleMinus;executePageScaleAdd;executePaperSize;executePaperDirection;executeSetPaperMargin;executeSetMainBadge;executeSetAreaBadge;executeInsertElementList;executeInsertArea;executeSetAreaValue;executeSetAreaProperties;executeLocationArea;executeClearGraffiti;executeAppendElementList;executeUpdateElementById;executeDeleteElementById;executeSetValue;executeRemoveControl;executeTranslate;executeSetLocale;executeLocationCatalog;executeWordTool;executeSetHTML;executeSetGroup;executeDeleteGroup;executeLocationGroup;executeSetZone;executeSetControlValue;executeSetControlValueList;executeSetControlExtension;executeSetControlExtensionList;executeSetControlProperties;executeSetControlPropertiesList;executeSetControlHighlight;executeLocationControl;executeInsertControl;executeInsertTextField;executeJumpControl;executeUpdateOptions;executeSetFormModeTrace;executeInsertTitle;executeFocus;executeComputeElementListHeight;getCatalog;getImage;getPageMode;getOptions;getValue;getValueAsync;getAreaValue;getHTML;getText;getWordCount;getCursorPosition;getRemainingContentHeight;getRange;getRangeText;getRangeContext;getRangeRow;getRangeParagraph;getKeywordRangeList;getKeywordContext;getPaperMargin;getSearchNavigateInfo;getLocale;getGroupIds;getControlValue;getControlList;getContainer;getTitleValue;getPositionContextByEvent;getElementById;getMacroValue;getMacroList;setMacroValue;setMacroValueList;updateMacroProperties;locationMacro;insertSubTemplate;expandSubTemplate;collapseSubTemplate;toggleSubTemplate;constructor(t){this.executeMode=t.mode.bind(t),this.executeCut=t.cut.bind(t),this.executeCopy=t.copy.bind(t),this.executePaste=t.paste.bind(t),this.executeSelectAll=t.selectAll.bind(t),this.executeBackspace=t.backspace.bind(t),this.executeSetRange=t.setRange.bind(t),this.executeReplaceRange=t.replaceRange.bind(t),this.executeSetPositionContext=t.setPositionContext.bind(t),this.executeForceUpdate=t.forceUpdate.bind(t),this.executeBlur=t.blur.bind(t),this.executeHideCursor=t.hideCursor.bind(t),this.executeUndo=t.undo.bind(t),this.executeRedo=t.redo.bind(t),this.executePainter=t.painter.bind(t),this.executeApplyPainterStyle=t.applyPainterStyle.bind(t),this.executeFormat=t.format.bind(t),this.executeFont=t.font.bind(t),this.executeButton=t.buttonText.bind(t),this.executeEditElementAttribute=t.editElementAttribute.bind(t),this.executeTriggerControlEditAttribute=t.triggerControlEditAttribute.bind(t),this.executeCopyControl=t.copyControl.bind(t),this.executePasteControl=t.pasteControl.bind(t),this.executeSize=t.size.bind(t),this.executeSizeAdd=t.sizeAdd.bind(t),this.executeSizeMinus=t.sizeMinus.bind(t),this.executeBold=t.bold.bind(t),this.executeItalic=t.italic.bind(t),this.executeUnderline=t.underline.bind(t),this.executeStrikeout=t.strikeout.bind(t),this.executeSuperscript=t.superscript.bind(t),this.executeSubscript=t.subscript.bind(t),this.executeColor=t.color.bind(t),this.executeHighlight=t.highlight.bind(t),this.executeTitle=t.title.bind(t),this.executeList=t.list.bind(t),this.executeRowFlex=t.rowFlex.bind(t),this.executeVertical=t.vertical.bind(t),this.executeRowMargin=t.rowMargin.bind(t),this.executeInsertTable=t.insertTable.bind(t),this.executeInsertTableTopRow=t.insertTableTopRow.bind(t),this.executeInsertTableBottomRow=t.insertTableBottomRow.bind(t),this.executeInsertTableLeftCol=t.insertTableLeftCol.bind(t),this.executeInsertTableRightCol=t.insertTableRightCol.bind(t),this.executeDeleteTableRow=t.deleteTableRow.bind(t),this.executeDeleteTableCol=t.deleteTableCol.bind(t),this.executeDeleteTable=t.deleteTable.bind(t),this.executeMergeTableCell=t.mergeTableCell.bind(t),this.executeCancelMergeTableCell=t.cancelMergeTableCell.bind(t),this.executeSplitVerticalTableCell=t.splitVerticalTableCell.bind(t),this.executeSplitHorizontalTableCell=t.splitHorizontalTableCell.bind(t),this.executeTableTdVerticalAlign=t.tableTdVerticalAlign.bind(t),this.executeTableBorderType=t.tableBorderType.bind(t),this.executeTableBorderColor=t.tableBorderColor.bind(t),this.executeTableTdBorderType=t.tableTdBorderType.bind(t),this.executeTableTdSlashType=t.tableTdSlashType.bind(t),this.executeTableTdBackgroundColor=t.tableTdBackgroundColor.bind(t),this.executeTableSelectAll=t.tableSelectAll.bind(t),this.executeTableProperties=t.tableProperties.bind(t),this.executeImage=t.image.bind(t),this.executeHyperlink=t.hyperlink.bind(t),this.executeDeleteHyperlink=t.deleteHyperlink.bind(t),this.executeCancelHyperlink=t.cancelHyperlink.bind(t),this.executeEditHyperlink=t.editHyperlink.bind(t),this.executeSeparator=t.separator.bind(t),this.executePageBreak=t.pageBreak.bind(t),this.executeAddWatermark=t.addWatermark.bind(t),this.executeDeleteWatermark=t.deleteWatermark.bind(t),this.executeSearch=t.search.bind(t),this.executeSearchNavigatePre=t.searchNavigatePre.bind(t),this.executeSearchNavigateNext=t.searchNavigateNext.bind(t),this.executeReplace=t.replace.bind(t),this.executePrint=t.print.bind(t),this.executeReplaceImageElement=t.replaceImageElement.bind(t),this.executeSaveAsImageElement=t.saveAsImageElement.bind(t),this.executeSetImageCrop=t.setImageCrop.bind(t),this.executeSetImageCaption=t.setImageCaption.bind(t),this.executeChangeImageDisplay=t.changeImageDisplay.bind(t),this.executePageMode=t.pageMode.bind(t),this.executePageScale=t.pageScale.bind(t),this.executePageScaleRecovery=t.pageScaleRecovery.bind(t),this.executePageScaleMinus=t.pageScaleMinus.bind(t),this.executePageScaleAdd=t.pageScaleAdd.bind(t),this.executePaperSize=t.paperSize.bind(t),this.executePaperDirection=t.paperDirection.bind(t),this.executeSetPaperMargin=t.setPaperMargin.bind(t),this.executeSetMainBadge=t.setMainBadge.bind(t),this.executeSetAreaBadge=t.setAreaBadge.bind(t),this.getAreaValue=t.getAreaValue.bind(t),this.executeInsertArea=t.insertArea.bind(t),this.executeSetAreaValue=t.setAreaValue.bind(t),this.executeSetAreaProperties=t.setAreaProperties.bind(t),this.executeLocationArea=t.locationArea.bind(t),this.executeClearGraffiti=t.clearGraffiti.bind(t),this.executeInsertElementList=t.insertElementList.bind(t),this.executeAppendElementList=t.appendElementList.bind(t),this.executeUpdateElementById=t.updateElementById.bind(t),this.executeDeleteElementById=t.deleteElementById.bind(t),this.executeSetValue=t.setValue.bind(t),this.executeRemoveControl=t.removeControl.bind(t),this.executeTranslate=t.translate.bind(t),this.executeSetLocale=t.setLocale.bind(t),this.executeLocationCatalog=t.locationCatalog.bind(t),this.executeWordTool=t.wordTool.bind(t),this.executeSetHTML=t.setHTML.bind(t),this.executeSetGroup=t.setGroup.bind(t),this.executeDeleteGroup=t.deleteGroup.bind(t),this.executeLocationGroup=t.locationGroup.bind(t),this.executeSetZone=t.setZone.bind(t),this.executeUpdateOptions=t.updateOptions.bind(t),this.executeSetFormModeTrace=t.setFormModeTrace.bind(t),this.executeInsertTitle=t.insertTitle.bind(t),this.executeFocus=t.focus.bind(t),this.executeComputeElementListHeight=t.computeElementListHeight.bind(t),this.getImage=t.getImage.bind(t),this.getPageMode=t.getPageMode.bind(t),this.getOptions=t.getOptions.bind(t),this.getValue=t.getValue.bind(t),this.getValueAsync=t.getValueAsync.bind(t),this.getHTML=t.getHTML.bind(t),this.getText=t.getText.bind(t),this.getWordCount=t.getWordCount.bind(t),this.getCursorPosition=t.getCursorPosition.bind(t),this.getRemainingContentHeight=t.getRemainingContentHeight.bind(t),this.getRange=t.getRange.bind(t),this.getRangeText=t.getRangeText.bind(t),this.getRangeContext=t.getRangeContext.bind(t),this.getRangeRow=t.getRangeRow.bind(t),this.getRangeParagraph=t.getRangeParagraph.bind(t),this.getKeywordRangeList=t.getKeywordRangeList.bind(t),this.getKeywordContext=t.getKeywordContext.bind(t),this.getCatalog=t.getCatalog.bind(t),this.getPaperMargin=t.getPaperMargin.bind(t),this.getSearchNavigateInfo=t.getSearchNavigateInfo.bind(t),this.getLocale=t.getLocale.bind(t),this.getGroupIds=t.getGroupIds.bind(t),this.getContainer=t.getContainer.bind(t),this.getTitleValue=t.getTitleValue.bind(t),this.getPositionContextByEvent=t.getPositionContextByEvent.bind(t),this.getElementById=t.getElementById.bind(t),this.executeSetControlValue=t.setControlValue.bind(t),this.executeSetControlValueList=t.setControlValueList.bind(t),this.executeSetControlExtension=t.setControlExtension.bind(t),this.executeSetControlExtensionList=t.setControlExtensionList.bind(t),this.executeSetControlProperties=t.setControlProperties.bind(t),this.executeSetControlPropertiesList=t.setControlPropertiesList.bind(t),this.executeSetControlHighlight=t.setControlHighlight.bind(t),this.getControlValue=t.getControlValue.bind(t),this.getControlList=t.getControlList.bind(t),this.executeLocationControl=t.locationControl.bind(t),this.executeInsertControl=t.insertControl.bind(t),this.executeInsertTextField=t.insertTextField.bind(t),this.executeJumpControl=t.jumpControl.bind(t),this.getMacroValue=t.getMacroValue.bind(t),this.getMacroList=t.getMacroList.bind(t),this.setMacroValue=t.setMacroValue.bind(t),this.setMacroValueList=t.setMacroValueList.bind(t),this.updateMacroProperties=t.updateMacroProperties.bind(t),this.locationMacro=t.locationMacro.bind(t),this.insertSubTemplate=t.insertSubTemplate.bind(t),this.expandSubTemplate=t.expandSubTemplate.bind(t),this.collapseSubTemplate=t.collapseSubTemplate.bind(t),this.toggleSubTemplate=t.toggleSubTemplate.bind(t)}}function qh(o,t){return o===1125&&t===1593?{size:"a3",width:"297mm",height:"420mm"}:o===794&&t===1123?{size:"a4",width:"210mm",height:"297mm"}:o===565&&t===796?{size:"a5",width:"148mm",height:"210mm"}:{size:"",width:`${o}px`,height:`${t}px`}}function tg(o,t){const{width:e,height:n,direction:i=l.PaperDirection.VERTICAL}=t,r=document.createElement("iframe");r.style.visibility="hidden",r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.width="0",r.style.height="0",r.style.border="none",document.body.append(r);const s=r.contentWindow,a=s.document;a.open();const c=document.createElement("div"),d=qh(e,n);o.forEach(h=>{const g=document.createElement("img");g.style.width=i===l.PaperDirection.HORIZONTAL?d.height:d.width,g.style.height=i===l.PaperDirection.HORIZONTAL?d.width:d.height,g.src=h,c.append(g)});const R=document.createElement("style"),u=`
538
+ `,document.body.appendChild(a);const c=a.querySelector(".table-properties-modal__mask"),d=a.querySelector(".table-properties-modal__close"),R=a.querySelector(".btn-cancel"),u=a.querySelector(".btn-confirm"),h=()=>{a.remove()};c.addEventListener("click",h),d.addEventListener("click",h),R.addEventListener("click",h),u.addEventListener("click",()=>{const g=parseInt(a.querySelector("#tdPaddingTop").value)||0,f=parseInt(a.querySelector("#tdPaddingRight").value)||0,T=parseInt(a.querySelector("#tdPaddingBottom").value)||0,m=parseInt(a.querySelector("#tdPaddingLeft").value)||0;i.tdPadding=[g,f,T,m],h();const{endIndex:p}=this.range.getRange();this.draw.render({curIndex:p,isCompute:!0})})}}l.AreaMode=void 0,(function(o){o.EDIT="edit",o.READONLY="readonly",o.FORM="form"})(l.AreaMode||(l.AreaMode={}));class eg{draw;zone;range;position;options;areaInfoMap=new Map;constructor(t){this.draw=t,this.options=t.getOptions(),this.zone=t.getZone(),this.range=t.getRange(),this.position=t.getPosition()}getAreaInfo(){return this.areaInfoMap}getActiveAreaId(){if(!this.areaInfoMap.size)return null;const{startIndex:t}=this.range.getRange();return this.draw.getElementList()[t]?.areaId||null}getActiveAreaInfo(){const t=this.getActiveAreaId();return t&&this.areaInfoMap.get(t)||null}isReadonly(){const t=this.getActiveAreaInfo();if(!t?.area)return!1;switch(t.area.mode){case l.AreaMode.EDIT:return!1;case l.AreaMode.READONLY:return!0;case l.AreaMode.FORM:return!this.draw.getControl().getIsRangeWithinControl();default:return!1}}insertArea(t){const{id:e,value:n,area:i,position:r,range:s}=t;if(this.zone.getZone()!==l.EditorZone.MAIN&&this.zone.setZone(l.EditorZone.MAIN),this.draw.getPosition().setPositionContext({isTable:!1}),s&&!this.getActiveAreaId()){const{startIndex:c,endIndex:d}=s,R=this.draw.getOriginalMainElementList();if(!R[c]||!R[d])return null;this.range.setRange(s.startIndex,s.endIndex)}else if(r===l.LocationPosition.BEFORE)this.range.setRange(0,0);else{const d=this.draw.getOriginalMainElementList().length-1;this.range.setRange(d,d)}const a=e||lt();return this.draw.insertElementList([{type:l.ElementType.AREA,value:"",areaId:a,valueList:n,area:at(i)}]),a}render(t,e){if(!this.areaInfoMap.size)return;t.save();const n=this.draw.getMargins(),i=this.draw.getInnerWidth();for(const r of this.areaInfoMap){const{area:s,positionList:a}=r[1];if(s?.hide||!s?.backgroundColor&&!s?.borderColor&&!s?.placeholder)continue;const c=a.filter(f=>f.pageNo===e);if(!c.length)continue;t.translate(.5,.5);const d=c[0],R=c[c.length-1],u=n[3],h=Math.ceil(d.coordinate.leftTop[1]),g=Math.ceil(R.coordinate.rightBottom[1]-h);t.textBaseline="middle",s.backgroundColor&&(t.fillStyle=s.backgroundColor,t.fillRect(u,h,i,g)),s.borderColor&&(t.strokeStyle=s.borderColor,t.strokeRect(u,h,i,g)),s.placeholder&&a.length<=1&&new Xr(this.draw).render(t,{placeholder:{...Bi,...s.placeholder},startY:d.coordinate.leftTop[1]}),t.translate(-.5,-.5)}t.restore()}compute(){this.areaInfoMap.clear();const t=this.draw.getOriginalMainElementList(),e=this.position.getOriginalMainPositionList();for(let n=0;n<t.length;n++){const i=t[n],r=i.areaId;if(r){const s=this.areaInfoMap.get(r);s?(s.elementList.push(i),s.positionList.push(e[n])):this.areaInfoMap.set(r,{id:r,area:i.area,elementList:[i],positionList:[e[n]]})}}}getAreaValue(t={}){const e=t.id||this.getActiveAreaId();if(!e)return null;const n=this.areaInfoMap.get(e);return n?{area:n.area,id:n.id,startPageNo:n.positionList[0].pageNo,endPageNo:n.positionList[n.positionList.length-1].pageNo,value:Pt(n.elementList)}:null}getContextByAreaId(t,e){const n=this.draw.getOriginalMainElementList();for(let i=0;i<n.length;i++){const r=n[i];if(e?.position===l.LocationPosition.OUTER_BEFORE){if(n[i+1]?.areaId!==t)continue}else if(e?.position===l.LocationPosition.AFTER){if(!(r.areaId===t&&n[i+1]?.areaId!==t))continue}else if(e?.position===l.LocationPosition.OUTER_AFTER){if(!(r.areaId!==t&&n[i-1]?.areaId===t))continue}else if(r.areaId!==t)continue;const s=this.position.getOriginalMainPositionList();return{range:{startIndex:i,endIndex:i},elementPosition:s[i]}}return null}setAreaProperties(t){const e=t.id||this.getActiveAreaId();if(!e)return;const n=this.areaInfoMap.get(e);if(!n)return;n.area||(n.area={});let i=!1;const r=["top","hide"];Object.entries(t.properties).forEach(([s,a])=>{if(Qi(a))return;const c=s;n.area[c]=a,r.includes(c)&&(i=!0)}),this.draw.render({isCompute:i,isSetCursor:!1})}setAreaValue(t){const e=t.id||this.getActiveAreaId();if(!e)return;const n=this.areaInfoMap.get(e);if(!n)return;const{positionList:i}=n,r=this.draw.getOriginalMainElementList(),s=t.value;bt([{type:l.ElementType.AREA,value:"",valueList:s,areaId:n.id,area:n.area}],{editorOptions:this.options}),this.draw.spliceElementList(r,i[0].index,i.length,s,{isIgnoreDeletedRule:!0}),this.draw.render({isSetCursor:!1})}}class ng{draw;options;imageCache;mainBadge;areaBadgeMap;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map,this.mainBadge=null,this.areaBadgeMap=new Map}setMainBadge(t){this.mainBadge=t}setAreaBadgeMap(t){this.areaBadgeMap.clear(),t.forEach(e=>{this.areaBadgeMap.set(e.areaId,e.badge)})}_drawImage(t,e,n,i,r,s){if(this.imageCache.has(s)){const a=this.imageCache.get(s);t.drawImage(a,e,n,i,r)}else{const a=new Image;a.setAttribute("crossOrigin","Anonymous"),a.src=s,a.onload=()=>{this.imageCache.set(s,a),t.drawImage(a,e,n,i,r)}}}render(t,e){if(e===0&&this.mainBadge){const{scale:n,badge:i}=this.options,{left:r,top:s,width:a,height:c,value:d}=this.mainBadge,R=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),u=(r||i.left)*n,h=(s||i.top)*n+R;this._drawImage(t,u,h,a*n,c*n,d)}if(this.areaBadgeMap.size){const n=this.draw.getArea().getAreaInfo();if(n.size){const{scale:i,badge:r}=this.options;for(const s of n){const{positionList:a}=s[1],c=a[0];if(c.pageNo!==e)continue;const d=this.areaBadgeMap.get(s[0]);if(!d)continue;const{left:R,top:u,width:h,height:g,value:f}=d,T=(R||r.left)*i,m=(u||r.top)*i+c.coordinate.leftTop[1];this._drawImage(t,T,m,h*i,g*i,f)}}}}}class og{draw;options;data;pageContainer;isDrawing=!1;startStroke=null;constructor(t,e){this.draw=t,this.options=t.getOptions(),this.data=e||[],this.pageContainer=t.getPageContainer(),this.register()}register(){this.pageContainer.addEventListener("mousedown",this.start.bind(this)),this.pageContainer.addEventListener("mouseup",this.stop.bind(this)),this.pageContainer.addEventListener("mouseleave",this.stop.bind(this)),this.pageContainer.addEventListener("mousemove",this.drawing.bind(this))}start(t){if(!this.draw.isGraffitiMode())return;this.isDrawing=!0;const{scale:e}=this.options;this.startStroke={lineColor:this.options.graffiti.defaultLineColor,lineWidth:this.options.graffiti.defaultLineWidth,points:[t.offsetX/e,t.offsetY/e]}}stop(){this.isDrawing=!1}drawing(t){if(!this.isDrawing||!this.draw.isGraffitiMode())return;const{offsetX:e,offsetY:n}=t,i=2;if(this.startStroke&&Math.abs(this.startStroke.points[0]-e)<i&&Math.abs(this.startStroke.points[1]-n)<i)return;const r=this.draw.getPageNo();let s=this.data.find(d=>d.pageNo===r);if(this.startStroke&&(s||(s={pageNo:r,strokes:[]},this.data.push(s)),s.strokes.push(this.startStroke),this.startStroke=null),!s?.strokes?.length)return;const{scale:a}=this.options;s.strokes[s.strokes.length-1].points.push(e/a,n/a),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}getValue(){return this.data}compute(){const t=this.draw.getPageRowList().length;for(let e=this.data.length-1;e>=0;e--)this.data[e].pageNo>t-1&&this.data.splice(e,1)}clear(){this.data=[]}render(t,e){const n=this.data.find(a=>a.pageNo===e)?.strokes;if(!n?.length)return;const{graffiti:{defaultLineColor:i,defaultLineWidth:r},scale:s}=this.options;t.save();for(let a=0;a<n.length;a++){const c=n[a];t.beginPath(),t.strokeStyle=c.lineColor||i,t.lineWidth=(c.lineWidth||r)*s,t.moveTo(c.points[0]*s,c.points[1]*s);for(let d=2;d<c.points.length;d+=2)t.lineTo(c.points[d]*s,c.points[d+1]*s);t.stroke()}t.restore()}}const Nr=1024,ig=['[aria-modal="true"]','[role="dialog"]','[data-overlay-active="true"]',".ant-modal-root",".ant-modal-wrap",".ant-modal",".ant-drawer",".ant-select-dropdown",".ant-picker-dropdown",".ant-dropdown",".ant-popover",".ant-tooltip",".ant-cascader-dropdown",".ant-mentions-dropdown"].join(", ");function Fr(o,t,e){for(let n=0;n<e.length;n+=Nr){const i=e.slice(n,n+Nr);o.splice(t+n,0,...i)}}class sg{container;pageContainer;pageList;ctxList;pageNo;renderCount;pagePixelRatio;mode;options;position;zone;elementList;listener;eventBus;override;i18n;canvasEvent;globalEvent;cursor;range;margin;background;badge;search;group;area;underline;strikeout;highlight;historyManager;previewer;imageParticle;laTexParticle;textParticle;tableParticle;tableTool;tableOperate;pageNumber;lineNumber;waterMark;placeholder;header;footer;hyperlinkParticle;labelParticle;macroParticle;dateParticle;separatorParticle;pageBreakParticle;superscriptParticle;subscriptParticle;checkboxParticle;radioParticle;menstrualHistoryParticle;fetalHeartPositionParticle;toothPositionParticle;blockParticle;listParticle;lineBreakParticle;whiteSpaceParticle;control;pageBorder;workerManager;scrollObserver;selectionObserver;imageObserver;graffiti;command;interactionPaused;overlayActiveCount;globalShortcutSuspended;LETTER_REG;WORD_LIKE_REG;rowList;pageRowList;painterStyle;painterOptions;visiblePageNoList;intersectionPageNo;lazyRenderIntersectionObserver;printModeData;splitTdValueMap=new Map;tdMap=new Map;constructor(t,e,n,i,r,s){this.container=this._wrapContainer(t),this.pageList=[],this.ctxList=[],this.pageNo=0,this.renderCount=0,this.pagePixelRatio=null,this.mode=e.mode,this.options=e,this.elementList=n.main,this.listener=i,this.eventBus=r,this.override=s,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new Kh(e.locale),this.historyManager=new Aa(this),this.position=new ka(this),this.zone=new xh(this),this.range=new Ja(this),this.margin=new za(this),this.background=new Ba(this),this.badge=new ng(this),this.search=new ja(this),this.group=new kh(this),this.area=new eg(this),this.underline=new tc(this),this.strikeout=new qa(this),this.highlight=new $a(this),this.previewer=new Uh(this),this.imageParticle=new Hi(this),this.laTexParticle=new Gi(this),this.textParticle=new ec(this),this.tableParticle=new ic(this),this.tableTool=new sc(this),this.tableOperate=new tg(this),this.pageNumber=new an(this),this.lineNumber=new $h(this),this.waterMark=new gc(this),this.placeholder=new Xr(this),this.header=new cc(this,n.header),this.footer=new Gh(this,n.footer),this.hyperlinkParticle=new rc(this),this.labelParticle=new lc(this),this.macroParticle=new ac(this),this.dateParticle=new wh(this),this.separatorParticle=new uc(this),this.pageBreakParticle=new hc(this),this.superscriptParticle=new dc,this.subscriptParticle=new Rc,this.checkboxParticle=new Eh(this),this.radioParticle=new Xh(this),this.menstrualHistoryParticle=new Nh(this),this.fetalHeartPositionParticle=new Fh(this),this.toothPositionParticle=new yh(this),this.blockParticle=new Qh(this),this.listParticle=new Ah(this),this.lineBreakParticle=new wn(this),this.whiteSpaceParticle=new Jh(this),this.control=new Ih(this),this.pageBorder=new zh(this),this.graffiti=new og(this,n.graffiti),this.scrollObserver=new nc(this),this.selectionObserver=new oc(this),this.imageObserver=new Hh,new Bh(this),this.canvasEvent=new xa(this),this.cursor=new da(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new Ga(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new Dh(this),new qh(this);const{letterClass:a}=e;this.LETTER_REG=new RegExp(`[${a.join("")}]`),this.WORD_LIKE_REG=new RegExp(`${a.map(c=>`[^${c}][${c}]`).join("|")}`),this.rowList=[],this.pageRowList=[],this.painterStyle=null,this.painterOptions=null,this.visiblePageNoList=[],this.intersectionPageNo=0,this.lazyRenderIntersectionObserver=null,this.printModeData=null,this.interactionPaused=!1,this.overlayActiveCount=0,this.globalShortcutSuspended=!1,this.mode===l.EditorMode.PRINT&&this.setPrintData(),this.mode,l.EditorMode.FORM,this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}setPrintData(){this.printModeData={header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()};const t=at(this.printModeData);["header","main","footer"].forEach(r=>{t[r]=this.control.filterAssistElement(t[r])});const n=t,i=this.removeStrikeout(n);t.main=i.main.filter(r=>!r.strikeout),this.setEditorData(i)}removeStrikeout(t){if(Array.isArray(t))return t.map(e=>this.removeStrikeout(e)).filter(e=>!(e&&typeof e=="object"&&"strikeout"in e&&e.strikeout===!0));if(t&&typeof t=="object"){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=this.removeStrikeout(t[n]));return e}return t}clearPrintData(){this.printModeData&&(this.setEditorData(this.printModeData),this.printModeData=null)}pushLogicTemplateFieldValue(t,e,n){const i=e?.trim();if(!i||n===void 0||n===null||n==="")return;const r=t.get(i)||[];r.includes(n)||(r.push(n),t.set(i,r))}collectControlFieldValues(t,e,n,i){for(let r=0;r<t.length;r++){const s=t[r];if(s.type===l.ElementType.TABLE){const u=s.trList||[];for(const h of u)for(const g of h.tdList)this.collectControlFieldValues(g.value,e,n,i);continue}const a=s.controlId,c=s.control;if(!a||!c||i.has(a))continue;i.add(a);let d="";if(c.type===l.ControlType.TEXT||c.type===l.ControlType.TEXTFIELD||c.type===l.ControlType.DATE||c.type===l.ControlType.NUMBER){let u=r;for(;u<t.length;){const h=t[u];if(h.controlId!==a)break;h.controlComponent===l.ControlComponent.VALUE&&(d+=h.value===H?"":h.value),u++}}else if(c.type===l.ControlType.SELECT||c.type===l.ControlType.CHECKBOX||c.type===l.ControlType.RADIO){const u=c.code||"",h=u.split(",").map(T=>c.valueSets?.find(m=>m.code===T)?.value).filter(Boolean).join(","),g=[c.label,a,c.conceptId];[u,h].forEach(T=>{g.forEach(m=>{this.pushLogicTemplateFieldValue(e,m,T),this.pushLogicTemplateFieldValue(n,m,T)})});continue}[c.label,a,c.conceptId].forEach(u=>{this.pushLogicTemplateFieldValue(e,u,d),this.pushLogicTemplateFieldValue(n,u,d)})}}collectMacroFieldValues(t,e,n){Ke(t,i=>{if(i.type!==l.ElementType.MACRO&&i.type!==l.ElementType.CUSTOM_MACRO&&i.type!==l.ElementType.REUSABLE_ITEM)return;const r=i.type===l.ElementType.MACRO?i.value:i.type===l.ElementType.CUSTOM_MACRO?i.macroConfig?.value:i.reusableItemConfig?.value;[i.label,i.id,i.dictCode].forEach(a=>{this.pushLogicTemplateFieldValue(e,a,r),this.pushLogicTemplateFieldValue(n,a,r)})})}collectLogicTemplateFieldValueMaps(){const t=new Map,e=new Map,n=new Map,i=new Set;return[this.header.getElementList(),this.elementList,this.footer.getElementList()].forEach(s=>{this.collectControlFieldValues(s,e,t,i),this.collectMacroFieldValues(s,n,t)}),{auto:t,control:e,macro:n}}getLogicTemplateHiddenState(t,e){if(!t.logicTemplateId||!t.logicTemplateDisplayRule||this.mode===l.EditorMode.EDIT||this.mode===l.EditorMode.DESIGN||!Sh(t.logicTemplateDisplayRule,this.mode))return!1;const{field:n,regexp:i,flags:r,source:s="auto"}=t.logicTemplateDisplayRule,a=e[s].get(n.trim());if(!a?.length)return!0;try{const c=new RegExp(i,r);return!a.some(d=>(c.lastIndex=0,c.test(d)))}catch(c){return console.warn("逻辑模板正则配置无效:",t.logicTemplateDisplayRule,c),!0}}updateLogicTemplateVisibility(){const t=this.collectLogicTemplateFieldValueMaps();[this.header.getElementList(),this.elementList,this.footer.getElementList()].forEach(n=>{Ke(n,i=>{i.logicTemplateHidden=this.getLogicTemplateHiddenState(i,t)})})}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}setMode(t){if(this.mode===t)return;this.mode=t,this.options.mode=t;const e=new Map,n=r=>{r.forEach(s=>{s.controlId&&(s.controlComponent==="value"&&e.set(s.controlId,!0),s.checked&&e.set(s.controlId,!0))})};n(this.elementList),this.elementList.forEach(r=>{r.type==="table"&&r.trList?.forEach(s=>{s.tdList?.forEach(a=>{n(a.value)})})});const i=r=>{r.forEach(s=>{if(!(!s.control&&!s.controlId)&&(s.controlComponent==="value"&&s.strikeout&&(t===l.EditorMode.PRINT?s.hide=!0:s.hide=!1),!!s.control&&!(s.type!=="control"&&s.control.type!=="button"))){if(s.control.type==="TextField"&&(s.controlComponent==="placeholder"||s.controlComponent==="preTextFix"||s.controlComponent==="preTextFixText"||s.controlComponent==="postTextFix"||s.controlComponent==="postTextFixText"||s.controlComponent==="textFixLabel")&&(t===l.EditorMode.EDIT?s.hide=!1:s.hide=!0),s.control.type==="text"&&(s.controlComponent==="placeholder"||s.controlComponent==="prefix"||s.controlComponent==="postfix")&&(t===l.EditorMode.EDIT||t===l.EditorMode.FORM?s.hide=!1:s.hide=!0),s.control.type==="number"||s.control.type==="select"||s.control.type==="date"||s.control.type==="checkbox"||s.control.type==="radio"){if(s.controlComponent==="placeholder"||s.controlComponent==="prefix"||s.controlComponent==="postfix"){const c=e.get(s.controlId);s.control.type==="select"&&t===l.EditorMode.PRINT||t===l.EditorMode.PRINT&&!c?s.hide=!0:s.hide=!1}s.control.type==="number"&&s.controlComponent==="value"&&(t===l.EditorMode.PRINT&&s.strikeout?s.hide=!0:t!==l.EditorMode.PRINT&&s.strikeout&&(s.hide=!1))}s.control.type==="button"&&(s.hide=!1,s.control.hide=!1),s.control.type==="menstrualHistory"&&(s.controlComponent==="prefix"||s.controlComponent==="postfix")&&(t===l.EditorMode.PRINT?s.hide=!0:s.hide=!1)}})};i(this.elementList),this.elementList.forEach(r=>{r.type==="table"&&r.trList.forEach(s=>{s.tdList.forEach(a=>{i(a.value)})})}),t===l.EditorMode.FORM?(this.elementList.filter(r=>r.type==="control").map(r=>{r.control?.type==="button"&&r.control.buttonText&&(r.color="#1677FF",r.highlight="transparent")}),this.hideTextFieldWhitespace(this.elementList,!0),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):t===l.EditorMode.EDIT?(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!1,!0)),t===l.EditorMode.PRINT?(this.elementList.filter(r=>r?.control?.type==="button").map(r=>{(r?.controlComponent==="prefix"||r?.controlComponent==="postfix")&&(r.color="transparent",r.highlight="transparent"),r?.controlComponent==="value"&&!r.control.buttonText&&(r.color="transparent",r.highlight="transparent")}),this.setPrintData()):(this.clearPrintData(),this.elementList.filter(r=>r?.control?.type==="button").map(r=>{(r?.controlComponent==="prefix"||r?.controlComponent==="postfix")&&!r.control.buttonText&&r.type==="control"&&(r.color="transparent",r.highlight="#1677FF"),r?.controlComponent==="value"&&!r.control.buttonText&&(r.color="#fff",r.highlight="#1677FF"),r?.type==="text"&&r.control.buttonText&&(r.color="#000"),r?.type==="control"&&r?.controlComponent==="value"&&r.control.buttonText&&(r.color="#000",r.highlight="transparent")})),this.mode===l.EditorMode.PRINT&&this.clearPrintData(),this.clearSideEffect(),this.control.destroyControl(),this.range.clearRange(),this.render({isSetCursor:!1,isSubmitHistory:!1})}hideTextFieldWhitespace(t,e){const n=r=>r?/^[\s\u00A0\u2000-\u200B\u3000\n\r\t]+$/.test(r):!1;(r=>{for(let s=0;s<r.length;s++){const a=r[s];if(a.type===l.ElementType.TABLE&&a.trList)for(const c of a.trList)for(const d of c.tdList)this.hideTextFieldWhitespace(d.value,e);a.control?.type===l.ControlType.TEXTFIELD&&a.controlComponent===l.ControlComponent.VALUE&&n(a.value)&&(a.hide=e)}})(t)}updateTextFieldPlaceholderVisibility(t,e,n){const i=[l.ControlType.TEXT,l.ControlType.TEXTFIELD,l.ControlType.SELECT,l.ControlType.DATE,l.ControlType.CHECKBOX,l.ControlType.RADIO,l.ControlType.NUMBER];(s=>{let a=0;for(;a<s.length;){const c=s[a];if(c.type===l.ElementType.TABLE&&c.trList)for(const d of c.trList)for(const R of d.tdList)this.updateTextFieldPlaceholderVisibility(R.value,e,n);if(c.control?.type&&i.includes(c.control.type)&&(c.controlComponent===l.ControlComponent.PREFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===l.ControlComponent.PRE_TEXT)){const d=c.controlId,R=c.control.type;let u=!1,h=!1,g=!1;const f=[],T=[],m=[];let p=-1,I=a;for(;I<s.length;){const L=s[I];if(L.controlId!==d)break;if((L.controlComponent===l.ControlComponent.PREFIX||L.controlComponent===l.ControlComponent.PRETEXTFIX||L.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)&&T.push(I),L.controlComponent===l.ControlComponent.VALUE&&L.value&&L.value.trim()&&(u=!0),L.controlComponent===l.ControlComponent.VALUE&&(L.type===l.ElementType.MENSTRUAL_HISTORY||L.type===l.ElementType.FETAL_HEART_POSITION||L.type===l.ElementType.TOOTH_POSITION||L.type===l.ElementType.MACRO||L.type===l.ElementType.CUSTOM_MACRO)&&(u=!0),L.controlComponent===l.ControlComponent.VALUE&&L.control&&L.control.type!==R&&(h=!0),L.controlComponent===l.ControlComponent.PLACEHOLDER&&(g=!0,f.push(I)),L.controlComponent===l.ControlComponent.POSTFIX||L.controlComponent===l.ControlComponent.POSTTEXTFIX||L.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT){m.push(I),p=I;break}I++}if(!u&&!h)if(g&&f.length>0)for(const L of f)s[L].hide=!e;else e&&c.control?.placeholder&&(p>0?this.control.addPlaceholder(p-1):this.control.addPlaceholder(a));if(n)if(e&&u){for(const L of T)s[L].hide=!0;for(const L of m)s[L].hide=!0}else if(e){for(const L of T)s[L].hide=!1;for(const L of m)s[L].hide=!1}else{for(const L of T)s[L].hide=!0;for(const L of m)s[L].hide=!0}else{for(const L of T)s[L].hide=!1;for(const L of m)s[L].hide=!1}a=I}a++}})(t)}isReadonly(){if(this.area.getActiveAreaInfo()?.area?.mode)return this.area.isReadonly();switch(this.mode){case l.EditorMode.DESIGN:return!1;case l.EditorMode.READONLY:case l.EditorMode.PRINT:case l.EditorMode.GRAFFITI:return!0;case l.EditorMode.FORM:if(this.control.getIsRangeWithinControl()){const t=this.getElementList(),{startIndex:e}=this.range.getRange();if(t[e]?.control?.type===l.ControlType.TEXTFIELD)return!0}return!this.control.getIsRangeWithinControl();default:return!1}}isDisabled(){if(this.mode===l.EditorMode.DESIGN)return!1;const{startIndex:t,endIndex:e}=this.range.getRange(),n=this.getElementList();if(this.getTd()?.disabled)return!0;if(t===e){const r=n[t],s=n[t+1];return!!(r?.title?.disabled&&s?.title?.disabled&&r.titleId===s.titleId||r?.control?.disabled&&s?.control?.disabled&&r.controlId===s.controlId)}return n.slice(t+1,e+1).some(r=>r.title?.disabled||r.control?.disabled)}isDesignMode(){return this.mode===l.EditorMode.DESIGN}isPrintMode(){return this.mode===l.EditorMode.PRINT}isGraffitiMode(){return this.mode===l.EditorMode.GRAFFITI}getOriginalWidth(){const{paperDirection:t,width:e,height:n}=this.options;return t===l.PaperDirection.VERTICAL?e:n}getOriginalHeight(){const{paperDirection:t,width:e,height:n}=this.options;return t===l.PaperDirection.VERTICAL?n:e}getWidth(){return Math.floor(this.getOriginalWidth()*this.options.scale)}getHeight(){return Math.floor(this.getOriginalHeight()*this.options.scale)}getMainHeight(){return this.getHeight()-this.getMainOuterHeight()}getMainOuterHeight(){const t=this.getMargins(),e=this.header.getExtraHeight(),n=this.footer.getExtraHeight();return t[0]+t[2]+e+n}getCanvasWidth(t=-1){return this.getPage(t).width}getCanvasHeight(t=-1){return this.getPage(t).height}getInnerWidth(){const t=this.getWidth(),e=this.getMargins();return t-e[1]-e[3]}getOriginalInnerWidth(){const t=this.getOriginalWidth(),e=this.getOriginalMargins();return t-e[1]-e[3]}getContextInnerWidth(){const t=this.position.getPositionContext();if(t.isTable){const{index:e,trIndex:n,tdIndex:i}=t,s=this.getOriginalElementList()[e],a=s.trList[n].tdList[i],c=this.getTdPadding(s);return a.width-c[1]-c[3]}return this.getOriginalInnerWidth()}getMargins(){return this.getOriginalMargins().map(t=>t*this.options.scale)}getOriginalMargins(){const{margins:t,paperDirection:e}=this.options;return e===l.PaperDirection.VERTICAL?t:[t[1],t[2],t[3],t[0]]}getPageGap(){return this.options.pageGap*this.options.scale}getOriginalPageGap(){return this.options.pageGap}getPageNumberBottom(){const{pageNumber:{bottom:t},scale:e}=this.options;return t*e}getMarginIndicatorSize(){return this.options.marginIndicatorSize*this.options.scale}getDefaultBasicRowMarginHeight(){return this.options.defaultBasicRowMarginHeight*this.options.scale}getHighlightMarginHeight(){return this.options.highlightMarginHeight*this.options.scale}getTdPadding(t){const{table:{tdPadding:e},scale:n}=this.options;return(t?.tdPadding||e).map(r=>r*n)}getContainer(){return this.container}getPageContainer(){return this.pageContainer}getEventTarget(t){return t instanceof Element?t:t instanceof Node?t.parentElement:null}isTargetInsideEditor(t){const e=this.getEventTarget(t);return e?this.container.contains(e)?!0:!!Yi(e,n=>!!n&&n.nodeType===1&&!!n.getAttribute(Re)):!1}isTargetInsideExternalOverlay(t){const e=this.getEventTarget(t);return!e||this.isTargetInsideEditor(e)?!1:!!e.closest(ig)}pauseInteraction(){this.interactionPaused=!0,this.cursor?.getAgentDom().blur(),this.globalEvent?.resetSideEffect()}resumeInteraction(){this.interactionPaused=!1}setOverlayActive(t){this.overlayActiveCount=t?1:0,t&&(this.cursor?.getAgentDom().blur(),this.globalEvent?.resetSideEffect())}suspendGlobalShortcut(t){this.globalShortcutSuspended=t}isInteractionSuspended(){return this.interactionPaused||this.overlayActiveCount>0}isGlobalShortcutActive(){return!this.globalShortcutSuspended&&!this.isInteractionSuspended()}getVisiblePageNoList(){return this.visiblePageNoList}setVisiblePageNoList(t){this.visiblePageNoList=t,this.listener.visiblePageNoListChange&&this.listener.visiblePageNoListChange(this.visiblePageNoList),this.eventBus.isSubscribe("visiblePageNoListChange")&&this.eventBus.emit("visiblePageNoListChange",this.visiblePageNoList)}getIntersectionPageNo(){return this.intersectionPageNo}setIntersectionPageNo(t){this.intersectionPageNo=t,this.listener.intersectionPageNoChange&&this.listener.intersectionPageNoChange(this.intersectionPageNo),this.eventBus.isSubscribe("intersectionPageNoChange")&&this.eventBus.emit("intersectionPageNoChange",this.intersectionPageNo)}getPageNo(){return this.pageNo}setPageNo(t){this.pageNo=t}getRenderCount(){return this.renderCount}getPage(t=-1){return this.pageList[~t?t:this.pageNo]}getPageList(){return this.pageList}getPageCount(){return this.pageList.length}getTableRowList(t){const e=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:r}=e;return t[n].trList[i].tdList[r].rowList}getOriginalRowList(){const t=this.getZone();return t.isHeaderActive()?this.header.getRowList():t.isFooterActive()?this.footer.getRowList():this.rowList}getRowList(){return this.position.getPositionContext().isTable?this.getTableRowList(this.getOriginalElementList()):this.getOriginalRowList()}getPageRowList(){return this.pageRowList}getCtx(){return this.ctxList[this.pageNo]}getOptions(){return this.options}getSearch(){return this.search}getGroup(){return this.group}getArea(){return this.area}getBadge(){return this.badge}getHistoryManager(){return this.historyManager}getPosition(){return this.position}getZone(){return this.zone}getRange(){return this.range}getLineBreakParticle(){return this.lineBreakParticle}getTextParticle(){return this.textParticle}getHeaderElementList(){return this.header.getElementList()}getTableElementList(t){const e=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:r}=e;return t[n]?.trList?.[i].tdList[r].value||[]}getElementList(){const t=this.position.getPositionContext(),e=this.getOriginalElementList();return t.isTable?this.getTableElementList(e):e}getMainElementList(){return this.position.getPositionContext().isTable?this.getTableElementList(this.elementList):this.elementList}getOriginalElementList(){const t=this.getZone();return t.isHeaderActive()?this.getHeaderElementList():t.isFooterActive()?this.getFooterElementList():this.elementList}getOriginalMainElementList(){return this.elementList}getFooterElementList(){return this.footer.getElementList()}getTd(){const t=this.position.getPositionContext(),{index:e,trIndex:n,tdIndex:i,isTable:r}=t;return r?this.getOriginalElementList()[e].trList[n].tdList[i]:null}getTdByPosition(t){const{index:e,trIndex:n,tdIndex:i,isTable:r}=t;return r?this.getOriginalElementList()[e].trList[n].tdList[i]:null}insertElementTextField(t,e={}){if(!t.length||!this.range.getIsCanInput())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.getElementList(),{isSubmitHistory:s=!0}=e;bt(t,{isHandleFirstElement:!1,editorOptions:this.options});let a=-1,c=this.control.getActiveControl();if(!c&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),c=this.control.getActiveControl()),c&&this.control.getIsRangeWithinControl()){const d=n===i,R=n+1;d||this.newSpliceElementList(r,R,i-n),this.newSpliceElementList(r,R,0,t),a=n+t.length}else{const d=n===i,R=n+1;d||this.newSpliceElementList(r,R,i-n),this.newSpliceElementList(r,R,0,t),a=n+t.length;const u=r[R-1];t[0].listId&&u&&!u.listId&&u?.value===H&&(!u.type||u.type===l.ElementType.TEXTFIELD)&&(r.splice(n,1),a-=1)}this.control.destroyControl(),~a&&(this.range.setRange(a,a),this.render({curIndex:a,isSubmitHistory:s}))}insertElementList(t,e={}){if(!t.length||!this.range.getIsCanInput())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const{isSubmitHistory:r=!0}=e;bt(t,{isHandleFirstElement:!1,editorOptions:this.options});let s=-1,a=this.control.getActiveControl();if(!a&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),a=this.control.getActiveControl()),a&&this.control.getIsRangeWithinControl()){const c=this.getElementList(),d=n===i,R=n+1,u=c[n];if(u?.controlComponent===l.ControlComponent.PRE_TEXT||u?.controlComponent===l.ControlComponent.POST_TEXT||u?.controlComponent===l.ControlComponent.PREFIX||u?.controlComponent===l.ControlComponent.POSTFIX)for(let f=0;f<t.length;f++)t[f].control||(t[f].color=this.options.defaultColor);d&&(c[n]?.control?.type===l.ControlType.TEXTFIELD||c[n]?.control?.type===l.ControlType.TEXT)&&this.control.removePlaceholder(n),d||this.newSpliceElementList(c,R,i-n);const g=c[n]?.controlId||c[n-1]?.controlId||c[n+1]?.controlId;for(let f=0;f<t.length;f++){if(t[f]?.control?.type=="button"&&!t[f]?.control?.buttonText&&(t[f]?.controlComponent==="prefix"||t[f]?.controlComponent==="postfix"?(t[f].color="transparent",t[f].highlight="#1677FF"):(t[f].color="#fff",t[f].highlight="#1677FF")),t[f]?.type===l.ElementType.MENSTRUAL_HISTORY||t[f]?.type===l.ElementType.FETAL_HEART_POSITION||t[f]?.type===l.ElementType.TOOTH_POSITION||t[f]?.type===l.ElementType.MACRO||t[f]?.type===l.ElementType.CUSTOM_MACRO||t[f]?.type===l.ElementType.REUSABLE_ITEM||t[f]?.type===l.ElementType.SUB_TEMPLATE||t[f]?.type===l.ElementType.SPECIAL_SYMBOLS){t[f].controlComponent=l.ControlComponent.VALUE;let T=c[n]?.controlId;T||(T=c[n-1]?.controlId),T||(T=c[n+1]?.controlId),!t[f].controlId&&T&&(t[f].controlId=T)}g&&t[f]?.control&&t[f].controlId&&t[f].controlId!==g&&(t[f].originControlId=g)}this.newSpliceElementList(c,R,0,t),s=n+t.length}else{const c=this.getElementList(),d=n===i,R=n+1;if(c[R]?.control?.type=="TextField"||c[n]?.control?.type=="TextField"){d||this.newSpliceElementList(c,R,i-n);for(let u=0;u<t.length;u++)if(t[u]?.type===l.ElementType.MENSTRUAL_HISTORY||t[u]?.type===l.ElementType.FETAL_HEART_POSITION||t[u]?.type===l.ElementType.TOOTH_POSITION||t[u]?.type===l.ElementType.MACRO||t[u]?.type===l.ElementType.CUSTOM_MACRO||t[u]?.type===l.ElementType.REUSABLE_ITEM||t[u]?.type===l.ElementType.SUB_TEMPLATE||t[u]?.type===l.ElementType.SPECIAL_SYMBOLS){t[u].controlComponent=l.ControlComponent.VALUE;const h=c[n]?.controlId||c[R]?.controlId;!t[u].controlId&&h&&(t[u].controlId=h)}this.newSpliceElementList(c,R,0,t),s=n+t.length}else{d||this.spliceElementList(c,R,i-n);for(let h=0;h<t.length;h++)t[h]?.control?.type=="button"&&!t[h]?.control?.buttonText&&(t[h]?.controlComponent==="prefix"||t[h]?.controlComponent==="postfix"?(t[h].color="transparent",t[h].highlight="#1677FF"):(t[h].color="#fff",t[h].highlight="#1677FF"));this.spliceElementList(c,R,0,t),s=n+t.length;const u=c[R-1];t[0].listId&&u&&!u.listId&&u?.value===H&&(!u.type||u.type===l.ElementType.TEXT)&&(c.splice(n,1),s-=1)}}~s&&(this.range.setRange(s,s),this.render({curIndex:s,isSubmitHistory:r}))}appendElementList(t,e={}){if(!t.length)return;bt(t,{isHandleFirstElement:!1,editorOptions:this.options});let n;const{isPrepend:i,isSubmitHistory:r=!0}=e;i?(this.elementList.splice(1,0,...t),n=t.length):(this.elementList.push(...t),n=this.elementList.length-1),this.range.setRange(n,n),this.render({curIndex:n,isSubmitHistory:r})}spliceElementList(t,e,n,i,r){const{isIgnoreDeletedRule:s=!1}=r||{},{group:a,modeRule:c}=this.options;if(n>0){const d=e+n,u=t[d]?.listId;if(u&&t[e-1]?.listId!==u){let h=d;for(;h<t.length;){const g=t[h];if(g.listId!==u||g.value===H)break;delete g.listId,delete g.listType,delete g.listStyle,h++}}if(!s&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const h=this.getTd()?.deletable;let g=d-1;for(;g>=e;){const f=t[g];(f?.hide||f?.control?.hide||f?.area?.hide||h!==!1&&f?.control?.deletable!==!1&&(!f.controlId||this.mode!==l.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&f?.title?.deletable!==!1&&(a.deletable!==!1||!f.groupIds?.length)&&(f?.area?.deletable!==!1||f?.areaIndex!==0))&&t.splice(g,1),g--}}else t.splice(e,n)}if(i?.length){let d=t[e];for(let R=0;R<i.length;R++)!i[R].controlComponent&&d?.controlComponent&&(i[R].controlId=d.controlId,i[R].control=d.control,i[R].controlComponent=d.controlComponent),d=i[R];Fr(t,e,i)}}newSpliceElementList(t,e,n,i,r){const{isIgnoreDeletedRule:s=!1}=r||{},{group:a,modeRule:c}=this.options;if(n>0){const R=e+n,h=t[R]?.listId;if(h&&t[e-1]?.listId!==h){let g=R;for(;g<t.length;){const f=t[g];if(f.listId!==h||f.value===H)break;delete f.listId,delete f.listType,delete f.listStyle,g++}}if(!s&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const g=this.getTd()?.deletable;let f=R-1;for(;f>=e;){const T=t[f];(T?.hide||T?.control?.hide||T?.area?.hide||g!==!1&&T?.control?.deletable!==!1&&(!T.controlId||this.mode!==l.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&T?.title?.deletable!==!1&&(a.deletable!==!1||!T.groupIds?.length)&&(T?.area?.deletable!==!1||T?.areaIndex!==0))&&t.splice(f,1),f--}}else t.splice(e,n)}const d=t[e]?.controlId;if(i?.length){for(let R=0;R<i.length;R++)d&&(i[R].originControlId=d);Fr(t,e,i)}}getCanvasEvent(){return this.canvasEvent}getGlobalEvent(){return this.globalEvent}getListener(){return this.listener}getEventBus(){return this.eventBus}getOverride(){return this.override}getCursor(){return this.cursor}getPreviewer(){return this.previewer}getImageParticle(){return this.imageParticle}getTableTool(){return this.tableTool}getTableOperate(){return this.tableOperate}getTableParticle(){return this.tableParticle}getHeader(){return this.header}getFooter(){return this.footer}getHyperlinkParticle(){return this.hyperlinkParticle}getMacroParticle(){return this.macroParticle}getDateParticle(){return this.dateParticle}getListParticle(){return this.listParticle}getCheckboxParticle(){return this.checkboxParticle}getRadioParticle(){return this.radioParticle}getMenstrualHistoryParticle(){return this.menstrualHistoryParticle}getFetalHeartPositionParticle(){return this.fetalHeartPositionParticle}getToothPositionParticle(){return this.toothPositionParticle}getControl(){return this.control}getWorkerManager(){return this.workerManager}getImageObserver(){return this.imageObserver}getI18n(){return this.i18n}getGraffiti(){return this.graffiti}setCommand(t){this.command=t}getCommand(){return this.command}getRowCount(){return this.getRowList().length}async getDataURL(t={}){const{pixelRatio:e,mode:n}=t;e&&this.setPagePixelRatio(e);const i=this.mode,r=!!n&&i!==n;r&&this.setMode(n),this.render({isLazy:!1,isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),await this.imageObserver.allSettled();const s=this.pageList.map(a=>a.toDataURL());return e&&this.setPagePixelRatio(null),r&&this.setMode(i),s}getPainterStyle(){return this.painterStyle&&Object.keys(this.painterStyle).length?this.painterStyle:null}getPainterOptions(){return this.painterOptions}setPainterStyle(t,e){this.painterStyle=t,this.painterOptions=e||null,this.getPainterStyle()&&this.pageList.forEach(n=>n.style.cursor="copy")}setDefaultRange(){this.elementList.length&&setTimeout(()=>{const t=this.elementList.length-1;this.range.setRange(t,t),this.range.setRangeStyle()})}getIsPagingMode(){return this.options.pageMode===l.PageMode.PAGING}setPageMode(t){if(!t||this.options.pageMode===t)return;if(this.options.pageMode=t,t===l.PageMode.PAGING){const{height:i}=this.options,r=this.getPagePixelRatio(),s=this.pageList[0];s.style.height=`${i}px`,s.height=i*r,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(l.EditorZone.MAIN);const{startIndex:e}=this.range.getRange(),n=this.range.getIsCollapsed();this.render({isSetCursor:!0,curIndex:e,isSubmitHistory:!1}),n||this.cursor.drawCursor({isShow:!1}),setTimeout(()=>{this.listener.pageModeChange&&this.listener.pageModeChange(t),this.eventBus.isSubscribe("pageModeChange")&&this.eventBus.emit("pageModeChange",t)})}setPageScale(t){const e=this.getPagePixelRatio();this.options.scale=t;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((s,a)=>{s.width=n*e,s.height=i*e,s.style.width=`${n}px`,s.style.height=`${i}px`,s.style.marginBottom=`${this.getPageGap()}px`,this._initPageContext(this.ctxList[a])});const r=this.position.getCursorPosition();this.render({isSubmitHistory:!1,isSetCursor:!!r,curIndex:r?.index}),this.listener.pageScaleChange&&this.listener.pageScaleChange(t),this.eventBus.isSubscribe("pageScaleChange")&&this.eventBus.emit("pageScaleChange",t)}getPagePixelRatio(){return this.pagePixelRatio||window.devicePixelRatio}setPagePixelRatio(t){!this.pagePixelRatio&&t===window.devicePixelRatio||t===this.pagePixelRatio||(this.pagePixelRatio=t,this.setPageDevicePixel())}setPageDevicePixel(){const t=this.getPagePixelRatio(),e=this.getWidth(),n=this.getHeight();this.pageList.forEach((i,r)=>{i.width=e*t,i.height=n*t,this._initPageContext(this.ctxList[r])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperSize(t,e){this.options.width=t,this.options.height=e;const n=this.getPagePixelRatio(),i=this.getWidth(),r=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((s,a)=>{s.width=i*n,s.height=r*n,s.style.width=`${i}px`,s.style.height=`${r}px`,this._initPageContext(this.ctxList[a])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperDirection(t){const e=this.getPagePixelRatio();this.options.paperDirection=t;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((r,s)=>{r.width=n*e,r.height=i*e,r.style.width=`${n}px`,r.style.height=`${i}px`,this._initPageContext(this.ctxList[s])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperMargin(t){this.options.margins=t,this.render({isSubmitHistory:!1,isSetCursor:!1})}getOriginValue(t={}){const{pageNo:e}=t;let n=this.elementList;return Number.isInteger(e)&&e>=0&&e<this.pageRowList.length&&(n=this.pageRowList[e].flatMap(r=>r.elementList)),{header:this.getHeaderElementList(),main:n,footer:this.getFooterElementList(),graffiti:this.graffiti.getValue()}}getValue(t={}){const e=this.getOriginValue(t);console.log(this.elementList,"所有元素");const{extraPickAttrs:n}=t,i={header:Pt(e.header,{extraPickAttrs:n,editorOptions:this.options}),main:Pt(e.main,{extraPickAttrs:n,isClassifyArea:!0,editorOptions:this.options}),footer:Pt(e.footer,{extraPickAttrs:n,editorOptions:this.options}),graffiti:e.graffiti};return{version:He,data:i,options:at(this.options)}}setValue(t,e){const{header:n,main:i,footer:r}=at(t);if(!n&&!i&&!r)return;const{isSetCursor:s=!1}=e||{};[n,i,r].forEach(d=>{d&&bt(d,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:n,main:i,footer:r}),this.historyManager.recovery();const c=s?i?.length?i.length-1:0:void 0;c!==void 0&&this.range.setRange(c,c),this.render({curIndex:c,isSetCursor:s,isFirstRender:!0})}setEditorData(t){const{header:e,main:n,footer:i}=t;e&&this.header.setElementList(e),n&&(this.elementList=n),i&&this.footer.setElementList(i)}_wrapContainer(t){const e=document.createElement("div");return t.append(e),e}_formatContainer(){this.container.style.position="relative",this.container.style.width=`${this.getWidth()}px`,this.container.setAttribute(Re,l.EditorComponent.MAIN)}_createPageContainer(){const t=document.createElement("div");return t.classList.add(`${z}-page-container`),this.container.append(t),t}_createPage(t){const e=this.getWidth(),n=this.getHeight(),i=document.createElement("canvas");i.style.width=`${e}px`,i.style.height=`${n}px`,i.style.display="block",i.style.backgroundColor="#ffffff",i.style.marginBottom=`${this.getPageGap()}px`,i.setAttribute("data-index",String(t)),this.pageContainer.append(i);const r=this.getPagePixelRatio();i.width=e*r,i.height=n*r,i.style.cursor="text";const s=i.getContext("2d");this._initPageContext(s),this.pageList.push(i),this.ctxList.push(s)}_initPageContext(t){const e=this.getPagePixelRatio();t.scale(e,e),t.letterSpacing="0px",t.wordSpacing="0px",t.direction="ltr"}getElementFont(t,e=1){const{defaultSize:n,defaultFont:i}=this.options,r=t.font||i,s=t.actualSize||t.size||n;return`${t.italic?"italic ":""}${t.bold?"bold ":""}${s*e}px ${r}`}getElementSize(t){return t.actualSize||t.size||this.options.defaultSize}getElementRowMargin(t){const{defaultSize:e,defaultBasicRowMarginHeight:n,defaultRowMargin:i,scale:r}=this.options,s=t.size||e;let a=1;return s<12?a=s/12:s>30&&(a=1+(s-30)/30),n*a*(t.rowMargin??i)*r}computeRowList(t){const{innerWidth:e,elementList:n,isPagingMode:i=!1,isFromTable:r=!1,startX:s=0,startY:a=0,pageHeight:c=0,mainOuterHeight:d=0,surroundElementList:R=[]}=t,{defaultSize:u,scale:h,imgCaption:g,table:{tdPadding:f,defaultTrMinHeight:T},defaultTabWidth:m}=this.options,p=this.getDefaultBasicRowMarginHeight(),L=document.createElement("canvas").getContext("2d"),P=this.listParticle.computeListStyle(L,n),O=[],S=this._collectTextControlValueSet(n);n.length&&O.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:n?.[0]?.rowFlex||n?.[1]?.rowFlex});let F=s,N=a,V=0,Y,X=0,W=0;for(let E=0;E<n.length;E++){const C=O[O.length-1],M=n[E];this.clearElementEffect(M);const y=this.getElementRowMargin(M),b={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},D=C.offsetX||M.listId&&P.get(M.listId)||0,U=e-D,Q=C.elementList.length===1;if(F+=Q?D:0,N+=Q&&C.offsetY||0,(M.control?.type===l.ControlType.TEXTFIELD||M.control?.type===l.ControlType.TEXT)&&!this.isDesignMode()&&(M.controlComponent===l.ControlComponent.PRETEXTFIX||M.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||M.controlComponent===l.ControlComponent.POSTTEXTFIX||M.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||M.controlComponent===l.ControlComponent.TEXTFIXLABEL||M.controlComponent===l.ControlComponent.PLACEHOLDER||M.controlComponent===l.ControlComponent.PREFIX||M.controlComponent===l.ControlComponent.POSTFIX)){const v=M.control?.type===l.ControlType.TEXTFIELD,K=M.controlId,w=!!K&&!!S?.has(K);v?this.mode===l.EditorMode.EDIT?M.hide=!1:M.hide=!0:this.mode===l.EditorMode.EDIT?M.hide=!1:this.mode===l.EditorMode.FORM?M.controlComponent===l.ControlComponent.PLACEHOLDER||M.controlComponent===l.ControlComponent.TEXTFIXLABEL?M.hide=w:M.hide=!1:M.hide=!0}if(se(M)&&!this.isDesignMode()){if(!M.logicTemplateHidden){const v=C.elementList[C.elementList.length-1];b.height=v?.metrics.height||this.options.defaultSize*h,b.boundingBoxAscent=v?.metrics.boundingBoxAscent||0,b.boundingBoxDescent=v?.metrics.boundingBoxDescent||0}}else if(M.type===l.ElementType.IMAGE||M.type===l.ElementType.LATEX)if(M.imgDisplay===l.ImageDisplay.SURROUND||M.imgDisplay===l.ImageDisplay.FLOAT_TOP||M.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)b.width=0,b.height=0,b.boundingBoxDescent=0;else{const v=M.width*h,K=M.height*h;if(v>U){const w=K*U/v;M.width=U/h,M.height=w/h,b.width=U,b.height=w,b.boundingBoxDescent=w}else b.width=v,b.height=K,b.boundingBoxDescent=K;if(M.imgCaption?.value){const w=M.imgCaption.size||g.size,Z=M.imgCaption.top??g.top,J=(w+Z)*h;b.boundingBoxAscent+=J}}else if(M.type===l.ElementType.TABLE){const v=M.tdPadding||f;if(M.pagingId){let x=E+1,A=0;for(;x<n.length;){const $=n[x];if($.pagingId===M.pagingId){const B=$.trList.filter(Ct=>!Ct.pagingRepeat).filter(Ct=>(Ct.tdList=Ct.tdList.filter(Xt=>{if(Xt.originalId){for(let pt=0;pt<M.trList.length;pt++){const yt=M.trList[pt],Yt=yt.tdList.find(({id:St})=>St===Xt.originalId);if(Yt){Xt.value[0]?.type===l.ElementType.SPLIT_TAG&&Xt.value.splice(0,1),Yt.value.push(...Xt.value.map(St=>this.updateElementTableInfo(St,M,yt,Yt))),Yt.rowspan=Yt.originalRowspan??Yt.rowspan;break}}return!1}return!0}),!Ct.originalId));M.trList.push(...B),M.height+=$.height,x++,A++}else break}A&&n.splice(E+1,A)}M.pagingIndex=M.pagingIndex??0,this.tableParticle.computeTrHeight(M,x=>this.computeRowList({innerWidth:(x.width-(v[1]+v[3]))*h,elementList:x.value,isFromTable:!0,isPagingMode:i})),M.trList?.forEach(x=>{x.tdList.forEach(A=>{this.tdMap.set(A.id,A)})});const K=this.tableParticle.getTableHeight(M),w=this.tableParticle.getTableWidth(M);M.width=w,M.height=K;const Z=w*h,J=K*h;if(b.width=Z,b.height=J,b.boundingBoxDescent=J,b.boundingBoxAscent=-y,n[E+1]?.type===l.ElementType.TABLE&&(b.boundingBoxAscent-=y),i){const x=this.getHeight(),A=this.getMainOuterHeight();let $=A;for(let pt=0;pt<O.length;pt++){const yt=O[pt],Yt=yt.offsetY||0;yt.height+$+Yt>x||O[pt-1]?.isPageBreak?$=A+yt.height+Yt:$+=yt.height+Yt}const B=y*2,Ct=M.trList[0].height*h;($+Ct+B>x||M.pagingIndex!==0&&M.trList[0].pagingRepeat||n[E-1]?.type===l.ElementType.PAGE_BREAK)&&($=A);let Xt=x-($+B);if(J>Xt){const pt=M.trList;let yt=0,Yt=0,St=0;for(let Tt=0;Tt<pt.length;Tt++){const It=pt[Tt],Kt=It.height*h;if($+B+St+Kt>x){const Qt=It;let Ve=0;const jt={...at(Qt),id:lt(),originalId:Qt.originalId??Qt.id,minHeight:void 0,tdList:M.colgroup.map((mt,oe)=>{if(Ve--,Ve>0)return;const Ht=Qt.tdList.find(Ye=>Ye.colIndex===oe),Jt=Ht??this.tableParticle.findPreRowSpanTd(pt,Tt,oe);Ht&&(Ve=Ht.colspan);const ze=lt();return Jt.originalRowspan=Jt.rowspan,Ht?{...Ht,id:ze,originalId:Ht.originalId??Ht.id,linkTdPrevId:Ht.id,tdIndex:oe,original:Jt}:{id:ze,originalId:Jt.originalId??Jt.id,linkTdPrevId:Jt.id,tdIndex:oe,colIndex:oe,colspan:1,rowspan:1,value:[],rowList:[],original:Jt}}).filter(mt=>!!mt)},de=jt.tdList,_t=de.map(mt=>mt.original);_t.forEach((mt,oe)=>{const Ht=[];let Jt=Xt;if(mt.rowspan>1){const Ye=pt.slice(mt.trIndex,mt.trIndex+Tt-mt.trIndex);Jt+=Ye.reduce((Mf,Of)=>Of.height*h+Mf,0)}for(;mt.mainHeight*h>Jt&&mt.rowList?.length;){const Ye=mt.rowList.pop();mt.value.splice(mt.value.length-Ye.elementList.length),Ht.unshift(Ye),mt.mainHeight-=Ye.height}const ze=de[oe];ze.rowList=Ht,ze.value=Ht.map(Ye=>Ye.elementList).flat()});let Me=!0;const Fi=Qt.tdList.some(mt=>mt.rowList?.length),Dr=jt.tdList.some(mt=>mt.rowList?.length),yi=Qt.minHeight>Xt;if(Dr||yi){(Fi||!Dr&&yi)&&(yi&&(Qt.originalMinHeight=Qt.minHeight,Qt.minHeight=Xt,jt.minHeight=Math.max(Qt.originalMinHeight-Xt,T)),jt.tdList.forEach(mt=>{mt.original.linkTdNextId=mt.id,mt.value.length&&mt.value[0].value!==H&&mt.value.unshift({...mt.original.value.slice(-1).pop(),value:H,type:l.ElementType.SPLIT_TAG})}),pt.splice(yt+1,0,jt),yt+=1,Yt=pt.length-yt,Me=!1),_t.forEach(mt=>{if(mt.rowspan>1){const oe=mt.rowspan-(Tt-mt.trIndex);mt.rowspan=Tt-mt.trIndex+(Fi?1:0);const Ht=jt.tdList.find(Jt=>Jt.colIndex===mt.colIndex);Fi?Ht.rowspan=oe:(Ht.original.linkTdNextId=Ht.id,Qt.tdList.push({...mt,...Ht,rowspan:oe}),Qt.tdList.sort((Jt,ze)=>Jt.colIndex-ze.colIndex),Ht.value=[])}}),Me&&_t.forEach((mt,oe)=>{mt.value.push(...de[oe].value)});break}}yt=Tt+1,Yt=pt.length-yt,St+=Kt,Xt-=Kt}if(Yt){const Tt=pt.splice(yt,Yt),It=M.pagingId||lt();M.pagingId=It;const Kt=at(M);Kt.originalId=M.originalId??M.id,Kt.pagingId=It,Kt.pagingIndex=M.pagingIndex+1;const Qt=pt.filter(de=>de.pagingRepeat);if(Qt.length){const de=at(Qt);de.forEach(_t=>_t.id=lt()),Tt.unshift(...de)}Kt.trList=Tt,Kt.id=lt(),Kt.trList?.forEach(de=>{de.tdList.forEach(_t=>{if(delete _t.valueStartIndex,_t.linkTdPrevId){const Me=this.getTdById(_t.linkTdPrevId);_t.valueStartIndex=Me?(Me.valueStartIndex??0)+Me.value.length:0,this.splitTdValueMap.has(_t.originalId)?this.splitTdValueMap.get(_t.originalId).push(..._t.value):Me&&this.splitTdValueMap.set(_t.originalId,[...Me.value,..._t.value])}_t.value.forEach(Me=>this.updateElementTableInfo(Me,Kt,de,_t))})}),this.spliceElementList(n,E+1,0,[Kt]),this.tableParticle.computeTrHeight(M);const Ve=this.tableParticle.getTableHeight(M),jt=Ve*h;M.height=Ve,b.height=jt,b.boundingBoxDescent=jt}}if(M.pagingId){const pt=this.position.getPositionContext();if(pt.isTable){let yt=-1,Yt=-1,St=E;for(;St<n.length;){const Tt=n[St];if(Tt.pagingId!==M.pagingId)break;const It=Tt.trList.findIndex(Kt=>Kt.id===pt.trId);if(~It){yt=St,Yt=It;break}St++}~yt&&(pt.index=yt,pt.trIndex=Yt,this.position.setPositionContext(pt))}}}this.initTableElementIndex(M,E)}else if(M.type===l.ElementType.SEPARATOR){const{separator:{lineWidth:v}}=this.options,K=M.lineWidth||v;M.width=U/h,b.width=U,b.height=K*h,b.boundingBoxAscent=-y,b.boundingBoxDescent=-y+b.height}else if(M.type===l.ElementType.PAGE_BREAK)M.width=U/h,b.width=U,b.height=u;else if(M.type===l.ElementType.RADIO||M.controlComponent===l.ControlComponent.RADIO){const{width:v,height:K,gap:w}=this.options.radio,Z=v+w*2;M.width=Z,b.width=Z*h,b.height=K*h}else if(M.type===l.ElementType.CHECKBOX||M.controlComponent===l.ControlComponent.CHECKBOX){const{width:v,height:K,gap:w}=this.options.checkbox,Z=v+w*2;M.width=Z,b.width=Z*h,b.height=K*h}else if(M.type===l.ElementType.MENSTRUAL_HISTORY){const v=this.menstrualHistoryParticle.computeSize(M);M.width=v.width/h,b.width=v.width,b.height=v.height,b.boundingBoxAscent=v.height,b.boundingBoxDescent=0}else if(M.type===l.ElementType.FETAL_HEART_POSITION){const v=this.fetalHeartPositionParticle.computeSize(M);M.width=v.width/h,b.width=v.width,b.height=v.height,b.boundingBoxAscent=v.height/2,b.boundingBoxDescent=v.height/2}else if(M.type===l.ElementType.TOOTH_POSITION){const v=this.toothPositionParticle.computeSize(M);M.width=v.width/h,b.width=v.width,b.height=v.height,b.boundingBoxAscent=v.height/2,b.boundingBoxDescent=v.height/2}else if(M.type===l.ElementType.TAB)b.width=m*h,b.height=u*h,b.boundingBoxDescent=0,b.boundingBoxAscent=this.textParticle.getBasisWordBoundingBoxAscent(L,L.font);else if(M.type===l.ElementType.BLOCK){if(!M.width)b.width=U;else{const v=M.width*h;b.width=Math.min(v,U)}b.height=M.height*h,b.boundingBoxDescent=b.height,b.boundingBoxAscent=0}else if(M.type===l.ElementType.LABEL){const{defaultSize:v,label:{defaultPadding:K}}=this.options;L.font=this.getElementFont(M);const w=this.textParticle.measureText(L,M);b.width=(w.width+K[1]+K[3])*h,b.height=(M.size||v)*h,b.boundingBoxDescent=0,b.boundingBoxAscent=(K[0]+w.actualBoundingBoxAscent)*h}else if(M.type===l.ElementType.MACRO||M.type===l.ElementType.CUSTOM_MACRO||M.type===l.ElementType.REUSABLE_ITEM||M.type===l.ElementType.SUB_TEMPLATE){const{defaultSize:v}=this.options;L.font=this.getElementFont(M);const K=this.getMode(),w=K==="edit",Z=K==="form";if(w){const J=M.label||M.value||"";L.font=this.getElementFont(M);const x=L.measureText(J),A=8*h,$=4*h;b.width=x.width+A*2;const B=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;b.height=B+$*2;const Ct=this.textParticle.measureBasisWord(L,this.getElementFont(M));b.boundingBoxAscent=Ct.actualBoundingBoxAscent*h,b.boundingBoxDescent=Ct.actualBoundingBoxDescent*h}else if(M.type===l.ElementType.CUSTOM_MACRO){const J=M.macroConfig,x=J?.value||"";if(Z){const A=J?.type||"text",$=this.textParticle.measureText(L,M),B=M.label||"";if(A==="select"){const Ct=x||`请选择${B}`,Xt=L.measureText(Ct),pt=L.measureText("[").width,yt=6*h+2*h;b.width=pt+Xt.width+yt+pt}else{const Ct=x||`请输入${B}`,Xt=L.measureText(Ct),pt=L.measureText("[").width;b.width=pt+Xt.width+pt}b.height=(M.size||v)*h,b.boundingBoxDescent=$.actualBoundingBoxDescent*h,b.boundingBoxAscent=$.actualBoundingBoxAscent*h}else{const A=M.label||"",$=x||`请输入${A}`,B=L.measureText($);b.width=B.width,b.height=(M.size||v)*h,b.boundingBoxDescent=B.actualBoundingBoxDescent,b.boundingBoxAscent=B.actualBoundingBoxAscent}}else if(M.type===l.ElementType.REUSABLE_ITEM){const x=M.reusableItemConfig?.value||"",A=M.label||"";if(Z){const $=this.textParticle.measureText(L,M),B=x||`获取 ${A}`,Ct=L.measureText(B),Xt=L.measureText("[").width;b.width=Xt+Ct.width+Xt,b.height=(M.size||v)*h,b.boundingBoxDescent=$.actualBoundingBoxDescent*h,b.boundingBoxAscent=$.actualBoundingBoxAscent*h}else{const $=x||`获取 ${A}`,B=L.measureText($);b.width=B.width,b.height=(M.size||v)*h,b.boundingBoxDescent=B.actualBoundingBoxDescent,b.boundingBoxAscent=B.actualBoundingBoxAscent}}else if(M.type===l.ElementType.SUB_TEMPLATE){const J=M.label||"子模板";if(Z){const x=this.textParticle.measureText(L,M),A=L.measureText(J),$=8*h;b.width=A.width+$*2,b.height=(M.size||v)*h,b.boundingBoxDescent=x.actualBoundingBoxDescent*h,b.boundingBoxAscent=x.actualBoundingBoxAscent*h}else{const x=L.measureText(J);b.width=x.width,b.height=(M.size||v)*h,b.boundingBoxDescent=x.actualBoundingBoxDescent,b.boundingBoxAscent=x.actualBoundingBoxAscent}}else{const J=M.label||"",x=M.value||`获取 ${J}`,A=L.measureText(x);b.width=A.width,b.height=(M.size||v)*h,b.boundingBoxDescent=A.actualBoundingBoxDescent,b.boundingBoxAscent=A.actualBoundingBoxAscent}}else{const v=M.size||u;(M.type===l.ElementType.SUPERSCRIPT||M.type===l.ElementType.SUBSCRIPT)&&(M.actualSize=Math.ceil(v*.6)),b.height=(M.actualSize||v)*h,L.font=this.getElementFont(M);const K=this.textParticle.measureText(L,M);b.width=K.width*h,M.letterSpacing&&(b.width+=M.letterSpacing*h);const w=this.textParticle.measureBasisWord(L,M.font);b.boundingBoxAscent=w.actualBoundingBoxAscent*h,b.boundingBoxDescent=w.actualBoundingBoxDescent*h,M.type===l.ElementType.SUPERSCRIPT?b.boundingBoxAscent+=b.height/2:M.type===l.ElementType.SUBSCRIPT&&(b.boundingBoxDescent+=b.height/2)}const G=!se(M)&&(M.imgDisplay!==l.ImageDisplay.INLINE&&M.type===l.ElementType.IMAGE||M.type===l.ElementType.LATEX)?b.height+y:b.boundingBoxAscent+y,_=y+b.boundingBoxAscent+b.boundingBoxDescent+y,j=Object.assign(M,{metrics:b,left:0,style:this.getElementFont(M,h)});j.control?.minWidth&&(j.controlComponent&&(W+=b.width),j.controlComponent===l.ControlComponent.POSTFIX&&(this.control.setMinWidthControlInfo({row:C,rowElement:j,availableWidth:U,controlRealWidth:W}),W=0));const st=n[E-1];let it=n[E+1],nt=C.width+b.width;if(this.options.wordBreak===l.WordBreak.BREAK_WORD&&(!st?.type||st?.type===l.ElementType.TEXT)&&(!M.type||M.type===l.ElementType.TEXT)){const v=`${st?.value||""}${M.value}`;if(this.WORD_LIKE_REG.test(v)){const{width:w,endElement:Z}=this.textParticle.measureWord(L,n,E),J=w*h;Z&&J<=U?(nt+=J,it=Z):st&&(nt+=J)}const K=this.textParticle.measurePunctuationWidth(L,it);nt+=K*h}M.listId&&(M.listId!==Y?X=0:M.value===H&&!M.listWrap&&X++),Y=M.listId;const et=this.position.setSurroundPosition({pageNo:V,rowElement:j,row:C,rowElementRect:{x:F,y:N,height:_,width:b.width},availableWidth:U,surroundElementList:R});F=et.x,nt+=et.rowIncreaseWidth,F+=b.width;let dt=!1;if(this.mode===l.EditorMode.FORM&&M.control?.type===l.ControlType.BUTTON&&M.controlComponent===l.ControlComponent.PREFIX&&C.elementList.filter(v=>v.controlId!==M.controlId).length>0){const v=M.controlId;if(n.some(w=>w.controlId===`${v}_text`&&w.control?.type===l.ControlType.BUTTON)){let w=0;for(let Z=E;Z<n.length;Z++){const J=n[Z];if(J.controlId!==v)break;L.font=this.getElementFont(J);const x=this.textParticle.measureText(L,J);if(w+=x.width*h,J.controlComponent===l.ControlComponent.POSTFIX)break}for(let Z=0;Z<n.length;Z++){const J=n[Z];if(J.controlId===`${v}_text`){L.font=this.getElementFont(J);const x=this.textParticle.measureText(L,J);w+=x.width*h}}dt=C.width+w>U}}const tt=!se(M)&&(M.type===l.ElementType.SEPARATOR||M.type===l.ElementType.TABLE||!se(st)&&st?.type===l.ElementType.TABLE||!se(st)&&st?.type===l.ElementType.BLOCK||M.type===l.ElementType.BLOCK||!se(st)&&st?.imgDisplay===l.ImageDisplay.INLINE||M.imgDisplay===l.ImageDisplay.INLINE||st?.listId!==M.listId||st?.areaId!==M.areaId&&!M.area?.hide||M.control?.flexDirection===l.FlexDirection.COLUMN&&(M.controlComponent===l.ControlComponent.CHECKBOX||M.controlComponent===l.ControlComponent.RADIO)&&st?.controlComponent===l.ControlComponent.VALUE||E!==0&&M.value===H&&!M.area?.hide||dt),ht=nt>U,ut=tt||ht;if(ut){const v={width:b.width,height:_,startIndex:E,elementList:[j],ascent:G,rowIndex:C.rowIndex+1,rowFlex:n[E]?.rowFlex||n[E+1]?.rowFlex,isPageBreak:M.type===l.ElementType.PAGE_BREAK};if(j.controlComponent!==l.ControlComponent.PREFIX&&j.control?.indentation===l.ControlIndentation.VALUE_START){const K=C.elementList.findIndex(w=>w.controlId===j.controlId&&w.controlComponent!==l.ControlComponent.PREFIX);if(~K){const Z=this.position.computeRowPosition({row:C,innerWidth:this.getInnerWidth()})[K];Z&&(v.offsetX=Z.coordinate.leftTop[0])}}M.listId&&(v.isList=!0,v.offsetX=P.get(M.listId),v.listIndex=X),v.offsetY=!r&&M.area?.top&&M.areaId!==n[E-1]?.areaId?M.area.top*h:0,O.push(v)}else C.width+=b.width,E===0&&(rn(n[1])||n[1]?.areaId)?(C.height=p,C.ascent=p):C.height<_&&(C.height=_,C.ascent=G),C.elementList.push(j);if((ut||E===n.length-1)&&(C.isWidthNotEnough=ht&&!tt,!C.isSurround&&(st?.rowFlex===l.RowFlex.JUSTIFY||st?.rowFlex===l.RowFlex.ALIGNMENT&&C.isWidthNotEnough))){const v=C.elementList[0]?.value===H?C.elementList.slice(1):C.elementList,K=(U-C.width)/(v.length-1);for(let w=0;w<v.length-1;w++){const Z=v[w];Z.metrics.width+=K}C.width=U}if(ut){F=s,N+=C.height,i&&!r&&c&&(N-a+d+_>c||M.type===l.ElementType.PAGE_BREAK)&&(N=a,ea(R,V),V+=1),j.left=0;const v=O[O.length-1];F=this.position.setSurroundPosition({pageNo:V,rowElement:j,row:v,rowElementRect:{x:F,y:N,height:_,width:b.width},availableWidth:U,surroundElementList:R}).x,F+=b.width}}return O}_collectTextControlValueSet(t){if(this.isDesignMode()||this.mode===l.EditorMode.EDIT)return null;const e=new Set;for(let i=0;i<t.length;i++){const r=t[i];r.controlId&&(r.control?.type===l.ControlType.TEXT||r.control?.type===l.ControlType.TEXTFIELD)&&e.add(r.controlId)}const n=new Set;for(let i=0;i<t.length;i++){const r=t[i];r.controlId&&r.controlComponent===l.ControlComponent.VALUE&&e.has(r.controlId)&&n.add(r.controlId)}return n}_computePageList(){const t=[[]],{pageMode:e,pageNumber:{maxPageNo:n}}=this.options,i=this.getHeight(),r=this.getMainOuterHeight();let s=r,a=0;if(e===l.PageMode.CONTINUITY){t[0]=this.rowList,s+=this.rowList.reduce((u,h)=>u+h.height+(h.offsetY||0),0);const c=this.getPagePixelRatio(),d=this.pageList[0],R=Number(d.style.height.replace("px",""));if(s>R)d.style.height=`${s}px`,d.height=s*c;else{const u=s<i?i:s;d.style.height=`${u}px`,d.height=u*c}this._initPageContext(this.ctxList[0])}else for(let c=0;c<this.rowList.length;c++){const d=this.rowList[c],R=d.offsetY||0;if(d.height+R+s>i||this.rowList[c-1]?.isPageBreak){if(Number.isInteger(n)&&a>=n){this.elementList=this.elementList.slice(0,d.startIndex);break}s=r+d.height+R,t.push([d]),a++}else s+=d.height+R,t[a].push(d)}return t}_drawHighlight(t,e){const{rowList:n,positionList:i,elementList:r}=e,s=this.getDefaultBasicRowMarginHeight(),a=this.getHighlightMarginHeight();for(let c=0;c<n.length;c++){const d=n[c];for(let R=0;R<d.elementList.length;R++){const u=d.elementList[R],h=d.elementList[R-1],g=u.highlight||this.control.getControlHighlight(r,d.startIndex+R);if(g){h&&h.highlight&&h.highlight!==u.highlight&&this.highlight.render(t);const{coordinate:{leftTop:[f,T]}}=i[d.startIndex+R],m=u.left||0;this.highlight.recordFillInfo(t,f-m,T+s-a,u.metrics.width+m,d.height-2*s+2*a,g)}else h?.highlight&&this.highlight.render(t)}this.highlight.render(t)}}validateNumber(t){return/^\d+$/.test(t)}drawRow(t,e){this._drawHighlight(t,e);const{scale:n,table:{tdPadding:i},group:r,lineBreak:s,whiteSpace:a}=this.options,{rowList:c,pageNo:d,elementList:R,positionList:u,startIndex:h,zone:g,isDrawLineBreak:f=!s.disabled,td:T,isDrawWhiteSpace:m=!a.disabled}=e,p=this.isPrintMode(),I=this.isGraffitiMode(),{isCrossRowCol:L,tableId:P}=this.range.getRange();let O=h;for(let S=0;S<c.length;S++){const F=c[S],N={x:0,y:0,width:0,height:0};let V=null;for(let Y=0;Y<F.elementList.length;Y++){const X=F.elementList[Y],W=X.metrics,{ascent:E,coordinate:{leftTop:[C,M]}}=u[F.startIndex+Y],y=F.elementList[Y-1];if(se(X)&&!this.isDesignMode())this.textParticle.complete();else if(X.type===l.ElementType.IMAGE)this.textParticle.complete(),X.imgDisplay!==l.ImageDisplay.SURROUND&&X.imgDisplay!==l.ImageDisplay.FLOAT_TOP&&X.imgDisplay!==l.ImageDisplay.FLOAT_BOTTOM&&this.imageParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.LATEX)this.textParticle.complete(),this.laTexParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.TABLE)L&&(N.x=C,N.y=M,V=X),this.tableParticle.render(t,X,C,M);else if(X.type===l.ElementType.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.LABEL)this.textParticle.complete(),this.labelParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.MACRO||X.type===l.ElementType.CUSTOM_MACRO||X.type===l.ElementType.REUSABLE_ITEM||X.type===l.ElementType.SUB_TEMPLATE)this.textParticle.complete(),this.macroParticle.render(t,X,C,M+E);else if(X.type===l.ElementType.DATE){const _=F.elementList[Y+1];(!y||y.dateId!==X.dateId)&&this.textParticle.complete(),this.textParticle.record(t,X,C,M+E),(!_||_.dateId!==X.dateId)&&this.textParticle.complete()}else X.type===l.ElementType.SUPERSCRIPT?(this.textParticle.complete(),this.superscriptParticle.render(t,X,C,M+E)):X.type===l.ElementType.SUBSCRIPT?(this.underline.render(t),this.textParticle.complete(),this.subscriptParticle.render(t,X,C,M+E)):X.type===l.ElementType.SEPARATOR?this.separatorParticle.render(t,X,C,M):X.type===l.ElementType.PAGE_BREAK?this.mode!==l.EditorMode.CLEAN&&!p&&this.pageBreakParticle.render(t,X,C,M):X.type===l.ElementType.CHECKBOX||X.controlComponent===l.ControlComponent.CHECKBOX?(this.textParticle.complete(),this.checkboxParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F})):X.type===l.ElementType.RADIO||X.controlComponent===l.ControlComponent.RADIO?(this.textParticle.complete(),this.radioParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F})):X.type===l.ElementType.MENSTRUAL_HISTORY?(this.textParticle.complete(),this.menstrualHistoryParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F,element:X})):X.type===l.ElementType.FETAL_HEART_POSITION?(this.textParticle.complete(),this.fetalHeartPositionParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F,element:X})):X.type===l.ElementType.TOOTH_POSITION?(this.textParticle.complete(),this.toothPositionParticle.render({ctx:t,x:C,y:M+E,index:Y,row:F,element:X})):X.type===l.ElementType.TAB?this.textParticle.complete():X.rowFlex===l.RowFlex.ALIGNMENT||X.rowFlex===l.RowFlex.JUSTIFY?(this.textParticle.record(t,X,C,M+E),this.textParticle.complete()):X.type===l.ElementType.BLOCK?(this.textParticle.complete(),this.blockParticle.render(t,d,X,C,M+E)):(X.left&&this.textParticle.complete(),this.textParticle.record(t,X,C,M+E),(X.width||X.letterSpacing||Kr.test(X.value))&&this.textParticle.complete());if(f&&!p&&this.mode!==l.EditorMode.CLEAN&&!F.isWidthNotEnough&&Y===F.elementList.length-1&&this.lineBreakParticle.render(t,X,C,M+F.height/2),m&&_r.test(X.value)&&this.whiteSpaceParticle.render(t,X,C,M+F.height/2),X.control?.border){y?.control?.border&&y.controlId!==X.controlId&&this.control.drawBorder(t);const _=this.getElementRowMargin(X);this.control.recordBorderInfo(C,M+_,X.metrics.width,F.height-2*_)}else y?.control?.border&&this.control.drawBorder(t);if(X.control?.type===l.ControlType.TEXT){const _=X.controlComponent===l.ControlComponent.VALUE,j=X.controlComponent===l.ControlComponent.POSTFIX||X.controlComponent===l.ControlComponent.POST_TEXT;_&&X.control?.underline&&((!y||y.controlId!==X.controlId||y.controlComponent!==l.ControlComponent.VALUE&&y.controlComponent!==l.ControlComponent.PLACEHOLDER)&&this.control.startTextFieldUnderline(X.controlId,C,M+F.height),this.control.recordTextFieldUnderlineWidth(X.metrics.width)),j&&this.control.drawTextFieldUnderline(t)}else y?.control?.type===l.ControlType.TEXT&&this.control.drawTextFieldUnderline(t);if((X.underline||X.control?.underline)&&X.controlComponent!==l.ControlComponent.PLACEHOLDER&&!(X.control?.type===l.ControlType.TEXT&&X.control?.underline)){y?.type===l.ElementType.SUBSCRIPT&&X.type!==l.ElementType.SUBSCRIPT&&this.underline.render(t);const _=this.getElementRowMargin(X),j=X.left||0;let st=0;X.type===l.ElementType.SUBSCRIPT&&(st=this.subscriptParticle.getOffsetY(X));const it=X.control?.underline?this.options.underlineColor:X.color;this.underline.recordFillInfo(t,C-j,M+F.height-_+st,W.width+j,0,it,X.textDecoration?.style)}else(y?.underline||y?.control?.underline)&&(y?.control?.type===l.ControlType.TEXT&&y?.control?.underline||this.underline.render(t));if(X.strikeout){if(!X.type||$t.includes(X.type)){y&&(y.type===l.ElementType.SUBSCRIPT&&X.type!==l.ElementType.SUBSCRIPT||y.type===l.ElementType.SUPERSCRIPT&&X.type!==l.ElementType.SUPERSCRIPT||this.getElementSize(y)!==this.getElementSize(X))&&this.strikeout.render(t);const _=this.textParticle.measureBasisWord(t,this.getElementFont(X));let j=M+E+_.actualBoundingBoxDescent*n-W.height/2;X.type===l.ElementType.SUBSCRIPT?j+=this.subscriptParticle.getOffsetY(X):X.type===l.ElementType.SUPERSCRIPT&&(j+=this.superscriptParticle.getOffsetY(X)),this.strikeout.recordFillInfo(t,C,j,W.width)}}else y?.strikeout&&this.strikeout.render(t);const{zone:b,splitTdRange:D}=this.range.getRange();let{startIndex:U,endIndex:Q}=this.range.getRange(),G=!1;if(T&&D&&[T.originalId,T.id].includes(D.originalId)&&(G=!0,U=D.startIndex-(T.valueStartIndex??0),Q=D.endIndex-(T.valueStartIndex??0)),b===g&&U!==Q&&U<=O&&O<=Q){const _=this.position.getPositionContext();if(!_.isTable&&!X.tdId||_.tdId===X.tdId||G)if(U===O){const j=R[U+1];j&&j.value===H&&(N.x=C+W.width,N.y=M,N.height=F.height,N.width+=this.options.rangeMinWidth)}else{let j=W.width;j===0&&F.elementList.length===1&&(j=this.options.rangeMinWidth),N.width||(N.x=C,N.y=M,N.height=F.height),N.width+=j}}if(!r.disabled&&X.groupIds&&this.group.recordFillInfo(X,C,M,W.width,F.height),O++,X.type===l.ElementType.TABLE&&!se(X)){const _=X.tdPadding||i,j=_[1]+_[3];for(let st=0;st<X.trList.length;st++){const it=X.trList[st];for(let nt=0;nt<it.tdList.length;nt++){const et=it.tdList[nt];this.drawRow(t,{elementList:et.value,positionList:et.positionList,rowList:et.rowList,pageNo:d,startIndex:0,innerWidth:(et.width-j)*n,zone:g,isDrawLineBreak:f,td:et})}}}}if(F.isList&&this.listParticle.drawListStyle(t,F,u[F.startIndex]),this.textParticle.complete(),this.control.drawBorder(t),this.underline.render(t),this.strikeout.render(t),this.group.render(t),!p&&!I){if(N.width&&N.height){const{x:Y,y:X,width:W,height:E}=N;this.range.render(t,Y,X,W,E)}if(L&&V&&V.id===P){const{coordinate:{leftTop:[Y,X]}}=u[F.startIndex];this.tableParticle.drawRange(t,V,Y,X)}}}}_drawFloat(t,e){const{scale:n}=this.options,i=this.position.getFloatPositionList(),{imgDisplays:r,pageNo:s}=e;for(let a=0;a<i.length;a++){const c=i[a],d=c.element;if((s===c.pageNo||c.zone===l.EditorZone.HEADER||c.zone==l.EditorZone.FOOTER)&&d.imgDisplay&&r.includes(d.imgDisplay)&&d.type===l.ElementType.IMAGE){const R=d.imgFloatPosition;this.imageParticle.render(t,d,R.x*n,R.y*n)}}}_clearPage(t){const e=this.ctxList[t],n=this.pageList[t];e.clearRect(0,0,Math.max(n.width,this.getWidth()),Math.max(n.height,this.getHeight())),this.blockParticle.clear()}_drawPage(t){const{elementList:e,positionList:n,rowList:i,pageNo:r}=t,{inactiveAlpha:s,pageMode:a,header:c,footer:d,pageNumber:R,lineNumber:u,pageBorder:h}=this.options,g=this.mode===l.EditorMode.PRINT,f=this.getInnerWidth(),T=this.ctxList[r];T.globalAlpha=this.zone.isMainActive()?1:s,this._clearPage(r),(!g||!this.options.modeRule[l.EditorMode.PRINT]?.backgroundDisabled)&&this.background.render(T,r),g||this.area.render(T,r),a!==l.PageMode.CONTINUITY&&this.options.watermark.data&&this.waterMark.render(T,r),g||this.margin.render(T,r),this._drawFloat(T,{pageNo:r,imgDisplays:[l.ImageDisplay.FLOAT_BOTTOM]}),g||this.control.renderHighlightList(T,r);const m=i[0]?.startIndex;this.drawRow(T,{elementList:e,positionList:n,rowList:i,pageNo:r,startIndex:m,innerWidth:f,zone:l.EditorZone.MAIN}),this.getIsPagingMode()&&(c.disabled||this.header.render(T,r),R.disabled||this.pageNumber.render(T,r),d.disabled||this.footer.render(T,r)),this._drawFloat(T,{pageNo:r,imgDisplays:[l.ImageDisplay.FLOAT_TOP,l.ImageDisplay.SURROUND]}),!g&&this.search.getSearchKeyword()&&this.search.render(T,r),this.elementList.length<=1&&!this.elementList[0]?.listId&&this.placeholder.render(T),u.disabled||this.lineNumber.render(T,r),h.disabled||this.pageBorder.render(T),this.badge.render(T,r),this.isGraffitiMode()&&this.graffiti.render(T,r)}_disconnectLazyRender(){this.lazyRenderIntersectionObserver?.disconnect()}_lazyRender(){const t=this.position.getOriginalMainPositionList(),e=this.getOriginalMainElementList();this._disconnectLazyRender(),this.lazyRenderIntersectionObserver=new IntersectionObserver(n=>{n.forEach(i=>{if(i.isIntersecting){const r=Number(i.target.dataset.index);this._drawPage({elementList:e,positionList:t,rowList:this.pageRowList[r],pageNo:r})}})}),this.pageList.forEach(n=>{this.lazyRenderIntersectionObserver.observe(n)})}_immediateRender(){const t=this.position.getOriginalMainPositionList(),e=this.getOriginalMainElementList();for(let n=0;n<this.pageRowList.length;n++)this._drawPage({elementList:e,positionList:t,rowList:this.pageRowList[n],pageNo:n})}render(t){const e=Vt(),n=[],i=(W,E)=>{n.push({label:W,duration:Vt()-E})};this.renderCount++;let r;const{endIndex:s,isCrossRowCol:a}=this.range.getRange(),c=this.position.getPositionContext();if(a)r=this.getOriginalElementList()[c.index];else{const W=~s?s:0,E=this.getElementList();r=en(E,W)}const{header:d,footer:R}=this.options,{isSubmitHistory:u=!0,isSetCursor:h=!0,isCompute:g=!0,isLazy:f=!0,isInit:T=!1,isSourceHistory:m=!1,isFirstRender:p=!1,isDel:I=!1}=t||{};let{curIndex:L}=t||{};const{traceLabel:P}=t||{};this.updateLogicTemplateVisibility();const O=this.getInnerWidth(),S=this.getIsPagingMode(),F=this.pageRowList.length;if(g){if(this.splitTdValueMap.clear(),this.tdMap.clear(),this.position.setFloatPositionList([]),S){if(!d.disabled){const j=Vt();this.header.compute(),i("header.compute",j)}if(!R.disabled){const j=Vt();this.footer.compute(),i("footer.compute",j)}}const W=this.getMargins(),E=this.getHeight(),C=this.header.getExtraHeight(),M=this.getMainOuterHeight(),y=W[3],b=W[0]+C,D=vo(this.elementList),U=Vt();this.rowList=this.computeRowList({startX:y,startY:b,pageHeight:E,mainOuterHeight:M,isPagingMode:S,innerWidth:O,surroundElementList:D,elementList:this.elementList}),i("computeRowList",U);const Q=Vt();this.pageRowList=this._computePageList(),i("computePageList",Q);const G=Vt();this.position.computePositionList(),i("computePositionList",G);const _=Vt();if(this.area.compute(),i("area.compute",_),!this.isPrintMode()){const j=this.search.getSearchKeyword();if(j){const it=Vt();this.search.compute(j),i("search.compute",it)}const st=Vt();this.control.computeHighlightList(),i("control.computeHighlightList",st)}if(this.isGraffitiMode()){const j=Vt();this.graffiti.compute(),i("graffiti.compute",j)}}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let W=0;W<this.pageRowList.length;W++)this.pageList[W]||this._createPage(W);const N=this.pageRowList.length,V=this.pageList.length;if(V>N){const W=V-N;this.ctxList.splice(N,W),this.pageList.splice(N,W).forEach(E=>E.remove())}const Y=Vt();if(f&&S?this._lazyRender():this._immediateRender(),i(f&&S?"lazyRender":"immediateRender",Y),h){if(g&&r?.tableId){const{index:W}=c,C=this.getOriginalElementList()[W];if(r.tableId!==C?.id){const y=this.findTableChildrenElement(!0,r.tableId,r);y&&c.index!==y.originalIndex&&(c.index=y.originalIndex,c.tableId=y.table.id,c.trIndex=y.trIndex,c.trId=y.tr.id,c.tdIndex=y.tdIndex,c.tdId=y.td.id,L=y.elementIndex,this.position.setPositionContext(c),this.range.setRange(L,L),this.updateTableTool())}const M=this.getElementList();M[s]!==r&&(L=M.findIndex(y=>y===r))}L=this.setCursor(L)}else this.range.getIsSelection()&&this.cursor.focus();if(I){let W;const E=this.position.getPositionContext();W=this.range.getRange().startIndex-1,E.index=W}(u&&!p||L!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(L);const X=Vt();Eo(()=>{const W=Vt();this.range.setRangeStyle(),g&&this.control.getActiveControl()&&this.control.reAwakeControl(),g&&!this.isReadonly()&&this.getMode()!==l.EditorMode.FORM&&c.isTable&&this.getOriginalElementList()[c.index].type===l.ElementType.TABLE&&this.tableTool.render(),g&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),F!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(u||m)&&!T&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"));const E=Vt();Xo(this.options,P||"render",E-e,[...n,{label:"nextTick.wait",duration:W-X},{label:"nextTick.callback",duration:E-W}],{isCompute:g,pageCount:this.pageRowList.length})}),h&&this.fixPosition()}fixPosition(t=!1){let e;const n=this.position.getPositionContext();if(n.isTable){const i=this.getElementList(),r=this.range.getRange().startIndex;if(t||r>=i.length){const s=this.getTd(),a=n.index+(t?-1:1),d=this.getOriginalElementList()[a];if(!d?.trList)return;e=r-i.length;for(let R=0;R<d.trList.length;R++){const u=d.trList[R],h=u.tdList.find(g=>t?s?.linkTdPrevId===g.id:s?.id===g.linkTdPrevId);if(h){n.index=a,n.trIndex=R,n.tableId=d.id,n.trId=u.id,n.tdId=h?.id,e=t?h.value.length-1:e+(h.value[0]?.type===l.ElementType.SPLIT_TAG?1:0);break}}if(this.position.setPositionContext(n),this.range.setRange(e,e),this.setCursor(e),e===0)return this.fixPosition(t);this.updateTableTool()}}return e}setCursor(t){const e=this.position.getPositionContext(),n=this.position.getPositionList(),i=this.getElementList();if(e.isTable){const{index:s,trIndex:a,tdIndex:c}=e,R=this.getOriginalElementList()[s].trList?.[a].tdList[c].positionList;t===void 0&&R&&(t=R.length-1);const u=R?.[t];this.position.setCursorPosition(u||null)}else t!==void 0&&t>=n.length&&(t=n.length-1),this.position.setCursorPosition(t!==void 0&&t>=0?n[t]:null);let r=!0;if(t!==void 0&&e.isImage&&e.isDirectHit){const s=i[t];if(s&&cl.includes(s.type)){r=!1;const a=this.position.getCursorPosition();this.previewer.updateResizer(s,a)}}return this.cursor.drawCursor({isShow:r}),t}submitHistory(t){const e=this.position.getPositionContext(),n=Qo(this.elementList),i=Qo(this.header.getElementList()),r=Qo(this.footer.getElementList()),s=at(this.range.getRange()),a=this.pageNo,c=at(e),d=this.zone.getZone();this.historyManager.execute(()=>{this.zone.setZone(d),this.setPageNo(a),this.position.setPositionContext(at(c)),this.header.setElementList(at(i)),this.footer.setElementList(at(r)),this.elementList=at(n),this.range.replaceRange(at(s)),this.render({curIndex:t,isSubmitHistory:!1,isSourceHistory:!0})})}destroy(){this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getPreviewer().clearResizer(),this.getTableTool().dispose(),this.getHyperlinkParticle().clearHyperlinkPopup(),this.getDateParticle().clearDatePicker()}updateTableTool(){if(this.getMode()===l.EditorMode.FORM){this.getTableTool().dispose();return}if(this.position.getPositionContext().isTable){const t=this.position.getPositionList();t.length&&(this.setPageNo(t[0].pageNo),this.getTableTool().render())}}initTableElementIndex(t,e){t.trList?.forEach((n,i)=>{n.tdList.forEach((r,s)=>{r.tableIndex=e,r.tableId=t.id,r.trIndex=i,r.trId=n.id,r.tdIndex=s,this.tdMap.set(r.id,r)})})}clearElementEffect(t){t.trList?.forEach(e=>{e.minHeight=e.originalMinHeight??e.minHeight,delete e.originalMinHeight,e.tdList.forEach(n=>{delete n.linkTdNextId})})}updateElementTableInfo(t,e,n,i){return t.tableId=e.id,t.trId=n.id,t.tdId=i.id,t}findTableChildrenElement(t,e,n){const i=this.position.getPositionContext(),{index:r}=i,s=this.getOriginalElementList();let a=r;t&&(a=r>s.length?s.length-1:r);for(let c=a;t?c>=0:c<s.length;t?c--:c++){const d=s[c];if(d&&[d.originalId,d.id].includes(e))for(const[R,u]of d.trList.entries())for(const[h,g]of u.tdList.entries()){const f=g.value.findIndex(typeof n=="function"?n:T=>T===n);if(f>=0)return{originalIndex:c,table:d,tr:u,trIndex:R,td:g,tdIndex:h,elementIndex:f}}}}getTdById(t){return this.tdMap.get(t)}getLinkTdPrevHasValue(t){const e=this.getTdById(t);if(e)return e.value.length?e:this.getLinkTdPrevHasValue(e.linkTdPrevId)}getFirstLinkTd(t){const e=this.getTdById(t);return e?.linkTdPrevId?this.getLastLinkTd(e.linkTdPrevId):e}getLastLinkTd(t){const e=this.getTdById(t);return e?.linkTdNextId?this.getLastLinkTd(e.linkTdNextId):e}removeLinkTd(t,e){const n=this.getTdById(e);if(n){if(n.linkTdPrevId){const i=this.getTdById(n.linkTdPrevId);i&&(delete i.linkTdNextId,this.removeLinkTd(t,n.linkTdPrevId))}if(n.linkTdNextId){const i=this.getTdById(n.linkTdNextId);i&&(delete i.linkTdPrevId,this.removeLinkTd(t,n.linkTdNextId))}t[n.tableIndex].trList[n.trIndex].tdList.splice(n.tdIndex,1),this.initTableElementIndex(t[n.tableIndex],n.tableIndex)}}removeLinkTdControl(t,e){const n=this.getTdById(t);if(n){for(let i=0;i<n.value.length;i++)n.value[i].control===e&&(n.value.splice(i,1),i--);n.linkTdNextId&&this.removeLinkTdControl(n.linkTdNextId,e)}}isSplitTd(t,e){return(!!t?.originalId||!!e?.originalId)&&(t?.originalId===e?.originalId||t?.id===e?.originalId||t?.originalId===e?.id)}getSplitTdValues(t){return this.splitTdValueMap.get(t)}removeSplitTdOtherRangeElements(){const{splitTdRange:t}=this.range.getRange();if(!t)return;const{startIndex:e,endIndex:n}=t;let i=this.getTd();if(i)if((i.valueStartIndex??0)>=e){let r=-1;for(;r<0;){const s=this.getTdById(i.linkTdPrevId);if(s){r=e-(s.valueStartIndex??0);const a=Math.max(0,r);this.spliceElementList(s.value,a+1,s.value.length-a-1),i=s}else r=0}}else{let r=1;for(;r>0;){const s=this.getTdById(i.linkTdNextId);if(s){const a=s.valueStartIndex??0;r=n-(a+s.value.length);const c=Math.min(s.value.length,n-a+1);this.spliceElementList(s.value,0,c),i=s}else r=0}}}getTablesByPagingId(t,e,n){const i=[],r=[];if(t[n].pagingId===e){i.push(n),r.push(t[n]);for(let s=n-1;s>=0&&t[s].pagingId===e;s--)r.unshift(t[s]),i.push(s);for(let s=n+1;s<t.length&&t[s].pagingId===e;s++)r.push(t[s]),i.push(s)}return{list:r,startIndex:i.sort()[0]}}}class yr{executeMode;executeCut;executeCopy;executePaste;executeSelectAll;executeBackspace;executeSetRange;executeReplaceRange;executeSetPositionContext;executeForceUpdate;executeBlur;executeHideCursor;executeUndo;executeRedo;executePainter;executeApplyPainterStyle;executeFormat;executeFont;executeButton;executeEditElementAttribute;executeTriggerControlEditAttribute;executeCopyControl;executePasteControl;executeSize;executeSizeAdd;executeSizeMinus;executeBold;executeItalic;executeUnderline;executeStrikeout;executeSuperscript;executeSubscript;executeColor;executeHighlight;executeTitle;executeList;executeRowFlex;executeVertical;executeRowMargin;executeInsertTable;executeInsertTableTopRow;executeInsertTableBottomRow;executeInsertTableLeftCol;executeInsertTableRightCol;executeDeleteTableRow;executeDeleteTableCol;executeDeleteTable;executeMergeTableCell;executeCancelMergeTableCell;executeSplitVerticalTableCell;executeSplitHorizontalTableCell;executeTableTdVerticalAlign;executeTableBorderType;executeTableBorderColor;executeTableTdBorderType;executeTableTdSlashType;executeTableTdBackgroundColor;executeTableSelectAll;executeTableProperties;executeImage;executeHyperlink;executeDeleteHyperlink;executeCancelHyperlink;executeEditHyperlink;executeSeparator;executePageBreak;executeAddWatermark;executeDeleteWatermark;executeSearch;executeSearchNavigatePre;executeSearchNavigateNext;executeReplace;executePrint;executeReplaceImageElement;executeSaveAsImageElement;executeSetImageCrop;executeSetImageCaption;executeChangeImageDisplay;executePageMode;executePageScale;executePageScaleRecovery;executePageScaleMinus;executePageScaleAdd;executePaperSize;executePaperDirection;executeSetPaperMargin;executeSetMainBadge;executeSetAreaBadge;executeInsertElementList;executeInsertArea;executeSetAreaValue;executeSetAreaProperties;executeLocationArea;executeClearGraffiti;executeAppendElementList;executeUpdateElementById;executeDeleteElementById;executeSetValue;executeRemoveControl;executeTranslate;executeSetLocale;executeLocationCatalog;executeWordTool;executeSetHTML;executeSetGroup;executeDeleteGroup;executeLocationGroup;executeSetZone;executeSetControlValue;executeSetControlValueList;executeSetControlExtension;executeSetControlExtensionList;executeSetControlProperties;executeSetControlPropertiesList;executeSetControlHighlight;executeLocationControl;executeInsertControl;executeInsertTextField;executeJumpControl;executeUpdateOptions;executeSetFormModeTrace;executeInsertTitle;executeFocus;executeComputeElementListHeight;getCatalog;getImage;getPageMode;getOptions;getValue;getValueAsync;getAreaValue;getHTML;getText;getWordCount;getCursorPosition;getRemainingContentHeight;getRange;getRangeText;getRangeContext;getRangeRow;getRangeParagraph;getKeywordRangeList;getKeywordContext;getPaperMargin;getSearchNavigateInfo;getLocale;getGroupIds;getControlValue;getControlList;getContainer;getTitleValue;getPositionContextByEvent;getElementById;getMacroValue;getMacroList;setMacroValue;setMacroValueList;updateMacroProperties;locationMacro;insertSubTemplate;expandSubTemplate;collapseSubTemplate;toggleSubTemplate;insertLogicTemplate;updateLogicTemplate;getLogicTemplateList;constructor(t){this.executeMode=t.mode.bind(t),this.executeCut=t.cut.bind(t),this.executeCopy=t.copy.bind(t),this.executePaste=t.paste.bind(t),this.executeSelectAll=t.selectAll.bind(t),this.executeBackspace=t.backspace.bind(t),this.executeSetRange=t.setRange.bind(t),this.executeReplaceRange=t.replaceRange.bind(t),this.executeSetPositionContext=t.setPositionContext.bind(t),this.executeForceUpdate=t.forceUpdate.bind(t),this.executeBlur=t.blur.bind(t),this.executeHideCursor=t.hideCursor.bind(t),this.executeUndo=t.undo.bind(t),this.executeRedo=t.redo.bind(t),this.executePainter=t.painter.bind(t),this.executeApplyPainterStyle=t.applyPainterStyle.bind(t),this.executeFormat=t.format.bind(t),this.executeFont=t.font.bind(t),this.executeButton=t.buttonText.bind(t),this.executeEditElementAttribute=t.editElementAttribute.bind(t),this.executeTriggerControlEditAttribute=t.triggerControlEditAttribute.bind(t),this.executeCopyControl=t.copyControl.bind(t),this.executePasteControl=t.pasteControl.bind(t),this.executeSize=t.size.bind(t),this.executeSizeAdd=t.sizeAdd.bind(t),this.executeSizeMinus=t.sizeMinus.bind(t),this.executeBold=t.bold.bind(t),this.executeItalic=t.italic.bind(t),this.executeUnderline=t.underline.bind(t),this.executeStrikeout=t.strikeout.bind(t),this.executeSuperscript=t.superscript.bind(t),this.executeSubscript=t.subscript.bind(t),this.executeColor=t.color.bind(t),this.executeHighlight=t.highlight.bind(t),this.executeTitle=t.title.bind(t),this.executeList=t.list.bind(t),this.executeRowFlex=t.rowFlex.bind(t),this.executeVertical=t.vertical.bind(t),this.executeRowMargin=t.rowMargin.bind(t),this.executeInsertTable=t.insertTable.bind(t),this.executeInsertTableTopRow=t.insertTableTopRow.bind(t),this.executeInsertTableBottomRow=t.insertTableBottomRow.bind(t),this.executeInsertTableLeftCol=t.insertTableLeftCol.bind(t),this.executeInsertTableRightCol=t.insertTableRightCol.bind(t),this.executeDeleteTableRow=t.deleteTableRow.bind(t),this.executeDeleteTableCol=t.deleteTableCol.bind(t),this.executeDeleteTable=t.deleteTable.bind(t),this.executeMergeTableCell=t.mergeTableCell.bind(t),this.executeCancelMergeTableCell=t.cancelMergeTableCell.bind(t),this.executeSplitVerticalTableCell=t.splitVerticalTableCell.bind(t),this.executeSplitHorizontalTableCell=t.splitHorizontalTableCell.bind(t),this.executeTableTdVerticalAlign=t.tableTdVerticalAlign.bind(t),this.executeTableBorderType=t.tableBorderType.bind(t),this.executeTableBorderColor=t.tableBorderColor.bind(t),this.executeTableTdBorderType=t.tableTdBorderType.bind(t),this.executeTableTdSlashType=t.tableTdSlashType.bind(t),this.executeTableTdBackgroundColor=t.tableTdBackgroundColor.bind(t),this.executeTableSelectAll=t.tableSelectAll.bind(t),this.executeTableProperties=t.tableProperties.bind(t),this.executeImage=t.image.bind(t),this.executeHyperlink=t.hyperlink.bind(t),this.executeDeleteHyperlink=t.deleteHyperlink.bind(t),this.executeCancelHyperlink=t.cancelHyperlink.bind(t),this.executeEditHyperlink=t.editHyperlink.bind(t),this.executeSeparator=t.separator.bind(t),this.executePageBreak=t.pageBreak.bind(t),this.executeAddWatermark=t.addWatermark.bind(t),this.executeDeleteWatermark=t.deleteWatermark.bind(t),this.executeSearch=t.search.bind(t),this.executeSearchNavigatePre=t.searchNavigatePre.bind(t),this.executeSearchNavigateNext=t.searchNavigateNext.bind(t),this.executeReplace=t.replace.bind(t),this.executePrint=t.print.bind(t),this.executeReplaceImageElement=t.replaceImageElement.bind(t),this.executeSaveAsImageElement=t.saveAsImageElement.bind(t),this.executeSetImageCrop=t.setImageCrop.bind(t),this.executeSetImageCaption=t.setImageCaption.bind(t),this.executeChangeImageDisplay=t.changeImageDisplay.bind(t),this.executePageMode=t.pageMode.bind(t),this.executePageScale=t.pageScale.bind(t),this.executePageScaleRecovery=t.pageScaleRecovery.bind(t),this.executePageScaleMinus=t.pageScaleMinus.bind(t),this.executePageScaleAdd=t.pageScaleAdd.bind(t),this.executePaperSize=t.paperSize.bind(t),this.executePaperDirection=t.paperDirection.bind(t),this.executeSetPaperMargin=t.setPaperMargin.bind(t),this.executeSetMainBadge=t.setMainBadge.bind(t),this.executeSetAreaBadge=t.setAreaBadge.bind(t),this.getAreaValue=t.getAreaValue.bind(t),this.executeInsertArea=t.insertArea.bind(t),this.executeSetAreaValue=t.setAreaValue.bind(t),this.executeSetAreaProperties=t.setAreaProperties.bind(t),this.executeLocationArea=t.locationArea.bind(t),this.executeClearGraffiti=t.clearGraffiti.bind(t),this.executeInsertElementList=t.insertElementList.bind(t),this.executeAppendElementList=t.appendElementList.bind(t),this.executeUpdateElementById=t.updateElementById.bind(t),this.executeDeleteElementById=t.deleteElementById.bind(t),this.executeSetValue=t.setValue.bind(t),this.executeRemoveControl=t.removeControl.bind(t),this.executeTranslate=t.translate.bind(t),this.executeSetLocale=t.setLocale.bind(t),this.executeLocationCatalog=t.locationCatalog.bind(t),this.executeWordTool=t.wordTool.bind(t),this.executeSetHTML=t.setHTML.bind(t),this.executeSetGroup=t.setGroup.bind(t),this.executeDeleteGroup=t.deleteGroup.bind(t),this.executeLocationGroup=t.locationGroup.bind(t),this.executeSetZone=t.setZone.bind(t),this.executeUpdateOptions=t.updateOptions.bind(t),this.executeSetFormModeTrace=t.setFormModeTrace.bind(t),this.executeInsertTitle=t.insertTitle.bind(t),this.executeFocus=t.focus.bind(t),this.executeComputeElementListHeight=t.computeElementListHeight.bind(t),this.getImage=t.getImage.bind(t),this.getPageMode=t.getPageMode.bind(t),this.getOptions=t.getOptions.bind(t),this.getValue=t.getValue.bind(t),this.getValueAsync=t.getValueAsync.bind(t),this.getHTML=t.getHTML.bind(t),this.getText=t.getText.bind(t),this.getWordCount=t.getWordCount.bind(t),this.getCursorPosition=t.getCursorPosition.bind(t),this.getRemainingContentHeight=t.getRemainingContentHeight.bind(t),this.getRange=t.getRange.bind(t),this.getRangeText=t.getRangeText.bind(t),this.getRangeContext=t.getRangeContext.bind(t),this.getRangeRow=t.getRangeRow.bind(t),this.getRangeParagraph=t.getRangeParagraph.bind(t),this.getKeywordRangeList=t.getKeywordRangeList.bind(t),this.getKeywordContext=t.getKeywordContext.bind(t),this.getCatalog=t.getCatalog.bind(t),this.getPaperMargin=t.getPaperMargin.bind(t),this.getSearchNavigateInfo=t.getSearchNavigateInfo.bind(t),this.getLocale=t.getLocale.bind(t),this.getGroupIds=t.getGroupIds.bind(t),this.getContainer=t.getContainer.bind(t),this.getTitleValue=t.getTitleValue.bind(t),this.getPositionContextByEvent=t.getPositionContextByEvent.bind(t),this.getElementById=t.getElementById.bind(t),this.executeSetControlValue=t.setControlValue.bind(t),this.executeSetControlValueList=t.setControlValueList.bind(t),this.executeSetControlExtension=t.setControlExtension.bind(t),this.executeSetControlExtensionList=t.setControlExtensionList.bind(t),this.executeSetControlProperties=t.setControlProperties.bind(t),this.executeSetControlPropertiesList=t.setControlPropertiesList.bind(t),this.executeSetControlHighlight=t.setControlHighlight.bind(t),this.getControlValue=t.getControlValue.bind(t),this.getControlList=t.getControlList.bind(t),this.executeLocationControl=t.locationControl.bind(t),this.executeInsertControl=t.insertControl.bind(t),this.executeInsertTextField=t.insertTextField.bind(t),this.executeJumpControl=t.jumpControl.bind(t),this.getMacroValue=t.getMacroValue.bind(t),this.getMacroList=t.getMacroList.bind(t),this.setMacroValue=t.setMacroValue.bind(t),this.setMacroValueList=t.setMacroValueList.bind(t),this.updateMacroProperties=t.updateMacroProperties.bind(t),this.locationMacro=t.locationMacro.bind(t),this.insertSubTemplate=t.insertSubTemplate.bind(t),this.expandSubTemplate=t.expandSubTemplate.bind(t),this.collapseSubTemplate=t.collapseSubTemplate.bind(t),this.toggleSubTemplate=t.toggleSubTemplate.bind(t),this.insertLogicTemplate=t.insertLogicTemplate.bind(t),this.updateLogicTemplate=t.updateLogicTemplate.bind(t),this.getLogicTemplateList=t.getLogicTemplateList.bind(t)}}function rg(o,t){return o===1125&&t===1593?{size:"a3",width:"297mm",height:"420mm"}:o===794&&t===1123?{size:"a4",width:"210mm",height:"297mm"}:o===565&&t===796?{size:"a5",width:"148mm",height:"210mm"}:{size:"",width:`${o}px`,height:`${t}px`}}function lg(o,t){const{width:e,height:n,direction:i=l.PaperDirection.VERTICAL}=t,r=document.createElement("iframe");r.style.visibility="hidden",r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.width="0",r.style.height="0",r.style.border="none",document.body.append(r);const s=r.contentWindow,a=s.document;a.open();const c=document.createElement("div"),d=rg(e,n);o.forEach(h=>{const g=document.createElement("img");g.style.width=i===l.PaperDirection.HORIZONTAL?d.height:d.width,g.style.height=i===l.PaperDirection.HORIZONTAL?d.width:d.height,g.src=h,c.append(g)});const R=document.createElement("style"),u=`
539
539
  * {
540
540
  margin: 0;
541
541
  padding: 0;
@@ -543,7 +543,7 @@ ${u} `}textToElements(t){const e=[],n=t.split(`
543
543
  @page {
544
544
  margin: 0;
545
545
  size: ${d.size} ${i===l.PaperDirection.HORIZONTAL?"landscape":"portrait"};
546
- }`;R.append(document.createTextNode(u)),setTimeout(()=>{a.write(`${R.outerHTML}${c.innerHTML}`),s.print(),a.close(),window.addEventListener("mouseover",()=>{r?.remove()},{once:!0})})}const eg=[l.ControlType.TEXT,l.ControlType.TEXTFIELD],Nr=["id","titleId","listId","areaId","hyperlinkId","dateId","labelId","tableId","trId","tdId","pagingId","menstrualHistoryId","fetalHeartPositionId","toothPositionId"];function go(o,t){for(let e=0;e<o.length;e++){const n=o[e];if(n.type===l.ElementType.CONTROL&&n.controlId===t&&n.control)return at(n);if(n.control?.value?.length){const i=go(n.control.value,t);if(i)return i}if(n.valueList?.length){const i=go(n.valueList,t);if(i)return i}if(n.type===l.ElementType.TABLE&&n.trList?.length)for(let i=0;i<n.trList.length;i++){const r=n.trList[i];for(let s=0;s<r.tdList.length;s++){const a=r.tdList[s],c=go(a.value,t);if(c)return c}}}return null}function ng(o){const t=new Map,e=new Map,n=a=>a&&(t.has(a)||t.set(a,lt()),t.get(a)),i=a=>a&&(e.has(a)||e.set(a,lt()),e.get(a)),r=a=>{a.controlId&&(a.controlId=n(a.controlId)),a.originControlId&&(a.originControlId=n(a.originControlId));for(let c=0;c<Nr.length;c++){const d=Nr[c],R=a[d];if(typeof R=="string"){const u=a;u[d]=i(R)}}a.groupIds?.length&&(a.groupIds=a.groupIds.map(c=>i(c))),a.valueList?.length&&a.valueList.forEach(r),a.control?.value?.length&&a.control.value.forEach(r),a.trList?.length&&a.trList.forEach(c=>{const d=c;typeof d.id=="string"&&(d.id=i(d.id)),c.tdList.forEach(R=>{const u=R;typeof u.id=="string"&&(u.id=i(u.id)),R.value.forEach(r)})})},s=at(o);return r(s),s}function og(o,t,e){let n=-1;const i=!!e;for(let r=0;r<o.length;r++){const s=o[r];if(i?s.controlId===t&&s.originControlId===e:s.controlId===t&&!s.originControlId)n=r;else if(~n)break}return n}class ig{draw;range;position;historyManager;canvasEvent;options;control;workerManager;searchManager;i18n;zone;tableOperate;constructor(t){this.draw=t,this.range=t.getRange(),this.position=t.getPosition(),this.historyManager=t.getHistoryManager(),this.canvasEvent=t.getCanvasEvent(),this.options=t.getOptions(),this.control=t.getControl(),this.workerManager=t.getWorkerManager(),this.searchManager=t.getSearch(),this.i18n=t.getI18n(),this.zone=t.getZone(),this.tableOperate=t.getTableOperate()}getIsRangeInTextField(){const{startIndex:t}=this.range.getRange(),e=this.draw.getElementList(),n=e[t];if(!n)return!1;let i=null;const r=s=>{if(!s)return null;for(let a=t;a>=0;a--){const c=e[a];if(c.controlId===s&&c.control?.type===l.ControlType.TEXTFIELD&&(c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===l.ControlComponent.PREFIX||c.controlComponent===l.ControlComponent.PRE_TEXT))return s}return null};return i=r(n.controlId)||r(n.originControlId),!!i}mode(t){this.draw.setMode(t)}async cut(){this.draw.isReadonly()||this.draw.isDisabled()||await this.canvasEvent.cut()}async copy(t){await this.canvasEvent.copy(t)}paste(t){this.draw.isReadonly()||this.draw.isDisabled()||sa(this.canvasEvent,t)}copyControl(t){if(!t)return;const e=Pt(this.draw.getElementList(),{editorOptions:this.options}),n=go(e,t);n&&ta({element:n})}pasteControl(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=es();if(!e?.element)return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.draw.getElementList(),s=ng(e.element),a=s.controlId;if(!a)return;const c=Do([s]);if(!c.length)return;Vt(c,{isHandleFirstElement:!1,editorOptions:this.options});let d=n,R=n,u=i,h=!1,g;const f=n===i;let T=this.control.getActiveControl();!T&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),T=this.control.getActiveControl());const p=T?.getElement();if(p?.control?.type&&eg.includes(p.control.type)&&this.control.getIsRangeWithinControl()){h=!0,g=p.controlId;const L=r[n];f&&(L?.control?.type===l.ControlType.TEXTFIELD||L?.control?.type===l.ControlType.TEXT)&&this.control.removePlaceholder(n)}else if(p?.controlId){const L=og(r,p.controlId,p.originControlId);~L&&(d=L,R=L,u=L)}Ut(r,c,d,{isBreakWhenWrap:!0,editorOptions:this.options}),g&&c.forEach(L=>{L.controlId===a&&!L.originControlId&&(L.originControlId=g)});const m=d+1;R!==u&&this.draw.spliceElementList(r,R+1,u-R),this.draw.spliceElementList(r,m,0,c);const I=d+c.length;this.range.setRange(I,I),this.draw.render({curIndex:I}),h&&this.control.emitControlContentChange()}selectAll(){this.canvasEvent.selectAll()}backspace(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.draw.getElementList(),{startIndex:n,endIndex:i}=this.range.getRange(),r=n===i;if(r&&e[n].value===_&&n===0)return;r?this.draw.spliceElementList(e,n,1):this.draw.spliceElementList(e,n+1,i-n);const s=r?n-1:n;this.range.setRange(s,s),this.draw.render({curIndex:s})}setRange(t,e,n,i,r,s,a){if(t<0||e<0||e<t)return;this.range.setRange(t,e,n,i,r,s,a);const c=t===e;this.draw.render({curIndex:c?t:void 0,isCompute:!1,isSubmitHistory:!1,isSetCursor:c})}replaceRange(t){this.setRange(t.startIndex,t.endIndex,t.tableId,t.startTdIndex,t.endTdIndex,t.startTrIndex,t.endTrIndex)}setPositionContext(t){const{tableId:e,startTrIndex:n,startTdIndex:i}=t,r=this.draw.getOriginalElementList();if(e){const s=r.findIndex(R=>R.id===e);if(!~s)return;const c=r[s].trList[n],d=c.tdList[i];this.position.setPositionContext({isTable:!0,index:s,trIndex:n,tdIndex:i,tdId:d.id,trId:c.id,tableId:e})}else this.position.setPositionContext({isTable:!1})}forceUpdate(t){const{isSubmitHistory:e=!1}=t||{};this.range.clearRange(),this.draw.render({isSubmitHistory:e,isSetCursor:!1})}blur(){this.range.clearRange(),this.draw.getCursor().recoveryCursor()}hideCursor(){this.draw.getCursor().recoveryCursor()}undo(){this.draw.isReadonly()||this.historyManager.undo()}redo(){this.draw.isReadonly()||this.historyManager.redo()}painter(t){if(!t.isDblclick&&this.draw.getPainterStyle()){this.canvasEvent.clearPainterStyle();return}const e=this.range.getSelection();if(!e)return;const n={};e.forEach(i=>{Re.forEach(s=>{const a=s;n[a]===void 0&&Reflect.set(n,a,i[a])})}),this.draw.setPainterStyle(n,t)}applyPainterStyle(){this.draw.isReadonly()||this.draw.isDisabled()||this.canvasEvent.applyPainterStyle()}format(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();let r={},s=[];if(i?.length)s=i,r={isSetCursor:!1};else{const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===_&&(s.push(d),r={curIndex:a})}s.length&&(s.forEach(a=>{Re.forEach(c=>{delete a[c]})}),this.draw.render(r))}buttonText(t){if(t)if([...t.element].filter(i=>i.newButtonValue&&i.newButtonValue.length>0).length){const i=t.controlId;this.removeButtonElementsByControlId(i+"_text").then(()=>{setTimeout(()=>{this.insertButtonValue(t)},500)})}else{const i=t.controlId;i&&this.removeButtonElementsByControlId(i+"_text")}}triggerControlEditAttribute(t){const n=this.draw.getElementList().filter(r=>r.controlId===t);this.draw.getEventBus().emit("controlEditAttribute",{controlId:t,element:n})}editElementAttribute(t){const e=this.draw.getElementList();if(t.controlId&&t.type==="button"){const n=[];e.forEach((h,g)=>{h.controlId===t.controlId&&h.control?.type==="button"&&n.push(g)});const i=[];let r=null;n.forEach(h=>{const g=e[h];g.controlComponent===l.ControlComponent.VALUE&&(i.push(h),r||(r=g))}),i.sort((h,g)=>g-h).forEach(h=>{e.splice(h,1)});let s=-1;for(let h=0;h<e.length;h++){const g=e[h];if(g.controlId===t.controlId&&g.control?.type==="button"){if(g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT){s=h+1;break}s===-1&&(s=h+1)}}if(s===-1&&n.length>0){const h=[];e.forEach((g,f)=>{g.controlId===t.controlId&&g.control?.type==="button"&&h.push(f)}),h.length>0&&(s=h[0]+1)}const a=t.label||"";for(let h=0;h<a.length;h++){const g={value:a[h],controlId:t.controlId,type:l.ElementType.CONTROL,control:{type:"button",buttonLabel:a,code:t.code,value:[{value:a}],label:a,hide:!1},controlComponent:l.ControlComponent.VALUE,color:r?.color||"#fff",highlight:r?.highlight||"#1677FF",style:r?.style||"16px Microsoft YaHei",hide:!1};e.splice(s+h,0,g)}e.filter(h=>h.controlId===t.controlId&&h.control?.type==="button").forEach(h=>{h.control&&(h.control.buttonLabel=t.label,h.control.label=t.label,h.control.code=t.code,h.control.hide=!1,h.control.value=[{value:t.label}]),h.hide=!1});const{startIndex:c,endIndex:d}=this.range.getRange(),R=!0,u=d;this.draw.render({curIndex:u,isSetCursor:R})}else if(t.controlId){const n=t.controlId;if(e.forEach(r=>{r.controlId===n&&r.control&&(t.label!==void 0&&(r.control.label=t.label),t.placeholder!==void 0&&(r.control.placeholder=t.placeholder),t.code!==void 0&&(r.control.code=t.code),t.value!==void 0&&(r.control.value=t.value?[{value:t.value}]:null),t.valueSets!==void 0&&(r.control.valueSets=t.valueSets),t.dateFormat!==void 0&&(r.control.dateFormat=t.dateFormat),t.numberExclusiveOptions!==void 0&&(r.control.numberExclusiveOptions=t.numberExclusiveOptions),t.underline!==void 0&&(r.control.underline=t.underline))}),t.placeholder!==void 0){const r=t.placeholder,s=[];if(e.forEach((a,c)=>{a.controlId===n&&a.controlComponent==="placeholder"&&s.push({element:a,index:c})}),s.length===r.length)s.forEach((a,c)=>{a.element.value=r[c]===`
547
- `?_:r[c]});else if(s.length>0){const a={...s[0].element};s.sort((d,R)=>R.index-d.index).forEach(d=>{e.splice(d.index,1)});const c=Math.min(...s.map(d=>d.index));for(let d=0;d<r.length;d++){const R=r[d]===`
548
- `?_:r[d];e.splice(c+d,0,{...a,value:R})}}}const{endIndex:i}=this.range.getRange();this.draw.render({curIndex:i,isSetCursor:!0})}}delButton(t,e){return new Promise(n=>{for(let i=t.length-1;i>=0;i--)e.some(s=>s.controlId===t[i].controlId&&s.type===t[i].type)&&t.splice(i,1);n(!0)})}editButton(t,e,n){const i=this.draw.getElementList();n=n+1;for(let d=0;d<e.label.length;d++){const R={value:e.label[d],controlId:e.controlId,type:l.ElementType.CONTROL,control:{type:"button",buttonLabel:e.label,code:e.code,value:[{value:e.label}],label:e.label,hide:!1},controlComponent:"value",color:"#fff",highlight:"#1677FF",style:"16px Microsoft YaHei",hide:!1};i.splice(n+d,0,R)}const{startIndex:r,endIndex:s}=this.range.getRange(),a=!0,c=s;this.draw.render({curIndex:c,isSetCursor:a})}removeButtonElementsByControlId(t){return new Promise(e=>{const n=this.draw.getElementList();for(let c=n.length-1;c>=0;c--)n[c].controlId===t&&n.splice(c,1);const{startIndex:i,endIndex:r}=this.range.getRange(),s=!0,a=r;this.draw.render({curIndex:a,isSetCursor:s}),e(!0)})}removeByValue(t,e){return new Promise(n=>{for(let c=t.length-1;c>=0;c--)(t[c].type=="control"||t[c].type=="text"||t[c].type=="buttonText")&&t[c].control?.buttonLabel===e&&t[c].control?.buttonText&&t.splice(c,1);const{startIndex:i,endIndex:r}=this.range.getRange(),s=!0,a=r;this.draw.render({curIndex:a,isSetCursor:s}),n(!0)})}insertButtonValue(t){const e=this.draw.getElementList(),n=t.controlId,i=t.element[0].newButtonValue,r=t.element[0].control.buttonLabel,s=t.element[0].control.code;if(!i||!i.length)return;let a=-1;for(let p=0;p<e.length;p++)if(e[p].controlId===n&&e[p].control?.type==="button"){a=p;break}if(a===-1)return;const c=n+"_text",d=[];for(let p=0;p<i.length;p++){const m=i[p];d.push({value:m.value,code:m.code})}const R={type:"button",buttonLabel:r,buttonText:!0,label:r,code:s,value:d,hide:!1},u=[];u.push({value:"[",controlId:c,type:l.ElementType.CONTROL,control:R,controlComponent:l.ControlComponent.PREFIX,color:"#1677FF",hide:!1});for(let p=0;p<i.length;p++){const m=i[p],I=i.length>1?`${p+1}.${m.value}`:m.value,L=ct(I);for(let P=0;P<L.length;P++)u.push({value:L[P],controlId:c,type:l.ElementType.CONTROL,control:R,controlComponent:l.ControlComponent.VALUE,color:"#000",hide:!1});i.length>1&&p<i.length-1&&u.push({value:_,controlId:c,type:l.ElementType.CONTROL,control:R,controlComponent:l.ControlComponent.VALUE,color:"#000",hide:!1})}u.push({value:"]",controlId:c,type:l.ElementType.CONTROL,control:R,controlComponent:l.ControlComponent.POSTFIX,color:"#1677FF",hide:!1});for(let p=0;p<u.length;p++)e.splice(a+p,0,u[p]);const{startIndex:h,endIndex:g}=this.range.getRange(),f=!0,T=g;this.draw.render({curIndex:T,isSetCursor:f})}font(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length)r.forEach(s=>{s.font=t}),this.draw.render({isSetCursor:!1});else{let s=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({font:t}),d?.value===_?d.font=t:s=!1,this.draw.render({isSubmitHistory:s,curIndex:a,isCompute:!1})}}size(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{minSize:r,maxSize:s,defaultSize:a}=this.options;if(t<r||t>s)return;let c={},d=[];const R=this.range.getTextLikeSelectionElementList();if(R?.length)d=R,c={isSetCursor:!1};else{const{endIndex:h}=this.range.getRange(),f=this.draw.getElementList()[h];this.range.setDefaultStyle({size:t}),f?.value===_?(d.push(f),c={curIndex:h}):this.draw.render({curIndex:h,isCompute:!1,isSubmitHistory:!1})}if(!d.length)return;let u=!1;d.forEach(h=>{!h.size&&t===a||h.size&&h.size===t||(h.size=t,u=!0)}),u&&this.draw.render(c)}sizeAdd(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,maxSize:r}=this.options,s=this.range.getTextLikeSelectionElementList();let a={},c=[];if(s?.length)c=s,a={isSetCursor:!1};else{const{endIndex:R}=this.range.getRange(),h=this.draw.getElementList()[R],f=this.range.getDefaultStyle()?.size||h.size||i;this.range.setDefaultStyle({size:f+2>r?r:f+2}),h?.value===_?(c.push(h),a={curIndex:R}):this.draw.render({curIndex:R,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(R=>{R.size||(R.size=i),!(R.size>=r)&&(R.size+2>r?R.size=r:R.size+=2,d=!0)}),d&&this.draw.render(a)}sizeMinus(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,minSize:r}=this.options,s=this.range.getTextLikeSelectionElementList();let a={},c=[];if(s?.length)c=s,a={isSetCursor:!1};else{const{endIndex:R}=this.range.getRange(),h=this.draw.getElementList()[R],f=this.range.getDefaultStyle()?.size||h.size||i;this.range.setDefaultStyle({size:f-2<r?r:f-2}),h?.value===_?(c.push(h),a={curIndex:R}):this.draw.render({curIndex:R,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(R=>{R.size||(R.size=i),!(R.size<=r)&&(R.size-2<r?R.size=r:R.size-=2,d=!0)}),d&&this.draw.render(a)}bold(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const r=i.findIndex(s=>!s.bold);i.forEach(s=>{s.bold=!!~r}),this.draw.render({isSetCursor:!1})}else{let r=!0;const{endIndex:s}=this.range.getRange(),c=this.draw.getElementList()[s];this.range.setDefaultStyle({bold:c.bold?!1:!this.range.getDefaultStyle()?.bold}),c?.value===_?c.bold=!c.bold:r=!1,this.draw.render({isSubmitHistory:r,curIndex:s,isCompute:!1})}}italic(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const r=i.findIndex(s=>!s.italic);i.forEach(s=>{s.italic=!!~r}),this.draw.render({isSetCursor:!1})}else{let r=!0;const{endIndex:s}=this.range.getRange(),c=this.draw.getElementList()[s];this.range.setDefaultStyle({italic:c.italic?!1:!this.range.getDefaultStyle()?.italic}),c?.value===_?c.italic=!c.italic:r=!1,this.draw.render({isSubmitHistory:r,curIndex:s,isCompute:!1})}}underline(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length){const s=r.some(a=>!a.underline||!t&&a.textDecoration||t&&!a.textDecoration||t&&a.textDecoration&&!Br(a.textDecoration,t));r.forEach(a=>{a.underline=s,s&&t?a.textDecoration=t:delete a.textDecoration}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let s=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({underline:d?.underline?!1:!this.range.getDefaultStyle()?.underline}),d?.value===_?d.underline=!d.underline:s=!1,this.draw.render({isSubmitHistory:s,curIndex:a,isCompute:!1})}}strikeout(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const r=i.findIndex(s=>!s.strikeout);i.forEach(s=>{s.strikeout=!!~r}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let r=!0;const{endIndex:s}=this.range.getRange(),c=this.draw.getElementList()[s];this.range.setDefaultStyle({strikeout:c.strikeout?!1:!this.range.getDefaultStyle()?.strikeout}),c?.value===_?c.strikeout=!c.strikeout:r=!1,this.draw.render({isSubmitHistory:r,curIndex:s,isCompute:!1})}}superscript(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const r=i.findIndex(s=>s.type===l.ElementType.SUPERSCRIPT);i.forEach(s=>{~r?s.type===l.ElementType.SUPERSCRIPT&&(s.type=l.ElementType.TEXT,delete s.actualSize):(!s.type||s.type===l.ElementType.TEXT||s.type===l.ElementType.SUBSCRIPT)&&(s.type=l.ElementType.SUPERSCRIPT)}),this.draw.render({isSetCursor:!1})}subscript(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const r=i.findIndex(s=>s.type===l.ElementType.SUBSCRIPT);i.forEach(s=>{~r?s.type===l.ElementType.SUBSCRIPT&&(s.type=l.ElementType.TEXT,delete s.actualSize):(!s.type||s.type===l.ElementType.TEXT||s.type===l.ElementType.SUPERSCRIPT)&&(s.type=l.ElementType.SUBSCRIPT)}),this.draw.render({isSetCursor:!1})}color(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length)r.forEach(s=>{t?s.color=t:delete s.color}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let s=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({color:t||void 0}),d?.value===_?t?d.color=t:delete d.color:s=!1,this.draw.render({isSubmitHistory:s,curIndex:a,isCompute:!1})}}highlight(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length)r.forEach(s=>{t?s.highlight=t:delete s.highlight}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let s=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({highlight:t||void 0}),d?.value===_?t?d.highlight=t:delete d.highlight:s=!1,this.draw.render({isSubmitHistory:s,curIndex:a,isCompute:!1})}}title(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.draw.getElementList(),s=n===i?this.range.getRangeParagraphElementList():r.slice(n+1,i+1);if(!s||!s.length)return;const a=lt(),c=this.draw.getOptions().title;s.forEach(u=>{!u.type&&u.value===_||(t?(u.level=t,u.titleId=a,vn(u)&&(u.size=c[xi[t]],u.bold=!0)):u.titleId&&(delete u.titleId,delete u.title,delete u.level,delete u.size,delete u.bold))});const d=n===i,R=d?i:n;this.draw.render({curIndex:R,isSetCursor:d})}list(t,e){this.draw.isReadonly()||this.draw.getListParticle().setList(t,e)}rowFlex(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(c=>{c.rowFlex=t});const s=n===i,a=s?i:n;this.draw.render({curIndex:a,isSetCursor:s})}vertical(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(c=>{c.vertical=t});const s=n===i,a=s?i:n;this.draw.render({curIndex:a,isSetCursor:s})}rowMargin(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(c=>{c.rowMargin=t});const s=n===i,a=s?i:n;this.draw.render({curIndex:a,isSetCursor:s})}insertTable(t,e){this.draw.isReadonly()||this.draw.isDisabled()||this.getIsRangeInTextField()||this.control.getActiveControl()||this.tableOperate.insertTable(t,e)}insertTableTopRow(){this.draw.isReadonly()||this.tableOperate.insertTableTopRow()}insertTableBottomRow(){this.draw.isReadonly()||this.tableOperate.insertTableBottomRow()}insertTableLeftCol(){this.draw.isReadonly()||this.tableOperate.insertTableLeftCol()}insertTableRightCol(){this.draw.isReadonly()||this.tableOperate.insertTableRightCol()}deleteTableRow(){this.draw.isReadonly()||this.tableOperate.deleteTableRow()}deleteTableCol(){this.draw.isReadonly()||this.tableOperate.deleteTableCol()}deleteTable(){this.draw.isReadonly()||this.tableOperate.deleteTable()}mergeTableCell(){this.draw.isReadonly()||this.tableOperate.mergeTableCell()}cancelMergeTableCell(){this.draw.isReadonly()||this.tableOperate.cancelMergeTableCell()}splitVerticalTableCell(){this.draw.isReadonly()||this.tableOperate.splitVerticalTableCell()}splitHorizontalTableCell(){this.draw.isReadonly()||this.tableOperate.splitHorizontalTableCell()}tableTdVerticalAlign(t){this.draw.isReadonly()||this.tableOperate.tableTdVerticalAlign(t)}tableBorderType(t){this.draw.isReadonly()||this.tableOperate.tableBorderType(t)}tableBorderColor(t){this.draw.isReadonly()||this.tableOperate.tableBorderColor(t)}tableTdBorderType(t){this.draw.isReadonly()||this.tableOperate.tableTdBorderType(t)}tableTdSlashType(t){this.draw.isReadonly()||this.tableOperate.tableTdSlashType(t)}tableTdBackgroundColor(t){this.draw.isReadonly()||this.tableOperate.tableTdBackgroundColor(t)}tableSelectAll(){this.tableOperate.tableSelectAll()}tableProperties(){this.draw.isReadonly()||this.tableOperate.tableProperties()}hyperlink(t){const{valueList:e,url:n,hyperlinkId:i}=t;if(!n||!e?.length||this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl())return;const{startIndex:a,endIndex:c}=this.range.getRange();!~a&&!~c||this.insertElementList([{type:l.ElementType.HYPERLINK,value:"",valueList:e,url:n,hyperlinkId:i||lt()}])}getHyperlinkRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList(),s=r[n];if(s.type!==l.ElementType.HYPERLINK)return null;let a=n;for(;a>0;){if(r[a].hyperlinkId!==s.hyperlinkId){t=a+1;break}a--}let c=n+1;for(;c<r.length;){if(r[c].hyperlinkId!==s.hyperlinkId){e=c-1;break}c++}return c===r.length&&(e=c-1),!~t||!~e?null:[t,e]}deleteHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.getHyperlinkRange();if(!e)return;const n=this.draw.getElementList(),[i,r]=e;this.draw.spliceElementList(n,i,r-i+1),this.draw.getHyperlinkParticle().clearHyperlinkPopup();const s=i-1;this.range.setRange(s,s),this.draw.render({curIndex:s})}cancelHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.getHyperlinkRange();if(!e)return;const n=this.draw.getElementList(),[i,r]=e;for(let a=i;a<=r;a++){const c=n[a];delete c.type,delete c.url,delete c.hyperlinkId,delete c.underline}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s,isCompute:!1})}editHyperlink(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.getHyperlinkRange();if(!n)return;const i=this.draw.getElementList(),[r,s]=n;for(let c=r;c<=s;c++){const d=i[c];d.url=t}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:a}=this.range.getRange();this.draw.render({curIndex:a,isCompute:!1})}separator(t,e){if(this.draw.isReadonly()||this.draw.isDisabled()||this.getIsRangeInTextField()||this.control.getActiveControl())return;const{startIndex:r,endIndex:s}=this.range.getRange();if(!~r&&!~s)return;const a=this.draw.getElementList();let c=-1;const d=a[s+1];if(d&&d.type===l.ElementType.SEPARATOR){if(d.dashArray&&d.dashArray.join()===t.join())return;c=s,Object.assign(d,{dashArray:t,...e})}else{const R={value:Ni,type:l.ElementType.SEPARATOR,dashArray:t,...e};Ut(a,[R],r,{editorOptions:this.options}),r!==0&&a[r].value===_?(this.draw.spliceElementList(a,r,1,[R]),c=r-1):(this.draw.spliceElementList(a,r+1,0,[R]),c=r)}this.range.setRange(c,c),this.draw.render({curIndex:c})}pageBreak(){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.insertElementList([{type:l.ElementType.PAGE_BREAK,value:Ni}])}addWatermark(t){if(this.draw.isReadonly())return;const n=this.draw.getOptions(),{color:i,size:r,opacity:s,font:a,gap:c}=Vo;n.watermark.data=t.data,n.watermark.type=t.type||l.WatermarkType.TEXT,t.width&&(n.watermark.width=t.width),t.height&&(n.watermark.height=t.height),n.watermark.color=t.color||i,n.watermark.opacity=t.opacity||s,n.watermark.size=t.size||r,n.watermark.font=t.font||a,n.watermark.repeat=!!t.repeat,t.numberType&&(n.watermark.numberType=t.numberType),n.watermark.gap=t.gap||c,this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1})}deleteWatermark(){if(this.draw.isReadonly())return;const e=this.draw.getOptions();e.watermark&&e.watermark.data&&(e.watermark={...Vo},this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1}))}image(t){if(this.draw.isReadonly()||this.draw.isDisabled())return null;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=t.id||lt();return this.insertElementList([{...t,id:r,type:l.ElementType.IMAGE}]),r}search(t,e){this.searchManager.setSearchKeyword(t,e),this.draw.render({isSubmitHistory:!1})}searchNavigatePre(){this.searchManager.searchNavigatePre()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}searchNavigateNext(){this.searchManager.searchNavigateNext()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}getSearchNavigateInfo(){return this.searchManager.getSearchNavigateInfo()}replace(t,e){this.draw.getSearch().replace(t,e)}async print(){const{scale:t,printPixelRatio:e,paperDirection:n,width:i,height:r}=this.options;t!==1&&this.draw.setPageScale(1);const s=await this.draw.getDataURL({pixelRatio:e,mode:l.EditorMode.PRINT});tg(s,{width:i,height:r,direction:n}),t!==1&&this.draw.setPageScale(t)}replaceImageElement(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==l.ElementType.IMAGE||(i.value=t,this.draw.render({isSetCursor:!1}))}saveAsImageElement(){const{startIndex:t}=this.range.getRange(),n=this.draw.getElementList()[t];!n||n.type!==l.ElementType.IMAGE||bi(n.value,`${n.id}.png`)}setImageCrop(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==l.ElementType.IMAGE||(i.imgCrop=t,this.draw.render({isSetCursor:!1,isCompute:!1}))}setImageCaption(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];i?.type===l.ElementType.IMAGE&&(i.imgCaption=t,this.draw.render({isSetCursor:!1}))}changeImageDisplay(t,e){if(t.imgDisplay===e)return;t.imgDisplay=e;const{startIndex:n,endIndex:i}=this.range.getRange();if(e===l.ImageDisplay.SURROUND||e===l.ImageDisplay.FLOAT_TOP||e===l.ImageDisplay.FLOAT_BOTTOM){const r=this.position.getPositionList(),{pageNo:s,coordinate:{leftTop:a}}=r[n];t.imgFloatPosition={pageNo:s,x:a[0],y:a[1]}}else delete t.imgFloatPosition;this.draw.getPreviewer().clearResizer(),this.draw.render({isSetCursor:!0,curIndex:i})}getImage(t){return this.draw.getDataURL(t)}getPageMode(){return this.options}getOptions(){return this.options}getValue(t){return this.draw.getValue(t)}getValueAsync(t){return this.draw.getWorkerManager().getValue(t)}getAreaValue(t){return this.draw.getArea().getAreaValue(t)}getHTML(){const t=this.options,e=this.draw.getHeaderElementList(),n=this.draw.getOriginalMainElementList(),i=this.draw.getFooterElementList();return{header:qe(e,t).innerHTML,main:qe(n,t).innerHTML,footer:qe(i,t).innerHTML}}getText(){const t=this.draw.getHeaderElementList(),e=this.draw.getOriginalMainElementList(),n=this.draw.getFooterElementList();return{header:en(t),main:en(e),footer:en(n)}}getWordCount(){return this.workerManager.getWordCount()}getCursorPosition(){return this.position.getCursorPosition()}getRemainingContentHeight(){if(!this.draw.getIsPagingMode())return 0;const t=this.draw.getPageRowList(),e=t.length-1,i=(t[e]||[]).reduce((c,d)=>c+d.height+(d.offsetY||0),0),r=this.draw.getHeight(),s=this.draw.getMainOuterHeight(),a=r-(s+i);return a>0?a:0}computeElementListHeight(t){if(!t.length)return 0;const e=this.draw.getInnerWidth();if(e<=0)return 0;const n=at(t);Vt(n,{isHandleFirstElement:!1,editorOptions:this.options});const i=wo(n);return this.draw.computeRowList({innerWidth:e,elementList:n,surroundElementList:i}).reduce((s,a)=>s+a.height+(a.offsetY||0),0)}getRange(){return at(this.range.getRange())}getRangeText(){return this.range.toString()}getRangeContext(){const t=this.range.getRange(),{startIndex:e,endIndex:n}=t;if(!~e&&!~n)return null;const i=e===n,r=this.range.toString(),s=Pt(this.range.getSelectionElementList()||[]),a=this.draw.getElementList(),c=De(a[i?e:e+1],{extraPickAttrs:["id","controlComponent"]}),d=De(a[n],{extraPickAttrs:["id","controlComponent"]}),R=this.draw.getRowList(),u=this.position.getPositionList(),h=u[e],g=u[n],f=h?.pageNo,T=g?.pageNo,p=h?.rowIndex,m=g?.rowIndex,I=R[p],L=R[m];let P=0,O=0;this.draw.getCursor().getHitLineStartIndex()||(P=I?.elementList[0]?.value===_?h?.index-I?.startIndex:h?.index-I?.startIndex+1),h===g?O=P:O=L.elementList[0]?.value===_?g.index-L.startIndex:g.index-L.startIndex+1;const S=[],F=this.draw.getOriginalHeight(),N=this.draw.getOriginalPageGap(),V=this.position.getSelectionPositionList();if(V){let U=null,Q=0,G=null;for(let H=0;H<V.length;H++){const{rowNo:j,pageNo:st,coordinate:{leftTop:it,rightTop:nt},lineHeight:et}=V[H];U===null||U!==j?(G&&S.push(G),G={x:it[0],y:it[1]+st*(F+N),width:nt[0]-it[0],height:et},U=j,Q=it[0]):G.width=nt[0]-Q,H===V.length-1&&G&&S.push(G)}}else{const Q=this.position.getPositionList()[n],{coordinate:{rightTop:G},pageNo:H,lineHeight:j}=Q;S.push({x:G[0],y:G[1]+H*(F+N),width:0,height:j})}const Y=this.draw.getZone().getZone(),{isTable:X,trIndex:b,tdIndex:E,index:C}=this.position.getPositionContext();let M=null;if(X){const Q=this.draw.getOriginalElementList()[C]||null;Q&&(M=Pt([Q])[0])}let y=null,W=null,D=e-1;for(;D>0;){const U=a[D],Q=a[D-1];if(U.titleId&&U.titleId!==Q?.titleId){y=U.titleId,W=u[D].pageNo;break}D--}return at({isCollapsed:i,startElement:c,endElement:d,startPageNo:f,endPageNo:T,startRowNo:p,endRowNo:m,startColNo:P,endColNo:O,rangeRects:S,zone:Y,isTable:X,trIndex:b??null,tdIndex:E??null,tableElement:M,selectionText:r,selectionElementList:s,titleId:y,titleStartPageNo:W})}getRangeRow(){const t=this.range.getRangeRowElementList();return t?Pt(t):null}getRangeParagraph(){const t=this.range.getRangeParagraphElementList();return t?Pt(t):null}getKeywordRangeList(t){return this.range.getKeywordRangeList(t)}getKeywordContext(t){const e=this.getKeywordRangeList(t);if(!e.length)return null;const n=[],i=this.position.getOriginalMainPositionList(),r=this.draw.getOriginalMainElementList();for(let s=0;s<e.length;s++){const a=e[s],{startIndex:c,endIndex:d,tableId:R,startTrIndex:u,startTdIndex:h}=a;let g=i;if(a.tableId){const p=r.find(m=>m.id===R);p&&(g=p.trList?.[u]?.tdList?.[h]?.positionList||[])}const f=at(g[c]),T=at(g[d]);n.push({range:a,startPosition:f,endPosition:T})}return n}pageMode(t){this.draw.setPageMode(t)}pageScale(t){t!==this.options.scale&&this.draw.setPageScale(t)}pageScaleRecovery(){const{scale:t}=this.options;t!==1&&this.draw.setPageScale(1)}pageScaleMinus(){const{scale:t}=this.options,e=t*10-1;e>=5&&this.draw.setPageScale(e/10)}pageScaleAdd(){const{scale:t}=this.options,e=t*10+1;e<=30&&this.draw.setPageScale(e/10)}paperSize(t,e){this.draw.setPaperSize(t,e)}paperDirection(t){this.draw.setPaperDirection(t)}getPaperMargin(){return this.options.margins}setPaperMargin(t){return this.draw.setPaperMargin(t)}setMainBadge(t){this.draw.getBadge().setMainBadge(t),this.draw.render({isCompute:!1,isSubmitHistory:!1})}setAreaBadge(t){this.draw.getBadge().setAreaBadgeMap(t),this.draw.render({isCompute:!1,isSubmitHistory:!1})}insertElementList(t,e={}){if(!t.length||this.draw.isReadonly()||this.draw.isDisabled())return;const{isReplace:i=!0,ignoreContextKeys:r}=e;i||this.range.shrinkRange(),console.log(t,"payload");const s=at(t),{startIndex:a}=this.range.getRange(),c=this.draw.getElementList();Ut(c,s,a,{ignoreContextKeys:r,isBreakWhenWrap:!0,editorOptions:this.options}),console.log(s,"cloneElementList"),this.draw.insertElementList(s,e),setTimeout(()=>{console.log(c,"elementList")},500)}appendElementList(t,e){!t.length||this.draw.isReadonly()||this.draw.appendElementList(at(t),e)}updateElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;const i=[];function r(a,c=!1){let d=0;for(;d<a.length;){const R=a[d];if(d++,R.type===l.ElementType.TABLE){const u=R.trList;for(let h=0;h<u.length;h++){const g=u[h];for(let f=0;f<g.tdList.length;f++){const T=g.tdList[f];r(T.value,c)}}}R.type===l.ElementType.CONTROL&&R.control?.value&&r(R.control.value,!0),(e&&R.id===e||n&&R.conceptId===n)&&i.push({elementList:a,index:d-1,isInsideControl:c})}}const s=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of s)r(a);if(i.length){for(let a=0;a<i.length;a++){const{elementList:c,index:d,isInsideControl:R}=i[a],u=c[d],h=u.controlId&&u.controlComponent===l.ControlComponent.VALUE;if(R||h){if(Object.assign(u,t.properties),u.id){const g=xl(u.id);g&&Object.assign(g,t.properties)}}else{const g=Pt([{...u,...t.properties}],{extraPickAttrs:["id"]});g.length>0&&g[0]?(Ye(Ke,u,g[0]),Vt(g,{isHandleFirstElement:!1,editorOptions:this.options}),c[d]=g[0]):Object.assign(u,t.properties)}}this.draw.render({isSetCursor:!1})}}deleteElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;let i=!1;function r(a){let c=0;for(;c<a.length;){const d=a[c];if(d.type===l.ElementType.TABLE){const R=d.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];r(f.value)}}}d.type===l.ElementType.CONTROL&&d.control?.value&&r(d.control.value),(e&&d.id===e||n&&d.conceptId===n)&&(i=!0,a.splice(c,1),c--),c++}}const s=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of s)r(a);i&&this.draw.render({isSetCursor:!1})}getElementById(t){const{id:e,conceptId:n}=t,i=[];if(!e&&!n)return i;const r=a=>{let c=0;for(;c<a.length;){const d=a[c];if(c++,d.type===l.ElementType.TABLE){const R=d.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];r(f.value)}}}e&&d.id!==e||n&&d.conceptId!==n||i.push(d)}},s=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const a of s)r(a);return Pt(i,{extraPickAttrs:["id"]})}setValue(t,e){this.draw.setValue(t,e)}removeControl(t){if(t?.id||t?.conceptId){const{id:e,conceptId:n}=t;let i=!1;const r=a=>{let c=a.length-1;for(;c>=0;){const d=a[c];if(d.type===l.ElementType.TABLE){const R=d.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];r(f.value)}}}c--,!(!d.control||e&&d.controlId!==e||n&&d.control.conceptId!==n)&&(i=!0,a.splice(c+1,1))}},s=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const a of s)r(a);i&&this.draw.render({isSetCursor:!1})}else{const{startIndex:e,endIndex:n}=this.range.getRange();if(e!==n||!this.draw.getElementList()[e].controlId)return;const a=this.draw.getControl().removeControl(e);if(a===null)return;this.range.setRange(a,a),this.draw.render({curIndex:a})}}translate(t){return this.i18n.t(t)}setLocale(t){this.i18n.setLocale(t)}getLocale(){return this.i18n.getLocale()}getCatalog(){return this.workerManager.getCatalog()}locationCatalog(t){const e=this.draw.getOriginalElementList();function n(m,I){for(let L=0;L<m.length;L++){const P=m[L];if(P.type===l.ElementType.TABLE){const O=P.trList;for(let S=0;S<O.length;S++){const F=O[S];for(let N=0;N<F.tdList.length;N++){const V=F.tdList[N],Y=n(V.value,I);if(Y)return{...Y,isTable:!0,index:L,trIndex:S,tdIndex:N,tdId:V.id,trId:F.id,tableId:P.id}}}}if(P.titleId===I){let O=L;for(;O<m.length;){if(m[O+1]?.titleId!==I)return{isTable:!1,startIndex:O,endIndex:O};O++}}}return null}const i=n(e,t);if(!i)return;const{isTable:r,index:s,startTdIndex:a,endTdIndex:c,startTrIndex:d,endTrIndex:R,trIndex:u,tdIndex:h,tdId:g,trId:f,tableId:T,endIndex:p}=i;this.position.setPositionContext({isTable:r,index:s,trIndex:u,tdIndex:h,tdId:g,trId:f,tableId:T}),this.range.setRange(p,p,T,a,c,d,R),this.draw.render({curIndex:p,isCompute:!1,isSubmitHistory:!1})}wordTool(){const t=this.draw.getMainElementList();let e=!1;for(let n=0;n<t.length;n++)if(t[n].value===_)for(;n+1<t.length;){const r=t[n+1];if(r.value!==_&&r.value!==fo)break;t.splice(n+1,1),e=!0}if(e)this.draw.render({isSetCursor:!1});else{const n=this.range.getIsCollapsed();this.draw.getCursor().drawCursor({isShow:n})}}setHTML(t){const{header:e,main:n,footer:i}=t,r=this.draw.getOriginalInnerWidth(),s=a=>a!==void 0?tn(a,{innerWidth:r}):void 0;this.setValue({header:s(e),main:s(n),footer:s(i)})}setGroup(){return this.draw.isReadonly()?null:this.draw.getGroup().setGroup()}deleteGroup(t){this.draw.isReadonly()||this.draw.getGroup().deleteGroup(t)}getGroupIds(){return this.draw.getWorkerManager().getGroupIds()}locationGroup(t){const e=this.draw.getOriginalMainElementList(),n=this.draw.getGroup().getContextByGroupId(e,t);if(!n)return;const{isTable:i,index:r,trIndex:s,tdIndex:a,tdId:c,trId:d,tableId:R,endIndex:u}=n;this.position.setPositionContext({isTable:i,index:r,trIndex:s,tdIndex:a,tdId:c,trId:d,tableId:R}),this.range.setRange(u,u),this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}setZone(t){this.draw.getZone().setZone(t)}getControlValue(t){return this.draw.getControl().getValueById(t)}setControlValue(t){this.draw.getControl().setValueListById([t])}setControlValueList(t){this.draw.getControl().setValueListById(t)}setControlExtension(t){this.draw.getControl().setExtensionListById([t])}setControlExtensionList(t){this.draw.getControl().setExtensionListById(t)}setControlProperties(t){this.draw.getControl().setPropertiesListById([t])}setControlPropertiesList(t){this.draw.getControl().setPropertiesListById(t)}setControlHighlight(t){this.draw.getControl().setHighlightList(t),this.draw.render({isSubmitHistory:!1})}updateOptions(t){const e=Yo(t);Object.entries(e).forEach(([n,i])=>{Reflect.set(this.options,n,i)}),this.forceUpdate()}setFormModeTrace(t){Object.assign(this.options.modeRule.form,t),this.forceUpdate()}getControlList(){return this.draw.getControl().getList()}locationControl(t,e){function n(r,s){let a=0;for(;a<r.length;){const c=r[a];if(a++,c.type===l.ElementType.TABLE){const R=c.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g],T=n(f.value,s);if(T)return{...T,positionContext:{isTable:!0,index:a-1,trIndex:u,tdIndex:g,tdId:c.tdId,trId:c.trId,tableId:c.tableId}}}}}if(c?.controlId!==t)continue;let d=a-1;if(e?.position===l.LocationPosition.OUTER_AFTER){if(!(c.controlComponent===l.ControlComponent.POSTFIX&&r[a+1]?.controlComponent!==l.ControlComponent.POST_TEXT))continue}else if(e?.position===l.LocationPosition.OUTER_BEFORE)d-=1;else if(e?.position===l.LocationPosition.AFTER){if(d-=1,c.controlComponent!==l.ControlComponent.PLACEHOLDER&&c.controlComponent!==l.ControlComponent.POSTFIX&&c.controlComponent!==l.ControlComponent.POST_TEXT)continue}else if(c.controlComponent!==l.ControlComponent.PREFIX&&c.controlComponent!==l.ControlComponent.PRE_TEXT||r[a]?.controlComponent===l.ControlComponent.PREFIX||r[a]?.controlComponent===l.ControlComponent.PRE_TEXT)continue;return{zone:s,range:{startIndex:d,endIndex:d},positionContext:{isTable:!1}}}return null}const i=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const r of i){const s=n(r.elementList,r.zone);if(s){this.setZone(s.zone),this.position.setPositionContext(s.positionContext),this.range.replaceRange(s.range),this.draw.render({curIndex:s.range.startIndex,isCompute:!1,isSubmitHistory:!1});break}}}insertTextField(t){if(this.draw.isReadonly()||this.draw.isDisabled()||!t)return;const n=at(t),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList(),s=je(r,i);if(!s)return;const a=[...Be,...Bt,...mn,...Ke];Ye(a,s,n),this.draw.insertElementTextField([n])}insertControl(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=at(t),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList(),s=je(r,i);if(!s)return;const a=r[i],c=a?.controlComponent===l.ControlComponent.POSTFIX||a?.controlComponent===l.ControlComponent.POSTTEXTFIX;let d=!1;if(a?.controlId&&!c)for(let u=i;u>=0;u--){const h=r[u];if(h.controlId!==a.controlId)break;if(h.controlComponent===l.ControlComponent.PRETEXTFIX||h.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){h.control?.type===l.ControlType.TEXTFIELD&&(d=!0);break}}if(!d&&!c){const u=r[i-1];if(u?.controlId)for(let h=i-1;h>=0;h--){const g=r[h];if(g.controlId!==u.controlId)break;if(g.controlComponent===l.ControlComponent.PRETEXTFIX||g.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){g.control?.type===l.ControlType.TEXTFIELD&&(d=!0);break}}}if(d&&t.control?.type===l.ControlType.TEXTFIELD)return;const R=[...Be,...Bt,...mn,...Ke];Ye(R,s,n),this.draw.insertElementList([n])}jumpControl(t){this.draw.getControl().initNextControl({direction:t?.direction})}getContainer(){return this.draw.getContainer()}getTitleValue(t){const{conceptId:e}=t,n=[],i=(s,a)=>{let c=0;for(;c<s.length;){const d=s[c];if(c++,d.type===l.ElementType.TABLE){const h=d.trList;for(let g=0;g<h.length;g++){const f=h[g];for(let T=0;T<f.tdList.length;T++){const p=f.tdList[T];i(p.value,a)}}}if(d?.title?.conceptId!==e)continue;const R=[];let u=c;for(;u<s.length;){const h=s[u];if(u++,d.titleId!==h.titleId){if(h.level&&bo[h.level]<=bo[d.level])break;R.push(h)}}n.push({...d.title,value:en(R),elementList:Pt(R),zone:a}),c=u}},r=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:s,elementList:a}of r)i(a,s);return n}getPositionContextByEvent(t,e={}){const n=t.target?.dataset.index;if(!n)return null;const{isMustDirectHit:i=!0}=e,r=Number(n),s=this.position.getPositionByXY({x:t.offsetX,y:t.offsetY,pageNo:r}),{isDirectHit:a,isTable:c,index:d,trIndex:R,tdIndex:u,tdValueIndex:h,zone:g}=s;if(i&&!a||g&&g!==this.zone.getZone())return null;let f=null,T=null;const p=this.draw.getOriginalElementList();let m=null;const I=this.position.getOriginalPositionList();if(c){const P=p[d].trList?.[R].tdList[u];T=P?.value[h]||null,m=P?.positionList?.[h]||null,f={element:p[d],trIndex:R,tdIndex:u}}else T=p[d]||null,m=I[d]||null;let L=null;if(m){const{pageNo:P,coordinate:{leftTop:O,rightTop:S},lineHeight:F}=m,N=this.draw.getOriginalHeight(),V=this.draw.getOriginalPageGap();L={x:O[0],y:O[1]+P*(N+V),width:S[0]-O[0],height:F}}return{pageNo:r,element:T,rangeRect:L,tableInfo:f}}insertTitle(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=at(t),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList(),s=je(r,i);if(!s)return;const a=[...Be,...Bt,...mn,...Ke];n.valueList?.forEach(c=>{Ye(a,s,c)}),this.draw.insertElementList([n])}focus(t){const{position:e=l.LocationPosition.AFTER,isMoveCursorToVisible:n=!0,rowNo:i,range:r}=t||{};let s=-1;if(r)this.range.replaceRange(r),s=e===l.LocationPosition.BEFORE?r.startIndex:r.endIndex;else if(Mo(i)){const c=this.draw.getOriginalRowList();if(s=e===l.LocationPosition.BEFORE?c[i]?.startIndex:c[i+1]?.startIndex-1,!Mo(s))return;this.range.setRange(s,s)}else s=e===l.LocationPosition.BEFORE?0:this.draw.getOriginalMainElementList().length-1,this.range.setRange(s,s);const a={isCompute:!1,isSetCursor:!1,isSubmitHistory:!1};n&&~s&&this.range.getIsCollapsed()&&(a.curIndex=s,a.isSetCursor=!0),this.draw.render(a)}insertArea(t){return this.draw.getArea().insertArea(t)}setAreaValue(t){return this.draw.getArea().setAreaValue(t)}setAreaProperties(t){this.draw.getArea().setAreaProperties(t)}locationArea(t,e){if(e?.isAppendLastLineBreak&&e?.position===l.LocationPosition.OUTER_AFTER){const r=this.draw.getOriginalMainElementList();r[r.length-1].areaId===t&&this.draw.appendElementList([{value:_}],{isSubmitHistory:!1})}const n=this.draw.getArea().getContextByAreaId(t,e);if(!n)return;const{range:{endIndex:i}}=n;this.position.setPositionContext({isTable:!1}),this.range.setRange(i,i),this.draw.render({curIndex:i,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1})}clearGraffiti(){this.draw.getGraffiti().clear(),this.draw.isGraffitiMode()&&this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}getMacroValue(t){const{id:e,dictCode:n,label:i,areaId:r}=t,s=[],a=(d,R)=>{for(const u of d){if(u.type===l.ElementType.TABLE){const g=u.trList;for(const f of g)for(const T of f.tdList)a(T.value,R);continue}if(u.type!==l.ElementType.MACRO&&u.type!==l.ElementType.CUSTOM_MACRO&&u.type!==l.ElementType.REUSABLE_ITEM||e&&u.id!==e||n&&u.dictCode!==n||i&&u.label!==i||r&&u.areaId!==r)continue;const h={id:u.id,type:u.type,label:u.label,dictCode:u.dictCode,zone:R};u.type===l.ElementType.MACRO?h.value=u.value:u.type===l.ElementType.CUSTOM_MACRO?(h.macroConfig=u.macroConfig,h.value=u.macroConfig?.value):u.type===l.ElementType.REUSABLE_ITEM&&(h.reusableItemConfig=u.reusableItemConfig,h.value=u.reusableItemConfig?.value),s.push(h)}},c=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:d,elementList:R}of c)a(R,d);return s}getMacroList(){const t=[],e=i=>{for(const r of i){if(r.type===l.ElementType.TABLE){const s=r.trList;for(const a of s)for(const c of a.tdList)e(c.value);continue}(r.type===l.ElementType.MACRO||r.type===l.ElementType.CUSTOM_MACRO||r.type===l.ElementType.REUSABLE_ITEM)&&t.push(r)}},n=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const i of n)e(i);return t}setMacroValue(t){const{id:e,dictCode:n,label:i,areaId:r,value:s,code:a,isSubmitHistory:c=!0}=t;let d=!1;const R=h=>{for(let g=0;g<h.length;g++){const f=h[g];if(f.type===l.ElementType.TABLE){const T=f.trList;for(const p of T)for(const m of p.tdList)R(m.value);continue}f.type!==l.ElementType.MACRO&&f.type!==l.ElementType.CUSTOM_MACRO&&f.type!==l.ElementType.REUSABLE_ITEM||e&&f.id!==e||n&&f.dictCode!==n||i&&f.label!==i||r&&f.areaId!==r||(d=!0,f.type===l.ElementType.MACRO?f.value=s:f.type===l.ElementType.CUSTOM_MACRO?f.macroConfig?(f.macroConfig.value=s,a!==void 0&&(f.macroConfig.code=a)):f.macroConfig={type:"text",value:s}:f.type===l.ElementType.REUSABLE_ITEM&&(f.reusableItemConfig?f.reusableItemConfig.value=s:f.reusableItemConfig={value:s}))}},u=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const h of u)R(h);d&&this.draw.render({isSubmitHistory:c,isSetCursor:!1})}setMacroValueList(t){if(!t.length)return;let e=!1,n=!1;const i=s=>{for(let a=0;a<s.length;a++){const c=s[a];if(c.type===l.ElementType.TABLE){const g=c.trList;for(const f of g)for(const T of f.tdList)i(T.value);continue}if(c.type!==l.ElementType.MACRO&&c.type!==l.ElementType.CUSTOM_MACRO&&c.type!==l.ElementType.REUSABLE_ITEM)continue;const d=t.find(g=>g.id&&c.id===g.id||g.dictCode&&c.dictCode===g.dictCode||g.label&&c.label===g.label||g.areaId&&c.areaId===g.areaId);if(!d)continue;const{value:R,code:u,isSubmitHistory:h=!0}=d;e=!0,h&&(n=!0),c.type===l.ElementType.MACRO?c.value=R:c.type===l.ElementType.CUSTOM_MACRO?c.macroConfig?(c.macroConfig.value=R,u!==void 0&&(c.macroConfig.code=u)):c.macroConfig={type:"text",value:R}:c.type===l.ElementType.REUSABLE_ITEM&&(c.reusableItemConfig?c.reusableItemConfig.value=R:c.reusableItemConfig={value:R})}},r=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const s of r)i(s);e&&(n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1}))}updateMacroProperties(t){const{id:e,dictCode:n,label:i,areaId:r,properties:s,isSubmitHistory:a=!0}=t;let c=!1;const d=u=>{for(let h=0;h<u.length;h++){const g=u[h];if(g.type===l.ElementType.TABLE){const f=g.trList;for(const T of f)for(const p of T.tdList)d(p.value);continue}g.type!==l.ElementType.MACRO&&g.type!==l.ElementType.CUSTOM_MACRO&&g.type!==l.ElementType.REUSABLE_ITEM||e&&g.id!==e||n&&g.dictCode!==n||i&&g.label!==i||r&&g.areaId!==r||(c=!0,Object.assign(g,s))}},R=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const u of R)d(u);c&&this.draw.render({isSubmitHistory:a,isSetCursor:!1})}locationMacro(t){const{id:e,dictCode:n,label:i,areaId:r}=t,s=(c,d)=>{for(let R=0;R<c.length;R++){const u=c[R];if(u.type===l.ElementType.TABLE){const h=u.trList;for(let g=0;g<h.length;g++){const f=h[g];for(let T=0;T<f.tdList.length;T++){const p=f.tdList[T],m=s(p.value,d);if(m)return{...m,isTable:!0,index:R,trIndex:g,tdIndex:T,tableId:u.tableId,trId:f.id,tdId:p.id}}}}if(!(u.type!==l.ElementType.MACRO&&u.type!==l.ElementType.CUSTOM_MACRO&&u.type!==l.ElementType.REUSABLE_ITEM)&&!(e&&u.id!==e)&&!(n&&u.dictCode!==n)&&!(i&&u.label!==i)&&!(r&&u.areaId!==r))return{zone:d,index:R}}return null},a=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:c,elementList:d}of a){const R=s(d,c);if(R){this.setZone(R.zone),this.position.setPositionContext({isTable:R.isTable||!1,index:R.index,trIndex:R.trIndex,tdIndex:R.tdIndex,tableId:R.tableId,trId:R.trId,tdId:R.tdId}),this.range.replaceRange({startIndex:R.index,endIndex:R.index}),this.draw.render({curIndex:R.index,isCompute:!1,isSubmitHistory:!1});break}}}insertSubTemplate(t){const{label:e,templateId:n,isSubmitHistory:i=!0}=t,r={id:lt(),value:e,type:l.ElementType.SUB_TEMPLATE,label:e,templateId:n,subTemplateExpanded:!1};this.insertElementList([r],{isSubmitHistory:i})}expandSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,r=this.draw.getOriginalMainElementList();for(let s=0;s<r.length;s++){const a=r[s];if(a.type===l.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){a.subTemplateExpanded=!0,a.hide=!0;const c=at(n);Vt(c,{isHandleFirstElement:!1,editorOptions:this.options}),r.splice(s+1,0,...c),this.draw.render({isSubmitHistory:i,isCompute:!0});return}}}collapseSubTemplate(t){const{id:e,isSubmitHistory:n=!0}=t,i=this.draw.getOriginalMainElementList();for(let r=0;r<i.length;r++){const s=i[r];if(s.type===l.ElementType.SUB_TEMPLATE&&(!e||s.id===e)){s.subTemplateExpanded=!1,s.hide=!1;let a=r+1;for(;a<i.length&&i[a].type!==l.ElementType.SUB_TEMPLATE;)a++;a>r+1&&i.splice(r+1,a-r-1),this.draw.render({isSubmitHistory:n,isCompute:!0});return}}}toggleSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,r=this.draw.getOriginalMainElementList();for(let s=0;s<r.length;s++){const a=r[s];if(a.type===l.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){if(a.subTemplateExpanded)this.collapseSubTemplate({id:e,isSubmitHistory:i});else{if(!n){console.warn("子模板内容为空,无法展开");return}this.expandSubTemplate({id:e,content:n,isSubmitHistory:i})}return}}}}class sg{rangeStyleChange;visiblePageNoListChange;intersectionPageNoChange;pageSizeChange;pageScaleChange;saved;contentChange;controlChange;controlContentChange;pageModeChange;zoneChange;constructor(){this.rangeStyleChange=null,this.visiblePageNoListChange=null,this.intersectionPageNoChange=null,this.pageSizeChange=null,this.pageScaleChange=null,this.saved=null,this.contentChange=null,this.controlChange=null,this.controlContentChange=null,this.pageModeChange=null,this.zoneChange=null}}class rg{contextMenu;contextMenuList;getContextMenuList;shortcutList;langMap;constructor(t){const{contextMenu:e,shortcut:n,i18n:i}=t;this.contextMenu=e,this.contextMenuList=e.registerContextMenuList.bind(e),this.getContextMenuList=e.getContextMenuList.bind(e),this.shortcutList=n.registerShortcutList.bind(n),this.langMap=i.registerLangMap.bind(i)}disposeContextMenu(){this.contextMenu.dispose()}}const Fr={SELECTED_TEXT:"%s"},fn={GLOBAL:{CUT:"globalCut",COPY:"globalCopy",PASTE:"globalPaste",SELECT_ALL:"globalSelectAll",PRINT:"globalPrint"},CONTROL:{DELETE:"controlDelete",EDIT_ATTRIBUTE:"controlEditAttribute",COPY:"controlCopy",PASTE:"controlPaste"},HYPERLINK:{DELETE:"hyperlinkDelete",CANCEL:"hyperlinkCancel",EDIT:"hyperlinkEdit"},IMAGE:{CHANGE:"imageChange",SAVE_AS:"imageSaveAs",TEXT_WRAP:"imageTextWrap",TEXT_WRAP_EMBED:"imageTextWrapEmbed",TEXT_WRAP_UP_DOWN:"imageTextWrapUpDown",TEXT_WRAP_SURROUND:"imageTextWrapSurround",TEXT_WRAP_FLOAT_TOP:"imageTextWrapFloatTop",TEXT_WRAP_FLOAT_BOTTOM:"imageTextWrapFloatBottom"},TABLE:{BORDER:"border",BORDER_ALL:"tableBorderAll",BORDER_EMPTY:"tableBorderEmpty",BORDER_DASH:"tableBorderDash",BORDER_EXTERNAL:"tableBorderExternal",BORDER_INTERNAL:"tableBorderInternal",BORDER_TD:"tableBorderTd",BORDER_TD_TOP:"tableBorderTdTop",BORDER_TD_RIGHT:"tableBorderTdRight",BORDER_TD_BOTTOM:"tableBorderTdBottom",BORDER_TD_LEFT:"tableBorderTdLeft",BORDER_TD_FORWARD:"tableBorderTdForward",BORDER_TD_BACK:"tableBorderTdBack",VERTICAL_ALIGN:"tableVerticalAlign",VERTICAL_ALIGN_TOP:"tableVerticalAlignTop",VERTICAL_ALIGN_MIDDLE:"tableVerticalAlignMiddle",VERTICAL_ALIGN_BOTTOM:"tableVerticalAlignBottom",INSERT_ROW_COL:"tableInsertRowCol",INSERT_TOP_ROW:"tableInsertTopRow",INSERT_BOTTOM_ROW:"tableInsertBottomRow",INSERT_LEFT_COL:"tableInsertLeftCol",INSERT_RIGHT_COL:"tableInsertRightCol",DELETE_ROW_COL:"tableDeleteRowCol",DELETE_ROW:"tableDeleteRow",DELETE_COL:"tableDeleteCol",DELETE_TABLE:"tableDeleteTable",MERGE_CELL:"tableMergeCell",CANCEL_MERGE_CELL:"tableCancelMergeCell",TABLE_PROPERTIES:"tableProperties"}},{CONTROL:{DELETE:lg,EDIT_ATTRIBUTE:ag,COPY:cg,PASTE:dg}}=fn;function yr(o,t){if(t!==l.EditorMode.EDIT)return!1;const n=o?.control?.type,i=o?.controlComponent,r=n===l.ControlType.TEXT||n===l.ControlType.TEXTFIELD||n===l.ControlType.NUMBER||n===l.ControlType.SELECT||n===l.ControlType.DATE||n===l.ControlType.CHECKBOX||n===l.ControlType.RADIO||n===l.ControlType.BUTTON,s=i==="prefix"||i==="preText"||i==="preTextFix"||i==="textFixLabel"||n===l.ControlType.BUTTON&&i==="value";return r&&s}const Rg=[{key:cg,name:"复制控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&yr(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeCopyControl(e)}},{key:dg,name:"粘贴控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.editorTextFocus&&o.options.mode===l.EditorMode.EDIT&&ea(),callback:o=>{o.executePasteControl()}},{key:lg,i18nPath:"contextmenu.control.delete",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&o.options.mode!==l.EditorMode.FORM,callback:o=>{o.executeRemoveControl()}},{key:ag,i18nPath:"contextmenu.control.editAttribute",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&yr(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeTriggerControlEditAttribute(e)}}],{GLOBAL:{CUT:ug,COPY:hg,PASTE:gg,SELECT_ALL:fg,PRINT:Tg}}=fn,mg=[{key:ug,i18nPath:"contextmenu.global.cut",shortCut:`${ve?"⌘":"Ctrl"} + X`,when:o=>!o.isReadonly,callback:o=>{o.executeCut()}},{key:hg,i18nPath:"contextmenu.global.copy",shortCut:`${ve?"⌘":"Ctrl"} + C`,when:o=>o.editorHasSelection||o.isCrossRowCol,callback:o=>{o.executeCopy()}},{key:gg,i18nPath:"contextmenu.global.paste",shortCut:`${ve?"⌘":"Ctrl"} + V`,when:o=>!o.isReadonly&&o.editorTextFocus,callback:o=>{o.executePaste()}},{key:fg,i18nPath:"contextmenu.global.selectAll",shortCut:`${ve?"⌘":"Ctrl"} + A`,when:o=>o.editorTextFocus,callback:o=>{o.executeSelectAll()}},{isDivider:!0},{key:Tg,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:o=>{o.executePrint()}}],{HYPERLINK:{DELETE:pg,CANCEL:Lg,EDIT:Ig}}=fn,Pg=[{key:pg,i18nPath:"contextmenu.hyperlink.delete",when:o=>!o.isReadonly&&o.startElement?.type===l.ElementType.HYPERLINK,callback:o=>{o.executeDeleteHyperlink()}},{key:Lg,i18nPath:"contextmenu.hyperlink.cancel",when:o=>!o.isReadonly&&o.startElement?.type===l.ElementType.HYPERLINK,callback:o=>{o.executeCancelHyperlink()}},{key:Ig,i18nPath:"contextmenu.hyperlink.edit",when:o=>!o.isReadonly&&o.startElement?.type===l.ElementType.HYPERLINK,callback:(o,t)=>{const e=window.prompt(o.executeTranslate("contextmenu.hyperlink.edit"),t.startElement?.url);e&&o.executeEditHyperlink(e)}}],{IMAGE:{CHANGE:Mg,SAVE_AS:Og,TEXT_WRAP:Cg,TEXT_WRAP_EMBED:Sg,TEXT_WRAP_UP_DOWN:Eg,TEXT_WRAP_SURROUND:Xg,TEXT_WRAP_FLOAT_TOP:Ng,TEXT_WRAP_FLOAT_BOTTOM:Fg}}=fn,yg=[{key:Mg,i18nPath:"contextmenu.image.change",icon:"image-change",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===l.ElementType.IMAGE,callback:o=>{const t=document.createElement("input");t.type="file",t.accept=".png, .jpg, .jpeg",t.onchange=()=>{const e=t.files[0],n=new FileReader;n.readAsDataURL(e),n.onload=()=>{const i=n.result;o.executeReplaceImageElement(i)}},t.click()}},{key:Og,i18nPath:"contextmenu.image.saveAs",icon:"image",when:o=>!o.editorHasSelection&&o.startElement?.type===l.ElementType.IMAGE,callback:o=>{o.executeSaveAsImageElement()}},{key:Cg,i18nPath:"contextmenu.image.textWrap",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===l.ElementType.IMAGE,childMenus:[{key:Sg,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.BLOCK)}},{key:Eg,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.INLINE)}},{key:Xg,i18nPath:"contextmenu.image.textWrapType.surround",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.SURROUND)}},{key:Ng,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.FLOAT_TOP)}},{key:Fg,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:Wg,BORDER_ALL:bg,BORDER_EMPTY:Vg,BORDER_DASH:Yg,BORDER_EXTERNAL:Dg,BORDER_INTERNAL:Ug,BORDER_TD:wg,BORDER_TD_TOP:Zg,BORDER_TD_LEFT:Qg,BORDER_TD_BOTTOM:vg,BORDER_TD_RIGHT:Kg,BORDER_TD_BACK:Hg,BORDER_TD_FORWARD:_g,VERTICAL_ALIGN:xg,VERTICAL_ALIGN_TOP:Gg,VERTICAL_ALIGN_MIDDLE:Ag,VERTICAL_ALIGN_BOTTOM:kg,INSERT_ROW_COL:Jg,INSERT_TOP_ROW:Bg,INSERT_BOTTOM_ROW:$g,INSERT_LEFT_COL:zg,INSERT_RIGHT_COL:jg,DELETE_ROW_COL:qg,DELETE_ROW:tf,DELETE_COL:ef,DELETE_TABLE:nf,MERGE_CELL:of,CANCEL_MERGE_CELL:sf}}=fn,rf=[{isDivider:!0},{key:Wg,i18nPath:"contextmenu.table.border",icon:"border-all",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:bg,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.ALL)}},{key:Vg,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.EMPTY)}},{key:Yg,i18nPath:"contextmenu.table.borderDash",icon:"border-dash",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.DASH)}},{key:Dg,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.EXTERNAL)}},{key:Ug,i18nPath:"contextmenu.table.borderInternal",icon:"border-internal",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.INTERNAL)}},{key:wg,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:Zg,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.TOP)}},{key:Kg,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.RIGHT)}},{key:vg,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.BOTTOM)}},{key:Qg,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.LEFT)}},{key:_g,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:o=>{o.executeTableTdSlashType(l.TdSlash.FORWARD)}},{key:Hg,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:o=>{o.executeTableTdSlashType(l.TdSlash.BACK)}}]}]},{key:xg,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:Gg,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(l.VerticalAlign.TOP)}},{key:Ag,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(l.VerticalAlign.MIDDLE)}},{key:kg,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(l.VerticalAlign.BOTTOM)}}]},{key:Jg,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:Bg,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:o=>{o.executeInsertTableTopRow()}},{key:$g,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:o=>{o.executeInsertTableBottomRow()}},{key:zg,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:o=>{o.executeInsertTableLeftCol()}},{key:jg,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:o=>{o.executeInsertTableRightCol()}}]},{key:qg,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:tf,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:o=>{o.executeDeleteTableRow()}},{key:ef,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:o=>{o.executeDeleteTableCol()}},{key:nf,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:o=>{o.executeDeleteTable()}}]},{key:of,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:o=>!o.isReadonly&&o.isCrossRowCol&&o.options.mode!==l.EditorMode.FORM,callback:o=>{o.executeMergeTableCell()}},{key:sf,i18nPath:"contextmenu.table.mergeCancelCell",icon:"merge-cancel-cell",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,callback:o=>{o.executeCancelMergeTableCell()}}];class lf{options;draw;command;range;position;i18n;container;contextMenuList;contextMenuContainerList;contextMenuRelationShip;context;constructor(t,e){this.options=t.getOptions(),this.draw=t,this.command=e,this.range=t.getRange(),this.position=t.getPosition(),this.i18n=t.getI18n(),this.container=t.getContainer(),this.context=null,this.contextMenuList=[...mg,...rf,...yg,...Rg,...Pg],this.contextMenuContainerList=[],this.contextMenuRelationShip=new Map,this._addEvent()}getContextMenuList(){return this.contextMenuList}_addEvent(){this.container.addEventListener("contextmenu",this._proxyContextMenuEvent),document.addEventListener("mousedown",this._handleSideEffect)}removeEvent(){this.container.removeEventListener("contextmenu",this._proxyContextMenuEvent),document.removeEventListener("mousedown",this._handleSideEffect)}_filterMenuList(t){const{contextMenuDisableKeys:e}=this.options,n=[];for(let i=0;i<t.length;i++){const r=t[i];r.disable||r.key&&e.includes(r.key)||(r.isDivider||r.when?.(this.context))&&n.push(r)}return n}_proxyContextMenuEvent=t=>{this.context=this._getContext();const e=this._filterMenuList(this.contextMenuList);e.some(i=>!i.isDivider)&&(this.dispose(),this._render({contextMenuList:e,left:t.x,top:t.y})),t.preventDefault()};_handleSideEffect=t=>{const e=t.target;this.contextMenuContainerList.some(i=>i.contains(e))||this.dispose()};_getContext(){const t=this.draw.isReadonly(),{isCrossRowCol:e,startIndex:n,endIndex:i}=this.range.getRange(),r=!!(~n||~i),s=r&&n!==i,{isTable:a,trIndex:c,tdIndex:d,index:R}=this.position.getPositionContext();let u=null;if(a){const I=this.draw.getOriginalElementList()[R]||null;I&&(u=Pt([I],{extraPickAttrs:["id"]})[0])}const h=a&&!!e,g=this.draw.getElementList(),f=g[n]||null,T=g[i]||null,p=this.draw.getZone().getZone();return{startElement:f,endElement:T,isReadonly:t,editorHasSelection:s,editorTextFocus:r,isCrossRowCol:h,zone:p,isInTable:a,trIndex:c??null,tdIndex:d??null,tableElement:u,options:this.options}}_createContextMenuContainer(){const t=document.createElement("div");return t.classList.add(`${z}-contextmenu-container`),t.setAttribute(de,l.EditorComponent.CONTEXTMENU),this.container.append(t),t}_render(t){const{contextMenuList:e,left:n,top:i,parentMenuContainer:r}=t,s=this._createContextMenuContainer(),a=document.createElement("div");a.classList.add(`${z}-contextmenu-content`);let c=null;r&&this.contextMenuRelationShip.set(r,s);for(let P=0;P<e.length;P++){const O=e[P];if(O.isDivider){if(P!==0&&P!==e.length-1&&!e[P-1]?.isDivider){const S=document.createElement("div");S.classList.add(`${z}-contextmenu-divider`),a.append(S)}}else{const S=document.createElement("div");if(S.classList.add(`${z}-contextmenu-item`),O.childMenus){const Y=this._filterMenuList(O.childMenus);Y.some(b=>!b.isDivider)&&(S.classList.add(`${z}-contextmenu-sub-item`),S.onmouseenter=()=>{this._setHoverStatus(S,!0),this._removeSubMenu(s);const b=S.getBoundingClientRect(),E=b.left+b.width,C=b.top;c=this._render({contextMenuList:Y,left:E,top:C,parentMenuContainer:s})},S.onmouseleave=b=>{(!c||!c.contains(b.relatedTarget))&&this._setHoverStatus(S,!1)})}else S.onmouseenter=()=>{this._setHoverStatus(S,!0),this._removeSubMenu(s)},S.onmouseleave=()=>{this._setHoverStatus(S,!1)},S.onclick=()=>{O.callback&&this.context&&O.callback(this.command,this.context),this.dispose()};const F=document.createElement("i");S.append(F),O.icon&&F.classList.add(`${z}-contextmenu-${O.icon}`);const N=document.createElement("span"),V=O.i18nPath?this._formatName(this.i18n.t(O.i18nPath)):this._formatName(O.name||"");if(N.append(document.createTextNode(V)),S.append(N),O.shortCut){const Y=document.createElement("span");Y.classList.add(`${z}-shortcut`),Y.append(document.createTextNode(O.shortCut)),S.append(Y)}a.append(S)}}const d=document.createElement("div");d.classList.add(`${z}-contextmenu-divider`),a.append(d);const R=document.createElement("div");R.classList.add(`${z}-contextmenu-item`),R.onmouseenter=()=>{this._setHoverStatus(R,!0),this._removeSubMenu(s)},R.onmouseleave=()=>{this._setHoverStatus(R,!1)},R.onclick=()=>{this.dispose()};const u=document.createElement("i");R.append(u);const h=document.createElement("span");h.append(document.createTextNode(this.i18n.t("contextmenu.global.cancel"))),R.append(h),a.append(R),s.append(a),s.style.display="block";const g=window.innerWidth,f=s.getBoundingClientRect(),T=f.width,p=n+T>g?n-T:n;s.style.left=`${p}px`;const m=window.innerHeight,I=f.height,L=i+I>m?i-I:i;return s.style.top=`${L}px`,this.contextMenuContainerList.push(s),s}_removeSubMenu(t){const e=this.contextMenuRelationShip.get(t);e&&(this._removeSubMenu(e),e.remove(),this.contextMenuRelationShip.delete(t))}_setHoverStatus(t,e){e?(t.parentNode?.querySelectorAll(`${z}-contextmenu-item`).forEach(n=>n.classList.remove("hover")),t.classList.add("hover")):t.classList.remove("hover")}_formatName(t){const e=Object.values(Fr),n=new RegExp(`${e.join("|")}`);let i=t;if(n.test(i)){const r=new RegExp(Fr.SELECTED_TEXT,"g");if(r.test(i)){const s=this.range.toString();i=i.replace(r,s)}}return i}registerContextMenuList(t){this.contextMenuList.push(...t)}dispose(){this.contextMenuContainerList.forEach(t=>t.remove()),this.contextMenuContainerList=[],this.contextMenuRelationShip.clear()}}const af=[{key:l.KeyMap.X,ctrl:!0,shift:!0,callback:o=>{o.executeStrikeout()}},{key:l.KeyMap.LEFT_BRACKET,mod:!0,callback:o=>{o.executeSizeAdd()}},{key:l.KeyMap.RIGHT_BRACKET,mod:!0,callback:o=>{o.executeSizeMinus()}},{key:l.KeyMap.B,mod:!0,callback:o=>{o.executeBold()}},{key:l.KeyMap.I,mod:!0,callback:o=>{o.executeItalic()}},{key:l.KeyMap.U,mod:!0,callback:o=>{o.executeUnderline()}},{key:ve?l.KeyMap.COMMA:l.KeyMap.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSuperscript()}},{key:ve?l.KeyMap.PERIOD:l.KeyMap.LEFT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSubscript()}},{key:l.KeyMap.L,mod:!0,callback:o=>{o.executeRowFlex(l.RowFlex.LEFT)}},{key:l.KeyMap.E,mod:!0,callback:o=>{o.executeRowFlex(l.RowFlex.CENTER)}},{key:l.KeyMap.R,mod:!0,callback:o=>{o.executeRowFlex(l.RowFlex.RIGHT)}},{key:l.KeyMap.J,mod:!0,callback:o=>{o.executeRowFlex(l.RowFlex.ALIGNMENT)}},{key:l.KeyMap.J,mod:!0,shift:!0,callback:o=>{o.executeRowFlex(l.RowFlex.JUSTIFY)}}],cf=[{key:l.KeyMap.ZERO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(null)}},{key:l.KeyMap.ONE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.FIRST)}},{key:l.KeyMap.TWO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.SECOND)}},{key:l.KeyMap.THREE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.THIRD)}},{key:l.KeyMap.FOUR,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.FOURTH)}},{key:l.KeyMap.FIVE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.FIFTH)}},{key:l.KeyMap.SIX,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.SIXTH)}}],df=[{key:l.KeyMap.I,shift:!0,mod:!0,callback:o=>{o.executeList(l.ListType.UL,l.ListStyle.DISC)}},{key:l.KeyMap.U,shift:!0,mod:!0,callback:o=>{o.executeList(l.ListType.OL)}}];class Rf{draw;command;globalShortcutList;agentShortcutList;constructor(t,e){this.draw=t,this.command=e,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...af,...cf,...df]),this._addEvent(),t.getCursor().getAgentDom().addEventListener("keydown",this._agentKeydown.bind(this))}_addEvent(){document.addEventListener("keydown",this._globalKeydown)}removeEvent(){document.removeEventListener("keydown",this._globalKeydown)}_addShortcutList(t){for(let e=t.length-1;e>=0;e--){const n=t[e];n.isGlobal?this.globalShortcutList.unshift(n):this.agentShortcutList.unshift(n)}}registerShortcutList(t){this._addShortcutList(t)}_globalKeydown=t=>{this.globalShortcutList.length&&this.draw.isGlobalShortcutActive()&&this.draw.isTargetInsideEditor(t.target)&&this._execute(t,this.globalShortcutList)};_agentKeydown(t){this.agentShortcutList.length&&(this.draw.isInteractionSuspended()||this._execute(t,this.agentShortcutList))}_execute(t,e){for(let n=0;n<e.length;n++){const i=e[n];if((i.mod?fe(t)===!!i.mod:t.ctrlKey===!!i.ctrl&&t.metaKey===!!i.meta)&&t.shiftKey===!!i.shift&&t.altKey===!!i.alt&&t.key.toLowerCase()===i.key.toLowerCase()){i.disable||(i?.callback?.(this.command),t.preventDefault());break}}}}class uf{editor;constructor(t){this.editor=t}use(t,e){t(this.editor,e)}}class hf{eventHub;constructor(){this.eventHub=new Map}on(t,e){if(!t||typeof e!="function")return;const n=this.eventHub.get(t)||new Set;n.add(e),this.eventHub.set(t,n)}emit(t,e){if(!t)return;const n=this.eventHub.get(t);if(n){if(n.size===1)return[...n][0](e);n.forEach(i=>i(e))}}off(t,e){if(!t||typeof e!="function")return;const n=this.eventHub.get(t);n&&n.delete(e)}isSubscribe(t){const e=this.eventHub.get(t);return!!e&&e.size>0}dangerouslyClearAll(){this.eventHub.clear()}}class gf{paste;copy;drop}class Wr{command;version;listener;eventBus;override;register;destroy;use;draw;constructor(t,e,n={}){const i=Yo(n);e=at(e);let r=[],s=[],a=[],c=[];Array.isArray(e)?s=e:(r=e.header||[],s=e.main,a=e.footer||[],c=e.graffiti||[]),[r,s,a].forEach(f=>{Vt(f,{editorOptions:i,isForceCompensation:!0})}),this.version=Qe,this.listener=new sg,this.eventBus=new hf,this.override=new gf,this.draw=new jh(t,i,{header:r,main:s,footer:a,graffiti:c},this.listener,this.eventBus,this.override);const R=this.draw;this.command=new Xr(new ig(R)),R.setCommand(this.command);const u=new lf(R,this.command),h=new Rf(R,this.command);this.register=new rg({contextMenu:u,shortcut:h,i18n:R.getI18n()}),this.destroy=()=>{R.destroy(),h.removeEvent(),u.removeEvent(),this.eventBus.dangerouslyClearAll()};const g=new uf(this);this.use=g.use.bind(g)}setFormModeTrace(t){this.command.executeSetFormModeTrace(t)}pauseInteraction(){this.draw.pauseInteraction()}resumeInteraction(){this.draw.resumeInteraction()}setOverlayActive(t){this.draw.setOverlayActive(t)}suspendGlobalShortcut(t){this.draw.suspendGlobalShortcut(t)}}l.Command=Xr,l.EDITOR_CLIPBOARD=Tn,l.EDITOR_COMPONENT=de,l.Editor=Wr,l.INTERNAL_CONTEXT_MENU_KEY=fn,l.INTERNAL_SHORTCUT_KEY=us,l.LETTER_CLASS=To,l.createDomFromElementList=qe,l.default=Wr,l.getElementListByHTML=tn,l.getTextFromElementList=en,l.splitText=ct,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
546
+ }`;R.append(document.createTextNode(u)),setTimeout(()=>{a.write(`${R.outerHTML}${c.innerHTML}`),s.print(),a.close(),window.addEventListener("mouseover",()=>{r?.remove()},{once:!0})})}const ag=[l.ControlType.TEXT,l.ControlType.TEXTFIELD],br=["id","titleId","listId","areaId","hyperlinkId","dateId","labelId","tableId","trId","tdId","pagingId","menstrualHistoryId","fetalHeartPositionId","toothPositionId"];function mo(o,t){for(let e=0;e<o.length;e++){const n=o[e];if(n.type===l.ElementType.CONTROL&&n.controlId===t&&n.control)return at(n);if(n.control?.value?.length){const i=mo(n.control.value,t);if(i)return i}if(n.valueList?.length){const i=mo(n.valueList,t);if(i)return i}if(n.type===l.ElementType.TABLE&&n.trList?.length)for(let i=0;i<n.trList.length;i++){const r=n.trList[i];for(let s=0;s<r.tdList.length;s++){const a=r.tdList[s],c=mo(a.value,t);if(c)return c}}}return null}function cg(o){const t=new Map,e=new Map,n=a=>a&&(t.has(a)||t.set(a,lt()),t.get(a)),i=a=>a&&(e.has(a)||e.set(a,lt()),e.get(a)),r=a=>{a.controlId&&(a.controlId=n(a.controlId)),a.originControlId&&(a.originControlId=n(a.originControlId));for(let c=0;c<br.length;c++){const d=br[c],R=a[d];if(typeof R=="string"){const u=a;u[d]=i(R)}}a.groupIds?.length&&(a.groupIds=a.groupIds.map(c=>i(c))),a.valueList?.length&&a.valueList.forEach(r),a.control?.value?.length&&a.control.value.forEach(r),a.trList?.length&&a.trList.forEach(c=>{const d=c;typeof d.id=="string"&&(d.id=i(d.id)),c.tdList.forEach(R=>{const u=R;typeof u.id=="string"&&(u.id=i(u.id)),R.value.forEach(r)})})},s=at(o);return r(s),s}function dg(o,t,e){let n=-1;const i=!!e;for(let r=0;r<o.length;r++){const s=o[r];if(i?s.controlId===t&&s.originControlId===e:s.controlId===t&&!s.originControlId)n=r;else if(~n)break}return n}class Rg{draw;range;position;historyManager;canvasEvent;options;control;workerManager;searchManager;i18n;zone;tableOperate;constructor(t){this.draw=t,this.range=t.getRange(),this.position=t.getPosition(),this.historyManager=t.getHistoryManager(),this.canvasEvent=t.getCanvasEvent(),this.options=t.getOptions(),this.control=t.getControl(),this.workerManager=t.getWorkerManager(),this.searchManager=t.getSearch(),this.i18n=t.getI18n(),this.zone=t.getZone(),this.tableOperate=t.getTableOperate()}getIsRangeInTextField(){const{startIndex:t}=this.range.getRange(),e=this.draw.getElementList(),n=e[t];if(!n)return!1;let i=null;const r=s=>{if(!s)return null;for(let a=t;a>=0;a--){const c=e[a];if(c.controlId===s&&c.control?.type===l.ControlType.TEXTFIELD&&(c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===l.ControlComponent.PREFIX||c.controlComponent===l.ControlComponent.PRE_TEXT))return s}return null};return i=r(n.controlId)||r(n.originControlId),!!i}mode(t){this.draw.setMode(t)}async cut(){this.draw.isReadonly()||this.draw.isDisabled()||await this.canvasEvent.cut()}async copy(t){await this.canvasEvent.copy(t)}paste(t){this.draw.isReadonly()||this.draw.isDisabled()||aa(this.canvasEvent,t)}copyControl(t){if(!t)return;const e=Pt(this.draw.getElementList(),{editorOptions:this.options}),n=mo(e,t);n&&oa({element:n})}pasteControl(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=is();if(!e?.element)return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.draw.getElementList(),s=cg(e.element),a=s.controlId;if(!a)return;const c=Zo([s]);if(!c.length)return;bt(c,{isHandleFirstElement:!1,editorOptions:this.options});let d=n,R=n,u=i,h=!1,g;const f=n===i;let T=this.control.getActiveControl();!T&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),T=this.control.getActiveControl());const m=T?.getElement();if(m?.control?.type&&ag.includes(m.control.type)&&this.control.getIsRangeWithinControl()){h=!0,g=m.controlId;const L=r[n];f&&(L?.control?.type===l.ControlType.TEXTFIELD||L?.control?.type===l.ControlType.TEXT)&&this.control.removePlaceholder(n)}else if(m?.controlId){const L=dg(r,m.controlId,m.originControlId);~L&&(d=L,R=L,u=L)}Ut(r,c,d,{isBreakWhenWrap:!0,editorOptions:this.options}),g&&c.forEach(L=>{L.controlId===a&&!L.originControlId&&(L.originControlId=g)});const p=d+1;R!==u&&this.draw.spliceElementList(r,R+1,u-R),this.draw.spliceElementList(r,p,0,c);const I=d+c.length;this.range.setRange(I,I),this.draw.render({curIndex:I}),h&&this.control.emitControlContentChange()}selectAll(){this.canvasEvent.selectAll()}backspace(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.draw.getElementList(),{startIndex:n,endIndex:i}=this.range.getRange(),r=n===i;if(r&&e[n].value===H&&n===0)return;r?this.draw.spliceElementList(e,n,1):this.draw.spliceElementList(e,n+1,i-n);const s=r?n-1:n;this.range.setRange(s,s),this.draw.render({curIndex:s})}setRange(t,e,n,i,r,s,a){if(t<0||e<0||e<t)return;this.range.setRange(t,e,n,i,r,s,a);const c=t===e;this.draw.render({curIndex:c?t:void 0,isCompute:!1,isSubmitHistory:!1,isSetCursor:c})}replaceRange(t){this.setRange(t.startIndex,t.endIndex,t.tableId,t.startTdIndex,t.endTdIndex,t.startTrIndex,t.endTrIndex)}setPositionContext(t){const{tableId:e,startTrIndex:n,startTdIndex:i}=t,r=this.draw.getOriginalElementList();if(e){const s=r.findIndex(R=>R.id===e);if(!~s)return;const c=r[s].trList[n],d=c.tdList[i];this.position.setPositionContext({isTable:!0,index:s,trIndex:n,tdIndex:i,tdId:d.id,trId:c.id,tableId:e})}else this.position.setPositionContext({isTable:!1})}forceUpdate(t){const{isSubmitHistory:e=!1}=t||{};this.range.clearRange(),this.draw.render({isSubmitHistory:e,isSetCursor:!1})}blur(){this.range.clearRange(),this.draw.getCursor().recoveryCursor()}hideCursor(){this.draw.getCursor().recoveryCursor()}undo(){this.draw.isReadonly()||this.historyManager.undo()}redo(){this.draw.isReadonly()||this.historyManager.redo()}painter(t){if(!t.isDblclick&&this.draw.getPainterStyle()){this.canvasEvent.clearPainterStyle();return}const e=this.range.getSelection();if(!e)return;const n={};e.forEach(i=>{ue.forEach(s=>{const a=s;n[a]===void 0&&Reflect.set(n,a,i[a])})}),this.draw.setPainterStyle(n,t)}applyPainterStyle(){this.draw.isReadonly()||this.draw.isDisabled()||this.canvasEvent.applyPainterStyle()}format(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();let r={},s=[];if(i?.length)s=i,r={isSetCursor:!1};else{const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===H&&(s.push(d),r={curIndex:a})}s.length&&(s.forEach(a=>{ue.forEach(c=>{delete a[c]})}),this.draw.render(r))}buttonText(t){if(t)if([...t.element].filter(i=>i.newButtonValue&&i.newButtonValue.length>0).length){const i=t.controlId;this.removeButtonElementsByControlId(i+"_text").then(()=>{setTimeout(()=>{this.insertButtonValue(t)},500)})}else{const i=t.controlId;i&&this.removeButtonElementsByControlId(i+"_text")}}triggerControlEditAttribute(t){const n=this.draw.getElementList().filter(r=>r.controlId===t);this.draw.getEventBus().emit("controlEditAttribute",{controlId:t,element:n})}editElementAttribute(t){const e=this.draw.getElementList();if(t.controlId&&t.type==="button"){const n=[];e.forEach((h,g)=>{h.controlId===t.controlId&&h.control?.type==="button"&&n.push(g)});const i=[];let r=null;n.forEach(h=>{const g=e[h];g.controlComponent===l.ControlComponent.VALUE&&(i.push(h),r||(r=g))}),i.sort((h,g)=>g-h).forEach(h=>{e.splice(h,1)});let s=-1;for(let h=0;h<e.length;h++){const g=e[h];if(g.controlId===t.controlId&&g.control?.type==="button"){if(g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT){s=h+1;break}s===-1&&(s=h+1)}}if(s===-1&&n.length>0){const h=[];e.forEach((g,f)=>{g.controlId===t.controlId&&g.control?.type==="button"&&h.push(f)}),h.length>0&&(s=h[0]+1)}const a=t.label||"";for(let h=0;h<a.length;h++){const g={value:a[h],controlId:t.controlId,type:l.ElementType.CONTROL,control:{type:"button",buttonLabel:a,code:t.code,value:[{value:a}],label:a,hide:!1},controlComponent:l.ControlComponent.VALUE,color:r?.color||"#fff",highlight:r?.highlight||"#1677FF",style:r?.style||"16px Microsoft YaHei",hide:!1};e.splice(s+h,0,g)}e.filter(h=>h.controlId===t.controlId&&h.control?.type==="button").forEach(h=>{h.control&&(h.control.buttonLabel=t.label,h.control.label=t.label,h.control.code=t.code,h.control.hide=!1,h.control.value=[{value:t.label}]),h.hide=!1});const{startIndex:c,endIndex:d}=this.range.getRange(),R=!0,u=d;this.draw.render({curIndex:u,isSetCursor:R})}else if(t.controlId){const n=t.controlId;if(e.forEach(r=>{r.controlId===n&&r.control&&(t.label!==void 0&&(r.control.label=t.label),t.placeholder!==void 0&&(r.control.placeholder=t.placeholder),t.code!==void 0&&(r.control.code=t.code),t.value!==void 0&&(r.control.value=t.value?[{value:t.value}]:null),t.valueSets!==void 0&&(r.control.valueSets=t.valueSets),t.dateFormat!==void 0&&(r.control.dateFormat=t.dateFormat),t.numberExclusiveOptions!==void 0&&(r.control.numberExclusiveOptions=t.numberExclusiveOptions),t.underline!==void 0&&(r.control.underline=t.underline))}),t.placeholder!==void 0){const r=t.placeholder,s=[];if(e.forEach((a,c)=>{a.controlId===n&&a.controlComponent==="placeholder"&&s.push({element:a,index:c})}),s.length===r.length)s.forEach((a,c)=>{a.element.value=r[c]===`
547
+ `?H:r[c]});else if(s.length>0){const a={...s[0].element};s.sort((d,R)=>R.index-d.index).forEach(d=>{e.splice(d.index,1)});const c=Math.min(...s.map(d=>d.index));for(let d=0;d<r.length;d++){const R=r[d]===`
548
+ `?H:r[d];e.splice(c+d,0,{...a,value:R})}}}const{endIndex:i}=this.range.getRange();this.draw.render({curIndex:i,isSetCursor:!0})}}delButton(t,e){return new Promise(n=>{for(let i=t.length-1;i>=0;i--)e.some(s=>s.controlId===t[i].controlId&&s.type===t[i].type)&&t.splice(i,1);n(!0)})}editButton(t,e,n){const i=this.draw.getElementList();n=n+1;for(let d=0;d<e.label.length;d++){const R={value:e.label[d],controlId:e.controlId,type:l.ElementType.CONTROL,control:{type:"button",buttonLabel:e.label,code:e.code,value:[{value:e.label}],label:e.label,hide:!1},controlComponent:"value",color:"#fff",highlight:"#1677FF",style:"16px Microsoft YaHei",hide:!1};i.splice(n+d,0,R)}const{startIndex:r,endIndex:s}=this.range.getRange(),a=!0,c=s;this.draw.render({curIndex:c,isSetCursor:a})}removeButtonElementsByControlId(t){return new Promise(e=>{const n=this.draw.getElementList();for(let c=n.length-1;c>=0;c--)n[c].controlId===t&&n.splice(c,1);const{startIndex:i,endIndex:r}=this.range.getRange(),s=!0,a=r;this.draw.render({curIndex:a,isSetCursor:s}),e(!0)})}removeByValue(t,e){return new Promise(n=>{for(let c=t.length-1;c>=0;c--)(t[c].type=="control"||t[c].type=="text"||t[c].type=="buttonText")&&t[c].control?.buttonLabel===e&&t[c].control?.buttonText&&t.splice(c,1);const{startIndex:i,endIndex:r}=this.range.getRange(),s=!0,a=r;this.draw.render({curIndex:a,isSetCursor:s}),n(!0)})}insertButtonValue(t){const e=this.draw.getElementList(),n=t.controlId,i=t.element[0].newButtonValue,r=t.element[0].control.buttonLabel,s=t.element[0].control.code;if(!i||!i.length)return;let a=-1;for(let m=0;m<e.length;m++)if(e[m].controlId===n&&e[m].control?.type==="button"){a=m;break}if(a===-1)return;const c=n+"_text",d=[];for(let m=0;m<i.length;m++){const p=i[m];d.push({value:p.value,code:p.code})}const R={type:"button",buttonLabel:r,buttonText:!0,label:r,code:s,value:d,hide:!1},u=[];u.push({value:"[",controlId:c,type:l.ElementType.CONTROL,control:R,controlComponent:l.ControlComponent.PREFIX,color:"#1677FF",hide:!1});for(let m=0;m<i.length;m++){const p=i[m],I=i.length>1?`${m+1}.${p.value}`:p.value,L=ct(I);for(let P=0;P<L.length;P++)u.push({value:L[P],controlId:c,type:l.ElementType.CONTROL,control:R,controlComponent:l.ControlComponent.VALUE,color:"#000",hide:!1});i.length>1&&m<i.length-1&&u.push({value:H,controlId:c,type:l.ElementType.CONTROL,control:R,controlComponent:l.ControlComponent.VALUE,color:"#000",hide:!1})}u.push({value:"]",controlId:c,type:l.ElementType.CONTROL,control:R,controlComponent:l.ControlComponent.POSTFIX,color:"#1677FF",hide:!1});for(let m=0;m<u.length;m++)e.splice(a+m,0,u[m]);const{startIndex:h,endIndex:g}=this.range.getRange(),f=!0,T=g;this.draw.render({curIndex:T,isSetCursor:f})}font(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length)r.forEach(s=>{s.font=t}),this.draw.render({isSetCursor:!1});else{let s=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({font:t}),d?.value===H?d.font=t:s=!1,this.draw.render({isSubmitHistory:s,curIndex:a,isCompute:!1})}}size(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{minSize:r,maxSize:s,defaultSize:a}=this.options;if(t<r||t>s)return;let c={},d=[];const R=this.range.getTextLikeSelectionElementList();if(R?.length)d=R,c={isSetCursor:!1};else{const{endIndex:h}=this.range.getRange(),f=this.draw.getElementList()[h];this.range.setDefaultStyle({size:t}),f?.value===H?(d.push(f),c={curIndex:h}):this.draw.render({curIndex:h,isCompute:!1,isSubmitHistory:!1})}if(!d.length)return;let u=!1;d.forEach(h=>{!h.size&&t===a||h.size&&h.size===t||(h.size=t,u=!0)}),u&&this.draw.render(c)}sizeAdd(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,maxSize:r}=this.options,s=this.range.getTextLikeSelectionElementList();let a={},c=[];if(s?.length)c=s,a={isSetCursor:!1};else{const{endIndex:R}=this.range.getRange(),h=this.draw.getElementList()[R],f=this.range.getDefaultStyle()?.size||h.size||i;this.range.setDefaultStyle({size:f+2>r?r:f+2}),h?.value===H?(c.push(h),a={curIndex:R}):this.draw.render({curIndex:R,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(R=>{R.size||(R.size=i),!(R.size>=r)&&(R.size+2>r?R.size=r:R.size+=2,d=!0)}),d&&this.draw.render(a)}sizeMinus(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,minSize:r}=this.options,s=this.range.getTextLikeSelectionElementList();let a={},c=[];if(s?.length)c=s,a={isSetCursor:!1};else{const{endIndex:R}=this.range.getRange(),h=this.draw.getElementList()[R],f=this.range.getDefaultStyle()?.size||h.size||i;this.range.setDefaultStyle({size:f-2<r?r:f-2}),h?.value===H?(c.push(h),a={curIndex:R}):this.draw.render({curIndex:R,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(R=>{R.size||(R.size=i),!(R.size<=r)&&(R.size-2<r?R.size=r:R.size-=2,d=!0)}),d&&this.draw.render(a)}bold(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const r=i.findIndex(s=>!s.bold);i.forEach(s=>{s.bold=!!~r}),this.draw.render({isSetCursor:!1})}else{let r=!0;const{endIndex:s}=this.range.getRange(),c=this.draw.getElementList()[s];this.range.setDefaultStyle({bold:c.bold?!1:!this.range.getDefaultStyle()?.bold}),c?.value===H?c.bold=!c.bold:r=!1,this.draw.render({isSubmitHistory:r,curIndex:s,isCompute:!1})}}italic(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const r=i.findIndex(s=>!s.italic);i.forEach(s=>{s.italic=!!~r}),this.draw.render({isSetCursor:!1})}else{let r=!0;const{endIndex:s}=this.range.getRange(),c=this.draw.getElementList()[s];this.range.setDefaultStyle({italic:c.italic?!1:!this.range.getDefaultStyle()?.italic}),c?.value===H?c.italic=!c.italic:r=!1,this.draw.render({isSubmitHistory:r,curIndex:s,isCompute:!1})}}underline(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length){const s=r.some(a=>!a.underline||!t&&a.textDecoration||t&&!a.textDecoration||t&&a.textDecoration&&!jr(a.textDecoration,t));r.forEach(a=>{a.underline=s,s&&t?a.textDecoration=t:delete a.textDecoration}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let s=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({underline:d?.underline?!1:!this.range.getDefaultStyle()?.underline}),d?.value===H?d.underline=!d.underline:s=!1,this.draw.render({isSubmitHistory:s,curIndex:a,isCompute:!1})}}strikeout(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const r=i.findIndex(s=>!s.strikeout);i.forEach(s=>{s.strikeout=!!~r}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let r=!0;const{endIndex:s}=this.range.getRange(),c=this.draw.getElementList()[s];this.range.setDefaultStyle({strikeout:c.strikeout?!1:!this.range.getDefaultStyle()?.strikeout}),c?.value===H?c.strikeout=!c.strikeout:r=!1,this.draw.render({isSubmitHistory:r,curIndex:s,isCompute:!1})}}superscript(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const r=i.findIndex(s=>s.type===l.ElementType.SUPERSCRIPT);i.forEach(s=>{~r?s.type===l.ElementType.SUPERSCRIPT&&(s.type=l.ElementType.TEXT,delete s.actualSize):(!s.type||s.type===l.ElementType.TEXT||s.type===l.ElementType.SUBSCRIPT)&&(s.type=l.ElementType.SUPERSCRIPT)}),this.draw.render({isSetCursor:!1})}subscript(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const r=i.findIndex(s=>s.type===l.ElementType.SUBSCRIPT);i.forEach(s=>{~r?s.type===l.ElementType.SUBSCRIPT&&(s.type=l.ElementType.TEXT,delete s.actualSize):(!s.type||s.type===l.ElementType.TEXT||s.type===l.ElementType.SUPERSCRIPT)&&(s.type=l.ElementType.SUBSCRIPT)}),this.draw.render({isSetCursor:!1})}color(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length)r.forEach(s=>{t?s.color=t:delete s.color}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let s=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({color:t||void 0}),d?.value===H?t?d.color=t:delete d.color:s=!1,this.draw.render({isSubmitHistory:s,curIndex:a,isCompute:!1})}}highlight(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length)r.forEach(s=>{t?s.highlight=t:delete s.highlight}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let s=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({highlight:t||void 0}),d?.value===H?t?d.highlight=t:delete d.highlight:s=!1,this.draw.render({isSubmitHistory:s,curIndex:a,isCompute:!1})}}title(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.draw.getElementList(),s=n===i?this.range.getRangeParagraphElementList():r.slice(n+1,i+1);if(!s||!s.length)return;const a=lt(),c=this.draw.getOptions().title;s.forEach(u=>{!u.type&&u.value===H||(t?(u.level=t,u.titleId=a,_n(u)&&(u.size=c[ki[t]],u.bold=!0)):u.titleId&&(delete u.titleId,delete u.title,delete u.level,delete u.size,delete u.bold))});const d=n===i,R=d?i:n;this.draw.render({curIndex:R,isSetCursor:d})}list(t,e){this.draw.isReadonly()||this.draw.getListParticle().setList(t,e)}rowFlex(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(c=>{c.rowFlex=t});const s=n===i,a=s?i:n;this.draw.render({curIndex:a,isSetCursor:s})}vertical(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(c=>{c.vertical=t});const s=n===i,a=s?i:n;this.draw.render({curIndex:a,isSetCursor:s})}rowMargin(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(c=>{c.rowMargin=t});const s=n===i,a=s?i:n;this.draw.render({curIndex:a,isSetCursor:s})}insertTable(t,e){this.draw.isReadonly()||this.draw.isDisabled()||this.getIsRangeInTextField()||this.control.getActiveControl()||this.tableOperate.insertTable(t,e)}insertTableTopRow(){this.draw.isReadonly()||this.tableOperate.insertTableTopRow()}insertTableBottomRow(){this.draw.isReadonly()||this.tableOperate.insertTableBottomRow()}insertTableLeftCol(){this.draw.isReadonly()||this.tableOperate.insertTableLeftCol()}insertTableRightCol(){this.draw.isReadonly()||this.tableOperate.insertTableRightCol()}deleteTableRow(){this.draw.isReadonly()||this.tableOperate.deleteTableRow()}deleteTableCol(){this.draw.isReadonly()||this.tableOperate.deleteTableCol()}deleteTable(){this.draw.isReadonly()||this.tableOperate.deleteTable()}mergeTableCell(){this.draw.isReadonly()||this.tableOperate.mergeTableCell()}cancelMergeTableCell(){this.draw.isReadonly()||this.tableOperate.cancelMergeTableCell()}splitVerticalTableCell(){this.draw.isReadonly()||this.tableOperate.splitVerticalTableCell()}splitHorizontalTableCell(){this.draw.isReadonly()||this.tableOperate.splitHorizontalTableCell()}tableTdVerticalAlign(t){this.draw.isReadonly()||this.tableOperate.tableTdVerticalAlign(t)}tableBorderType(t){this.draw.isReadonly()||this.tableOperate.tableBorderType(t)}tableBorderColor(t){this.draw.isReadonly()||this.tableOperate.tableBorderColor(t)}tableTdBorderType(t){this.draw.isReadonly()||this.tableOperate.tableTdBorderType(t)}tableTdSlashType(t){this.draw.isReadonly()||this.tableOperate.tableTdSlashType(t)}tableTdBackgroundColor(t){this.draw.isReadonly()||this.tableOperate.tableTdBackgroundColor(t)}tableSelectAll(){this.tableOperate.tableSelectAll()}tableProperties(){this.draw.isReadonly()||this.tableOperate.tableProperties()}hyperlink(t){const{valueList:e,url:n,hyperlinkId:i}=t;if(!n||!e?.length||this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl())return;const{startIndex:a,endIndex:c}=this.range.getRange();!~a&&!~c||this.insertElementList([{type:l.ElementType.HYPERLINK,value:"",valueList:e,url:n,hyperlinkId:i||lt()}])}getHyperlinkRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList(),s=r[n];if(s.type!==l.ElementType.HYPERLINK)return null;let a=n;for(;a>0;){if(r[a].hyperlinkId!==s.hyperlinkId){t=a+1;break}a--}let c=n+1;for(;c<r.length;){if(r[c].hyperlinkId!==s.hyperlinkId){e=c-1;break}c++}return c===r.length&&(e=c-1),!~t||!~e?null:[t,e]}deleteHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.getHyperlinkRange();if(!e)return;const n=this.draw.getElementList(),[i,r]=e;this.draw.spliceElementList(n,i,r-i+1),this.draw.getHyperlinkParticle().clearHyperlinkPopup();const s=i-1;this.range.setRange(s,s),this.draw.render({curIndex:s})}cancelHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.getHyperlinkRange();if(!e)return;const n=this.draw.getElementList(),[i,r]=e;for(let a=i;a<=r;a++){const c=n[a];delete c.type,delete c.url,delete c.hyperlinkId,delete c.underline}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s,isCompute:!1})}editHyperlink(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.getHyperlinkRange();if(!n)return;const i=this.draw.getElementList(),[r,s]=n;for(let c=r;c<=s;c++){const d=i[c];d.url=t}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:a}=this.range.getRange();this.draw.render({curIndex:a,isCompute:!1})}separator(t,e){if(this.draw.isReadonly()||this.draw.isDisabled()||this.getIsRangeInTextField()||this.control.getActiveControl())return;const{startIndex:r,endIndex:s}=this.range.getRange();if(!~r&&!~s)return;const a=this.draw.getElementList();let c=-1;const d=a[s+1];if(d&&d.type===l.ElementType.SEPARATOR){if(d.dashArray&&d.dashArray.join()===t.join())return;c=s,Object.assign(d,{dashArray:t,...e})}else{const R={value:bi,type:l.ElementType.SEPARATOR,dashArray:t,...e};Ut(a,[R],r,{editorOptions:this.options}),r!==0&&a[r].value===H?(this.draw.spliceElementList(a,r,1,[R]),c=r-1):(this.draw.spliceElementList(a,r+1,0,[R]),c=r)}this.range.setRange(c,c),this.draw.render({curIndex:c})}pageBreak(){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.insertElementList([{type:l.ElementType.PAGE_BREAK,value:bi}])}addWatermark(t){if(this.draw.isReadonly())return;const n=this.draw.getOptions(),{color:i,size:r,opacity:s,font:a,gap:c}=Uo;n.watermark.data=t.data,n.watermark.type=t.type||l.WatermarkType.TEXT,t.width&&(n.watermark.width=t.width),t.height&&(n.watermark.height=t.height),n.watermark.color=t.color||i,n.watermark.opacity=t.opacity||s,n.watermark.size=t.size||r,n.watermark.font=t.font||a,n.watermark.repeat=!!t.repeat,t.numberType&&(n.watermark.numberType=t.numberType),n.watermark.gap=t.gap||c,this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1})}deleteWatermark(){if(this.draw.isReadonly())return;const e=this.draw.getOptions();e.watermark&&e.watermark.data&&(e.watermark={...Uo},this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1}))}image(t){if(this.draw.isReadonly()||this.draw.isDisabled())return null;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=t.id||lt();return this.insertElementList([{...t,id:r,type:l.ElementType.IMAGE}]),r}search(t,e){this.searchManager.setSearchKeyword(t,e),this.draw.render({isSubmitHistory:!1})}searchNavigatePre(){this.searchManager.searchNavigatePre()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}searchNavigateNext(){this.searchManager.searchNavigateNext()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}getSearchNavigateInfo(){return this.searchManager.getSearchNavigateInfo()}replace(t,e){this.draw.getSearch().replace(t,e)}async print(){const{scale:t,printPixelRatio:e,paperDirection:n,width:i,height:r}=this.options;t!==1&&this.draw.setPageScale(1);const s=await this.draw.getDataURL({pixelRatio:e,mode:l.EditorMode.PRINT});lg(s,{width:i,height:r,direction:n}),t!==1&&this.draw.setPageScale(t)}replaceImageElement(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==l.ElementType.IMAGE||(i.value=t,this.draw.render({isSetCursor:!1}))}saveAsImageElement(){const{startIndex:t}=this.range.getRange(),n=this.draw.getElementList()[t];!n||n.type!==l.ElementType.IMAGE||Di(n.value,`${n.id}.png`)}setImageCrop(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==l.ElementType.IMAGE||(i.imgCrop=t,this.draw.render({isSetCursor:!1,isCompute:!1}))}setImageCaption(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];i?.type===l.ElementType.IMAGE&&(i.imgCaption=t,this.draw.render({isSetCursor:!1}))}changeImageDisplay(t,e){if(t.imgDisplay===e)return;t.imgDisplay=e;const{startIndex:n,endIndex:i}=this.range.getRange();if(e===l.ImageDisplay.SURROUND||e===l.ImageDisplay.FLOAT_TOP||e===l.ImageDisplay.FLOAT_BOTTOM){const r=this.position.getPositionList(),{pageNo:s,coordinate:{leftTop:a}}=r[n];t.imgFloatPosition={pageNo:s,x:a[0],y:a[1]}}else delete t.imgFloatPosition;this.draw.getPreviewer().clearResizer(),this.draw.render({isSetCursor:!0,curIndex:i})}getImage(t){return this.draw.getDataURL(t)}getPageMode(){return this.options}getOptions(){return this.options}getValue(t){return this.draw.getValue(t)}getValueAsync(t){return this.draw.getWorkerManager().getValue(t)}getAreaValue(t){return this.draw.getArea().getAreaValue(t)}getHTML(){const t=this.options,e=this.draw.getHeaderElementList(),n=this.draw.getOriginalMainElementList(),i=this.draw.getFooterElementList();return{header:nn(e,t).innerHTML,main:nn(n,t).innerHTML,footer:nn(i,t).innerHTML}}getText(){const t=this.draw.getHeaderElementList(),e=this.draw.getOriginalMainElementList(),n=this.draw.getFooterElementList();return{header:sn(t),main:sn(e),footer:sn(n)}}getWordCount(){return this.workerManager.getWordCount()}getCursorPosition(){return this.position.getCursorPosition()}getRemainingContentHeight(){if(!this.draw.getIsPagingMode())return 0;const t=this.draw.getPageRowList(),e=t.length-1,i=(t[e]||[]).reduce((c,d)=>c+d.height+(d.offsetY||0),0),r=this.draw.getHeight(),s=this.draw.getMainOuterHeight(),a=r-(s+i);return a>0?a:0}computeElementListHeight(t){if(!t.length)return 0;const e=this.draw.getInnerWidth();if(e<=0)return 0;const n=at(t);bt(n,{isHandleFirstElement:!1,editorOptions:this.options});const i=vo(n);return this.draw.computeRowList({innerWidth:e,elementList:n,surroundElementList:i}).reduce((s,a)=>s+a.height+(a.offsetY||0),0)}getRange(){return at(this.range.getRange())}getRangeText(){return this.range.toString()}getRangeContext(){const t=this.range.getRange(),{startIndex:e,endIndex:n}=t;if(!~e&&!~n)return null;const i=e===n,r=this.range.toString(),s=Pt(this.range.getSelectionElementList()||[]),a=this.draw.getElementList(),c=Ue(a[i?e:e+1],{extraPickAttrs:["id","controlComponent"]}),d=Ue(a[n],{extraPickAttrs:["id","controlComponent"]}),R=this.draw.getRowList(),u=this.position.getPositionList(),h=u[e],g=u[n],f=h?.pageNo,T=g?.pageNo,m=h?.rowIndex,p=g?.rowIndex,I=R[m],L=R[p];let P=0,O=0;this.draw.getCursor().getHitLineStartIndex()||(P=I?.elementList[0]?.value===H?h?.index-I?.startIndex:h?.index-I?.startIndex+1),h===g?O=P:O=L.elementList[0]?.value===H?g.index-L.startIndex:g.index-L.startIndex+1;const S=[],F=this.draw.getOriginalHeight(),N=this.draw.getOriginalPageGap(),V=this.position.getSelectionPositionList();if(V){let U=null,Q=0,G=null;for(let _=0;_<V.length;_++){const{rowNo:j,pageNo:st,coordinate:{leftTop:it,rightTop:nt},lineHeight:et}=V[_];U===null||U!==j?(G&&S.push(G),G={x:it[0],y:it[1]+st*(F+N),width:nt[0]-it[0],height:et},U=j,Q=it[0]):G.width=nt[0]-Q,_===V.length-1&&G&&S.push(G)}}else{const Q=this.position.getPositionList()[n],{coordinate:{rightTop:G},pageNo:_,lineHeight:j}=Q;S.push({x:G[0],y:G[1]+_*(F+N),width:0,height:j})}const Y=this.draw.getZone().getZone(),{isTable:X,trIndex:W,tdIndex:E,index:C}=this.position.getPositionContext();let M=null;if(X){const Q=this.draw.getOriginalElementList()[C]||null;Q&&(M=Pt([Q])[0])}let y=null,b=null,D=e-1;for(;D>0;){const U=a[D],Q=a[D-1];if(U.titleId&&U.titleId!==Q?.titleId){y=U.titleId,b=u[D].pageNo;break}D--}return at({isCollapsed:i,startElement:c,endElement:d,startPageNo:f,endPageNo:T,startRowNo:m,endRowNo:p,startColNo:P,endColNo:O,rangeRects:S,zone:Y,isTable:X,trIndex:W??null,tdIndex:E??null,tableElement:M,selectionText:r,selectionElementList:s,titleId:y,titleStartPageNo:b})}getRangeRow(){const t=this.range.getRangeRowElementList();return t?Pt(t):null}getRangeParagraph(){const t=this.range.getRangeParagraphElementList();return t?Pt(t):null}getKeywordRangeList(t){return this.range.getKeywordRangeList(t)}getKeywordContext(t){const e=this.getKeywordRangeList(t);if(!e.length)return null;const n=[],i=this.position.getOriginalMainPositionList(),r=this.draw.getOriginalMainElementList();for(let s=0;s<e.length;s++){const a=e[s],{startIndex:c,endIndex:d,tableId:R,startTrIndex:u,startTdIndex:h}=a;let g=i;if(a.tableId){const m=r.find(p=>p.id===R);m&&(g=m.trList?.[u]?.tdList?.[h]?.positionList||[])}const f=at(g[c]),T=at(g[d]);n.push({range:a,startPosition:f,endPosition:T})}return n}pageMode(t){this.draw.setPageMode(t)}pageScale(t){t!==this.options.scale&&this.draw.setPageScale(t)}pageScaleRecovery(){const{scale:t}=this.options;t!==1&&this.draw.setPageScale(1)}pageScaleMinus(){const{scale:t}=this.options,e=t*10-1;e>=5&&this.draw.setPageScale(e/10)}pageScaleAdd(){const{scale:t}=this.options,e=t*10+1;e<=30&&this.draw.setPageScale(e/10)}paperSize(t,e){this.draw.setPaperSize(t,e)}paperDirection(t){this.draw.setPaperDirection(t)}getPaperMargin(){return this.options.margins}setPaperMargin(t){return this.draw.setPaperMargin(t)}setMainBadge(t){this.draw.getBadge().setMainBadge(t),this.draw.render({isCompute:!1,isSubmitHistory:!1})}setAreaBadge(t){this.draw.getBadge().setAreaBadgeMap(t),this.draw.render({isCompute:!1,isSubmitHistory:!1})}insertElementList(t,e={}){if(!t.length||this.draw.isReadonly()||this.draw.isDisabled())return;const{isReplace:i=!0,ignoreContextKeys:r}=e;i||this.range.shrinkRange(),console.log(t,"payload");const s=at(t),{startIndex:a}=this.range.getRange(),c=this.draw.getElementList();Ut(c,s,a,{ignoreContextKeys:r,isBreakWhenWrap:!0,editorOptions:this.options}),console.log(s,"cloneElementList"),this.draw.insertElementList(s,e),setTimeout(()=>{console.log(c,"elementList")},500)}appendElementList(t,e){!t.length||this.draw.isReadonly()||this.draw.appendElementList(at(t),e)}updateElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;const i=[];function r(a,c=!1){let d=0;for(;d<a.length;){const R=a[d];if(d++,R.type===l.ElementType.TABLE){const u=R.trList;for(let h=0;h<u.length;h++){const g=u[h];for(let f=0;f<g.tdList.length;f++){const T=g.tdList[f];r(T.value,c)}}}R.type===l.ElementType.CONTROL&&R.control?.value&&r(R.control.value,!0),(e&&R.id===e||n&&R.conceptId===n)&&i.push({elementList:a,index:d-1,isInsideControl:c})}}const s=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of s)r(a);if(i.length){for(let a=0;a<i.length;a++){const{elementList:c,index:d,isInsideControl:R}=i[a],u=c[d],h=u.controlId&&u.controlComponent===l.ControlComponent.VALUE;if(R||h){if(Object.assign(u,t.properties),u.id){const g=kl(u.id);g&&Object.assign(g,t.properties)}}else{const g=Pt([{...u,...t.properties}],{extraPickAttrs:["id"]});g.length>0&&g[0]?(De(xe,u,g[0]),bt(g,{isHandleFirstElement:!1,editorOptions:this.options}),c[d]=g[0]):Object.assign(u,t.properties)}}this.draw.render({isSetCursor:!1})}}deleteElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;let i=!1;function r(a){let c=0;for(;c<a.length;){const d=a[c];if(d.type===l.ElementType.TABLE){const R=d.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];r(f.value)}}}d.type===l.ElementType.CONTROL&&d.control?.value&&r(d.control.value),(e&&d.id===e||n&&d.conceptId===n)&&(i=!0,a.splice(c,1),c--),c++}}const s=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of s)r(a);i&&this.draw.render({isSetCursor:!1})}getElementById(t){const{id:e,conceptId:n}=t,i=[];if(!e&&!n)return i;const r=a=>{let c=0;for(;c<a.length;){const d=a[c];if(c++,d.type===l.ElementType.TABLE){const R=d.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];r(f.value)}}}e&&d.id!==e||n&&d.conceptId!==n||i.push(d)}},s=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const a of s)r(a);return Pt(i,{extraPickAttrs:["id"]})}setValue(t,e){this.draw.setValue(t,e)}removeControl(t){if(t?.id||t?.conceptId){const{id:e,conceptId:n}=t;let i=!1;const r=a=>{let c=a.length-1;for(;c>=0;){const d=a[c];if(d.type===l.ElementType.TABLE){const R=d.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g];r(f.value)}}}c--,!(!d.control||e&&d.controlId!==e||n&&d.control.conceptId!==n)&&(i=!0,a.splice(c+1,1))}},s=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const a of s)r(a);i&&this.draw.render({isSetCursor:!1})}else{const{startIndex:e,endIndex:n}=this.range.getRange();if(e!==n||!this.draw.getElementList()[e].controlId)return;const a=this.draw.getControl().removeControl(e);if(a===null)return;this.range.setRange(a,a),this.draw.render({curIndex:a})}}translate(t){return this.i18n.t(t)}setLocale(t){this.i18n.setLocale(t)}getLocale(){return this.i18n.getLocale()}getCatalog(){return this.workerManager.getCatalog()}locationCatalog(t){const e=this.draw.getOriginalElementList();function n(p,I){for(let L=0;L<p.length;L++){const P=p[L];if(P.type===l.ElementType.TABLE){const O=P.trList;for(let S=0;S<O.length;S++){const F=O[S];for(let N=0;N<F.tdList.length;N++){const V=F.tdList[N],Y=n(V.value,I);if(Y)return{...Y,isTable:!0,index:L,trIndex:S,tdIndex:N,tdId:V.id,trId:F.id,tableId:P.id}}}}if(P.titleId===I){let O=L;for(;O<p.length;){if(p[O+1]?.titleId!==I)return{isTable:!1,startIndex:O,endIndex:O};O++}}}return null}const i=n(e,t);if(!i)return;const{isTable:r,index:s,startTdIndex:a,endTdIndex:c,startTrIndex:d,endTrIndex:R,trIndex:u,tdIndex:h,tdId:g,trId:f,tableId:T,endIndex:m}=i;this.position.setPositionContext({isTable:r,index:s,trIndex:u,tdIndex:h,tdId:g,trId:f,tableId:T}),this.range.setRange(m,m,T,a,c,d,R),this.draw.render({curIndex:m,isCompute:!1,isSubmitHistory:!1})}wordTool(){const t=this.draw.getMainElementList();let e=!1;for(let n=0;n<t.length;n++)if(t[n].value===H)for(;n+1<t.length;){const r=t[n+1];if(r.value!==H&&r.value!==po)break;t.splice(n+1,1),e=!0}if(e)this.draw.render({isSetCursor:!1});else{const n=this.range.getIsCollapsed();this.draw.getCursor().drawCursor({isShow:n})}}setHTML(t){const{header:e,main:n,footer:i}=t,r=this.draw.getOriginalInnerWidth(),s=a=>a!==void 0?on(a,{innerWidth:r}):void 0;this.setValue({header:s(e),main:s(n),footer:s(i)})}setGroup(){return this.draw.isReadonly()?null:this.draw.getGroup().setGroup()}deleteGroup(t){this.draw.isReadonly()||this.draw.getGroup().deleteGroup(t)}getGroupIds(){return this.draw.getWorkerManager().getGroupIds()}locationGroup(t){const e=this.draw.getOriginalMainElementList(),n=this.draw.getGroup().getContextByGroupId(e,t);if(!n)return;const{isTable:i,index:r,trIndex:s,tdIndex:a,tdId:c,trId:d,tableId:R,endIndex:u}=n;this.position.setPositionContext({isTable:i,index:r,trIndex:s,tdIndex:a,tdId:c,trId:d,tableId:R}),this.range.setRange(u,u),this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}setZone(t){this.draw.getZone().setZone(t)}getControlValue(t){return this.draw.getControl().getValueById(t)}setControlValue(t){this.draw.getControl().setValueListById([t])}setControlValueList(t){this.draw.getControl().setValueListById(t)}setControlExtension(t){this.draw.getControl().setExtensionListById([t])}setControlExtensionList(t){this.draw.getControl().setExtensionListById(t)}setControlProperties(t){this.draw.getControl().setPropertiesListById([t])}setControlPropertiesList(t){this.draw.getControl().setPropertiesListById(t)}setControlHighlight(t){this.draw.getControl().setHighlightList(t),this.draw.render({isSubmitHistory:!1})}updateOptions(t){const e=wo(t);Object.entries(e).forEach(([n,i])=>{Reflect.set(this.options,n,i)}),this.forceUpdate()}setFormModeTrace(t){Object.assign(this.options.modeRule.form,t),this.forceUpdate()}getControlList(){return this.draw.getControl().getList()}locationControl(t,e){function n(r,s){let a=0;for(;a<r.length;){const c=r[a];if(a++,c.type===l.ElementType.TABLE){const R=c.trList;for(let u=0;u<R.length;u++){const h=R[u];for(let g=0;g<h.tdList.length;g++){const f=h.tdList[g],T=n(f.value,s);if(T)return{...T,positionContext:{isTable:!0,index:a-1,trIndex:u,tdIndex:g,tdId:c.tdId,trId:c.trId,tableId:c.tableId}}}}}if(c?.controlId!==t)continue;let d=a-1;if(e?.position===l.LocationPosition.OUTER_AFTER){if(!(c.controlComponent===l.ControlComponent.POSTFIX&&r[a+1]?.controlComponent!==l.ControlComponent.POST_TEXT))continue}else if(e?.position===l.LocationPosition.OUTER_BEFORE)d-=1;else if(e?.position===l.LocationPosition.AFTER){if(d-=1,c.controlComponent!==l.ControlComponent.PLACEHOLDER&&c.controlComponent!==l.ControlComponent.POSTFIX&&c.controlComponent!==l.ControlComponent.POST_TEXT)continue}else if(c.controlComponent!==l.ControlComponent.PREFIX&&c.controlComponent!==l.ControlComponent.PRE_TEXT||r[a]?.controlComponent===l.ControlComponent.PREFIX||r[a]?.controlComponent===l.ControlComponent.PRE_TEXT)continue;return{zone:s,range:{startIndex:d,endIndex:d},positionContext:{isTable:!1}}}return null}const i=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const r of i){const s=n(r.elementList,r.zone);if(s){this.setZone(s.zone),this.position.setPositionContext(s.positionContext),this.range.replaceRange(s.range),this.draw.render({curIndex:s.range.startIndex,isCompute:!1,isSubmitHistory:!1});break}}}insertTextField(t){if(this.draw.isReadonly()||this.draw.isDisabled()||!t)return;const n=at(t),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList(),s=en(r,i);if(!s)return;const a=[...je,...Bt,...In,...xe];De(a,s,n),this.draw.insertElementTextField([n])}insertControl(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=at(t),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList(),s=en(r,i);if(!s)return;const a=r[i],c=a?.controlComponent===l.ControlComponent.POSTFIX||a?.controlComponent===l.ControlComponent.POSTTEXTFIX;let d=!1;if(a?.controlId&&!c)for(let u=i;u>=0;u--){const h=r[u];if(h.controlId!==a.controlId)break;if(h.controlComponent===l.ControlComponent.PRETEXTFIX||h.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){h.control?.type===l.ControlType.TEXTFIELD&&(d=!0);break}}if(!d&&!c){const u=r[i-1];if(u?.controlId)for(let h=i-1;h>=0;h--){const g=r[h];if(g.controlId!==u.controlId)break;if(g.controlComponent===l.ControlComponent.PRETEXTFIX||g.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){g.control?.type===l.ControlType.TEXTFIELD&&(d=!0);break}}}if(d&&t.control?.type===l.ControlType.TEXTFIELD)return;const R=[...je,...Bt,...In,...xe];De(R,s,n),this.draw.insertElementList([n])}jumpControl(t){this.draw.getControl().initNextControl({direction:t?.direction})}getContainer(){return this.draw.getContainer()}getTitleValue(t){const{conceptId:e}=t,n=[],i=(s,a)=>{let c=0;for(;c<s.length;){const d=s[c];if(c++,d.type===l.ElementType.TABLE){const h=d.trList;for(let g=0;g<h.length;g++){const f=h[g];for(let T=0;T<f.tdList.length;T++){const m=f.tdList[T];i(m.value,a)}}}if(d?.title?.conceptId!==e)continue;const R=[];let u=c;for(;u<s.length;){const h=s[u];if(u++,d.titleId!==h.titleId){if(h.level&&Do[h.level]<=Do[d.level])break;R.push(h)}}n.push({...d.title,value:sn(R),elementList:Pt(R),zone:a}),c=u}},r=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:s,elementList:a}of r)i(a,s);return n}getPositionContextByEvent(t,e={}){const n=t.target?.dataset.index;if(!n)return null;const{isMustDirectHit:i=!0}=e,r=Number(n),s=this.position.getPositionByXY({x:t.offsetX,y:t.offsetY,pageNo:r}),{isDirectHit:a,isTable:c,index:d,trIndex:R,tdIndex:u,tdValueIndex:h,zone:g}=s;if(i&&!a||g&&g!==this.zone.getZone())return null;let f=null,T=null;const m=this.draw.getOriginalElementList();let p=null;const I=this.position.getOriginalPositionList();if(c){const P=m[d].trList?.[R].tdList[u];T=P?.value[h]||null,p=P?.positionList?.[h]||null,f={element:m[d],trIndex:R,tdIndex:u}}else T=m[d]||null,p=I[d]||null;let L=null;if(p){const{pageNo:P,coordinate:{leftTop:O,rightTop:S},lineHeight:F}=p,N=this.draw.getOriginalHeight(),V=this.draw.getOriginalPageGap();L={x:O[0],y:O[1]+P*(N+V),width:S[0]-O[0],height:F}}return{pageNo:r,element:T,rangeRect:L,tableInfo:f}}insertTitle(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=at(t),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList(),s=en(r,i);if(!s)return;const a=[...je,...Bt,...In,...xe];n.valueList?.forEach(c=>{De(a,s,c)}),this.draw.insertElementList([n])}focus(t){const{position:e=l.LocationPosition.AFTER,isMoveCursorToVisible:n=!0,rowNo:i,range:r}=t||{};let s=-1;if(r)this.range.replaceRange(r),s=e===l.LocationPosition.BEFORE?r.startIndex:r.endIndex;else if(So(i)){const c=this.draw.getOriginalRowList();if(s=e===l.LocationPosition.BEFORE?c[i]?.startIndex:c[i+1]?.startIndex-1,!So(s))return;this.range.setRange(s,s)}else s=e===l.LocationPosition.BEFORE?0:this.draw.getOriginalMainElementList().length-1,this.range.setRange(s,s);const a={isCompute:!1,isSetCursor:!1,isSubmitHistory:!1};n&&~s&&this.range.getIsCollapsed()&&(a.curIndex=s,a.isSetCursor=!0),this.draw.render(a)}insertArea(t){return this.draw.getArea().insertArea(t)}setAreaValue(t){return this.draw.getArea().setAreaValue(t)}setAreaProperties(t){this.draw.getArea().setAreaProperties(t)}locationArea(t,e){if(e?.isAppendLastLineBreak&&e?.position===l.LocationPosition.OUTER_AFTER){const r=this.draw.getOriginalMainElementList();r[r.length-1].areaId===t&&this.draw.appendElementList([{value:H}],{isSubmitHistory:!1})}const n=this.draw.getArea().getContextByAreaId(t,e);if(!n)return;const{range:{endIndex:i}}=n;this.position.setPositionContext({isTable:!1}),this.range.setRange(i,i),this.draw.render({curIndex:i,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1})}clearGraffiti(){this.draw.getGraffiti().clear(),this.draw.isGraffitiMode()&&this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}getMacroValue(t){const{id:e,dictCode:n,label:i,areaId:r}=t,s=[],a=(d,R)=>{for(const u of d){if(u.type===l.ElementType.TABLE){const g=u.trList;for(const f of g)for(const T of f.tdList)a(T.value,R);continue}if(u.type!==l.ElementType.MACRO&&u.type!==l.ElementType.CUSTOM_MACRO&&u.type!==l.ElementType.REUSABLE_ITEM||e&&u.id!==e||n&&u.dictCode!==n||i&&u.label!==i||r&&u.areaId!==r)continue;const h={id:u.id,type:u.type,label:u.label,dictCode:u.dictCode,zone:R};u.type===l.ElementType.MACRO?h.value=u.value:u.type===l.ElementType.CUSTOM_MACRO?(h.macroConfig=u.macroConfig,h.value=u.macroConfig?.value):u.type===l.ElementType.REUSABLE_ITEM&&(h.reusableItemConfig=u.reusableItemConfig,h.value=u.reusableItemConfig?.value),s.push(h)}},c=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:d,elementList:R}of c)a(R,d);return s}getMacroList(){const t=[],e=i=>{for(const r of i){if(r.type===l.ElementType.TABLE){const s=r.trList;for(const a of s)for(const c of a.tdList)e(c.value);continue}(r.type===l.ElementType.MACRO||r.type===l.ElementType.CUSTOM_MACRO||r.type===l.ElementType.REUSABLE_ITEM)&&t.push(r)}},n=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const i of n)e(i);return t}setMacroValue(t){const{id:e,dictCode:n,label:i,areaId:r,value:s,code:a,isSubmitHistory:c=!0}=t;let d=!1;const R=h=>{for(let g=0;g<h.length;g++){const f=h[g];if(f.type===l.ElementType.TABLE){const T=f.trList;for(const m of T)for(const p of m.tdList)R(p.value);continue}f.type!==l.ElementType.MACRO&&f.type!==l.ElementType.CUSTOM_MACRO&&f.type!==l.ElementType.REUSABLE_ITEM||e&&f.id!==e||n&&f.dictCode!==n||i&&f.label!==i||r&&f.areaId!==r||(d=!0,f.type===l.ElementType.MACRO?f.value=s:f.type===l.ElementType.CUSTOM_MACRO?f.macroConfig?(f.macroConfig.value=s,a!==void 0&&(f.macroConfig.code=a)):f.macroConfig={type:"text",value:s}:f.type===l.ElementType.REUSABLE_ITEM&&(f.reusableItemConfig?f.reusableItemConfig.value=s:f.reusableItemConfig={value:s}))}},u=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const h of u)R(h);d&&this.draw.render({isSubmitHistory:c,isSetCursor:!1})}setMacroValueList(t){if(!t.length)return;let e=!1,n=!1;const i=s=>{for(let a=0;a<s.length;a++){const c=s[a];if(c.type===l.ElementType.TABLE){const g=c.trList;for(const f of g)for(const T of f.tdList)i(T.value);continue}if(c.type!==l.ElementType.MACRO&&c.type!==l.ElementType.CUSTOM_MACRO&&c.type!==l.ElementType.REUSABLE_ITEM)continue;const d=t.find(g=>g.id&&c.id===g.id||g.dictCode&&c.dictCode===g.dictCode||g.label&&c.label===g.label||g.areaId&&c.areaId===g.areaId);if(!d)continue;const{value:R,code:u,isSubmitHistory:h=!0}=d;e=!0,h&&(n=!0),c.type===l.ElementType.MACRO?c.value=R:c.type===l.ElementType.CUSTOM_MACRO?c.macroConfig?(c.macroConfig.value=R,u!==void 0&&(c.macroConfig.code=u)):c.macroConfig={type:"text",value:R}:c.type===l.ElementType.REUSABLE_ITEM&&(c.reusableItemConfig?c.reusableItemConfig.value=R:c.reusableItemConfig={value:R})}},r=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const s of r)i(s);e&&(n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1}))}updateMacroProperties(t){const{id:e,dictCode:n,label:i,areaId:r,properties:s,isSubmitHistory:a=!0}=t;let c=!1;const d=u=>{for(let h=0;h<u.length;h++){const g=u[h];if(g.type===l.ElementType.TABLE){const f=g.trList;for(const T of f)for(const m of T.tdList)d(m.value);continue}g.type!==l.ElementType.MACRO&&g.type!==l.ElementType.CUSTOM_MACRO&&g.type!==l.ElementType.REUSABLE_ITEM||e&&g.id!==e||n&&g.dictCode!==n||i&&g.label!==i||r&&g.areaId!==r||(c=!0,Object.assign(g,s))}},R=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const u of R)d(u);c&&this.draw.render({isSubmitHistory:a,isSetCursor:!1})}locationMacro(t){const{id:e,dictCode:n,label:i,areaId:r}=t,s=(c,d)=>{for(let R=0;R<c.length;R++){const u=c[R];if(u.type===l.ElementType.TABLE){const h=u.trList;for(let g=0;g<h.length;g++){const f=h[g];for(let T=0;T<f.tdList.length;T++){const m=f.tdList[T],p=s(m.value,d);if(p)return{...p,isTable:!0,index:R,trIndex:g,tdIndex:T,tableId:u.tableId,trId:f.id,tdId:m.id}}}}if(!(u.type!==l.ElementType.MACRO&&u.type!==l.ElementType.CUSTOM_MACRO&&u.type!==l.ElementType.REUSABLE_ITEM)&&!(e&&u.id!==e)&&!(n&&u.dictCode!==n)&&!(i&&u.label!==i)&&!(r&&u.areaId!==r))return{zone:d,index:R}}return null},a=[{zone:l.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:l.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:l.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:c,elementList:d}of a){const R=s(d,c);if(R){this.setZone(R.zone),this.position.setPositionContext({isTable:R.isTable||!1,index:R.index,trIndex:R.trIndex,tdIndex:R.tdIndex,tableId:R.tableId,trId:R.trId,tdId:R.tdId}),this.range.replaceRange({startIndex:R.index,endIndex:R.index}),this.draw.render({curIndex:R.index,isCompute:!1,isSubmitHistory:!1});break}}}insertSubTemplate(t){const{label:e,templateId:n,isSubmitHistory:i=!0}=t,r={id:lt(),value:e,type:l.ElementType.SUB_TEMPLATE,label:e,templateId:n,subTemplateExpanded:!1};this.insertElementList([r],{isSubmitHistory:i})}expandSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,r=this.draw.getOriginalMainElementList();for(let s=0;s<r.length;s++){const a=r[s];if(a.type===l.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){a.subTemplateExpanded=!0,a.hide=!0;const c=at(n);bt(c,{isHandleFirstElement:!1,editorOptions:this.options}),r.splice(s+1,0,...c),this.draw.render({isSubmitHistory:i,isCompute:!0});return}}}collapseSubTemplate(t){const{id:e,isSubmitHistory:n=!0}=t,i=this.draw.getOriginalMainElementList();for(let r=0;r<i.length;r++){const s=i[r];if(s.type===l.ElementType.SUB_TEMPLATE&&(!e||s.id===e)){s.subTemplateExpanded=!1,s.hide=!1;let a=r+1;for(;a<i.length&&i[a].type!==l.ElementType.SUB_TEMPLATE;)a++;a>r+1&&i.splice(r+1,a-r-1),this.draw.render({isSubmitHistory:n,isCompute:!0});return}}}toggleSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,r=this.draw.getOriginalMainElementList();for(let s=0;s<r.length;s++){const a=r[s];if(a.type===l.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){if(a.subTemplateExpanded)this.collapseSubTemplate({id:e,isSubmitHistory:i});else{if(!n){console.warn("子模板内容为空,无法展开");return}this.expandSubTemplate({id:e,content:n,isSubmitHistory:i})}return}}}insertLogicTemplate(t){const{label:e,templateId:n,content:i,displayRule:r,isSubmitHistory:s=!0}=t;if(!i?.length)return null;const a=lt(),c=at(i);return bt(c,{isHandleFirstElement:!1,editorOptions:this.options}),Oh(c,{logicTemplateId:a,logicTemplateName:e,logicTemplateTemplateId:n,logicTemplateDisplayRule:r}),this.insertElementList(c,{isSubmitHistory:s}),a}updateLogicTemplate(t){const{id:e,properties:n,isSubmitHistory:i=!0}=t;let{logicTemplateId:r}=t;const s=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];if(!r&&e){for(const d of s)if(Ke(d,R=>{r||R.id!==e||(r=R.logicTemplateId)}),r)break}if(!r)return;let a=!1;const c=Object.keys(n);if(c.length){for(const d of s)Ke(d,R=>{R.logicTemplateId===r&&(c.forEach(u=>{Reflect.set(R,u,n[u])}),a=!0)});a&&this.draw.render({isSubmitHistory:i,isSetCursor:!1})}}getLogicTemplateList(){const t=new Map,e=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const n of e)Ch(n).forEach(r=>{r.logicTemplateId&&(t.has(r.logicTemplateId)||t.set(r.logicTemplateId,r))});return Array.from(t.values())}}class ug{rangeStyleChange;visiblePageNoListChange;intersectionPageNoChange;pageSizeChange;pageScaleChange;saved;contentChange;controlChange;controlContentChange;pageModeChange;zoneChange;constructor(){this.rangeStyleChange=null,this.visiblePageNoListChange=null,this.intersectionPageNoChange=null,this.pageSizeChange=null,this.pageScaleChange=null,this.saved=null,this.contentChange=null,this.controlChange=null,this.controlContentChange=null,this.pageModeChange=null,this.zoneChange=null}}class hg{contextMenu;contextMenuList;getContextMenuList;shortcutList;langMap;constructor(t){const{contextMenu:e,shortcut:n,i18n:i}=t;this.contextMenu=e,this.contextMenuList=e.registerContextMenuList.bind(e),this.getContextMenuList=e.getContextMenuList.bind(e),this.shortcutList=n.registerShortcutList.bind(n),this.langMap=i.registerLangMap.bind(i)}disposeContextMenu(){this.contextMenu.dispose()}}const Wr={SELECTED_TEXT:"%s"},pn={GLOBAL:{CUT:"globalCut",COPY:"globalCopy",PASTE:"globalPaste",SELECT_ALL:"globalSelectAll",PRINT:"globalPrint"},CONTROL:{DELETE:"controlDelete",EDIT_ATTRIBUTE:"controlEditAttribute",COPY:"controlCopy",PASTE:"controlPaste"},HYPERLINK:{DELETE:"hyperlinkDelete",CANCEL:"hyperlinkCancel",EDIT:"hyperlinkEdit"},IMAGE:{CHANGE:"imageChange",SAVE_AS:"imageSaveAs",TEXT_WRAP:"imageTextWrap",TEXT_WRAP_EMBED:"imageTextWrapEmbed",TEXT_WRAP_UP_DOWN:"imageTextWrapUpDown",TEXT_WRAP_SURROUND:"imageTextWrapSurround",TEXT_WRAP_FLOAT_TOP:"imageTextWrapFloatTop",TEXT_WRAP_FLOAT_BOTTOM:"imageTextWrapFloatBottom"},TABLE:{BORDER:"border",BORDER_ALL:"tableBorderAll",BORDER_EMPTY:"tableBorderEmpty",BORDER_DASH:"tableBorderDash",BORDER_EXTERNAL:"tableBorderExternal",BORDER_INTERNAL:"tableBorderInternal",BORDER_TD:"tableBorderTd",BORDER_TD_TOP:"tableBorderTdTop",BORDER_TD_RIGHT:"tableBorderTdRight",BORDER_TD_BOTTOM:"tableBorderTdBottom",BORDER_TD_LEFT:"tableBorderTdLeft",BORDER_TD_FORWARD:"tableBorderTdForward",BORDER_TD_BACK:"tableBorderTdBack",VERTICAL_ALIGN:"tableVerticalAlign",VERTICAL_ALIGN_TOP:"tableVerticalAlignTop",VERTICAL_ALIGN_MIDDLE:"tableVerticalAlignMiddle",VERTICAL_ALIGN_BOTTOM:"tableVerticalAlignBottom",INSERT_ROW_COL:"tableInsertRowCol",INSERT_TOP_ROW:"tableInsertTopRow",INSERT_BOTTOM_ROW:"tableInsertBottomRow",INSERT_LEFT_COL:"tableInsertLeftCol",INSERT_RIGHT_COL:"tableInsertRightCol",DELETE_ROW_COL:"tableDeleteRowCol",DELETE_ROW:"tableDeleteRow",DELETE_COL:"tableDeleteCol",DELETE_TABLE:"tableDeleteTable",MERGE_CELL:"tableMergeCell",CANCEL_MERGE_CELL:"tableCancelMergeCell",TABLE_PROPERTIES:"tableProperties"}},{CONTROL:{DELETE:gg,EDIT_ATTRIBUTE:fg,COPY:Tg,PASTE:mg}}=pn;function Vr(o,t){if(t!==l.EditorMode.EDIT)return!1;const n=o?.control?.type,i=o?.controlComponent,r=n===l.ControlType.TEXT||n===l.ControlType.TEXTFIELD||n===l.ControlType.NUMBER||n===l.ControlType.SELECT||n===l.ControlType.DATE||n===l.ControlType.CHECKBOX||n===l.ControlType.RADIO||n===l.ControlType.BUTTON,s=i==="prefix"||i==="preText"||i==="preTextFix"||i==="textFixLabel"||n===l.ControlType.BUTTON&&i==="value";return r&&s}const pg=[{key:Tg,name:"复制控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&Vr(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeCopyControl(e)}},{key:mg,name:"粘贴控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.editorTextFocus&&o.options.mode===l.EditorMode.EDIT&&ia(),callback:o=>{o.executePasteControl()}},{key:gg,i18nPath:"contextmenu.control.delete",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&o.options.mode!==l.EditorMode.FORM,callback:o=>{o.executeRemoveControl()}},{key:fg,i18nPath:"contextmenu.control.editAttribute",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&Vr(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeTriggerControlEditAttribute(e)}}],{GLOBAL:{CUT:Lg,COPY:Ig,PASTE:Pg,SELECT_ALL:Mg,PRINT:Og}}=pn,Cg=[{key:Lg,i18nPath:"contextmenu.global.cut",shortCut:`${_e?"⌘":"Ctrl"} + X`,when:o=>!o.isReadonly,callback:o=>{o.executeCut()}},{key:Ig,i18nPath:"contextmenu.global.copy",shortCut:`${_e?"⌘":"Ctrl"} + C`,when:o=>o.editorHasSelection||o.isCrossRowCol,callback:o=>{o.executeCopy()}},{key:Pg,i18nPath:"contextmenu.global.paste",shortCut:`${_e?"⌘":"Ctrl"} + V`,when:o=>!o.isReadonly&&o.editorTextFocus,callback:o=>{o.executePaste()}},{key:Mg,i18nPath:"contextmenu.global.selectAll",shortCut:`${_e?"⌘":"Ctrl"} + A`,when:o=>o.editorTextFocus,callback:o=>{o.executeSelectAll()}},{isDivider:!0},{key:Og,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:o=>{o.executePrint()}}],{HYPERLINK:{DELETE:Sg,CANCEL:Eg,EDIT:Xg}}=pn,Ng=[{key:Sg,i18nPath:"contextmenu.hyperlink.delete",when:o=>!o.isReadonly&&o.startElement?.type===l.ElementType.HYPERLINK,callback:o=>{o.executeDeleteHyperlink()}},{key:Eg,i18nPath:"contextmenu.hyperlink.cancel",when:o=>!o.isReadonly&&o.startElement?.type===l.ElementType.HYPERLINK,callback:o=>{o.executeCancelHyperlink()}},{key:Xg,i18nPath:"contextmenu.hyperlink.edit",when:o=>!o.isReadonly&&o.startElement?.type===l.ElementType.HYPERLINK,callback:(o,t)=>{const e=window.prompt(o.executeTranslate("contextmenu.hyperlink.edit"),t.startElement?.url);e&&o.executeEditHyperlink(e)}}],{IMAGE:{CHANGE:Fg,SAVE_AS:yg,TEXT_WRAP:bg,TEXT_WRAP_EMBED:Wg,TEXT_WRAP_UP_DOWN:Vg,TEXT_WRAP_SURROUND:Yg,TEXT_WRAP_FLOAT_TOP:Dg,TEXT_WRAP_FLOAT_BOTTOM:Ug}}=pn,wg=[{key:Fg,i18nPath:"contextmenu.image.change",icon:"image-change",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===l.ElementType.IMAGE,callback:o=>{const t=document.createElement("input");t.type="file",t.accept=".png, .jpg, .jpeg",t.onchange=()=>{const e=t.files[0],n=new FileReader;n.readAsDataURL(e),n.onload=()=>{const i=n.result;o.executeReplaceImageElement(i)}},t.click()}},{key:yg,i18nPath:"contextmenu.image.saveAs",icon:"image",when:o=>!o.editorHasSelection&&o.startElement?.type===l.ElementType.IMAGE,callback:o=>{o.executeSaveAsImageElement()}},{key:bg,i18nPath:"contextmenu.image.textWrap",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===l.ElementType.IMAGE,childMenus:[{key:Wg,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.BLOCK)}},{key:Vg,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.INLINE)}},{key:Yg,i18nPath:"contextmenu.image.textWrapType.surround",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.SURROUND)}},{key:Dg,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.FLOAT_TOP)}},{key:Ug,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:Zg,BORDER_ALL:Qg,BORDER_EMPTY:vg,BORDER_DASH:Kg,BORDER_EXTERNAL:Hg,BORDER_INTERNAL:_g,BORDER_TD:xg,BORDER_TD_TOP:Gg,BORDER_TD_LEFT:Ag,BORDER_TD_BOTTOM:kg,BORDER_TD_RIGHT:Jg,BORDER_TD_BACK:Bg,BORDER_TD_FORWARD:$g,VERTICAL_ALIGN:zg,VERTICAL_ALIGN_TOP:jg,VERTICAL_ALIGN_MIDDLE:qg,VERTICAL_ALIGN_BOTTOM:tf,INSERT_ROW_COL:ef,INSERT_TOP_ROW:nf,INSERT_BOTTOM_ROW:of,INSERT_LEFT_COL:sf,INSERT_RIGHT_COL:rf,DELETE_ROW_COL:lf,DELETE_ROW:af,DELETE_COL:cf,DELETE_TABLE:df,MERGE_CELL:Rf,CANCEL_MERGE_CELL:uf}}=pn,hf=[{isDivider:!0},{key:Zg,i18nPath:"contextmenu.table.border",icon:"border-all",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:Qg,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.ALL)}},{key:vg,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.EMPTY)}},{key:Kg,i18nPath:"contextmenu.table.borderDash",icon:"border-dash",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.DASH)}},{key:Hg,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.EXTERNAL)}},{key:_g,i18nPath:"contextmenu.table.borderInternal",icon:"border-internal",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.INTERNAL)}},{key:xg,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:Gg,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.TOP)}},{key:Jg,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.RIGHT)}},{key:kg,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.BOTTOM)}},{key:Ag,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.LEFT)}},{key:$g,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:o=>{o.executeTableTdSlashType(l.TdSlash.FORWARD)}},{key:Bg,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:o=>{o.executeTableTdSlashType(l.TdSlash.BACK)}}]}]},{key:zg,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:jg,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(l.VerticalAlign.TOP)}},{key:qg,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(l.VerticalAlign.MIDDLE)}},{key:tf,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(l.VerticalAlign.BOTTOM)}}]},{key:ef,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:nf,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:o=>{o.executeInsertTableTopRow()}},{key:of,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:o=>{o.executeInsertTableBottomRow()}},{key:sf,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:o=>{o.executeInsertTableLeftCol()}},{key:rf,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:o=>{o.executeInsertTableRightCol()}}]},{key:lf,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:af,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:o=>{o.executeDeleteTableRow()}},{key:cf,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:o=>{o.executeDeleteTableCol()}},{key:df,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:o=>{o.executeDeleteTable()}}]},{key:Rf,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:o=>!o.isReadonly&&o.isCrossRowCol&&o.options.mode!==l.EditorMode.FORM,callback:o=>{o.executeMergeTableCell()}},{key:uf,i18nPath:"contextmenu.table.mergeCancelCell",icon:"merge-cancel-cell",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,callback:o=>{o.executeCancelMergeTableCell()}}];class gf{options;draw;command;range;position;i18n;container;contextMenuList;contextMenuContainerList;contextMenuRelationShip;context;constructor(t,e){this.options=t.getOptions(),this.draw=t,this.command=e,this.range=t.getRange(),this.position=t.getPosition(),this.i18n=t.getI18n(),this.container=t.getContainer(),this.context=null,this.contextMenuList=[...Cg,...hf,...wg,...pg,...Ng],this.contextMenuContainerList=[],this.contextMenuRelationShip=new Map,this._addEvent()}getContextMenuList(){return this.contextMenuList}_addEvent(){this.container.addEventListener("contextmenu",this._proxyContextMenuEvent),document.addEventListener("mousedown",this._handleSideEffect)}removeEvent(){this.container.removeEventListener("contextmenu",this._proxyContextMenuEvent),document.removeEventListener("mousedown",this._handleSideEffect)}_filterMenuList(t){const{contextMenuDisableKeys:e}=this.options,n=[];for(let i=0;i<t.length;i++){const r=t[i];r.disable||r.key&&e.includes(r.key)||(r.isDivider||r.when?.(this.context))&&n.push(r)}return n}_proxyContextMenuEvent=t=>{this.context=this._getContext();const e=this._filterMenuList(this.contextMenuList);e.some(i=>!i.isDivider)&&(this.dispose(),this._render({contextMenuList:e,left:t.x,top:t.y})),t.preventDefault()};_handleSideEffect=t=>{const e=t.target;this.contextMenuContainerList.some(i=>i.contains(e))||this.dispose()};_getContext(){const t=this.draw.isReadonly(),{isCrossRowCol:e,startIndex:n,endIndex:i}=this.range.getRange(),r=!!(~n||~i),s=r&&n!==i,{isTable:a,trIndex:c,tdIndex:d,index:R}=this.position.getPositionContext();let u=null;if(a){const I=this.draw.getOriginalElementList()[R]||null;I&&(u=Pt([I],{extraPickAttrs:["id"]})[0])}const h=a&&!!e,g=this.draw.getElementList(),f=g[n]||null,T=g[i]||null,m=this.draw.getZone().getZone();return{startElement:f,endElement:T,isReadonly:t,editorHasSelection:s,editorTextFocus:r,isCrossRowCol:h,zone:m,isInTable:a,trIndex:c??null,tdIndex:d??null,tableElement:u,options:this.options}}_createContextMenuContainer(){const t=document.createElement("div");return t.classList.add(`${z}-contextmenu-container`),t.setAttribute(Re,l.EditorComponent.CONTEXTMENU),this.container.append(t),t}_render(t){const{contextMenuList:e,left:n,top:i,parentMenuContainer:r}=t,s=this._createContextMenuContainer(),a=document.createElement("div");a.classList.add(`${z}-contextmenu-content`);let c=null;r&&this.contextMenuRelationShip.set(r,s);for(let P=0;P<e.length;P++){const O=e[P];if(O.isDivider){if(P!==0&&P!==e.length-1&&!e[P-1]?.isDivider){const S=document.createElement("div");S.classList.add(`${z}-contextmenu-divider`),a.append(S)}}else{const S=document.createElement("div");if(S.classList.add(`${z}-contextmenu-item`),O.childMenus){const Y=this._filterMenuList(O.childMenus);Y.some(W=>!W.isDivider)&&(S.classList.add(`${z}-contextmenu-sub-item`),S.onmouseenter=()=>{this._setHoverStatus(S,!0),this._removeSubMenu(s);const W=S.getBoundingClientRect(),E=W.left+W.width,C=W.top;c=this._render({contextMenuList:Y,left:E,top:C,parentMenuContainer:s})},S.onmouseleave=W=>{(!c||!c.contains(W.relatedTarget))&&this._setHoverStatus(S,!1)})}else S.onmouseenter=()=>{this._setHoverStatus(S,!0),this._removeSubMenu(s)},S.onmouseleave=()=>{this._setHoverStatus(S,!1)},S.onclick=()=>{O.callback&&this.context&&O.callback(this.command,this.context),this.dispose()};const F=document.createElement("i");S.append(F),O.icon&&F.classList.add(`${z}-contextmenu-${O.icon}`);const N=document.createElement("span"),V=O.i18nPath?this._formatName(this.i18n.t(O.i18nPath)):this._formatName(O.name||"");if(N.append(document.createTextNode(V)),S.append(N),O.shortCut){const Y=document.createElement("span");Y.classList.add(`${z}-shortcut`),Y.append(document.createTextNode(O.shortCut)),S.append(Y)}a.append(S)}}const d=document.createElement("div");d.classList.add(`${z}-contextmenu-divider`),a.append(d);const R=document.createElement("div");R.classList.add(`${z}-contextmenu-item`),R.onmouseenter=()=>{this._setHoverStatus(R,!0),this._removeSubMenu(s)},R.onmouseleave=()=>{this._setHoverStatus(R,!1)},R.onclick=()=>{this.dispose()};const u=document.createElement("i");R.append(u);const h=document.createElement("span");h.append(document.createTextNode(this.i18n.t("contextmenu.global.cancel"))),R.append(h),a.append(R),s.append(a),s.style.display="block";const g=window.innerWidth,f=s.getBoundingClientRect(),T=f.width,m=n+T>g?n-T:n;s.style.left=`${m}px`;const p=window.innerHeight,I=f.height,L=i+I>p?i-I:i;return s.style.top=`${L}px`,this.contextMenuContainerList.push(s),s}_removeSubMenu(t){const e=this.contextMenuRelationShip.get(t);e&&(this._removeSubMenu(e),e.remove(),this.contextMenuRelationShip.delete(t))}_setHoverStatus(t,e){e?(t.parentNode?.querySelectorAll(`${z}-contextmenu-item`).forEach(n=>n.classList.remove("hover")),t.classList.add("hover")):t.classList.remove("hover")}_formatName(t){const e=Object.values(Wr),n=new RegExp(`${e.join("|")}`);let i=t;if(n.test(i)){const r=new RegExp(Wr.SELECTED_TEXT,"g");if(r.test(i)){const s=this.range.toString();i=i.replace(r,s)}}return i}registerContextMenuList(t){this.contextMenuList.push(...t)}dispose(){this.contextMenuContainerList.forEach(t=>t.remove()),this.contextMenuContainerList=[],this.contextMenuRelationShip.clear()}}const ff=[{key:l.KeyMap.X,ctrl:!0,shift:!0,callback:o=>{o.executeStrikeout()}},{key:l.KeyMap.LEFT_BRACKET,mod:!0,callback:o=>{o.executeSizeAdd()}},{key:l.KeyMap.RIGHT_BRACKET,mod:!0,callback:o=>{o.executeSizeMinus()}},{key:l.KeyMap.B,mod:!0,callback:o=>{o.executeBold()}},{key:l.KeyMap.I,mod:!0,callback:o=>{o.executeItalic()}},{key:l.KeyMap.U,mod:!0,callback:o=>{o.executeUnderline()}},{key:_e?l.KeyMap.COMMA:l.KeyMap.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSuperscript()}},{key:_e?l.KeyMap.PERIOD:l.KeyMap.LEFT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSubscript()}},{key:l.KeyMap.L,mod:!0,callback:o=>{o.executeRowFlex(l.RowFlex.LEFT)}},{key:l.KeyMap.E,mod:!0,callback:o=>{o.executeRowFlex(l.RowFlex.CENTER)}},{key:l.KeyMap.R,mod:!0,callback:o=>{o.executeRowFlex(l.RowFlex.RIGHT)}},{key:l.KeyMap.J,mod:!0,callback:o=>{o.executeRowFlex(l.RowFlex.ALIGNMENT)}},{key:l.KeyMap.J,mod:!0,shift:!0,callback:o=>{o.executeRowFlex(l.RowFlex.JUSTIFY)}}],Tf=[{key:l.KeyMap.ZERO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(null)}},{key:l.KeyMap.ONE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.FIRST)}},{key:l.KeyMap.TWO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.SECOND)}},{key:l.KeyMap.THREE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.THIRD)}},{key:l.KeyMap.FOUR,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.FOURTH)}},{key:l.KeyMap.FIVE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.FIFTH)}},{key:l.KeyMap.SIX,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(l.TitleLevel.SIXTH)}}],mf=[{key:l.KeyMap.I,shift:!0,mod:!0,callback:o=>{o.executeList(l.ListType.UL,l.ListStyle.DISC)}},{key:l.KeyMap.U,shift:!0,mod:!0,callback:o=>{o.executeList(l.ListType.OL)}}];class pf{draw;command;globalShortcutList;agentShortcutList;constructor(t,e){this.draw=t,this.command=e,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...ff,...Tf,...mf]),this._addEvent(),t.getCursor().getAgentDom().addEventListener("keydown",this._agentKeydown.bind(this))}_addEvent(){document.addEventListener("keydown",this._globalKeydown)}removeEvent(){document.removeEventListener("keydown",this._globalKeydown)}_addShortcutList(t){for(let e=t.length-1;e>=0;e--){const n=t[e];n.isGlobal?this.globalShortcutList.unshift(n):this.agentShortcutList.unshift(n)}}registerShortcutList(t){this._addShortcutList(t)}_globalKeydown=t=>{this.globalShortcutList.length&&this.draw.isGlobalShortcutActive()&&this.draw.isTargetInsideEditor(t.target)&&this._execute(t,this.globalShortcutList)};_agentKeydown(t){this.agentShortcutList.length&&(this.draw.isInteractionSuspended()||this._execute(t,this.agentShortcutList))}_execute(t,e){for(let n=0;n<e.length;n++){const i=e[n];if((i.mod?Te(t)===!!i.mod:t.ctrlKey===!!i.ctrl&&t.metaKey===!!i.meta)&&t.shiftKey===!!i.shift&&t.altKey===!!i.alt&&t.key.toLowerCase()===i.key.toLowerCase()){i.disable||(i?.callback?.(this.command),t.preventDefault());break}}}}class Lf{editor;constructor(t){this.editor=t}use(t,e){t(this.editor,e)}}class If{eventHub;constructor(){this.eventHub=new Map}on(t,e){if(!t||typeof e!="function")return;const n=this.eventHub.get(t)||new Set;n.add(e),this.eventHub.set(t,n)}emit(t,e){if(!t)return;const n=this.eventHub.get(t);if(n){if(n.size===1)return[...n][0](e);n.forEach(i=>i(e))}}off(t,e){if(!t||typeof e!="function")return;const n=this.eventHub.get(t);n&&n.delete(e)}isSubscribe(t){const e=this.eventHub.get(t);return!!e&&e.size>0}dangerouslyClearAll(){this.eventHub.clear()}}class Pf{paste;copy;drop}class Yr{command;version;listener;eventBus;override;register;destroy;use;draw;constructor(t,e,n={}){const i=wo(n);e=at(e);let r=[],s=[],a=[],c=[];Array.isArray(e)?s=e:(r=e.header||[],s=e.main,a=e.footer||[],c=e.graffiti||[]),[r,s,a].forEach(f=>{bt(f,{editorOptions:i,isForceCompensation:!0})}),this.version=He,this.listener=new ug,this.eventBus=new If,this.override=new Pf,this.draw=new sg(t,i,{header:r,main:s,footer:a,graffiti:c},this.listener,this.eventBus,this.override);const R=this.draw;this.command=new yr(new Rg(R)),R.setCommand(this.command);const u=new gf(R,this.command),h=new pf(R,this.command);this.register=new hg({contextMenu:u,shortcut:h,i18n:R.getI18n()}),this.destroy=()=>{R.destroy(),h.removeEvent(),u.removeEvent(),this.eventBus.dangerouslyClearAll()};const g=new Lf(this);this.use=g.use.bind(g)}setFormModeTrace(t){this.command.executeSetFormModeTrace(t)}pauseInteraction(){this.draw.pauseInteraction()}resumeInteraction(){this.draw.resumeInteraction()}setOverlayActive(t){this.draw.setOverlayActive(t)}suspendGlobalShortcut(t){this.draw.suspendGlobalShortcut(t)}}l.Command=yr,l.EDITOR_CLIPBOARD=Ln,l.EDITOR_COMPONENT=Re,l.Editor=Yr,l.INTERNAL_CONTEXT_MENU_KEY=pn,l.INTERNAL_SHORTCUT_KEY=fs,l.LETTER_CLASS=Lo,l.createDomFromElementList=nn,l.default=Yr,l.getElementListByHTML=on,l.getTextFromElementList=sn,l.splitText=ct,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
549
549
  //# sourceMappingURL=canvas-editor.umd.cjs.map