ht-emr 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas-editor.js +7788 -6822
- package/dist/canvas-editor.umd.cjs +76 -72
- package/dist/src/editor/core/draw/Draw.d.ts +9 -0
- package/dist/src/editor/core/draw/control/Control.d.ts +0 -5
- package/dist/src/editor/core/draw/control/text/TextControl.d.ts +3 -1
- package/dist/src/editor/utils/element.d.ts +6 -1
- package/package.json +4 -9
- package/dist/canvas-editor.js.map +0 -1
- package/dist/canvas-editor.umd.cjs.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
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(
|
|
3
|
-
`,To=" ",yi=" ",Zr=["·","、",":",":",",",",",".","。",";",";","?","?","!","!"],bi={[l.MaxHeightRatio.HALF]:1/2,[l.MaxHeightRatio.ONE_THIRD]:1/3,[l.MaxHeightRatio.QUARTER]:1/4},mo={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:"ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"},Qr="中";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 po=/[0-9.]/,vr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,Kr=/[#*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\uFE0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FE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\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,Hr=new RegExp(`${Kr.source}|${vr.source}`,"g"),_r=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,Lo=new RegExp(`^[${_}
|
|
4
|
-
]`),
|
|
5
|
-
`)}function
|
|
2
|
+
(function(r,_e){typeof exports=="object"&&typeof module<"u"?_e(exports):typeof define=="function"&&define.amd?define(["exports"],_e):(r=typeof globalThis<"u"?globalThis:r||self,_e(r["canvas-editor"]={}))})(this,(function(r){"use strict";const _e="0.7.4";r.MaxHeightRatio=void 0,(function(o){o.HALF="half",o.ONE_THIRD="one-third",o.QUARTER="quarter"})(r.MaxHeightRatio||(r.MaxHeightRatio={})),r.NumberType=void 0,(function(o){o.ARABIC="arabic",o.CHINESE="chinese"})(r.NumberType||(r.NumberType={})),r.ImageDisplay=void 0,(function(o){o.INLINE="inline",o.BLOCK="block",o.SURROUND="surround",o.FLOAT_TOP="float-top",o.FLOAT_BOTTOM="float-bottom"})(r.ImageDisplay||(r.ImageDisplay={})),r.LocationPosition=void 0,(function(o){o.BEFORE="before",o.AFTER="after",o.OUTER_BEFORE="outer-before",o.OUTER_AFTER="outer-after"})(r.LocationPosition||(r.LocationPosition={})),r.FlexDirection=void 0,(function(o){o.ROW="row",o.COLUMN="column"})(r.FlexDirection||(r.FlexDirection={}));const k="",Hi=`
|
|
3
|
+
`,Eo=" ",_i=" ",el=["·","、",":",":",",",",",".","。",";",";","?","?","!","!"],Ai={[r.MaxHeightRatio.HALF]:1/2,[r.MaxHeightRatio.ONE_THIRD]:1/3,[r.MaxHeightRatio.QUARTER]:1/4},So={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:"ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"},nl="中";r.RowFlex=void 0,(function(o){o.LEFT="left",o.CENTER="center",o.RIGHT="right",o.ALIGNMENT="alignment",o.JUSTIFY="justify"})(r.RowFlex||(r.RowFlex={}));const Xo=/[0-9.]/,ol=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,il=/[#*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])?(?:\u200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DC3B(?:\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,sl=new RegExp(`${il.source}|${ol.source}`,"g"),rl=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,No=new RegExp(`^[${k}
|
|
4
|
+
]`),ll=/[^0-9\+\-\.eE,]/,al=/\s/;function cl(o,t){let e;return function(...n){e&&window.clearTimeout(e),e=window.setTimeout(()=>{o.apply(this,n)},t)}}function dl(o,t){let e=0,n;return function(...i){const l=Date.now();l-e>=t?(window.clearTimeout(n),o.apply(this,i),e=l):(window.clearTimeout(n),n=window.setTimeout(()=>{o.apply(this,i),e=l},t))}}function Fo(o,t){if(!o||typeof o!="object")return o;let e={};return Array.isArray(o)?e=o.map(n=>Fo(n,t)):Object.keys(o).forEach(n=>{t.includes(n)||(e[n]=Fo(o[n],t))}),e}function dt(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=>dt(e)):Object.keys(o).forEach(e=>{t[e]=dt(o[e])}),t}function yo(o){return o&&o.nodeType===1&&o.tagName.toLowerCase()==="body"}function Gi(o,t,e){if(o&&!yo(o))for(o=o;o;){if(!t||t(o)||yo(o))return t&&!t(o)&&yo(o)?null:o;o=o.parentNode}return null}function gt(){function o(){return((1+Math.random())*65536|0).toString(16).substring(1)}return o()+o()+"-"+o()+"-"+o()+"-"+o()+"-"+o()+o()+o()}function Tt(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(sl))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 xi(o,t){const e=document.createElement("a");e.href=o,e.download=t,e.click()}function ul(o,t){Rl(3,o,t)}function Rl(o,t,e){let n=0,i=0;const l=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",l)}function Hn(o){return Object.prototype.toString.call(o)==="[object Object]"}function bo(o){return Array.isArray(o)}function Wo(o){return Object.prototype.toString.call(o)==="[object Number]"}function hl(o){return Object.prototype.toString.call(o)==="[object String]"}function ki(o,t){if(Hn(o)&&Hn(t)){const e=t;for(const[n,i]of Object.entries(o))e[n]?e[n]=ki(i,e[n]):e[n]=i}else bo(o)&&bo(t)&&t.push(...o);return t}function Vo(o){if(typeof queueMicrotask=="function"){queueMicrotask(()=>{o()});return}if(typeof Promise<"u"){Promise.resolve().then(()=>{o()});return}setTimeout(()=>{o()},0)}function gl(o){const t=["零","一","二","三","四","五","六","七","八","九"],e=["","十","百","千","万","十","百","千","亿","十","百","千","万","十","百","千","亿"];if(!o||isNaN(o))return"零";const n=o.toString().split("");let i="";for(let l=0;l<n.length;l++){const s=n.length-1-l;i=`${e[l]}${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 Ze(o,t,e){for(let n=0;n<o.length;n++){const i=o[n],l=t[i];l!==void 0?e[i]=l:delete e[i]}}function Ji(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 qt(o,t){const e={};for(const n in o)t.includes(n)||(e[n]=o[n]);return e}function Tl(o){const e=new TextEncoder().encode(o),n=Array.from(e,l=>String.fromCharCode(l));return window.btoa(n.join(""))}function fl(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 Bi(o,t){return o.length!==t.length?!1:!o.some(e=>!t.includes(e))}function ml(o,t){if(!Hn(o)||!Hn(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 pl(o,t){const e=o.x,n=o.x+o.width,i=o.y,l=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||l<c)}function $i(o){return o==null}function _n(o){return o.replace(/\r\n|\r/g,`
|
|
5
|
+
`)}function zi(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,l=i.includes("g")?i:i+"g",s=new RegExp(t.source,l);s.lastIndex=n;const a=s.exec(o);return a?{index:a.index,length:a[0].length}:{index:-1,length:0}}function ji(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),l=i+t.offsetHeight,s=o.scrollTop,a=s+o.clientHeight;i<s?o.scrollTop=i:l>a&&(o.scrollTop=l-o.clientHeight)}function Yt(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function Il(o,t){return o.performance.enabled&&t>=o.performance.threshold}function Do(o,t,e,n=[],i){if(!Il(o,e))return;const l={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}`,l)}const Cl=12,Ll={width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF",dragFloatImageDisabled:!1},he="editor-component",q="ce",On=`${q}-clipboard`,Yo={print:{imagePreviewerDisabled:!1,backgroundDisabled:!1},readonly:{imagePreviewerDisabled:!1},form:{controlDeletableDisabled:!1,inputTraceEnabled:!0,deleteTraceEnabled:!0}};var Ut;(function(o){o.UP="top",o.DOWN="down",o.LEFT="left",o.RIGHT="right"})(Ut||(Ut={}));const Ae=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),Pl=typeof navigator<"u"&&/iPad|iPhone/.test(navigator.userAgent),Ml=/Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Ol=typeof navigator<"u"&&/Firefox/.test(navigator.userAgent);r.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"})(r.ElementType||(r.ElementType={}));const ge=["bold","color","highlight","font","size","italic","underline","strikeout","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],Bt=["rowFlex","rowMargin"],El=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","url","areaId","hyperlinkId","dateId","dateFormat","groupIds","templateId","subTemplateContent","subTemplateRelation","subTemplateConditions","rowMargin","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],Sl=["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","subTemplateContent","subTemplateRelation","subTemplateConditions","subTemplateExpanded"],Xl=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],en=["tdId","trId","tableId"],Uo=["level","titleId","title"],En=["listId","listType","listStyle"],wo=["control","controlId","controlComponent"],Jt=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"],Ge=["areaId","area"],Zo=[...en,...Uo,...En,...Ge],te=[r.ElementType.TEXT,r.ElementType.HYPERLINK,r.ElementType.SUBSCRIPT,r.ElementType.SUPERSCRIPT,r.ElementType.CONTROL,r.ElementType.DATE],Nl=[r.ElementType.IMAGE,r.ElementType.LATEX],Fl=[r.ElementType.BLOCK,r.ElementType.PAGE_BREAK,r.ElementType.SEPARATOR,r.ElementType.TABLE],yl=["HR","TABLE","UL","OL"],bl=[r.ElementType.TITLE,r.ElementType.LIST];class nn{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||nn.sandbox),n.setAttribute("allow",[e?.allow||nn.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===r.ElementType.TABLE){const l=i.trList;for(let s=0;s<l.length;s++){const a=l[s];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];e(d.value)}}}else i.type===r.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===r.ElementType.TABLE){const l=i.trList;for(const s of l)for(const a of s.tdList)n+=this._countImagesBeforeTarget(a.value,e)}else i.type===r.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(`${q}-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 l=this.draw.getHeight(),s=this.draw.getPageGap(),a=this.draw.getPageNo()*(l+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,l=(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
|
-
<pattern id="mosaic" x="${i}" y="${
|
|
8
|
+
<pattern id="mosaic" x="${i}" y="${l}" width="16" height="16" patternUnits="userSpaceOnUse">
|
|
9
9
|
<rect width="8" height="8" fill="#cccccc" />
|
|
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,${jr(s)}`,a}_drawImageWithCrop(t,e,n,i,r,s,a){if(n.imgCrop){const{x:c,y:d,width:u,height:R}=n.imgCrop;t.drawImage(e,c,d,u,R,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 u=(e.imgCaption.size||c.size)*a,R=e.imgCaption.font||c.font,h=e.imgCaption.color||c.color;t.save(),t.font=`${u}px ${R}`,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),C=d.substring(0,P);t.measureText(C+"...").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((u,R)=>{const h=new Image;h.setAttribute("crossOrigin","Anonymous"),h.src=e.value,h.onload=()=>{this.imageCache.set(e.value,h),u(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)},R(g)}});this.addImageObserver(d)}}}const Qn=82;function tn(o){return yo[o]==null&&fl(o),yo[o]}function fl(o){const t=Tl[o];if(t==null)return;const e=t.substring(3,5),n=1*e.charCodeAt(0)-Qn,i=1*e.charCodeAt(1)-Qn,r=t.substring(5),s=[[]];let a=1/0,c=-1/0,d=1/0,u=-1/0,R=0;for(;R<r.length;){const h=r.substring(R,R+2);if(h==" R")s.push([]);else{const g=h.charCodeAt(0)-Qn-n,f=h.charCodeAt(1)-Qn;a=Math.min(f,a),c=Math.max(f,c),d=Math.min(g,d),u=Math.max(g,u),s[s.length-1].push([g,f])}R+=2}yo[o]={w:i-n,xmin:d,xmax:u,ymin:a,ymax:c,polylines:s}}const yo={},Tl={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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XUZS[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]NMLNJQITIWJZK[M[OZQW RRSQWRZS[U[WZYWZTZQYNXM",651:" 22L\\UUTSRRPRNSMTLVLXMZO[Q[SZTXVRUWUZV[W[YZZY\\V",652:" 23M[MVOSRNSLTITGSFQGPIOMNTNZO[P[RZTXUUURVVWWYW[V",653:" 14MXTTTSSRQROSNTMVMXNZP[S[VYXV",654:" 24L\\UUTSRRPRNSMTLVLXMZO[Q[SZTXZF RVRUWUZV[W[YZZY\\V",655:" 17NXOYQXRWSUSSRRQROSNUNXOZQ[S[UZVYXV",656:" 24OWOVSQUNV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XQZN[P\\Q^QaPdOfMgLfLdMaP^S\\WYZV",677:" 22J\\K[NZQXSVUSWOXKXIWGUFSGRHQJPOPTQXRZT[V[XZYY",683:" 26I[WUWRVOUNSMQMONMPLSLVMYNZP[R[TZVXWUXPXKWHVGTFRFPGNI",684:" 16JZWNUMRMPNNPMSMVNYOZQ[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 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 RRPTSVTXTYRYSXT RNTPTRSTTVT RRUPXOYMZLZKYJWJYLZ RRUTXUYWZXZYYZWZYXZ RMZOZRYUZWZ",872:" 40JZRYQ\\ RRYS\\ RQ\\S\\ RRYUZXZZXZUYTWTYRZOYMWLUMVJUHSGQGOHNJOMMLKMJOKRMTKTJUJXLZOZRY",873:" 32JZRYQ\\ RRYS\\ RQ\\S\\ RRYVXVVXUXRZQZLYIXHVHTGPGNHLHKIJLJQLRLUNVNXRY",874:" 15I[IPKR RLKNP RRGRO RXKVP R[PYR",899:" 6QSRQQRRSSRRQ",900:" 10PTQPPQPSQTSTTSTQSPQP",901:" 14NVQNOONQNSOUQVSVUUVSVQUOSNQN",902:" 18MWQMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM",903:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",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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WVTVOULTK",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[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 R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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 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[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VGWIWLVNTO RTOVPXRYTYWXYWZT[P[MZLYKWKVLUMVLW RWQXTXWWYVZT[",2204:" 13H\\THT[ RUFU[ RUFJUZU RQ[X[",2205:" 39H\\MFKP RKPMNPMSMVNXPYSYUXXVZS[P[MZLYKWKVLUMVLW RSMUNWPXSXUWXUZS[ 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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" 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_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M[ 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[ 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:" 22LXTSSTTTTSSRQRO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RLT 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: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[ RWMW[ RXMX[ RIMPM RTM[M RI[P[ RT[[[ RWNMZ ROGOFNFNGOIQJSJUIVG",2911:" 38H\\MMM[ RNMN[ RJMQM RNTPTSSTRVNWMXMYNXOWN RPTSUTVVZW[ RPTRUSVUZV[X[YZZX RJ[Q[",2912:" 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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VYWVWRVOUNSM",3116:" 60G\\LMLb RMNMa RIMNMNb RNPONQMSMVNXPYSYUXXVZS[Q[OZNX RWPXRXVWX RSMUNVOWRWVVYUZS[ RIbQb RJMLN RKMLO RLaJb RL`Kb RN`Ob RNaPb",3117:" 55H\\VNVb RWOWa RUNWNXMXb RVPUNSMQMNNLPKSKULXNZQ[S[UZVX RMPLRLVMX RQMONNOMRMVNYOZQ[ RSb[b RVaTb RV`Ub RX`Yb RXaZb",3118:" 43IZNMN[ RONOZ RKMPMP[ RWOWNVNVPXPXNWMUMSNQPPS RK[S[ RLMNN RMMNO RNZL[ RNYM[ RPYQ[ RPZR[",3119:" 43J[WOXMXQWOVNTMPMNNMOMQNSPTUUWVXY RNNMQ RNRPSUTWU RXVWZ RMONQPRUSWTXVXYWZU[Q[OZNYMWM[NY",3120:" 22KZPHPVQYRZT[V[XZYX RQHQWRY RPHRFRWSZT[ RMMVM",3121:" 43G^LMLVMYNZP[S[UZVYWW RMNMWNY RIMNMNWOZP[ RWMW[\\[ RXNXZ RTMYMY[ RJMLN RKMLO RYYZ[ RYZ[[",3122:" 31I[LMR[ RMMRY RNMSY RXNSYR[ RJMQM RTMZM RKMNO RPMNN RVMXN RYMXN",3123:" 45F^JMN[ RKMNX RLMOX RRMOXN[ RRMV[ RSMVX RRMTMWX RZNWXV[ RGMOM RWM]M RHMKN RNMLN RXMZN R\\MZN",3124:" 48H\\LMV[ RMMW[ RNMX[ RWNMZ RJMQM RTMZM RJ[P[ RS[Z[ RKMMN RPMNN RUMWN RYMWN RMZK[ RMZO[ RVZT[ RWZY[",3125:" 40H[LMR[ RMMRY RNMSY RXNSYP_NaLbJbIaI_K_KaJaJ` RJMQM RTMZM RKMNO RPMNN RVMXN RYMXN",3126:" 41I[VML[ RWMM[ RXMN[ RXMLMLQ RL[X[XW RMMLQ RNMLP ROMLO RQMLN RS[XZ RU[XY RV[XX RW[XW",3151:" 50G]WMUTUXVZW[Y[[Y\\W RXMVTVZ RWMYMWTVX RU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GVHRT RVFWGWHRT RPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY",3265:" 59H]OKOJPJPLNLNJOHPGSFWFZG[I[KZMYNWOSPQQQSSTTT RUFZG RYGZIZKYMXNVO RWFXGYIYKXMWNSPRQRSST RPXOYOZP[Q[RZRYQXPX 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^IHJIIJHIIGKFMFOGPHQK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R[ 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[ 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 R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PWb 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 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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Z[YZX RVNYPYXXYZ[",3914:" 44I[KOLOMPMXLYN[ RMNNONXMYNZOYNX RKOMMOOOXPYN[ ROORNTMWOWXXYV[ RTNVOVXUYVZWYVX RRNUPUXTYV[",3915:" 28JZMPMXP[UYWX RNPNXPZ ROOOWRZ RMPOOTMWPWX 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 vn(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 te={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function ml(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 pl(o){return{type:gt[o]?"symb":"char",mode:"math",text:o,chld:[],bbox:null}}function bo(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=bo(o.slice(t+1,s));return t=s,a}function i(r){let s=t,a=s,c=0,d=0;const u=[];for(;s<o.length;){if(o[s]=="{")c||(a=s),c++;else if(o[s]=="}"){if(c--,!c&&(u.push(bo(o.slice(a+1,s))),d++,d==r))break}else if(c==0&&(u.push(pl(o[s])),d++,d==r))break;s++}return t=s,u}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 Ki(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));Ki(n),o[t].text=o[t].chld[0].text,o[t].chld=n,o.splice(t+1,1)}t++}}function kt(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++)kt(o.chld[s],t,e,0,0,!0);o.bbox.x+=n,o.bbox.y+=i}}function Hi(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 Ll(o){if(!o.length)return null;const t=Hi(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 Il(o,t="center"){for(let d=0;d<o.length;d++)if(o[d].text=="^"||o[d].text=="'"){let u=0,R=d;for(;R>0&&(o[R].text=="^"||o[R].text=="_"||o[R].text=="'");)R--;u=o[R].bbox.y,o[d].text=="'"?o[d].bbox.y=u:(kt(o[d],te.SUB_SUP_SCALE,null,0,0),gt[o[R].text]&>[o[R].text].flags.big?o[d].bbox.y=u-o[d].bbox.h:o[R].text=="\\int"?o[d].bbox.y=u:o[d].bbox.y=u-o[d].bbox.h/2)}else if(o[d].text=="_"){let u=1,R=d;for(;R>0&&(o[R].text=="^"||o[R].text=="_"||o[R].text=="'");)R--;u=o[R].bbox.y+o[R].bbox.h,kt(o[d],te.SUB_SUP_SCALE,null,0,0),gt[o[R].text]&>[o[R].text].flags.big?o[d].bbox.y=u:o[R].text=="\\int"?o[d].bbox.y=u-o[d].bbox.h:o[d].bbox.y=u-o[d].bbox.h/2}function e(d,u,R,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==u)T++;else if(o[f].text==R){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[u,R]=e(d,"\\left","\\right",1,0);u!=1/0&&R!=-1/0&&(o[d].bbox.y=u,kt(o[d],1,(R-u)/o[d].bbox.h,0,0))}else if(o[d].text=="\\right"){const[u,R]=e(d,"\\right","\\left",-1,0);u!=1/0&&R!=-1/0&&(o[d].bbox.y=u,kt(o[d],1,(R-u)/o[d].bbox.h,0,0))}else if(o[d].text=="\\middle"){const[u,R]=e(d,"\\right","\\left",-1,1),[h,g]=e(d,"\\left","\\right",1,1),f=Math.min(u,h),T=Math.max(R,g);f!=1/0&&T!=-1/0&&(o[d].bbox.y=f,kt(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 u=[];for(let R=0;R<n[d].length;R++){const h=Ll(n[d][R]);h&&(s[R]=s[R]||0,s[R]=Math.max(h.bbox.w+1,s[R])),u[R]=h}a.push(u)}const c=[];for(let d=0;d<a.length;d++){let u=1/0,R=-1/0;for(let h=0;h<a[d].length;h++)a[d][h]&&(u=Math.min(u,a[d][h].bbox.y),R=Math.max(R,a[d][h].bbox.y+a[d][h].bbox.h));c.push([u,R])}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 u=c[d-1][1]-c[d][0]+te.LINE_SPACING;for(let R=0;R<a[d].length;R++)a[d][R]&&(a[d][R].bbox.y+=u);c[d][0]+=u,c[d][1]+=u}o.splice(0,o.length);for(let d=0;d<a.length;d++){let u=0;for(let R=0;R<a[d].length;R++){const h=a[d][R];if(!h){u+=s[R];continue}h.bbox.x+=u,u+=s[R]-h.bbox.w,t=="center"?h.bbox.x+=(s[R]-h.bbox.w)/2:t=="left"||(t=="right"||t=="equation"&&R!=a[d].length-1)&&(h.bbox.x+=s[R]-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(vn(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(vn(o.text[i],e))&&(e=="tt"?n+=16:n+=tn(vn(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=te.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;kt(n,r,null,(s-n.bbox.w*r)/2,0),kt(i,r,null,(s-i.bbox.w*r)/2,n.bbox.h+te.FRAC_SPACING),o.bbox={x:0,y:-n.bbox.h+1-te.FRAC_SPACING/2,w:s,h:n.bbox.h+i.bbox.h+te.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);kt(n,1,null,(r-n.bbox.w)/2+1,0),kt(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*te.SQRT_MAG_SCALE-.5,0),kt(i,te.SQRT_MAG_SCALE,null,0,.5)),kt(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]&>[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]&>[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 R=0;R<o.chld.length;R++){const h=o.chld[R],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),kt(h,1,null,n,i),h.text=="^"||h.text=="_"||h.text=="'"){let f=R;for(;f>0&&(o.chld[f].text=="^"||o.chld[f].text=="_"||o.chld[f].text=="'");)f--;const T=gt[o.chld[f].text]&>[o.chld[f].text].flags.big;if(h.text=="'"){let m=f+1,p=0;for(;m<R;)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*te.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*te.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*te.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;Il(o.chld,a);const u=Hi(o.chld);o.text=="\\text"&&(u.x-=1,u.w+=2);for(let R=0;R<o.chld.length;R++)kt(o.chld[R],1,null,-u.x+(c?1.5:0),-u.y);o.bbox={x:0,y:0,w:u.w+1.5*Number(c)+1.5*Number(d),h:u.h},c&&o.chld.unshift({type:"symb",text:s[o.text][0],mode:o.mode,chld:[],bbox:{x:0,y:0,w:1,h:u.h}}),d&&o.chld.push({type:"symb",text:s[o.text][1],mode:o.mode,chld:[],bbox:{x:u.w+2,y:0,w:1,h:u.h}}),(c||d||o.text=="matrix")&&(o.type="node",o.text="",o.bbox.y-=(o.bbox.h-2)/2)}}function Pl(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]&>[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]&>[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]&>[n.text].flags.hat&&!gt[n.text].flags.xfl&&!gt[n.text].flags.yfl&&(i*=4,r=!0),gt[n.text]&>[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 u=s.polylines[a][d][0],R=s.polylines[a][d][1];if(gt[n.text].flags.xfl)u=(u-s.xmin)/Math.max(s.xmax-s.xmin,1)*n.bbox.w,u+=n.bbox.x;else if(s.w/16*i>n.bbox.w)u=u/Math.max(s.w,1)*n.bbox.w,u+=n.bbox.x;else{u=u/16*i;const h=(n.bbox.w-s.w/16*i)/2;u+=n.bbox.x+h}if(gt[n.text].flags.yfl)R=(R-s.ymin)/Math.max(s.ymax-s.ymin,1)*n.bbox.h,R+=n.bbox.y;else{if(R=R/16*i,r){const h=(s.ymax+s.ymin)/2;R-=h/16*i}R+=n.bbox.y+n.bbox.h/2}c.push([u,R])}t.push(c)}}else if(gt[n.text]&>[n.text].flags.txt||n.type=="char"){let s=n.bbox.x;const a=!!(gt[n.text]&>[n.text].flags.txt);for(let c=Number(a);c<n.text.length;c++){const d=tn(vn(n.text[c],a?"text":n.mode));if(!d){console.warn("unmapped character: "+n.text[c]);continue}for(let u=0;u<d.polylines.length;u++){const R=[];for(let h=0;h<d.polylines[u].length;h++){let g=d.polylines[u][h][0],f=d.polylines[u][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,R.push([g,f])}t.push(R)}n.mode=="tt"?s+=i:s+=d.w/16*i}}}return t}function ge(o){return Math.round(o*100)/100}class Ol{_latex;_tree;_tokens;_polylines;constructor(t){this._latex=t,this._tokens=ml(t),this._tree=bo(this._tokens),Ki(this._tree.chld),he(this._tree),Pl(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,u]=this._polylines[a][c];e[e.length-1].push([n+d*r,i+u*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,u]=this._polylines[a][c];e+=c?"L":"M",e+=`${ge(n+d*r)} ${ge(i+u*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
|
|
13
|
+
</svg>`,a=new Image;return a.src=`data:image/svg+xml;base64,${Tl(s)}`,a}_drawImageWithCrop(t,e,n,i,l,s,a){if(n.imgCrop){const{x:c,y:d,width:u,height:R}=n.imgCrop;t.drawImage(e,c,d,u,R,i,l,s,a)}else t.drawImage(e,i,l,s,a)}_renderCaption(t,e,n,i,l,s){if(!e.imgCaption?.value)return;const{scale:a,imgCaption:c}=this.options;let d=e.imgCaption.value;if(d.includes("{imageNo}")){const C=this.draw.getOriginalMainElementList(),I=this._countImagesBeforeTarget(C,e)+1;d=d.replace(/\{imageNo\}/g,String(I))}const u=(e.imgCaption.size||c.size)*a,R=e.imgCaption.font||c.font,h=e.imgCaption.color||c.color;t.save(),t.font=`${u}px ${R}`,t.fillStyle=h,t.textAlign="center";let g=d;const T=t.measureText(d);if(T.width>l){let C=0,I=d.length;for(;C<I;){const P=Math.ceil((C+I)/2),M=d.substring(0,P);t.measureText(M+"...").width<=l?C=P:I=P-1}g=d.substring(0,C)+"..."}const f=(e.imgCaption.top??c.top)*a,m=i+s+f+T.actualBoundingBoxAscent,p=n+l/2;t.fillText(g,p,m),t.restore()}render(t,e,n,i){const{scale:l}=this.options,s=e.width*l,a=e.height*l;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((u,R)=>{const h=new Image;h.setAttribute("crossOrigin","Anonymous"),h.src=e.value,h.onload=()=>{this.imageCache.set(e.value,h),u(e),c===this.draw.getRenderCount()&&(e.imgDisplay===r.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 T=this.getFallbackImage(s,a);T.onload=()=>{this._drawImageWithCrop(t,T,e,n,i,s,a),this.imageCache.set(e.value,T),this._renderCaption(t,e,n,i,s,a)},R(g)}});this.addImageObserver(d)}}}const An=82;function on(o){return Qo[o]==null&&Wl(o),Qo[o]}function Wl(o){const t=Vl[o];if(t==null)return;const e=t.substring(3,5),n=1*e.charCodeAt(0)-An,i=1*e.charCodeAt(1)-An,l=t.substring(5),s=[[]];let a=1/0,c=-1/0,d=1/0,u=-1/0,R=0;for(;R<l.length;){const h=l.substring(R,R+2);if(h==" R")s.push([]);else{const g=h.charCodeAt(0)-An-n,T=h.charCodeAt(1)-An;a=Math.min(T,a),c=Math.max(T,c),d=Math.min(g,d),u=Math.max(g,u),s[s.length-1].push([g,T])}R+=2}Qo[o]={w:i-n,xmin:d,xmax:u,ymin:a,ymax:c,polylines:s}}const Qo={},Vl={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[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PYMZIZGYFXFWGVIVKWNYP[Q",573:" 25C_HMFLEJEIFGHFIFKGLILLK[ RUFK[ RUFS[ RaF_G\\JYNVTS[",574:" 36F^NLLLKKKILGNFPFRGSISLQUQXRZT[V[XZYXYVXUVU R]I]G\\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: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\\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 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 RRM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MXWX",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:" 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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LMMNOOUQWRYT RKKMMONUPWQXRYTYXWZT[Q[NZLXKUK[LX",2020:" 16I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[",2021:" 23F^KFKULXNZQ[S[VZXXYUYF RLFLUMXOZQ[ RHFOF RVF\\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[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RIFMF RI[P[ RT[[[",2109:" 18MXRFQGRHSGRF RRMR[ RSMS[ ROMSM RO[V[",2110:" 25MXSFRGSHTGSF RTMT_SaQbObNaN`O_P`Oa RSMS_RaQb RPMTM",2111:" 27G\\LFL[ RMFM[ 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[",2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YSZS\\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:" 44I\\XRWOVNTMRMONMQLTLWMYNZP[R[UZWXXUYPYKXHWGUFRFPGOHOIPIPH RRMPNNQMTMXNZ RR[TZVXWUXPXKWHUF",2266:" 15H\\JFR[ RKFRY RZFR[ RJFZF RKGYG",2267:" 10AbDMIMRY RHNR[ Rb:R[",2268:" 32F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia",2269:" 50F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia RQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",2270:" 26F_\\S[UYVWVUUTTQPPONNLNJOIQISJULVNVPUQTTPUOWNYN[O\\Q\\S",2271:" 32F^[FI[ RNFPHPJOLMMKMIKIIJGLFNFPGSHVHYG[F RWTUUTWTYV[X[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QLPJ[J RIMJOKPMQ RQMPKOJMI RIXXXZW[U[SZQXPVPTQSSSUTWIW R[TZRYQWP RSTTVUWWX",2305:" 48F]OUMTLTJUIWIXJZL[M[OZPXPWOUJPINIKJILHOGSGWHYJZLZOYRVUUWUYV[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:" 21AcH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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[",2656:" 27OXRRUOWLXIXGWFUGTIKdKfLgNfOcPZQ[S[UZVYXV RTISNRRO[M`Kd",2657:" 38K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRPd RWRT[R`PdOfMgLfLdMaO_R]V[YY[V",2658:" 30L[LVNSPO RSFL[ RTFM[ ROUQSSRTRVSVUUXUZV[ RTRUSUUTXTZV[XZYY[V",2659:" 19NVSLRMSNTMSL RQROXOZQ[SZTYVV RRRPXPZQ[",2660:" 24NVSLRMSNTMSL RQRKd RRRO[M`KdJfHgGfGdHaJ_M]Q[TYVV",2661:" 31LZLVNSPO RSFL[ RTFM[ RURUSVSURTRRTOU ROURVSZT[ ROUQVRZT[U[XYZV",2662:" 17NVNVPSRO RUFOXOZQ[SZTYVV RVFPXPZQ[",2663:" 45E^EVGSIRKSKUI[ RIRJSJUH[ RKUMSORPRR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RJZM[",3069:" 44G^ZH[H\\F[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJUI[JYKY",3070:" 54G]TFN[ RUFO[ RVFP[ RMFKL R]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[WQWPVPVRXRXPVNTMQMNNLPKSKULX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WPXO RWPWXXYYY",3402:" 50J[LHMINK RTFQGOINKNXMY RPIOKOXRZ RTFRGQHPKPXRYSZ RMYNYPZQ[TZ RPPVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ",3403:" 27KXRNTPVOTMRNOPNRNWOYQ[UY RSNUO RPPOROWPYQZ RQOPQPVQXSZ",3404:" 47J[QFNINKOLSNVPWRWUVXTZ ROJOKSMVOWP ROHOIPJUMWOXRXUWXTZQ[ RRNNPNXMY ROPOXRZ RPOPXRYSZ RMYNYPZQ[",3405:" 27KXPUVQSMOPNRNWOYQ[UY RUQRN RPPOROWPYQZ RTRROQOPQPVQXSZ",3406:" 49LYXFWGUGSFQFPHPMOONP RVHTHRGQG RXFWHVITIRHQHPI RPKQMRNTOVOVP RNPPP RRPVP RPPPTQ` RSOPOQNQ[ RRPRTQ`",3407:" 53J[TMQNOONPMSMVNYO[UX RNWOYPZ RQNOPNSNUOXQZ RRNSOUPUXV[V]U_ RSNVPVZ RTMUNWOXO RWPXO RWPW\\V^U_S`P`N_M^M]N]N^",3408:" 50J[LHMINK RTFQGOINKNXMY RPIOKOYPZ RTFRGQHPKPXQYRY RMYOZP[SX RPPVMWOXSXWWZV\\T^Q` RUNVOWR RTNVQWTWWV[T^",3409:" 39MWRFQGQHRISHSGRF RQGSH RQHSG ROOPOQPQYS[VX RPNRORXTZ RNPQMRNTO RSPTO RSPSXTYUY",3410:" 45MWRFQGQHRISHSGRF RQGSH RQHSG ROOPOQPQ[P^O_M` RPNROR[Q] RNPQMRNTO RSPTO RSPS[R]P_M` RS[T]U^",3411:" 63KYNHOIPK RUFSGQIPKPMOONP RPPPXOY RRIQKQM RQOPOQMQXSZ RUFSHRKRO RRPRXSYTY ROYQZR[UX RRLVIWJWLUNSO RUJVKVLUN RROWOWP RNPPP RRPWP",3412:" 29MWOHPIQK RWFTGRIQKQXPY RSIRKRYTZ RWFUGTHSKSXTYUY RPYRZS[VX",3413:" 74E_GOHOIPIXHYJ[ RHNJPJ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XWY 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 RMMMU RJPMP RNKNTMVLW RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RSIRJQLQU RRKRS RSISRRTQU RSIUGWFYF[G RXGYGZH RUGWGYI[G RWGWX",3513:"107D`LJKKJMJOHOGPGRHQJQJU RKLKS RHPKP RLJLRKTJU RE[GYIXKXMYNYOX RHYKYMZ RE[GZJZL[M[NZOX RLJPFTJTWUYVY RPGSJSXRYSZTYSX RPPSP RNHOHRKROOO ROQRQRXQYS[VYWX RTJXF\\J\\W]Y^Y RXG[J[X]Z RXP[P RVHWHZKZOWO RWQZQZY\\[^Y ROHOX RWHWX",3514:" 84E^GIIGKFMFOGQJVUXXYY RMGOIPKVWYZ RIGKGMHOKTVVYWZY[ RVHXIZI\\H]F RWGYH[H RVHXFZG\\G]F RKOIOHPHRIQKQ RIPKP RG[IYKXNXPY RJYMYOZ RG[JZMZN[PY RKG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SPRSRVSYQ[",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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909:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQXPYR[ RRPSORNQORPRXQYRZSYRX RRMTOSPSXTYR[",3910:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQYT] RRPSORNQORPRYS[ RRMTOSPSZT]T`RbPaPbRb",3911:" 51IZNHLFMJMXLYN[ RNHNXMYNZOYNX RNHPFOJOXPYN[ ROPRNTMVPSROU RSNUP RRNTQ RRSSTTYV[XY RSSTUUYVZ RSRTSVXWYXY",3912:" 21MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[",3913:" 66E_GOHOIPIXHYJ[ RINJOJXIYJZKYJX RGOIMKOKXLYJ[ RKONNPMSOSXTYR[ RPNRORXQYRZSYRX RNNQPQXPYR[ RSOVNXM[O[X\\YZ[ RXNZOZXYYZZ[YZX RVNYPYXXYZ[",3914:" 44I[KOLOMPMXLYN[ RMNNONXMYNZOYNX RKOMMOOOXPYN[ ROORNTMWOWXXYV[ RTNVOVXUYVZWYVX RRNUPUXTYV[",3915:" 28JZMPMXP[UYWX RNPNXPZ ROOOWRZ RMPOOTMWPWX 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"},mt={"\\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 Gn(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 oe={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function Dl(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 Yl(o){return{type:mt[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 l=0,s=t;for(;s<o.length;){if(o[s]=="[")l++;else if(o[s]=="]"&&(l--,!l))break;s++}const a=vo(o.slice(t+1,s));return t=s,a}function i(l){let s=t,a=s,c=0,d=0;const u=[];for(;s<o.length;){if(o[s]=="{")c||(a=s),c++;else if(o[s]=="}"){if(c--,!c&&(u.push(vo(o.slice(a+1,s))),d++,d==l))break}else if(c==0&&(u.push(Yl(o[s])),d++,d==l))break;s++}return t=s,u}for(t=0;t<o.length;t++){const l=mt[o[t]],s={type:"",text:o[t],mode:"math",chld:[],bbox:null};if(l)if(l.arity){t++,s.type="func";let a=null;l.flags.opt&&(a=n(),a&&t++);const c=i(l.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 ts(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));ts(n),o[t].text=o[t].chld[0].text,o[t].chld=n,o.splice(t+1,1)}t++}}function $t(o,t,e,n,i,l){if(e==null&&(e=t),!!o.bbox){l&&(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++)$t(o.chld[s],t,e,0,0,!0);o.bbox.x+=n,o.bbox.y+=i}}function es(o){let t=1/0,e=-1/0,n=1/0,i=-1/0;for(let l=0;l<o.length;l++)o[l].bbox&&(t=Math.min(t,o[l].bbox.x),n=Math.min(n,o[l].bbox.y),e=Math.max(e,o[l].bbox.x+o[l].bbox.w),i=Math.max(i,o[l].bbox.y+o[l].bbox.h));return{x:t,y:n,w:e-t,h:i-n}}function Ul(o){if(!o.length)return null;const t=es(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 wl(o,t="center"){for(let d=0;d<o.length;d++)if(o[d].text=="^"||o[d].text=="'"){let u=0,R=d;for(;R>0&&(o[R].text=="^"||o[R].text=="_"||o[R].text=="'");)R--;u=o[R].bbox.y,o[d].text=="'"?o[d].bbox.y=u:($t(o[d],oe.SUB_SUP_SCALE,null,0,0),mt[o[R].text]&&mt[o[R].text].flags.big?o[d].bbox.y=u-o[d].bbox.h:o[R].text=="\\int"?o[d].bbox.y=u:o[d].bbox.y=u-o[d].bbox.h/2)}else if(o[d].text=="_"){let u=1,R=d;for(;R>0&&(o[R].text=="^"||o[R].text=="_"||o[R].text=="'");)R--;u=o[R].bbox.y+o[R].bbox.h,$t(o[d],oe.SUB_SUP_SCALE,null,0,0),mt[o[R].text]&&mt[o[R].text].flags.big?o[d].bbox.y=u:o[R].text=="\\int"?o[d].bbox.y=u-o[d].bbox.h:o[d].bbox.y=u-o[d].bbox.h/2}function e(d,u,R,h,g){let T=d,f=g,m=1/0,p=-1/0;for(;h>0?T<o.length:T>=0;){if(o[T].text==u)f++;else if(o[T].text==R){if(f--,f==0)break}else o[T].text=="^"||o[T].text=="_"||o[T].bbox&&(m=Math.min(m,o[T].bbox.y),p=Math.max(p,o[T].bbox.y+o[T].bbox.h));T+=h}return[m,p]}for(let d=0;d<o.length;d++)if(o[d].text=="\\left"){const[u,R]=e(d,"\\left","\\right",1,0);u!=1/0&&R!=-1/0&&(o[d].bbox.y=u,$t(o[d],1,(R-u)/o[d].bbox.h,0,0))}else if(o[d].text=="\\right"){const[u,R]=e(d,"\\right","\\left",-1,0);u!=1/0&&R!=-1/0&&(o[d].bbox.y=u,$t(o[d],1,(R-u)/o[d].bbox.h,0,0))}else if(o[d].text=="\\middle"){const[u,R]=e(d,"\\right","\\left",-1,1),[h,g]=e(d,"\\left","\\right",1,1),T=Math.min(u,h),f=Math.max(R,g);T!=1/0&&f!=-1/0&&(o[d].bbox.y=T,$t(o[d],1,(f-T)/o[d].bbox.h,0,0))}if(!o.some(d=>d.text=="&"||d.text=="\\\\"))return;const n=[];let i=[],l=[];for(let d=0;d<o.length;d++)o[d].text=="&"?(i.push(l),l=[]):o[d].text=="\\\\"?(l.length&&(i.push(l),l=[]),n.push(i),i=[]):l.push(o[d]);l.length&&i.push(l),i.length&&n.push(i);const s=[],a=[];for(let d=0;d<n.length;d++){const u=[];for(let R=0;R<n[d].length;R++){const h=Ul(n[d][R]);h&&(s[R]=s[R]||0,s[R]=Math.max(h.bbox.w+1,s[R])),u[R]=h}a.push(u)}const c=[];for(let d=0;d<a.length;d++){let u=1/0,R=-1/0;for(let h=0;h<a[d].length;h++)a[d][h]&&(u=Math.min(u,a[d][h].bbox.y),R=Math.max(R,a[d][h].bbox.y+a[d][h].bbox.h));c.push([u,R])}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 u=c[d-1][1]-c[d][0]+oe.LINE_SPACING;for(let R=0;R<a[d].length;R++)a[d][R]&&(a[d][R].bbox.y+=u);c[d][0]+=u,c[d][1]+=u}o.splice(0,o.length);for(let d=0;d<a.length;d++){let u=0;for(let R=0;R<a[d].length;R++){const h=a[d][R];if(!h){u+=s[R];continue}h.bbox.x+=u,u+=s[R]-h.bbox.w,t=="center"?h.bbox.x+=(s[R]-h.bbox.w)/2:t=="left"||(t=="right"||t=="equation"&&R!=a[d].length-1)&&(h.bbox.x+=s[R]-h.bbox.w),o.push(h)}}}function Te(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(mt[o.text])if(mt[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(mt[o.text].flags.txt){let n=0;for(let i=1;i<o.text.length;i++)n+=on(Gn(o.text[i],"text")).w;n/=16,o.bbox={x:0,y:0,w:n,h:2}}else if(mt[o.text].glyph){let n=on(mt[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++)on(Gn(o.text[i],e))&&(e=="tt"?n+=16:n+=on(Gn(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],l=oe.FRAC_SCALE;Te(n),Te(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)*l;$t(n,l,null,(s-n.bbox.w*l)/2,0),$t(i,l,null,(s-i.bbox.w*l)/2,n.bbox.h+oe.FRAC_SPACING),o.bbox={x:0,y:-n.bbox.h+1-oe.FRAC_SPACING/2,w:s,h:n.bbox.h+i.bbox.h+oe.FRAC_SPACING}}else if(o.text=="\\binom"){const n=o.chld[0],i=o.chld[1];Te(n),Te(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const l=Math.max(n.bbox.w,i.bbox.w);$t(n,1,null,(l-n.bbox.w)/2+1,0),$t(i,1,null,(l-i.bbox.w)/2+1,n.bbox.h),o.bbox={x:0,y:-n.bbox.h+1,w:l+2,h:n.bbox.h+i.bbox.h}}else if(o.text=="\\sqrt"){const n=o.chld[0];Te(n);const i=o.chld[1];let l=0;i&&(Te(i),l=Math.max(i.bbox.w*oe.SQRT_MAG_SCALE-.5,0),$t(i,oe.SQRT_MAG_SCALE,null,0,.5)),$t(n,1,null,1+l,.5),o.bbox={x:0,y:2-n.bbox.h-.5,w:n.bbox.w+1+l,h:n.bbox.h+.5}}else if(mt[o.text]&&mt[o.text].flags.hat){const n=o.chld[0];Te(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(mt[o.text]&&mt[o.text].flags.mat){const n=o.chld[0];Te(n),o.bbox={x:0,y:0,w:n.bbox.w,h:n.bbox.h+.5}}else{let n=0,i=0,l=1;for(let R=0;R<o.chld.length;R++){const h=o.chld[R],g={"\\quad":2,"\\,":6/18,"\\:":8/18,"\\;":10/18,"\\!":-6/18}[h.text]??null;if(h.text=="\\\\"){i+=l,n=0,l=1;continue}else{if(h.text=="&")continue;if(g!=null){n+=g;continue}else{if(Te(h,e),$t(h,1,null,n,i),h.text=="^"||h.text=="_"||h.text=="'"){let T=R;for(;T>0&&(o.chld[T].text=="^"||o.chld[T].text=="_"||o.chld[T].text=="'");)T--;const f=mt[o.chld[T].text]&&mt[o.chld[T].text].flags.big;if(h.text=="'"){let m=T+1,p=0;for(;m<R;)o.chld[m].text=="'"&&p++,m++;h.bbox.x=o.chld[T].bbox.x+o.chld[T].bbox.w+h.bbox.w*p,n=Math.max(n,h.bbox.x+h.bbox.w)}else if(f){const m=o.chld[T].bbox.x+(o.chld[T].bbox.w-h.bbox.w*oe.SUB_SUP_SCALE)/2;h.bbox.x=m,n=Math.max(n,o.chld[T].bbox.x+o.chld[T].bbox.w+(h.bbox.w*oe.SUB_SUP_SCALE-o.chld[T].bbox.w)/2)}else h.bbox.x=o.chld[T].bbox.x+o.chld[T].bbox.w,n=Math.max(n,h.bbox.x+h.bbox.w*oe.SUB_SUP_SCALE)}else n+=h.bbox.w;t=="text"&&(n+=1),l=Math.max(h.bbox.y+h.bbox.h-i,l)}}}i+=l;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;wl(o.chld,a);const u=es(o.chld);o.text=="\\text"&&(u.x-=1,u.w+=2);for(let R=0;R<o.chld.length;R++)$t(o.chld[R],1,null,-u.x+(c?1.5:0),-u.y);o.bbox={x:0,y:0,w:u.w+1.5*Number(c)+1.5*Number(d),h:u.h},c&&o.chld.unshift({type:"symb",text:s[o.text][0],mode:o.mode,chld:[],bbox:{x:0,y:0,w:1,h:u.h}}),d&&o.chld.push({type:"symb",text:s[o.text][1],mode:o.mode,chld:[],bbox:{x:u.w+2,y:0,w:1,h:u.h}}),(c||d||o.text=="matrix")&&(o.type="node",o.text="",o.bbox.y-=(o.bbox.h-2)/2)}}function Zl(o){function t(n,i,l){const s=[];if(n.bbox){if(i+=n.bbox.x,l+=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:l+(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:l+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:l,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:l,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:l,w:a,h:n.bbox.h},chld:[]})}else if(mt[n.text]&&mt[n.text].flags.hat){const a=n.chld[0].bbox.y,c={type:"symb",mode:n.mode,text:n.text,bbox:{x:i,y:l,w:n.bbox.w,h:a},chld:[]};s.push(c)}else if(mt[n.text]&&mt[n.text].flags.mat){const a=n.chld[0].bbox.h,c={type:"symb",text:n.text,mode:n.mode,bbox:{x:i,y:l+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:l,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,l);s.push(...c)}return s}const e=t(o,-o.bbox.x,-o.bbox.y);o.type="node",o.text="",o.chld=e}function Ql(o){const t=[];for(let e=0;e<o.chld.length;e++){const n=o.chld[e];let i=n.bbox.h/2,l=!1;if(mt[n.text]&&mt[n.text].flags.hat&&!mt[n.text].flags.xfl&&!mt[n.text].flags.yfl&&(i*=4,l=!0),mt[n.text]&&mt[n.text].glyph){const s=on(mt[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 u=s.polylines[a][d][0],R=s.polylines[a][d][1];if(mt[n.text].flags.xfl)u=(u-s.xmin)/Math.max(s.xmax-s.xmin,1)*n.bbox.w,u+=n.bbox.x;else if(s.w/16*i>n.bbox.w)u=u/Math.max(s.w,1)*n.bbox.w,u+=n.bbox.x;else{u=u/16*i;const h=(n.bbox.w-s.w/16*i)/2;u+=n.bbox.x+h}if(mt[n.text].flags.yfl)R=(R-s.ymin)/Math.max(s.ymax-s.ymin,1)*n.bbox.h,R+=n.bbox.y;else{if(R=R/16*i,l){const h=(s.ymax+s.ymin)/2;R-=h/16*i}R+=n.bbox.y+n.bbox.h/2}c.push([u,R])}t.push(c)}}else if(mt[n.text]&&mt[n.text].flags.txt||n.type=="char"){let s=n.bbox.x;const a=!!(mt[n.text]&&mt[n.text].flags.txt);for(let c=Number(a);c<n.text.length;c++){const d=on(Gn(n.text[c],a?"text":n.mode));if(!d){console.warn("unmapped character: "+n.text[c]);continue}for(let u=0;u<d.polylines.length;u++){const R=[];for(let h=0;h<d.polylines[u].length;h++){let g=d.polylines[u][h][0],T=d.polylines[u][h][1];g/=16,T/=16,g*=i,T*=i,n.mode=="tt"&&(d.w>16?g*=16/d.w:g+=(16-d.w)/2/16),g+=s,T+=n.bbox.y+n.bbox.h/2,R.push([g,T])}t.push(R)}n.mode=="tt"?s+=i:s+=d.w/16*i}}}return t}function fe(o){return Math.round(o*100)/100}class vl{_latex;_tree;_tokens;_polylines;constructor(t){this._latex=t,this._tokens=Dl(t),this._tree=vo(this._tokens),ts(this._tree.chld),Te(this._tree),Zl(this._tree),this._polylines=Ql(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"||mt[d.text]&&(mt[d.text].flags.txt||!Object.keys(mt[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,l=t.MARGIN_Y??n;return[i,l,e,n]}polylines(t){t||(t={});const e=[],[n,i,l,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,u]=this._polylines[a][c];e[e.length-1].push([n+d*l,i+u*s])}}return e}pathd(t){t||(t={});let e="";const[n,i,l,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,u]=this._polylines[a][c];e+=c?"L":"M",e+=`${fe(n+d*l)} ${fe(i+u*s)}`}return e}svg(t){t||(t={});const[e,n,i,l]=this.resolveScale(t),s=fe(this._tree.bbox.w*i+e*2),a=fe(this._tree.bbox.h*l+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 u=0;u<this._polylines[d].length;u++){const[R,h]=this._polylines[d][u];c+=
|
|
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 u=0;u<this._polylines[d].length;u++){const[R,h]=this._polylines[d][u];c+=fe(e+R*i)+" "+fe(n+h*l)+" "}}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,l]=this.resolveScale(t),s=fe(this._tree.bbox.w*i+e*2),a=fe(this._tree.bbox.h*l+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[R].length;h++){const[g,
|
|
47
|
+
`;for(let h=0;h<this._polylines[R].length;h++){const[g,T]=this._polylines[R][h];d+=`${fe(e+g*i)} ${fe(a-(n+T*l))} ${h?"l":"m"} `}d+=`
|
|
48
48
|
S
|
|
49
49
|
endstream
|
|
50
50
|
endobj
|
|
@@ -58,54 +58,59 @@ 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:u,h:R}=this._tree.chld[a].bbox;s.push({x:e+c*i,y:n+d*r,w:u*i,h:R*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 _i extends vi{static convertLaTextToSVG(t){return new Ol(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,u)=>{const R=new Image;R.src=e.laTexSVG,R.onload=()=>{t.drawImage(R,n,i,s,a),this.imageCache.set(e.value,R),d(e)},R.onerror=h=>{u(h)}});this.addImageObserver(c)}}}l.ListType=void 0,(function(o){o.UL="ul",o.OL="ol"})(l.ListType||(l.ListType={}));var _e;(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.CHECKBOX="checkbox"})(_e||(_e={}));var xi;(function(o){o.DECIMAL="decimal"})(xi||(xi={})),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 Cl={inheritStyle:!1},Wo={[_e.DISC]:"•",[_e.CIRCLE]:"◦",[_e.SQUARE]:"▫︎",[_e.CHECKBOX]:"☑️"},Sl={[l.ListType.OL]:"ol",[l.ListType.UL]:"ul"},El={[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 Xl={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},Gi={[l.TitleLevel.FIRST]:"defaultFirstSize",[l.TitleLevel.SECOND]:"defaultSecondSize",[l.TitleLevel.THIRD]:"defaultThirdSize",[l.TitleLevel.FOURTH]:"defaultFourthSize",[l.TitleLevel.FIFTH]:"defaultFifthSize",[l.TitleLevel.SIXTH]:"defaultSixthSize"},Vo={[l.TitleLevel.FIRST]:1,[l.TitleLevel.SECOND]:2,[l.TitleLevel.THIRD]:3,[l.TitleLevel.FOURTH]:4,[l.TitleLevel.FIFTH]:5,[l.TitleLevel.SIXTH]:6},Nl={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 Ai;(function(o){o.NUMBER="number",o.OPERATOR="operator",o.UTILITY="utility",o.EQUAL="equal"})(Ai||(Ai={})),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 Fl={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 yl={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:l.VerticalAlign.BOTTOM},bl={placeholderColor:"#9c9b9b",bracketColor:"#2284FE",textFixColor:"blue",prefix:"[",postfix:"]",preTextFix:"{",postTextFix:"}",textFixLabel:"",preTextFixText:"",postTextFixText:"",borderWidth:1,borderColor:"#000000",activeBackgroundColor:"",disabledBackgroundColor:"",existValueBackgroundColor:"",noValueBackgroundColor:""},Wl={bottom:30,inactiveAlpha:1,maxHeightRadio:l.MaxHeightRatio.HALF,disabled:!1,editable:!0},Vl={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1,deletable:!0},Yl={top:30,inactiveAlpha:1,maxHeightRadio:l.MaxHeightRatio.HALF,disabled:!1,editable:!0},Dl={defaultColor:"#1976d2",defaultBackgroundColor:"#e3f2fd",defaultBorderRadius:4,defaultPadding:[4,4,4,4]},Ul={color:"#666666",font:"Microsoft YaHei",size:12,top:5},wl={disabled:!0,color:"#CCCCCC",lineWidth:1.5},Zl={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},Pn={PAGE_NO:"{pageNo}",PAGE_COUNT:"{pageCount}"},Ql={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},ki={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},vl={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:l.VerticalAlign.BOTTOM},Kl={lineWidth:1,strokeStyle:"#000000"},Hl={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 Yo={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},_l={tipDisabled:!0};l.LineNumberType=void 0,(function(o){o.PAGE="page",o.CONTINUITY="continuity"})(l.LineNumberType||(l.LineNumberType={}));const xl={size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:l.LineNumberType.CONTINUITY},Gl={color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0},Al={top:0,left:5},kl={defaultLineColor:"#000000",defaultLineWidth:2},Jl={disabled:!0,color:"#CCCCCC",radius:1};function Do(o={}){const t={...Hl,...o.table},e={...Yl,...o.header},n={...Wl,...o.footer},i={...Ql,...o.pageNumber},r={...Yo,...o.watermark},s={...bl,...o.control},a={...yl,...o.checkbox},c={...vl,...o.radio},d={...il,...o.cursor},u={...Xl,...o.title},R={...ki,...o.placeholder},h={...Vl,...o.group},g={...Zl,...o.pageBreak},f={..._l,...o.zone},T={...Fl,...o.background},m={...wl,...o.lineBreak},p={...Jl,...o.whiteSpace},I={...Kl,...o.separator},L={...xl,...o.lineNumber},P={...Gl,...o.pageBorder},C={...Al,...o.badge},S={...kl,...o.graffiti},F={...Dl,...o.label},N={...Ul,...o.imgCaption},V={...Cl,...o.list},Y={print:{...Eo.print,...o.modeRule?.print},readonly:{...Eo.readonly,...o.modeRule?.readonly},form:{...Eo.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:[mo.ENGLISH,mo.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:u,placeholder:R,group:h,pageBreak:g,zone:f,background:T,lineBreak:m,whiteSpace:p,separator:I,lineNumber:L,pageBorder:P,badge:C,modeRule:Y,graffiti:S,label:F,imgCaption:N,list:V,performance:{enabled:!1,threshold:16,...o.performance}}}const Ji=new Map;function Bl(o){return Ji.get(o)}function Kn(o,t){Ji.set(o,t)}function Uo(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||!Lo.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(bt(c,{...t,isHandleFirstElement:!1,isForceCompensation:!1}),c.length){const d=a.titleId||lt(),u=i.title;for(let R=0;R<c.length;R++){const h=c[R];h.title=a.title,a.level&&(h.titleId=d,h.level=a.level),Hn(h)&&(h.size||(h.size=u[Gi[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 u=0;u<c.length;u++){const R=c[u];R.listId=d,R.listType=a.listType,R.listStyle=a.listStyle,o.splice(s,0,R),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 u=0;u<c.length;u++){const R=c[u];if(R.areaId=a.areaId||d,R.area=a.area,R.areaIndex=u,R.type===l.ElementType.TABLE){const h=R.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,R),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 u=0;u<a.trList.length;u++){const R=a.trList[u],h=R.id||lt();R.id=h,(!R.minHeight||R.minHeight<d)&&(R.minHeight=d),R.height<R.minHeight&&(R.height=R.minHeight);for(let g=0;g<R.tdList.length;g++){const f=R.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&&Hn(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=Uo(a.valueList||[]);if(c.length){const d=lt();for(let u=0;u<c.length;u++){const R=c[u];R.type=a.type,R.url=a.url,R.hyperlinkId=d,o.splice(s,0,R),s++}}s--}else if(a.type===l.ElementType.DATE){o.splice(s,1);const c=Uo(a.valueList||[]);if(c.length){const d=lt();for(let u=0;u<c.length;u++){const R=c[u];R.type=a.type,R.dateFormat=a.dateFormat,R.dateId=d,o.splice(s,0,R),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:u,postTextFixText:R,value:h,placeholder:g,code:f,type:T,valueSets:m}=a.control,p=T,{editorOptions:{control:I,checkbox:L,radio:P}}=t,C=a.controlId||lt();o.splice(s,1);const S=Dt(a,[...Fo,...$t]),F=Dt(a.control,At),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 X=Y[W];o.splice(s,0,{...S,...N,controlId:C,value:X,type:a.type,control:a.control,controlComponent:l.ControlComponent.PRETEXTFIX}),s++}if(u){const W=ct(u);for(let X=0;X<W.length;X++){const O=W[X];o.splice(s,0,{...S,...F,controlId:C,value:O,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 X=f?f.split(","):[];if(Array.isArray(m)&&m.length){const O=W.reduce((b,y)=>b.concat(y.value.split("").map(D=>({...y,value:D}))),[]);let M=0;for(let b=0;b<m.length;b++){const y=m[b];o.splice(s,0,{...S,...F,controlId:C,value:"",type:a.type,control:a.control,controlComponent:l.ControlComponent.CHECKBOX,checkbox:{code:y.code,value:X.includes(y.code)}}),s++;const D=ct(y.value);for(let U=0;U<D.length;U++){const Q=D[U],G=U===D.length-1;o.splice(s,0,{...S,...V,...O[M],controlId:C,value:Q===`
|
|
62
|
-
|
|
63
|
-
`?
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
`?
|
|
68
|
-
`?
|
|
69
|
-
`?
|
|
70
|
-
`?
|
|
71
|
-
`?
|
|
72
|
-
`?
|
|
73
|
-
`?
|
|
74
|
-
`?
|
|
75
|
-
`?
|
|
76
|
-
`?
|
|
77
|
-
`?
|
|
78
|
-
`?
|
|
79
|
-
`?
|
|
61
|
+
`,c+d}boxes(t){t||(t={});const[e,n,i,l]=this.resolveScale(t),s=[];for(let a=0;a<this._tree.chld.length;a++){const{x:c,y:d,w:u,h:R}=this._tree.chld[a].bbox;s.push({x:e+c*i,y:n+d*l,w:u*i,h:R*l})}return s}box(t){t||(t={});const[e,n,i,l]=this.resolveScale(t);return{x:e+this._tree.bbox.x*i,y:n+this._tree.bbox.y*l,w:this._tree.bbox.w*i,h:this._tree.bbox.h*l}}}class ns extends qi{static convertLaTextToSVG(t){return new vl(t).svg({SCALE_X:10,SCALE_Y:10,MARGIN_X:0,MARGIN_Y:0})}render(t,e,n,i){const{scale:l}=this.options,s=e.width*l,a=e.height*l;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,u)=>{const R=new Image;R.src=e.laTexSVG,R.onload=()=>{t.drawImage(R,n,i,s,a),this.imageCache.set(e.value,R),d(e)},R.onerror=h=>{u(h)}});this.addImageObserver(c)}}}r.ListType=void 0,(function(o){o.UL="ul",o.OL="ol"})(r.ListType||(r.ListType={}));var xe;(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.CHECKBOX="checkbox"})(xe||(xe={}));var os;(function(o){o.DECIMAL="decimal"})(os||(os={})),r.ListStyle=void 0,(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.DECIMAL="decimal",o.CHECKBOX="checkbox"})(r.ListStyle||(r.ListStyle={}));const Kl={inheritStyle:!1},Ko={[xe.DISC]:"•",[xe.CIRCLE]:"◦",[xe.SQUARE]:"▫︎",[xe.CHECKBOX]:"☑️"},Hl={[r.ListType.OL]:"ol",[r.ListType.UL]:"ul"},_l={[r.ListStyle.DISC]:"disc",[r.ListStyle.CIRCLE]:"circle",[r.ListStyle.SQUARE]:"square",[r.ListStyle.DECIMAL]:"decimal",[r.ListStyle.CHECKBOX]:"checkbox"};r.TitleLevel=void 0,(function(o){o.FIRST="first",o.SECOND="second",o.THIRD="third",o.FOURTH="fourth",o.FIFTH="fifth",o.SIXTH="sixth"})(r.TitleLevel||(r.TitleLevel={}));const Al={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},is={[r.TitleLevel.FIRST]:"defaultFirstSize",[r.TitleLevel.SECOND]:"defaultSecondSize",[r.TitleLevel.THIRD]:"defaultThirdSize",[r.TitleLevel.FOURTH]:"defaultFourthSize",[r.TitleLevel.FIFTH]:"defaultFifthSize",[r.TitleLevel.SIXTH]:"defaultSixthSize"},Ho={[r.TitleLevel.FIRST]:1,[r.TitleLevel.SECOND]:2,[r.TitleLevel.THIRD]:3,[r.TitleLevel.FOURTH]:4,[r.TitleLevel.FIFTH]:5,[r.TitleLevel.SIXTH]:6},Gl={H1:r.TitleLevel.FIRST,H2:r.TitleLevel.SECOND,H3:r.TitleLevel.THIRD,H4:r.TitleLevel.FOURTH,H5:r.TitleLevel.FIFTH,H6:r.TitleLevel.SIXTH};r.BlockType=void 0,(function(o){o.IFRAME="iframe",o.VIDEO="video"})(r.BlockType||(r.BlockType={})),r.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"})(r.ControlType||(r.ControlType={})),r.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"})(r.ControlComponent||(r.ControlComponent={})),r.ControlIndentation=void 0,(function(o){o.ROW_START="rowStart",o.VALUE_START="valueStart"})(r.ControlIndentation||(r.ControlIndentation={})),r.ControlState=void 0,(function(o){o.ACTIVE="active",o.INACTIVE="inactive"})(r.ControlState||(r.ControlState={}));var ss;(function(o){o.NUMBER="number",o.OPERATOR="operator",o.UTILITY="utility",o.EQUAL="equal"})(ss||(ss={})),r.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"})(r.EditorComponent||(r.EditorComponent={}));var me;(function(o){o.PAGE="page",o.TABLE="table"})(me||(me={})),r.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"})(r.EditorMode||(r.EditorMode={})),r.EditorZone=void 0,(function(o){o.HEADER="header",o.MAIN="main",o.FOOTER="footer"})(r.EditorZone||(r.EditorZone={})),r.PageMode=void 0,(function(o){o.PAGING="paging",o.CONTINUITY="continuity"})(r.PageMode||(r.PageMode={})),r.PaperDirection=void 0,(function(o){o.VERTICAL="vertical",o.HORIZONTAL="horizontal"})(r.PaperDirection||(r.PaperDirection={})),r.WordBreak=void 0,(function(o){o.BREAK_ALL="break-all",o.BREAK_WORD="break-word"})(r.WordBreak||(r.WordBreak={})),r.RenderMode=void 0,(function(o){o.SPEED="speed",o.COMPATIBILITY="compatibility"})(r.RenderMode||(r.RenderMode={})),r.TableBorder=void 0,(function(o){o.ALL="all",o.EMPTY="empty",o.EXTERNAL="external",o.INTERNAL="internal",o.DASH="dash"})(r.TableBorder||(r.TableBorder={})),r.TdBorder=void 0,(function(o){o.TOP="top",o.RIGHT="right",o.BOTTOM="bottom",o.LEFT="left"})(r.TdBorder||(r.TdBorder={})),r.TdSlash=void 0,(function(o){o.FORWARD="forward",o.BACK="back"})(r.TdSlash||(r.TdSlash={})),r.BackgroundSize=void 0,(function(o){o.CONTAIN="contain",o.COVER="cover"})(r.BackgroundSize||(r.BackgroundSize={})),r.BackgroundRepeat=void 0,(function(o){o.REPEAT="repeat",o.NO_REPEAT="no-repeat",o.REPEAT_X="repeat-x",o.REPEAT_Y="repeat-y"})(r.BackgroundRepeat||(r.BackgroundRepeat={}));const xl={color:"#FFFFFF",image:"",size:r.BackgroundSize.COVER,repeat:r.BackgroundRepeat.NO_REPEAT,applyPageNumbers:[]};r.VerticalAlign=void 0,(function(o){o.TOP="top",o.MIDDLE="middle",o.BOTTOM="bottom"})(r.VerticalAlign||(r.VerticalAlign={}));const kl={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:r.VerticalAlign.BOTTOM},Jl={placeholderColor:"#9c9b9b",bracketColor:"#2284FE",textFixColor:"blue",prefix:"[",postfix:"]",preTextFix:"{",postTextFix:"}",textFixLabel:"",preTextFixText:"",postTextFixText:"",borderWidth:1,borderColor:"#000000",activeBackgroundColor:"",disabledBackgroundColor:"",existValueBackgroundColor:"",noValueBackgroundColor:""},Bl={bottom:30,inactiveAlpha:1,maxHeightRadio:r.MaxHeightRatio.HALF,disabled:!1,editable:!0},$l={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1,deletable:!0},zl={top:30,inactiveAlpha:1,maxHeightRadio:r.MaxHeightRatio.HALF,disabled:!1,editable:!0},jl={defaultColor:"#1976d2",defaultBackgroundColor:"#e3f2fd",defaultBorderRadius:4,defaultPadding:[4,4,4,4]},ql={color:"#666666",font:"Microsoft YaHei",size:12,top:5},ta={disabled:!0,color:"#CCCCCC",lineWidth:1.5},ea={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},Sn={PAGE_NO:"{pageNo}",PAGE_COUNT:"{pageCount}"},na={bottom:60,size:12,font:"Microsoft YaHei",color:"#000000",rowFlex:r.RowFlex.CENTER,format:Sn.PAGE_NO,numberType:r.NumberType.ARABIC,disabled:!1,startPageNo:1,fromPageNo:0,maxPageNo:null},rs={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},oa={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:r.VerticalAlign.BOTTOM},ia={lineWidth:1,strokeStyle:"#000000"},sa={tdPadding:[5,5,5,5],defaultTrMinHeight:24,defaultColMinWidth:40,defaultBorderColor:"#000000",overflow:!0};r.WatermarkType=void 0,(function(o){o.TEXT="text",o.IMAGE="image"})(r.WatermarkType||(r.WatermarkType={}));const _o={data:"",type:r.WatermarkType.TEXT,width:0,height:0,color:"#AEB5C0",opacity:.3,size:200,font:"Microsoft YaHei",repeat:!1,gap:[10,10],numberType:r.NumberType.ARABIC},ra={tipDisabled:!0};r.LineNumberType=void 0,(function(o){o.PAGE="page",o.CONTINUITY="continuity"})(r.LineNumberType||(r.LineNumberType={}));const la={size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:r.LineNumberType.CONTINUITY},aa={color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0},ca={top:0,left:5},da={defaultLineColor:"#000000",defaultLineWidth:2},ua={disabled:!0,color:"#CCCCCC",radius:1};function xn(o={}){const t={...sa,...o.table},e={...zl,...o.header},n={...Bl,...o.footer},i={...na,...o.pageNumber},l={..._o,...o.watermark},s={...Jl,...o.control},a={...kl,...o.checkbox},c={...oa,...o.radio},d={...Ll,...o.cursor},u={...Al,...o.title},R={...rs,...o.placeholder},h={...$l,...o.group},g={...ea,...o.pageBreak},T={...ra,...o.zone},f={...xl,...o.background},m={...ta,...o.lineBreak},p={...ua,...o.whiteSpace},C={...ia,...o.separator},I={...la,...o.lineNumber},P={...aa,...o.pageBorder},M={...ca,...o.badge},N={...da,...o.graffiti},F={...jl,...o.label},S={...ql,...o.imgCaption},W={...Kl,...o.list},Y={print:{...Yo.print,...o.modeRule?.print},readonly:{...Yo.readonly,...o.modeRule?.readonly},form:{...Yo.form,...o.modeRule?.form}};return{mode:r.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:r.PageMode.PAGING,renderMode:r.RenderMode.SPEED,defaultHyperlinkColor:"#0000FF",paperDirection:r.PaperDirection.VERTICAL,inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:r.WordBreak.BREAK_WORD,printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:[So.ENGLISH,So.NUMBER],contextMenuDisableKeys:[],shortcutDisableKeys:[],scrollContainerSelector:"",pageOuterSelectionDisable:!1,...o,table:t,header:e,footer:n,pageNumber:i,watermark:l,control:s,checkbox:a,radio:c,cursor:d,title:u,placeholder:R,group:h,pageBreak:g,zone:T,background:f,lineBreak:m,whiteSpace:p,separator:C,lineNumber:I,pageBorder:P,badge:M,modeRule:Y,graffiti:N,label:F,imgCaption:S,list:W,performance:{enabled:!1,threshold:16,...o.performance}}}const ls=new Map;function Ra(o){return ls.get(o)}function kn(o,t){ls.set(o,t)}function Ao(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e],i=Tt(n.value);for(let l=0;l<i.length;l++)t.push({...n,value:i[l]})}return t}const as=new Set([r.ControlComponent.PREFIX,r.ControlComponent.POSTFIX,r.ControlComponent.PRE_TEXT,r.ControlComponent.POST_TEXT,r.ControlComponent.PRETEXTFIX,r.ControlComponent.PRETEXTFIX_TEXT,r.ControlComponent.POSTTEXTFIX,r.ControlComponent.POSTTEXTFIX_TEXT,r.ControlComponent.PLACEHOLDER,r.ControlComponent.TEXTFIXLABEL,r.ControlComponent.CHECKBOX,r.ControlComponent.RADIO,r.ControlComponent.UNDERLINE]),ha=["请选择","双击获取日期","格式化日期时间"];function ga(o){const t=[];return o.filter(Boolean).forEach(e=>{t.push(e,`获取${e}`,`获取 ${e}`,`请选择${e}`,`请选择 ${e}`,`请输入${e}`,`请输入 ${e}`)}),t}function pe(o,t=[]){if(!o)return"";const e=o.replace(new RegExp(`${k}`,"g"),`
|
|
62
|
+
`),n=e.trim();return n?[...ha,...ga(t)].includes(n)?"":e:""}function Go(o,t){const e=pe(o,[t?.label||""]);if(!e)return[];const n=t?Dt(t,[...Bt,"font","size","bold","italic","underline","strikeout","rowFlex","rowMargin","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime","color"]):{};return Tt(e).map(i=>({...n,type:r.ElementType.TEXT,value:i===`
|
|
63
|
+
`?k:i}))}function Jn(o){const t=(o.code||"").split(",").map(n=>n.trim()).filter(Boolean);if(!t.length||!o.valueSets?.length)return"";const e=o.multiSelectDelimiter||",";return t.map(n=>o.valueSets?.find(i=>i.code===n)?.value).filter(n=>!!n).join(e)}function cs(o){return o.type===r.ElementType.REUSABLE_ITEM?pe(o.reusableItemConfig?.value||"",[o.label||""]):o.type===r.ElementType.CUSTOM_MACRO?pe(o.macroConfig?.value||o.value||"",[o.label||""]):o.type===r.ElementType.MACRO?pe(o.value||"",[o.label||""]):""}function Ta(o){const t=o.control;if(!t)return[];const e=[t.placeholder||"",t.label||""];if(t.type===r.ControlType.CHECKBOX||t.type===r.ControlType.RADIO){const s=pe(Jn(t),e);if(s)return Go(s,o)}const i=sn(t.value||[]);return pe(Bn(i),e)?i:t.type===r.ControlType.SELECT?Go(pe(Jn(t),e),o):[]}function fa(o){if(!o)return"";const t=[o.placeholder||"",o.label||""];if(o.type===r.ControlType.CHECKBOX||o.type===r.ControlType.RADIO){const i=pe(Jn(o),t);if(i)return i}const n=pe(Bn(o.value||[]),t);return n||(o.type===r.ControlType.SELECT?pe(Jn(o),t):"")}function xo(o){return _t(o)||o.controlComponent&&as.has(o.controlComponent)?"":o.type===r.ElementType.CONTROL?fa(o.control):o.type===r.ElementType.MACRO||o.type===r.ElementType.CUSTOM_MACRO||o.type===r.ElementType.REUSABLE_ITEM?cs(o):o.type===r.ElementType.TABLE?o.trList?.map(t=>t.tdList.map(e=>Bn(e.value||[])).join(" ")).join(`
|
|
64
|
+
`)||"":o.type===r.ElementType.TAB?" ":o.valueList?.length?Bn(o.valueList):o.value||""}function Bn(o){return o.map(t=>xo(t)).join("")}function sn(o=[]){const t=[];return o.forEach(e=>{if(_t(e)||e.controlComponent&&as.has(e.controlComponent))return;if(e.type===r.ElementType.TABLE){const i=dt(e);i.trList?.forEach(l=>{l.tdList.forEach(s=>{s.value=sn(s.value||[])})}),t.push(i);return}if(e.type===r.ElementType.CONTROL&&e.control){t.push(...Ta(e));return}if(e.type===r.ElementType.MACRO||e.type===r.ElementType.CUSTOM_MACRO||e.type===r.ElementType.REUSABLE_ITEM){t.push(...Go(cs(e),e));return}if(e.valueList?.length){const i=dt(e);i.valueList=sn(e.valueList),t.push(i);return}const n=dt(e);delete n.control,delete n.controlId,delete n.originControlId,delete n.controlComponent,n.type===r.ElementType.CONTROL&&(n.type=r.ElementType.TEXT),(n.value===`
|
|
65
|
+
`||n.value===`\r
|
|
66
|
+
`)&&(n.value=k),t.push(n)}),t}function yt(o,t){const{isHandleFirstElement:e=!0,isForceCompensation:n=!1,editorOptions:i}=t,l=o[0];(n||e&&l?.type!==r.ElementType.LIST&&(l?.type&&l.type!==r.ElementType.TEXT||!No.test(l?.value)))&&o.unshift({value:k});let s=0;for(;s<o.length;){let a=o[s];if(a.type===r.ElementType.TITLE){o.splice(s,1);const c=a.valueList||[];if(yt(c,{...t,isHandleFirstElement:!1,isForceCompensation:!1}),c.length){const d=a.titleId||gt(),u=i.title;for(let R=0;R<c.length;R++){const h=c[R];h.title=a.title,a.level&&(h.titleId=d,h.level=a.level),$n(h)&&(h.size||(h.size=u[is[h.level]]),h.bold===void 0&&(h.bold=!0)),o.splice(s,0,h),s++}}s--}else if(a.type===r.ElementType.LIST){o.splice(s,1);const c=a.valueList||[];if(yt(c,{...t,isHandleFirstElement:!0,isForceCompensation:!1}),c.length){const d=gt();for(let u=0;u<c.length;u++){const R=c[u];R.listId=d,R.listType=a.listType,R.listStyle=a.listStyle,o.splice(s,0,R),s++}}s--}else if(a.type===r.ElementType.AREA){o.splice(s,1);const c=a?.valueList||[];if(yt(c,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),c.length){const d=gt();for(let u=0;u<c.length;u++){const R=c[u];if(R.areaId=a.areaId||d,R.area=a.area,R.areaIndex=u,R.type===r.ElementType.TABLE){const h=R.trList;for(let g=0;g<h.length;g++){const T=h[g];for(let f=0;f<T.tdList.length;f++){const p=T.tdList[f].value;for(let C=0;C<p.length;C++){const I=p[C];I.areaId=a.areaId||d,I.area=a.area}}}}o.splice(s,0,R),s++}}s--}else if(a.type===r.ElementType.TABLE){const c=a.id||gt();if(a.id=c,a.trList){const{defaultTrMinHeight:d}=i.table;for(let u=0;u<a.trList.length;u++){const R=a.trList[u],h=R.id||gt();R.id=h,(!R.minHeight||R.minHeight<d)&&(R.minHeight=d),R.height<R.minHeight&&(R.height=R.minHeight);for(let g=0;g<R.tdList.length;g++){const T=R.tdList[g],f=T.id||gt();T.id=f,yt(T.value,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),!T.value[0].size&&T.value[1]?.size&&$n(T.value[1])&&(T.value[0].size=T.value[1].size);for(let m=0;m<T.value.length;m++){const p=T.value[m];p.tdId=f,p.trId=h,p.tableId=c}}}}}else if(a.type===r.ElementType.HYPERLINK){o.splice(s,1);const c=Ao(a.valueList||[]);if(c.length){const d=gt();for(let u=0;u<c.length;u++){const R=c[u];R.type=a.type,R.url=a.url,R.hyperlinkId=d,o.splice(s,0,R),s++}}s--}else if(a.type===r.ElementType.DATE){o.splice(s,1);const c=Ao(a.valueList||[]);if(c.length){const d=gt();for(let u=0;u<c.length;u++){const R=c[u];R.type=a.type,R.dateFormat=a.dateFormat,R.dateId=d,o.splice(s,0,R),s++}}s--}else if(a.type===r.ElementType.CONTROL){if(!a.control){s++;continue}if(a.control.type=="TextField"){const{preTextFix:c,postTextFix:d,preTextFixText:u,postTextFixText:R,value:h,placeholder:g,code:T,type:f,valueSets:m}=a.control,p=f,{editorOptions:{control:C,checkbox:I,radio:P}}=t,M=a.controlId||gt();o.splice(s,1);const N=Dt(a,[...Zo,...Bt]),F=Dt(a.control,Jt),S={...F,color:i.control.textFixColor,fontWeight:"blod"},W={...F,color:void 0},Y=Tt(c||C.preTextFix);for(let D=0;D<Y.length;D++){const X=Y[D];o.splice(s,0,{...N,...S,controlId:M,value:X,type:a.type,control:a.control,controlComponent:r.ControlComponent.PRETEXTFIX}),s++}if(u){const D=Tt(u);for(let X=0;X<D.length;X++){const O=D[X];o.splice(s,0,{...N,...F,controlId:M,value:O,type:a.type,control:a.control,controlComponent:r.ControlComponent.PRETEXTFIX_TEXT}),s++}}if(h&&h.length||p===r.ControlType.CHECKBOX||p===r.ControlType.RADIO||p===r.ControlType.SELECT&&T&&(!h||!h.length)){let D=h?dt(h):[];if(p===r.ControlType.CHECKBOX){const X=T?T.split(","):[];if(Array.isArray(m)&&m.length){const O=D.reduce((L,V)=>L.concat(V.value.split("").map(y=>({...V,value:y}))),[]);let E=0;for(let L=0;L<m.length;L++){const V=m[L];o.splice(s,0,{...N,...F,controlId:M,value:"",type:a.type,control:a.control,controlComponent:r.ControlComponent.CHECKBOX,checkbox:{code:V.code,value:X.includes(V.code)}}),s++;const y=Tt(V.value);for(let U=0;U<y.length;U++){const Q=y[U],K=U===y.length-1;o.splice(s,0,{...N,...W,...O[E],controlId:M,value:Q===`
|
|
67
|
+
`?k:Q,letterSpacing:K?I.gap:0,control:a.control,controlComponent:r.ControlComponent.VALUE}),E++,s++}}}}else if(p===r.ControlType.RADIO){if(Array.isArray(m)&&m.length){const X=D.reduce((E,L)=>E.concat(L.value.split("").map(V=>({...L,value:V}))),[]);let O=0;for(let E=0;E<m.length;E++){const L=m[E];o.splice(s,0,{...N,...F,controlId:M,value:"",type:a.type,control:a.control,controlComponent:r.ControlComponent.RADIO,radio:{code:L.code,value:T===L.code}}),s++;const V=Tt(L.value);for(let y=0;y<V.length;y++){const U=V[y],Q=y===V.length-1;o.splice(s,0,{...N,...W,...X[O],controlId:M,value:U===`
|
|
68
|
+
`?k:U,letterSpacing:Q?P.gap:0,control:a.control,controlComponent:r.ControlComponent.VALUE}),O++,s++}}}}else{if((!h||!h.length)&&Array.isArray(m)&&m.length){const X=T?T.split(",").map(O=>O.trim()).filter(O=>O):[];if(X.length>1){const O=[];for(const E of X){const L=m.find(V=>V.code===E);L&&O.push({value:L.value})}O.length>0&&(D=O)}else if(X.length===1){const O=m.find(E=>E.code===X[0]);O&&(D=[{value:O.value}])}}for(let X=0;X<D.length;X++){const O=D[X];if(O.type===r.ElementType.CONTROL&&O.control){const E=O,L=E.controlId||gt(),V=E.control?.value||[],y=E.control?.placeholder||"",U=E.control?.type,Q=U===r.ControlType.TEXTFIELD,K=U===r.ControlType.TEXT,z=U===r.ControlType.CHECKBOX,rt=U===r.ControlType.RADIO,at=U===r.ControlType.BUTTON,A=Q?r.ControlComponent.PRETEXTFIX:r.ControlComponent.PREFIX,it=Q?r.ControlComponent.POSTTEXTFIX:r.ControlComponent.POSTFIX,ct={...N,controlId:L,type:r.ElementType.CONTROL,control:E.control},Nt=Q?i.control.textFixColor:K?"#87d068":at?"transparent":i.control.bracketColor,Ft=at?"#1677FF":void 0,St=Q?E.control?.preTextFix||C.preTextFix:E.control?.prefix||C.prefix,le=Tt(St);for(let v=0;v<le.length;v++)o.splice(s,0,{...ct,color:Nt,highlight:Ft,originControlId:M,value:le[v],controlComponent:A}),s++;if(at){const v=E.control.buttonLabel||E.control.label||"按钮",Z=Tt(v);for(let _=0;_<Z.length;_++){const x=Z[_];o.splice(s,0,{...ct,originControlId:M,value:x,controlComponent:r.ControlComponent.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if(z){const v=E.control?.valueSets||[],Z=E.control?.code||"",_=Z?Z.split(","):[];for(let x=0;x<v.length;x++){const G=v[x];o.splice(s,0,{...ct,originControlId:M,value:"",controlComponent:r.ControlComponent.CHECKBOX,checkbox:{code:G.code,value:_.includes(G.code)}}),s++;const B=Tt(G.value||"");for(let st=0;st<B.length;st++){const J=B[st],Rt=st===B.length-1;o.splice(s,0,{...ct,...W,originControlId:M,value:J===`
|
|
69
|
+
`?k:J,letterSpacing:Rt?I.gap:0,controlComponent:r.ControlComponent.VALUE}),s++}}}else if(rt){const v=E.control?.valueSets||[],Z=E.control?.code||"";for(let _=0;_<v.length;_++){const x=v[_];o.splice(s,0,{...ct,originControlId:M,value:"",controlComponent:r.ControlComponent.RADIO,radio:{code:x.code,value:Z===x.code}}),s++;const G=Tt(x.value||"");for(let B=0;B<G.length;B++){const st=G[B],J=B===G.length-1;o.splice(s,0,{...ct,...W,originControlId:M,value:st===`
|
|
70
|
+
`?k:st,letterSpacing:J?P.gap:0,controlComponent:r.ControlComponent.VALUE}),s++}}}else if(V.length>0)for(let v=0;v<V.length;v++){const Z=V[v];if(Z.type===r.ElementType.CONTROL&&Z.control){const _=Z,x=_.controlId||gt(),G=_.control?.value||[],B=_.control?.type===r.ControlType.TEXTFIELD,st=_.control?.type===r.ControlType.TEXT,J={...ct,controlId:x,control:_.control},Rt=B?i.control.textFixColor:st?"#87d068":i.control.bracketColor,ht=B?_.control?.preTextFix||C.preTextFix:_.control?.prefix||C.prefix,et=Tt(ht);for(let j=0;j<et.length;j++)o.splice(s,0,{...J,color:Rt,originControlId:L,value:et[j],controlComponent:B?r.ControlComponent.PRETEXTFIX:r.ControlComponent.PREFIX}),s++;for(let j=0;j<G.length;j++){const H=G[j];if(H.type===r.ElementType.MENSTRUAL_HISTORY||H.type===r.ElementType.FETAL_HEART_POSITION||H.type===r.ElementType.TOOTH_POSITION||H.type===r.ElementType.MACRO||H.type===r.ElementType.CUSTOM_MACRO||H.type===r.ElementType.REUSABLE_ITEM||H.type===r.ElementType.LIST||H.type===r.ElementType.SPECIAL_SYMBOLS){const Et=H.id||gt();H.id||(H.id=Et);const Qt=_.control?.value?.find(kt=>kt.id===Et||kt.type===H.type&&kt.value===H.value);Qt&&kn(Et,Qt),o.splice(s,0,{...J,...H,id:Et,originControlId:L,controlComponent:r.ControlComponent.VALUE,type:H.type})}else o.splice(s,0,{...J,...W,...H,originControlId:L,value:H.value===`
|
|
71
|
+
`?k:H.value,controlComponent:r.ControlComponent.VALUE});s++}if(G.length===0){const j=_.control?.placeholder||"";if(j){const H=Tt(j);for(let Ot=0;Ot<H.length;Ot++)o.splice(s,0,{...J,color:i.control.placeholderColor,originControlId:L,value:H[Ot],controlComponent:r.ControlComponent.PLACEHOLDER}),s++}}const tt=B?_.control?.postTextFix||C.postTextFix:_.control?.postfix||C.postfix,nt=Tt(tt);for(let j=0;j<nt.length;j++)o.splice(s,0,{...J,color:Rt,originControlId:L,value:nt[j],controlComponent:B?r.ControlComponent.POSTTEXTFIX:r.ControlComponent.POSTFIX}),s++}else{if(Z.type===r.ElementType.MENSTRUAL_HISTORY||Z.type===r.ElementType.FETAL_HEART_POSITION||Z.type===r.ElementType.TOOTH_POSITION||Z.type===r.ElementType.MACRO||Z.type===r.ElementType.CUSTOM_MACRO||Z.type===r.ElementType.REUSABLE_ITEM||Z.type===r.ElementType.LIST||Z.type===r.ElementType.SPECIAL_SYMBOLS){const x=Z.id||gt();Z.id||(Z.id=x);const G=E.control?.value?.find(B=>B.id===x||B.type===Z.type&&B.value===Z.value);G&&kn(x,G),o.splice(s,0,{...ct,...Z,id:x,originControlId:M,controlComponent:r.ControlComponent.VALUE,type:Z.type})}else o.splice(s,0,{...ct,...W,...Z,originControlId:M,value:Z.value===`
|
|
72
|
+
`?k:Z.value,controlComponent:r.ControlComponent.VALUE});s++}}else if(y){const v=Tt(y);for(let Z=0;Z<v.length;Z++)o.splice(s,0,{...ct,color:i.control.placeholderColor,originControlId:M,value:v[Z],controlComponent:r.ControlComponent.PLACEHOLDER}),s++}else if((U===r.ControlType.SELECT||U===r.ControlType.DATE||U===r.ControlType.NUMBER)&&!E.control?.code&&y){const Z=Tt(y);for(let _=0;_<Z.length;_++)o.splice(s,0,{...ct,color:i.control.placeholderColor,originControlId:M,value:Z[_],controlComponent:r.ControlComponent.PLACEHOLDER}),s++}const ne=Q?E.control?.postTextFix||C.postTextFix:E.control?.postfix||C.postfix,w=Tt(ne);for(let v=0;v<w.length;v++)o.splice(s,0,{...ct,color:Nt,highlight:Ft,originControlId:M,value:w[v],controlComponent:it}),s++}else if(O.type===r.ElementType.MENSTRUAL_HISTORY||O.type===r.ElementType.FETAL_HEART_POSITION||O.type===r.ElementType.TOOTH_POSITION||O.type===r.ElementType.MACRO||O.type===r.ElementType.CUSTOM_MACRO||O.type===r.ElementType.REUSABLE_ITEM||O.type===r.ElementType.LIST||O.type===r.ElementType.SPECIAL_SYMBOLS){const E=O.id||gt();O.id||(O.id=E);const L=h?.find(V=>V.id===E||V.type===O.type&&V.value===O.value);L&&kn(E,L),o.splice(s,0,{...N,...O,id:E,controlId:M,control:a.control,controlComponent:r.ControlComponent.VALUE,type:O.type}),s++}else{const E=Tt(O.value||"");for(let L=0;L<E.length;L++){const V=E[L];o.splice(s,0,{...N,...W,...O,controlId:M,value:V===`
|
|
73
|
+
`?k:V,type:O.type||r.ElementType.TEXT,control:a.control,controlComponent:r.ControlComponent.VALUE}),s++}}}}}else if(g){const D={...F,color:i.control.placeholderColor},X=Tt(g);for(let O=0;O<X.length;O++){const E=X[O];o.splice(s,0,{...N,...D,controlId:M,value:E===`
|
|
74
|
+
`?k:E,type:a.type,control:a.control,controlComponent:r.ControlComponent.PLACEHOLDER}),s++}}if(R){const D=Tt(R);for(let X=0;X<D.length;X++){const O=D[X];o.splice(s,0,{...N,...F,controlId:M,value:O,type:a.type,control:a.control,controlComponent:r.ControlComponent.POSTTEXTFIX_TEXT}),s++}}const b=Tt(d||C.postTextFix);for(let D=0;D<b.length;D++){const X=b[D];o.splice(s,0,{...N,...S,controlId:M,value:X,type:a.type,control:a.control,controlComponent:r.ControlComponent.POSTTEXTFIX}),s++}s--}else{const{prefix:c,postfix:d,preText:u,postText:R,value:h,placeholder:g,code:T,type:f,valueSets:m}=a.control,{editorOptions:{control:p,checkbox:C,radio:I}}=t,P=a.controlId||gt();o.splice(s,1);const M=Dt(a,[...Zo,...Bt]),N=Dt(a.control,Jt),F={...N,color:f===r.ControlType.TEXT?"#87d068":f===r.ControlType.BUTTON?"transparent":i.control.bracketColor,highlight:f===r.ControlType.BUTTON?"#1677FF":void 0},S={...N,color:void 0},W=Tt(c||p.prefix);for(let b=0;b<W.length;b++){const D=W[b];o.splice(s,0,{...M,...F,controlId:P,value:D===`
|
|
75
|
+
`?k:D,type:a.type,control:a.control,controlComponent:r.ControlComponent.PREFIX}),s++}if(u){const b=Tt(u);for(let D=0;D<b.length;D++){const X=b[D];o.splice(s,0,{...M,...N,controlId:P,value:X,type:a.type,control:a.control,controlComponent:r.ControlComponent.PRE_TEXT}),s++}}if(h&&h.length||f===r.ControlType.CHECKBOX||f===r.ControlType.RADIO||f===r.ControlType.BUTTON||f===r.ControlType.SELECT&&T&&(!h||!h.length)){let b=h?dt(h):[];if(f===r.ControlType.CHECKBOX){const D=T?T.split(","):[];if(Array.isArray(m)&&m.length){const X=b.reduce((E,L)=>E.concat(L.value.split("").map(V=>({...L,value:V}))),[]);let O=0;for(let E=0;E<m.length;E++){const L=m[E];o.splice(s,0,{...M,...N,controlId:P,value:"",type:a.type,control:a.control,controlComponent:r.ControlComponent.CHECKBOX,checkbox:{code:L.code,value:D.includes(L.code)}}),s++;const V=Tt(L.value);for(let y=0;y<V.length;y++){const U=V[y],Q=y===V.length-1;o.splice(s,0,{...M,...S,...X[O],controlId:P,value:U===`
|
|
76
|
+
`?k:U,letterSpacing:Q?C.gap:0,control:a.control,controlComponent:r.ControlComponent.VALUE}),O++,s++}}}}else if(f===r.ControlType.RADIO){if(Array.isArray(m)&&m.length){const D=b.reduce((O,E)=>O.concat(E.value.split("").map(L=>({...E,value:L}))),[]);let X=0;for(let O=0;O<m.length;O++){const E=m[O];o.splice(s,0,{...M,...N,controlId:P,value:"",type:a.type,control:a.control,controlComponent:r.ControlComponent.RADIO,radio:{code:E.code,value:T===E.code}}),s++;const L=Tt(E.value);for(let V=0;V<L.length;V++){const y=L[V],U=V===L.length-1;o.splice(s,0,{...M,...S,...D[X],controlId:P,value:y===`
|
|
77
|
+
`?k:y,letterSpacing:U?I.gap:0,control:a.control,controlComponent:r.ControlComponent.VALUE}),X++,s++}}}}else{if(f===r.ControlType.BUTTON){const D=a.control.buttonLabel||a.control.label||"按钮",X=Tt(D);for(let O=0;O<X.length;O++){const E=X[O];o.splice(s,0,{...M,...N,controlId:P,value:E,type:r.ElementType.CONTROL,control:a.control,controlComponent:r.ControlComponent.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if((!h||!h.length)&&Array.isArray(m)&&m.length){const D=T?T.split(","):[];if(D.length>1){const X=[];for(const O of D){const E=m.find(L=>L.code===O.trim());E&&X.push({value:E.value})}X.length>0&&(b=X)}else{const X=m.find(O=>O.code===T);X&&(b=[{value:X.value}])}}if(f!==r.ControlType.BUTTON)for(let D=0;D<b.length;D++){const X=b[D];if(X.type===r.ElementType.CONTROL&&X.control){const O=X,E=O.controlId||gt(),L=O.control?.value||[],V=O.control?.placeholder||"",y=O.control?.type,U=y===r.ControlType.TEXTFIELD,Q=y===r.ControlType.TEXT,K=y===r.ControlType.CHECKBOX,z=y===r.ControlType.RADIO,rt=y===r.ControlType.BUTTON,at=U?r.ControlComponent.PRETEXTFIX:r.ControlComponent.PREFIX,A=U?r.ControlComponent.POSTTEXTFIX:r.ControlComponent.POSTFIX,it={...M,controlId:E,type:r.ElementType.CONTROL,control:O.control},ct=U?i.control.textFixColor:Q?"#87d068":rt?"transparent":i.control.bracketColor,Nt=rt?"#1677FF":void 0,Ft=U?O.control?.preTextFix||p.preTextFix:O.control?.prefix||p.prefix,St=Tt(Ft);for(let w=0;w<St.length;w++)o.splice(s,0,{...it,color:ct,highlight:Nt,originControlId:P,value:St[w],controlComponent:at}),s++;if(rt){const w=O.control.buttonLabel||O.control.label||"按钮",v=Tt(w);for(let Z=0;Z<v.length;Z++){const _=v[Z];o.splice(s,0,{...it,originControlId:P,value:_,controlComponent:r.ControlComponent.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if(K){const w=O.control?.valueSets||[],v=O.control?.code||"",Z=v?v.split(","):[];for(let _=0;_<w.length;_++){const x=w[_];o.splice(s,0,{...it,...N,originControlId:P,value:"",controlComponent:r.ControlComponent.CHECKBOX,checkbox:{code:x.code,value:Z.includes(x.code)}}),s++;const G=Tt(x.value||"");for(let B=0;B<G.length;B++){const st=G[B],J=B===G.length-1;o.splice(s,0,{...it,...S,originControlId:P,value:st===`
|
|
78
|
+
`?k:st,letterSpacing:J?C.gap:0,controlComponent:r.ControlComponent.VALUE}),s++}}}else if(z){const w=O.control?.valueSets||[],v=O.control?.code||"";for(let Z=0;Z<w.length;Z++){const _=w[Z];o.splice(s,0,{...it,...N,originControlId:P,value:"",controlComponent:r.ControlComponent.RADIO,radio:{code:_.code,value:v===_.code}}),s++;const x=Tt(_.value||"");for(let G=0;G<x.length;G++){const B=x[G],st=G===x.length-1;o.splice(s,0,{...it,...S,originControlId:P,value:B===`
|
|
79
|
+
`?k:B,letterSpacing:st?I.gap:0,controlComponent:r.ControlComponent.VALUE}),s++}}}else if(L.length>0)for(let w=0;w<L.length;w++){const v=L[w];if(v.type===r.ElementType.CONTROL&&v.control){const Z=v,_=Z.controlId||gt(),x=Z.control?.value||[],G=Z.control?.type===r.ControlType.TEXTFIELD,B=Z.control?.type===r.ControlType.TEXT,st={...it,controlId:_,control:Z.control},J=G?i.control.textFixColor:B?"#87d068":i.control.bracketColor,Rt=G?Z.control?.preTextFix||p.preTextFix:Z.control?.prefix||p.prefix,ht=Tt(Rt);for(let nt=0;nt<ht.length;nt++)o.splice(s,0,{...st,color:J,originControlId:E,value:ht[nt],controlComponent:G?r.ControlComponent.PRETEXTFIX:r.ControlComponent.PREFIX}),s++;for(let nt=0;nt<x.length;nt++){const j=x[nt];o.splice(s,0,{...st,...S,...j,originControlId:E,value:j.value===`
|
|
80
|
+
`?k:j.value,controlComponent:r.ControlComponent.VALUE}),s++}if(x.length===0){const nt=Z.control?.placeholder||"";if(nt){const j=Tt(nt);for(let H=0;H<j.length;H++)o.splice(s,0,{...st,color:i.control.placeholderColor,originControlId:E,value:j[H],controlComponent:r.ControlComponent.PLACEHOLDER}),s++}}const et=G?Z.control?.postTextFix||p.postTextFix:Z.control?.postfix||p.postfix,tt=Tt(et);for(let nt=0;nt<tt.length;nt++)o.splice(s,0,{...st,color:J,originControlId:E,value:tt[nt],controlComponent:G?r.ControlComponent.POSTTEXTFIX:r.ControlComponent.POSTFIX}),s++}else o.splice(s,0,{...it,...S,...v,originControlId:P,value:v.value===`
|
|
81
|
+
`?k:v.value,controlComponent:r.ControlComponent.VALUE}),s++}else if(V){const w=Tt(V);for(let v=0;v<w.length;v++)o.splice(s,0,{...it,color:i.control.placeholderColor,originControlId:P,value:w[v],controlComponent:r.ControlComponent.PLACEHOLDER}),s++}else if((y===r.ControlType.SELECT||y===r.ControlType.DATE||y===r.ControlType.NUMBER)&&!O.control?.code&&V){const v=Tt(V);for(let Z=0;Z<v.length;Z++)o.splice(s,0,{...it,color:i.control.placeholderColor,originControlId:P,value:v[Z],controlComponent:r.ControlComponent.PLACEHOLDER}),s++}const le=U?O.control?.postTextFix||p.postTextFix:O.control?.postfix||p.postfix,ne=Tt(le);for(let w=0;w<ne.length;w++)o.splice(s,0,{...it,color:ct,highlight:Nt,originControlId:P,value:ne[w],controlComponent:A}),s++}else if(X.type===r.ElementType.MENSTRUAL_HISTORY||X.type===r.ElementType.FETAL_HEART_POSITION||X.type===r.ElementType.TOOTH_POSITION||X.type===r.ElementType.MACRO||X.type===r.ElementType.CUSTOM_MACRO||X.type===r.ElementType.REUSABLE_ITEM||X.type===r.ElementType.LIST||X.type===r.ElementType.SPECIAL_SYMBOLS){const O=X.id||gt();X.id||(X.id=O);const E=a.control?.value;if(E){const L=E.find(V=>V.id===O||V.type===X.type&&V.value===X.value);L&&kn(O,L)}o.splice(s,0,{...M,...X,id:O,controlId:P,control:a.control,controlComponent:r.ControlComponent.VALUE,type:X.type}),s++}else{const O=Tt(X.value||"");for(let E=0;E<O.length;E++){const L=O[E];o.splice(s,0,{...M,...S,...X,controlId:P,value:L===`
|
|
82
|
+
`?k:L,type:X.type||r.ElementType.TEXT,control:a.control,controlComponent:r.ControlComponent.VALUE}),s++}}}}}else if(g){const b={...N,color:i.control.placeholderColor},D=Tt(g);for(let X=0;X<D.length;X++){const O=D[X];o.splice(s,0,{...M,...b,controlId:P,value:O===`
|
|
83
|
+
`?k:O,type:a.type,control:a.control,controlComponent:r.ControlComponent.PLACEHOLDER}),s++}}if(R){const b=Tt(R);for(let D=0;D<b.length;D++){const X=b[D];o.splice(s,0,{...M,...N,controlId:P,value:X,type:a.type,control:a.control,controlComponent:r.ControlComponent.POST_TEXT}),s++}}const Y=Tt(d||p.postfix);for(let b=0;b<Y.length;b++){const D=Y[b];o.splice(s,0,{...M,...F,controlId:P,value:D===`
|
|
84
|
+
`?k:D,type:a.type,control:a.control,controlComponent:r.ControlComponent.POSTFIX}),s++}s--}}else if((!a.type||te.includes(a.type))&&a.type!==r.ElementType.SPECIAL_SYMBOLS&&a.value?.length>1){o.splice(s,1);const c=Tt(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
85
|
`||a.value==`\r
|
|
81
|
-
`)&&(a.value=
|
|
82
|
-
`:o?.value};return o&&n.forEach(
|
|
83
|
-
`:R.value;u.value+=h}else break}else c++;a.push(u)}return a}function
|
|
84
|
-
`),n}function
|
|
85
|
-
`);for(let s=0;s<
|
|
86
|
-
`),
|
|
87
|
-
`});else if(R.nodeName==="A"){const h=R,g=h.innerText;g&&e.push({type:
|
|
88
|
-
`})}else if(R.nodeName==="UL"||R.nodeName==="OL"){const h=R,g={value:"",type:
|
|
89
|
-
`&&(m.listWrap=!0)}),
|
|
90
|
-
`}),g.valueList.push(...
|
|
91
|
-
`,type:
|
|
92
|
-
`,colgroup:[],trList:[]},
|
|
93
|
-
`})}}}}const i=document.createElement("div");document.body.appendChild(i);const
|
|
94
|
-
`;const
|
|
95
|
-
`:""}`}}}else if(
|
|
96
|
-
${
|
|
97
|
-
`:""}`})}else if(
|
|
98
|
-
`)}}return
|
|
99
|
-
`,
|
|
100
|
-
`||(t.splice(a,0,u),a++)}a--}a++}}wt(r,t,i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()})}e.insertElementList(t)}function is(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=on(t,{innerWidth:e.getOriginalInnerWidth()});Qo(o,n)}function vo(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&&wt(r,[d],i,{editorOptions:e.getOptions()}),e.insertElementList([d])}}}function ca(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(!aa(n)){const s=n.getData("text"),a=ts();if(a&&Zn(s)===Zn(a.text)){Qo(o,a.elementList);return}}es();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=>{is(o,c)});break}}else if(a.kind==="file"&&a.type.includes("image")){const c=a.getAsFile();c&&vo(o,c)}}}async function da(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=ts();if(r&&Zn(i)===Zn(r.text)){Qo(o,r.elementList);return}if(es(),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 u=await(await c.getType("text/plain")).text();u&&o.input(u)}else if(c.types.includes("text/html")&&a){const u=await(await c.getType("text/html")).text();u&&is(o,u)}else if(c.types.some(d=>d.startsWith("image/"))){const d=c.types.find(R=>R.startsWith("image/")),u=await c.getType(d);vo(o,u)}}}class ua{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||(ca(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 Ra{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 ua(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(rl&&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:u}={...i,...t},R=this.draw.getHeight(),h=this.draw.getPageGap();this.hitLineStartIndex=u,u&&(e=this.position.getPositionList()[u]);const{metrics:g,coordinate:{leftTop:f,rightTop:T},ascent:m,pageNo:p}=e,P=(this.draw.getZone().isMainActive()?p:this.draw.getPageNo())*(R+h),C=ol*n,S=Math.min(g.height/4,C),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,E=u?f[0]:T[0];if(N.style.left=`${E}px`,N.style.top=`${Y+F-C}px`,!a){this.recoveryCursor();return}const W=this.cursorDom.style.top,X=this.draw.isReadonly();this.cursorDom.style.width=`${s*n}px`,this.cursorDom.style.backgroundColor=r,this.cursorDom.style.left=`${E}px`,this.cursorDom.style.top=`${Y}px`,this.cursorDom.style.display=X?"none":"block",this.cursorDom.style.height=`${F}px`,c?this._setBlinkTimeout():this._clearBlinkTimeout(),Co(()=>{this.moveCursorToVisible({cursorPosition:e,direction:parseInt(W)>Y?Ut.UP:Ut.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=qr(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 u=i*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,R=n===Ut.UP,h=s[0]+(d?0:c.left),g=R?r[1]+u:s[1]+u,{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;R?a.scroll(T,m-(c.top-g)):a.scroll(T,m+g-c.bottom)}}}var rn;(function(o){o[o.LEFT=0]="LEFT",o[o.CENTER=1]="CENTER",o[o.RIGHT=2]="RIGHT"})(rn||(rn={}));function Te(o){return Ke?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 _n{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 u=r[c];if(u.controlId!==a.controlId||u.controlComponent===l.ControlComponent.PREFIX||u.controlComponent===l.ControlComponent.PRE_TEXT)break;if(u.controlComponent===l.ControlComponent.CHECKBOX){const R=u.checkbox;R.value=t.includes(R.code)}c--}let d=s+1;for(;d<r.length;){const u=r[d];if(u.controlId!==a.controlId||u.controlComponent===l.ControlComponent.POSTFIX||u.controlComponent===l.ControlComponent.POST_TEXT)break;if(u.controlComponent===l.ControlComponent.CHECKBOX){const R=u.checkbox;R.value=t.includes(R.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 Ko extends _n{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 u=r[c];if(u.controlId!==a.controlId||u.controlComponent===l.ControlComponent.PREFIX||u.controlComponent===l.ControlComponent.PRE_TEXT)break;if(u.controlComponent===l.ControlComponent.RADIO){const R=u.radio;R.value=t.includes(R.code)}c--}let d=s+1;for(;d<r.length;){const u=r[d];if(u.controlId!==a.controlId||u.controlComponent===l.ControlComponent.POSTFIX||u.controlComponent===l.ControlComponent.POST_TEXT)break;if(u.controlComponent===l.ControlComponent.RADIO){const R=u.radio;R.value=t.includes(R.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:s,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}}function ss(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 rs(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 _n&&r.setSelect(i)}}function ls(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 Ko&&r.setSelect(i)}}function ha(o,t){const e=t.getDraw();let n=e.isReadonly();const i=e.getRange(),r=e.getPosition(),s=i.getRange();if(o.button===rn.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())){ss(t);return}t.isAllowSelection=!0;const d=at(r.getPositionContext()),u=r.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!u)return;const{index:R,isDirectHit:h,isCheckbox:g,isRadio:f,isImage:T,isLabel:m,isMacro:p,isTable:I,tdValueIndex:L,hitLineStartIndex:P}=u;h&&p&&console.log("mousedown - positionResult:",{index:R,isDirectHit:h,isMacro:p}),t.mouseDownStartPosition={...u,index:I?L:R,originalIndex:R,x:o.offsetX,y:o.offsetY};const C=e.getElementList(),S=r.getPositionList(),F=I?L:R;let N;I?N=e.getTd().value[L]:N=C[F];const V=!!(h&&T),Y=!!(h&&g),E=!!(h&&f),W=!!(h&&m),X=!!(h&&p),O=ot=>ot&&(ot.type===l.ElementType.MACRO||ot.type===l.ElementType.CUSTOM_MACRO||ot.type===l.ElementType.REUSABLE_ITEM||ot.type===l.ElementType.SUB_TEMPLATE||ot.type===l.ElementType.MENSTRUAL_HISTORY||ot.type===l.ElementType.FETAL_HEART_POSITION||ot.type===l.ElementType.TOOTH_POSITION||ot.type===l.ElementType.LIST||ot.type===l.ElementType.SPECIAL_SYMBOLS),M=ot=>ot&&!!ot.originControlId&&!!ot.controlId,b=ot=>ot&&!!ot.originControlId&&!!ot.controlId&&(ot.controlComponent===l.ControlComponent.POSTFIX||ot.controlComponent===l.ControlComponent.POSTTEXTFIX||ot.controlComponent===l.ControlComponent.POST_TEXT||ot.controlComponent===l.ControlComponent.PLACEHOLDER),y=e.getMode()===l.EditorMode.FORM,D=y?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(y&&(N?.controlId||N?.originControlId)){let ot;const ut=N.originControlId||N.controlId;for(let ht=F;ht>=0;ht--){const K=C[ht];if(K.controlId===ut&&!K.originControlId&&K.control?.type){ot=K.control.type;break}if(K.controlId!==N.controlId&&K.controlId!==ut)break}if(ot===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(ot===l.ControlType.TEXTFIELD){const ht=N.controlComponent;if(!M(N)){if(!(F>0&&b(C[F-1]))){if(!(N.controlComponent===l.ControlComponent.VALUE&&O(N))){if(ht===l.ControlComponent.PRETEXTFIX||ht===l.ControlComponent.PRETEXTFIX_TEXT||ht===l.ControlComponent.POSTTEXTFIX||ht===l.ControlComponent.POSTTEXTFIX_TEXT||ht===l.ControlComponent.TEXTFIXLABEL||ht===l.ControlComponent.PREFIX||ht===l.ControlComponent.POSTFIX||ht===l.ControlComponent.PRE_TEXT||ht===l.ControlComponent.POST_TEXT||ht===l.ControlComponent.PLACEHOLDER)for(let K=F+1;K<C.length;K++){const v=C[K];if(v.controlId!==ut&&v.originControlId!==ut)break;if(v.controlComponent===l.ControlComponent.VALUE&&!O(v)){U=K;break}if(v.controlComponent===l.ControlComponent.POSTTEXTFIX||v.controlComponent===l.ControlComponent.POSTFIX){for(let w=F-1;w>=0;w--){const Z=C[w];if(Z.controlId!==ut&&Z.originControlId!==ut)break;if(Z.controlComponent===l.ControlComponent.VALUE&&!O(Z)){U=w;break}}break}}else if(ht===l.ControlComponent.VALUE&&F>0){const K=C[F-1];if(K&&(K.controlId===ut||K.originControlId===ut)&&K.controlComponent===l.ControlComponent.VALUE&&O(K)){let v=!1;for(let w=F-2;w>=0;w--){const Z=C[w];if(Z.controlId!==ut&&Z.originControlId!==ut||Z.controlComponent!==l.ControlComponent.VALUE&&!Z.originControlId&&Z.controlId===ut)break;if(!O(Z)){U=w+1,v=!0;break}}if(!v)for(let w=F;w<C.length;w++){const Z=C[w];if(Z.controlId!==ut&&Z.originControlId!==ut||(Z.controlComponent===l.ControlComponent.POSTTEXTFIX||Z.controlComponent===l.ControlComponent.POSTFIX)&&!Z.originControlId&&Z.controlId===ut)break;if(!O(Z)){U=w,v=!0;break}}}}}}}}}if(~R){Q&&(U=Math.min(Math.max(U,D.startIndex),D.endIndex));let ot=U,ut=U;if(o.shiftKey){const{startIndex:ht}=i.getRange();~ht&&r.getPositionContext().tdId===d.tdId&&(F>ht?ot=ht:ut=ht)}if(Q&&(ot=Math.min(Math.max(ot,D.startIndex),D.endIndex),ut=Math.min(Math.max(ut,D.startIndex),D.endIndex),U=Math.min(Math.max(U,D.startIndex),D.endIndex)),i.setRange(ot,ut),r.setCursorPosition(S[U]),n=e.isReadonly(),Y&&!n)rs(N,e);else if(E&&!n)ls(N,e);else if(N.controlComponent===l.ControlComponent.VALUE&&(N.control?.type===l.ControlType.CHECKBOX||N.control?.type===l.ControlType.RADIO)){let ht=F;for(;ht>0;){const K=C[ht];if(K.controlComponent===l.ControlComponent.CHECKBOX){rs(K,e);break}else if(K.controlComponent===l.ControlComponent.RADIO){ls(K,e);break}ht--}}else{const ht=N?.control?.type===l.ControlType.BUTTON&&!N.control?.buttonText,K=h&&ht;let v=!1;if(y&&N?.controlId&&N?.controlComponent===l.ControlComponent.VALUE&&!N.originControlId)for(let x=F;x>=0;x--){const A=C[x];if(A.controlId!==N.controlId)break;if(A.control?.type===l.ControlType.TEXTFIELD){v=!0;break}}const w=v&&O(N),Z=X&&!w?U+1:void 0;e.render({curIndex:X&&!w?Z:U,isCompute:!1,isSubmitHistory:!1,isSetCursor:!V&&!Y&&!E&&!(K&&y)&&!w});const J=C[U];if(!n&&h&&J?.controlId&&o.button===rn.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}),X&&(N.type===l.ElementType.MACRO||N.type===l.ElementType.CUSTOM_MACRO||N.type===l.ElementType.REUSABLE_ITEM)){const ot=e.getMode();if(ot===l.EditorMode.EDIT&&N.type===l.ElementType.CUSTOM_MACRO)G.isSubscribe("macroClick")&&G.emit("macroClick",{evt:o,element:N});else if(ot===l.EditorMode.FORM){let ut=!1;N.type===l.ElementType.CUSTOM_MACRO&&o.button===rn.LEFT&&!n&&(ut=e.getMacroParticle().activateInlineEditor(N,F)),!ut&&G.isSubscribe("macroValueChange")&&G.emit("macroValueChange",{evt:o,element:N})}}o.button===rn.LEFT&&X&&N.type===l.ElementType.SUB_TEMPLATE&&e.getMode()===l.EditorMode.FORM&&G.isSubscribe("subTemplateClick")&&G.emit("subTemplateClick",{evt:o,element:N});const H=e.getPreviewer();if(H.clearResizer(),V){const ot={dragDisable:n||!N.controlId&&e.getMode()===l.EditorMode.FORM};N.type===l.ElementType.LATEX&&(ot.mime="svg",ot.srcKey="laTexSVG"),H.drawResizer(N,S[F],ot),e.getCursor().drawCursor({isShow:!1}),ss(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 tt=e.getTableTool();tt.dispose(),I&&!n&&e.getMode()!==l.EditorMode.FORM&&tt.render();const st=e.getHyperlinkParticle();st.clearHyperlinkPopup(),N.type===l.ElementType.HYPERLINK&&(Te(o)?st.openHyperlink(N):st.drawHyperlinkPopup(N,S[F]));const et=e.getDateParticle();et.clearDatePicker(),N.type===l.ElementType.DATE&&!n&&et.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 q=e.getFetalHeartPositionParticle();q.clearFetalHeartPositionEditor(),N.type===l.ElementType.FETAL_HEART_POSITION&&h&&(e.getMode()===l.EditorMode.FORM||e.getMode()===l.EditorMode.EDIT)&&q.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 xn(o){const t=lt();return Reflect.set(o,"dragId",t),t}function Gn(o,t){return t.findIndex(e=>e.dragId===o)}function as(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 ga(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,u=t.cachePositionContext,R=s.getRange(),h=a.startIndex===a.endIndex,g=h?a.startIndex-1:a.startIndex,f=a.endIndex;if(R.startIndex>=g&&R.endIndex<=f&&t.cachePositionContext?.tdId===r.tdId){e.clearSideEffect();let et=!1,nt=!1;if(h){const q=c[f];if(q.type===l.ElementType.IMAGE||q.type===l.ElementType.LATEX){if(as(q,o,t),q.imgDisplay===l.ImageDisplay.SURROUND||q.imgDisplay===l.ImageDisplay.FLOAT_TOP||q.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(q),et=!0;else{const dt=d[f];e.getPreviewer().drawResizer(q,dt)}nt=q.imgDisplay===l.ImageDisplay.SURROUND}}s.replaceRange({...a}),e.render({isCompute:nt,isSubmitHistory:et,isSetCursor:!1});return}const T=c.slice(g+1,f+1),m=T.find(et=>et.controlId);if(m){const et=c[g+1],nt=c[f];if(!((!et.controlId||et.controlComponent===l.ControlComponent.PREFIX)&&(!nt.controlId||nt.controlComponent===l.ControlComponent.POSTFIX)||et.controlId===nt.controlId&&et.controlComponent===l.ControlComponent.PREFIX&&nt.controlComponent===l.ControlComponent.POSTFIX||et.control?.type===l.ControlType.TEXT&&et.controlComponent===l.ControlComponent.VALUE&&nt.control?.type===l.ControlType.TEXT&&nt.controlComponent===l.ControlComponent.VALUE)){e.render({curIndex:R.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const p=e.getControl(),I=e.getElementList(),L=!m||!!I[R.startIndex].controlId||!p.getIsElementListContainFullControl(T),P=e.getOptions(),C=T.map(et=>{if(!et.type||et.type===l.ElementType.TEXT){const nt={value:et.value},q=Re;return L||q.push(...No),q.forEach(dt=>{const ot=et[dt];ot!==void 0&&(nt[dt]=ot)}),nt}else{let nt=at(et);return L&&(nt=se(nt,No)),bt([nt],{isHandleFirstElement:!1,editorOptions:P}),nt}});wt(I,C,R.startIndex,{editorOptions:e.getOptions()});const S=c[g],F=d[g],N=xn(c[g]),V=xn(c[f]),Y=C.length;let E=R.startIndex,W=E+Y;const X=p.getActiveControl();if(X&&c[E].controlComponent!==l.ControlComponent.POSTFIX?(W=X.setValue(C),E=W-Y):e.spliceElementList(I,E+1,0,C),!~W){e.render({isSetCursor:!1});return}const O=xn(I[E]),M=xn(I[W]),b=Gn(N,c),y=Gn(V,c),D=c[y];if(D.controlId&&D.controlComponent!==l.ControlComponent.POSTFIX)s.replaceRange({...a,startIndex:b,endIndex:y}),p.getActiveControl()?.cut();else{let et=!0;if(u?.isTable){const{tableId:nt,trIndex:q,tdIndex:dt}=u;et=!e.getOriginalElementList().some(ut=>ut.id===nt&&ut?.trList?.[q]?.tdList?.[dt]?.deletable===!1)}et&&e.spliceElementList(c,b+1,y-b)}const U=I[R.startIndex],Q=i[R.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=Gn(O,I),tt=Gn(M,I);s.setRange(h?tt:H,tt,R.tableId,R.startTdIndex,R.endTdIndex,R.startTrIndex,R.endTrIndex),e.clearSideEffect();let st=null;if(h){const nt=e.getElementList()[tt];(nt.type===l.ElementType.IMAGE||nt.type===l.ElementType.LATEX)&&(as(nt,o,t),st=nt)}if(e.render({isSetCursor:!1}),X?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()[tt];e.getPreviewer().drawResizer(st,nt)}}else t.isAllowDrag&&t.cacheRange?.startIndex!==t.cacheRange?.endIndex&&t.mousedown(o)}function fa(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 Ta(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 O=e.getElementList(),M=c.isTable?c.tdValueIndex:c.index,b=O[M];b?.control?.type===l.ControlType.BUTTON&&!b.control?.buttonText?s&&(s.style.cursor="pointer"):s&&(s.style.cursor="text")}else s&&(s.style.cursor="text");if(t.isAllowDrag){const O=o.offsetX,M=o.offsetY,{startIndex:b,endIndex:y}=t.cacheRange,D=t.cachePositionList;for(let Q=b+1;Q<=y;Q++){const{coordinate:{leftTop:G,rightBottom:H}}=D[Q];if(O>=G[0]&&O<=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 u=o.target.dataset.index;u&&e.setPageNo(Number(u));const R=e.getPosition(),h=R.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:C,isTable:S,tdIndex:F,tdId:N,trIndex:V,tableId:Y}=t.mouseDownStartPosition,E=f?T:g,W=e.getRange();let X;if(P!==N&&P&&N){const O=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(O,M)){const b=(O.valueStartIndex??0)+C,y=(M.valueStartIndex??0)+T;X=[{index:b,element:O.value[C],originalId:O.originalId,isCurrent:!1,length:O.value.length,startIndex:O.valueStartIndex??0},{index:y,element:M.value[T],originalId:M.originalId,isCurrent:!0,length:M.value.length,startIndex:M.valueStartIndex??0}]}}if(f&&S&&P!==N&&!X)W.setRange(E,E,I,F,m,V,p),R.setPositionContext({isTable:!!f,index:g,trIndex:p,tdIndex:m,tdId:P,trId:L,tableId:I});else{let O=~E?E:0;if((S||f)&&Y!==I&&!X)return;R.setPositionContext({isTable:!!f,index:g,trIndex:p,tdIndex:m,tdId:P,trId:L,tableId:I});let M=C,b,y;if(X)[{element:b},{element:y}]=X;else{const Q=e.getElementList();b=Q[M+1],y=Q[O]}if(M===O||b?.controlComponent===l.ControlComponent.PLACEHOLDER&&y?.controlComponent===l.ControlComponent.PLACEHOLDER&&b.controlId===y.controlId)return;if(M>O&&([M,O]=[O,M]),e.getMode()===l.EditorMode.FORM){const Q=n.getActiveTextControlLimit();Q&&(M=Math.min(Math.max(M,Q.startIndex),Q.endIndex),O=Math.min(Math.max(O,Q.startIndex),Q.endIndex));const G=e.getElementList(),H=G[M],tt=G[O];if(H?.control?.type===l.ControlType.TEXTFIELD||tt?.control?.type===l.ControlType.TEXTFIELD){const st=H?.controlId||tt?.controlId;if(st){let et=-1,nt=-1;for(let q=M;q>=0;q--){const dt=G[q];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){et=q+1;break}}for(let q=O;q<G.length;q++){const dt=G[q];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=q-1;break}}et!==-1&&M<et&&(M=et),nt!==-1&&O>nt&&(O=nt)}}}let U;if(X){const[Q,G]=X.sort((H,tt)=>H.index-tt.index);U={originalId:X[0].originalId??X[1].originalId,startIndex:Q.index,endIndex:G.index},Q.isCurrent?(M=Q.index,O=Q.length-1):(M=0,O=U.endIndex-G.startIndex)}W.setRange(M,O,void 0,void 0,void 0,void 0,void 0,U)}e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}function ma(o,t){const e=o[t];if(!e?.subTemplateParentId)return null;const n=e.subTemplateParentId;for(let i=t-1;i>=0;i--){const r=o[i];if(r.type===l.ElementType.SUB_TEMPLATE&&r.id===n)return{labelIndex:i,labelElement:r};if(r.type===l.ElementType.SUB_TEMPLATE&&r.id!==n)break}return null}function cs(o,t,e){const n=o[t];n.subTemplateExpanded=!1,n.hide=!1;let i=t+1;for(;i<o.length&&o[i].subTemplateParentId===n.id;)i++;const r=i-t-1;return r>0&&e.spliceElementList(o,t+1,r),t}function pa(o){const t=o.getDraw(),e=t.getRange(),n=e.getRange(),i=t.getElementList(),r=i[n.startIndex];if(!vt(r))return;let s=n.startIndex;for(;s>0;){const a=i[s];if(a.type===l.ElementType.SUB_TEMPLATE&&a.subTemplateExpanded){const u=cs(i,s,t);n.startIndex=u,n.endIndex=u,e.replaceRange(n);const R=t.getPosition(),h=R.getPositionList();R.setCursorPosition(h[u]);return}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||!vt(d)){if(c){n.startIndex=c,n.endIndex=c,e.replaceRange(n);const u=t.getPosition(),R=u.getPositionList();u.setCursorPosition(R[c])}break}}}function La(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 Ia(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;n.getIsCollapsed()&&pa(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 R=d[r-1],h=d[r];if(R?.subTemplateParentId){const Y=ma(d,r-1);if(Y){const E=cs(d,Y.labelIndex,e);e.getGlobalEvent().setCanvasEventAbility(),n.setRange(E,E),e.render({curIndex:E});return}}const f=e.getPosition().getPositionList(),T=f[r],m=f[r-1],p=T&&m&&T.rowIndex===m.rowIndex,I=R?.controlComponent===l.ControlComponent.PREFIX||R?.controlComponent===l.ControlComponent.PRETEXTFIX||R?.controlComponent===l.ControlComponent.PRE_TEXT||R?.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT,L=R?.controlComponent===l.ControlComponent.POSTFIX||R?.controlComponent===l.ControlComponent.POSTTEXTFIX||R?.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||R?.controlComponent===l.ControlComponent.POST_TEXT,P=!!R?.controlId,C=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(C&&I&&P&&p)return;const{isInParent:N,parentControlId:V}=La(d,r,R);if(L&&P&&p&&N){if(R.originControlId&&V)for(let Y=r;Y<d.length;Y++){const E=d[Y];if(E.controlId===V&&!E.originControlId){if(E.controlComponent===l.ControlComponent.VALUE){n.setRange(Y,Y),e.render({curIndex:Y,isSubmitHistory:!1});return}if(E.controlComponent===l.ControlComponent.POSTFIX||E.controlComponent===l.ControlComponent.POSTTEXTFIX||E.controlComponent===l.ControlComponent.POST_TEXT)return}E.controlId!==V&&E.originControlId}return}if(L&&P&&p&&!N&&!(F&&!C&&!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 R=e.getTableParticle().getRangeRowCol();if(!R)return;let h=!1;for(let g=0;g<R.length;g++){const f=R[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 R=e.getPosition().getCursorPosition();if(!R)return;const{index:h}=R,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 m=T.value===_?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 ds(o,t,e){const n=o[t];n.subTemplateExpanded=!1,n.hide=!1;let i=t+1;for(;i<o.length&&o[i].subTemplateParentId===n.id;)i++;const r=i-t-1;return r>0&&e.spliceElementList(o,t+1,r),t}function Pa(o){const t=o.getDraw(),n=t.getRange().getRange(),i=t.getElementList(),r=i[n.startIndex+1];if(!vt(r))return;const s=n.startIndex+1;for(;s<i.length;){const a=i[s];if(a.type===l.ElementType.SUB_TEMPLATE&&a.subTemplateExpanded){ds(i,s,t);return}let c=null;a.controlId?c=t.getControl().removeControl(s):(t.spliceElementList(i,s,1),c=s);const d=i[c];if(!d||!vt(d))break}}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,isCrossRowCol:s,splitTdRange:a}=n.getRange(),c=e.getElementList(),d=e.getControl();n.getIsCollapsed()&&Pa(t);let u;if(s){const R=e.getTableParticle().getRangeRowCol();if(!R)return;let h=!1;for(let g=0;g<R.length;g++){const f=R[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)}}u=h?0:null}else if(d.getActiveControl()&&d.getIsRangeWithinControl())u=d.keydown(o),u&&d.emitControlContentChange();else if(c[r+1]?.controlId)u=d.removeControl(r+1);else if(n.getIsCollapsed()&&c[r+1]?.subTemplateParentId){const R=c[r+1].subTemplateParentId;let h=-1;for(let g=r;g>=0;g--){const f=c[g];if(f.type===l.ElementType.SUB_TEMPLATE&&f.id===R){h=g;break}}h!==-1?u=ds(c,h,e):u=null}else{e.removeSplitTdOtherRangeElements();const R=e.getPosition(),h=R.getCursorPosition();if(!h)return;const{index:g}=h,f=R.getPositionContext();if(f.isDirectHit&&f.isImage)e.spliceElementList(c,g,1),u=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}u=T?g:i,u===0&&a&&(u=e.fixPosition(!0)??u)}}e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}))}function Oa(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 u={value:_};if(o.shiftKey&&c.listId&&(u.listWrap=!0),wt(a,[u],i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()}),o.shiftKey&&d.areaId&&d.areaId!==a[r+1]?.areaId&&(u=se(u,He)),!(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=[...$t],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(...Re),p.forEach(P=>{const C=m[P];C!==void 0&&(u[P]=C)})}}const R=e.getControl(),h=R.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,[u]),g=p+1}else if(h&&R.getIsRangeWithinControl())g=R.setValue([u]),R.emitControlContentChange();else{const p=e.getPosition().getCursorPosition();if(!p)return;const{index:I}=p;if(s){if(e.spliceElementList(a,I+1,0,[u]),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,[u]);g=I+1}~g&&(n.setRange(g,g),e.render({curIndex:g})),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 Ca(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:u}=c.getRange(),R=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 E=h[Y];if(E.controlId===V&&!E.originControlId){I=!0;break}if(E.controlId&&E.controlId!==V&&E.originControlId!==V)break}}if(f&&g.getActiveControl()&&p&&!T&&!I){g.initNextControl({direction:Ut.UP});return}let L=1;if(Te(o)){const V=e.getLetterReg(),Y=o.shiftKey&&!R&&d===r?.index?u:d;if(V.test(h[Y]?.value)){let E=Y-1;for(;E>0;){const W=h[E];if(!V.test(W.value))break;L++,E--}}}if(f){const V=h[d],Y=V?.controlId;if(Y&&V?.controlComponent===l.ControlComponent.VALUE){let E=!1;for(let W=d;W>=0;W--){const X=h[W];if(X.controlId!==Y)break;if(X.control?.type===l.ControlType.TEXTFIELD){E=!0;break}}if(E){if(V.controlComponent===l.ControlComponent.VALUE&&us(V))return;const W=d-L;if(W>=0){const X=h[W];if(X&&X.controlId===Y&&X.controlComponent===l.ControlComponent.VALUE&&us(X))return}}}}const P=T?Math.max(d-L,T.startIndex):d-L;let C=P,S=P;if(o.shiftKey&&r&&(d!==u?d===r.index?(C=d,S=u-L):(C=P,S=u):S=u),!o.shiftKey){const V=h[d];if(V.type===l.ElementType.TABLE){const Y=V.trList,E=Y.length-1,W=Y[E],X=W.tdList.length-1,O=W.tdList[X];i.setPositionContext({isTable:!0,index:d,trIndex:E,tdIndex:X,tdId:O.id,trId:W.id,tableId:V.id}),C=O.value.length-1,S=C}else if(V.tableId&&d===0){const E=e.getOriginalElementList()[s.index],W=e.getTd();if(W?.linkTdPrevId){const X=e.getTdById(W.linkTdPrevId);X&&(i.setPositionContext({...s,isTable:!0,index:X.tableIndex,trIndex:X.trIndex,tdId:X.id,trId:X.trId,tableId:X.tableId}),C=X.value.length-1,S=C)}else{const X=E.trList;t:for(let O=0;O<X.length;O++){const M=X[O];if(M.id!==V.trId)continue;const b=M.tdList;for(let y=0;y<b.length;y++)if(b[y].id===V.tdId){if(O===0&&y===0)i.setPositionContext({isTable:!1}),C=s.index-1,S=C,e.getTableTool().dispose();else{let U=O,Q=y-1;Q<0&&(U=O-1,Q=X[U].tdList.length-1);const G=X[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}),C=H.value.length-1,S=C}break t}}}}}if(!~C||!~S)return;const F=e.getElementList();C=Ge(F,C),S=Ge(F,S),c.setRange(C,S);const N=C===S;e.updateTableTool(),e.render({curIndex:N?C:void 0,isSetCursor:N,isSubmitHistory:!1,isCompute:!1}),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 Sa(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:u,endIndex:R}=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 E=p.originControlId;for(let W=s+1;W<g.length;W++){const X=g[W];if(X.controlId===E&&!X.originControlId){L=!0;break}if(X.controlId&&X.controlId!==E&&X.originControlId!==E)break}}if(T&&f.getActiveControl()&&I&&!m&&!L){f.initNextControl({direction:Ut.DOWN});return}let P=1;if(Te(o)){const E=e.getLetterReg(),W=o.shiftKey&&!h&&u===r?.index?R:u;if(E.test(g[W+1]?.value)){let X=W+2;for(;X<g.length;){const O=g[X];if(!E.test(O.value))break;P++,X++}}}if(T){const E=g[R],W=E?.controlId;if(W&&E?.controlComponent===l.ControlComponent.VALUE){let X=!1;for(let O=R;O>=0;O--){const M=g[O];if(M.controlId!==W)break;if(M.control?.type===l.ControlType.TEXTFIELD){X=!0;break}}if(X){if(E.controlComponent===l.ControlComponent.VALUE&&Rs(E))return;const O=R+P;if(O<g.length){const M=g[O];if(M&&M.controlId===W&&M.controlComponent===l.ControlComponent.VALUE&&Rs(M))return}}}}const C=m?Math.min(R+P,m.endIndex):R+P;let S=C,F=C;if(o.shiftKey&&r&&(u!==R?u===r.index?(S=u,F=C):(S=u+P,F=R):S=u),!o.shiftKey){const E=g[R],W=g[R+1];if(W?.type===l.ElementType.TABLE){const O=W.trList[0],M=O.tdList[0];i.setPositionContext({isTable:!0,index:R+1,trIndex:0,tdIndex:0,tdId:M.id,trId:O.id,tableId:W.id}),S=0,F=0}else if(E.tableId&&!W){const X=e.getTd(),O=X?.linkTdNextId?e.getTdById(X.linkTdNextId):void 0;if(O?.value.length)i.setPositionContext({...c,isTable:!0,index:O.tableIndex,trIndex:O.trIndex,tdId:O.id,trId:O.trId,tableId:O.tableId}),S=0,F=S;else{const b=e.getOriginalElementList()[c.index].trList;t:for(let y=0;y<b.length;y++){const D=b[y];if(D.id!==E.trId)continue;const U=D.tdList;for(let Q=0;Q<U.length;Q++)if(U[Q].id===E.tdId){if(y===b.length-1&&Q===U.length-1)i.setPositionContext({isTable:!1}),S=c.index,F=S,g=e.getElementList(),e.getTableTool().dispose();else{let H=y,tt=Q+1;tt>U.length-1&&(H=y+1,tt=0);const st=b[H],et=st.tdList[tt];i.setPositionContext({isTable:!0,index:c.index,trIndex:H,tdIndex:tt,tdId:et.id,trId:st.id,tableId:E.tableId}),S=0,F=S}break t}}}}}const N=g.length-1;if(S>N||F>N)return;const V=e.getElementList();S=Ge(V,S,l.LocationPosition.AFTER),F=Ge(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 Ea(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getMode()===l.EditorMode.FORM,r=e.getControl(),s=r.getActiveControl();if(i&&s&&r.getIsRangeWithinControl())o.preventDefault(),r.initNextControl({direction:o.shiftKey?Ut.UP:Ut.DOWN});else{o.preventDefault();const a=e.getRange(),c=e.getElementList(),{startIndex:d,endIndex:u}=a.getRange(),R=a.getRangeAnchorStyle(c,u),g={...R?Dt(R,Re):null,type:l.ElementType.TAB,value:""};wt(c,[g],d,{editorOptions:e.getOptions()}),e.insertElementList([g])}}function Ho(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:[u],rightTop:[R]}}=d;if(c===a.length-1&&(s=d.index),!(r<u||r>R)){s=d.index;break}}return s}function Xa(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 u=o.key===l.KeyMap.Up;let R=-1,h=-1;const g=i.getPositionContext();if(!o.shiftKey&&g.isTable&&(u&&r.rowIndex===0||!u&&r.rowIndex===e.getRowCount()-1)){const{index:T,trIndex:m,tdIndex:p,tableId:I}=g;if(u){const L=e.getOriginalElementList();if(m===0)if(L[T].originalId){const C=T-1,S=L[C];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:C,trIndex:F,tdIndex:p}),R=N.value.length-1,h=N.value.length-1;break}}}else i.setPositionContext({isTable:!1}),R=T-1,h=R,e.getTableTool().dispose();else{let P=-1,C=-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 X=0;X<W.length;X++){const O=W[X];if(O.colIndex===F||O.colIndex+O.colspan-1>=F&&O.colIndex<=F){P=Y,C=X;break t}}}if(!~P||!~C)return;const N=S[P],V=N.tdList[C];i.setPositionContext({isTable:!0,index:T,trIndex:P,tdIndex:C,tdId:V.id,trId:N.id,tableId:I}),R=V.value.length-1,h=R}}else{const L=e.getOriginalElementList(),P=L[T],C=P.trList;if(m===C.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}),R=0,h=0;break}}else i.setPositionContext({isTable:!1}),R=T,h=R,e.getTableTool().dispose()}else{let S=-1,F=-1;const N=C[m].tdList[p].colIndex;t:for(let E=m+1;E<C.length;E++){const X=C[E].tdList;for(let O=0;O<X.length;O++){const M=X[O];if(M.colIndex===N||M.colIndex+M.colspan-1>=N&&M.colIndex<=N){S=E,F=O;break t}}}if(!~S||!~F)return;const V=C[S],Y=V.tdList[F];i.setPositionContext({isTable:!0,index:T,trIndex:S,tdIndex:F,tdId:Y.id,trId:V.id,tableId:I}),R=Y.value.length-1,h=R}}}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(u&&I===0||!u&&I===e.getRowCount()-1)return;const P=Ho({positionList:d,index:m,rowNo:p,isUp:u,cursorX:L});if(P<0)return;R=P,h=P,o.shiftKey&&(a!==c?a===r.index?R=a:h=c:u?h=c:R=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,E=-1,W=-1;if(u)t:for(let X=V.length-1;X>=0;X--){const M=V[X].tdList;for(let b=0;b<M.length;b++){const y=M[b],D=y.x*F+N[3],U=y.width*F;if(L>=D&&L<=D+U){const Q=y.positionList,G=Q[Q.length-1],H=Ho({positionList:Q,index:G.index+1,rowNo:G.rowNo-1,isUp:u,cursorX:L})||G.index;Y=X,E=b,W=H;break t}}}else t:for(let X=0;X<V.length;X++){const M=V[X].tdList;for(let b=0;b<M.length;b++){const y=M[b],D=y.x*F+N[3],U=y.width*F;if(L>=D&&L<=D+U){const Q=y.positionList,G=Ho({positionList:Q,index:-1,rowNo:-1,isUp:u,cursorX:L})||0;Y=X,E=b,W=G;break t}}}if(~Y&&~E&&~W){const X=V[Y],O=X.tdList[E];i.setPositionContext({isTable:!0,index:P,trIndex:Y,tdIndex:E,tdId:O.id,trId:X.id,tableId:S.id}),R=W,h=R,d=i.getPositionList()}}}if(!~R||!~h)return;R>h&&([R,h]=[h,R]),s.setRange(R,h);const f=R===h;e.render({curIndex:f?R:void 0,isSetCursor:f,isSubmitHistory:!1,isCompute:!1}),f||(e.getCursor().moveCursorToVisible({cursorPosition:d[u?R:h],direction:u?Ut.UP:Ut.DOWN}),e.updateTableTool())}function Na(o,t){if(t.isComposing)return;const e=t.getDraw();if(o.key===l.KeyMap.Backspace)Ia(o,t);else if(o.key===l.KeyMap.Delete)Ma(o,t);else if(o.key===l.KeyMap.Enter)Oa(o,t);else if(o.key===l.KeyMap.Left)Ca(o,t);else if(o.key===l.KeyMap.Right)Sa(o,t);else if(o.key===l.KeyMap.Up||o.key===l.KeyMap.Down)Xa(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&&Ea(o,t)}function Fa(o){return/[\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef]/.test(o)}function ya(o){return/[a-zA-Z]/.test(o)}function ba(o,t){return Fa(o)?t:ya(o)?"Times New Roman":t}function Wa(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 Va(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 _o(o,t,e="input"){const n=Vt(),i=t.getDraw(),r=i.getControl(),s=i.getOptions(),a=i.getElementList(),u=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();if(vt(m[T])){const v=m[T]?.type===l.ElementType.SUB_TEMPLATE&&m[T].subTemplateExpanded?l.LocationPosition.AFTER:l.LocationPosition.BEFORE,w=Ge(m,T,v);if(w!==T&&!vt(m[w])){f.setRange(w,w),i.render({curIndex:w,isSubmitHistory:!1});return}}const 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 K=r.getActiveTextControlLimit();if(!r.getActiveControl()||!r.getIsRangeWithinControl()&&!r.getIsRangeInPostfix())return;if(K){const x=f.getRange();if(x.startIndex<K.startIndex||x.endIndex>K.endIndex){const A=Math.min(Math.max(x.endIndex,K.startIndex),K.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,C=t.compositionInfo?.perfStartTime,S=Da(t,i.getElementList());g||i.getCursor().clearAgentDomValue();const{TEXT:F,HYPERLINK:N,SUBSCRIPT:V,SUPERSCRIPT:Y,DATE:E,TAB:W}=l.ElementType,X=o.replaceAll(`
|
|
101
|
-
`,_),{startIndex:O,endIndex:M}=f.getRange(),b=f.getRangeAnchorStyle(S,O);if(!b)return;const y=O>0?S[O-1]:null,D=!!(b.controlId||b.control),Q={...!D&&y?y:b,...P},G=i.isDesignMode(),H=S[M+1],tt=Wa(H)&&!H?.originControlId,st=Va(b)&&!b.originControlId||b.type===l.ElementType.CONTROL&&b.controlComponent===l.ControlComponent.VALUE&&H?.type!==l.ElementType.CONTROL&&!b.originControlId,et=tt||st,nt=et?{...b,type:void 0,control:void 0,controlId:void 0,controlComponent:void 0,originControlId:void 0,color:s.defaultColor,highlight:void 0}:b,q=et||D?nt:Q,dt=ct(X).map(K=>{const v={value:K};if(G||!q.title?.disabled&&!q.control?.disabled){const w=S[M+1];(!q.type||q.type===F||q.type===N&&w?.type===N||q.type===E&&w?.type===E||q.type===V&&w?.type===V||q.type===Y&&w?.type===Y)&&al.forEach(Z=>{if(Z==="groupIds"&&!w?.groupIds)return;const J=q[Z];J!==void 0&&(v[Z]=J)}),(P||q.type===W)&&Re.forEach(Z=>{const J=P?.[Z]||q[Z];J!==void 0&&(v[Z]=J)}),g&&(v.underline=!0)}if(!et){const w=b.originControlId&&(b.controlComponent===l.ControlComponent.POSTFIX||b.controlComponent===l.ControlComponent.POSTTEXTFIX||b.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||b.controlComponent===l.ControlComponent.POST_TEXT),Z=!b.originControlId&&b.controlId&&(b.controlComponent===l.ControlComponent.POSTFIX||b.controlComponent===l.ControlComponent.POSTTEXTFIX||b.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||b.controlComponent===l.ControlComponent.POST_TEXT)&&H?.controlId&&H.controlId!==b.controlId,J=b.controlId&&b.originControlId&&(b.controlComponent===l.ControlComponent.VALUE||b.controlComponent===l.ControlComponent.PLACEHOLDER);if(w&&!v.controlId){const x=b.originControlId;let A=null;for(let $=O;$>=0;$--){const B=S[$];if(B.controlId===x&&!B.originControlId&&B.control){A=B.control;break}}v.controlId=x,v.controlComponent=l.ControlComponent.VALUE,A&&(v.control=A)}else if(Z&&!v.controlId){if(H?.controlId&&H.controlId!==b.controlId)if(H.controlComponent===l.ControlComponent.PREFIX||H.controlComponent===l.ControlComponent.PRETEXTFIX)for(let x=O;x>=0;x--){const A=S[x];if(A.controlId===b.controlId&&(A.controlComponent===l.ControlComponent.PREFIX||A.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let $=x-1;$>=0;$--){const B=S[$];if(B.controlId&&B.controlId!==b.controlId&&(B.controlComponent===l.ControlComponent.PRETEXTFIX||B.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||B.controlComponent===l.ControlComponent.PREFIX||B.controlComponent===l.ControlComponent.PRE_TEXT)){v.controlId=B.controlId,v.controlComponent=l.ControlComponent.VALUE,B.control&&(v.control=B.control);break}if(B.controlId&&B.controlId!==b.controlId&&(B.controlComponent===l.ControlComponent.POSTFIX||B.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}else(H.controlComponent===l.ControlComponent.POSTFIX||H.controlComponent===l.ControlComponent.POSTTEXTFIX)&&(v.controlId=H.controlId,v.controlComponent=l.ControlComponent.VALUE,H.control&&(v.control=H.control));if(!v.controlId)for(let x=O;x>=0;x--){const A=S[x];if(A.controlId===b.controlId&&(A.controlComponent===l.ControlComponent.PREFIX||A.controlComponent===l.ControlComponent.PRETEXTFIX)){for(let $=x-1;$>=0;$--){const B=S[$];if(B.controlId&&B.controlId!==b.controlId&&(B.controlComponent===l.ControlComponent.PRETEXTFIX||B.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||B.controlComponent===l.ControlComponent.PREFIX||B.controlComponent===l.ControlComponent.PRE_TEXT)){v.controlId=B.controlId,v.controlComponent=l.ControlComponent.VALUE,B.control&&(v.control=B.control);break}if(B.controlId&&B.controlId!==b.controlId&&(B.controlComponent===l.ControlComponent.POSTFIX||B.controlComponent===l.ControlComponent.POSTTEXTFIX))break}break}}}else if(J&&!v.controlId){const x=b.controlId;let A=b.control;if(!A)for(let $=O;$>=0;$--){const B=S[$];if(B.controlId===x&&B.control&&(A=B.control,B.controlComponent===l.ControlComponent.PREFIX||B.controlComponent===l.ControlComponent.PRETEXTFIX))break}v.controlId=x,v.originControlId=b.originControlId,v.controlComponent=l.ControlComponent.VALUE,A&&(v.control=A)}else if(b.controlId&&!b.originControlId){let x=b.control;if(!x)for(let A=O;A>=0;A--){const $=S[A];if($.controlId===b.controlId&&!$.originControlId&&$.control){x=$.control;break}}v.controlId||(v.controlId=b.controlId),x&&!v.control&&(v.control=x),v.controlComponent||(v.controlComponent=l.ControlComponent.VALUE)}else if(!v.controlId&&!v.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}}v.controlId=x,v.controlComponent=l.ControlComponent.VALUE,A&&(v.control=A)}}if(K&&K!==_){const w=ba(K,s.defaultFont);v.font=w}return v});let ot;const ut=a[u],ht=a[u+1];if(g)ot=O;else{const K=w=>{if(dt?.length)for(let Z=0;Z<dt.length;Z++)S.splice(w+Z,0,dt[Z]);return O+dt.length},v=O+1;if(O!==M&&(i.removeSplitTdOtherRangeElements(),i.spliceElementList(S,v,M-O)),et)ot=K(v);else if(ut?.originControlId&&(ut?.controlComponent==="postfix"||ut?.controlComponent==="postTextFix"))ot=K(v);else if((ut?.control?.type===l.ControlType.NUMBER||ht?.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(),ot=O}else if((ut?.control?.type===l.ControlType.SELECT||ht?.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(),ot=O}else ut?.control?.type==="button"||ht?.control?.type==="button"?(ut?.control||ht?.control)?.buttonText?ot=O:r.getActiveControl()&&r.getIsRangeWithinControl()?(r.removePlaceholder(O,{elementList:S}),ot=r.setValue(dt),r.emitControlContentChange()):ot=O:r.getActiveControl()&&r.getIsRangeWithinControl()?(r.removePlaceholder(O,{elementList:S}),ot=r.setValue(dt),r.emitControlContentChange()):(ut?.type==="control"||ht?.type==="control")&&!et?ot=K(v):(wt(S,dt,O,{editorOptions:s}),i.spliceElementList(S,v,0,dt),ot=O+dt.length)}if(~ot&&!g){const K=Vt()-n,v=Vt();f.setRange(ot,ot),i.render({curIndex:ot,isSubmitHistory:!g,traceLabel:`input:${e}`}),So(s,`input:${e}`,Vt()-n,[{label:"mutate",duration:K},{label:"renderCall",duration:Vt()-v}],{isComposing:g,textLength:dt.length,compositionChainDuration:e==="compositionend"&&C!==void 0?Number((Vt()-C).toFixed(2)):void 0})}g&&(t.compositionInfo={value:X,startIndex:ot,endIndex:M,defaultStyle:P,perfStartTime:n})}function Ya(o){o.compositionInfo&&(o.compositionInfo=null)}function Da(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 Ua(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 os(r.slice(s+1,a+1),c);const d=t.getControl();let u;d.getActiveControl()&&d.getIsRangeWithinControl()?(u=d.cut(),d.emitControlContentChange()):(t.spliceElementList(r,s+1,a-s),u=s),e.setRange(u,u),t.render({curIndex:u})}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:[]},u=c[0],R=u[0].colIndex,h=u[u.length-1],g=h.colIndex+h.colspan-1;for(let f=R;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=Mt([d])}else r=i.getIsCollapsed()?i.getRangeRowElementList():i.getSelectionElementList();t?.isPlainText&&r?.length&&(r=[{value:xe(r)}]),r?.length&&await os(r,e.getOptions())}function Za(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")&&vo(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&&zt.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 u=-1,R=-1;for(const{segment:h,index:g,isWordLike:f}of d){const T=g+a;if(f&&s>=T&&s<T+h.length){u=T-1,R=u+h.length;break}}return~u&&~R?{startIndex:u,endIndex:R}:null}function Qa(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=po.test(n);if(c||r.test(n)){const u=t.getElementList();let R=i-1;for(;R>0;){const g=u[R].value;if(c&&po.test(g)||!c&&r.test(g))s++,R--;else break}let h=i+1;for(;h<u.length;){const g=u[h].value;if(c&&po.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 va(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)||Qa(o);s&&(r.setRange(s.startIndex,s.endIndex),e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),r.setRangeStyle())}function Ka(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 u=r+1;for(;u<s.length;){const f=s[u],T=s[u+1];if(f.value===_&&!f.listWrap||f.listId!==T?.listId||f.titleId!==T?.titleId)break;c++,u++}const R=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),R.setRange(h,g),t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}const gs={dblclick:va,threeClick:Ka};function Ha(o){o.isComposing=!0}function _a(o,t){const e=Vt();o.isComposing=!1;const n=o.getDraw(),i=n.getOptions();if(t.data)o.compositionInfo&&(o.compositionInfo.perfStartTime=e),ll?setTimeout(()=>{o.compositionInfo&&_o(t.data,o,"compositionend")},1):o.compositionInfo&&_o(t.data,o,"compositionend");else{const s=o.compositionInfo?.cancel;if(Ya(o),!s){const a=n.getRange(),{endIndex:c}=a.getRange();n.render({curIndex:c,isSubmitHistory:!1,traceLabel:"compositionend:empty"})}}n.getCursor().clearAgentDomValue(),So(i,"compositionend",Vt()-e,[],{hasData:!!t.data,dataLength:t.data?.length||0})}function xa(o){o.compositionInfo&&(o.compositionInfo.cancel=!0)}const xo={compositionstart:Ha,compositionend:_a,compositionCancel:xa};function Ga(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:u,tdValueIndex:R,index:h}=d,g=c.getPositionList(),f=u?R: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 Aa={dragover:Ga};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)),Jr(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()||Ta(t,this)}mousedown(t){this.draw.isInteractionSuspended()||ha(t,this)}click(){this.draw.isInteractionSuspended()||sl&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(t){this.draw.isInteractionSuspended()||ga(t,this)}mouseleave(t){this.draw.isInteractionSuspended()||fa(t,this)}keydown(t){this.draw.isInteractionSuspended()||Na(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()||_o(t,this,e)}async cut(){this.draw.isInteractionSuspended()||await Ua(this)}async copy(t){this.draw.isInteractionSuspended()||await wa(this,t)}compositionstart(){this.draw.isInteractionSuspended()||xo.compositionstart(this)}compositionend(t){this.draw.isInteractionSuspended()||xo.compositionend(this,t)}compositionCancel(){this.draw.isInteractionSuspended()||xo.compositionCancel(this)}drop(t){this.draw.isInteractionSuspended()||Za(t,this)}dragover(t){this.draw.isInteractionSuspended()||Aa.dragover(t,this)}}const fs={PAGE_SCALE:"pageScale"};class Ja{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 Ba{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 $a{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:u}=t,{scale:R,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 C=p.elementList[P],S=C.metrics,F=!vt(C)&&(C.imgDisplay!==l.ImageDisplay.INLINE&&C.type===l.ElementType.IMAGE||C.type===l.ElementType.LATEX)?p.ascent-S.height:p.ascent;C.left&&(g+=C.left),C.translateX&&(g+=C.translateX*R);const N={pageNo:i,index:T,value:C.value,rowIndex:a+m,rowNo:m,metrics:S,left:C.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(C.imgDisplay===l.ImageDisplay.SURROUND||C.imgDisplay===l.ImageDisplay.FLOAT_TOP||C.imgDisplay===l.ImageDisplay.FLOAT_BOTTOM){const V=e[e.length-1];V&&(N.metrics=V.metrics,N.coordinate=V.coordinate),C.imgFloatPosition||(C.imgFloatPosition={x:g,y:f,pageNo:i}),this.floatPositionList.push({pageNo:i,element:C,position:N,isTable:t.isTable,index:t.index,tdIndex:t.tdIndex,trIndex:t.trIndex,tdValueIndex:T,zone:u})}if(e.push(N),T++,g+=S.width,C.type===l.ElementType.TABLE&&!vt(C)){const V=C.tdPadding||h,Y=V[1]+V[3],E=V[0]+V[2];for(let W=0;W<C.trList.length;W++){const X=C.trList[W];for(let O=0;O<X.tdList.length;O++){const M=X.tdList[O];M.positionList=[];const b=M.rowList,y=this.computePageRowPosition({positionList:M.positionList,rowList:b,pageNo:i,startRowIndex:0,startIndex:0,startX:(M.x+V[3])*R+I+(C.translateX||0)*R,startY:(M.y+V[0])*R+L,innerWidth:(M.width-Y)*R,isTable:!0,index:T-1,tdIndex:O,trIndex:W,zone:u});if(M.verticalAlign===l.VerticalAlign.MIDDLE||M.verticalAlign===l.VerticalAlign.BOTTOM){const D=b.reduce((G,H)=>G+H.height,0),U=(M.height-E)*R-D,Q=M.verticalAlign===l.VerticalAlign.MIDDLE?U/2:U;Math.floor(Q)>0&&M.positionList.forEach(G=>{const{coordinate:{leftTop:H,leftBottom:tt,rightBottom:st,rightTop:et}}=G;H[1]+=Q,tt[1]+=Q,st[1]+=Q,et[1]+=Q})}g=y.x,f=y.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 u=e[d];if(!u?.length)continue;const R=u[0].startIndex;this.computePageRowPosition({positionList:this.positionList,rowList:u,pageNo:d,startRowIndex:c,startIndex:R,startX:i,startY:a,innerWidth:t}),c+=u.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(),u=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:C,leftBottom:S}}=s[T];if(u===p){if(p>u)break;if(P[0]-I<=e&&C[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 E=N.trList[Y];for(let W=0;W<E.tdList.length;W++){const X=E.tdList[W],O=this.getPositionByXY({x:e,y:n,td:X,pageNo:c,tablePosition:s[T],isTable:!0,elementList:X.value,positionList:X.positionList});if(~O.index){const{index:M,hitLineStartIndex:b}=O,y=X.value[M];return{index:m,isCheckbox:O.isCheckbox||y.type===l.ElementType.CHECKBOX||y.controlComponent===l.ControlComponent.CHECKBOX,isRadio:y.type===l.ElementType.RADIO||y.controlComponent===l.ControlComponent.RADIO,isControl:!!y.controlId,isImage:O.isImage,isLabel:O.isLabel,isMacro:O.isMacro,isDirectHit:O.isDirectHit,isTable:!0,tdIndex:W,trIndex:Y,tdValueIndex:M,tdId:X.id,trId:E.id,tableId:N.id,hitLineStartIndex:b}}}}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,E=N.width*Y;return e>=P[0]&&e<=P[0]+E?{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 E=r[Y];if(E.value===_&&E.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!==_){const Y=C[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 R=!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],C=m.width*T,S=m.height*T;if(!(L<e&&e<L+C&&P<n&&n<P+S))return{index:h}}}const f=s.filter(T=>T.isLastLetter&&T.pageNo===u);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===u&&N.rowNo===p),C=r[P],S=s[P],F=C.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=m;else{if(C.listStyle===l.ListStyle.CHECKBOX&&e<I[0])return{index:P,isDirectHit:!0,isCheckbox:!0};h=m}R=!0;break}}if(!R){if(this.draw.getIsPagingMode()){const m=this.draw.getHeader(),p=m.getHeight(),I=m.getHeaderTop()+p,L=this.draw.getFooter(),C=this.draw.getHeight()-(L.getFooterBottom()+L.getHeight());if(d){if(n<I)return{index:-1,zone:l.EditorZone.HEADER};if(n>C)return{index:-1,zone:l.EditorZone.FOOTER}}else if(n<=C&&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!==u||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!==u||L.rowNo!==p)continue;const{leftTop:P,rightTop:C}=L.coordinate;if(e<=T[3]||e>=P[0]&&e<=C[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:u,index:R,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,C=d.height*s;if(e>=I&&e<=I+P&&n>=L&&n<=L+C)return u?{index:R,isDirectHit:!0,isImage:!0,isTable:u,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,C=this.draw.getControl(),{newIndex:S}=C.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:u,trIndex:R,tdIndex:h,tdId:g,trId:f,tableId:T}=e;return this.setPositionContext({isTable:u||!1,isCheckbox:i||!1,isRadio:r||!1,isControl:s||!1,isImage:a||!1,isLabel:c||!1,isDirectHit:d||!1,index:n,trIndex:R,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,u=0;if(a.length&&!sn(r)&&!r.control?.minWidth)for(let R=0;R<a.length;R++){const h=a[R],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(el(s,f)){i.isSurround=!0;const T=f.width+f.x-s.x;if(r.left=T,i.width+=T,u+=T,d=f.x+f.width,i.width+r.metrics.width>c){r.left=0,i.width-=u;break}}}return{x:d,rowIncreaseWidth:u}}}class za{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===_?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||zt.includes(e.type)):null}getTextLikeSelectionElementList(){const t=this.getSelectionElementList();return t?t.filter(e=>!e.type||zt.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],u=i.get(d.pageNo);u&&u.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:u}=n[s];let R=r.get(d);R||(R=[],r.set(d,R)),R.includes(u)||R.unshift(u);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:u,rowNo:R}=n[d];let h=r.get(u);h||(h=[],r.set(u,h)),h.includes(R)||h.push(R),d++}}let c=e;for(a&&i[t].value===_&&(c+=1);c<n.length;){const d=i[c],u=i[c+1];if(d.value===_&&!d.listWrap||d.listId!==u?.listId||d.titleId!==u?.titleId)break;const{pageNo:R,rowNo:h}=n[c];let g=r.get(R);g||(g=[],r.set(R,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],u=r.get(d.pageNo);u&&u.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:u},pageNo:R}=s[a];if(n===R&&t>=d[0]&&t<=u[0]&&e>=d[1]&&e<=u[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:u,tdIndex:R,trIndex:h}=r,g={startIndex:u,endIndex:u};a===fe.TABLE&&(g.tableId=d,g.startTdIndex=R,g.endTdIndex=R,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 u=this.draw.getControl();if(~t&&~e&&!!this.draw.getElementList()[t]?.controlId){u.initControl();return}u.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 b=this.draw.getOriginalElementList(),y=this.position.getPositionContext();s=b[y.index]}else{const b=~i?i:0,y=this.draw.getElementList();s=this.getRangeAnchorStyle(y,b)}if(!s)return;const a=this.getSelection()||[s],c=s.type||l.ElementType.TEXT,d=s.font||this.options.defaultFont,u=s.size||this.options.defaultSize,R=!~a.findIndex(b=>!b.bold),h=!~a.findIndex(b=>!b.italic),g=!~a.findIndex(b=>!b.underline&&!b.control?.underline),f=!~a.findIndex(b=>!b.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||[],C=s.level||null,S=s.listType||null,F=s.listStyle||null,N=g&&s.textDecoration||null,V=!!this.draw.getPainterStyle(),Y=this.historyManager.isCanUndo(),E=this.historyManager.isCanRedo(),W=s.groupIds||null,X=s.extension??null,O=s.deletePerson??"",M={type:c,undo:Y,redo:E,painter:V,font:d,size:u,bold:R,italic:h,underline:g,strikeout:f,deletePerson:O,color:T,highlight:m,rowFlex:p,vertical:I,rowMargin:L,dashArray:P,level:C,listType:S,listStyle:F,groupIds:W,textDecoration:N,extension:X};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(),u={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(u)}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 ja{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,u=0;const R=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<R;g++){for(let f=0;f<h;f++)t.drawImage(e,d,u,a,c),u+=c;u=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 Go{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 qa extends Go{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 tc{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]],u=[r-a[1],a[0]],R=[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(u[0]+c,u[1]),t.lineTo(...u),t.lineTo(u[0],u[1]-c),t.moveTo(R[0]-c,R[1]),t.lineTo(...R),t.lineTo(R[0],R[1]+c),t.moveTo(h[0]+c,h[1]),t.lineTo(...h),t.lineTo(h[0],h[1]+c),t.stroke(),t.restore()}}class ec{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 u=50;d.style.width=`${i[0]-e[0]+u}px`,d.style.height=`${n[1]-e[1]+u}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 u=0,R=0;for(;R<c-1;){const g=d.length?d[u]:c,f=e.slice(R,g);f.length&&a.push({index:R,type:fe.PAGE,elementList:f});const T=e[g];T&&a.push({index:g,type:fe.TABLE,elementList:[T]}),R=g+1,u++}function h(g,f,T,m){if(!g)return;let p=T.map(S=>!S.type||zt.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&&(p=p.toLocaleLowerCase());const I=[],L=n?new RegExp(g):g;let{index:P,length:C}=Zi(p,L);for(;P!==-1&&C!==0;){I.push({index:P,length:C});const S=Zi(p,L,P+C);P=S.index,C=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 E=F+Y+(m?.startIndex||0);s.push({type:f,index:E,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 u=null;if(d.type===fe.TABLE){const{tableIndex:P,trIndex:C,tdIndex:S,index:F}=d;u=a[P]?.trList[C].tdList[S]?.positionList[F]}else u=s[d.index];if(!u)continue;const{coordinate:{leftTop:R,leftBottom:h,rightTop:g},pageNo:f}=u;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(u)}else t.fillStyle=i;const m=R[0],p=R[1],I=g[0]-R[0],L=h[1]-R[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(Oo(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="",u="",R=-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:C}=m;u&&C!==u&&(c=0),u=C;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--,~R||(R=T);continue}if(d===m.groupId){this.draw.spliceElementList(F,N,1),c--;continue}~R||(R=T);for(let Y=0;Y<t.length;Y++){const E=t[Y];Y===0?V.value=E:(this.draw.spliceElementList(F,N+Y,0,[{...V,value:E}]),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--,~R||(R=T);continue}if(~R||(R=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(!~R)return;const g=i[R],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 nc extends Go{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 oc extends Go{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 u=s*Math.sin(a*d);t.lineTo(e+d,c+u)}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 ic{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:Qr});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||!Zr.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?zr(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:u,fromPageNo:R}}=this.options;if(e<R)return;let h=d;const g=new RegExp(Pn.PAGE_NO);g.test(h)&&(h=an.formatNumberPlaceholder(h,e+u-R,g,c));const f=new RegExp(Pn.PAGE_COUNT);f.test(h)&&(h=an.formatNumberPlaceholder(h,this.draw.getPageCount()-R,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:C}=t.measureText(h);a===l.RowFlex.CENTER?L=(T-C)/2:a===l.RowFlex.RIGHT?L=T-C-P[1]:L=P[3],t.fillText(h,L,I),t.restore()}}class sc{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=Ar(()=>{const{intersectionPageNo:t,visiblePageNoList:e}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(t),this.draw.setVisiblePageNoList(e)},150)}class rc{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(Ut.UP):this.clientHeight-n<=this.thresholdPoints[1]?this._startMove(Ut.DOWN):e<this.thresholdPoints[2]?this._startMove(Ut.LEFT):this.clientWidth-e<this.thresholdPoints[3]?this._startMove(Ut.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===Ut.DOWN?e.scrollTo(n,i+this.step):t===Ut.UP?e.scrollTo(n,i-this.step):t===Ut.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 lc{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,u=c+a-1;if(u!==r){const R=i.tdList.splice(r,1)[0];e[u]?.tdList.splice(d,0,R)}}}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 C=h[P],S=[];for(let F=0;F<C.tdList.length;F++){const N=C.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,u=e.lineWidth;c&&(e.lineWidth=c*d),e.beginPath();const R=Math.round(n),h=Math.round(i);e.translate(.5,.5),a?e.rect(R,h,r,s):(e.moveTo(R,h+s),e.lineTo(R,h),e.lineTo(R+r,h)),e.stroke(),c&&(e.lineWidth=u),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:u}=e;if(!r||!s)return;const{scale:R,table:{defaultBorderColor:h}}=this.options,g=e.width*R,f=e.height*R,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*R,t.strokeStyle=c||h,!T&&!p&&this._drawOuterBorder({ctx:t,startX:n,startY:i,width:g,height:f,borderExternalWidth:u,isDrawFullBorder:m});for(let I=0;I<s.length;I++){const L=s[I];for(let P=0;P<L.tdList.length;P++){const C=L.tdList[P];if(C.slashTypes?.length&&this._drawSlash(t,C,n,i),!C.borderTypes?.length&&(T||m))continue;const S=C.width*R,F=C.height*R,N=Math.round(C.x*R+n+S),V=Math.round(C.y*R+i);if(t.translate(.5,.5),t.beginPath(),C.borderTypes?.includes(l.TdBorder.TOP)&&(t.moveTo(N-S,V),t.lineTo(N,V),t.stroke()),C.borderTypes?.includes(l.TdBorder.RIGHT)&&(t.moveTo(N,V),t.lineTo(N,V+F),t.stroke()),C.borderTypes?.includes(l.TdBorder.BOTTOM)&&(t.moveTo(N,V+F),t.lineTo(N-S,V+F),t.stroke()),C.borderTypes?.includes(l.TdBorder.LEFT)&&(t.moveTo(N-S,V),t.lineTo(N-S,V+F),t.stroke()),!T&&!m){if((!p||C.colIndex+C.colspan<r.length)&&(t.moveTo(N,V),t.lineTo(N,V+F),u&&u!==d&&C.colIndex+C.colspan===r.length)){const Y=t.lineWidth;t.lineWidth=u*R,t.stroke(),t.beginPath(),t.lineWidth=Y}if(!p||C.rowIndex+C.rowspan<s.length){const Y=u&&u!==d&&C.rowIndex+C.rowspan===s.length;if(Y&&(t.stroke(),t.beginPath()),t.moveTo(N,V+F),t.lineTo(N-S,V+F),Y){const E=t.lineWidth;t.lineWidth=u*R,t.stroke(),t.beginPath(),t.lineWidth=E}}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 u=c.tdList[d];if(!u.backgroundColor)continue;t.save();const R=u.width*s,h=u.height*s,g=Math.round(u.x*s+n),f=Math.round(u.y*s+i);t.fillStyle=u.backgroundColor,t.fillRect(g,f,R,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 u=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){u=L;let C=0;for(let S=0;S<L;S++)C+=e[S].width;i=C;break}}else{const p=s.tdList[c-1];p&&(u=p.colIndex+p.colspan)}let R=0;for(let p=0;p<d.colspan;p++)R+=e[p+u].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(u>=P.colIndex&&u<P.colIndex+P.colspan){m+=P.height;break}}}d.y=m,d.width=R,d.height=h,d.rowIndex=r,d.colIndex=u,d.trIndex=r,d.tdIndex=c,i+=R,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:u,startTdIndex:R,endTdIndex:h,startTrIndex:g,endTrIndex:f}=this.range.getRange();if(!u)return;let T=d[g].tdList[R],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 C=0;C<d.length;C++){const S=d[C];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 E=N.x*r,W=N.y*r,X=N.width*r,O=N.height*r;t.globalAlpha=s,t.fillStyle=a,t.fillRect(E+n,W+i,X,O)}}}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 R=0;R<c.length;R++){const h=c[R];h.height=h.minHeight||r,h.minHeight=h.height}this.computeRowColInfo(t);const d={},u={};for(let R=0;R<c.length;R++){const h=c[R];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((C,S)=>C+S.height,0);p.rowList=I;const P=L/n+a;p.mainHeight=P,p.rowspan>1?(u[p.colIndex]=p.id,d[p.id]={td:p,rowSpan:[R,R+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[u[m]];I?.rowSpan[1]==R&&g.push(I.extraHeight)}}const T=Math.max(...g.length?g:f);Object.values(d).forEach(m=>{m.rowSpan[0]<=R&&m.rowSpan[1]>=R&&(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,R,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 ac{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,u=s[e],{colgroup:R,trList:h}=a,{coordinate:{leftTop:g}}=u,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,C=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(b=>b.height),Y=document.createElement("div");Y.classList.add(`${z}-table-tool__row`),Y.style.transform=`translateX(-${this.ROW_COL_OFFSET*c}px)`;for(let b=0;b<V.length;b++){const y=V[b]*c,D=document.createElement("div");D.classList.add(`${z}-table-tool__row__item`),b===P&&D.classList.add("active"),D.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByRowIndex(h,b),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,b)};const U=document.createElement("div");U.classList.add(`${z}-table-tool__anchor`),U.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:b,order:me.ROW})},D.append(U),D.style.height=`${y}px`,Y.append(D)}Y.style.left=`${p}px`,Y.style.top=`${I}px`,this.container.append(Y),this.toolRowContainer=Y;const E=document.createElement("div");E.classList.add(`${z}-table-tool__quick__add`),E.style.height=`${S*c}`,E.style.left=`${p}px`,E.style.top=`${I+S}px`,E.style.transform=`translate(-${this.ROW_COL_QUICK_POSITION*c}px, ${this.ROW_COL_QUICK_OFFSET*c}px)`,E.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:h.length-1,tdIndex:0,tableId:a.id}),this.draw.getTableOperate().insertTableBottomRow()},this.container.append(E),this.toolRowAddBtn=E;const W=R.map(b=>b.width),X=document.createElement("div");X.classList.add(`${z}-table-tool__col`),X.style.transform=`translateY(-${this.ROW_COL_OFFSET*c}px)`;for(let b=0;b<W.length;b++){const y=W[b]*c,D=document.createElement("div");D.classList.add(`${z}-table-tool__col__item`),b===C&&D.classList.add("active"),D.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByColIndex(h,b),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(X,b)};const U=document.createElement("div");U.classList.add(`${z}-table-tool__anchor`),U.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:b,order:me.COL})},D.append(U),D.style.width=`${y}px`,X.append(D)}X.style.left=`${p}px`,X.style.top=`${I}px`,this.container.append(X),this.toolColContainer=X;const O=document.createElement("div");O.classList.add(`${z}-table-tool__quick__add`),O.style.height=`${S*c}`,O.style.left=`${p+F}px`,O.style.top=`${I}px`,O.style.transform=`translate(${this.ROW_COL_QUICK_OFFSET*c}px, -${this.ROW_COL_QUICK_POSITION*c}px)`,O.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(O),this.toolColAddBtn=O;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 b=0;b<h.length;b++){const y=h[b];for(let D=0;D<y.tdList.length;D++){const U=y.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: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=H=>{this._mousedown({evt:H,element:a,index:U.colIndex+U.colspan-1,order:me.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=tt=>{this._mousedown({evt:tt,element:a,index:0,isLeftStartBorder:!0,order:me.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(),u=this.draw.getHeight(),R=this.draw.getPageGap(),h=this.draw.getPageNo()*(u+R),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,C=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 E=document.createElement("div");E.classList.add(`${z}-table-anchor__line`),i===me.ROW?(E.classList.add(`${z}-table-anchor__line__row`),E.style.width=`${d}px`,V=0,Y=h+this.mousedownY-F.top):(E.classList.add(`${z}-table-anchor__line__col`),E.style.height=`${u}px`,V=this.mousedownX-F.left,Y=h),E.style.left=`${V}px`,E.style.top=`${Y}px`,this.container.append(E),this.anchorLine=E;let W=0,X=0;const O=M=>{const b=this._mousemove(M,i,V,Y);b&&(W=b.dx,X=b.dy)};document.addEventListener("mousemove",O),document.addEventListener("mouseup",()=>{let M=!1;if(i===me.ROW){const b=r.trList,y=b[n]||b[n-1],{defaultTrMinHeight:D}=this.options.table;X<0&&y.height+X<D&&(X=D-y.height),X&&(y.height+=X,y.minHeight=y.height,M=!0)}else{const{colgroup:b}=r;if(b&&W)if(c&&s){b[n].width-W/a<=this.MIN_TD_WIDTH&&(W=(b[n].width-this.MIN_TD_WIDTH)*a);const y=m+(r.translateX||0)*a;y+W<P&&(W=P-y),b[n].width-=W/a,r.width-=W/a,r.translateX=(r.translateX||0)+W/a,M=!0}else{const y=b[n].width;W<0&&y*a+W<this.MIN_TD_WIDTH*a&&(W=this.MIN_TD_WIDTH*a-y*a);const D=b[n+1]?.width;if(W>0&&D&&D*a-W<this.MIN_TD_WIDTH*a&&(W=D*a-this.MIN_TD_WIDTH*a),n===b.length-1){const Q=m+(r.translateX||0)*a+r.width*a;Q+W>C&&(W=C-Q)}W&&(b.length-1!==n&&(b[n+1].width-=W/a),b[n].width+=W/a,M=!0)}}M&&this.draw.render({isSetCursor:!1}),E.remove(),document.removeEventListener("mousemove",O),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 cc{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 dc{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,u=e.label?.backgroundColor||s,R=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=u,this._drawRoundedRect(t,n,i-m,f,T+(g[0]+g[3])*r,h*r),t.fill(),t.fillStyle=R,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 uc{options;draw;activeInlineEditor;constructor(t){this.draw=t,this.options=t.getOptions(),this.activeInlineEditor=null}render(t,e,n,i){const r=this.draw.getMode(),s=e.macroConfig;if(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||"",u=e.label||"";if(r===l.EditorMode.FORM)this.activeInlineEditor?.elementId===e.id&&this._syncInlineEditorPosition(),c==="select"?this._renderSelectControl(t,e,n,i,d):this._renderTextControl(t,e,n,i,d);else{const R=d||`获取 ${u}`;this._renderPlainText(t,e,n,i,R)}return}if(e.type==="reusableItem"){const d=e.reusableItemConfig?.value||"",u=e.label||"";if(r===l.EditorMode.FORM)this._renderTextControl(t,e,n,i,d);else{const R=d||`获取 ${u}`;this._renderPlainText(t,e,n,i,R)}return}if(e.type==="subTemplate"){const c=e.label||"子模板";r===l.EditorMode.FORM?e.subTemplateExpanded||this._renderEditMode(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)}activateInlineEditor(t,e){if(this.draw.getMode()!==l.EditorMode.FORM||t.type!=="customMacro")return!1;const n=this._ensureMacroConfig(t),i=n.type||"text",r=this.activeInlineEditor;if(r&&r.elementId===t.id&&r.type===i)return r.input.focus(),r.input instanceof HTMLInputElement&&r.input.select(),!0;this.clearInlineEditor({isSubmitHistory:!1});const s=document.createElement("div");s.style.position="absolute",s.style.zIndex="1002",s.style.boxSizing="border-box",s.style.display="flex",s.style.alignItems="center";const a=this._getInlineEditorBaseStyle(t);let c;i==="select"?c=this._createSelectEditor(t,s):c=this._createTextEditor(t,s),c.style.boxSizing="border-box",c.style.width="100%",c.style.height="100%",c.style.border="none",c.style.outline="none",c.style.background="transparent",c.style.font=a.font,c.style.color=a.color,c.style.padding=a.padding,c.style.margin="0",s.append(c),s.addEventListener("mousedown",u=>u.stopPropagation()),s.addEventListener("click",u=>u.stopPropagation()),this.draw.getContainer().append(s),this.draw.setOverlayActive(!0);const d=u=>{const R=u.target;R instanceof Node&&s.contains(R)||this.clearInlineEditor()};return document.addEventListener("mousedown",d,!0),this.activeInlineEditor={elementId:t.id,index:e,type:i,wrapper:s,input:c,initialValue:n.value||"",initialCode:n.code,outsideHandler:d},this._syncInlineEditorPosition(),c.focus(),c instanceof HTMLInputElement?c.select():"showPicker"in c&&typeof c.showPicker=="function"?c.showPicker():c.click(),!0}clearInlineEditor(t={}){const e=this.activeInlineEditor;if(!e)return;const{isSubmitHistory:n=!0,isRestore:i=!1}=t;document.removeEventListener("mousedown",e.outsideHandler,!0);const r=this._getInlineEditorElement(e),s=r?.macroConfig,a=e.input.value||"",c=e.input instanceof HTMLSelectElement&&e.input.value||"";if(r&&s&&(i?(s.value=e.initialValue,e.type==="select"&&(s.code=e.initialCode)):e.type==="text"?s.value=a:(s.code=c||void 0,s.value=this._getSelectLabelByCode(s,c))),e.wrapper.remove(),this.activeInlineEditor=null,this.draw.setOverlayActive(!1),r&&!i){const d=this._ensureMacroConfig(r),u=d.value||"",R=d.code;u!==e.initialValue||R!==e.initialCode?this.draw.getCommand().setMacroValue({id:r.id,dictCode:r.dictCode,label:r.label,areaId:r.areaId,value:u,code:R,isSubmitHistory:n}):this.draw.render({isSubmitHistory:!1,isSetCursor:!1})}else this.draw.render({isSubmitHistory:!1,isSetCursor:!1})}_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()}_renderEditMode(t,e,n,i,r){const{scale:s}=this.options,a=e.type==="customMacro",c=e.type==="reusableItem",d=e.type==="subTemplate";let u,R;d?(u="#722ed1",R="#f9f0ff"):c?(u="#52c41a",R="#f6ffed"):a?(u="#fa8c16",R="#fff7e6"):(u="#1677ff",R="#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,C=i-L.boundingBoxAscent+(L.boundingBoxAscent+L.boundingBoxDescent-I)/2;t.fillStyle=R,this._drawRoundedRect(t,P,C,p,I,m),t.fill(),t.fillStyle=u,t.textBaseline="middle",t.fillText(r,n+f,C+I/2),t.restore()}_renderTextControl(t,e,n,i,r){const{scale:s,control:a,strikeoutColor:c}=this.options,{placeholderColor:d,bracketColor:u}=a;t.save(),t.font=e.style;const h=`请输入${e.label||""}`,g=r||h,T=t.measureText(g).width;t.fillStyle=u,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=u,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 R=`请选择${e.label||""}`,h=r||R,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()}_createTextEditor(t,e){const n=document.createElement("input");return n.type="text",n.value=t.macroConfig?.value||"",n.placeholder=`请输入${t.label||""}`,n.style.minWidth="0",n.style.background="#ffffff",n.addEventListener("input",()=>{const i=this._ensureMacroConfig(t);i.value=n.value}),n.addEventListener("keydown",i=>{i.key==="Enter"?(i.preventDefault(),this.clearInlineEditor()):i.key==="Escape"&&(i.preventDefault(),this.clearInlineEditor({isSubmitHistory:!1,isRestore:!0}))}),n.addEventListener("blur",()=>{this.activeInlineEditor?.input===n&&this.clearInlineEditor()}),e.style.background="#ffffff",e.style.border="1px solid #1677ff",e.style.borderRadius="4px",e.style.boxShadow="0 0 0 2px rgba(22, 119, 255, 0.12)",n}_createSelectEditor(t,e){const n=document.createElement("select"),i=this._ensureMacroConfig(t),r=document.createElement("option");return r.value="",r.textContent=`请选择${t.label||""}`,n.append(r),i.items?.forEach(s=>{const a=document.createElement("option");a.value=s.code,a.textContent=s.value,n.append(a)}),n.value=i.code||i.items?.find(s=>s.value===i.value)?.code||"",n.addEventListener("change",()=>{i.code=n.value||void 0,i.value=this._getSelectLabelByCode(i,n.value),this.clearInlineEditor()}),n.addEventListener("keydown",s=>{s.key==="Escape"?(s.preventDefault(),this.clearInlineEditor({isSubmitHistory:!1,isRestore:!0})):s.key==="Enter"&&(s.preventDefault(),this.clearInlineEditor())}),n.addEventListener("blur",()=>{this.activeInlineEditor?.input===n&&this.clearInlineEditor()}),e.style.background="#ffffff",e.style.border="1px solid #1677ff",e.style.borderRadius="4px",e.style.boxShadow="0 0 0 2px rgba(22, 119, 255, 0.12)",n}_syncInlineEditorPosition(){const t=this.activeInlineEditor;if(!t)return;const e=this._getInlineEditorPosition(t);if(!e){this.clearInlineEditor({isSubmitHistory:!1});return}const n=e.pageNo*(this.draw.getHeight()+this.draw.getPageGap()),[i,r]=e.coordinate.leftTop,s=Math.max(e.lineHeight,e.metrics.height),a=Math.max(e.metrics.width,80*this.options.scale),c=Math.max(0,(e.lineHeight-s)/2);t.wrapper.style.left=`${i}px`,t.wrapper.style.top=`${r+n+c}px`,t.wrapper.style.width=`${a}px`,t.wrapper.style.height=`${s}px`}_getInlineEditorBaseStyle(t){return{font:this.draw.getElementFont(t),color:t.color||"#000000",padding:`0 ${6*this.options.scale}px`}}_getInlineEditorElement(t){const e=this.draw.getElementList()[t.index];return e?.id===t.elementId?e:t.elementId?this.draw.getElementList().find(n=>n.id===t.elementId)||null:e||null}_getInlineEditorPosition(t){return this.draw.getPosition().getPositionList()[t.index]||null}_ensureMacroConfig(t){return t.macroConfig||(t.macroConfig={type:"text"}),t.macroConfig}_getSelectLabelByCode(t,e){return e&&t.items?.find(n=>n.code===e)?.value||""}}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=Zo(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*bi[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 hc{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 gc{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 fc{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 Tc{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:u}=this.options,R=s*d,h=e.width*d,g=this.draw.getDefaultBasicRowMarginHeight()*u;t.save(),t.font=`${R}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-R/2),t.restore()}}class mc{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:u},scale:R}=this.options,h=this.draw.getWidth(),g=this.draw.getHeight();t.save(),t.globalAlpha=i,t.font=`${s*R}px ${r}`;let f=n;const T=new RegExp(Pn.PAGE_NO);T.test(f)&&(f=an.formatNumberPlaceholder(f,e+1,T,u));const m=new RegExp(Pn.PAGE_COUNT);m.test(f)&&(f=an.formatNumberPlaceholder(f,this.draw.getPageCount(),m,u));const p=t.measureText(f);if(c){const I=this.draw.getPagePixelRatio(),L=document.createElement("canvas"),P=L.getContext("2d"),C=p.width,S=p.actualBoundingBoxAscent+p.actualBoundingBoxDescent,F=Math.sqrt(Math.pow(C,2)+Math.pow(S,2)),N=F+2*d[0]*R,V=F+2*d[1]*R;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*R}px ${r}`,P.fillStyle=a,P.fillText(f,(N-C)/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*R/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(),u=this.draw.getHeight(),R=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(R,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-R)/2,(I-h)/2,R,h);const L=t.createPattern(f,"repeat");L&&(t.fillStyle=L,t.fillRect(0,0,d,u))}else{const g=d/2,f=u/2;t.translate(g,f),t.rotate(-45*Math.PI/180),t.drawImage(this.imageCache.get(i),-R/2,-h/2,R,h)}t.restore()}render(t,e){this.options.watermark.type===l.WatermarkType.IMAGE?this.renderImage(t):this.renderText(t,e)}}class pc{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 u=!1,R=!1,h=!1,g=!1;return a.highlight||(u=!c&&!!n&&!!d&&a.controlId===d.controlId&&!this.control.getIsRangeInPostfix()),u||(R=!c&&!!i&&!!a.control?.disabled),R||(h=!c&&!!r&&!!a.controlId&&this.control.getIsExistValueByElementListIndex(t,e)),h||(g=!c&&!!s&&!!a.controlId&&!this.control.getIsExistValueByElementListIndex(t,e)),(u?n:"")||(R?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 u=r;for(;u<n.length&&n[u].controlId===s.controlId;)u++;r=u;const R=n.slice(d,u).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],m=t.getMatchList(T.keyword,R);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:C}=c;d=s[I]?.trList[L].tdList[P]?.positionList[C]}else d=r[c.index];if(!d)continue;const{coordinate:{leftTop:u,leftBottom:R,rightTop:h},pageNo:g}=d;if(g!==e)continue;t.fillStyle=c.backgroundColor||i,t.globalAlpha=c.alpha||n;const f=u[0],T=u[1],m=h[0]-u[0],p=R[1]-u[1];t.fillRect(f,T,m,p)}t.restore()}}class Lc{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 Mn{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&&!wi(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],u=d.type&&!zt.includes(d.type)||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...At]):se(d,["type"]),R=r.startIndex+1;for(let h=0;h<t.length;h++){const g={...u,...t[h],controlComponent:l.ControlComponent.VALUE};wt(i,[g],s,{editorOptions:this.options}),c.spliceElementList(i,R+h,0,[g])}return R+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,u=s;for(;u>0;){const g=r[u];if(g.controlId!==a.controlId||g.controlComponent===l.ControlComponent.PREFIX||g.controlComponent===l.ControlComponent.PRE_TEXT){c=u;break}u--}let R=s+1;for(;R<r.length;){const g=r[R];if(g.controlId!==a.controlId||g.controlComponent===l.ControlComponent.POSTFIX||g.controlComponent===l.ControlComponent.POST_TEXT){d=R-1;break}R++}return!~c||!~d?-1:(this.control.getDraw().spliceElementList(r,c+1,d-c,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(u,t),this.control.setControlProperties({code:void 0},{elementList:r,range:{startIndex:u,endIndex:u}}),u)}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)||[],u=s.isMultiSelect;if(!u&&t===c||u&&Ui(d,a)){this.control.repaintControl({curIndex:r.startIndex,isCompute:!1,isSubmitHistory:!1}),this.destroy();return}const R=s.valueSets;if(!Array.isArray(R)||!R.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],At),T=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~T)return;c||this.control.removePlaceholder(T,e);const m=se(i[T],Re),p=T+1,I=ct(h),L=this.control.getDraw();for(let P=0;P<I.length;P++){const C={...f,...m,type:l.ElementType.TEXT,value:I[P],controlComponent:l.ControlComponent.VALUE};(C.color===this.options.control.bracketColor||C.color===this.options.control.placeholderColor)&&(C.color=this.options.defaultColor),wt(i,[C],T,{editorOptions:this.options}),L.spliceElementList(i,p+P,0,[C])}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}),u||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(ue,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,u=this.control.getPreY();i.style.left=`${a}px`,i.style.top=`${c+u+d}px`,this.control.getContainer().append(i),this.selectDom=i,s&&Qi(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 j(){return Ts.apply(null,arguments)}function Ic(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 Ot(o,t){return Object.prototype.hasOwnProperty.call(o,t)}function Ao(o){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(o).length===0;var t;for(t in o)if(Ot(o,t))return!1;return!0}function Jt(o){return o===void 0}function Oe(o){return typeof o=="number"||Object.prototype.toString.call(o)==="[object Number]"}function On(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 we(o,t){for(var e in t)Ot(t,e)&&(o[e]=t[e]);return Ot(t,"toString")&&(o.toString=t.toString),Ot(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 ko;Array.prototype.some?ko=Array.prototype.some:ko=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 Jo(o){var t=null,e=!1,n=o._d&&!isNaN(o._d.getTime());if(n&&(t=Rt(o),e=ko.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 An(o){var t=pe(NaN);return o!=null?we(Rt(t),o):Rt(t).userInvalidated=!0,t}var ps=j.momentProperties=[],Bo=!1;function $o(o,t){var e,n,i,r=ps.length;if(Jt(t._isAMomentObject)||(o._isAMomentObject=t._isAMomentObject),Jt(t._i)||(o._i=t._i),Jt(t._f)||(o._f=t._f),Jt(t._l)||(o._l=t._l),Jt(t._strict)||(o._strict=t._strict),Jt(t._tzm)||(o._tzm=t._tzm),Jt(t._isUTC)||(o._isUTC=t._isUTC),Jt(t._offset)||(o._offset=t._offset),Jt(t._pf)||(o._pf=Rt(t)),Jt(t._locale)||(o._locale=t._locale),r>0)for(e=0;e<r;e++)n=ps[e],i=t[n],Jt(i)||(o[n]=i);return o}function Cn(o){$o(this,o),this._d=new Date(o._d!=null?o._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Bo===!1&&(Bo=!0,j.updateOffset(this),Bo=!1)}function le(o){return o instanceof Cn||o!=null&&o._isAMomentObject!=null}function Ls(o){j.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+o)}function ee(o,t){var e=!0;return we(function(){if(j.deprecationHandler!=null&&j.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
|
-
[`+
|
|
86
|
+
`)&&(a.value=k),(a.type===r.ElementType.IMAGE||a.type===r.ElementType.BLOCK)&&(a.id=a.id||gt()),a.type===r.ElementType.LATEX){const{svg:c,width:d,height:u}=ns.convertLaTextToSVG(a.value);a.width=a.width||d,a.height=a.height||u,a.laTexSVG=c,a.id=a.id||gt()}(a.type===r.ElementType.MACRO||a.type===r.ElementType.CUSTOM_MACRO||a.type===r.ElementType.REUSABLE_ITEM)&&(a.id=a.id||gt()),(a.type===r.ElementType.MENSTRUAL_HISTORY||a.type===r.ElementType.TOOTH_POSITION||a.type===r.ElementType.FETAL_HEART_POSITION||a.type===r.ElementType.SPECIAL_SYMBOLS)&&(a.id=a.id||gt()),s++}}function ma(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 l=e[i];if(l!=="value"&&!(l==="groupIds"&&Array.isArray(o[l])&&Array.isArray(t[l])&&Bi(o[l],t[l]))&&o[l]!==t[l])return!1}return!0}function Qe(o,t={}){const{extraPickAttrs:e}=t,n=[...Sl];e&&n.push(...e);const i={value:o?.value===k?`
|
|
87
|
+
`:o?.value};return o&&n.forEach(l=>{const s=o[l];s!==void 0&&(i[l]=s)}),i}function Ct(o,t={}){const{extraPickAttrs:e,isClassifyArea:n=!1,isClone:i=!0,editorOptions:l}=t,s=(i?dt(o):o).filter(d=>d.type!==r.ElementType.SPLIT_TAG),a=[];let c=0;for(;c<s.length;){let d=s[c];if(c===0&&d.value===k&&!d.listId&&(!d.type||d.type===r.ElementType.TEXT)){c++;continue}if(d.areaId){const R=d.areaId,h=d.area,g=[];for(;c<s.length;){const f=s[c];if(R!==f.areaId){c--;break}delete f.area,delete f.areaId,g.push(f),c++}const T=Ct(g,t);if(n){const f={type:r.ElementType.AREA,value:"",areaId:R,area:h};f.valueList=T,d=f}else{a.splice(c,0,...T);continue}}else if(d.titleId&&d.level){const R=d.titleId;if(R){const h=d.level,g={type:r.ElementType.TITLE,title:d.title,titleId:R,value:"",level:h},T=[];for(;c<s.length;){const f=s[c];if(R!==f.titleId){c--;break}delete f.level,delete f.title,T.push(f),c++}g.valueList=Ct(T,t),d=g}}else if(d.listId&&d.listType){const R=d.listId;if(R){const h=d.listType,g=d.listStyle,T=d?.label,f={type:r.ElementType.LIST,value:"",label:T||"",listId:R,listType:h,listStyle:g},m=[];for(;c<s.length;){const p=s[c];if(R!==p.listId){c--;break}delete p.listType,delete p.listStyle,m.push(p),c++}f.valueList=Ct(m,t),d=f}}else if(d.type===r.ElementType.TABLE){if(d.pagingId){let R=c+1,h=0;for(;R<s.length;){const g=s[R];if(g.pagingId===d.pagingId){d.height+=g.height;const T=g.trList.filter(f=>!f.pagingRepeat).filter(f=>(f.tdList=f.tdList.filter(m=>{if(m.originalId){for(let p=0;p<d.trList.length;p++){const I=d.trList[p].tdList.find(({id:P})=>P===m.originalId);if(I){m.value[0]?.type===r.ElementType.SPLIT_TAG&&m.value.splice(0,1),I.value.push(...m.value),I.rowspan=I.originalRowspan??I.rowspan;break}}return!1}return!0}),!f.originalId));d.trList.push(...T),d.trList?.forEach(f=>f.minHeight=f.originalMinHeight??f.minHeight),R++,h++}else break}c+=h}if(d.trList)for(let R=0;R<d.trList.length;R++){const h=d.trList[R];delete h.id;for(let g=0;g<h.tdList.length;g++){const T=h.tdList[g],f={colspan:T.colspan,rowspan:T.rowspan,value:Ct(T.value,{...t,isClassifyArea:!1})};Xl.forEach(m=>{const p=T[m];p!==void 0&&(f[m]=p)}),h.tdList[g]=f}}}else if(d.type===r.ElementType.HYPERLINK){const R=d.hyperlinkId;if(R){const h={type:r.ElementType.HYPERLINK,value:"",url:d.url},g=[];for(;c<s.length;){const T=s[c];if(R!==T.hyperlinkId){c--;break}delete T.type,delete T.url,g.push(T),c++}h.valueList=Ct(g,t),d=h}}else if(d.type===r.ElementType.DATE){const R=d.dateId;if(R){const h={type:r.ElementType.DATE,value:"",dateFormat:d.dateFormat},g=[];for(;c<s.length;){const T=s[c];if(R!==T.dateId){c--;break}delete T.type,delete T.dateFormat,g.push(T),c++}h.valueList=Ct(g,t),d=h}}else if(d.type!==r.ElementType.BUTTON){if(d.controlId){const R=d.controlId;if(!(d.controlComponent===r.ControlComponent.PREFIX||d.controlComponent===r.ControlComponent.PRETEXTFIX||d.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)&&d.controlComponent===r.ControlComponent.VALUE){if(d.type===r.ElementType.MENSTRUAL_HISTORY||d.type===r.ElementType.FETAL_HEART_POSITION||d.type===r.ElementType.TOOTH_POSITION||d.type===r.ElementType.MACRO||d.type===r.ElementType.CUSTOM_MACRO||d.type===r.ElementType.REUSABLE_ITEM||d.type===r.ElementType.LIST||d.type===r.ElementType.SPECIAL_SYMBOLS){let m=!1;for(let p=c-1;p>=0;p--){const C=s[p],I=C.controlComponent===r.ControlComponent.PREFIX||C.controlComponent===r.ControlComponent.PRETEXTFIX||C.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT;if(C.controlId===R&&I){m=!0;break}if(C.controlId!==R)break}if(!m){const p=dt(d);delete p.controlId,delete p.control,delete p.controlComponent,delete p.originControlId,a.push(p),c++;continue}}c++;continue}if(d.controlComponent===r.ControlComponent.PLACEHOLDER||d.controlComponent===r.ControlComponent.POSTFIX||d.controlComponent===r.ControlComponent.POSTTEXTFIX||d.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===r.ControlComponent.POST_TEXT||d.controlComponent===r.ControlComponent.PRE_TEXT||d.controlComponent===r.ControlComponent.CHECKBOX||d.controlComponent===r.ControlComponent.RADIO){c++;continue}const g=(f,m,p,C)=>{if(C===r.ControlType.CHECKBOX||C===r.ControlType.RADIO){let P=-1;for(let M=f;M<s.length&&s[M].controlId===m;M++)P=M;return P}const I=p?[r.ControlComponent.POSTTEXTFIX,r.ControlComponent.POSTTEXTFIX_TEXT]:[r.ControlComponent.POSTFIX];for(let P=f;P<s.length;P++){const M=s[P];if(M.controlId===m&&I.includes(M.controlComponent))return P}return-1},T=(f,m,p)=>{const C=[];let I=f;for(;I<=m;){const P=s[I];if(P.controlId&&P.controlId!==p&&P.control){const W=P.control?.type,Y=W===r.ControlType.TEXTFIELD,b=Y?r.ControlComponent.PRETEXTFIX:r.ControlComponent.PREFIX,D=P.controlComponent===b,X=W===r.ControlType.CHECKBOX||W===r.ControlType.RADIO;if(D||X&&(P.controlComponent===r.ControlComponent.CHECKBOX||P.controlComponent===r.ControlComponent.RADIO)){const O=g(I+1,P.controlId,Y,W);if(O!==-1){const E=s.slice(I,O+1).map(V=>{const y=dt(V);return delete y.originControlId,y}),L=Ct(E,t);L.length>0&&C.push(L[0]),I=O+1;continue}}}if(!(P.controlId===p&&(P.controlComponent===r.ControlComponent.VALUE||!P.controlComponent)&&(!P.originControlId||P.originControlId===p)||P.originControlId===p&&P.controlComponent===r.ControlComponent.VALUE||P.controlId===p&&(P.controlComponent===r.ControlComponent.CHECKBOX||P.controlComponent===r.ControlComponent.RADIO)&&!P.originControlId)){I++;continue}if(P.type===r.ElementType.MENSTRUAL_HISTORY||P.type===r.ElementType.FETAL_HEART_POSITION||P.type===r.ElementType.TOOTH_POSITION||P.type===r.ElementType.MACRO||P.type===r.ElementType.CUSTOM_MACRO||P.type===r.ElementType.REUSABLE_ITEM||P.type===r.ElementType.LIST||P.type===r.ElementType.SPECIAL_SYMBOLS){const W=dt(P);delete W.controlId,delete W.control,delete W.controlComponent,delete W.originControlId,C.push(W),I++;continue}if(P.controlComponent===r.ControlComponent.CHECKBOX||P.controlComponent===r.ControlComponent.RADIO){C.push(dt(P)),I++;continue}const F=d.control?.type;if(F===r.ControlType.CHECKBOX||F===r.ControlType.RADIO){let W=I-1,Y=!1;for(;W>=f-1;){const b=s[W];if(b.controlId===p&&!b.originControlId)if(b.controlComponent===r.ControlComponent.CHECKBOX){Y=b.checkbox?.value===!0;break}else if(b.controlComponent===r.ControlComponent.RADIO){Y=b.radio?.value===!0;break}else if(b.controlComponent===r.ControlComponent.VALUE){W--;continue}else break;W--}if(Y){const b={value:P.value||""},D=[...Bt,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const X of D){const O=P[X];if(O!==void 0){if(X==="color"&&l){const E=l.control?.bracketColor,L=l.control?.placeholderColor;if(O===E||O===L)continue}b[X]=O}}C.push(b)}}else{const W={value:P.value||""},Y=[...Bt,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const b of Y){const D=P[b];if(D!==void 0){if(b==="color"&&l){const X=l.control?.bracketColor,O=l.control?.placeholderColor;if(D===X||D===O)continue}W[b]=D}}C.push(W)}I++}return C};if(d.controlComponent===r.ControlComponent.PREFIX){const f=d.control?.type===r.ControlType.TEXTFIELD,m=g(c+1,R,f);if(m!==-1){const p=T(c+1,m-1,R),C=Dt(d,Jt),I={...d.control,...C,value:p},P={...Dt(d,Bt),type:r.ElementType.CONTROL,value:"",control:I,controlId:R};d=Qe(P,{extraPickAttrs:e}),c=m}}if(d.controlComponent===r.ControlComponent.PRETEXTFIX){const f=g(c+1,R,!0);if(f!==-1){const m=T(c+1,f-1,R),p=Dt(d,Jt),C={...d.control,...p,value:m},I={...Dt(d,Bt),type:r.ElementType.CONTROL,value:"",control:C,controlId:R};d=Qe(I,{extraPickAttrs:e}),c=f}}if(d.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT){const f=g(c+1,R,!0);if(f!==-1){const m=T(c+1,f-1,R),p=Dt(d,Jt),C={...d.control,...p,value:m},I={...Dt(d,Bt),type:r.ElementType.CONTROL,value:"",control:C,controlId:R};d=Qe(I,{extraPickAttrs:e}),c=f}}}}const u=Qe(d,{extraPickAttrs:e});if(!d.type||d.type===r.ElementType.TEXT||d.type===r.ElementType.SUBSCRIPT||d.type===r.ElementType.SUPERSCRIPT)for(;c<s.length;){const R=s[c+1];if(c++,R&&ma(u,Qe(R,{extraPickAttrs:e}))){const h=R.value===k?`
|
|
88
|
+
`:R.value;u.value+=h}else break}else c++;a.push(u)}return a}function ds(o){switch(window.getComputedStyle(o).textAlign){case"left":case"start":return r.RowFlex.LEFT;case"center":return r.RowFlex.CENTER;case"right":case"end":return r.RowFlex.RIGHT;case"justify":return r.RowFlex.ALIGNMENT;case"justify-all":return r.RowFlex.JUSTIFY;default:return r.RowFlex.LEFT}}function us(o){return o===r.RowFlex.ALIGNMENT?"justify":o}function pa(o){switch(o){case r.RowFlex.LEFT:return"flex-start";case r.RowFlex.CENTER:return"center";case r.RowFlex.RIGHT:return"flex-end";case r.RowFlex.ALIGNMENT:case r.RowFlex.JUSTIFY:return"space-between";default:return"flex-start"}}function $n(o){return!o.type||te.includes(o.type)}function Ia(o){return!o.type||o.type===r.ElementType.TEXT}function Rs(o){return o.filter(t=>$n(t)).map(t=>t.value).join("").replace(new RegExp(k,"g"),"")}function rn(o,t){const e=o[t];if(!e)return null;const n=o[t+1];return!e.listId&&e.value===k&&n&&n.value!==k&&e.areaId===n.areaId?n:e}function wt(o,t,e,n){let i=rn(o,e);if(!i)return;const{isBreakWhenWrap:l=!1,editorOptions:s,ignoreContextKeys:a=[]}=n||{},{mode:c}=s||{};c!==r.EditorMode.DESIGN&&i.title?.disabled&&(i=qt(i,Uo));let d=!1;for(let u=0;u<t.length;u++){const R=t[u];if(l&&!i.listId&&No.test(R.value)&&(d=!0),d||!i.listId&&R.type===r.ElementType.LIST){const g=[...en,...Bt,...Ge];Ji(g,a),Ze(g,i,R),R.valueList?.forEach(T=>{Ze(g,i,T)});continue}R.valueList?.length&&wt(o,R.valueList,e,n);const h=[...Zo];cn(R)||h.push(...Bt),Ji(h,a),Ze(h,i,R)}}function Ca(o,t){let e="span";o.type===r.ElementType.SUPERSCRIPT?e="sup":o.type===r.ElementType.SUBSCRIPT&&(e="sub");const n=document.createElement(e);return n.style.fontFamily=o.font||t.defaultFont,o.rowFlex&&(n.style.textAlign=us(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(`${k}`,"g"),`
|
|
89
|
+
`),n}function hs(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(No,"")}if(i.listWrap){const l=e.get(t)||[];l.push(i),e.set(t,l)}else{const l=i.value.split(`
|
|
90
|
+
`);for(let s=0;s<l.length;s++){s>0&&(t+=1);const a=l[s],c=e.get(t)||[];c.push({...i,value:a}),e.set(t,c)}}}return e}function La(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],l=i.rowFlex||null;e===l&&!cn(i)&&!cn(o[n-1])?t[t.length-1].data.push(i):(t.push({rowFlex:l,data:[i]}),e=l)}for(let n=0;n<t.length;n++){const i=t[n];i.data=Ct(i.data)}return t}function ln(o,t){const e=xn(t),n=e.mode===r.EditorMode.READONLY?sn(Ct(o,{editorOptions:e})):o;function i(a){const c=document.createElement("div");for(let d=0;d<a.length;d++){const u=a[d];if(u.type===r.ElementType.TABLE){const R=document.createElement("table");R.setAttribute("cellSpacing","0"),R.setAttribute("cellpadding","0"),R.setAttribute("border","0");const h="1px solid #000000";!u.borderType||u.borderType===r.TableBorder.ALL?(R.style.borderTop=h,R.style.borderLeft=h):u.borderType===r.TableBorder.EXTERNAL&&(R.style.border=h),R.style.width=`${u.width}px`;const g=document.createElement("colgroup");for(let f=0;f<u.colgroup.length;f++){const m=u.colgroup[f],p=document.createElement("col");p.setAttribute("width",`${m.width}`),g.append(p)}R.append(g);const T=u.trList;for(let f=0;f<T.length;f++){const m=document.createElement("tr"),p=T[f];m.style.height=`${p.height}px`;for(let C=0;C<p.tdList.length;C++){const I=document.createElement("td");(!u.borderType||u.borderType===r.TableBorder.ALL)&&(I.style.borderBottom=I.style.borderRight="1px solid");const P=p.tdList[C];I.colSpan=P.colspan,I.rowSpan=P.rowspan,I.style.verticalAlign=P.verticalAlign||"top",P.borderTypes?.includes(r.TdBorder.TOP)&&(I.style.borderTop=h),P.borderTypes?.includes(r.TdBorder.RIGHT)&&(I.style.borderRight=h),P.borderTypes?.includes(r.TdBorder.BOTTOM)&&(I.style.borderBottom=h),P.borderTypes?.includes(r.TdBorder.LEFT)&&(I.style.borderLeft=h);const M=ln(P.value,t);I.innerHTML=M.innerHTML,P.backgroundColor&&(I.style.backgroundColor=P.backgroundColor),m.append(I)}R.append(m)}c.append(R)}else if(u.type===r.ElementType.HYPERLINK){const R=document.createElement("a");R.innerText=u.valueList.map(h=>h.value).join(""),u.url&&(R.href=u.url),c.append(R)}else if(u.type===r.ElementType.TITLE){const R=document.createElement(`h${Ho[u.level]}`),h=i(u.valueList);R.innerHTML=h.innerHTML,c.append(R)}else if(u.type===r.ElementType.LIST){const R=document.createElement(Hl[u.listType]);u.listStyle&&(R.style.listStyleType=_l[u.listStyle]);const h=Ct(u.valueList);hs(h).forEach(T=>{const f=document.createElement("li"),m=i(T);f.innerHTML=m.innerHTML,R.append(f)}),c.append(R)}else if(u.type===r.ElementType.IMAGE){const R=document.createElement("img");u.value&&(R.src=u.value,R.width=u.width,R.height=u.height),c.append(R)}else if(u.type===r.ElementType.BLOCK){if(u.block?.type===r.BlockType.VIDEO){const R=u.block.videoBlock?.src;if(R){const h=document.createElement("video");h.style.display="block",h.controls=!0,h.src=R,h.width=u.width||t?.width||window.innerWidth,h.height=u.height,c.append(h)}}else if(u.block?.type===r.BlockType.IFRAME){const{src:R,srcdoc:h,sandbox:g,allow:T}=u.block.iframeBlock||{};if(R||h){const f=document.createElement("iframe");f.sandbox.add(...g||nn.sandbox),f.setAttribute("allow",[T||nn.allow].join(" ")),f.style.display="block",f.style.border="none",R?f.src=R:h&&(f.srcdoc=h),f.width=`${u.width||t?.width||window.innerWidth}`,f.height=`${u.height}`,c.append(f)}}}else if(u.type===r.ElementType.SEPARATOR){const R=document.createElement("hr");u.dashArray?.length&&R.setAttribute("data-dash-array",u.dashArray.join(",")),c.append(R)}else if(u.type===r.ElementType.CHECKBOX){const R=document.createElement("input");R.type="checkbox",u.checkbox?.value&&R.setAttribute("checked","true"),c.append(R)}else if(u.type===r.ElementType.RADIO){const R=document.createElement("input");R.type="radio",u.radio?.value&&R.setAttribute("checked","true"),c.append(R)}else if(u.type===r.ElementType.TAB){const R=document.createElement("span");R.innerHTML=`${_i}${_i}`,c.append(R)}else if(u.type===r.ElementType.CONTROL){const R=document.createElement("span"),h=i(u.control?.value||[]);R.innerHTML=h.innerHTML,c.append(R)}else if(u.type===r.ElementType.PAGE_BREAK){const R=document.createElement("div");R.style.breakAfter="page",c.append(R)}else if(!u.type||u.type===r.ElementType.LATEX||te.includes(u.type)){let R="";if(u.type===r.ElementType.DATE?R=u.valueList?.map(g=>g.value).join("")||"":R=u.value,!R)continue;const h=Ca(u,e);a[d-1]?.type===r.ElementType.TITLE&&(R=R.replace(/^\n/,"")),h.innerText=R.replace(new RegExp(`${k}`,"g"),`
|
|
91
|
+
`),c.append(h)}}return c}const l=document.createElement("div"),s=La(n);for(let a=0;a<s.length;a++){const c=s[a],d=!c.rowFlex||c.rowFlex===r.RowFlex.LEFT,u=document.createElement("div");if(!d){const R=c.data[0];cn(R)?(u.style.display="flex",u.style.justifyContent=pa(R.rowFlex)):(u.style.textAlign=us(c.rowFlex),c.rowFlex==="justify"&&(u.style.textAlignLast="justify"))}u.innerHTML=i(c.data).innerHTML,d?u.childNodes.forEach(R=>{l.append(R.cloneNode(!0))}):l.append(u)}return l}function Pa(o){if(!o||o.nodeType!==3)return null;const t=o.parentNode,e=t.nodeName==="FONT"?t.parentNode:t,n=ds(e),i=o.textContent,l=window.getComputedStyle(e);if(!i||e.nodeName==="STYLE")return null;const s={value:i,color:l.color,bold:Number(l.fontWeight)>500,italic:l.fontStyle.includes("italic"),size:Math.floor(parseFloat(l.fontSize))};return e.nodeName==="SUB"||l.verticalAlign==="sub"?s.type=r.ElementType.SUBSCRIPT:(e.nodeName==="SUP"||l.verticalAlign==="super")&&(s.type=r.ElementType.SUPERSCRIPT),n!==r.RowFlex.LEFT&&(s.rowFlex=n),l.backgroundColor!=="rgba(0, 0, 0, 0)"&&(s.highlight=l.backgroundColor),l.textDecorationLine.includes("underline")&&(s.underline=!0),l.textDecorationLine.includes("line-through")&&(s.strikeout=!0),s}function an(o,t){const e=[];function n(c){if(c.nodeType===3){const d=Pa(c);d&&e.push(d)}else if(c.nodeType===1){const d=c.childNodes;for(let u=0;u<d.length;u++){const R=d[u];if(R.nodeName==="BR")e.push({value:`
|
|
92
|
+
`});else if(R.nodeName==="A"){const h=R,g=h.innerText;g&&e.push({type:r.ElementType.HYPERLINK,value:"",valueList:[{value:g}],url:h.href})}else if(/H[1-6]/.test(R.nodeName)){const g=an(Ma(R,"div").outerHTML,t);e.push({value:"",type:r.ElementType.TITLE,level:Gl[R.nodeName],valueList:g}),R.nextSibling&&!yl.includes(R.nextSibling.nodeName)&&e.push({value:`
|
|
93
|
+
`})}else if(R.nodeName==="UL"||R.nodeName==="OL"){const h=R,g={value:"",type:r.ElementType.LIST,valueList:[]};R.nodeName==="OL"?g.listType=r.ListType.OL:(g.listType=r.ListType.UL,g.listStyle=h.style.listStyleType),h.querySelectorAll("li").forEach(T=>{const f=an(T.innerHTML,t);f.forEach(m=>{m.value===`
|
|
94
|
+
`&&(m.listWrap=!0)}),f.unshift({value:`
|
|
95
|
+
`}),g.valueList.push(...f)}),e.push(g)}else if(R.nodeName==="HR")e.push({value:`
|
|
96
|
+
`,type:r.ElementType.SEPARATOR});else if(R.nodeName==="IMG"){const{src:h,width:g,height:T}=R;h&&g&&T&&e.push({width:g,height:T,value:h,type:r.ElementType.IMAGE,rowFlex:ds(R.parentElement)})}else if(R.nodeName==="VIDEO"){const{src:h,width:g,height:T}=R;h&&g&&T&&e.push({value:"",type:r.ElementType.BLOCK,block:{type:r.BlockType.VIDEO,videoBlock:{src:h}},width:g,height:T})}else if(R.nodeName==="IFRAME"){const{src:h,srcdoc:g,width:T,height:f}=R;(h||g)&&T&&f&&e.push({value:"",type:r.ElementType.BLOCK,block:{type:r.BlockType.IFRAME,iframeBlock:{src:h,srcdoc:g}},width:parseInt(T),height:parseInt(f)})}else if(R.nodeName==="TABLE"){const h=R,g={type:r.ElementType.TABLE,value:`
|
|
97
|
+
`,colgroup:[],trList:[]},T=h.querySelectorAll("colgroup col");if(h.querySelectorAll("tr").forEach(f=>{const m=Number(window.getComputedStyle(f).height.replace("px","")),p={height:m,minHeight:m,tdList:[]};f.querySelectorAll("th,td").forEach(C=>{const I=C,P=an(I.innerHTML,t),M={colspan:I.colSpan,rowspan:I.rowSpan,value:P,verticalAlign:window.getComputedStyle(C).verticalAlign,width:parseFloat(window.getComputedStyle(C).width)};I.style.backgroundColor&&(M.backgroundColor=I.style.backgroundColor),p.tdList.push(M)}),g.trList.push(p)}),g.trList.length){const f=g.trList[0].tdList.reduce((p,C)=>p+C.colspan,0),m=Math.ceil(t.innerWidth/f);for(let p=0;p<f;p++){const C=T[p]?.getAttribute("width");g.colgroup.push({width:C?parseFloat(C):m})}e.push(g)}}else if(R.nodeName==="INPUT"&&R.type===r.ControlComponent.CHECKBOX)e.push({type:r.ElementType.CHECKBOX,value:"",checkbox:{value:R.checked}});else if(R.nodeName==="INPUT"&&R.type===r.ControlComponent.RADIO)e.push({type:r.ElementType.RADIO,value:"",radio:{value:R.checked}});else if(n(R),R.nodeType===1&&u!==d.length-1){const h=R;window.getComputedStyle(h).display==="block"&&!/(\n|\r\n)$/.test(h.textContent)&&e.push({value:`
|
|
98
|
+
`})}}}}const i=document.createElement("div");document.body.appendChild(i);const l=i.attachShadow({mode:"open"}),s=document.createElement("div");s.innerHTML=o,l.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 ke(o,t){const e=t?xn(t):null,n=e?.mode===r.EditorMode.READONLY?sn(Ct(o,{editorOptions:e})):Ct(o);function i(l){let s="";for(let a=0;a<l.length;a++){const c=l[a];if(c.type===r.ElementType.TABLE){s+=`
|
|
99
|
+
`;const d=c.trList;for(let u=0;u<d.length;u++){const R=d[u];for(let h=0;h<R.tdList.length;h++){const g=R.tdList[h],T=i(Ct(g.value)),f=h===0,m=R.tdList.length-1===h;s+=`${f?"":" "}${T}${m?`
|
|
100
|
+
`:""}`}}}else if(c.type===r.ElementType.TAB)s+=" ";else if(c.type===r.ElementType.HYPERLINK)s+=c.valueList.map(d=>d.value).join("");else if(c.type===r.ElementType.TITLE)s+=`${i(Ct(c.valueList))}`;else if(c.type===r.ElementType.LIST){const d=Ct(c.valueList),u=hs(d);let R="";c.listType===r.ListType.UL&&(R=Ko[c.listStyle]),u.forEach((h,g)=>{const T=u.size-1===g;s+=`
|
|
101
|
+
${R||`${g+1}.`}${i(h)}${T?`
|
|
102
|
+
`:""}`})}else if(c.type===r.ElementType.CHECKBOX)s+=c.checkbox?.value?"☑":"□";else if(c.type===r.ElementType.RADIO)s+=c.radio?.value?"☉":"○";else if(!c.type||c.type===r.ElementType.LATEX||te.includes(c.type)){let d="";if(c.type===r.ElementType.CONTROL){const u=c.control.value?.[0]?.value||"";d=u?`${c.control?.preText||""}${u}${c.control?.postText||""}`:""}else c.type===r.ElementType.DATE?d=c.valueList?.map(u=>u.value).join("")||"":d=c.value;s+=d.replace(new RegExp(`${k}`,"g"),`
|
|
103
|
+
`)}}return s}return i(n)}function ko(o){return Fo(o,["metrics","style"])}function cn(o){return!!o?.type&&(Fl.includes(o.type)||o.imgDisplay===r.ImageDisplay.INLINE)}function Ma(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 Jo(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e];n?.imgDisplay===r.ImageDisplay.SURROUND&&t.push(n)}return t}function Oa(o,t){for(let e=o.length-1;e>=0;e--)o[e].imgFloatPosition?.pageNo===t&&o.splice(e,1)}function _t(o){return o?!!(o.hide||o.control?.hide||o.area?.hide):!0}function dn(o,t,e=r.LocationPosition.BEFORE){if(!_t(o[t]))return t;let n=t;if(e===r.LocationPosition.BEFORE)for(n=t-1;n>0;){if(!_t(o[n]))return n;n--}else for(n=t+1;n<o.length;){if(!_t(o[n]))return n;n++}return n}const gs=`${On}-control`;function Ea(o){localStorage.setItem(On,JSON.stringify({text:o.text,elementList:o.elementList}))}function Ts(){const o=localStorage.getItem(On);return o?JSON.parse(o):null}function fs(){localStorage.removeItem(On)}function Sa(o){localStorage.setItem(gs,JSON.stringify(o))}function ms(){const o=localStorage.getItem(gs);return o?JSON.parse(o):null}function Xa(){return!!ms()?.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 l=new ClipboardItem({[n.type]:n,[i.type]:i});await window.navigator.clipboard.write([l])}else{const l=document.createElement("div");l.setAttribute("contenteditable","true"),l.innerHTML=t,document.body.append(l);const s=window.getSelection(),a=document.createRange(),c=document.createElement("span");c.innerText=`
|
|
104
|
+
`,l.append(c),a.selectNodeContents(l),s?.removeAllRanges(),s?.addRange(a),document.execCommand("copy"),l.remove()}Ea({text:o,elementList:e})}async function ps(o,t){const e=ln(o,t);document.body.append(e);const n=e.innerText;e.remove();const i=e.innerHTML;!n&&!i&&!o.length||await Na(n,i,Ct(o))}function Fa(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 Bo(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled()||e.getControl().getIsDisabledPasteControl())return;const n=e.getRange(),{startIndex:i}=n.getRange(),l=e.getElementList();if(~i&&!n.getIsSelectAll()){const s=l[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(bl.includes(c.type)){if(t.splice(a,1),c.valueList)for(let d=0;d<c.valueList.length;d++){const u=c.valueList[d];u.value===k||u.value===`
|
|
105
|
+
`||(t.splice(a,0,u),a++)}a--}a++}}wt(l,t,i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()})}e.insertElementList(t)}function Is(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=an(t,{innerWidth:e.getOriginalInnerWidth()});Bo(o,n)}function $o(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=e.getRange(),{startIndex:i}=n.getRange(),l=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:r.ElementType.IMAGE,width:a.width,height:a.height};~i&&wt(l,[d],i,{editorOptions:e.getOptions()}),e.insertElementList([d])}}}function ya(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(!Fa(n)){const s=n.getData("text"),a=Ts();if(a&&_n(s)===_n(a.text)){Bo(o,a.elementList);return}}fs();let l=!1;for(let s=0;s<n.items.length;s++)if(n.items[s].type==="text/html"){l=!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"&&!l){a.getAsString(c=>{o.input(c)});break}if(a.type==="text/html"&&l){a.getAsString(c=>{Is(o,c)});break}}else if(a.kind==="file"&&a.type.includes("image")){const c=a.getAsFile();c&&$o(o,c)}}}async function ba(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(),l=Ts();if(l&&_n(i)===_n(l.text)){Bo(o,l.elementList);return}if(fs(),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 u=await(await c.getType("text/plain")).text();u&&o.input(u)}else if(c.types.includes("text/html")&&a){const u=await(await c.getType("text/html")).text();u&&Is(o,u)}else if(c.types.some(d=>d.startsWith("image/"))){const d=c.types.find(R=>R.startsWith("image/")),u=await c.getType(d);$o(o,u)}}}class Wa{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(`${q}-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||(ya(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 Va{ANIMATION_CLASS=`${q}-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(`${q}-cursor`),this.container.append(this.cursorDom),this.cursorAgent=new Wa(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(Ml&&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:l,width:s,isShow:a=!0,isBlink:c=!0,isFocus:d=!0,hitLineStartIndex:u}={...i,...t},R=this.draw.getHeight(),h=this.draw.getPageGap();this.hitLineStartIndex=u,u&&(e=this.position.getPositionList()[u]);const{metrics:g,coordinate:{leftTop:T,rightTop:f},ascent:m,pageNo:p}=e,P=(this.draw.getZone().isMainActive()?p:this.draw.getPageNo())*(R+h),M=Cl*n,N=Math.min(g.height/4,M),F=g.height+N*2,S=this.cursorAgent.getAgentCursorDom();d&&setTimeout(()=>{this.focus()});const W=g.boundingBoxDescent<0?0:g.boundingBoxDescent,Y=T[1]+m+W-(F-N)+P,b=u?T[0]:f[0];if(S.style.left=`${b}px`,S.style.top=`${Y+F-M}px`,!a){this.recoveryCursor();return}const D=this.cursorDom.style.top,X=this.draw.isReadonly();this.cursorDom.style.width=`${s*n}px`,this.cursorDom.style.backgroundColor=l,this.cursorDom.style.left=`${b}px`,this.cursorDom.style.top=`${Y}px`,this.cursorDom.style.display=X?"none":"block",this.cursorDom.style.height=`${F}px`,c?this._setBlinkTimeout():this._clearBlinkTimeout(),Vo(()=>{this.moveCursorToVisible({cursorPosition:e,direction:parseInt(D)>Y?Ut.UP:Ut.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:l,leftBottom:s}}=e,a=fl(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:f,right:m,top:p,bottom:C}=a.getBoundingClientRect();c.left=f,c.right=m,c.top=p,c.bottom=C}const u=i*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,R=n===Ut.UP,h=s[0]+(d?0:c.left),g=R?l[1]+u:s[1]+u,{maskMargin:T}=this.options;if(c.top+=T[0],c.bottom-=T[2],!(h>=c.left&&h<=c.right&&g>=c.top&&g<=c.bottom)){const{scrollLeft:f,scrollTop:m}=a;R?a.scroll(f,m-(c.top-g)):a.scroll(f,m+g-c.bottom)}}}var un;(function(o){o[o.LEFT=0]="LEFT",o[o.CENTER=1]="CENTER",o[o.RIGHT=2]="RIGHT"})(un||(un={}));function Ie(o){return Ae?o.metaKey:o.ctrlKey}r.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"})(r.KeyMap||(r.KeyMap={}));class zn{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 l=e;for(;l>0;){const a=t[l];if(a.controlId!==n.controlId||a.controlComponent===r.ControlComponent.PREFIX||a.controlComponent===r.ControlComponent.PRE_TEXT)break;a.controlComponent===r.ControlComponent.VALUE&&i.unshift(a),l--}let s=e+1;for(;s<t.length;){const a=t[s];if(a.controlId!==n.controlId||a.controlComponent===r.ControlComponent.POSTFIX||a.controlComponent===r.ControlComponent.POST_TEXT)break;a.controlComponent===r.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,l=e.elementList||this.control.getElementList(),{startIndex:s}=e.range||this.control.getRange(),a=l[s];let c=s;for(;c>0;){const u=l[c];if(u.controlId!==a.controlId||u.controlComponent===r.ControlComponent.PREFIX||u.controlComponent===r.ControlComponent.PRE_TEXT)break;if(u.controlComponent===r.ControlComponent.CHECKBOX){const R=u.checkbox;R.value=t.includes(R.code)}c--}let d=s+1;for(;d<l.length;){const u=l[d];if(u.controlId!==a.controlId||u.controlComponent===r.ControlComponent.POSTFIX||u.controlComponent===r.ControlComponent.POST_TEXT)break;if(u.controlComponent===r.ControlComponent.CHECKBOX){const R=u.checkbox;R.value=t.includes(R.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===r.KeyMap.Backspace||t.key===r.KeyMap.Delete?this.control.removeControl(n):i}cut(){return-1}}class zo extends zn{setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const{control:i}=this.element,l=e.elementList||this.control.getElementList(),{startIndex:s}=e.range||this.control.getRange(),a=l[s];let c=s;for(;c>0;){const u=l[c];if(u.controlId!==a.controlId||u.controlComponent===r.ControlComponent.PREFIX||u.controlComponent===r.ControlComponent.PRE_TEXT)break;if(u.controlComponent===r.ControlComponent.RADIO){const R=u.radio;R.value=t.includes(R.code)}c--}let d=s+1;for(;d<l.length;){const u=l[d];if(u.controlId!==a.controlId||u.controlComponent===r.ControlComponent.POSTFIX||u.controlComponent===r.ControlComponent.POST_TEXT)break;if(u.controlComponent===r.ControlComponent.RADIO){const R=u.radio;R.value=t.includes(R.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:s,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}}function Cs(o){const t=o.getDraw(),e=t.getPosition(),n=t.getRange();o.isAllowDrag=!0,o.cacheRange=dt(n.getRange()),o.cacheElementList=t.getElementList(),o.cachePositionList=e.getPositionList(),o.cachePositionContext=e.getPositionContext()}function Ls(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 l=t.getControl().getActiveControl();l instanceof zn&&l.setSelect(i)}}function Ps(o,t){const{radio:e,control:n}=o;if(!n)t.getRadioParticle().setSelect(o);else{const i=e?.code?[e.code]:[],l=t.getControl().getActiveControl();l instanceof zo&&l.setSelect(i)}}function Da(o,t){const e=t.getDraw();let n=e.isReadonly();const i=e.getRange(),l=e.getPosition(),s=i.getRange();if(o.button===un.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())){Cs(t);return}t.isAllowSelection=!0;const d=dt(l.getPositionContext()),u=l.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!u)return;const{index:R,isDirectHit:h,isCheckbox:g,isRadio:T,isImage:f,isLabel:m,isMacro:p,isTable:C,tdValueIndex:I,hitLineStartIndex:P}=u;h&&p&&console.log("mousedown - positionResult:",{index:R,isDirectHit:h,isMacro:p}),t.mouseDownStartPosition={...u,index:C?I:R,originalIndex:R,x:o.offsetX,y:o.offsetY};const M=e.getElementList(),N=l.getPositionList(),F=C?I:R;let S;C?S=e.getTd().value[I]:S=M[F];const W=!!(h&&f),Y=!!(h&&g),b=!!(h&&T),D=!!(h&&m),X=!!(h&&p),O=w=>w&&(w.type===r.ElementType.MACRO||w.type===r.ElementType.CUSTOM_MACRO||w.type===r.ElementType.REUSABLE_ITEM||w.type===r.ElementType.SUB_TEMPLATE||w.type===r.ElementType.MENSTRUAL_HISTORY||w.type===r.ElementType.FETAL_HEART_POSITION||w.type===r.ElementType.TOOTH_POSITION||w.type===r.ElementType.LIST||w.type===r.ElementType.SPECIAL_SYMBOLS),E=w=>w&&!!w.originControlId&&!!w.controlId,L=w=>w&&!!w.originControlId&&!!w.controlId&&(w.controlComponent===r.ControlComponent.POSTFIX||w.controlComponent===r.ControlComponent.POSTTEXTFIX||w.controlComponent===r.ControlComponent.POST_TEXT||w.controlComponent===r.ControlComponent.PLACEHOLDER),V=w=>{if(!w)return null;const v=new Set;let Z=w,_=null;for(;Z&&!v.has(Z);){v.add(Z);let x;for(let G=0;G<M.length;G++){const B=M[G];if(B.controlId===Z&&B.control?.type&&(x=B,B.controlComponent===r.ControlComponent.PREFIX||B.controlComponent===r.ControlComponent.PRE_TEXT||B.controlComponent===r.ControlComponent.PRETEXTFIX||B.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT))break}if(!x)break;x.control?.type===r.ControlType.TEXT&&(_=Z),Z=x.originControlId||null}return _},y=e.getMode()===r.EditorMode.FORM,U=y&&S?.control?.type===r.ControlType.TEXT,Q=y&&!U?e.getControl().getActiveTextControlLimit():null;let K=F;const z=(w,v)=>!!w&&!!v&&w.controlId===v;let rt=!1;if(y&&Q?.parentControlId&&S?.controlId===Q.parentControlId&&!S?.originControlId)for(let w=F;w>=0;w--){const v=M[w];if(z(v,Q.parentControlId)){v.control?.type===r.ControlType.TEXTFIELD&&(rt=!0);break}if(v.controlId!==Q.parentControlId)break}const at=!!(Q&&(!S?.controlId||S.controlId===Q.controlId&&(S.originControlId||null)===Q.originControlId||Q.parentControlId&&S.controlId===Q.parentControlId&&!S.originControlId&&rt));if(y&&!U&&(S?.controlId||S?.originControlId)){let w;const v=S.originControlId||S.controlId;for(let Z=F;Z>=0;Z--){const _=M[Z];if(z(_,v)&&_.control?.type){w=_.control.type;break}if(_.controlId!==S.controlId&&_.controlId!==v)break}if(w===r.ControlType.TEXT&&E(S))S.controlComponent===r.ControlComponent.PREFIX||S.controlComponent===r.ControlComponent.PRE_TEXT||S.controlComponent===r.ControlComponent.PRETEXTFIX||S.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||S.controlComponent===r.ControlComponent.PLACEHOLDER?K=Math.max(F-1,0):(S.controlComponent===r.ControlComponent.POSTFIX||S.controlComponent===r.ControlComponent.POST_TEXT||S.controlComponent===r.ControlComponent.POSTTEXTFIX||S.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)&&(K=F);else if(w===r.ControlType.TEXTFIELD){const Z=S.controlComponent;if(!E(S)){if(!(F>0&&L(M[F-1]))){if(!(S.controlComponent===r.ControlComponent.VALUE&&O(S))){if(Z===r.ControlComponent.PRETEXTFIX||Z===r.ControlComponent.PRETEXTFIX_TEXT||Z===r.ControlComponent.POSTTEXTFIX||Z===r.ControlComponent.POSTTEXTFIX_TEXT||Z===r.ControlComponent.TEXTFIXLABEL||Z===r.ControlComponent.PREFIX||Z===r.ControlComponent.POSTFIX||Z===r.ControlComponent.PRE_TEXT||Z===r.ControlComponent.POST_TEXT||Z===r.ControlComponent.PLACEHOLDER)for(let _=F+1;_<M.length;_++){const x=M[_];if(x.controlId!==v&&x.originControlId!==v)break;if(x.controlComponent===r.ControlComponent.VALUE&&!O(x)){K=_;break}if(x.controlComponent===r.ControlComponent.POSTTEXTFIX||x.controlComponent===r.ControlComponent.POSTFIX){for(let G=F-1;G>=0;G--){const B=M[G];if(B.controlId!==v&&B.originControlId!==v)break;if(B.controlComponent===r.ControlComponent.VALUE&&!O(B)){K=G;break}}break}}else if(Z===r.ControlComponent.VALUE&&F>0){const _=M[F-1];if(_&&(_.controlId===v||_.originControlId===v)&&_.controlComponent===r.ControlComponent.VALUE&&O(_)){let x=!1;for(let G=F-2;G>=0;G--){const B=M[G];if(B.controlId!==v&&B.originControlId!==v||B.controlComponent!==r.ControlComponent.VALUE&&!B.originControlId&&B.controlId===v)break;if(!O(B)){K=G+1,x=!0;break}}if(!x)for(let G=F;G<M.length;G++){const B=M[G];if(B.controlId!==v&&B.originControlId!==v||(B.controlComponent===r.ControlComponent.POSTTEXTFIX||B.controlComponent===r.ControlComponent.POSTFIX)&&!B.originControlId&&B.controlId===v)break;if(!O(B)){K=G,x=!0;break}}}}}}}}}if(y&&S?.control?.type===r.ControlType.TEXT&&S?.originControlId&&S.controlComponent===r.ControlComponent.PLACEHOLDER&&V(S.originControlId)&&(K=Math.max(F-1,0)),~R){at&&(K=Math.min(Math.max(K,Q.startIndex),Q.endIndex));let w=K,v=K;if(o.shiftKey){const{startIndex:Z}=i.getRange();~Z&&l.getPositionContext().tdId===d.tdId&&(F>Z?w=Z:v=Z)}if(at&&(w=Math.min(Math.max(w,Q.startIndex),Q.endIndex),v=Math.min(Math.max(v,Q.startIndex),Q.endIndex),K=Math.min(Math.max(K,Q.startIndex),Q.endIndex)),i.setRange(w,v),l.setCursorPosition(N[K]),n=e.isReadonly(),Y&&!n)Ls(S,e);else if(b&&!n)Ps(S,e);else if(S.controlComponent===r.ControlComponent.VALUE&&(S.control?.type===r.ControlType.CHECKBOX||S.control?.type===r.ControlType.RADIO)){let Z=F;for(;Z>0;){const _=M[Z];if(_.controlComponent===r.ControlComponent.CHECKBOX){Ls(_,e);break}else if(_.controlComponent===r.ControlComponent.RADIO){Ps(_,e);break}Z--}}else{const Z=S?.control?.type===r.ControlType.BUTTON&&!S.control?.buttonText,_=h&&Z;let x=!1;if(y&&S?.controlId&&S?.controlComponent===r.ControlComponent.VALUE&&!S.originControlId){let J=!1;for(let Rt=F;Rt>=0;Rt--){const ht=M[Rt];if(ht.controlId!==S.controlId){if(ht.originControlId===S.controlId){J=!0;continue}break}if(ht.control?.type===r.ControlType.TEXTFIELD){if(J)break;x=!0;break}}if(!J&&!x)for(let Rt=F+1;Rt<M.length;Rt++){const ht=M[Rt];if(ht.controlId!==S.controlId){if(ht.originControlId===S.controlId){J=!0;continue}break}}J&&(x=!1)}const G=x&&O(S),B=X&&!G?K+1:void 0;e.render({curIndex:X&&!G?B:K,isCompute:!1,isSubmitHistory:!1,isSetCursor:!W&&!Y&&!b&&!(_&&y)&&!G});const st=M[K];if(!n&&h&&st?.controlId&&o.button===un.LEFT){const Rt=e.getControl().getActiveControl(),ht=Rt?.getElement()?.control?.type;Rt&&(ht===r.ControlType.NUMBER||ht===r.ControlType.SELECT)&&Rt.getElement()?.controlId===st.controlId&&st.controlComponent!==r.ControlComponent.POSTFIX&&st.controlComponent!==r.ControlComponent.POSTTEXTFIX&&st.controlComponent!==r.ControlComponent.POSTTEXTFIX_TEXT&&st.controlComponent!==r.ControlComponent.POST_TEXT&&typeof Rt.awake=="function"&&Rt.awake()}}P&&t.getDraw().getCursor().drawCursor({hitLineStartIndex:P})}const A=e.getEventBus();if(D&&A.isSubscribe("labelMousedown")&&A.emit("labelMousedown",{evt:o,element:S}),X&&(S.type===r.ElementType.MACRO||S.type===r.ElementType.CUSTOM_MACRO||S.type===r.ElementType.REUSABLE_ITEM)){const w=e.getMode();if(w===r.EditorMode.EDIT&&S.type===r.ElementType.CUSTOM_MACRO)A.isSubscribe("macroClick")&&A.emit("macroClick",{evt:o,element:S});else if(w===r.EditorMode.FORM){let v=!1;S.type===r.ElementType.CUSTOM_MACRO&&o.button===un.LEFT&&!n&&(v=e.getMacroParticle().activateInlineEditor(S,F)),!v&&A.isSubscribe("macroValueChange")&&A.emit("macroValueChange",{evt:o,element:S})}}o.button===un.LEFT&&X&&S.type===r.ElementType.SUB_TEMPLATE&&e.getMode()===r.EditorMode.FORM&&A.isSubscribe("subTemplateClick")&&A.emit("subTemplateClick",{evt:o,element:S});const it=e.getPreviewer();if(it.clearResizer(),W){const w={dragDisable:n||!S.controlId&&e.getMode()===r.EditorMode.FORM};S.type===r.ElementType.LATEX&&(w.mime="svg",w.srcKey="laTexSVG"),it.drawResizer(S,N[F],w),e.getCursor().drawCursor({isShow:!1}),Cs(t),(S.imgDisplay===r.ImageDisplay.SURROUND||S.imgDisplay===r.ImageDisplay.FLOAT_TOP||S.imgDisplay===r.ImageDisplay.FLOAT_BOTTOM)&&e.getImageParticle().createFloatImage(S),A.isSubscribe("imageMousedown")&&A.emit("imageMousedown",{evt:o,element:S})}const ct=e.getTableTool();ct.dispose(),C&&!n&&e.getMode()!==r.EditorMode.FORM&&ct.render();const Nt=e.getHyperlinkParticle();Nt.clearHyperlinkPopup(),S.type===r.ElementType.HYPERLINK&&(Ie(o)?Nt.openHyperlink(S):Nt.drawHyperlinkPopup(S,N[F]));const Ft=e.getDateParticle();Ft.clearDatePicker(),S.type===r.ElementType.DATE&&!n&&Ft.renderDatePicker(S,N[F]);const St=e.getMenstrualHistoryParticle();St.clearMenstrualHistoryEditor(),S.type===r.ElementType.MENSTRUAL_HISTORY&&h&&(e.getMode()===r.EditorMode.FORM||e.getMode()===r.EditorMode.EDIT)&&St.renderMenstrualHistoryEditor(S,N[F]);const le=e.getFetalHeartPositionParticle();le.clearFetalHeartPositionEditor(),S.type===r.ElementType.FETAL_HEART_POSITION&&h&&(e.getMode()===r.EditorMode.FORM||e.getMode()===r.EditorMode.EDIT)&&le.renderFetalHeartPositionEditor(S,N[F]);const ne=e.getToothPositionParticle();ne.clearToothPositionEditor(),S.type===r.ElementType.TOOTH_POSITION&&h&&(e.getMode()===r.EditorMode.FORM||e.getMode()===r.EditorMode.EDIT)&&ne.renderToothPositionEditor(S,N[F])}function jn(o){const t=gt();return Reflect.set(o,"dragId",t),t}function qn(o,t){return t.findIndex(e=>e.dragId===o)}function Ms(o,t,e){const n=e.getDraw();if(o.imgDisplay===r.ImageDisplay.SURROUND||o.imgDisplay===r.ImageDisplay.FLOAT_TOP||o.imgDisplay===r.ImageDisplay.FLOAT_BOTTOM){const i=t.offsetX-e.mouseDownStartPosition.x,l=t.offsetY-e.mouseDownStartPosition.y,s=o.imgFloatPosition;o.imgFloatPosition={x:s.x+i,y:s.y+l,pageNo:n.getPageNo()}}n.getImageParticle().destroyFloatImage()}function Ya(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(),l=n.getPositionContext(),s=e.getRange(),a=t.cacheRange,c=t.cacheElementList,d=t.cachePositionList,u=t.cachePositionContext,R=s.getRange(),h=a.startIndex===a.endIndex,g=h?a.startIndex-1:a.startIndex,T=a.endIndex;if(R.startIndex>=g&&R.endIndex<=T&&t.cachePositionContext?.tdId===l.tdId){e.clearSideEffect();let A=!1,it=!1;if(h){const ct=c[T];if(ct.type===r.ElementType.IMAGE||ct.type===r.ElementType.LATEX){if(Ms(ct,o,t),ct.imgDisplay===r.ImageDisplay.SURROUND||ct.imgDisplay===r.ImageDisplay.FLOAT_TOP||ct.imgDisplay===r.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(ct),A=!0;else{const Nt=d[T];e.getPreviewer().drawResizer(ct,Nt)}it=ct.imgDisplay===r.ImageDisplay.SURROUND}}s.replaceRange({...a}),e.render({isCompute:it,isSubmitHistory:A,isSetCursor:!1});return}const f=c.slice(g+1,T+1),m=f.find(A=>A.controlId);if(m){const A=c[g+1],it=c[T];if(!((!A.controlId||A.controlComponent===r.ControlComponent.PREFIX)&&(!it.controlId||it.controlComponent===r.ControlComponent.POSTFIX)||A.controlId===it.controlId&&A.controlComponent===r.ControlComponent.PREFIX&&it.controlComponent===r.ControlComponent.POSTFIX||A.control?.type===r.ControlType.TEXT&&A.controlComponent===r.ControlComponent.VALUE&&it.control?.type===r.ControlType.TEXT&&it.controlComponent===r.ControlComponent.VALUE)){e.render({curIndex:R.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const p=e.getControl(),C=e.getElementList(),I=!m||!!C[R.startIndex].controlId||!p.getIsElementListContainFullControl(f),P=e.getOptions(),M=f.map(A=>{if(!A.type||A.type===r.ElementType.TEXT){const it={value:A.value},ct=ge;return I||ct.push(...wo),ct.forEach(Nt=>{const Ft=A[Nt];Ft!==void 0&&(it[Nt]=Ft)}),it}else{let it=dt(A);return I&&(it=qt(it,wo)),yt([it],{isHandleFirstElement:!1,editorOptions:P}),it}});wt(C,M,R.startIndex,{editorOptions:e.getOptions()});const N=c[g],F=d[g],S=jn(c[g]),W=jn(c[T]),Y=M.length;let b=R.startIndex,D=b+Y;const X=p.getActiveControl();if(X&&c[b].controlComponent!==r.ControlComponent.POSTFIX?(D=X.setValue(M),b=D-Y):e.spliceElementList(C,b+1,0,M),!~D){e.render({isSetCursor:!1});return}const O=jn(C[b]),E=jn(C[D]),L=qn(S,c),V=qn(W,c),y=c[V];if(y.controlId&&y.controlComponent!==r.ControlComponent.POSTFIX)s.replaceRange({...a,startIndex:L,endIndex:V}),p.getActiveControl()?.cut();else{let A=!0;if(u?.isTable){const{tableId:it,trIndex:ct,tdIndex:Nt}=u;A=!e.getOriginalElementList().some(St=>St.id===it&&St?.trList?.[ct]?.tdList?.[Nt]?.deletable===!1)}A&&e.spliceElementList(c,L+1,V-L)}const U=C[R.startIndex],Q=i[R.startIndex];let K=l.index;K&&(U.tableId&&!N.tableId?F.index<K&&(K-=Y):!U.tableId&&N.tableId&&Q.index<K&&(K+=Y),n.setPositionContext({...l,index:K}));const z=qn(O,C),rt=qn(E,C);s.setRange(h?rt:z,rt,R.tableId,R.startTdIndex,R.endTdIndex,R.startTrIndex,R.endTrIndex),e.clearSideEffect();let at=null;if(h){const it=e.getElementList()[rt];(it.type===r.ElementType.IMAGE||it.type===r.ElementType.LATEX)&&(Ms(it,o,t),at=it)}if(e.render({isSetCursor:!1}),X?p.emitControlContentChange():N.controlId&&p.emitControlContentChange({context:{range:a,elementList:c},controlElement:N}),at)if(at.imgDisplay===r.ImageDisplay.SURROUND||at.imgDisplay===r.ImageDisplay.FLOAT_TOP||at.imgDisplay===r.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(at);else{const it=n.getPositionList()[rt];e.getPreviewer().drawResizer(at,it)}}else t.isAllowDrag&&t.cacheRange?.startIndex!==t.cacheRange?.endIndex&&t.mousedown(o)}function Ua(o,t){const e=t.getDraw();if(!e.getOptions().pageOuterSelectionDisable)return;const n=e.getPageContainer(),{x:i,y:l,width:s,height:a}=n.getBoundingClientRect();o.x>=i&&o.x<=i+s&&o.y>=l&&o.y<=l+a||t.setIsAllowSelection(!1)}function wa(o,t){const e=t.getDraw(),n=e.getControl(),i=e.getPageList(),l=e.getPageNo(),s=i[l],c=e.getPosition().getPositionByXY({x:o.offsetX,y:o.offsetY});if(~c.index){const E=e.getElementList(),L=c.isTable?c.tdValueIndex:c.index,V=E[L];V?.control?.type===r.ControlType.BUTTON&&!V.control?.buttonText?s&&(s.style.cursor="pointer"):s&&(s.style.cursor="text")}else s&&(s.style.cursor="text");if(t.isAllowDrag){const E=o.offsetX,L=o.offsetY,{startIndex:V,endIndex:y}=t.cacheRange,U=t.cachePositionList;for(let K=V+1;K<=y;K++){const{coordinate:{leftTop:z,rightBottom:rt}}=U[K];if(E>=z[0]&&E<=rt[0]&&L>=z[1]&&L<=rt[1])return}const Q=t.cacheRange?.startIndex;if(Q){const K=t.cacheElementList[Q];K?.type===r.ElementType.IMAGE&&(K.imgDisplay===r.ImageDisplay.SURROUND||K.imgDisplay===r.ImageDisplay.FLOAT_TOP||K.imgDisplay===r.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 u=o.target.dataset.index;u&&e.setPageNo(Number(u));const R=e.getPosition(),h=R.getPositionByXY({x:o.offsetX,y:o.offsetY});if(!~h.index)return;const{index:g,isTable:T,tdValueIndex:f,tdIndex:m,trIndex:p,tableId:C,trId:I,tdId:P}=h;let M=T?f:g;if(h.isControl&&e.getMode()!==r.EditorMode.READONLY){const{newIndex:E}=n.moveCursor({index:g,isTable:T,trIndex:p,tdIndex:m,tdValueIndex:f});M=E}const{index:N,isTable:F,tdIndex:S,tdId:W,trIndex:Y,tableId:b}=t.mouseDownStartPosition,D=M,X=e.getRange();let O;if(P!==W&&P&&W){const E=e.getTdByPosition({...t.mouseDownStartPosition,isTable:!!t.mouseDownStartPosition.tableId,index:t.mouseDownStartPosition.originalIndex??t.mouseDownStartPosition.index}),L=e.getTdByPosition({...h,isTable:!!h.tableId,index:h.index});if(e.isSplitTd(E,L)){const V=(E.valueStartIndex??0)+N,y=(L.valueStartIndex??0)+f;O=[{index:V,element:E.value[N],originalId:E.originalId,isCurrent:!1,length:E.value.length,startIndex:E.valueStartIndex??0},{index:y,element:L.value[f],originalId:L.originalId,isCurrent:!0,length:L.value.length,startIndex:L.valueStartIndex??0}]}}if(T&&F&&P!==W&&!O)X.setRange(D,D,C,S,m,Y,p),R.setPositionContext({isTable:!!T,index:g,trIndex:p,tdIndex:m,tdId:P,trId:I,tableId:C});else{let E=~D?D:0;if((F||T)&&b!==C&&!O)return;R.setPositionContext({isTable:!!T,index:g,trIndex:p,tdIndex:m,tdId:P,trId:I,tableId:C});let L=N,V,y;if(O)[{element:V},{element:y}]=O;else{const K=e.getElementList();V=K[L+1],y=K[E]}if(L===E||V?.controlComponent===r.ControlComponent.PLACEHOLDER&&y?.controlComponent===r.ControlComponent.PLACEHOLDER&&V.controlId===y.controlId)return;if(L>E&&([L,E]=[E,L]),e.getMode()===r.EditorMode.FORM){const z=n.getActiveControl()?.getElement()?.control?.type===r.ControlType.TEXT?null:n.getActiveTextControlLimit();z&&(L=Math.min(Math.max(L,z.startIndex),z.endIndex),E=Math.min(Math.max(E,z.startIndex),z.endIndex));const rt=e.getElementList(),at=rt[L],A=rt[E];if(at?.control?.type===r.ControlType.TEXTFIELD||A?.control?.type===r.ControlType.TEXTFIELD){const it=at?.controlId||A?.controlId;if(it){let ct=-1,Nt=-1;for(let Ft=L;Ft>=0;Ft--){const St=rt[Ft];if(St.controlId!==it)break;if(St.controlComponent===r.ControlComponent.PRETEXTFIX||St.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||St.controlComponent===r.ControlComponent.TEXTFIXLABEL||St.controlComponent===r.ControlComponent.PREFIX||St.controlComponent===r.ControlComponent.PRE_TEXT){ct=Ft+1;break}}for(let Ft=E;Ft<rt.length;Ft++){const St=rt[Ft];if(St.controlId!==it)break;if(St.controlComponent===r.ControlComponent.POSTTEXTFIX||St.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||St.controlComponent===r.ControlComponent.POSTFIX||St.controlComponent===r.ControlComponent.POST_TEXT){Nt=Ft-1;break}}ct!==-1&&L<ct&&(L=ct),Nt!==-1&&E>Nt&&(E=Nt)}}}let Q;if(O){const[K,z]=O.sort((rt,at)=>rt.index-at.index);Q={originalId:O[0].originalId??O[1].originalId,startIndex:K.index,endIndex:z.index},K.isCurrent?(L=K.index,E=K.length-1):(L=0,E=Q.endIndex-z.startIndex)}X.setRange(L,E,void 0,void 0,void 0,void 0,void 0,Q)}e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}function to(o,t){if(!t)return null;const e=new Set;let n=t,i=null;for(;n&&!e.has(n);){e.add(n);let l=null;for(let s=0;s<o.length;s++){const a=o[s];if(a.controlId===n&&a.control?.type&&(l=a,a.controlComponent===r.ControlComponent.PREFIX||a.controlComponent===r.ControlComponent.PRE_TEXT||a.controlComponent===r.ControlComponent.PRETEXTFIX||a.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT))break}if(!l)break;l.control?.type==="text"&&(i=n),n=l.originControlId||null}return i}function jo(o,t){return!!o&&!!t&&o.controlId===t}function Za(o,t){const e=o[t];if(!e?.subTemplateParentId)return null;const n=e.subTemplateParentId;for(let i=t-1;i>=0;i--){const l=o[i];if(l.type===r.ElementType.SUB_TEMPLATE&&l.id===n)return{labelIndex:i,labelElement:l};if(l.type===r.ElementType.SUB_TEMPLATE&&l.id!==n)break}return null}function Os(o,t,e){const n=o[t];n.subTemplateExpanded=!1,n.hide=!1;let i=t+1;for(;i<o.length&&o[i].subTemplateParentId===n.id;)i++;const l=i-t-1;return l>0&&e.spliceElementList(o,t+1,l),t}function Qa(o){const t=o.getDraw(),e=t.getRange(),n=e.getRange(),i=t.getElementList(),l=i[n.startIndex];if(!_t(l))return;let s=n.startIndex;for(;s>0;){const a=i[s];if(a.type===r.ElementType.SUB_TEMPLATE&&a.subTemplateExpanded){const u=Os(i,s,t);n.startIndex=u,n.endIndex=u,e.replaceRange(n);const R=t.getPosition(),h=R.getPositionList();R.setCursorPosition(h[u]);return}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||!_t(d)){if(c){n.startIndex=c,n.endIndex=c,e.replaceRange(n);const u=t.getPosition(),R=u.getPositionList();u.setCursorPosition(R[c])}break}}}function va(o,t,e){if(e.originControlId){const n=to(o,e.originControlId);if(!n)return{isInParent:!1};for(let i=t;i<o.length;i++){const l=o[i];if(l.controlId===n)return l.controlComponent===r.ControlComponent.POSTFIX||l.controlComponent===r.ControlComponent.POSTTEXTFIX||l.controlComponent===r.ControlComponent.POST_TEXT?{isInParent:!1}:{isInParent:!0,parentControlId:n};if(l.controlId&&l.controlId!==n&&l.originControlId!==n)break}}if(!e.originControlId&&e.controlId){const n=o[t];if(n?.controlId&&n.controlId!==e.controlId&&(n.controlComponent===r.ControlComponent.PREFIX||n.controlComponent===r.ControlComponent.PRETEXTFIX))for(let i=t-1;i>=0;i--){const l=o[i];if(l.controlId===e.controlId&&(l.controlComponent===r.ControlComponent.PREFIX||l.controlComponent===r.ControlComponent.PRETEXTFIX)){for(let s=i-1;s>=0;s--){const a=o[s],c=to(o,a.controlId);if(c&&c!==e.controlId&&(a.controlComponent===r.ControlComponent.PRETEXTFIX||a.controlComponent===r.ControlComponent.PREFIX))return{isInParent:!0,parentControlId:c};if(a.controlId&&a.controlId!==e.controlId&&(a.controlComponent===r.ControlComponent.POSTFIX||a.controlComponent===r.ControlComponent.POSTTEXTFIX))return{isInParent:!1}}break}}if(n?.controlId&&n.controlId!==e.controlId&&!n.originControlId&&(n.controlComponent===r.ControlComponent.POSTFIX||n.controlComponent===r.ControlComponent.POSTTEXTFIX)){if(e.originControlId===n.controlId){const i=to(o,n.controlId);if(i)return{isInParent:!0,parentControlId:i}}return{isInParent:!1}}}return{isInParent:!1}}function Ka(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;n.getIsCollapsed()&&Qa(t);const i=e.getControl(),{startIndex:l,endIndex:s,isCrossRowCol:a}=n.getRange();let c;const d=e.getElementList();if(n.getIsCollapsed()&&l>0){const R=d[l-1],h=d[l],g=h?.control?.type===r.ControlType.TEXT&&h.controlComponent===r.ControlComponent.PLACEHOLDER&&!i.getIsExistValueByElementListIndex(d,l);if(R?.subTemplateParentId){const X=Za(d,l-1);if(X){const O=Os(d,X.labelIndex,e);e.getGlobalEvent().setCanvasEventAbility(),n.setRange(O,O),e.render({curIndex:O});return}}const f=e.getPosition().getPositionList(),m=f[l],p=f[l-1],C=m&&p&&m.rowIndex===p.rowIndex,I=R?.controlComponent===r.ControlComponent.PREFIX||R?.controlComponent===r.ControlComponent.PRETEXTFIX||R?.controlComponent===r.ControlComponent.PRE_TEXT||R?.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT,P=R?.controlComponent===r.ControlComponent.POSTFIX||R?.controlComponent===r.ControlComponent.POSTTEXTFIX||R?.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||R?.controlComponent===r.ControlComponent.POST_TEXT,M=!!R?.controlId,N=h?.controlComponent===r.ControlComponent.PLACEHOLDER,F=h?.controlComponent===r.ControlComponent.POSTFIX||h?.controlComponent===r.ControlComponent.POSTTEXTFIX||h?.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||h?.controlComponent===r.ControlComponent.POST_TEXT,S=h?.control?.type===r.ControlType.TEXT&&(h.controlComponent===r.ControlComponent.PREFIX||h.controlComponent===r.ControlComponent.PRE_TEXT),W=F&&R?.controlId===h?.controlId&&R?.originControlId===h?.originControlId&&R?.controlComponent===r.ControlComponent.VALUE,Y=!!h&&!h.controlId&&!h.control;if(N&&I&&M&&C)return;const{isInParent:b,parentControlId:D}=va(d,l,R);if(P&&M&&C&&b&&!(h?.controlId===D&&!h?.originControlId&&(h?.controlComponent===r.ControlComponent.VALUE||h?.controlComponent===r.ControlComponent.PLACEHOLDER))){if(R.originControlId&&D)for(let O=l;O<d.length;O++){const E=d[O];if(jo(E,D)){if(E.controlComponent===r.ControlComponent.VALUE){n.setRange(O,O),e.render({curIndex:O,isSubmitHistory:!1});return}if(E.controlComponent===r.ControlComponent.POSTFIX||E.controlComponent===r.ControlComponent.POSTTEXTFIX||E.controlComponent===r.ControlComponent.POST_TEXT)return}E.controlId!==D&&E.originControlId}return}if(P&&M&&C&&!b&&!(Y&&!N&&!F)){if(S)return;if(g)return;{const X=l-1;c=i.removeControl(X),e.getGlobalEvent().setCanvasEventAbility(),c===null?(n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1})):(n.setRange(c,c),e.render({curIndex:c}));return}}if(F&&h?.originControlId&&b&&D&&C){for(let X=l+1;X<d.length;X++){const O=d[X];if(jo(O,D)){if(O.controlComponent===r.ControlComponent.VALUE||O.controlComponent===r.ControlComponent.PLACEHOLDER){n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1});return}break}if(O.controlId&&O.controlId!==D&&O.originControlId!==D)break}for(let X=l-1;X>=0;X--){const O=d[X];if(jo(O,D)){if(O.controlComponent===r.ControlComponent.VALUE||O.controlComponent===r.ControlComponent.PLACEHOLDER){n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1});return}break}if(O.controlId&&O.controlId!==D&&O.originControlId!==D)break}return}if(e.getMode()===r.EditorMode.FORM&&F&&h?.originControlId&&C){const X=to(d,h.originControlId);if(!X)return;for(let O=l-1;O>=0;O--){const E=d[O];if(E.controlId===X&&!E.originControlId){if(E.controlComponent===r.ControlComponent.VALUE||E.controlComponent===r.ControlComponent.PLACEHOLDER){n.setRange(O,O),e.render({curIndex:O,isSubmitHistory:!1});return}if(E.controlComponent===r.ControlComponent.PREFIX||E.controlComponent===r.ControlComponent.PRE_TEXT||E.controlComponent===r.ControlComponent.PRETEXTFIX||E.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)return}if(E.controlId&&E.controlId!==X&&E.originControlId!==X)break}return}if(F&&h?.controlId&&C&&!W){const X=l;c=i.removeControl(X),e.getGlobalEvent().setCanvasEventAbility(),c===null?(n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1})):(n.setRange(c,c),e.render({curIndex:c}));return}}if(a){const R=e.getTableParticle().getRangeRowCol();if(!R)return;let h=!1;for(let g=0;g<R.length;g++){const T=R[g];for(let f=0;f<T.length;f++){const m=T[f];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()){const R=n.getRange(),h=e.getElementList()[R.startIndex];e.getMode()===r.EditorMode.FORM&&h?.control?.type==="text"&&console.log("[backspace:control-keydown]",{startIndex:R.startIndex,endIndex:R.endIndex,value:h?.value,component:h?.controlComponent,controlId:h?.controlId,originControlId:h?.originControlId||null}),c=i.keydown(o),c!==null&&i.emitControlContentChange()}else{const R=e.getPosition().getCursorPosition();if(!R)return;const{index:h}=R,g=n.getIsCollapsed(),T=e.getElementList();if(e.getMode()===r.EditorMode.FORM&&T[l]?.control?.type==="text"&&console.log("[backspace:fallback]",{startIndex:l,endIndex:s,cursorIndex:h,startValue:T[l]?.value,startComponent:T[l]?.controlComponent,activeControlId:i.getActiveControl()?.getElement()?.controlId||null,canCaptureEvent:i.getIsRangeCanCaptureEvent()}),g&&h===0){const C=T[h];if(C.value===k){C.listId&&e.getListParticle().unsetList(),o.preventDefault();return}}const f=T[l];if(g&&f.rowFlex&&f.value===k){const C=n.getRangeRowElementList();if(C){const I=T[l-1];C.forEach(P=>{P.rowFlex=I?.rowFlex})}}const m=f.value===k?T[l-1]:f,p=T[s+1];if(m?.titleId&&p?.titleId&&m.level===p.level&&m.titleId!==p.titleId){const C=m.titleId,I=p.titleId;let P=s+1;for(;P<T.length&&T[P]?.titleId===I;)T[P].titleId=C,P++}g?e.spliceElementList(T,h,1):e.spliceElementList(T,l+1,s-l),c=g?h-1:l}e.getGlobalEvent().setCanvasEventAbility(),c===null?(n.setRange(l,l),e.render({curIndex:l,isSubmitHistory:!1})):(n.setRange(c,c),e.render({curIndex:c}))}function Es(o,t,e){const n=o[t];n.subTemplateExpanded=!1,n.hide=!1;let i=t+1;for(;i<o.length&&o[i].subTemplateParentId===n.id;)i++;const l=i-t-1;return l>0&&e.spliceElementList(o,t+1,l),t}function Ha(o){const t=o.getDraw(),n=t.getRange().getRange(),i=t.getElementList(),l=i[n.startIndex+1];if(!_t(l))return;const s=n.startIndex+1;for(;s<i.length;){const a=i[s];if(a.type===r.ElementType.SUB_TEMPLATE&&a.subTemplateExpanded){Es(i,s,t);return}let c=null;a.controlId?c=t.getControl().removeControl(s):(t.spliceElementList(i,s,1),c=s);const d=i[c];if(!d||!_t(d))break}}function _a(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:l,isCrossRowCol:s,splitTdRange:a}=n.getRange(),c=e.getElementList(),d=e.getControl();n.getIsCollapsed()&&Ha(t);let u;if(s){const R=e.getTableParticle().getRangeRowCol();if(!R)return;let h=!1;for(let g=0;g<R.length;g++){const T=R[g];for(let f=0;f<T.length;f++){const m=T[f];m.value.length>1&&(e.spliceElementList(m.value,1,m.value.length-1),h=!0)}}u=h?0:null}else if(d.getActiveControl()&&d.getIsRangeWithinControl())u=d.keydown(o),u!==null&&d.emitControlContentChange();else if(c[l+1]?.controlId)u=d.removeControl(l+1);else if(n.getIsCollapsed()&&c[l+1]?.subTemplateParentId){const R=c[l+1].subTemplateParentId;let h=-1;for(let g=l;g>=0;g--){const T=c[g];if(T.type===r.ElementType.SUB_TEMPLATE&&T.id===R){h=g;break}}h!==-1?u=Es(c,h,e):u=null}else{e.removeSplitTdOtherRangeElements();const R=e.getPosition(),h=R.getCursorPosition();if(!h)return;const{index:g}=h,T=R.getPositionContext();if(T.isDirectHit&&T.isImage)e.spliceElementList(c,g,1),u=g-1;else{const f=n.getIsCollapsed();if(!f)e.spliceElementList(c,i+1,l-i);else if(c[g+1])e.spliceElementList(c,g+1,1);else{let m=!0;if(T.isTable){const p=e.getTd();if(p?.linkTdNextId){const C=e.getTdById(p.linkTdNextId);C&&(m=!1,e.spliceElementList(C.value,1,1))}}if(m)return}u=f?g:i,u===0&&a&&(u=e.fixPosition(!0)??u)}}e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}))}function Aa(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:l}=n.getRange(),s=n.getIsCollapsed(),a=e.getElementList(),c=a[i],d=a[l];if(s&&d.listId&&d.value===k&&a[l+1]?.listId!==d.listId){e.getListParticle().unsetList();return}let u={value:k};if(o.shiftKey&&c.listId&&(u.listWrap=!0),wt(a,[u],i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()}),o.shiftKey&&d.areaId&&d.areaId!==a[l+1]?.areaId&&(u=qt(u,Ge)),!(a[i+1]?.titleId&&(!c.titleId||c.titleId!==a[i+1]?.titleId))&&!(d.titleId&&d.titleId!==a[l+1]?.titleId)){const m=n.getRangeAnchorStyle(a,l);if(m){const p=[...Bt],C=m.controlComponent===r.ControlComponent.POSTFIX||m.controlComponent===r.ControlComponent.POSTTEXTFIX||m.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||m.controlComponent===r.ControlComponent.POST_TEXT,I=m.control?.type===r.ControlType.BUTTON&&!m.control?.buttonText;!C&&!I&&p.push(...ge),p.forEach(P=>{const M=m[P];M!==void 0&&(u[P]=M)})}}const R=e.getControl(),h=R.getActiveControl();let g;const T=h?.getElement();if(T?.control?.type===r.ControlType.BUTTON&&!T.control?.buttonText&&T?.controlId){const m=T.controlId;let p=l;for(;p+1<a.length&&a[p+1]?.controlId===m;)p++;e.spliceElementList(a,p+1,0,[u]),g=p+1}else if(h&&R.getIsRangeWithinControl())g=R.setValue([u]),R.emitControlContentChange();else{const p=e.getPosition().getCursorPosition();if(!p)return;const{index:C}=p;if(s){if(e.spliceElementList(a,C+1,0,[u]),d.titleId&&a[C+2]?.titleId===d.titleId){const I=gt();let P=C+2;for(;P<a.length&&a[P]?.titleId===d.titleId;)a[P].titleId=I,P++}}else e.spliceElementList(a,i+1,l-i,[u]);g=C+1}~g&&(n.setRange(g,g),e.render({curIndex:g})),o.preventDefault()}function Ss(o){return o&&(o.type===r.ElementType.MACRO||o.type===r.ElementType.CUSTOM_MACRO||o.type===r.ElementType.REUSABLE_ITEM||o.type===r.ElementType.SUB_TEMPLATE||o.type===r.ElementType.MENSTRUAL_HISTORY||o.type===r.ElementType.FETAL_HEART_POSITION||o.type===r.ElementType.TOOTH_POSITION||o.type===r.ElementType.LIST||o.type===r.ElementType.SPECIAL_SYMBOLS)}function Ga(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),l=i.getCursorPosition();if(!l)return;const s=i.getPositionContext(),{index:a}=l;if(a<=0&&!s.isTable)return;const c=e.getRange(),{startIndex:d,endIndex:u}=c.getRange(),R=c.getIsCollapsed(),h=e.getElementList(),g=e.getControl(),T=e.getMode()===r.EditorMode.FORM,f=g.getActiveControl()?.getElement()?.control?.type,m=T&&f===r.ControlType.TEXT,p=T&&!m?g.getActiveTextControlLimit():null,C=h[a],I=C?.controlComponent===r.ControlComponent.PREFIX||C?.controlComponent===r.ControlComponent.PRETEXTFIX||C?.controlComponent===r.ControlComponent.PRE_TEXT;let P=!1;if(I&&C?.originControlId){const b=C.originControlId;for(let D=a-1;D>=0;D--){const X=h[D];if(X.controlId===b&&!X.originControlId){P=!0;break}if(X.controlId&&X.controlId!==b&&X.originControlId!==b)break}}if(T&&!m&&g.getActiveControl()&&I&&!p&&!P){g.initNextControl({direction:Ut.UP});return}let M=1;if(Ie(o)){const b=e.getLetterReg(),D=o.shiftKey&&!R&&d===l?.index?u:d;if(b.test(h[D]?.value)){let X=D-1;for(;X>0;){const O=h[X];if(!b.test(O.value))break;M++,X--}}}if(T&&!m){const b=h[d],D=b?.controlId;if(D&&b?.controlComponent===r.ControlComponent.VALUE){let X=!1;for(let O=d;O>=0;O--){const E=h[O];if(E.controlId!==D)break;if(E.control?.type===r.ControlType.TEXTFIELD){X=!0;break}}if(X){if(b.controlComponent===r.ControlComponent.VALUE&&Ss(b))return;const O=d-M;if(O>=0){const E=h[O];if(E&&E.controlId===D&&E.controlComponent===r.ControlComponent.VALUE&&Ss(E))return}}}}const N=p?Math.max(d-M,p.startIndex):d-M;let F=N,S=N;if(o.shiftKey&&l&&(d!==u?d===l.index?(F=d,S=u-M):(F=N,S=u):S=u),!o.shiftKey){const b=h[d];if(b.type===r.ElementType.TABLE){const D=b.trList,X=D.length-1,O=D[X],E=O.tdList.length-1,L=O.tdList[E];i.setPositionContext({isTable:!0,index:d,trIndex:X,tdIndex:E,tdId:L.id,trId:O.id,tableId:b.id}),F=L.value.length-1,S=F}else if(b.tableId&&d===0){const X=e.getOriginalElementList()[s.index],O=e.getTd();if(O?.linkTdPrevId){const E=e.getTdById(O.linkTdPrevId);E&&(i.setPositionContext({...s,isTable:!0,index:E.tableIndex,trIndex:E.trIndex,tdId:E.id,trId:E.trId,tableId:E.tableId}),F=E.value.length-1,S=F)}else{const E=X.trList;t:for(let L=0;L<E.length;L++){const V=E[L];if(V.id!==b.trId)continue;const y=V.tdList;for(let U=0;U<y.length;U++)if(y[U].id===b.tdId){if(L===0&&U===0)i.setPositionContext({isTable:!1}),F=s.index-1,S=F,e.getTableTool().dispose();else{let K=L,z=U-1;z<0&&(K=L-1,z=E[K].tdList.length-1);const rt=E[K],at=rt.tdList[z];i.setPositionContext({isTable:!0,index:s.index,trIndex:K,tdIndex:z,tdId:at.id,trId:rt.id,tableId:b.tableId}),F=at.value.length-1,S=F}break t}}}}}if(!~F||!~S)return;const W=e.getElementList();F=dn(W,F),S=dn(W,S),c.setRange(F,S);const Y=F===S;e.updateTableTool(),e.render({curIndex:Y?F:void 0,isSetCursor:Y,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function Xs(o){return o&&(o.type===r.ElementType.MACRO||o.type===r.ElementType.CUSTOM_MACRO||o.type===r.ElementType.REUSABLE_ITEM||o.type===r.ElementType.SUB_TEMPLATE||o.type===r.ElementType.MENSTRUAL_HISTORY||o.type===r.ElementType.FETAL_HEART_POSITION||o.type===r.ElementType.TOOTH_POSITION||o.type===r.ElementType.LIST||o.type===r.ElementType.SPECIAL_SYMBOLS)}function xa(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),l=i.getCursorPosition();if(!l)return;const{index:s}=l,a=i.getPositionList(),c=i.getPositionContext();if(s>a.length-1&&!c.isTable)return;const d=e.getRange(),{startIndex:u,endIndex:R}=d.getRange(),h=d.getIsCollapsed();let g=e.getElementList();const T=e.getControl(),f=e.getMode()===r.EditorMode.FORM,m=T.getActiveControl()?.getElement()?.control?.type,p=f&&m===r.ControlType.TEXT,C=f&&!p?T.getActiveTextControlLimit():null,I=g[s],P=I?.controlComponent===r.ControlComponent.POSTFIX||I?.controlComponent===r.ControlComponent.POSTTEXTFIX||I?.controlComponent===r.ControlComponent.POST_TEXT;let M=!1;if(P&&I?.originControlId){const X=I.originControlId;for(let O=s+1;O<g.length;O++){const E=g[O];if(E.controlId===X&&!E.originControlId){M=!0;break}if(E.controlId&&E.controlId!==X&&E.originControlId!==X)break}}if(f&&!p&&T.getActiveControl()&&P&&!C&&!M){T.initNextControl({direction:Ut.DOWN});return}let N=1;if(Ie(o)){const X=e.getLetterReg(),O=o.shiftKey&&!h&&u===l?.index?R:u;if(X.test(g[O+1]?.value)){let E=O+2;for(;E<g.length;){const L=g[E];if(!X.test(L.value))break;N++,E++}}}if(f&&!p){const X=g[R],O=X?.controlId;if(O&&X?.controlComponent===r.ControlComponent.VALUE){let E=!1;for(let L=R;L>=0;L--){const V=g[L];if(V.controlId!==O)break;if(V.control?.type===r.ControlType.TEXTFIELD){E=!0;break}}if(E){if(X.controlComponent===r.ControlComponent.VALUE&&Xs(X))return;const L=R+N;if(L<g.length){const V=g[L];if(V&&V.controlId===O&&V.controlComponent===r.ControlComponent.VALUE&&Xs(V))return}}}}const F=C?Math.min(R+N,C.endIndex):R+N;let S=F,W=F;if(o.shiftKey&&l&&(u!==R?u===l.index?(S=u,W=F):(S=u+N,W=R):S=u),!o.shiftKey){const X=g[R],O=g[R+1];if(O?.type===r.ElementType.TABLE){const L=O.trList[0],V=L.tdList[0];i.setPositionContext({isTable:!0,index:R+1,trIndex:0,tdIndex:0,tdId:V.id,trId:L.id,tableId:O.id}),S=0,W=0}else if(X.tableId&&!O){const E=e.getTd(),L=E?.linkTdNextId?e.getTdById(E.linkTdNextId):void 0;if(L?.value.length)i.setPositionContext({...c,isTable:!0,index:L.tableIndex,trIndex:L.trIndex,tdId:L.id,trId:L.trId,tableId:L.tableId}),S=0,W=S;else{const y=e.getOriginalElementList()[c.index].trList;t:for(let U=0;U<y.length;U++){const Q=y[U];if(Q.id!==X.trId)continue;const K=Q.tdList;for(let z=0;z<K.length;z++)if(K[z].id===X.tdId){if(U===y.length-1&&z===K.length-1)i.setPositionContext({isTable:!1}),S=c.index,W=S,g=e.getElementList(),e.getTableTool().dispose();else{let at=U,A=z+1;A>K.length-1&&(at=U+1,A=0);const it=y[at],ct=it.tdList[A];i.setPositionContext({isTable:!0,index:c.index,trIndex:at,tdIndex:A,tdId:ct.id,trId:it.id,tableId:X.tableId}),S=0,W=S}break t}}}}}const Y=g.length-1;if(S>Y||W>Y)return;const b=e.getElementList();S=dn(b,S,r.LocationPosition.AFTER),W=dn(b,W,r.LocationPosition.AFTER),d.setRange(S,W);const D=S===W;e.updateTableTool(),e.render({curIndex:D?S:void 0,isSetCursor:D,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function ka(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getMode()===r.EditorMode.FORM,l=e.getControl(),s=l.getActiveControl();if(i&&s&&l.getIsRangeWithinControl())o.preventDefault(),l.initNextControl({direction:o.shiftKey?Ut.UP:Ut.DOWN});else{o.preventDefault();const a=e.getRange(),c=e.getElementList(),{startIndex:d,endIndex:u}=a.getRange(),R=a.getRangeAnchorStyle(c,u),g={...R?Dt(R,ge):null,type:r.ElementType.TAB,value:""};wt(c,[g],d,{editorOptions:e.getOptions()}),e.insertElementList([g])}}function qo(o){const{positionList:t,index:e,isUp:n,rowNo:i,cursorX:l}=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:[u],rightTop:[R]}}=d;if(c===a.length-1&&(s=d.index),!(l<u||l>R)){s=d.index;break}}return s}function Ja(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),l=i.getCursorPosition();if(!l)return;const s=e.getRange(),{startIndex:a,endIndex:c}=s.getRange();let d=i.getPositionList();const u=o.key===r.KeyMap.Up;let R=-1,h=-1;const g=i.getPositionContext();if(!o.shiftKey&&g.isTable&&(u&&l.rowIndex===0||!u&&l.rowIndex===e.getRowCount()-1)){const{index:f,trIndex:m,tdIndex:p,tableId:C}=g;if(u){const I=e.getOriginalElementList();if(m===0)if(I[f].originalId){const M=f-1,N=I[M];for(let F=N.trList.length-1;F>=0;F--){const S=N.trList[F].tdList.find(W=>W.tdIndex===p);if(S?.value.length){i.setPositionContext({isTable:!0,tableId:N.id,index:M,trIndex:F,tdIndex:p}),R=S.value.length-1,h=S.value.length-1;break}}}else i.setPositionContext({isTable:!1}),R=f-1,h=R,e.getTableTool().dispose();else{let P=-1,M=-1;const N=I[f].trList,F=N[m].tdList[p].colIndex;t:for(let Y=m-1;Y>=0;Y--){const D=N[Y].tdList;for(let X=0;X<D.length;X++){const O=D[X];if(O.colIndex===F||O.colIndex+O.colspan-1>=F&&O.colIndex<=F){P=Y,M=X;break t}}}if(!~P||!~M)return;const S=N[P],W=S.tdList[M];i.setPositionContext({isTable:!0,index:f,trIndex:P,tdIndex:M,tdId:W.id,trId:S.id,tableId:C}),R=W.value.length-1,h=R}}else{const I=e.getOriginalElementList(),P=I[f],M=P.trList;if(m===M.length-1){const N=f+1,F=I[N];if(F&&[P.id,P.originalId].includes(F.originalId)){for(let W=p;W>=0;W--)if(F.trList[0].tdList[W].value.length){i.setPositionContext({isTable:!0,index:N,tableId:F.id,trIndex:0,tdIndex:W}),R=0,h=0;break}}else i.setPositionContext({isTable:!1}),R=f,h=R,e.getTableTool().dispose()}else{let N=-1,F=-1;const S=M[m].tdList[p].colIndex;t:for(let b=m+1;b<M.length;b++){const X=M[b].tdList;for(let O=0;O<X.length;O++){const E=X[O];if(E.colIndex===S||E.colIndex+E.colspan-1>=S&&E.colIndex<=S){N=b,F=O;break t}}}if(!~N||!~F)return;const W=M[N],Y=W.tdList[F];i.setPositionContext({isTable:!0,index:f,trIndex:N,tdIndex:F,tdId:Y.id,trId:W.id,tableId:C}),R=Y.value.length-1,h=R}}}else{let f=l;o.shiftKey&&(a===l.index?f=d[c]:f=d[a]);const{index:m,rowNo:p,rowIndex:C,coordinate:{rightTop:[I]}}=f;if(u&&C===0||!u&&C===e.getRowCount()-1)return;const P=qo({positionList:d,index:m,rowNo:p,isUp:u,cursorX:I});if(P<0)return;R=P,h=P,o.shiftKey&&(a!==c?a===l.index?R=a:h=c:u?h=c:R=a);const N=e.getElementList()[P];if(N.type===r.ElementType.TABLE){const{scale:F}=e.getOptions(),S=e.getMargins(),W=N.trList;let Y=-1,b=-1,D=-1;if(u)t:for(let X=W.length-1;X>=0;X--){const E=W[X].tdList;for(let L=0;L<E.length;L++){const V=E[L],y=V.x*F+S[3],U=V.width*F;if(I>=y&&I<=y+U){const Q=V.positionList,K=Q[Q.length-1],z=qo({positionList:Q,index:K.index+1,rowNo:K.rowNo-1,isUp:u,cursorX:I})||K.index;Y=X,b=L,D=z;break t}}}else t:for(let X=0;X<W.length;X++){const E=W[X].tdList;for(let L=0;L<E.length;L++){const V=E[L],y=V.x*F+S[3],U=V.width*F;if(I>=y&&I<=y+U){const Q=V.positionList,K=qo({positionList:Q,index:-1,rowNo:-1,isUp:u,cursorX:I})||0;Y=X,b=L,D=K;break t}}}if(~Y&&~b&&~D){const X=W[Y],O=X.tdList[b];i.setPositionContext({isTable:!0,index:P,trIndex:Y,tdIndex:b,tdId:O.id,trId:X.id,tableId:N.id}),R=D,h=R,d=i.getPositionList()}}}if(!~R||!~h)return;R>h&&([R,h]=[h,R]),s.setRange(R,h);const T=R===h;e.render({curIndex:T?R:void 0,isSetCursor:T,isSubmitHistory:!1,isCompute:!1}),T||(e.getCursor().moveCursorToVisible({cursorPosition:d[u?R:h],direction:u?Ut.UP:Ut.DOWN}),e.updateTableTool())}function Ba(o,t){if(t.isComposing)return;const e=t.getDraw();if(o.key===r.KeyMap.Backspace)Ka(o,t);else if(o.key===r.KeyMap.Delete)_a(o,t);else if(o.key===r.KeyMap.Enter)Aa(o,t);else if(o.key===r.KeyMap.Left)Ga(o,t);else if(o.key===r.KeyMap.Right)xa(o,t);else if(o.key===r.KeyMap.Up||o.key===r.KeyMap.Down)Ja(o,t);else if(Ie(o)&&o.key.toLocaleLowerCase()===r.KeyMap.Z){if(e.isReadonly()&&e.getMode()!==r.EditorMode.FORM)return;e.getHistoryManager().undo(),o.preventDefault()}else if(Ie(o)&&o.key.toLocaleLowerCase()===r.KeyMap.Y){if(e.isReadonly()&&e.getMode()!==r.EditorMode.FORM)return;e.getHistoryManager().redo(),o.preventDefault()}else if(Ie(o)&&o.key.toLocaleLowerCase()===r.KeyMap.C)t.copy(),o.preventDefault();else if(Ie(o)&&o.key.toLocaleLowerCase()===r.KeyMap.X)t.cut(),o.preventDefault();else if(Ie(o)&&o.key.toLocaleLowerCase()===r.KeyMap.A)t.selectAll(),o.preventDefault();else if(Ie(o)&&o.key.toLocaleLowerCase()===r.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===r.KeyMap.ESC){t.clearPainterStyle();const n=e.getZone();n.isMainActive()||n.setZone(r.EditorZone.MAIN),o.preventDefault()}else o.key===r.KeyMap.TAB&&ka(o,t)}function $a(o){return/[\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef]/.test(o)}function za(o){return/[a-zA-Z]/.test(o)}function ja(o,t){return $a(o)?t:za(o)?"Times New Roman":t}function ti(o){return o?.type===r.ElementType.CONTROL&&(o.controlComponent===r.ControlComponent.PREFIX||o.controlComponent===r.ControlComponent.PRE_TEXT||o.controlComponent===r.ControlComponent.PRETEXTFIX||o.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)}function ei(o){return o?.type===r.ElementType.CONTROL&&(o.controlComponent===r.ControlComponent.POSTFIX||o.controlComponent===r.ControlComponent.POST_TEXT||o.controlComponent===r.ControlComponent.POSTTEXTFIX||o.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)}function Ns(o){return!!o?.originControlId&&ti(o)}function Fs(o){return!!o?.originControlId&&ei(o)}function qa(o,t){return!o||!t?!1:!!o.originControlId&&!!t.originControlId&&o.originControlId===t.originControlId&&o.controlId!==t.controlId}function Je(o,t){if(!t)return null;const e=new Set;let n=t,i=null;for(;n&&!e.has(n);){e.add(n);let l;for(let s=0;s<o.length;s++){const a=o[s];if(a.controlId===n&&a.control?.type&&(l=a,a.controlComponent===r.ControlComponent.PREFIX||a.controlComponent===r.ControlComponent.PRE_TEXT||a.controlComponent===r.ControlComponent.PRETEXTFIX||a.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT))break}if(!l)break;l.control?.type===r.ControlType.TEXT&&(i=n),n=l.originControlId||null}return i}function Se(o,t){return!!o&&!!t&&o.controlId===t}function ni(o,t,e="input"){const n=Yt(),i=t.getDraw(),l=i.getControl(),s=i.getOptions(),a=i.getElementList(),u=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 T=i.getRange();if(!T.getIsCanInput())return;let f=l.getActiveControl();const m=i.getElementList()[T.getRange().endIndex],p=m?.control?.type===r.ControlType.TEXT&&!!m?.originControlId&&(m.controlComponent===r.ControlComponent.PREFIX||m.controlComponent===r.ControlComponent.PRE_TEXT||m.controlComponent===r.ControlComponent.PRETEXTFIX||m.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||m.controlComponent===r.ControlComponent.POSTFIX||m.controlComponent===r.ControlComponent.POST_TEXT||m.controlComponent===r.ControlComponent.POSTTEXTFIX||m.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||m.controlComponent===r.ControlComponent.PLACEHOLDER);if(!f&&(l.getIsRangeWithinControl()||p)&&(l.initControl(),f=l.getActiveControl()),f){const st=f.getElement(),J=i.getElementList()[T.getRange().endIndex],Rt=st?.controlId===J?.controlId&&(st?.originControlId||null)===(J?.originControlId||null),ht=!!J&&J.controlComponent===r.ControlComponent.VALUE&&!!J.controlId&&!J.originControlId&&T.getRange().endIndex>0&&i.getElementList()[T.getRange().endIndex-1]?.originControlId===J.controlId;(!Rt||ht)&&(l.initControl(),f=l.getActiveControl())}const{endIndex:C}=T.getRange(),I=i.getElementList(),P=I[C],M=I[C+1];if(P?.type===r.ElementType.SUB_TEMPLATE&&M?.type===r.ElementType.SUB_TEMPLATE)return;const N=i.getMode()===r.EditorMode.FORM;if(N){const st=T.getRange();if(!(i.getElementList()[st.endIndex]?.control?.type===r.ControlType.TEXT)){const ht=l.getActiveTextControlLimit();if(!f||!l.getIsRangeWithinControl()&&!l.getIsRangeInPostfix())return;if(ht){const j=T.getRange();if(j.startIndex<ht.startIndex||j.endIndex>ht.endIndex){const H=Math.min(Math.max(j.endIndex,ht.startIndex),ht.endIndex);T.setRange(H,H),i.render({curIndex:H,isSubmitHistory:!1});return}}const{endIndex:et}=T.getRange(),tt=i.getElementList(),nt=tt[et];if(!nt?.originControlId){if(nt?.controlId&&nt?.controlComponent===r.ControlComponent.VALUE){let j=!1,H=!1;for(let Ot=et;Ot>=0;Ot--){const Et=tt[Ot];if(Et.controlId!==nt.controlId){if(Et.originControlId===nt.controlId){H=!0;continue}break}if(Et.originControlId)break;if(Et.control?.type===r.ControlType.TEXTFIELD){j=!0;break}}if(!H)for(let Ot=et+1;Ot<tt.length;Ot++){const Et=tt[Ot];if(Et.controlId!==nt.controlId){if(Et.originControlId===nt.controlId){H=!0;continue}break}}if(j&&!H)return}}}}const F=T.getDefaultStyle()||t.compositionInfo?.defaultStyle||null,S=t.compositionInfo?.perfStartTime,W=ec(t,i.getElementList());g||i.getCursor().clearAgentDomValue();const{TEXT:Y,HYPERLINK:b,SUBSCRIPT:D,SUPERSCRIPT:X,DATE:O,TAB:E}=r.ElementType,L=o.replaceAll(`
|
|
106
|
+
`,k),{startIndex:V,endIndex:y}=T.getRange(),U=T.getRangeAnchorStyle(W,V);if(!U)return;const Q=V>0?W[V-1]:null,K=!!(U.controlId||U.control),rt={...!K&&Q?Q:U,...F},at=i.isDesignMode(),A=W[y+1],it=Je(W,U.originControlId),ct=Je(W,A?.originControlId),Nt=!U.originControlId&&!A?.originControlId&&ei(U)&&ti(A)&&!!U.controlId&&!!A.controlId&&U.controlId!==A.controlId,Ft=Fs(U)&&Ns(A)&&!it&&!ct,St=it&&it===ct?it:null;if(N&&(Nt||Ft))return;const le=ti(A)&&!A?.originControlId,ne=ei(U)&&!U.originControlId||U.type===r.ElementType.CONTROL&&U.controlComponent===r.ControlComponent.VALUE&&A?.type!==r.ElementType.CONTROL&&!U.originControlId,w=le||ne,v=w?{...U,type:void 0,control:void 0,controlId:void 0,controlComponent:void 0,originControlId:void 0,color:s.defaultColor,highlight:void 0}:U,Z=w||K?v:rt,_=Tt(L).map(st=>{const J={value:st};if(at||!Z.title?.disabled&&!Z.control?.disabled){const Rt=W[y+1];(!Z.type||Z.type===Y||Z.type===b&&Rt?.type===b||Z.type===O&&Rt?.type===O||Z.type===D&&Rt?.type===D||Z.type===X&&Rt?.type===X)&&El.forEach(ht=>{if(ht==="groupIds"&&!Rt?.groupIds)return;const et=Z[ht];et!==void 0&&(J[ht]=et)}),(F||Z.type===E)&&ge.forEach(ht=>{const et=F?.[ht]||Z[ht];et!==void 0&&(J[ht]=et)}),g&&(J.underline=!0)}if(!w){const Rt=U.originControlId&&(U.controlComponent===r.ControlComponent.POSTFIX||U.controlComponent===r.ControlComponent.POSTTEXTFIX||U.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||U.controlComponent===r.ControlComponent.POST_TEXT),ht=!U.originControlId&&U.controlId&&(U.controlComponent===r.ControlComponent.POSTFIX||U.controlComponent===r.ControlComponent.POSTTEXTFIX||U.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||U.controlComponent===r.ControlComponent.POST_TEXT)&&A?.controlId&&A.controlId!==U.controlId&&qa(U,A),et=U.controlId&&U.originControlId&&(U.controlComponent===r.ControlComponent.VALUE||U.controlComponent===r.ControlComponent.PLACEHOLDER);if(Rt&&!J.controlId){const tt=Je(W,U.originControlId);if(!tt)return J;let nt=null;for(let j=V;j>=0;j--){const H=W[j];if(Se(H,tt)&&H.control){nt=H.control;break}}J.controlId=tt,J.controlComponent=r.ControlComponent.VALUE,nt&&(J.control=nt)}else if(ht&&!J.controlId){if(A?.controlId&&A.controlId!==U.controlId)if(A.controlComponent===r.ControlComponent.PREFIX||A.controlComponent===r.ControlComponent.PRETEXTFIX)for(let tt=V;tt>=0;tt--){const nt=W[tt];if(nt.controlId===U.controlId&&(nt.controlComponent===r.ControlComponent.PREFIX||nt.controlComponent===r.ControlComponent.PRETEXTFIX)){for(let j=tt-1;j>=0;j--){const H=W[j];if(H.controlId&&H.controlId!==U.controlId&&(H.controlComponent===r.ControlComponent.PRETEXTFIX||H.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||H.controlComponent===r.ControlComponent.PREFIX||H.controlComponent===r.ControlComponent.PRE_TEXT)){J.controlId=H.controlId,J.controlComponent=r.ControlComponent.VALUE,H.control&&(J.control=H.control);break}if(H.controlId&&H.controlId!==U.controlId&&(H.controlComponent===r.ControlComponent.POSTFIX||H.controlComponent===r.ControlComponent.POSTTEXTFIX))break}break}}else(A.controlComponent===r.ControlComponent.POSTFIX||A.controlComponent===r.ControlComponent.POSTTEXTFIX)&&(J.controlId=A.controlId,J.controlComponent=r.ControlComponent.VALUE,A.control&&(J.control=A.control));if(!J.controlId)for(let tt=V;tt>=0;tt--){const nt=W[tt];if(nt.controlId===U.controlId&&(nt.controlComponent===r.ControlComponent.PREFIX||nt.controlComponent===r.ControlComponent.PRETEXTFIX)){for(let j=tt-1;j>=0;j--){const H=W[j];if(H.controlId&&H.controlId!==U.controlId&&(H.controlComponent===r.ControlComponent.PRETEXTFIX||H.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||H.controlComponent===r.ControlComponent.PREFIX||H.controlComponent===r.ControlComponent.PRE_TEXT)){J.controlId=H.controlId,J.controlComponent=r.ControlComponent.VALUE,H.control&&(J.control=H.control);break}if(H.controlId&&H.controlId!==U.controlId&&(H.controlComponent===r.ControlComponent.POSTFIX||H.controlComponent===r.ControlComponent.POSTTEXTFIX))break}break}}}else if(et&&!J.controlId){const tt=U.controlId;let nt=U.control;if(!nt)for(let j=V;j>=0;j--){const H=W[j];if(H.controlId===tt&&H.control&&(nt=H.control,H.controlComponent===r.ControlComponent.PREFIX||H.controlComponent===r.ControlComponent.PRETEXTFIX))break}J.controlId=tt,J.originControlId=U.originControlId,J.controlComponent=r.ControlComponent.VALUE,nt&&(J.control=nt)}else if(U.controlId){let tt=U.control;if(!tt)for(let nt=V;nt>=0;nt--){const j=W[nt];if(Se(j,U.controlId)&&j.control){tt=j.control;break}}J.controlId||(J.controlId=U.controlId),tt&&!J.control&&(J.control=tt),J.controlComponent||(J.controlComponent=r.ControlComponent.VALUE)}else if(!J.controlId&&!J.control&&A?.originControlId&&(A.controlComponent===r.ControlComponent.PREFIX||A.controlComponent===r.ControlComponent.PRETEXTFIX)){const tt=Je(W,A.originControlId);if(!tt)return J;let nt=null;for(let j=y;j>=0;j--){const H=W[j];if(Se(H,tt)&&H.control){nt=H.control;break}}J.controlId=tt,J.controlComponent=r.ControlComponent.VALUE,nt&&(J.control=nt)}}if(st&&st!==k){const Rt=ja(st,s.defaultFont);J.font=Rt}return J});let x;const G=a[u],B=a[u+1];if(g)x=V;else{const st=et=>{if(_?.length)for(let tt=0;tt<_.length;tt++)W.splice(et+tt,0,_[tt]);return V+_.length},J=V+1,Rt=()=>{let et=null;if(Fs(G)?et=Je(a,G.originControlId):Ns(B)?et=Je(a,B.originControlId):St&&(et=St),!et)return null;let tt;for(let j=u;j>=0;j--){const H=a[j];if(Se(H,et)&&H.control?.type){tt=H.control.type;break}if(H.controlId&&H.controlId!==et&&H.originControlId!==et)break}return tt!==r.ControlType.TEXT?null:{parentControlId:et,activationIndex:(()=>{for(let j=u+1;j<a.length;j++){const H=a[j];if(Se(H,et))return j;if(H.controlId&&H.controlId!==et&&H.originControlId!==et)break}for(let j=u;j>=0;j--){const H=a[j];if(Se(H,et))return j;if(H.controlId&&H.controlId!==et&&H.originControlId!==et)break}return u})()}};V!==y&&(i.removeSplitTdOtherRangeElements(),i.spliceElementList(W,J,y-V));const ht=Rt();if(ht){const{parentControlId:et,activationIndex:tt}=ht;T.setRange(tt,tt),l.initControl();const nt=l.getActiveControl(),j=B?.controlId===et&&!B?.originControlId&&B?.controlComponent===r.ControlComponent.VALUE?u+1:-1,H=j!==-1?{startIndex:u,endIndex:j}:{startIndex:V,endIndex:y};T.setRange(H.startIndex,H.endIndex),nt&&nt.getElement()?.controlId===et&&(nt.getElement()?.control?.type===r.ControlType.TEXT||nt.getElement()?.control?.type===r.ControlType.TEXTFIELD)?(x=nt.setValue(_,{range:H,elementList:W}),l.emitControlContentChange(),T.setRange(x,x),l.initControl()):w?x=st(J):(x=l.setValue(_),l.emitControlContentChange())}else if(w)x=st(J);else if(G?.originControlId&&(G.controlComponent===r.ControlComponent.POSTFIX||G.controlComponent===r.ControlComponent.POST_TEXT||G.controlComponent===r.ControlComponent.POSTTEXTFIX||G.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)){if(f?.getElement()?.control?.type===r.ControlType.TEXT&&f.getElement()?.controlId===G.controlId&&(f.getElement()?.originControlId||null)===(G.originControlId||null)){x=l.setValue(_),l.emitControlContentChange();return}const tt=Je(a,G.originControlId);if(!tt){x=st(J);return}let nt;for(let H=u;H>=0;H--){const Ot=a[H];if(Se(Ot,tt)&&Ot.control?.type){nt=Ot.control.type;break}if(Ot.controlId&&Ot.controlId!==tt&&Ot.originControlId!==tt)break}if(nt===r.ControlType.TEXT){const H=()=>{for(let Ht=u+1;Ht<a.length;Ht++){const vt=a[Ht];if(Se(vt,tt))return Ht;if(vt.controlId&&vt.controlId!==tt&&vt.originControlId!==tt)break}for(let Ht=u;Ht>=0;Ht--){const vt=a[Ht];if(Se(vt,tt))return Ht;if(vt.controlId&&vt.controlId!==tt&&vt.originControlId!==tt)break}return u},Ot=B?.controlId===tt&&B?.controlComponent===r.ControlComponent.VALUE?u+1:-1,Et=Ot!==-1?{startIndex:u,endIndex:Ot}:{startIndex:u,endIndex:u},Qt=H();T.setRange(Qt,Qt),l.initControl();const kt=l.getActiveControl();T.setRange(Et.startIndex,Et.endIndex),kt&&kt.getElement()?.controlId===tt&&(kt.getElement()?.control?.type===r.ControlType.TEXT||kt.getElement()?.control?.type===r.ControlType.TEXTFIELD)?(x=kt.setValue(_,{range:Et,elementList:W}),l.emitControlContentChange(),T.setRange(x,x),l.initControl()):x=st(J)}else x=st(J)}else if((G?.control?.type===r.ControlType.NUMBER||B?.control?.type===r.ControlType.NUMBER)&&f?.getElement()?.control?.type===r.ControlType.NUMBER&&l.getIsRangeWithinControl()){const et=l.getActiveControl();et&&typeof et.awake=="function"&&et.awake(),x=V}else if((G?.control?.type===r.ControlType.SELECT||B?.control?.type===r.ControlType.SELECT)&&f?.getElement()?.control?.type===r.ControlType.SELECT&&l.getIsRangeWithinControl()){const et=l.getActiveControl();et&&typeof et.awake=="function"&&et.awake(),x=V}else G?.control?.type==="button"||B?.control?.type==="button"?(G?.control||B?.control)?.buttonText?x=V:f&&l.getIsRangeWithinControl()?(x=l.setValue(_),l.emitControlContentChange()):x=V:f&&l.getIsRangeWithinControl()?(x=l.setValue(_),l.emitControlContentChange()):(G?.type==="control"||B?.type==="control")&&!w?x=st(J):(wt(W,_,V,{editorOptions:s}),i.spliceElementList(W,J,0,_),x=V+_.length)}if(~x&&!g){const st=Yt()-n,J=Yt();T.setRange(x,x),i.render({curIndex:x,isSubmitHistory:!g,traceLabel:`input:${e}`}),Do(s,`input:${e}`,Yt()-n,[{label:"mutate",duration:st},{label:"renderCall",duration:Yt()-J}],{isComposing:g,textLength:_.length,compositionChainDuration:e==="compositionend"&&S!==void 0?Number((Yt()-S).toFixed(2)):void 0})}g&&(t.compositionInfo={value:L,startIndex:x,endIndex:y,defaultStyle:F,perfStartTime:n})}function tc(o){o.compositionInfo&&(o.compositionInfo=null)}function ec(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 nc(o){const t=o.getDraw(),e=t.getRange(),{startIndex:n,endIndex:i}=e.getRange();if(!~n&&!~n||t.isReadonly()||!e.getIsCanInput())return;const l=t.getElementList();let s=n,a=i;if(n===i){const h=t.getPosition().getPositionList(),g=h[n],T=g.rowNo,f=g.pageNo,m=[];for(let C=0;C<h.length;C++){const I=h[C];if(I.pageNo>f)break;I.pageNo===f&&I.rowNo===T&&m.push(C)}const p=m[0]-1;s=p<0?0:p,a=m[m.length-1]}const c=t.getOptions();await ps(l.slice(s+1,a+1),c);const d=t.getControl();let u;d.getActiveControl()&&d.getIsRangeWithinControl()?(u=d.cut(),d.emitControlContentChange()):(t.spliceElementList(l,s+1,a-s),u=s),e.setRange(u,u),t.render({curIndex:u})}async function oc(o,t){const e=o.getDraw(),{copy:n}=e.getOverride();if(n&&n()?.preventDefault!==!1)return;const i=e.getRange();let l=null;if(i.getRange().isCrossRowCol){const a=i.getRangeTableElement();if(!a)return;const c=e.getTableParticle().getRangeRowCol();if(!c)return;const d={type:r.ElementType.TABLE,value:"",colgroup:[],trList:[]},u=c[0],R=u[0].colIndex,h=u[u.length-1],g=h.colIndex+h.colspan-1;for(let T=R;T<=g;T++)d.colgroup.push(a.colgroup[T]);for(let T=0;T<c.length;T++){const f=c[T],m=a.trList[f[0].rowIndex],p={tdList:[],height:m.height,minHeight:m.minHeight};for(let C=0;C<f.length;C++)p.tdList.push(f[C]);d.trList.push(p)}l=Ct([d])}else l=i.getIsCollapsed()?i.getRangeRowElementList():i.getSelectionElementList();t?.isPlainText&&l?.length&&(l=[{value:ke(l,e.getOptions())}]),l?.length&&await ps(l,e.getOptions())}function ic(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 l=o.dataTransfer?.files;if(!l)return;for(let s=0;s<l.length;s++){const a=l[s];a.type.startsWith("image")&&$o(t,a)}}}function ys(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 l=i?.elementList?.map(h=>!h.type||h.type!==r.ElementType.CONTROL&&te.includes(h.type)?h.value:k).join("")||"";if(!l)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(l);let u=-1,R=-1;for(const{segment:h,index:g,isWordLike:T}of d){const f=g+a;if(T&&s>=f&&s<f+h.length){u=f-1,R=u+h.length;break}}return~u&&~R?{startIndex:u,endIndex:R}:null}function sc(o){const t=o.getDraw(),e=t.getPosition().getCursorPosition();if(!e)return null;const{value:n,index:i}=e,l=t.getLetterReg();let s=0,a=0;const c=Xo.test(n);if(c||l.test(n)){const u=t.getElementList();let R=i-1;for(;R>0;){const g=u[R].value;if(c&&Xo.test(g)||!c&&l.test(g))s++,R--;else break}let h=i+1;for(;h<u.length;){const g=u[h].value;if(c&&Xo.test(g)||!c&&l.test(g))a++,h++;else break}}const d=i-s-1;return d<0?null:{startIndex:d,endIndex:i+a}}function rc(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()===r.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 l=e.getRange(),s=ys(o)||sc(o);s&&(l.setRange(s.startIndex,s.endIndex),e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),l.setRangeStyle())}function lc(o){const t=o.getDraw(),e=t.getControl();if(e.getActiveControl()&&e.selectValue())return;const i=t.getPosition().getCursorPosition();if(!i)return;const{index:l}=i,s=t.getElementList();let a=0,c=0,d=l-1;for(;d>0;){const T=s[d],f=s[d-1];if(T.value===k&&!T.listWrap||T.listId!==f?.listId||T.titleId!==f?.titleId)break;a++,d--}let u=l+1;for(;u<s.length;){const T=s[u],f=s[u+1];if(T.value===k&&!T.listWrap||T.listId!==f?.listId||T.titleId!==f?.titleId)break;c++,u++}const R=t.getRange();let h=l-a-1;if(s[h]?.value!==k&&(h-=1),h<0)return;let g=l+c+1;(s[g]?.value===k||g>s.length-1)&&(g-=1),R.setRange(h,g),t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}const bs={dblclick:rc,threeClick:lc};function ac(o){o.isComposing=!0}function cc(o,t){const e=Yt();o.isComposing=!1;const n=o.getDraw(),i=n.getOptions();if(t.data)o.compositionInfo&&(o.compositionInfo.perfStartTime=e),Ol?setTimeout(()=>{o.compositionInfo&&ni(t.data,o,"compositionend")},1):o.compositionInfo&&ni(t.data,o,"compositionend");else{const s=o.compositionInfo?.cancel;if(tc(o),!s){const a=n.getRange(),{endIndex:c}=a.getRange();n.render({curIndex:c,isSubmitHistory:!1,traceLabel:"compositionend:empty"})}}n.getCursor().clearAgentDomValue(),Do(i,"compositionend",Yt()-e,[],{hasData:!!t.data,dataLength:t.data?.length||0})}function dc(o){o.compositionInfo&&(o.compositionInfo.cancel=!0)}const oi={compositionstart:ac,compositionend:cc,compositionCancel:dc};function uc(o,t){const e=t.getDraw();if(e.isReadonly())return;o.preventDefault();const i=e.getPageContainer();if(!Gi(o.target,I=>I===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:u,tdValueIndex:R,index:h}=d,g=c.getPositionList(),T=u?R:h;~h&&(e.getRange().setRange(T,T),c.setCursorPosition(g[T]));const f=e.getCursor(),{cursor:{dragColor:m,dragWidth:p,dragFloatImageDisabled:C}}=e.getOptions();if(C){const I=t.cacheElementList?.[t.cacheRange.startIndex];if(I?.type===r.ElementType.IMAGE&&(I.imgDisplay===r.ImageDisplay.FLOAT_TOP||I.imgDisplay===r.ImageDisplay.FLOAT_BOTTOM||I.imgDisplay===r.ImageDisplay.SURROUND))return}f.drawCursor({width:p,color:m,isBlink:!1,isFocus:!1})}const Rc={dragover:uc};class hc{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)),ul(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=ys(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 l=this.draw.getPainterOptions();(!l||!l.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()||wa(t,this)}mousedown(t){this.draw.isInteractionSuspended()||Da(t,this)}click(){this.draw.isInteractionSuspended()||Pl&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(t){this.draw.isInteractionSuspended()||Ya(t,this)}mouseleave(t){this.draw.isInteractionSuspended()||Ua(t,this)}keydown(t){this.draw.isInteractionSuspended()||Ba(t,this)}dblclick(t){this.draw.isInteractionSuspended()||bs.dblclick(this,t)}threeClick(){this.draw.isInteractionSuspended()||bs.threeClick(this)}input(t,e="input"){this.draw.isInteractionSuspended()||ni(t,this,e)}async cut(){this.draw.isInteractionSuspended()||await nc(this)}async copy(t){this.draw.isInteractionSuspended()||await oc(this,t)}compositionstart(){this.draw.isInteractionSuspended()||oi.compositionstart(this)}compositionend(t){this.draw.isInteractionSuspended()||oi.compositionend(this,t)}compositionCancel(){this.draw.isInteractionSuspended()||oi.compositionCancel(this)}drop(t){this.draw.isInteractionSuspended()||ic(t,this)}dragover(t){this.draw.isInteractionSuspended()||Rc.dragover(t,this)}}const Ws={PAGE_SCALE:"pageScale"};class gc{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(Ws.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 Tc{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 fc{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:l,startY:s,startRowIndex:a,startIndex:c,innerWidth:d,zone:u}=t,{scale:R,table:{tdPadding:h}}=this.options;let g=l,T=s,f=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===r.RowFlex.CENTER?g+=(d-P)/2:p.rowFlex===r.RowFlex.RIGHT&&(g+=d-P)}g+=p.offsetX||0,T+=p.offsetY||0;const C=g,I=T;for(let P=0;P<p.elementList.length;P++){const M=p.elementList[P],N=M.metrics,F=!_t(M)&&(M.imgDisplay!==r.ImageDisplay.INLINE&&M.type===r.ElementType.IMAGE||M.type===r.ElementType.LATEX)?p.ascent-N.height:p.ascent;M.left&&(g+=M.left),M.translateX&&(g+=M.translateX*R);const S={pageNo:i,index:f,value:M.value,rowIndex:a+m,rowNo:m,metrics:N,left:M.left||0,ascent:F,lineHeight:p.height,isFirstLetter:P===0,isLastLetter:P===p.elementList.length-1,coordinate:{leftTop:[g,T],leftBottom:[g,T+p.height],rightTop:[g+N.width,T],rightBottom:[g+N.width,T+p.height]}};if(M.imgDisplay===r.ImageDisplay.SURROUND||M.imgDisplay===r.ImageDisplay.FLOAT_TOP||M.imgDisplay===r.ImageDisplay.FLOAT_BOTTOM){const W=e[e.length-1];W&&(S.metrics=W.metrics,S.coordinate=W.coordinate),M.imgFloatPosition||(M.imgFloatPosition={x:g,y:T,pageNo:i}),this.floatPositionList.push({pageNo:i,element:M,position:S,isTable:t.isTable,index:t.index,tdIndex:t.tdIndex,trIndex:t.trIndex,tdValueIndex:f,zone:u})}if(e.push(S),f++,g+=N.width,M.type===r.ElementType.TABLE&&!_t(M)){const W=M.tdPadding||h,Y=W[1]+W[3],b=W[0]+W[2];for(let D=0;D<M.trList.length;D++){const X=M.trList[D];for(let O=0;O<X.tdList.length;O++){const E=X.tdList[O];E.positionList=[];const L=E.rowList,V=this.computePageRowPosition({positionList:E.positionList,rowList:L,pageNo:i,startRowIndex:0,startIndex:0,startX:(E.x+W[3])*R+C+(M.translateX||0)*R,startY:(E.y+W[0])*R+I,innerWidth:(E.width-Y)*R,isTable:!0,index:f-1,tdIndex:O,trIndex:D,zone:u});if(E.verticalAlign===r.VerticalAlign.MIDDLE||E.verticalAlign===r.VerticalAlign.BOTTOM){const y=L.reduce((K,z)=>K+z.height,0),U=(E.height-b)*R-y,Q=E.verticalAlign===r.VerticalAlign.MIDDLE?U/2:U;Math.floor(Q)>0&&E.positionList.forEach(K=>{const{coordinate:{leftTop:z,leftBottom:rt,rightBottom:at,rightTop:A}}=K;z[1]+=Q,rt[1]+=Q,at[1]+=Q,A[1]+=Q})}g=V.x,T=V.y}}g=C,T=I}}g=l,T+=p.height}return{x:g,y:T,index:f}}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 u=e[d];if(!u?.length)continue;const R=u[0].startIndex;this.computePageRowPosition({positionList:this.positionList,rowList:u,pageNo:d,startRowIndex:c,startIndex:R,startX:i,startY:a,innerWidth:t}),c+=u.length}}computeRowPosition(t){const{row:e,innerWidth:n}=t,i=[];return this.computePageRowPosition({positionList:i,innerWidth:n,rowList:[dt(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:l,positionList:s}=t;l||(l=this.draw.getOriginalElementList()),s||(s=this.getOriginalPositionList());const a=this.draw.getZone(),c=t.pageNo??this.draw.getPageNo(),d=a.isMainActive(),u=d?c:0;if(!i){const f=this.getFloatPositionByXY({...t,imgDisplays:[r.ImageDisplay.FLOAT_TOP,r.ImageDisplay.SURROUND]});if(f)return f}for(let f=0;f<s.length;f++){const{index:m,pageNo:p,left:C,isFirstLetter:I,coordinate:{leftTop:P,rightTop:M,leftBottom:N}}=s[f];if(u===p){if(p>u)break;if(P[0]-C<=e&&M[0]>=e&&P[1]<=n&&N[1]>=n){let F=f;const S=l[f];if(S.type===r.ElementType.TABLE)for(let Y=0;Y<S.trList.length;Y++){const b=S.trList[Y];for(let D=0;D<b.tdList.length;D++){const X=b.tdList[D],O=this.getPositionByXY({x:e,y:n,td:X,pageNo:c,tablePosition:s[f],isTable:!0,elementList:X.value,positionList:X.positionList});if(~O.index){const{index:E,hitLineStartIndex:L}=O,V=X.value[E];return{index:m,isCheckbox:O.isCheckbox||V.type===r.ElementType.CHECKBOX||V.controlComponent===r.ControlComponent.CHECKBOX,isRadio:V.type===r.ElementType.RADIO||V.controlComponent===r.ControlComponent.RADIO,isControl:!!V.controlId,isImage:O.isImage,isLabel:O.isLabel,isMacro:O.isMacro,isDirectHit:O.isDirectHit,isTable:!0,tdIndex:D,trIndex:Y,tdValueIndex:E,tdId:X.id,trId:b.id,tableId:S.id,hitLineStartIndex:L}}}}if(S.type===r.ElementType.IMAGE||S.type===r.ElementType.LATEX)return{index:F,isDirectHit:!0,isImage:!0};if(S.type===r.ElementType.MENSTRUAL_HISTORY)return{index:F,isDirectHit:!0};if(S.type===r.ElementType.FETAL_HEART_POSITION)return{index:F,isDirectHit:!0};if(S.type===r.ElementType.TOOTH_POSITION){const{scale:Y}=this.options,b=S.width*Y;return e>=P[0]&&e<=P[0]+b?{index:F,isDirectHit:!0}:{index:F}}if(S.type===r.ElementType.CHECKBOX||S.controlComponent===r.ControlComponent.CHECKBOX)return{index:F,isDirectHit:!0,isCheckbox:!0};if(S.type===r.ElementType.LABEL)return{index:F,isDirectHit:!0,isLabel:!0};if(S.type===r.ElementType.MACRO||S.type===r.ElementType.CUSTOM_MACRO||S.type===r.ElementType.REUSABLE_ITEM||S.type===r.ElementType.SUB_TEMPLATE)return{index:F,isDirectHit:!0,isMacro:!0};if(S.type===r.ElementType.TAB&&S.listStyle===r.ListStyle.CHECKBOX){let Y=F-1;for(;Y>0;){const b=l[Y];if(b.value===k&&b.listStyle===r.ListStyle.CHECKBOX)break;Y--}return{index:Y,isDirectHit:!0,isCheckbox:!0}}if(S.type===r.ElementType.RADIO||S.controlComponent===r.ControlComponent.RADIO)return{index:F,isDirectHit:!0,isRadio:!0};let W;if(l[m].value!==k){const Y=M[0]-P[0];e<P[0]+Y/2&&(F=f-1,I&&(W=f))}return{isDirectHit:!0,hitLineStartIndex:W,index:F,isControl:!!S.controlId}}}}if(!i){const f=this.getFloatPositionByXY({...t,imgDisplays:[r.ImageDisplay.FLOAT_BOTTOM]});if(f)return f}let R=!1,h=-1,g;if(i){const{scale:f}=this.options,{td:m,tablePosition:p}=t;if(m&&p){const{leftTop:C}=p.coordinate,I=m.x*f+C[0],P=m.y*f+C[1],M=m.width*f,N=m.height*f;if(!(I<e&&e<I+M&&P<n&&n<P+N))return{index:h}}}const T=s.filter(f=>f.isLastLetter&&f.pageNo===u);for(let f=0;f<T.length;f++){const{index:m,rowNo:p,coordinate:{leftTop:C,leftBottom:I}}=T[f];if(n>C[1]&&n<=I[1]){const P=s.findIndex(S=>S.pageNo===u&&S.rowNo===p),M=l[P],N=s[P],F=M.listStyle===r.ListStyle.CHECKBOX?this.draw.getMargins()[3]:N.coordinate.leftTop[0];if(e<F)~P?N.value===k?h=P:(h=P-1,g=P):h=m;else{if(M.listStyle===r.ListStyle.CHECKBOX&&e<C[0])return{index:P,isDirectHit:!0,isCheckbox:!0};h=m}R=!0;break}}if(!R){if(this.draw.getIsPagingMode()){const m=this.draw.getHeader(),p=m.getHeight(),C=m.getHeaderTop()+p,I=this.draw.getFooter(),M=this.draw.getHeight()-(I.getFooterBottom()+I.getHeight());if(d){if(n<C)return{index:-1,zone:r.EditorZone.HEADER};if(n>M)return{index:-1,zone:r.EditorZone.FOOTER}}else if(n<=M&&n>=C)return{index:-1,zone:r.EditorZone.MAIN}}const f=this.draw.getMargins();if(n<=f[0])for(let m=0;m<s.length;m++){const p=s[m];if(p.pageNo!==u||p.rowNo!==0)continue;const{leftTop:C,rightTop:I}=p.coordinate;if(e<=f[3]||e>=C[0]&&e<=I[0]||s[m+1]?.rowNo!==0)return{index:p.index}}else{const m=T[T.length-1];if(m){const p=m.rowNo;for(let C=0;C<s.length;C++){const I=s[C];if(I.pageNo!==u||I.rowNo!==p)continue;const{leftTop:P,rightTop:M}=I.coordinate;if(e<=f[3]||e>=P[0]&&e<=M[0]||s[C+1]?.rowNo!==p)return{index:I.index}}}}return{index:T[T.length-1]?.index||s.length-1}}return{hitLineStartIndex:g,index:h,isControl:!!l[h]?.controlId}}getFloatPositionByXY(t){const{x:e,y:n}=t,i=t.pageNo??this.draw.getPageNo(),l=this.draw.getZone().getZone(),{scale:s}=this.options;for(let a=0;a<this.floatPositionList.length;a++){const{position:c,element:d,isTable:u,index:R,trIndex:h,tdIndex:g,tdValueIndex:T,zone:f,pageNo:m}=this.floatPositionList[a];if(i===m&&d.type===r.ElementType.IMAGE&&d.imgDisplay&&t.imgDisplays.includes(d.imgDisplay)&&(!f||f===l)){const p=d.imgFloatPosition,C=p.x*s,I=p.y*s,P=d.width*s,M=d.height*s;if(e>=C&&e<=C+P&&n>=I&&n<=I+M)return u?{index:R,isDirectHit:!0,isImage:!0,isTable:u,trIndex:h,tdIndex:g,tdValueIndex:T,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()!==r.EditorMode.READONLY){const{index:m,isTable:p,trIndex:C,tdIndex:I,tdValueIndex:P}=e,M=this.draw.getControl(),{newIndex:N}=M.moveCursor({index:m,isTable:p,trIndex:C,tdIndex:I,tdValueIndex:P});p?e.tdValueIndex=N:e.index=N}const{index:n,isCheckbox:i,isRadio:l,isControl:s,isImage:a,isLabel:c,isDirectHit:d,isTable:u,trIndex:R,tdIndex:h,tdId:g,trId:T,tableId:f}=e;return this.setPositionContext({isTable:u||!1,isCheckbox:i||!1,isRadio:l||!1,isControl:s||!1,isImage:a||!1,isLabel:c||!1,isDirectHit:d||!1,index:n,trIndex:R,tdIndex:h,tdId:g,trId:T,tableId:f}),e}setSurroundPosition(t){const{scale:e}=this.options,{pageNo:n,row:i,rowElement:l,rowElementRect:s,surroundElementList:a,availableWidth:c}=t;let d=s.x,u=0;if(a.length&&!cn(l)&&!l.control?.minWidth)for(let R=0;R<a.length;R++){const h=a[R],g=h.imgFloatPosition;if(g.pageNo!==n)continue;const T={...g,x:g.x*e,y:g.y*e,width:h.width*e,height:h.height*e};if(pl(s,T)){i.isSurround=!0;const f=T.width+T.x-s.x;if(l.left=f,i.width+=f,u+=f,d=T.x+T.width,i.width+l.metrics.width>c){l.left=0,i.width-=u;break}}}return{x:d,rowIncreaseWidth:u}}}class mc{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=rn(t,e);return n?{...n,...this.defaultStyle}:null}getIsRangeChange(t,e,n,i,l,s,a){return this.range.startIndex!==t||this.range.endIndex!==e||this.range.tableId!==n||this.range.startTdIndex!==i||this.range.endTdIndex!==l||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===k?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 l=0;l<i.length;l++){const s=i[l];e.push(...s.value)}}return e}return this.getSelection()}getTextLikeSelection(){const t=this.getSelection();return t?t.filter(e=>!e.type||te.includes(e.type)):null}getTextLikeSelectionElementList(){const t=this.getSelectionElementList();return t?t.filter(e=>!e.type||te.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 l=t;l<e+1;l++){const{pageNo:s,rowNo:a}=n[l],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 l=this.position.getPositionList(),s=this.draw.getElementList(),a=[];for(let c=0;c<l.length;c++){const d=l[c],u=i.get(d.pageNo);u&&u.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(),l=new Map;let s=t;for(;s>=0;){const{pageNo:d,rowNo:u}=n[s];let R=l.get(d);R||(R=[],l.set(d,R)),R.includes(u)||R.unshift(u);const h=i[s],g=i[s-1];if(h.value===k&&!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:u,rowNo:R}=n[d];let h=l.get(u);h||(h=[],l.set(u,h)),h.includes(R)||h.push(R),d++}}let c=e;for(a&&i[t].value===k&&(c+=1);c<n.length;){const d=i[c],u=i[c+1];if(d.value===k&&!d.listWrap||d.listId!==u?.listId||d.titleId!==u?.titleId)break;const{pageNo:R,rowNo:h}=n[c];let g=l.get(R);g||(g=[],l.set(R,g)),g.includes(h)||g.push(h),c++}return l}getRangeParagraphInfo(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;let n=-1;const i=[],l=this.getRangeParagraph();if(!l)return null;const s=this.draw.getElementList(),a=this.position.getPositionList();for(let c=0;c<a.length;c++){const d=a[c],u=l.get(d.pageNo);u&&u.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:l}=this.range,s=this.position.getPositionList();for(let a=i+1;a<=l&&s[a];a++){const{coordinate:{leftTop:d,rightBottom:u},pageNo:R}=s[a];if(n===R&&t>=d[0]&&t<=u[0]&&e>=d[1]&&e<=u[1])return!0}return!1}getKeywordRangeList(t){const e=this.draw.getSearch().getMatchList(t,this.draw.getOriginalElementList()),n=new Map;for(const l of e){const s=n.get(l.groupId);if(s)s.endIndex+=1;else{const{type:a,groupId:c,tableId:d,index:u,tdIndex:R,trIndex:h}=l,g={startIndex:u,endIndex:u};a===me.TABLE&&(g.tableId=d,g.startTdIndex=R,g.endTdIndex=R,g.startTrIndex=h,g.endTrIndex=h),n.set(c,g)}}const i=[];return n.forEach(l=>{i.push(l)}),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!==r.ControlComponent.PRE_TEXT||n[t+1]?.controlComponent!==r.ControlComponent.PRE_TEXT)&&i.controlComponent!==r.ControlComponent.POST_TEXT;const l=n[e];return l?!i.controlId&&!l.controlId||(!i.controlId||i.controlComponent===r.ControlComponent.POSTFIX)&&(!l.controlId||l.controlComponent===r.ControlComponent.POSTFIX)||!!i.controlId&&l.controlId===i.controlId&&l.controlComponent!==r.ControlComponent.PRE_TEXT&&l.controlComponent!==r.ControlComponent.POST_TEXT&&l.controlComponent!==r.ControlComponent.POSTFIX:!1}setRange(t,e,n,i,l,s,a,c){this.getIsRangeChange(t,e,n,i,l,s,a)&&(this.range.startIndex=t,this.range.endIndex=e,this.range.tableId=n,this.range.startTdIndex=i,this.range.endTdIndex=l,this.range.startTrIndex=s,this.range.endTrIndex=a,this.range.isCrossRowCol=!!(i||l||s||a),this.range.splitTdRange=c,this.setDefaultStyle(null)),this.range.zone=this.draw.getZone().getZone();const u=this.draw.getControl();if(~t&&~e&&!!this.draw.getElementList()[t]?.controlId){u.initControl();return}u.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:l}=this.range;if(!~n&&!~i)return;let s;if(l){const L=this.draw.getOriginalElementList(),V=this.position.getPositionContext();s=L[V.index]}else{const L=~i?i:0,V=this.draw.getElementList();s=this.getRangeAnchorStyle(V,L)}if(!s)return;const a=this.getSelection()||[s],c=s.type||r.ElementType.TEXT,d=s.font||this.options.defaultFont,u=s.size||this.options.defaultSize,R=!~a.findIndex(L=>!L.bold),h=!~a.findIndex(L=>!L.italic),g=!~a.findIndex(L=>!L.underline&&!L.control?.underline),T=!~a.findIndex(L=>!L.strikeout),f=s.color||null,m=s.highlight||null,p=s.rowFlex||null,C=s.vertical||null,I=s.rowMargin??this.options.defaultRowMargin,P=s.dashArray||[],M=s.level||null,N=s.listType||null,F=s.listStyle||null,S=g&&s.textDecoration||null,W=!!this.draw.getPainterStyle(),Y=this.historyManager.isCanUndo(),b=this.historyManager.isCanRedo(),D=s.groupIds||null,X=s.extension??null,O=s.deletePerson??"",E={type:c,undo:Y,redo:b,painter:W,font:d,size:u,bold:R,italic:h,underline:g,strikeout:T,deletePerson:O,color:f,highlight:m,rowFlex:p,vertical:C,rowMargin:I,dashArray:P,level:M,listType:N,listStyle:F,groupIds:D,textDecoration:S,extension:X};this._emitRangeStyle(E)}recoveryRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const n=this.options.defaultFont,i=this.options.defaultSize,l=this.options.defaultRowMargin,s=!!this.draw.getPainterStyle(),a=this.historyManager.isCanUndo(),c=this.historyManager.isCanRedo(),u={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:l,dashArray:[],level:null,listType:null,listStyle:null,groupIds:null,textDecoration:null,extension:null,vertical:null};this._emitRangeStyle(u)}shrinkBoundary(t={}){const{elementList:e,range:n}=this.getRangeElement(t),{startIndex:i,endIndex:l}=n;if(!~i&&!~l)return;const s=e[i],a=e[l];if(i===l){if(s.controlComponent===r.ControlComponent.PLACEHOLDER&&s.originControlId&&s.control?.type==="text")return;if(s.controlComponent===r.ControlComponent.PLACEHOLDER){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId===s.controlId&&(d.controlComponent===r.ControlComponent.PREFIX||d.controlComponent===r.ControlComponent.PRE_TEXT||d.controlComponent===r.ControlComponent.PRETEXTFIX||d.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)){n.startIndex=c,n.endIndex=c;break}if(d.controlId!==s.controlId&&!d.originControlId)break;c--}}if(s.controlComponent===r.ControlComponent.TEXTFIXLABEL){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId!==s.controlId||d.controlComponent===r.ControlComponent.VALUE||d.controlComponent===r.ControlComponent.PRETEXTFIX||d.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;break}c--}}}else{if(s.controlComponent===r.ControlComponent.PLACEHOLDER||a.controlComponent===r.ControlComponent.PLACEHOLDER||s.controlComponent===r.ControlComponent.TEXTFIXLABEL||a.controlComponent===r.ControlComponent.TEXTFIXLABEL){let c=l-1;for(;c>0;){const d=e[c];if(d.controlId!==a.controlId||d.controlComponent===r.ControlComponent.PREFIX||d.controlComponent===r.ControlComponent.PRE_TEXT||d.controlComponent===r.ControlComponent.PRETEXTFIX||d.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;return}c--}}if(s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT||s.controlComponent===r.ControlComponent.PRETEXTFIX||s.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT){let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==s.controlId||d.controlComponent===r.ControlComponent.VALUE){n.startIndex=c-1;break}else if(d.controlComponent===r.ControlComponent.PLACEHOLDER){n.startIndex=c-1,n.endIndex=c-1;return}c++}}if(a.controlComponent!==r.ControlComponent.VALUE){let c=l-1;for(;c>0;){const d=e[c];if(d.controlId!==s.controlId||d.controlComponent===r.ControlComponent.VALUE){n.endIndex=c;break}else if(d.controlComponent===r.ControlComponent.PLACEHOLDER){n.startIndex=c,n.endIndex=c;return}c--}}}}render(t,e,n,i,l){t.save(),t.globalAlpha=this.options.rangeAlpha,t.fillStyle=this.options.rangeColor,t.fillRect(e,n,i,l),t.restore()}toString(){const t=this.getTextLikeSelection();return t?t.map(e=>e.value).join("").replace(new RegExp(k,"g"),""):""}getRangeElement(t={}){const e=t.elementList||this.draw.getElementList(),n=t.range||this.getRange(),{splitTdRange:i}=n,l={elementList:e,range:n};return i&&(l.range=i,l.elementList=this.draw.getSplitTdValues(i.originalId)??[]),l}}class pc{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:l,scale:s}=this.options;if(l.size===r.BackgroundSize.CONTAIN){const a=e.width*s,c=e.height*s;if(!l.repeat||l.repeat===r.BackgroundRepeat.NO_REPEAT)t.drawImage(e,0,0,a,c);else{let d=0,u=0;const R=l.repeat===r.BackgroundRepeat.REPEAT||l.repeat===r.BackgroundRepeat.REPEAT_X?Math.ceil(n*s/a):1,h=l.repeat===r.BackgroundRepeat.REPEAT||l.repeat===r.BackgroundRepeat.REPEAT_Y?Math.ceil(i*s/c):1;for(let g=0;g<R;g++){for(let T=0;T<h;T++)t.drawImage(e,d,u,a,c),u+=c;u=0,d+=a}}}else t.drawImage(e,0,0,n*s,i*s)}_renderBackgroundImage(t,e,n){const{background:i}=this.options,l=this.imageCache.get(i.image);if(l)this._drawImage(t,l,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:l}}=this.options;if(n&&(!l?.length||l.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 ii{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,l,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,l,s,a);return}c&&(this.fillRect.x=e,this.fillRect.y=n),l&&this.fillRect.height<l&&(this.fillRect.height=l),this.fillRect.width+=i,this.fillColor=s,this.fillDecorationStyle=a}}class Ic extends ii{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:l,height:s}=this.fillRect;t.save(),t.globalAlpha=e,t.fillStyle=this.fillColor,t.fillRect(n,i,l,s),t.restore(),this.clearFillInfo()}}class Cc{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{marginIndicatorColor:n,pageMode:i}=this.options,l=this.draw.getWidth(),s=i===r.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]],u=[l-a[1],a[0]],R=[a[3],s-a[2]],h=[l-a[1],s-a[2]];t.moveTo(d[0]-c,d[1]),t.lineTo(...d),t.lineTo(d[0],d[1]-c),t.moveTo(u[0]+c,u[1]),t.lineTo(...u),t.lineTo(u[0],u[1]-c),t.moveTo(R[0]-c,R[1]),t.lineTo(...R),t.lineTo(R[0],R[1]+c),t.moveTo(h[0]+c,h[1]),t.lineTo(...h),t.lineTo(h[0],h[1]+c),t.stroke(),t.restore()}}class Lc{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:l}=t,s=this.draw.getHeight(),a=this.draw.getPageGap(),c=l*(s+a),d=document.createElement("div");d.style.position="absolute";const u=50;d.style.width=`${i[0]-e[0]+u}px`,d.style.height=`${n[1]-e[1]+u}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 l=this.searchMatchList[i];n!==l.groupId&&(n=l.groupId,e+=1)}return{index:t,count:e}}getMatchList(t,e){const{isRegEnable:n=!1,isIgnoreCase:i=!0}=this.searchOptions||{},l=i?t.toLocaleLowerCase():t,s=[],a=[],c=e.length,d=[];for(let g=0;g<c;g++)e[g].type===r.ElementType.TABLE&&d.push(g);let u=0,R=0;for(;R<c-1;){const g=d.length?d[u]:c,T=e.slice(R,g);T.length&&a.push({index:R,type:me.PAGE,elementList:T});const f=e[g];f&&a.push({index:g,type:me.TABLE,elementList:[f]}),R=g+1,u++}function h(g,T,f,m){if(!g)return;let p=f.map(N=>!N.type||te.includes(N.type)&&N.controlComponent!==r.ControlComponent.CHECKBOX&&N.controlComponent!==r.ControlComponent.RADIO&&!N.hide&&!N.control?.hide&&!N.area?.hide?N.value:k).filter(Boolean).join("");i&&(p=p.toLocaleLowerCase());const C=[],I=n?new RegExp(g):g;let{index:P,length:M}=zi(p,I);for(;P!==-1&&M!==0;){C.push({index:P,length:M});const N=zi(p,I,P+M);P=N.index,M=N.length}for(let N=0;N<C.length;N++){const{index:F,length:S}=C[N],W=gt();for(let Y=0;Y<S;Y++){const b=F+Y+(m?.startIndex||0);s.push({type:T,index:b,groupId:W,...m})}}}for(let g=0;g<a.length;g++){const T=a[g];if(T.type===me.TABLE){const f=T.elementList[0];for(let m=0;m<f.trList.length;m++){const p=f.trList[m];for(let C=0;C<p.tdList.length;C++){const I=p.tdList[C],P={tableId:f.id,tableIndex:T.index,trIndex:m,tdIndex:C,tdId:I.id};h(l,T.type,I.value,P)}}}else h(l,T.type,T.elementList,{startIndex:T.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(),l=i+1;for(const s of this.searchMatchList)s.type===me.TABLE?s.tableIndex+=l:s.index+=l}render(t,e){if(!this.searchMatchList||!this.searchMatchList.length||!this.searchKeyword)return;const{searchMatchAlpha:n,searchMatchColor:i,searchNavigateMatchColor:l}=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 u=null;if(d.type===me.TABLE){const{tableIndex:P,trIndex:M,tdIndex:N,index:F}=d;u=a[P]?.trList[M].tdList[N]?.positionList[F]}else u=s[d.index];if(!u)continue;const{coordinate:{leftTop:R,leftBottom:h,rightTop:g},pageNo:T}=u;if(T!==e)continue;if(this.getSearchNavigateIndexList().includes(c)){t.fillStyle=l;const P=this.searchMatchList[c-1];(!P||P.groupId!==d.groupId)&&this.searchNavigateScrollIntoView(u)}else t.fillStyle=i;const m=R[0],p=R[1],C=g[0]-R[0],I=h[1]-R[1];t.fillRect(m,p,C,I)}t.restore()}replace(t,e){if(this.draw.isReadonly()||t==null)return;let i=this.getSearchMatchList();const l=e?.index;if(Wo(l)){const f=[];i.forEach(m=>{const p=f[f.length-1];!p||p[0].groupId!==m.groupId?f.push([m]):p.push(m)}),i=f[l]}if(!i?.length)return;const s=this.draw.isDesignMode();let a=0,c=0,d="",u="",R=-1;const h=this.draw.getOriginalElementList();for(let f=0;f<i.length;f++){const m=i[f];if(m.type===me.TABLE){const{tableIndex:p,trIndex:C,tdIndex:I,index:P,tdId:M}=m;u&&M!==u&&(c=0),u=M;const N=p+a,F=h[N].trList[C].tdList[I].value,S=P+c,W=F[S];if(!s&&(W?.control?.deletable===!1||W?.title?.deletable===!1))continue;if(t===""){this.draw.spliceElementList(F,S,1),c--,~R||(R=f);continue}if(d===m.groupId){this.draw.spliceElementList(F,S,1),c--;continue}~R||(R=f);for(let Y=0;Y<t.length;Y++){const b=t[Y];Y===0?W.value=b:(this.draw.spliceElementList(F,S+Y,0,[{...W,value:b}]),c++)}}else{const p=m.index+a,C=h[p];if(!s&&(C?.control?.deletable===!1||C?.title?.deletable===!1)||C.type===r.ElementType.CONTROL&&C.controlComponent!==r.ControlComponent.VALUE)continue;if(t===""){this.draw.spliceElementList(h,p,1),a--,~R||(R=f);continue}if(~R||(R=f),d===m.groupId){this.draw.spliceElementList(h,p,1),a--;continue}for(let I=0;I<t.length;I++){const P=t[I];I===0?C.value=P:(this.draw.spliceElementList(h,p+I,0,[{...C,value:P}]),a++)}}d=m.groupId}if(!~R)return;const g=i[R],T=g.index+(t.length-1);if(g.type===me.TABLE){const{tableIndex:f,trIndex:m,tdIndex:p,index:C}=g,I=h[f].trList[m].tdList[p].value[C];this.position.setPositionContext({isTable:!0,index:f,trIndex:m,tdIndex:p,tdId:I.tdId,trId:I.trId,tableId:I.tableId})}else this.position.setPositionContext({isTable:!1});this.draw.getRange().setRange(T,T),this.draw.render({curIndex:T})}}class Pc extends ii{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:l,width:s}=this.fillRect;t.save(),t.lineWidth=e,t.strokeStyle=n;const a=l-3;t.beginPath(),t.moveTo(i,a),t.lineTo(i+s,a),t.stroke(),t.beginPath(),t.moveTo(i,l+3.5),t.lineTo(i+s,l+3.5),t.stroke(),t.restore(),this.clearFillInfo()}}r.TextDecorationStyle=void 0,(function(o){o.SOLID="solid",o.DOUBLE="double",o.DASHED="dashed",o.DOTTED="dotted",o.WAVY="wavy"})(r.TextDecorationStyle||(r.TextDecorationStyle={}));var Rn;(function(o){o.SOLID="solid",o.DASHED="dashed",o.DOTTED="dotted"})(Rn||(Rn={}));class Mc extends ii{options;constructor(t){super(),this.options=t.getOptions()}_drawLine(t,e,n,i,l){const s=e+i;switch(t.beginPath(),l){case Rn.DASHED:t.setLineDash([3,1]);break;case Rn.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===r.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:l}=this.options,s=1.2*l,a=1/l,c=n+2*s;t.beginPath();for(let d=0;d<i;d++){const u=s*Math.sin(a*d);t.lineTo(e+d,c+u)}t.stroke()}render(t){if(!this.fillRect.width)return;const{underlineColor:e,scale:n}=this.options,{x:i,y:l,width:s}=this.fillRect;t.save(),t.strokeStyle=this.fillColor||e,t.lineWidth=n;const a=Math.floor(l+2*t.lineWidth)+.5;switch(this.fillDecorationStyle){case r.TextDecorationStyle.WAVY:this._drawWave(t,i,a,s);break;case r.TextDecorationStyle.DOUBLE:this._drawDouble(t,i,a,s);break;case r.TextDecorationStyle.DASHED:this._drawLine(t,i,a,s,Rn.DASHED);break;case r.TextDecorationStyle.DOTTED:this._drawLine(t,i,a,s,Rn.DOTTED);break;default:this._drawLine(t,i,a,s);break}t.restore(),this.clearFillInfo()}}class Oc{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:nl});return t.restore(),n}measureWord(t,e,n){const i=this.draw.getLetterReg();let l=0,s=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==r.ElementType.TEXT||!i.test(c.value)){s=c;break}l+=this.measureText(t,c).width,a++}return{width:l,endElement:s}}buttonMeasureWord(t,e,n){const i=this.draw.getLetterReg();let l=0,s=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==r.ElementType.TEXT||!i.test(c.value)){s=c;break}l+=this.measureText(t,c).width,a++}return{width:l,endElement:s}}measurePunctuationWidth(t,e){return!e||!el.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 l=t.measureText(e.value);return this.cacheMeasureText.set(n,l),l}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===r.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 hn{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}static formatNumberPlaceholder(t,e,n,i){const l=i===r.NumberType.CHINESE?gl(e):`${e}`;return t.replace(n,l)}render(t,e){const{scale:n,pageNumber:{size:i,font:l,color:s,rowFlex:a,numberType:c,format:d,startPageNo:u,fromPageNo:R}}=this.options;if(e<R)return;let h=d;const g=new RegExp(Sn.PAGE_NO);g.test(h)&&(h=hn.formatNumberPlaceholder(h,e+u-R,g,c));const T=new RegExp(Sn.PAGE_COUNT);T.test(h)&&(h=hn.formatNumberPlaceholder(h,this.draw.getPageCount()-R,T,c));const f=this.draw.getWidth(),m=this.draw.getHeight(),p=this.draw.getPageNumberBottom(),C=m-p;t.save(),t.fillStyle=s,t.font=`${i*n}px ${l}`;let I=0;const P=this.draw.getMargins(),{width:M}=t.measureText(h);a===r.RowFlex.CENTER?I=(f-M)/2:a===r.RowFlex.RIGHT?I=f-M-P[1]:I=P[3],t.fillText(h,I,C),t.restore()}}class Ec{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 l=0;l<t.length;l++){const s=t[l],{intersectionHeight:a}=this.getElementVisibleInfo(s);if(i&&!a)break;a&&e.push(l),a>i&&(i=a,n=l)}return{intersectionPageNo:n,visiblePageNoList:e}}_observer=cl(()=>{const{intersectionPageNo:t,visiblePageNoList:e}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(t),this.draw.setVisiblePageNoList(e)},150)}class Sc{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(Ut.UP):this.clientHeight-n<=this.thresholdPoints[1]?this._startMove(Ut.DOWN):e<this.thresholdPoints[2]?this._startMove(Ut.LEFT):this.clientWidth-e<this.thresholdPoints[3]?this._startMove(Ut.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===Ut.DOWN?e.scrollTo(n,i+this.step):t===Ut.UP?e.scrollTo(n,i-this.step):t===Ut.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 Xc{draw;range;options;constructor(t){this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}getTrListGroupByCol(t){const e=dt(t);for(let n=0;n<t.length;n++){const i=e[n];for(let l=i.tdList.length-1;l>=0;l--){const s=i.tdList[l],{rowspan:a,rowIndex:c,colIndex:d}=s,u=c+a-1;if(u!==l){const R=i.tdList.splice(l,1)[0];e[u]?.tdList.splice(d,0,R)}}}return e}getRangeRowCol(){const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.draw.getPosition().getPositionContext();if(!t)return null;const{isCrossRowCol:l,startTdIndex:s,endTdIndex:a,startTrIndex:c,endTrIndex:d}=this.range.getRange(),h=this.draw.getOriginalElementList()[e].trList;if(!l)return[[h[n].tdList[i]]];let g=h[c].tdList[s],T=h[d].tdList[a];(g.x>T.x||g.y>T.y)&&([g,T]=[T,g]);const f=g.colIndex,m=T.colIndex+(T.colspan-1),p=g.rowIndex,C=T.rowIndex+(T.rowspan-1),I=[];for(let P=0;P<h.length;P++){const M=h[P],N=[];for(let F=0;F<M.tdList.length;F++){const S=M.tdList[F],W=S.colIndex,Y=S.rowIndex;W>=f&&W<=m&&Y>=p&&Y<=C&&N.push(S)}N.length&&I.push(N)}return I.length?I:null}_drawOuterBorder(t){const{ctx:e,startX:n,startY:i,width:l,height:s,isDrawFullBorder:a,borderExternalWidth:c}=t,{scale:d}=this.options,u=e.lineWidth;c&&(e.lineWidth=c*d),e.beginPath();const R=Math.round(n),h=Math.round(i);e.translate(.5,.5),a?e.rect(R,h,l,s):(e.moveTo(R,h+s),e.lineTo(R,h),e.lineTo(R+l,h)),e.stroke(),c&&(e.lineWidth=u),e.translate(-.5,-.5)}_drawSlash(t,e,n,i){const{scale:l}=this.options;t.save();const s=e.width*l,a=e.height*l,c=Math.round(e.x*l+n),d=Math.round(e.y*l+i);e.slashTypes?.includes(r.TdSlash.FORWARD)&&(t.moveTo(c+s,d),t.lineTo(c,d+a)),e.slashTypes?.includes(r.TdSlash.BACK)&&(t.moveTo(c,d),t.lineTo(c+s,d+a)),t.stroke(),t.restore()}_drawBorder(t,e,n,i){const{colgroup:l,trList:s,borderType:a,borderColor:c,borderWidth:d=1,borderExternalWidth:u}=e;if(!l||!s)return;const{scale:R,table:{defaultBorderColor:h}}=this.options,g=e.width*R,T=e.height*R,f=a===r.TableBorder.EMPTY,m=a===r.TableBorder.EXTERNAL,p=a===r.TableBorder.INTERNAL;t.save(),a===r.TableBorder.DASH&&t.setLineDash([3,3]),t.lineWidth=d*R,t.strokeStyle=c||h,!f&&!p&&this._drawOuterBorder({ctx:t,startX:n,startY:i,width:g,height:T,borderExternalWidth:u,isDrawFullBorder:m});for(let C=0;C<s.length;C++){const I=s[C];for(let P=0;P<I.tdList.length;P++){const M=I.tdList[P];if(M.slashTypes?.length&&this._drawSlash(t,M,n,i),!M.borderTypes?.length&&(f||m))continue;const N=M.width*R,F=M.height*R,S=Math.round(M.x*R+n+N),W=Math.round(M.y*R+i);if(t.translate(.5,.5),t.beginPath(),M.borderTypes?.includes(r.TdBorder.TOP)&&(t.moveTo(S-N,W),t.lineTo(S,W),t.stroke()),M.borderTypes?.includes(r.TdBorder.RIGHT)&&(t.moveTo(S,W),t.lineTo(S,W+F),t.stroke()),M.borderTypes?.includes(r.TdBorder.BOTTOM)&&(t.moveTo(S,W+F),t.lineTo(S-N,W+F),t.stroke()),M.borderTypes?.includes(r.TdBorder.LEFT)&&(t.moveTo(S-N,W),t.lineTo(S-N,W+F),t.stroke()),!f&&!m){if((!p||M.colIndex+M.colspan<l.length)&&(t.moveTo(S,W),t.lineTo(S,W+F),u&&u!==d&&M.colIndex+M.colspan===l.length)){const Y=t.lineWidth;t.lineWidth=u*R,t.stroke(),t.beginPath(),t.lineWidth=Y}if(!p||M.rowIndex+M.rowspan<s.length){const Y=u&&u!==d&&M.rowIndex+M.rowspan===s.length;if(Y&&(t.stroke(),t.beginPath()),t.moveTo(S,W+F),t.lineTo(S-N,W+F),Y){const b=t.lineWidth;t.lineWidth=u*R,t.stroke(),t.beginPath(),t.lineWidth=b}}t.stroke()}t.translate(-.5,-.5)}}t.restore()}_drawBackgroundColor(t,e,n,i){const{trList:l}=e;if(!l)return;const{scale:s}=this.options;for(let a=0;a<l.length;a++){const c=l[a];for(let d=0;d<c.tdList.length;d++){const u=c.tdList[d];if(!u.backgroundColor)continue;t.save();const R=u.width*s,h=u.height*s,g=Math.round(u.x*s+n),T=Math.round(u.y*s+i);t.fillStyle=u.backgroundColor,t.fillRect(g,T,R,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 l=t[i].tdList;for(let s=0;s<l.length;s++){const a=l[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 l=t[i].tdList;for(let s=0;s<l.length;s++){const a=l[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 l=0;l<n.length;l++){const s=n[l],a=n.length-1===l;for(let c=0;c<s.tdList.length;c++){const d=s.tdList[c];let u=0;if(n.length>1&&l!==0){const p=s.tdList[c-1],C=p?p.colIndex+p.colspan:c;for(let I=C;I<e.length;I++)if(this.getRowCountByColIndex(n.slice(0,l),I)===l){u=I;let M=0;for(let N=0;N<I;N++)M+=e[N].width;i=M;break}}else{const p=s.tdList[c-1];p&&(u=p.colIndex+p.colspan)}let R=0;for(let p=0;p<d.colspan;p++)R+=e[p+u].width;let h=0;for(let p=0;p<d.rowspan;p++){const C=n[p+l]||n[l];h+=C.height}const g=s.tdList.length-1===c;let T=a;if(!T&&d.rowspan>1){const p=n.length-1-l;T=d.rowspan-1===p}const f=a&&g;d.isLastRowTd=g,d.isLastColTd=T,d.isLastTd=f,d.x=i;let m=0;for(let p=0;p<l;p++){const C=n[p].tdList;for(let I=0;I<C.length;I++){const P=C[I];if(u>=P.colIndex&&u<P.colIndex+P.colspan){m+=P.height;break}}}d.y=m,d.width=R,d.height=h,d.rowIndex=l,d.colIndex=u,d.trIndex=l,d.tdIndex=c,i+=R,g&&!f&&(i=0)}}}drawRange(t,e,n,i){const{scale:l,rangeAlpha:s,rangeColor:a}=this.options,{type:c,trList:d}=e;if(!d||c!==r.ElementType.TABLE)return;const{isCrossRowCol:u,startTdIndex:R,endTdIndex:h,startTrIndex:g,endTrIndex:T}=this.range.getRange();if(!u)return;let f=d[g].tdList[R],m=d[T].tdList[h];(f.x>m.x||f.y>m.y)&&([f,m]=[m,f]);const p=f.colIndex,C=m.colIndex+(m.colspan-1),I=f.rowIndex,P=m.rowIndex+(m.rowspan-1);t.save();for(let M=0;M<d.length;M++){const N=d[M];for(let F=0;F<N.tdList.length;F++){const S=N.tdList[F],W=S.colIndex,Y=S.rowIndex;if(W>=p&&W<=C&&Y>=I&&Y<=P){const b=S.x*l,D=S.y*l,X=S.width*l,O=S.height*l;t.globalAlpha=s,t.fillStyle=a,t.fillRect(b+n,D+i,X,O)}}}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 l=t[i].tdList.find(s=>s.colIndex===n);if(l)return l}}computeTrHeight(t,e){const{scale:n,table:{tdPadding:i,defaultTrMinHeight:l}}=this.options,s=t.tdPadding||i,a=s[0]+s[2],c=t.trList;for(let R=0;R<c.length;R++){const h=c[R];h.height=h.minHeight||l,h.minHeight=h.height}this.computeRowColInfo(t);const d={},u={};for(let R=0;R<c.length;R++){const h=c[R];if(!h.tdList.length){h.height=0;continue}const g=[],T=[];for(let m=0;m<t.colgroup.length;m++){const p=h.tdList.find(C=>C.colIndex===m);if(p){const C=e?e(p):p.rowList,I=C.reduce((M,N)=>M+N.height,0);p.rowList=C;const P=I/n+a;p.mainHeight=P,p.rowspan>1?(u[p.colIndex]=p.id,d[p.id]={td:p,rowSpan:[R,R+p.rowspan-1],preHeight:0,preMinHeight:0,extraHeight:P},T.push(P)):p.height<P?(p.height=P,p.realHeight=P,g.push(P)):g.push(p.height)}else{const C=d[u[m]];C?.rowSpan[1]==R&&g.push(C.extraHeight)}}const f=Math.max(...g.length?g:T);Object.values(d).forEach(m=>{m.rowSpan[0]<=R&&m.rowSpan[1]>=R&&(m.extraHeight-=f,m.preHeight+=f,m.preMinHeight+=h.minHeight)}),h.height=f;for(let m=0;m<t.colgroup.length;m++){const p=h.tdList.find(C=>C.colIndex===m)??this.findPreRowSpanTd(c,R,m);if(p){const C=d[p.id]?.preHeight??0,I=d[p.id]?.preMinHeight??h.minHeight;p.height=f+C,p.realHeight=f+C,p.realMinHeight=I}}}this.computeRowColInfo(t)}}var Ce;(function(o){o.ROW="row",o.COL="col"})(Ce||(Ce={}));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()===r.EditorMode.FORM){this.dispose();return}const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.position.getPositionContext();if(!t)return;this.dispose();const l=this.draw.getOriginalElementList(),s=this.position.getOriginalPositionList(),a=l[e];if(a.tableToolDisabled&&!this.draw.isDesignMode())return;const{scale:c,table:{overflow:d}}=this.options,u=s[e],{colgroup:R,trList:h}=a,{coordinate:{leftTop:g}}=u,T=this.draw.getHeight(),f=this.draw.getPageGap(),m=this.draw.getPageNo()*(T+f),p=g[0],C=g[1]+m,I=a.trList[n].tdList[i],P=I.rowIndex,M=I.colIndex,N=a.height*c,F=a.width*c,S=document.createElement("div");S.classList.add(`${q}-table-tool__select`),S.style.height=`${N*c}`,S.style.left=`${p}px`,S.style.top=`${C}px`,S.style.transform=`translate(-${this.TABLE_SELECT_OFFSET*c}px, ${-this.TABLE_SELECT_OFFSET*c}px)`,S.onclick=()=>{this.draw.getTableOperate().tableSelectAll()},this.container.append(S),this.toolTableSelectBtn=S;const W=h.map(L=>L.height),Y=document.createElement("div");Y.classList.add(`${q}-table-tool__row`),Y.style.transform=`translateX(-${this.ROW_COL_OFFSET*c}px)`;for(let L=0;L<W.length;L++){const V=W[L]*c,y=document.createElement("div");y.classList.add(`${q}-table-tool__row__item`),L===P&&y.classList.add("active"),y.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByRowIndex(h,L),K=Q[0],z=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:K.trIndex,tdIndex:K.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,K.tdIndex,z.tdIndex,K.trIndex,z.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(Y,L)};const U=document.createElement("div");U.classList.add(`${q}-table-tool__anchor`),U.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:L,order:Ce.ROW})},y.append(U),y.style.height=`${V}px`,Y.append(y)}Y.style.left=`${p}px`,Y.style.top=`${C}px`,this.container.append(Y),this.toolRowContainer=Y;const b=document.createElement("div");b.classList.add(`${q}-table-tool__quick__add`),b.style.height=`${N*c}`,b.style.left=`${p}px`,b.style.top=`${C+N}px`,b.style.transform=`translate(-${this.ROW_COL_QUICK_POSITION*c}px, ${this.ROW_COL_QUICK_OFFSET*c}px)`,b.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:h.length-1,tdIndex:0,tableId:a.id}),this.draw.getTableOperate().insertTableBottomRow()},this.container.append(b),this.toolRowAddBtn=b;const D=R.map(L=>L.width),X=document.createElement("div");X.classList.add(`${q}-table-tool__col`),X.style.transform=`translateY(-${this.ROW_COL_OFFSET*c}px)`;for(let L=0;L<D.length;L++){const V=D[L]*c,y=document.createElement("div");y.classList.add(`${q}-table-tool__col__item`),L===M&&y.classList.add("active"),y.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByColIndex(h,L),K=Q[0],z=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:K.trIndex,tdIndex:K.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,K.tdIndex,z.tdIndex,K.trIndex,z.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(X,L)};const U=document.createElement("div");U.classList.add(`${q}-table-tool__anchor`),U.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:L,order:Ce.COL})},y.append(U),y.style.width=`${V}px`,X.append(y)}X.style.left=`${p}px`,X.style.top=`${C}px`,this.container.append(X),this.toolColContainer=X;const O=document.createElement("div");O.classList.add(`${q}-table-tool__quick__add`),O.style.height=`${N*c}`,O.style.left=`${p+F}px`,O.style.top=`${C}px`,O.style.transform=`translate(${this.ROW_COL_QUICK_OFFSET*c}px, -${this.ROW_COL_QUICK_POSITION*c}px)`,O.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(O),this.toolColAddBtn=O;const E=document.createElement("div");E.classList.add(`${q}-table-tool__border`),E.style.height=`${N}px`,E.style.width=`${F}px`,E.style.left=`${p}px`,E.style.top=`${C}px`;for(let L=0;L<h.length;L++){const V=h[L];for(let y=0;y<V.tdList.length;y++){const U=V.tdList[y],Q=document.createElement("div");Q.classList.add(`${q}-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=z=>{this._mousedown({evt:z,element:a,index:U.rowIndex+U.rowspan-1,order:Ce.ROW})},E.appendChild(Q);const K=document.createElement("div");if(K.classList.add(`${q}-table-tool__border__col`),K.style.width=`${this.BORDER_VALUE}px`,K.style.height=`${U.height*c}px`,K.style.top=`${U.y*c}px`,K.style.left=`${(U.x+U.width)*c-this.BORDER_VALUE/2}px`,K.onmousedown=z=>{this._mousedown({evt:z,element:a,index:U.colIndex+U.colspan-1,order:Ce.COL})},E.appendChild(K),d&&U.colIndex===0){const z=document.createElement("div");z.classList.add(`${q}-table-tool__border__col`),z.style.width=`${this.BORDER_VALUE}px`,z.style.height=`${U.height*c}px`,z.style.top=`${U.y*c}px`,z.style.left=`${U.x*c-this.BORDER_VALUE/2}px`,z.onmousedown=rt=>{this._mousedown({evt:rt,element:a,index:0,isLeftStartBorder:!0,order:Ce.COL})},E.appendChild(z)}}}this.container.append(E),this.toolBorderContainer=E}_setAnchorActive(t,e){const n=t.children;for(let i=0;i<n.length;i++){const l=n[i];i===e?l.classList.add("active"):l.classList.remove("active")}}_mousedown(t){const{evt:e,index:n,order:i,element:l,isLeftStartBorder:s}=t;this.canvas=this.draw.getPage();const{scale:a,table:{overflow:c}}=this.options,d=this.draw.getWidth(),u=this.draw.getHeight(),R=this.draw.getPageGap(),h=this.draw.getPageNo()*(u+R),g=this.position.getPositionContext(),m=(this.position.getOriginalPositionList()[g.index]?.coordinate?.leftTop?.[0]||0)*a,p=this.draw.getMargins(),C=p[0],I=p[1],P=C,M=d-I;this.mousedownX=e.x,this.mousedownY=e.y;const N=e.target,F=this.canvas.getBoundingClientRect(),S=window.getComputedStyle(N).cursor;document.body.style.cursor=S,this.canvas.style.cursor=S;let W=0,Y=0;const b=document.createElement("div");b.classList.add(`${q}-table-anchor__line`),i===Ce.ROW?(b.classList.add(`${q}-table-anchor__line__row`),b.style.width=`${d}px`,W=0,Y=h+this.mousedownY-F.top):(b.classList.add(`${q}-table-anchor__line__col`),b.style.height=`${u}px`,W=this.mousedownX-F.left,Y=h),b.style.left=`${W}px`,b.style.top=`${Y}px`,this.container.append(b),this.anchorLine=b;let D=0,X=0;const O=E=>{const L=this._mousemove(E,i,W,Y);L&&(D=L.dx,X=L.dy)};document.addEventListener("mousemove",O),document.addEventListener("mouseup",()=>{let E=!1;if(i===Ce.ROW){const L=l.trList,V=L[n]||L[n-1],{defaultTrMinHeight:y}=this.options.table;X<0&&V.height+X<y&&(X=y-V.height),X&&(V.height+=X,V.minHeight=V.height,E=!0)}else{const{colgroup:L}=l;if(L&&D)if(c&&s){L[n].width-D/a<=this.MIN_TD_WIDTH&&(D=(L[n].width-this.MIN_TD_WIDTH)*a);const V=m+(l.translateX||0)*a;V+D<P&&(D=P-V),L[n].width-=D/a,l.width-=D/a,l.translateX=(l.translateX||0)+D/a,E=!0}else{const V=L[n].width;D<0&&V*a+D<this.MIN_TD_WIDTH*a&&(D=this.MIN_TD_WIDTH*a-V*a);const y=L[n+1]?.width;if(D>0&&y&&y*a-D<this.MIN_TD_WIDTH*a&&(D=y*a-this.MIN_TD_WIDTH*a),n===L.length-1){const Q=m+(l.translateX||0)*a+l.width*a;Q+D>M&&(D=M-Q)}D&&(L.length-1!==n&&(L[n+1].width-=D/a),L[n].width+=D/a,E=!0)}}E&&this.draw.render({isSetCursor:!1}),b.remove(),document.removeEventListener("mousemove",O),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),e.preventDefault()}_mousemove(t,e,n,i){if(!this.anchorLine)return null;const l=t.x-this.mousedownX,s=t.y-this.mousedownY;return e===Ce.ROW?this.anchorLine.style.top=`${i+s}px`:this.anchorLine.style.left=`${n+l}px`,t.preventDefault(),{dx:l,dy:s}}}class Fc{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(`${q}-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:l}=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+l}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 yc{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:l,label:{defaultBackgroundColor:s,defaultColor:a,defaultBorderRadius:c,defaultPadding:d}}=this.options,u=e.label?.backgroundColor||s,R=e.label?.color||a,h=e.label?.borderRadius||c,g=e.label?.padding||d;t.save(),t.font=e.style;const{width:T,height:f,boundingBoxAscent:m}=e.metrics;t.fillStyle=u,this._drawRoundedRect(t,n,i-m,T,f+(g[0]+g[3])*l,h*l),t.fill(),t.fillStyle=R,t.fillText(e.value,n+g[3]*l,i),t.restore()}_drawRoundedRect(t,e,n,i,l,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+l-s),t.quadraticCurveTo(e+i,n+l,e+i-s,n+l),t.lineTo(e+s,n+l),t.quadraticCurveTo(e,n+l,e,n+l-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+s,n),t.closePath()}}class bc{options;draw;activeInlineEditor;constructor(t){this.draw=t,this.options=t.getOptions(),this.activeInlineEditor=null}render(t,e,n,i){const l=this.draw.getMode(),s=e.macroConfig;if(l===r.EditorMode.READONLY&&e.type!=="subTemplate"){this._renderPlainText(t,e,n,i,xo(e));return}if(l===r.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||"",u=e.label||"";if(l===r.EditorMode.FORM)this.activeInlineEditor?.elementId===e.id&&this._syncInlineEditorPosition(),c==="select"?this._renderSelectControl(t,e,n,i,d):this._renderTextControl(t,e,n,i,d);else{const R=d||`获取 ${u}`;this._renderPlainText(t,e,n,i,R)}return}if(e.type==="reusableItem"){const d=e.reusableItemConfig?.value||"",u=e.label||"";if(l===r.EditorMode.FORM)this._renderTextControl(t,e,n,i,d);else{const R=d||`获取 ${u}`;this._renderPlainText(t,e,n,i,R)}return}if(e.type==="subTemplate"){const c=e.label||"子模板";l===r.EditorMode.FORM?e.subTemplateExpanded||this._renderEditMode(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)}activateInlineEditor(t,e){if(this.draw.getMode()!==r.EditorMode.FORM||t.type!=="customMacro")return!1;const n=this._ensureMacroConfig(t),i=n.type||"text",l=this.activeInlineEditor;if(l&&l.elementId===t.id&&l.type===i)return l.input.focus(),l.input instanceof HTMLInputElement&&l.input.select(),!0;this.clearInlineEditor({isSubmitHistory:!1});const s=document.createElement("div");s.style.position="absolute",s.style.zIndex="1002",s.style.boxSizing="border-box",s.style.display="flex",s.style.alignItems="center";const a=this._getInlineEditorBaseStyle(t);let c;i==="select"?c=this._createSelectEditor(t,s):c=this._createTextEditor(t,s),c.style.boxSizing="border-box",c.style.width="100%",c.style.height="100%",c.style.border="none",c.style.outline="none",c.style.background="transparent",c.style.font=a.font,c.style.color=a.color,c.style.padding=a.padding,c.style.margin="0",s.append(c),s.addEventListener("mousedown",u=>u.stopPropagation()),s.addEventListener("click",u=>u.stopPropagation()),this.draw.getContainer().append(s),this.draw.setOverlayActive(!0);const d=u=>{const R=u.target;R instanceof Node&&s.contains(R)||this.clearInlineEditor()};return document.addEventListener("mousedown",d,!0),this.activeInlineEditor={elementId:t.id,index:e,type:i,wrapper:s,input:c,initialValue:n.value||"",initialCode:n.code,outsideHandler:d},this._syncInlineEditorPosition(),c.focus(),c instanceof HTMLInputElement?c.select():"showPicker"in c&&typeof c.showPicker=="function"?c.showPicker():c.click(),!0}clearInlineEditor(t={}){const e=this.activeInlineEditor;if(!e)return;const{isSubmitHistory:n=!0,isRestore:i=!1}=t;document.removeEventListener("mousedown",e.outsideHandler,!0);const l=this._getInlineEditorElement(e),s=l?.macroConfig,a=e.input.value||"",c=e.input instanceof HTMLSelectElement&&e.input.value||"";if(l&&s&&(i?(s.value=e.initialValue,e.type==="select"&&(s.code=e.initialCode)):e.type==="text"?s.value=a:(s.code=c||void 0,s.value=this._getSelectLabelByCode(s,c))),e.wrapper.remove(),this.activeInlineEditor=null,this.draw.setOverlayActive(!1),l&&!i){const d=this._ensureMacroConfig(l),u=d.value||"",R=d.code;u!==e.initialValue||R!==e.initialCode?this.draw.getCommand().setMacroValue({id:l.id,dictCode:l.dictCode,label:l.label,areaId:l.areaId,value:u,code:R,isSubmitHistory:n}):this.draw.render({isSubmitHistory:!1,isSetCursor:!1})}else this.draw.render({isSubmitHistory:!1,isSetCursor:!1})}_renderPlainText(t,e,n,i,l){t.save(),t.font=e.style,t.fillStyle=e.color||"#000000",t.textBaseline="alphabetic",t.fillText(l,n,i),t.restore()}_renderEditMode(t,e,n,i,l){const{scale:s}=this.options,a=e.type==="customMacro",c=e.type==="reusableItem",d=e.type==="subTemplate";let u,R;d?(u="#722ed1",R="#f9f0ff"):c?(u="#52c41a",R="#f6ffed"):a?(u="#fa8c16",R="#fff7e6"):(u="#1677ff",R="#e6f4ff"),t.save(),t.font=e.style;const h=t.measureText(l),g=h.actualBoundingBoxAscent+h.actualBoundingBoxDescent,T=8*s,f=4*s,m=4*s,p=h.width+T*2,C=g+f*2,I=e.metrics,P=n,M=i-I.boundingBoxAscent+(I.boundingBoxAscent+I.boundingBoxDescent-C)/2;t.fillStyle=R,this._drawRoundedRect(t,P,M,p,C,m),t.fill(),t.fillStyle=u,t.textBaseline="middle",t.fillText(l,n+T,M+C/2),t.restore()}_renderTextControl(t,e,n,i,l){const{scale:s,control:a,strikeoutColor:c}=this.options,{placeholderColor:d,bracketColor:u}=a;t.save(),t.font=e.style;const h=`请输入${e.label||""}`,g=l||h,f=t.measureText(g).width;t.fillStyle=u,t.textBaseline="alphabetic",t.fillText("[",n,i);const m=n+t.measureText("[").width;t.fillStyle=l?e.color||"#000000":d,t.fillText(g,m,i);const p=m+f;if(t.fillStyle=u,t.fillText("]",p,i),e.type==="reusableItem"){const C=t.measureText("[").width+f+t.measureText("]").width;if(t.lineWidth=s,this.draw.getMode()===r.EditorMode.PRINT?t.strokeStyle="transparent":t.strokeStyle=c||"red",e.strikeout){const I=i-3*s,P=i+3.5*s;t.beginPath(),t.moveTo(n,I),t.lineTo(n+C,I),t.stroke(),t.beginPath(),t.moveTo(n,P),t.lineTo(n+C,P),t.stroke()}else if(e.underline&&e.textDecoration?.style==="double"){const I=Math.floor(i+2*s)+.5,P=3*s;t.beginPath(),t.moveTo(n,I),t.lineTo(n+C,I),t.stroke(),t.beginPath(),t.moveTo(n,I+P),t.lineTo(n+C,I+P),t.stroke()}}t.restore()}_renderSelectControl(t,e,n,i,l){const{scale:s,control:a}=this.options,{placeholderColor:c,bracketColor:d}=a;t.save(),t.font=e.style;const R=`请选择${e.label||""}`,h=l||R,g=t.measureText(h),T=g.actualBoundingBoxAscent+g.actualBoundingBoxDescent;t.fillStyle=d,t.textBaseline="alphabetic",t.fillText("[",n,i);const f=n+t.measureText("[").width;t.fillStyle=l?e.color||"#000000":c,t.fillText(h,f,i);const m=f+g.width+2*s,p=i-T/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 C=m+6*s;t.fillStyle=d,t.fillText("]",C,i),t.restore()}_drawRoundedRect(t,e,n,i,l,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+l-s),t.quadraticCurveTo(e+i,n+l,e+i-s,n+l),t.lineTo(e+s,n+l),t.quadraticCurveTo(e,n+l,e,n+l-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+s,n),t.closePath()}_createTextEditor(t,e){const n=document.createElement("input");return n.type="text",n.value=t.macroConfig?.value||"",n.placeholder=`请输入${t.label||""}`,n.style.minWidth="0",n.style.background="#ffffff",n.addEventListener("input",()=>{const i=this._ensureMacroConfig(t);i.value=n.value}),n.addEventListener("keydown",i=>{i.key==="Enter"?(i.preventDefault(),this.clearInlineEditor()):i.key==="Escape"&&(i.preventDefault(),this.clearInlineEditor({isSubmitHistory:!1,isRestore:!0}))}),n.addEventListener("blur",()=>{this.activeInlineEditor?.input===n&&this.clearInlineEditor()}),e.style.background="#ffffff",e.style.border="1px solid #1677ff",e.style.borderRadius="4px",e.style.boxShadow="0 0 0 2px rgba(22, 119, 255, 0.12)",n}_createSelectEditor(t,e){const n=document.createElement("select"),i=this._ensureMacroConfig(t),l=document.createElement("option");return l.value="",l.textContent=`请选择${t.label||""}`,n.append(l),i.items?.forEach(s=>{const a=document.createElement("option");a.value=s.code,a.textContent=s.value,n.append(a)}),n.value=i.code||i.items?.find(s=>s.value===i.value)?.code||"",n.addEventListener("change",()=>{i.code=n.value||void 0,i.value=this._getSelectLabelByCode(i,n.value),this.clearInlineEditor()}),n.addEventListener("keydown",s=>{s.key==="Escape"?(s.preventDefault(),this.clearInlineEditor({isSubmitHistory:!1,isRestore:!0})):s.key==="Enter"&&(s.preventDefault(),this.clearInlineEditor())}),n.addEventListener("blur",()=>{this.activeInlineEditor?.input===n&&this.clearInlineEditor()}),e.style.background="#ffffff",e.style.border="1px solid #1677ff",e.style.borderRadius="4px",e.style.boxShadow="0 0 0 2px rgba(22, 119, 255, 0.12)",n}_syncInlineEditorPosition(){const t=this.activeInlineEditor;if(!t)return;const e=this._getInlineEditorPosition(t);if(!e){this.clearInlineEditor({isSubmitHistory:!1});return}const n=e.pageNo*(this.draw.getHeight()+this.draw.getPageGap()),[i,l]=e.coordinate.leftTop,s=Math.max(e.lineHeight,e.metrics.height),a=Math.max(e.metrics.width,80*this.options.scale),c=Math.max(0,(e.lineHeight-s)/2);t.wrapper.style.left=`${i}px`,t.wrapper.style.top=`${l+n+c}px`,t.wrapper.style.width=`${a}px`,t.wrapper.style.height=`${s}px`}_getInlineEditorBaseStyle(t){return{font:this.draw.getElementFont(t),color:t.color||"#000000",padding:`0 ${6*this.options.scale}px`}}_getInlineEditorElement(t){const e=this.draw.getElementList()[t.index];return e?.id===t.elementId?e:t.elementId?this.draw.getElementList().find(n=>n.id===t.elementId)||null:e||null}_getInlineEditorPosition(t){return this.draw.getPosition().getPositionList()[t.index]||null}_ensureMacroConfig(t){return t.macroConfig||(t.macroConfig={type:"text"}),t.macroConfig}_getSelectLabelByCode(t,e){return e&&t.items?.find(n=>n.code===e)?.value||""}}class Wc{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=Jo(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],l=t;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:l,innerWidth:e,zone:r.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*Ai[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(),l=[];let s=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(s+c.height>i)break;l.push(c),s+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:l,pageNo:e,startIndex:0,innerWidth:n,zone:r.EditorZone.HEADER}),t.restore()}}class Vc{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 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 Yc{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){t.save();const{scale:l,separator:{lineWidth:s,strokeStyle:a}}=this.options;t.lineWidth=(e.lineWidth||s)*l,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*l,c),t.stroke(),t.restore()}}class Uc{draw;options;i18n;constructor(t){this.draw=t,this.options=t.getOptions(),this.i18n=t.getI18n()}render(t,e,n,i){const{pageBreak:{font:l,fontSize:s,lineDash:a}}=this.options,c=this.i18n.t("pageBreak.displayName"),{scale:d,defaultRowMargin:u}=this.options,R=s*d,h=e.width*d,g=this.draw.getDefaultBasicRowMarginHeight()*u;t.save(),t.font=`${R}px ${l}`;const T=t.measureText(c),f=(h-T.width)/2;t.setLineDash(a),t.translate(0,.5+g),t.beginPath(),t.moveTo(n,i),t.lineTo(n+f,i),t.moveTo(n+f+T.width,i),t.lineTo(n+h,i),t.stroke(),t.fillText(c,n+f,i+T.actualBoundingBoxAscent-R/2),t.restore()}}class wc{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:l,size:s,color:a,repeat:c,gap:d,numberType:u},scale:R}=this.options,h=this.draw.getWidth(),g=this.draw.getHeight();t.save(),t.globalAlpha=i,t.font=`${s*R}px ${l}`;let T=n;const f=new RegExp(Sn.PAGE_NO);f.test(T)&&(T=hn.formatNumberPlaceholder(T,e+1,f,u));const m=new RegExp(Sn.PAGE_COUNT);m.test(T)&&(T=hn.formatNumberPlaceholder(T,this.draw.getPageCount(),m,u));const p=t.measureText(T);if(c){const C=this.draw.getPagePixelRatio(),I=document.createElement("canvas"),P=I.getContext("2d"),M=p.width,N=p.actualBoundingBoxAscent+p.actualBoundingBoxDescent,F=Math.sqrt(Math.pow(M,2)+Math.pow(N,2)),S=F+2*d[0]*R,W=F+2*d[1]*R;I.width=S,I.height=W,I.style.width=`${S*C}px`,I.style.height=`${W*C}px`,P.translate(S/2,W/2),P.rotate(-45*Math.PI/180),P.translate(-S/2,-W/2),P.font=`${s*R}px ${l}`,P.fillStyle=a,P.fillText(T,(S-M)/2,(W-N)/2+p.actualBoundingBoxAscent);const Y=t.createPattern(I,"repeat");Y&&(t.fillStyle=Y,t.fillRect(0,0,h,g))}else{const C=h/2,I=g/2;t.fillStyle=a,t.translate(C,I),t.rotate(-45*Math.PI/180),t.fillText(T,-p.width/2,p.actualBoundingBoxAscent-s*R/2)}t.restore()}renderImage(t){const{watermark:{width:e,height:n,data:i,opacity:l,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(),u=this.draw.getHeight(),R=e*c,h=n*c;if(t.save(),t.globalAlpha=l,s){const g=this.draw.getPagePixelRatio(),T=document.createElement("canvas"),f=T.getContext("2d"),m=Math.sqrt(Math.pow(R,2)+Math.pow(h,2)),p=m+2*a[0]*c,C=m+2*a[1]*c;T.width=p,T.height=C,T.style.width=`${p*g}px`,T.style.height=`${C*g}px`,f.translate(p/2,C/2),f.rotate(-45*Math.PI/180),f.translate(-p/2,-C/2),f.drawImage(this.imageCache.get(i),(p-R)/2,(C-h)/2,R,h);const I=t.createPattern(T,"repeat");I&&(t.fillStyle=I,t.fillRect(0,0,d,u))}else{const g=d/2,T=u/2;t.translate(g,T),t.rotate(-45*Math.PI/180),t.drawImage(this.imageCache.get(i),-R/2,-h/2,R,h)}t.restore()}render(t,e){this.options.watermark.type===r.WatermarkType.IMAGE?this.renderImage(t):this.renderText(t,e)}}class Zc{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:l,noValueBackgroundColor:s}}=this.options,a=t[e],c=this.draw.isPrintMode(),d=this.control.getActiveControl()?.getElement();let u=!1,R=!1,h=!1,g=!1;return a.highlight||(u=!c&&!!n&&!!d&&a.controlId===d.controlId&&!this.control.getIsRangeInPostfix()),u||(R=!c&&!!i&&!!a.control?.disabled),R||(h=!c&&!!l&&!!a.controlId&&this.control.getIsExistValueByElementListIndex(t,e)),h||(g=!c&&!!s&&!!a.controlId&&!this.control.getIsExistValueByElementListIndex(t,e)),(u?n:"")||(R?i:"")||(h?l:"")||(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 l=0;for(;l<n.length;){const s=n[l];if(l++,s.type===r.ElementType.TABLE){const T=s.trList;for(let f=0;f<T.length;f++){const m=T[f];for(let p=0;p<m.tdList.length;p++){const C=m.tdList[p],I={tableId:s.id,tableIndex:l-1,trIndex:f,tdIndex:p,tdId:C.id};e(C.value,I)}}}const a=s?.control;if(!a)continue;const c=this.highlightList.findIndex(T=>T.id===s.controlId||a.conceptId&&a.conceptId===T.conceptId);if(!~c)continue;const d=l;let u=l;for(;u<n.length&&n[u].controlId===s.controlId;)u++;l=u;const R=n.slice(d,u).map(T=>T.controlComponent===r.ControlComponent.VALUE?T:{value:k}),h=this.highlightList[c],{ruleList:g}=h;for(let T=0;T<g.length;T++){const f=g[T],m=t.getMatchList(f.keyword,R);this.highlightMatchResult.push(...m.map(p=>({...p,...f,...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,l=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:C,trIndex:I,tdIndex:P,index:M}=c;d=s[C]?.trList[I].tdList[P]?.positionList[M]}else d=l[c.index];if(!d)continue;const{coordinate:{leftTop:u,leftBottom:R,rightTop:h},pageNo:g}=d;if(g!==e)continue;t.fillStyle=c.backgroundColor||i,t.globalAlpha=c.alpha||n;const T=u[0],f=u[1],m=h[0]-u[0],p=R[1]-u[1];t.fillRect(T,f,m,p)}t.restore()}}class Qc{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:l,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(l,s,a,c),t.stroke(),t.restore(),this.clearBorderInfo()}}class Xn{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,l=[];return t.forEach(s=>{const a=i.find(c=>c.code===s);a&&!$i(a.value)&&l.push(a.value)}),l.join(n)||null}getValue(t={}){const{elementList:e,range:n}=this.control.mergeControl(t),{startIndex:i}=n,l=e[i],s=[];let a=i;for(;a>=0;){const d=e[a];if(!d||d.controlId!==l.controlId||d.controlComponent===r.ControlComponent.PREFIX||d.controlComponent===r.ControlComponent.PRE_TEXT)break;d.controlComponent===r.ControlComponent.VALUE&&s.unshift(d),a--}let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==l.controlId||d.controlComponent===r.ControlComponent.POSTFIX||d.controlComponent===r.ControlComponent.POST_TEXT)break;d.controlComponent===r.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:l}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=l,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s):this.control.removePlaceholder(s,{elementList:i});const d=i[s],u=d.type&&!te.includes(d.type)||d.controlComponent===r.ControlComponent.PREFIX||d.controlComponent===r.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...Jt]):qt(d,["type"]),R=l.startIndex+1;for(let h=0;h<t.length;h++){const g={...u,...t[h],controlComponent:r.ControlComponent.VALUE};wt(i,[g],s,{editorOptions:this.options}),c.spliceElementList(i,R+h,0,[g])}return R+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:l}=n,s=e[i],a=e[l],c=this.element.control?.selectExclusiveOptions?.inputAble;if(t.key===r.KeyMap.Backspace)return i!==l?c?(this.draw.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect():s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT||a.controlComponent===r.ControlComponent.POSTFIX||a.controlComponent===r.ControlComponent.POST_TEXT||s.controlComponent===r.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===r.KeyMap.Delete){if(i!==l)return c?(this.draw.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect();{const d=e[l+1];return(s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT)&&d.controlComponent===r.ControlComponent.PLACEHOLDER||d.controlComponent===r.ControlComponent.POSTFIX||d.controlComponent===r.ControlComponent.POST_TEXT||s.controlComponent===r.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 l}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 l=t.elementList||this.control.getElementList(),{startIndex:s}=t.range||this.control.getRange(),a=l[s];let c=-1,d=-1,u=s;for(;u>0;){const g=l[u];if(g.controlId!==a.controlId||g.controlComponent===r.ControlComponent.PREFIX||g.controlComponent===r.ControlComponent.PRE_TEXT){c=u;break}u--}let R=s+1;for(;R<l.length;){const g=l[R];if(g.controlId!==a.controlId||g.controlComponent===r.ControlComponent.POSTFIX||g.controlComponent===r.ControlComponent.POST_TEXT){d=R-1;break}R++}return!~c||!~d?-1:(this.control.getDraw().spliceElementList(l,c+1,d-c,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(u,t),this.control.setControlProperties({code:void 0},{elementList:l,range:{startIndex:u,endIndex:u}}),u)}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const i=e.elementList||this.control.getElementList(),l=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)||[],u=s.isMultiSelect;if(!u&&t===c||u&&Bi(d,a)){this.control.repaintControl({curIndex:l.startIndex,isCompute:!1,isSubmitHistory:!1}),this.destroy();return}const R=s.valueSets;if(!Array.isArray(R)||!R.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],T=g?Dt(g,ge):Dt(i[l.startIndex],Jt),f=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~f)return;c||this.control.removePlaceholder(f,e);const m=qt(i[f],ge),p=f+1,C=Tt(h),I=this.control.getDraw();for(let P=0;P<C.length;P++){const M={...T,...m,type:r.ElementType.TEXT,value:C[P],controlComponent:r.ControlComponent.VALUE};(M.color===this.options.control.bracketColor||M.color===this.options.control.placeholderColor)&&(M.color=this.options.defaultColor),wt(i,[M],f,{editorOptions:this.options}),I.spliceElementList(i,p+P,0,[M])}if(this.control.setControlProperties({code:t},{elementList:i,range:{startIndex:f,endIndex:f}}),!e.range){const P=p+C.length-1;this.control.repaintControl({curIndex:P}),this.control.emitControlContentChange({context:e}),u||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(`${q}-select-control-popup`),i.setAttribute(he,r.EditorComponent.POPUP);const l=document.createElement("ul");let s=null;for(let h=0;h<e.length;h++){const g=e[h],T=document.createElement("li");let f=this.getCodes();f.includes(g.code)&&(T.classList.add("active"),s=T),T.onclick=()=>{const m=f.findIndex(p=>p===g.code);t.isMultiSelect?~m?f.splice(m,1):f.push(g.code):~m?f=[]:f=[g.code],this.setSelect(f.join(this.VALUE_DELIMITER))},T.append(document.createTextNode(g.value)),l.append(T)}i.append(l);const{coordinate:{leftTop:[a,c]},lineHeight:d}=n,u=this.control.getPreY();i.style.left=`${a}px`,i.style.top=`${c+u+d}px`,this.control.getContainer().append(i),this.selectDom=i,s&&ji(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===r.ControlComponent.PREFIX||n.controlComponent===r.ControlComponent.PRE_TEXT||n.controlComponent===r.ControlComponent.POSTFIX||n.controlComponent===r.ControlComponent.POST_TEXT||n.controlComponent===r.ControlComponent.PLACEHOLDER;!this.control.getIsRangeWithinControl()&&!i||(this._createSelectPopupDom(),this.isPopup=!0)}destroy(){this.isPopup&&(this.selectDom?.remove(),this.isPopup=!1)}}var Vs;function ot(){return Vs.apply(null,arguments)}function vc(o){Vs=o}function ce(o){return o instanceof Array||Object.prototype.toString.call(o)==="[object Array]"}function Be(o){return o!=null&&Object.prototype.toString.call(o)==="[object Object]"}function Pt(o,t){return Object.prototype.hasOwnProperty.call(o,t)}function si(o){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(o).length===0;var t;for(t in o)if(Pt(o,t))return!1;return!0}function zt(o){return o===void 0}function Xe(o){return typeof o=="number"||Object.prototype.toString.call(o)==="[object Number]"}function Nn(o){return o instanceof Date||Object.prototype.toString.call(o)==="[object Date]"}function Ds(o,t){var e=[],n,i=o.length;for(n=0;n<i;++n)e.push(t(o[n],n));return e}function ve(o,t){for(var e in t)Pt(t,e)&&(o[e]=t[e]);return Pt(t,"toString")&&(o.toString=t.toString),Pt(t,"valueOf")&&(o.valueOf=t.valueOf),o}function Le(o,t,e,n){return lr(o,t,e,n,!0).utc()}function Kc(){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 ft(o){return o._pf==null&&(o._pf=Kc()),o._pf}var ri;Array.prototype.some?ri=Array.prototype.some:ri=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 li(o){var t=null,e=!1,n=o._d&&!isNaN(o._d.getTime());if(n&&(t=ft(o),e=ri.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 eo(o){var t=Le(NaN);return o!=null?ve(ft(t),o):ft(t).userInvalidated=!0,t}var Ys=ot.momentProperties=[],ai=!1;function ci(o,t){var e,n,i,l=Ys.length;if(zt(t._isAMomentObject)||(o._isAMomentObject=t._isAMomentObject),zt(t._i)||(o._i=t._i),zt(t._f)||(o._f=t._f),zt(t._l)||(o._l=t._l),zt(t._strict)||(o._strict=t._strict),zt(t._tzm)||(o._tzm=t._tzm),zt(t._isUTC)||(o._isUTC=t._isUTC),zt(t._offset)||(o._offset=t._offset),zt(t._pf)||(o._pf=ft(t)),zt(t._locale)||(o._locale=t._locale),l>0)for(e=0;e<l;e++)n=Ys[e],i=t[n],zt(i)||(o[n]=i);return o}function Fn(o){ci(this,o),this._d=new Date(o._d!=null?o._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),ai===!1&&(ai=!0,ot.updateOffset(this),ai=!1)}function de(o){return o instanceof Fn||o!=null&&o._isAMomentObject!=null}function Us(o){ot.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+o)}function ie(o,t){var e=!0;return ve(function(){if(ot.deprecationHandler!=null&&ot.deprecationHandler(null,o),e){var n=[],i,l,s,a=arguments.length;for(l=0;l<a;l++){if(i="",typeof arguments[l]=="object"){i+=`
|
|
107
|
+
[`+l+"] ";for(s in arguments[0])Pt(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[l];n.push(i)}Us(o+`
|
|
103
108
|
Arguments: `+Array.prototype.slice.call(n).join("")+`
|
|
104
|
-
`+new Error().stack),e=!1}return t.apply(this,arguments)},t)}var Is={};function Ps(o,t){j.deprecationHandler!=null&&j.deprecationHandler(o,t),Is[o]||(Ls(t),Is[o]=!0)}j.suppressDeprecationWarnings=!1,j.deprecationHandler=null;function Le(o){return typeof Function<"u"&&o instanceof Function||Object.prototype.toString.call(o)==="[object Function]"}function Mc(o){var t,e;for(e in o)Ot(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 zo(o,t){var e=we({},o),n;for(n in t)Ot(t,n)&&(Ae(o[n])&&Ae(t[n])?(e[n]={},we(e[n],o[n]),we(e[n],t[n])):t[n]!=null?e[n]=t[n]:delete e[n]);for(n in o)Ot(o,n)&&!Ot(t,n)&&Ae(o[n])&&(e[n]=we({},e[n]));return e}function jo(o){o!=null&&this.set(o)}var qo;Object.keys?qo=Object.keys:qo=function(o){var t,e=[];for(t in o)Ot(o,t)&&e.push(t);return e};var Oc={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Cc(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 ti=/(\[[^\[]*\])|(\\)?([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,kn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ei={},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 Sc(o){return o.match(/\[[\s\S]/)?o.replace(/^\[|\]$/g,""):o.replace(/\\/g,"")}function Ec(o){var t=o.match(ti),e,n;for(e=0,n=t.length;e<n;e++)cn[t[e]]?t[e]=cn[t[e]]:t[e]=Sc(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 Jn(o,t){return o.isValid()?(t=Ms(t,o.localeData()),ei[t]=ei[t]||Ec(t),ei[t](o)):o.localeData().invalidDate()}function Ms(o,t){var e=5;function n(i){return t.longDateFormat(i)||i}for(kn.lastIndex=0;e>=0&&kn.test(o);)o=o.replace(kn,n),kn.lastIndex=0,e-=1;return o}var Xc={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 Nc(o){var t=this._longDateFormat[o],e=this._longDateFormat[o.toUpperCase()];return t||!e?t:(this._longDateFormat[o]=e.match(ti).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[o])}var Fc="Invalid date";function yc(){return this._invalidDate}var bc="%d",Wc=/\d{1,2}/;function Vc(o){return this._ordinal.replace("%d",o)}var Yc={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 Dc(o,t,e,n){var i=this._relativeTime[e];return Le(i)?i(o,t,e,n):i.replace(/%d/i,o)}function Uc(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 ne(o){return typeof o=="string"?Os[o]||Os[o.toLowerCase()]:void 0}function ni(o){var t={},e,n;for(n in o)Ot(o,n)&&(e=ne(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 Zc(o){var t=[],e;for(e in o)Ot(o,e)&&t.push({unit:e,priority:wc[e]});return t.sort(function(n,i){return n.priority-i.priority}),t}var Cs=/\d/,jt=/\d\d/,Ss=/\d{3}/,oi=/\d{4}/,Bn=/[+-]?\d{6}/,Nt=/\d\d?/,Es=/\d\d\d\d?/,Xs=/\d\d\d\d\d\d?/,$n=/\d{1,3}/,ii=/\d{1,4}/,zn=/[+-]?\d{1,6}/,dn=/\d+/,jn=/[+-]?\d+/,Qc=/Z|[+-]\d\d:?\d\d/gi,qn=/Z|[+-]\d\d(?::?\d\d)?/gi,vc=/[+-]?\d+(\.\d{1,3})?/,Sn=/[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,un=/^[1-9]\d?/,si=/^([1-9]\d|\d)/,to;to={};function it(o,t,e){to[o]=Le(t)?t:function(n,i){return n&&e?e:t}}function Kc(o,t){return Ot(to,o)?to[o](t._strict,t._locale):new RegExp(Hc(o))}function Hc(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 oe(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=oe(t)),e}var ri={};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++)ri[o[e]]=n}function En(o,t){Et(o,function(e,n,i,r){i._w=i._w||{},t(e,i._w,i,r)})}function _c(o,t,e){t!=null&&Ot(ri,o)&&ri[o](t,e._a,e,o)}function eo(o){return o%4===0&&o%100!==0||o%400===0}var Gt=0,Se=1,Pe=2,Kt=3,ae=4,Ee=5,ke=6,xc=7,Gc=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"),it("Y",jn),it("YY",Nt,jt),it("YYYY",ii,oi),it("YYYYY",zn,Bn),it("YYYYYY",zn,Bn),Et(["YYYYY","YYYYYY"],Gt),Et("YYYY",function(o,t){t[Gt]=o.length===2?j.parseTwoDigitYear(o):ft(o)}),Et("YY",function(o,t){t[Gt]=j.parseTwoDigitYear(o)}),Et("Y",function(o,t){t[Gt]=parseInt(o,10)});function Xn(o){return eo(o)?366:365}j.parseTwoDigitYear=function(o){return ft(o)+(ft(o)>68?1900:2e3)};var Ns=Rn("FullYear",!0);function Ac(){return eo(this.year())}function Rn(o,t){return function(e){return e!=null?(Fs(this,o,e),j.updateOffset(this,t),this):Nn(this,o)}}function Nn(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&&!eo(r)?28:a,i?n.setUTCFullYear(r,s,a):n.setFullYear(r,s,a)}}function kc(o){return o=ne(o),Le(this[o])?this[o]():this}function Jc(o,t){if(typeof o=="object"){o=ni(o);var e=Zc(o),n,i=e.length;for(n=0;n<i;n++)this[e[n].unit](o[e[n].unit])}else if(o=ne(o),Le(this[o]))return this[o](t);return this}function Bc(o,t){return(o%t+t)%t}var Zt;Array.prototype.indexOf?Zt=Array.prototype.indexOf:Zt=function(o){var t;for(t=0;t<this.length;++t)if(this[t]===o)return t;return-1};function li(o,t){if(isNaN(o)||isNaN(t))return NaN;var e=Bc(t,12);return o+=(t-e)/12,e===1?eo(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)}),it("M",Nt,un),it("MM",Nt,jt),it("MMM",function(o,t){return t.monthsShortRegex(o)}),it("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 $c="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?/,zc=Sn,jc=Sn;function qc(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 td(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 ed(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=Zt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Zt.call(this._longMonthsParse,s),i!==-1?i:null):t==="MMM"?(i=Zt.call(this._shortMonthsParse,s),i!==-1?i:(i=Zt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Zt.call(this._longMonthsParse,s),i!==-1?i:(i=Zt.call(this._shortMonthsParse,s),i!==-1?i:null))}function nd(o,t,e){var n,i,r;if(this._monthsParseExact)return ed.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,li(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),j.updateOffset(this,!0),this):Nn(this,"Month")}function od(){return li(this.year(),this.month())}function id(o){return this._monthsParseExact?(Ot(this,"_monthsRegex")||Ys.call(this),o?this._monthsShortStrictRegex:this._monthsShortRegex):(Ot(this,"_monthsShortRegex")||(this._monthsShortRegex=zc),this._monthsShortStrictRegex&&o?this._monthsShortStrictRegex:this._monthsShortRegex)}function sd(o){return this._monthsParseExact?(Ot(this,"_monthsRegex")||Ys.call(this),o?this._monthsStrictRegex:this._monthsRegex):(Ot(this,"_monthsRegex")||(this._monthsRegex=jc),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 rd(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 Fn(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 no(o,t,e){var n=7+t-e,i=(7+Fn(o,0,n).getUTCDay()-t)%7;return-i+n-1}function Ds(o,t,e,n,i){var r=(7+e-n)%7,s=no(o,n,i),a=1+7*(t-1)+r+s,c,d;return a<=0?(c=o-1,d=Xn(c)+a):a>Xn(o)?(c=o+1,d=a-Xn(o)):(c=o,d=a),{year:c,dayOfYear:d}}function yn(o,t,e){var n=no(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=no(o,t,e),i=no(o+1,t,e);return(Xn(o)-n+i)/7}rt("w",["ww",2],"wo","week"),rt("W",["WW",2],"Wo","isoWeek"),it("w",Nt,un),it("ww",Nt,jt),it("W",Nt,un),it("WW",Nt,jt),En(["w","ww","W","WW"],function(o,t,e,n){t[n.substr(0,1)]=ft(o)});function ld(o){return yn(o,this._week.dow,this._week.doy).week}var ad={dow:0,doy:6};function cd(){return this._week.dow}function dd(){return this._week.doy}function ud(o){var t=this.localeData().week(this);return o==null?t:this.add((o-t)*7,"d")}function Rd(o){var t=yn(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"),it("d",Nt),it("e",Nt),it("E",Nt),it("dd",function(o,t){return t.weekdaysMinRegex(o)}),it("ddd",function(o,t){return t.weekdaysShortRegex(o)}),it("dddd",function(o,t){return t.weekdaysRegex(o)}),En(["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}),En(["d","e","E"],function(o,t,e,n){t[n]=ft(o)});function hd(o,t){return typeof o!="string"?o:isNaN(o)?(o=t.weekdaysParse(o),typeof o=="number"?o:null):parseInt(o,10)}function gd(o,t){return typeof o=="string"?t.weekdaysParse(o)%7||7:isNaN(o)?null:o}function ai(o,t){return o.slice(t,7).concat(o.slice(0,t))}var fd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Us="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Td="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),md=Sn,pd=Sn,Ld=Sn;function Id(o,t){var e=re(this._weekdays)?this._weekdays:this._weekdays[o&&o!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return o===!0?ai(e,this._week.dow):o?e[o.day()]:e}function Pd(o){return o===!0?ai(this._weekdaysShort,this._week.dow):o?this._weekdaysShort[o.day()]:this._weekdaysShort}function Md(o){return o===!0?ai(this._weekdaysMin,this._week.dow):o?this._weekdaysMin[o.day()]:this._weekdaysMin}function Od(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=Zt.call(this._weekdaysParse,s),i!==-1?i:null):t==="ddd"?(i=Zt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Zt.call(this._minWeekdaysParse,s),i!==-1?i:null):t==="dddd"?(i=Zt.call(this._weekdaysParse,s),i!==-1||(i=Zt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Zt.call(this._minWeekdaysParse,s),i!==-1?i:null)):t==="ddd"?(i=Zt.call(this._shortWeekdaysParse,s),i!==-1||(i=Zt.call(this._weekdaysParse,s),i!==-1)?i:(i=Zt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Zt.call(this._minWeekdaysParse,s),i!==-1||(i=Zt.call(this._weekdaysParse,s),i!==-1)?i:(i=Zt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function Cd(o,t,e){var n,i,r;if(this._weekdaysParseExact)return Od.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 Sd(o){if(!this.isValid())return o!=null?this:NaN;var t=Nn(this,"Day");return o!=null?(o=hd(o,this.localeData()),this.add(o-t,"d")):t}function Ed(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 Xd(o){if(!this.isValid())return o!=null?this:NaN;if(o!=null){var t=gd(o,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Nd(o){return this._weekdaysParseExact?(Ot(this,"_weekdaysRegex")||ci.call(this),o?this._weekdaysStrictRegex:this._weekdaysRegex):(Ot(this,"_weekdaysRegex")||(this._weekdaysRegex=md),this._weekdaysStrictRegex&&o?this._weekdaysStrictRegex:this._weekdaysRegex)}function Fd(o){return this._weekdaysParseExact?(Ot(this,"_weekdaysRegex")||ci.call(this),o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Ot(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=pd),this._weekdaysShortStrictRegex&&o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function yd(o){return this._weekdaysParseExact?(Ot(this,"_weekdaysRegex")||ci.call(this),o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Ot(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ld),this._weekdaysMinStrictRegex&&o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ci(){function o(u,R){return R.length-u.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 di(){return this.hours()%12||12}function bd(){return this.hours()||24}rt("H",["HH",2],0,"hour"),rt("h",["hh",2],0,di),rt("k",["kk",2],0,bd),rt("hmm",0,0,function(){return""+di.apply(this)+Ie(this.minutes(),2)}),rt("hmmss",0,0,function(){return""+di.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}it("a",Zs),it("A",Zs),it("H",Nt,si),it("h",Nt,un),it("k",Nt,un),it("HH",Nt,jt),it("hh",Nt,jt),it("kk",Nt,jt),it("hmm",Es),it("hmmss",Xs),it("Hmm",Es),it("Hmmss",Xs),Et(["H","HH"],Kt),Et(["k","kk"],function(o,t,e){var n=ft(o);t[Kt]=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[Kt]=ft(o),Rt(e).bigHour=!0}),Et("hmm",function(o,t,e){var n=o.length-2;t[Kt]=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[Kt]=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[Kt]=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[Kt]=ft(o.substr(0,n)),t[ae]=ft(o.substr(n,2)),t[Ee]=ft(o.substr(i))});function Wd(o){return(o+"").toLowerCase().charAt(0)==="p"}var Vd=/[ap]\.?m?\.?/i,Yd=Rn("Hours",!0);function Dd(o,t,e){return o>11?e?"pm":"PM":e?"am":"AM"}var Qs={calendar:Oc,longDateFormat:Xc,invalidDate:Fc,ordinal:bc,dayOfMonthOrdinalParse:Wc,relativeTime:Yc,months:$c,monthsShort:ys,week:ad,weekdays:fd,weekdaysMin:Td,weekdaysShort:Us,meridiemParse:Vd},Wt={},bn={},Wn;function Ud(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 wd(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=oo(r.slice(0,e).join("-")),i)return i;if(n&&n.length>=e&&Ud(r,n)>=e-1)break;e--}t++}return Wn}function Zd(o){return!!(o&&o.match("^[^/\\\\]*$"))}function oo(o){var t=null,e;if(Wt[o]===void 0&&typeof module<"u"&&module&&module.exports&&Zd(o))try{t=Wn._abbr,e=require,e("./locale/"+o),Ze(t)}catch{Wt[o]=null}return Wt[o]}function Ze(o,t){var e;return o&&(Jt(t)?e=Ne(o):e=ui(o,t),e?Wn=e:typeof console<"u"&&console.warn&&console.warn("Locale "+o+" not found. Did you forget to load it?")),Wn._abbr}function ui(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=oo(t.parentLocale),e!=null)n=e._config;else return bn[t.parentLocale]||(bn[t.parentLocale]=[]),bn[t.parentLocale].push({name:o,config:t}),null;return Wt[o]=new jo(zo(n,t)),bn[o]&&bn[o].forEach(function(i){ui(i.name,i.config)}),Ze(o),Wt[o]}else return delete Wt[o],null}function Qd(o,t){if(t!=null){var e,n,i=Qs;Wt[o]!=null&&Wt[o].parentLocale!=null?Wt[o].set(zo(Wt[o]._config,t)):(n=oo(o),n!=null&&(i=n._config),t=zo(i,t),n==null&&(t.abbr=o),e=new jo(t),e.parentLocale=Wt[o],Wt[o]=e),Ze(o)}else Wt[o]!=null&&(Wt[o].parentLocale!=null?(Wt[o]=Wt[o].parentLocale,o===Ze()&&Ze(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 Wn;if(!re(o)){if(t=oo(o),t)return t;o=[o]}return wd(o)}function vd(){return qo(Wt)}function Ri(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]>li(e[Gt],e[Se])?Pe:e[Kt]<0||e[Kt]>24||e[Kt]===24&&(e[ae]!==0||e[Ee]!==0||e[ke]!==0)?Kt: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<Gt||t>Pe)&&(t=Pe),Rt(o)._overflowWeeks&&t===-1&&(t=xc),Rt(o)._overflowWeekday&&t===-1&&(t=Gc),Rt(o).overflow=t),o}var Kd=/^\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)?)?$/,Hd=/^\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)?)?$/,_d=/Z|[+-]\d\d(?::?\d\d)?/,io=[["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]],hi=[["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/]],xd=/^\/?Date\((-?\d+)/i,Gd=/^(?:(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}))$/,Ad={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=Kd.exec(n)||Hd.exec(n),r,s,a,c,d=io.length,u=hi.length;if(i){for(Rt(o).iso=!0,t=0,e=d;t<e;t++)if(io[t][1].exec(i[1])){s=io[t][0],r=io[t][2]!==!1;break}if(s==null){o._isValid=!1;return}if(i[3]){for(t=0,e=u;t<e;t++)if(hi[t][1].exec(i[3])){a=(i[2]||" ")+hi[t][0];break}if(a==null){o._isValid=!1;return}}if(!r&&a!=null){o._isValid=!1;return}if(i[4])if(_d.exec(i[4]))c="Z";else{o._isValid=!1;return}o._f=s+(a||"")+(c||""),fi(o)}else o._isValid=!1}function kd(o,t,e,n,i,r){var s=[Jd(o),ys.indexOf(t),parseInt(e,10),parseInt(n,10),parseInt(i,10)];return r&&s.push(parseInt(r,10)),s}function Jd(o){var t=parseInt(o,10);return t<=49?2e3+t:t<=999?1900+t:t}function Bd(o){return o.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function $d(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 zd(o,t,e){if(o)return Ad[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=Gd.exec(Bd(o._i)),e;if(t){if(e=kd(t[4],t[3],t[2],t[5],t[6],t[7]),!$d(t[1],e,o))return;o._a=e,o._tzm=zd(t[8],t[9],t[10]),o._d=Fn.apply(null,o._a),o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),Rt(o).rfc2822=!0}else o._isValid=!1}function jd(o){var t=xd.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:j.createFromInputFallback(o)}j.createFromInputFallback=ee("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 qd(o){var t=new Date(j.now());return o._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function gi(o){var t,e,n=[],i,r,s;if(!o._d){for(i=qd(o),o._w&&o._a[Pe]==null&&o._a[Se]==null&&tu(o),o._dayOfYear!=null&&(s=hn(o._a[Gt],i[Gt]),(o._dayOfYear>Xn(s)||o._dayOfYear===0)&&(Rt(o)._overflowDayOfYear=!0),e=Fn(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[Kt]===24&&o._a[ae]===0&&o._a[Ee]===0&&o._a[ke]===0&&(o._nextDay=!0,o._a[Kt]=0),o._d=(o._useUTC?Fn:rd).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[Kt]=24),o._w&&typeof o._w.d<"u"&&o._w.d!==r&&(Rt(o).weekdayMismatch=!0)}}function tu(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[Gt],yn(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=yn(Ft(),r,s),e=hn(t.gg,o._a[Gt],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[Gt]=a.year,o._dayOfYear=a.dayOfYear)}j.ISO_8601=function(){},j.RFC_2822=function(){};function fi(o){if(o._f===j.ISO_8601){Ks(o);return}if(o._f===j.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,u;for(i=Ms(o._f,o._locale).match(ti)||[],u=i.length,e=0;e<u;e++)r=i[e],n=(t.match(Kc(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),_c(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[Kt]<=12&&Rt(o).bigHour===!0&&o._a[Kt]>0&&(Rt(o).bigHour=void 0),Rt(o).parsedDateParts=o._a.slice(0),Rt(o).meridiem=o._meridiem,o._a[Kt]=eu(o._locale,o._a[Kt],o._meridiem),d=Rt(o).era,d!==null&&(o._a[Gt]=o._locale.erasConvertYear(d,o._a[Gt])),gi(o),Ri(o)}function eu(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 nu(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=$o({},o),o._useUTC!=null&&(t._useUTC=o._useUTC),t._f=o._f[i],fi(t),Jo(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));we(o,e||t)}function ou(o){if(!o._d){var t=ni(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)}),gi(o)}}function iu(o){var t=new Cn(Ri(_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===""?An({nullInput:!0}):(typeof t=="string"&&(o._i=t=o._locale.preparse(t)),le(t)?new Cn(Ri(t)):(On(t)?o._d=t:re(e)?nu(o):e?fi(o):su(o),Jo(o)||(o._d=null),o))}function su(o){var t=o._i;Jt(t)?o._d=new Date(j.now()):On(t)?o._d=new Date(t.valueOf()):typeof t=="string"?jd(o):re(t)?(o._a=ms(t.slice(0),function(e){return parseInt(e,10)}),gi(o)):Ae(t)?ou(o):Oe(t)?o._d=new Date(t):j.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)&&Ao(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,iu(r)}function Ft(o,t,e,n){return xs(o,t,e,n,!1)}var ru=ee("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:An()}),lu=ee("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:An()});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 au(){var o=[].slice.call(arguments,0);return Gs("isBefore",o)}function cu(){var o=[].slice.call(arguments,0);return Gs("isAfter",o)}var du=function(){return Date.now?Date.now():+new Date},Vn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function uu(o){var t,e=!1,n,i=Vn.length;for(t in o)if(Ot(o,t)&&!(Zt.call(Vn,t)!==-1&&(o[t]==null||!isNaN(o[t]))))return!1;for(n=0;n<i;++n)if(o[Vn[n]]){if(e)return!1;parseFloat(o[Vn[n]])!==ft(o[Vn[n]])&&(e=!0)}return!0}function Ru(){return this._isValid}function hu(){return ce(NaN)}function so(o){var t=ni(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,u=t.millisecond||0;this._isValid=uu(t),this._milliseconds=+u+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 ro(o){return o instanceof so}function Ti(o){return o<0?Math.round(-1*o)*-1:Math.round(o)}function gu(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",""),it("Z",qn),it("ZZ",qn),Et(["Z","ZZ"],function(o,t,e){e._useUTC=!0,e._tzm=mi(qn,o)});var fu=/([\+\-]|\d\d)/gi;function mi(o,t){var e=(t||"").match(o),n,i,r;return e===null?null:(n=e[e.length-1]||[],i=(n+"").match(fu)||["-",0,0],r=+(i[1]*60)+ft(i[2]),r===0?0:i[0]==="+"?r:-r)}function pi(o,t){var e,n;return t._isUTC?(e=t.clone(),n=(le(o)||On(o)?o.valueOf():Ft(o).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+n),j.updateOffset(e,!1),e):Ft(o).local()}function Li(o){return-Math.round(o._d.getTimezoneOffset())}j.updateOffset=function(){};function Tu(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=mi(qn,o),o===null)return this}else Math.abs(o)<16&&!e&&(o=o*60);return!this._isUTC&&t&&(i=Li(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,j.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:Li(this)}function mu(o,t){return o!=null?(typeof o!="string"&&(o=-o),this.utcOffset(o,t),this):-this.utcOffset()}function pu(o){return this.utcOffset(0,o)}function Lu(o){return this._isUTC&&(this.utcOffset(0,o),this._isUTC=!1,o&&this.subtract(Li(this),"m")),this}function Iu(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var o=mi(Qc,this._i);o!=null?this.utcOffset(o):this.utcOffset(0,!0)}return this}function Pu(o){return this.isValid()?(o=o?Ft(o).utcOffset():0,(this.utcOffset()-o)%60===0):!1}function Mu(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ou(){if(!Jt(this._isDSTShifted))return this._isDSTShifted;var o={},t;return $o(o,this),o=_s(o),o._a?(t=o._isUTC?pe(o._a):Ft(o._a),this._isDSTShifted=this.isValid()&&gu(o._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Cu(){return this.isValid()?!this._isUTC:!1}function Su(){return this.isValid()?this._isUTC:!1}function ks(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Eu=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Xu=/^(-|\+)?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 ro(o)?e={ms:o._milliseconds,d:o._days,M:o._months}:Oe(o)||!isNaN(+o)?(e={},t?e[t]=+o:e.milliseconds=+o):(n=Eu.exec(o))?(i=n[1]==="-"?-1:1,e={y:0,d:ft(n[Pe])*i,h:ft(n[Kt])*i,m:ft(n[ae])*i,s:ft(n[Ee])*i,ms:ft(Ti(n[ke]*1e3))*i}):(n=Xu.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=Nu(Ft(e.from),Ft(e.to)),e={},e.ms=s.milliseconds,e.M=s.months),r=new so(e),ro(o)&&Ot(o,"_locale")&&(r._locale=o._locale),ro(o)&&Ot(o,"_isValid")&&(r._isValid=o._isValid),r}ce.fn=so.prototype,ce.invalid=hu;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 Nu(o,t){var e;return o.isValid()&&t.isValid()?(t=pi(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=Ti(t._days),s=Ti(t._months);o.isValid()&&(n=n??!0,s&&Ws(o,Nn(o,"Month")+s*e),r&&Fs(o,"Date",Nn(o,"Date")+r*e),i&&o._d.setTime(o._d.valueOf()+i*e),n&&j.updateOffset(o,r||s))}var Fu=Bs(1,"add"),yu=Bs(-1,"subtract");function zs(o){return typeof o=="string"||o instanceof String}function bu(o){return le(o)||On(o)||zs(o)||Oe(o)||Vu(o)||Wu(o)||o===null||o===void 0}function Wu(o){var t=Ae(o)&&!Ao(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||Ot(o,r);return t&&e}function Vu(o){var t=re(o),e=!1;return t&&(e=o.filter(function(n){return!Oe(n)&&zs(o)}).length===0),t&&e}function Yu(o){var t=Ae(o)&&!Ao(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||Ot(o,r);return t&&e}function Du(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 Uu(o,t){arguments.length===1&&(arguments[0]?bu(arguments[0])?(o=arguments[0],t=void 0):Yu(arguments[0])&&(t=arguments[0],o=void 0):(o=void 0,t=void 0));var e=o||Ft(),n=pi(e,this).startOf("day"),i=j.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 wu(){return new Cn(this)}function Zu(o,t){var e=le(o)?o:Ft(o);return this.isValid()&&e.isValid()?(t=ne(t)||"millisecond",t==="millisecond"?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf()):!1}function Qu(o,t){var e=le(o)?o:Ft(o);return this.isValid()&&e.isValid()?(t=ne(t)||"millisecond",t==="millisecond"?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf()):!1}function vu(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 Ku(o,t){var e=le(o)?o:Ft(o),n;return this.isValid()&&e.isValid()?(t=ne(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 Hu(o,t){return this.isSame(o,t)||this.isAfter(o,t)}function _u(o,t){return this.isSame(o,t)||this.isBefore(o,t)}function xu(o,t,e){var n,i,r;if(!this.isValid())return NaN;if(n=pi(o,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,t=ne(t),t){case"year":r=lo(this,n)/12;break;case"month":r=lo(this,n);break;case"quarter":r=lo(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:oe(r)}function lo(o,t){if(o.date()<t.date())return-lo(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}j.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",j.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Gu(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Au(o){if(!this.isValid())return null;var t=o!==!0,e=t?this.clone().utc():this;return e.year()<0||e.year()>9999?Jn(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",Jn(e,"Z")):Jn(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ku(){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 Ju(o){o||(o=this.isUtc()?j.defaultFormatUtc:j.defaultFormat);var t=Jn(this,o);return this.localeData().postformat(t)}function Bu(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 $u(o){return this.from(Ft(),o)}function zu(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 ju(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=ee("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 ao=1e3,gn=60*ao,co=60*gn,er=(365*400+97)*24*co;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 qu(o){var t,e;if(o=ne(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),co);break;case"minute":t=this._d.valueOf(),t-=fn(t,gn);break;case"second":t=this._d.valueOf(),t-=fn(t,ao);break}return this._d.setTime(t),j.updateOffset(this,!0),this}function tR(o){var t,e;if(o=ne(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+=co-fn(t+(this._isUTC?0:this.utcOffset()*gn),co)-1;break;case"minute":t=this._d.valueOf(),t+=gn-fn(t,gn)-1;break;case"second":t=this._d.valueOf(),t+=ao-fn(t,ao)-1;break}return this._d.setTime(t),j.updateOffset(this,!0),this}function eR(){return this._d.valueOf()-(this._offset||0)*6e4}function nR(){return Math.floor(this.valueOf()/1e3)}function oR(){return new Date(this.valueOf())}function iR(){var o=this;return[o.year(),o.month(),o.date(),o.hour(),o.minute(),o.second(),o.millisecond()]}function sR(){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 rR(){return this.isValid()?this.toISOString():null}function lR(){return Jo(this)}function aR(){return we({},Rt(this))}function cR(){return Rt(this).overflow}function dR(){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"),it("N",Ii),it("NN",Ii),it("NNN",Ii),it("NNNN",PR),it("NNNNN",MR),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}),it("y",dn),it("yy",dn),it("yyy",dn),it("yyyy",dn),it("yo",OR),Et(["y","yy","yyy","yyyy"],Gt),Et(["yo"],function(o,t,e,n){var i;e._locale._eraYearOrdinalRegex&&(i=o.match(e._locale._eraYearOrdinalRegex)),e._locale.eraYearOrdinalParse?t[Gt]=e._locale.eraYearOrdinalParse(o,i):t[Gt]=parseInt(o,10)});function uR(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=j(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=j(r[e].until).startOf("day").valueOf(),r[e].until=i.valueOf();break}return r}function RR(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 hR(o,t){var e=o.since<=o.until?1:-1;return t===void 0?j(o.since).year():j(o.since).year()+(t-o.offset)*e}function gR(){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 fR(){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 TR(){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 mR(){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()-j(i[o].since).year())*e+i[o].offset;return this.year()}function pR(o){return Ot(this,"_erasNameRegex")||Pi.call(this),o?this._erasNameRegex:this._erasRegex}function LR(o){return Ot(this,"_erasAbbrRegex")||Pi.call(this),o?this._erasAbbrRegex:this._erasRegex}function IR(o){return Ot(this,"_erasNarrowRegex")||Pi.call(this),o?this._erasNarrowRegex:this._erasRegex}function Ii(o,t){return t.erasAbbrRegex(o)}function PR(o,t){return t.erasNameRegex(o)}function MR(o,t){return t.erasNarrowRegex(o)}function OR(o,t){return t._eraYearOrdinalRegex||dn}function Pi(){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 uo(o,t){rt(0,[o,o.length],0,t)}uo("gggg","weekYear"),uo("ggggg","weekYear"),uo("GGGG","isoWeekYear"),uo("GGGGG","isoWeekYear"),it("G",jn),it("g",jn),it("GG",Nt,jt),it("gg",Nt,jt),it("GGGG",ii,oi),it("gggg",ii,oi),it("GGGGG",zn,Bn),it("ggggg",zn,Bn),En(["gggg","ggggg","GGGG","GGGGG"],function(o,t,e,n){t[n.substr(0,2)]=ft(o)}),En(["gg","GG"],function(o,t,e,n){t[n]=j.parseTwoDigitYear(o)});function CR(o){return ir.call(this,o,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function SR(o){return ir.call(this,o,this.isoWeek(),this.isoWeekday(),1,4)}function ER(){return Xe(this.year(),1,4)}function XR(){return Xe(this.isoWeekYear(),1,4)}function NR(){var o=this.localeData()._week;return Xe(this.year(),o.dow,o.doy)}function FR(){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?yn(this,n,i).year:(r=Xe(o,n,i),t>r&&(t=r),yR.call(this,o,t,e,n,i))}function yR(o,t,e,n,i){var r=Ds(o,t,e,n,i),s=Fn(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}rt("Q",0,"Qo","quarter"),it("Q",Cs),Et("Q",function(o,t){t[Se]=(ft(o)-1)*3});function bR(o){return o==null?Math.ceil((this.month()+1)/3):this.month((o-1)*3+this.month()%3)}rt("D",["DD",2],"Do","date"),it("D",Nt,un),it("DD",Nt,jt),it("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=Rn("Date",!0);rt("DDD",["DDDD",3],"DDDo","dayOfYear"),it("DDD",$n),it("DDDD",Ss),Et(["DDD","DDDD"],function(o,t,e){e._dayOfYear=ft(o)});function WR(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"),it("m",Nt,si),it("mm",Nt,jt),Et(["m","mm"],ae);var VR=Rn("Minutes",!1);rt("s",["ss",2],0,"second"),it("s",Nt,si),it("ss",Nt,jt),Et(["s","ss"],Ee);var YR=Rn("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}),it("S",$n,Cs),it("SS",$n,jt),it("SSS",$n,Ss);var Qe,rr;for(Qe="SSSS";Qe.length<=9;Qe+="S")it(Qe,dn);function DR(o,t){t[ke]=ft(("0."+o)*1e3)}for(Qe="S";Qe.length<=9;Qe+="S")Et(Qe,DR);rr=Rn("Milliseconds",!1),rt("z",0,0,"zoneAbbr"),rt("zz",0,0,"zoneName");function UR(){return this._isUTC?"UTC":""}function wR(){return this._isUTC?"Coordinated Universal Time":""}var k=Cn.prototype;k.add=Fu,k.calendar=Uu,k.clone=wu,k.diff=xu,k.endOf=tR,k.format=Ju,k.from=Bu,k.fromNow=$u,k.to=zu,k.toNow=ju,k.get=kc,k.invalidAt=cR,k.isAfter=Zu,k.isBefore=Qu,k.isBetween=vu,k.isSame=Ku,k.isSameOrAfter=Hu,k.isSameOrBefore=_u,k.isValid=lR,k.lang=qs,k.locale=js,k.localeData=tr,k.max=lu,k.min=ru,k.parsingFlags=aR,k.set=Jc,k.startOf=qu,k.subtract=yu,k.toArray=iR,k.toObject=sR,k.toDate=oR,k.toISOString=Au,k.inspect=ku,typeof Symbol<"u"&&Symbol.for!=null&&(k[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),k.toJSON=rR,k.toString=Gu,k.unix=nR,k.valueOf=eR,k.creationData=dR,k.eraName=gR,k.eraNarrow=fR,k.eraAbbr=TR,k.eraYear=mR,k.year=Ns,k.isLeapYear=Ac,k.weekYear=CR,k.isoWeekYear=SR,k.quarter=k.quarters=bR,k.month=Vs,k.daysInMonth=od,k.week=k.weeks=ud,k.isoWeek=k.isoWeeks=Rd,k.weeksInYear=NR,k.weeksInWeekYear=FR,k.isoWeeksInYear=ER,k.isoWeeksInISOWeekYear=XR,k.date=sr,k.day=k.days=Sd,k.weekday=Ed,k.isoWeekday=Xd,k.dayOfYear=WR,k.hour=k.hours=Yd,k.minute=k.minutes=VR,k.second=k.seconds=YR,k.millisecond=k.milliseconds=rr,k.utcOffset=Tu,k.utc=pu,k.local=Lu,k.parseZone=Iu,k.hasAlignedHourOffset=Pu,k.isDST=Mu,k.isLocal=Cu,k.isUtcOffset=Su,k.isUtc=ks,k.isUTC=ks,k.zoneAbbr=UR,k.zoneName=wR,k.dates=ee("dates accessor is deprecated. Use date instead.",sr),k.months=ee("months accessor is deprecated. Use month instead",Vs),k.years=ee("years accessor is deprecated. Use year instead",Ns),k.zone=ee("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mu),k.isDSTShifted=ee("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ou);function ZR(o){return Ft(o*1e3)}function QR(){return Ft.apply(null,arguments).parseZone()}function lr(o){return o}var Ct=jo.prototype;Ct.calendar=Cc,Ct.longDateFormat=Nc,Ct.invalidDate=yc,Ct.ordinal=Vc,Ct.preparse=lr,Ct.postformat=lr,Ct.relativeTime=Dc,Ct.pastFuture=Uc,Ct.set=Mc,Ct.eras=uR,Ct.erasParse=RR,Ct.erasConvertYear=hR,Ct.erasAbbrRegex=LR,Ct.erasNameRegex=pR,Ct.erasNarrowRegex=IR,Ct.months=qc,Ct.monthsShort=td,Ct.monthsParse=nd,Ct.monthsRegex=sd,Ct.monthsShortRegex=id,Ct.week=ld,Ct.firstDayOfYear=dd,Ct.firstDayOfWeek=cd,Ct.weekdays=Id,Ct.weekdaysMin=Md,Ct.weekdaysShort=Pd,Ct.weekdaysParse=Cd,Ct.weekdaysRegex=Nd,Ct.weekdaysShortRegex=Fd,Ct.weekdaysMinRegex=yd,Ct.isPM=Wd,Ct.meridiem=Dd;function Ro(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 Ro(o,t,e,"month");var n,i=[];for(n=0;n<12;n++)i[n]=Ro(o,n,e,"month");return i}function Mi(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 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 vR(o,t){return ar(o,t,"months")}function KR(o,t){return ar(o,t,"monthsShort")}function HR(o,t,e){return Mi(o,t,e,"weekdays")}function _R(o,t,e){return Mi(o,t,e,"weekdaysShort")}function xR(o,t,e){return Mi(o,t,e,"weekdaysMin")}Ze("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}}),j.lang=ee("moment.lang is deprecated. Use moment.locale instead.",Ze),j.langData=ee("moment.langData is deprecated. Use moment.localeData instead.",Ne);var Fe=Math.abs;function GR(){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 AR(o,t){return cr(this,o,t,1)}function kR(o,t){return cr(this,o,t,-1)}function dr(o){return o<0?Math.floor(o):Math.ceil(o)}function JR(){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(Oi(e)+t)*864e5,t=0,e=0),n.milliseconds=o%1e3,i=oe(o/1e3),n.seconds=i%60,r=oe(i/60),n.minutes=r%60,s=oe(r/60),n.hours=s%24,t+=oe(s/24),c=oe(ur(t)),e+=c,t-=dr(Oi(c)),a=oe(e/12),e%=12,n.days=t,n.months=e,n.years=a,this}function ur(o){return o*4800/146097}function Oi(o){return o*146097/4800}function BR(o){if(!this.isValid())return NaN;var t,e,n=this._milliseconds;if(o=ne(o),o==="month"||o==="quarter"||o==="year")switch(t=this._days+n/864e5,e=this._months+ur(t),o){case"month":return e;case"quarter":return e/3;case"year":return e/12}else switch(t=this._days+Math.round(Oi(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 Rr=ye("ms"),$R=ye("s"),zR=ye("m"),jR=ye("h"),qR=ye("d"),th=ye("w"),eh=ye("M"),nh=ye("Q"),oh=ye("y"),ih=Rr;function sh(){return ce(this)}function rh(o){return o=ne(o),this.isValid()?this[o+"s"]():NaN}function Be(o){return function(){return this.isValid()?this._data[o]:NaN}}var lh=Be("milliseconds"),ah=Be("seconds"),ch=Be("minutes"),dh=Be("hours"),uh=Be("days"),Rh=Be("months"),hh=Be("years");function gh(){return oe(this.days()/7)}var be=Math.round,Tn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function fh(o,t,e,n,i){return i.relativeTime(t||1,!!e,o,n)}function Th(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")),u=be(i.as("w")),R=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||u<=1&&["w"]||u<e.w&&["ww",u]),h=h||d<=1&&["M"]||d<e.M&&["MM",d]||R<=1&&["y"]||["yy",R],h[2]=t,h[3]=+o>0,h[4]=n,fh.apply(null,h)}function mh(o){return o===void 0?be:typeof o=="function"?(be=o,!0):!1}function ph(o,t){return Tn[o]===void 0?!1:t===void 0?Tn[o]:(Tn[o]=t,o==="s"&&(Tn.ss=t-1),!0)}function Lh(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=Th(this,!e,n,i),e&&(r=i.pastFuture(+this,r)),i.postformat(r)}var Ci=Math.abs;function mn(o){return(o>0)-(o<0)||+o}function ho(){if(!this.isValid())return this.localeData().invalidDate();var o=Ci(this._milliseconds)/1e3,t=Ci(this._days),e=Ci(this._months),n,i,r,s,a=this.asSeconds(),c,d,u,R;return a?(n=oe(o/60),i=oe(n/60),o%=60,n%=60,r=oe(e/12),e%=12,s=o?o.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",d=mn(this._months)!==mn(a)?"-":"",u=mn(this._days)!==mn(a)?"-":"",R=mn(this._milliseconds)!==mn(a)?"-":"",c+"P"+(r?d+r+"Y":"")+(e?d+e+"M":"")+(t?u+t+"D":"")+(i||n||o?"T":"")+(i?R+i+"H":"")+(n?R+n+"M":"")+(o?R+s+"S":"")):"P0D"}var It=so.prototype;It.isValid=Ru,It.abs=GR,It.add=AR,It.subtract=kR,It.as=BR,It.asMilliseconds=Rr,It.asSeconds=$R,It.asMinutes=zR,It.asHours=jR,It.asDays=qR,It.asWeeks=th,It.asMonths=eh,It.asQuarters=nh,It.asYears=oh,It.valueOf=ih,It._bubble=JR,It.clone=sh,It.get=rh,It.milliseconds=lh,It.seconds=ah,It.minutes=ch,It.hours=dh,It.days=uh,It.weeks=gh,It.months=Rh,It.years=hh,It.humanize=Lh,It.toISOString=ho,It.toString=ho,It.toJSON=ho,It.locale=js,It.localeData=tr,It.toIsoString=ee("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ho),It.lang=qs,rt("X",0,0,"unix"),rt("x",0,0,"valueOf"),it("x",jn),it("X",vc),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))});j.version="2.30.1",Ic(Ft),j.fn=k,j.min=au,j.max=cu,j.now=du,j.utc=pe,j.unix=ZR,j.months=vR,j.isDate=On,j.locale=Ze,j.invalid=An,j.duration=ce,j.isMoment=le,j.weekdays=HR,j.parseZone=QR,j.localeData=Ne,j.isDuration=ro,j.monthsShort=KR,j.weekdaysMin=xR,j.defineLocale=ui,j.updateLocale=Qd,j.locales=vd,j.weekdaysShort=_R,j.normalizeUnits=ne,j.relativeTimeRounding=mh,j.relativeTimeThreshold=ph,j.calendarFormat=Du,j.prototype=k,j.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 Si{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,u=n;for(;;){if(u<0&&c?.linkTdPrevId){const T=i.getTdById(c.linkTdPrevId);if(T){d=T.value,u=d.length-1,c=T;continue}}if(u<0)break;const f=d[u];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),u--}c=r;let R=e,h=n+1;for(;;){if(h>=R.length&&c?.linkTdNextId){const T=i.getTdById(c.linkTdNextId);if(T){R=T.value,h=0,c=T;continue}}const f=R[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],u=d.controlId;this._removeControlPlaceholders(i,s);const R=d.type&&!zt.includes(d.type)||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...At]):se(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;wt(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(),C=L.control?.value||[],S=L.control?.type===l.ControlType.TEXTFIELD,F={...R,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 X={...F,value:Y[W],controlComponent:N};m(X)}for(let W=0;W<C.length;W++){const X=C[W],O={...F,...X,controlComponent:l.ControlComponent.VALUE};(O.color===this.options.control.bracketColor||O.color===this.options.control.placeholderColor)&&(O.color=this.options.defaultColor),m(O)}if(C.length===0){const W=L.control?.placeholder||"";for(let X=0;X<W.length;X++){const O={...F,value:W[X],controlComponent:l.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};m(O)}}const E=S?L.control?.postTextFix||this.options.control.postTextFix:L.control?.postfix||this.options.control.postfix;for(let W=0;W<E.length;W++){const X={...F,value:E[W],controlComponent:V};m(X)}}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)&&(R.color=this.options.defaultColor);const P={...R,...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 R=e[i+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(i),i===0&&e[0].type===l.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i}else{const R=e[i+1];return R?.controlComponent===l.ControlComponent.POSTFIX||R?.controlComponent===l.ControlComponent.POST_TEXT||R?.controlComponent===l.ControlComponent.POSTTEXTFIX||R?.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 u=e[r+1],R=!!s.originControlId;if(this.options.mode===l.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&!R){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(u?.controlComponent===l.ControlComponent.POSTFIX||u?.controlComponent===l.ControlComponent.POST_TEXT||u?.controlComponent===l.ControlComponent.POSTTEXTFIX||u?.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=j(new Date).format("YYYY-MM-DD HH:mm:ss");if(s?.length){if(!this.element.strikeout){const d=s.findIndex(u=>!u.strikeout);s.forEach(u=>{u.deletePerson="SWJ",u.deleteTime=c,u.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],u=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 R=--a.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const g=R;this.draws.render({curIndex:g,isSetCursor:!0}),a.index=R,this.position.setCursorPosition(a),this.ranges.setRange(R,R)},100)}else n>=0&&n<u.length&&u[n]?.metrics?.width!==void 0&&u[n].metrics.width<=0&&!u[n]?.strikeout&&(setTimeout(()=>{u.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(ue,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:u,mon:R,tue:h,wed:g,thu:f,fri:T,sat:m}}=this.lang;[u,R,h,g,f,T,m].forEach(W=>{const X=document.createElement("span");X.innerText=`${W}`,d.append(X)});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,C,S;[this.lang.hour,this.lang.minute,this.lang.second].forEach((W,X)=>{const O=document.createElement("li"),M=document.createElement("span");M.innerText=W,O.append(M);const b=document.createElement("ol"),y=X===0,D=X===1,U=y?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}`),b.append(G)}y?P=b:D?C=b:S=b,O.append(b),L.append(O)});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 E=document.createElement("button");return E.classList.add(`${z}-date-menu__submit`),E.innerText=this.lang.confirm,N.append(V),N.append(Y),N.append(E),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:C,second:S},menu:{time:V,now:Y,submit:E}}}_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 u=this.dom.time.minute.previousElementSibling;u.innerText=this.lang.minute;const R=this.dom.time.second.previousElementSibling;R.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 R=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<=R;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-R;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(u=>{u.querySelectorAll("li").forEach(R=>R.classList.remove("active"))}),[[r,e],[s,n],[a,i]].forEach(([u,R])=>{const h=u.querySelector(`[data-id='${R}']`);h.classList.add("active"),t&&Qi(u,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(),u=t.getSeconds().toString(),R=t.getMilliseconds().toString(),h={"y+":i,"Y+":i,"M+":r,"d+":s,"D+":s,"h+":c.toString(),"H+":a.toString(),"m+":d,"s+":u,"S+":R};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 Yn{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],u=d.type&&!zt.includes(d.type)||d.controlComponent===l.ControlComponent.PREFIX||d.controlComponent===l.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...At]):se(d,["type"]),R=r.startIndex+1;for(let h=0;h<t.length;h++){const g={...u,...t[h],controlComponent:l.ControlComponent.VALUE};wt(i,[g],s,{editorOptions:this.options}),c.spliceElementList(i,R+h,0,[g])}return R+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],At),c=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~c)return;const d=se(i[c],Re),u=c+1,R=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),wt(i,[g],c,{editorOptions:this.options}),R.spliceElementList(i,u+h,0,[g])}if(!e.range){const h=u+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 Dn extends Si{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=>!jl(P)||xr.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 u=null;for(let P=a;P>=0;P--)if(i[P].controlComponent===l.ControlComponent.PREFIX){u=i[P];break}const R=u?.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 C=c+1;for(;C<i.length;){const S=i[C];if(S.controlId!==d.controlId||S.controlComponent===l.ControlComponent.POSTFIX||S.controlComponent===l.ControlComponent.POST_TEXT)break;s.push(S),C++}}const h=zi(s);if(Number.isNaN(Number(h))||!Number.isFinite(Number(h)))return-1;const g=R?.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,u=a?.decimalPlaces,R=a?.minLength,h=a?.maxLength;let g=t;u!=null&&(g=parseFloat(t.toFixed(u)));const f=g.toString(),T=f.replace(/[.-]/g,"").length;if(R!=null&&T<R||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,C=j(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=C),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?zi(c):"",u=s?.numberExclusiveOptions,R=u?.minValue,h=u?.maxValue,g=u?.decimalPlaces;this.inputPopup=new Ih({control:this.control,currentValue:d,minValue:R,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)},onTab:f=>{this.destroy(),setTimeout(()=>{this.control.initNextControl({direction:f})})},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 u=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||u?.controlComponent===l.ControlComponent.POSTFIX||u?.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 Ih{options;popupDom;constructor(t){this.options=t,this.popupDom=null}create(){const{currentValue:t,minValue:e,maxValue:n,decimalPlaces:i,onConfirm:r,onTab:s,onClose:a}=this.options,c=document.createElement("div");c.classList.add(`${z}-number-input-modal`),c.setAttribute(ue,l.EditorComponent.POPUP);const d=document.createElement("div");d.classList.add(`${z}-number-input-modal__content`);const u=document.createElement("div");if(u.classList.add(`${z}-number-input-modal__title`),u.textContent="请输入数值",d.appendChild(u),e!==void 0||n!==void 0){const I=document.createElement("div");I.classList.add(`${z}-number-input-modal__hint`);let L="有效范围:";e!==void 0&&n!==void 0?L+=`${e} ~ ${n}`:e!==void 0?L+=`≥ ${e}`:L+=`≤ ${n}`,i!=null&&(L+=`,保留${i}位小数`),I.textContent=L,d.appendChild(I)}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),d.appendChild(R);const h=document.createElement("div");h.classList.add(`${z}-number-input-modal__error`),h.style.display="none",d.appendChild(h);const g=document.createElement("div");g.classList.add(`${z}-number-input-modal__buttons`);const f=document.createElement("button");f.classList.add(`${z}-number-input-modal__cancel`),f.textContent="取消",f.onclick=()=>{a()},g.appendChild(f);const T=document.createElement("button");T.classList.add(`${z}-number-input-modal__confirm`),T.textContent="确定";const m=()=>{const I=R.value.trim();if(!I)return r("");const L=parseFloat(I);return Number.isNaN(L)||!Number.isFinite(L)?(h.textContent="请输入有效的数值",h.style.display="block",!1):i!=null&&(I.split(".")[1]||"").length>i?(h.textContent=`小数位数不能超过${i}位`,h.style.display="block",!1):e!==void 0&&L<e?(h.textContent=`数值不能小于 ${e}`,h.style.display="block",!1):n!==void 0&&L>n?(h.textContent=`数值不能大于 ${n}`,h.style.display="block",!1):(h.style.display="none",r(I))};T.onclick=()=>{m()&&a()},g.appendChild(T),d.appendChild(g),c.appendChild(d),R.onkeydown=I=>{I.key==="Enter"?T.click():I.key==="Tab"?(I.preventDefault(),m()&&(a(),s(I.shiftKey?Ut.UP:Ut.DOWN))):I.key==="Escape"&&a()},this.options.control.getContainer().appendChild(c),this.popupDom=c}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(ue,l.EditorComponent.COMPONENT),document.body.append(r);const s=document.createElement("div");s.classList.add("dialog-container"),s.setAttribute(ue,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 u=document.createElement("i");u.onclick=()=>{e&&e(),this._dispose()},c.append(d),c.append(u),a.append(c);const R=document.createElement("div");R.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 C=document.createElement("input");C.type="radio",C.name=m.name,C.value=L.value,L.value===(m.value||"")&&(C.checked=!0);const S=document.createElement("span");S.textContent=L.label,P.append(C),P.append(S),I.append(P),C.addEventListener("change",()=>{this._updateFieldVisibility()}),this.inputList.push(C)}),p.append(I)}else if(m.type==="select"){const I=document.createElement("select"),L=m.value||"";m.options?.forEach(P=>{const C=document.createElement("option");C.value=P.value,C.label=P.label,P.value===L&&(C.selected=!0),I.append(C)}),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)}R.append(p),this.optionItemContainers.push(p)}a.append(R);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 u=a;for(let p=a;p>=0;p--){const I=i[p];if(I.controlId!==d)break;if(I.controlComponent===l.ControlComponent.PREFIX){u=p;break}}let R=a;for(let p=a;p<i.length;p++){const I=i[p];if(I.controlId!==d){R=p;break}if(I.controlComponent===l.ControlComponent.POSTFIX){R=p;break}}const h=u+1,g=R-1;g>=h&&s.spliceElementList(i,h,g-h+1);const f=i[u],T=Dt(f,["control","controlId",...At]),m=u+1;for(let p=0;p<t.length;p++){const I={...T,...t[p],controlComponent:l.ControlComponent.VALUE};I.color="#fff",I.highlight="#1677FF",wt(i,[I],u,{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(ue,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((u,R)=>({value:u.trim(),code:String(R+1)})).filter(u=>u.value);if(d.length>0&&t[0]?.controlId){const u={controlId:t[0].controlId,element:[{...t[0],newButtonValue:d}]};this.draw.getCommand().executeButton(u)}}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 u=[];for(let h=0;h<s.length;h++)u.push({value:s[h],controlComponent:l.ControlComponent.VALUE});const R=this.setValue(u);R!==-1&&this.control.repaintControl({curIndex:R}),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,u=n;for(;;){if(u<0&&c?.linkTdPrevId){const T=i.getTdById(c.linkTdPrevId);if(T){d=T.value,u=d.length-1,c=T;continue}}if(u<0)break;const f=d[u];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),u--}c=r;let R=e,h=n+1;for(;;){if(h>=R.length&&c?.linkTdNextId){const T=i.getTdById(c.linkTdNextId);if(T){R=T.value,h=0,c=T;continue}}const f=R[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],u=i[s+1];let R=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)&&u?.controlId&&u.controlId!==d.controlId)if(u.controlComponent===l.ControlComponent.PREFIX||u.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)){R=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(u.controlComponent===l.ControlComponent.POSTFIX||u.controlComponent===l.ControlComponent.POSTTEXTFIX)&&(R=u.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)){R=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&&!zt.includes(d.type)||d.controlComponent===l.ControlComponent.PRETEXTFIX||d.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT?Dt(d,["control","controlId",...At]):se(d,["type"]);h&&(g.controlId=R,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;wt(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(),C=L.control?.value||[],S=L.control?.type===l.ControlType.TEXTFIELD,F={...g,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 X={...F,value:Y[W],controlComponent:N};m(X)}for(let W=0;W<C.length;W++){const X=C[W],O={...F,...X,controlComponent:l.ControlComponent.VALUE,type:X.type};(O.color===this.options.control.textFixColor||O.color===this.options.control.placeholderColor)&&(O.color=this.options.defaultColor),m(O)}if(C.length===0){const W=L.control?.placeholder||"";for(let X=0;X<W.length;X++){const O={...F,value:W[X],controlComponent:l.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};m(O)}}const E=S?L.control?.postTextFix||this.options.control.postTextFix:L.control?.postfix||this.options.control.postfix;for(let W=0;W<E.length;W++){const X={...F,value:E[W],controlComponent:V};m(X)}}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,C=this.draws.getPosition().getPositionList(),S=C[i],F=C[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(),u=e[a+1],R=!!c?.originControlId&&!!c?.controlId&&c.originControlId!==c.controlId,h=R&&(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=R&&c.control?.type===l.ControlType.BUTTON&&c.controlComponent===l.ControlComponent.VALUE,f=!!u?.originControlId&&!!u?.controlId&&u.originControlId!==u.controlId&&(u.controlComponent===l.ControlComponent.PREFIX||u.controlComponent===l.ControlComponent.PRE_TEXT||u.controlComponent===l.ControlComponent.PRETEXTFIX||u.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||u.controlComponent===l.ControlComponent.PLACEHOLDER||u.controlComponent===l.ControlComponent.TEXTFIXLABEL),T=!!u?.originControlId&&!!u?.controlId&&u.originControlId!==u.controlId&&u.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):(u||d.getTd()?.linkTdNextId&&c.controlId&&this.removeNextControlElement(c.controlId),u&&((c.controlComponent===l.ControlComponent.PRETEXTFIX||c.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT)&&(u.controlComponent===l.ControlComponent.PLACEHOLDER||u.controlComponent===l.ControlComponent.TEXTFIXLABEL)||u.controlComponent===l.ControlComponent.POSTTEXTFIX||u.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=j(new Date).format("YYYY-MM-DD HH:mm:ss");if(s?.length){if(!this.element.strikeout){const d=s.findIndex(u=>!u.strikeout);s.forEach(u=>{u.deletePerson="SWJ",u.deleteTime=c,u.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 u=--a.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const h=u;this.draws.render({curIndex:h,isSetCursor:!0}),a.index=u,this.position.setCursorPosition(a),this.ranges.setRange(u,u)},100)}else{const{elementList:u,range:R}=this.control.mergeControl(n),h=R.startIndex;if(h>=0&&h<u.length&&u[h]?.metrics?.width!==void 0&&u[h].metrics.width<=0&&!u[h]?.strikeout){this.draws.spliceElementList(u,R.startIndex,1,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule});const g=!0,f=R.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 Mh={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 u=a;for(let p=a;p>=0;p--){const I=i[p];if(I.controlId!==d)break;if(I.controlComponent===l.ControlComponent.PREFIX){u=p;break}}let R=a;for(let p=a;p<i.length;p++){const I=i[p];if(I.controlId!==d){R=p;break}if(I.controlComponent===l.ControlComponent.POSTFIX){R=p;break}}const h=u+1,g=R-1;g>=h&&s.spliceElementList(i,h,g-h+1);const f=i[u],T=Dt(f,["control","controlId",...At]),m=u+1;for(let p=0;p<t.length;p++){const I={...T,...t[p],value:t[p].value===`
|
|
105
|
-
`?
|
|
109
|
+
`+new Error().stack),e=!1}return t.apply(this,arguments)},t)}var ws={};function Zs(o,t){ot.deprecationHandler!=null&&ot.deprecationHandler(o,t),ws[o]||(Us(t),ws[o]=!0)}ot.suppressDeprecationWarnings=!1,ot.deprecationHandler=null;function Pe(o){return typeof Function<"u"&&o instanceof Function||Object.prototype.toString.call(o)==="[object Function]"}function Hc(o){var t,e;for(e in o)Pt(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 di(o,t){var e=ve({},o),n;for(n in t)Pt(t,n)&&(Be(o[n])&&Be(t[n])?(e[n]={},ve(e[n],o[n]),ve(e[n],t[n])):t[n]!=null?e[n]=t[n]:delete e[n]);for(n in o)Pt(o,n)&&!Pt(t,n)&&Be(o[n])&&(e[n]=ve({},e[n]));return e}function ui(o){o!=null&&this.set(o)}var Ri;Object.keys?Ri=Object.keys:Ri=function(o){var t,e=[];for(t in o)Pt(o,t)&&e.push(t);return e};var _c={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Ac(o,t,e){var n=this._calendar[o]||this._calendar.sameElse;return Pe(n)?n.call(t,e):n}function Me(o,t,e){var n=""+Math.abs(o),i=t-n.length,l=o>=0;return(l?e?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var hi=/(\[[^\[]*\])|(\\)?([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,no=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,gi={},gn={};function ut(o,t,e,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),o&&(gn[o]=i),t&&(gn[t[0]]=function(){return Me(i.apply(this,arguments),t[1],t[2])}),e&&(gn[e]=function(){return this.localeData().ordinal(i.apply(this,arguments),o)})}function Gc(o){return o.match(/\[[\s\S]/)?o.replace(/^\[|\]$/g,""):o.replace(/\\/g,"")}function xc(o){var t=o.match(hi),e,n;for(e=0,n=t.length;e<n;e++)gn[t[e]]?t[e]=gn[t[e]]:t[e]=Gc(t[e]);return function(i){var l="",s;for(s=0;s<n;s++)l+=Pe(t[s])?t[s].call(i,o):t[s];return l}}function oo(o,t){return o.isValid()?(t=Qs(t,o.localeData()),gi[t]=gi[t]||xc(t),gi[t](o)):o.localeData().invalidDate()}function Qs(o,t){var e=5;function n(i){return t.longDateFormat(i)||i}for(no.lastIndex=0;e>=0&&no.test(o);)o=o.replace(no,n),no.lastIndex=0,e-=1;return o}var kc={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 Jc(o){var t=this._longDateFormat[o],e=this._longDateFormat[o.toUpperCase()];return t||!e?t:(this._longDateFormat[o]=e.match(hi).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[o])}var Bc="Invalid date";function $c(){return this._invalidDate}var zc="%d",jc=/\d{1,2}/;function qc(o){return this._ordinal.replace("%d",o)}var td={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 ed(o,t,e,n){var i=this._relativeTime[e];return Pe(i)?i(o,t,e,n):i.replace(/%d/i,o)}function nd(o,t){var e=this._relativeTime[o>0?"future":"past"];return Pe(e)?e(t):e.replace(/%s/i,t)}var vs={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 se(o){return typeof o=="string"?vs[o]||vs[o.toLowerCase()]:void 0}function Ti(o){var t={},e,n;for(n in o)Pt(o,n)&&(e=se(n),e&&(t[e]=o[n]));return t}var od={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 id(o){var t=[],e;for(e in o)Pt(o,e)&&t.push({unit:e,priority:od[e]});return t.sort(function(n,i){return n.priority-i.priority}),t}var Ks=/\d/,ee=/\d\d/,Hs=/\d{3}/,fi=/\d{4}/,io=/[+-]?\d{6}/,bt=/\d\d?/,_s=/\d\d\d\d?/,As=/\d\d\d\d\d\d?/,so=/\d{1,3}/,mi=/\d{1,4}/,ro=/[+-]?\d{1,6}/,Tn=/\d+/,lo=/[+-]?\d+/,sd=/Z|[+-]\d\d:?\d\d/gi,ao=/Z|[+-]\d\d(?::?\d\d)?/gi,rd=/[+-]?\d+(\.\d{1,3})?/,yn=/[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,fn=/^[1-9]\d?/,pi=/^([1-9]\d|\d)/,co;co={};function lt(o,t,e){co[o]=Pe(t)?t:function(n,i){return n&&e?e:t}}function ld(o,t){return Pt(co,o)?co[o](t._strict,t._locale):new RegExp(ad(o))}function ad(o){return Ne(o.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,l){return e||n||i||l}))}function Ne(o){return o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function re(o){return o<0?Math.ceil(o)||0:Math.floor(o)}function pt(o){var t=+o,e=0;return t!==0&&isFinite(t)&&(e=re(t)),e}var Ii={};function Xt(o,t){var e,n=t,i;for(typeof o=="string"&&(o=[o]),Xe(t)&&(n=function(l,s){s[t]=pt(l)}),i=o.length,e=0;e<i;e++)Ii[o[e]]=n}function bn(o,t){Xt(o,function(e,n,i,l){i._w=i._w||{},t(e,i._w,i,l)})}function cd(o,t,e){t!=null&&Pt(Ii,o)&&Ii[o](t,e._a,e,o)}function uo(o){return o%4===0&&o%100!==0||o%400===0}var xt=0,Fe=1,Oe=2,Kt=3,ue=4,ye=5,$e=6,dd=7,ud=8;ut("Y",0,0,function(){var o=this.year();return o<=9999?Me(o,4):"+"+o}),ut(0,["YY",2],0,function(){return this.year()%100}),ut(0,["YYYY",4],0,"year"),ut(0,["YYYYY",5],0,"year"),ut(0,["YYYYYY",6,!0],0,"year"),lt("Y",lo),lt("YY",bt,ee),lt("YYYY",mi,fi),lt("YYYYY",ro,io),lt("YYYYYY",ro,io),Xt(["YYYYY","YYYYYY"],xt),Xt("YYYY",function(o,t){t[xt]=o.length===2?ot.parseTwoDigitYear(o):pt(o)}),Xt("YY",function(o,t){t[xt]=ot.parseTwoDigitYear(o)}),Xt("Y",function(o,t){t[xt]=parseInt(o,10)});function Wn(o){return uo(o)?366:365}ot.parseTwoDigitYear=function(o){return pt(o)+(pt(o)>68?1900:2e3)};var Gs=mn("FullYear",!0);function Rd(){return uo(this.year())}function mn(o,t){return function(e){return e!=null?(xs(this,o,e),ot.updateOffset(this,t),this):Vn(this,o)}}function Vn(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 xs(o,t,e){var n,i,l,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}l=e,s=o.month(),a=o.date(),a=a===29&&s===1&&!uo(l)?28:a,i?n.setUTCFullYear(l,s,a):n.setFullYear(l,s,a)}}function hd(o){return o=se(o),Pe(this[o])?this[o]():this}function gd(o,t){if(typeof o=="object"){o=Ti(o);var e=id(o),n,i=e.length;for(n=0;n<i;n++)this[e[n].unit](o[e[n].unit])}else if(o=se(o),Pe(this[o]))return this[o](t);return this}function Td(o,t){return(o%t+t)%t}var Zt;Array.prototype.indexOf?Zt=Array.prototype.indexOf:Zt=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=Td(t,12);return o+=(t-e)/12,e===1?uo(o)?29:28:31-e%7%2}ut("M",["MM",2],"Mo",function(){return this.month()+1}),ut("MMM",0,0,function(o){return this.localeData().monthsShort(this,o)}),ut("MMMM",0,0,function(o){return this.localeData().months(this,o)}),lt("M",bt,fn),lt("MM",bt,ee),lt("MMM",function(o,t){return t.monthsShortRegex(o)}),lt("MMMM",function(o,t){return t.monthsRegex(o)}),Xt(["M","MM"],function(o,t){t[Fe]=pt(o)-1}),Xt(["MMM","MMMM"],function(o,t,e,n){var i=e._locale.monthsParse(o,n,e._strict);i!=null?t[Fe]=i:ft(e).invalidMonth=o});var fd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ks="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Js=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,md=yn,pd=yn;function Id(o,t){return o?ce(this._months)?this._months[o.month()]:this._months[(this._months.isFormat||Js).test(t)?"format":"standalone"][o.month()]:ce(this._months)?this._months:this._months.standalone}function Cd(o,t){return o?ce(this._monthsShort)?this._monthsShort[o.month()]:this._monthsShort[Js.test(t)?"format":"standalone"][o.month()]:ce(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ld(o,t,e){var n,i,l,s=o.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)l=Le([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(l,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(l,"").toLocaleLowerCase();return e?t==="MMM"?(i=Zt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Zt.call(this._longMonthsParse,s),i!==-1?i:null):t==="MMM"?(i=Zt.call(this._shortMonthsParse,s),i!==-1?i:(i=Zt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Zt.call(this._longMonthsParse,s),i!==-1?i:(i=Zt.call(this._shortMonthsParse,s),i!==-1?i:null))}function Pd(o,t,e){var n,i,l;if(this._monthsParseExact)return Ld.call(this,o,t,e);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=Le([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]&&(l="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(l.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 Bs(o,t){if(!o.isValid())return o;if(typeof t=="string"){if(/^\d+$/.test(t))t=pt(t);else if(t=o.localeData().monthsParse(t),!Xe(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 $s(o){return o!=null?(Bs(this,o),ot.updateOffset(this,!0),this):Vn(this,"Month")}function Md(){return Ci(this.year(),this.month())}function Od(o){return this._monthsParseExact?(Pt(this,"_monthsRegex")||zs.call(this),o?this._monthsShortStrictRegex:this._monthsShortRegex):(Pt(this,"_monthsShortRegex")||(this._monthsShortRegex=md),this._monthsShortStrictRegex&&o?this._monthsShortStrictRegex:this._monthsShortRegex)}function Ed(o){return this._monthsParseExact?(Pt(this,"_monthsRegex")||zs.call(this),o?this._monthsStrictRegex:this._monthsRegex):(Pt(this,"_monthsRegex")||(this._monthsRegex=pd),this._monthsStrictRegex&&o?this._monthsStrictRegex:this._monthsRegex)}function zs(){function o(c,d){return d.length-c.length}var t=[],e=[],n=[],i,l,s,a;for(i=0;i<12;i++)l=Le([2e3,i]),s=Ne(this.monthsShort(l,"")),a=Ne(this.months(l,"")),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 Sd(o,t,e,n,i,l,s){var a;return o<100&&o>=0?(a=new Date(o+400,t,e,n,i,l,s),isFinite(a.getFullYear())&&a.setFullYear(o)):a=new Date(o,t,e,n,i,l,s),a}function Dn(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 Ro(o,t,e){var n=7+t-e,i=(7+Dn(o,0,n).getUTCDay()-t)%7;return-i+n-1}function js(o,t,e,n,i){var l=(7+e-n)%7,s=Ro(o,n,i),a=1+7*(t-1)+l+s,c,d;return a<=0?(c=o-1,d=Wn(c)+a):a>Wn(o)?(c=o+1,d=a-Wn(o)):(c=o,d=a),{year:c,dayOfYear:d}}function Yn(o,t,e){var n=Ro(o.year(),t,e),i=Math.floor((o.dayOfYear()-n-1)/7)+1,l,s;return i<1?(s=o.year()-1,l=i+be(s,t,e)):i>be(o.year(),t,e)?(l=i-be(o.year(),t,e),s=o.year()+1):(s=o.year(),l=i),{week:l,year:s}}function be(o,t,e){var n=Ro(o,t,e),i=Ro(o+1,t,e);return(Wn(o)-n+i)/7}ut("w",["ww",2],"wo","week"),ut("W",["WW",2],"Wo","isoWeek"),lt("w",bt,fn),lt("ww",bt,ee),lt("W",bt,fn),lt("WW",bt,ee),bn(["w","ww","W","WW"],function(o,t,e,n){t[n.substr(0,1)]=pt(o)});function Xd(o){return Yn(o,this._week.dow,this._week.doy).week}var Nd={dow:0,doy:6};function Fd(){return this._week.dow}function yd(){return this._week.doy}function bd(o){var t=this.localeData().week(this);return o==null?t:this.add((o-t)*7,"d")}function Wd(o){var t=Yn(this,1,4).week;return o==null?t:this.add((o-t)*7,"d")}ut("d",0,"do","day"),ut("dd",0,0,function(o){return this.localeData().weekdaysMin(this,o)}),ut("ddd",0,0,function(o){return this.localeData().weekdaysShort(this,o)}),ut("dddd",0,0,function(o){return this.localeData().weekdays(this,o)}),ut("e",0,0,"weekday"),ut("E",0,0,"isoWeekday"),lt("d",bt),lt("e",bt),lt("E",bt),lt("dd",function(o,t){return t.weekdaysMinRegex(o)}),lt("ddd",function(o,t){return t.weekdaysShortRegex(o)}),lt("dddd",function(o,t){return t.weekdaysRegex(o)}),bn(["dd","ddd","dddd"],function(o,t,e,n){var i=e._locale.weekdaysParse(o,n,e._strict);i!=null?t.d=i:ft(e).invalidWeekday=o}),bn(["d","e","E"],function(o,t,e,n){t[n]=pt(o)});function Vd(o,t){return typeof o!="string"?o:isNaN(o)?(o=t.weekdaysParse(o),typeof o=="number"?o:null):parseInt(o,10)}function Dd(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 Yd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),qs="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ud="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),wd=yn,Zd=yn,Qd=yn;function vd(o,t){var e=ce(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 Kd(o){return o===!0?Li(this._weekdaysShort,this._week.dow):o?this._weekdaysShort[o.day()]:this._weekdaysShort}function Hd(o){return o===!0?Li(this._weekdaysMin,this._week.dow):o?this._weekdaysMin[o.day()]:this._weekdaysMin}function _d(o,t,e){var n,i,l,s=o.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)l=Le([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(l,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(l,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(l,"").toLocaleLowerCase();return e?t==="dddd"?(i=Zt.call(this._weekdaysParse,s),i!==-1?i:null):t==="ddd"?(i=Zt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Zt.call(this._minWeekdaysParse,s),i!==-1?i:null):t==="dddd"?(i=Zt.call(this._weekdaysParse,s),i!==-1||(i=Zt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Zt.call(this._minWeekdaysParse,s),i!==-1?i:null)):t==="ddd"?(i=Zt.call(this._shortWeekdaysParse,s),i!==-1||(i=Zt.call(this._weekdaysParse,s),i!==-1)?i:(i=Zt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Zt.call(this._minWeekdaysParse,s),i!==-1||(i=Zt.call(this._weekdaysParse,s),i!==-1)?i:(i=Zt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function Ad(o,t,e){var n,i,l;if(this._weekdaysParseExact)return _d.call(this,o,t,e);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=Le([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]||(l="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(l.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 Gd(o){if(!this.isValid())return o!=null?this:NaN;var t=Vn(this,"Day");return o!=null?(o=Vd(o,this.localeData()),this.add(o-t,"d")):t}function xd(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 kd(o){if(!this.isValid())return o!=null?this:NaN;if(o!=null){var t=Dd(o,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Jd(o){return this._weekdaysParseExact?(Pt(this,"_weekdaysRegex")||Pi.call(this),o?this._weekdaysStrictRegex:this._weekdaysRegex):(Pt(this,"_weekdaysRegex")||(this._weekdaysRegex=wd),this._weekdaysStrictRegex&&o?this._weekdaysStrictRegex:this._weekdaysRegex)}function Bd(o){return this._weekdaysParseExact?(Pt(this,"_weekdaysRegex")||Pi.call(this),o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Pt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Zd),this._weekdaysShortStrictRegex&&o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function $d(o){return this._weekdaysParseExact?(Pt(this,"_weekdaysRegex")||Pi.call(this),o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Pt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Qd),this._weekdaysMinStrictRegex&&o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Pi(){function o(u,R){return R.length-u.length}var t=[],e=[],n=[],i=[],l,s,a,c,d;for(l=0;l<7;l++)s=Le([2e3,1]).day(l),a=Ne(this.weekdaysMin(s,"")),c=Ne(this.weekdaysShort(s,"")),d=Ne(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 Mi(){return this.hours()%12||12}function zd(){return this.hours()||24}ut("H",["HH",2],0,"hour"),ut("h",["hh",2],0,Mi),ut("k",["kk",2],0,zd),ut("hmm",0,0,function(){return""+Mi.apply(this)+Me(this.minutes(),2)}),ut("hmmss",0,0,function(){return""+Mi.apply(this)+Me(this.minutes(),2)+Me(this.seconds(),2)}),ut("Hmm",0,0,function(){return""+this.hours()+Me(this.minutes(),2)}),ut("Hmmss",0,0,function(){return""+this.hours()+Me(this.minutes(),2)+Me(this.seconds(),2)});function tr(o,t){ut(o,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}tr("a",!0),tr("A",!1);function er(o,t){return t._meridiemParse}lt("a",er),lt("A",er),lt("H",bt,pi),lt("h",bt,fn),lt("k",bt,fn),lt("HH",bt,ee),lt("hh",bt,ee),lt("kk",bt,ee),lt("hmm",_s),lt("hmmss",As),lt("Hmm",_s),lt("Hmmss",As),Xt(["H","HH"],Kt),Xt(["k","kk"],function(o,t,e){var n=pt(o);t[Kt]=n===24?0:n}),Xt(["a","A"],function(o,t,e){e._isPm=e._locale.isPM(o),e._meridiem=o}),Xt(["h","hh"],function(o,t,e){t[Kt]=pt(o),ft(e).bigHour=!0}),Xt("hmm",function(o,t,e){var n=o.length-2;t[Kt]=pt(o.substr(0,n)),t[ue]=pt(o.substr(n)),ft(e).bigHour=!0}),Xt("hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[Kt]=pt(o.substr(0,n)),t[ue]=pt(o.substr(n,2)),t[ye]=pt(o.substr(i)),ft(e).bigHour=!0}),Xt("Hmm",function(o,t,e){var n=o.length-2;t[Kt]=pt(o.substr(0,n)),t[ue]=pt(o.substr(n))}),Xt("Hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[Kt]=pt(o.substr(0,n)),t[ue]=pt(o.substr(n,2)),t[ye]=pt(o.substr(i))});function jd(o){return(o+"").toLowerCase().charAt(0)==="p"}var qd=/[ap]\.?m?\.?/i,tu=mn("Hours",!0);function eu(o,t,e){return o>11?e?"pm":"PM":e?"am":"AM"}var nr={calendar:_c,longDateFormat:kc,invalidDate:Bc,ordinal:zc,dayOfMonthOrdinalParse:jc,relativeTime:td,months:fd,monthsShort:ks,week:Nd,weekdays:Yd,weekdaysMin:Ud,weekdaysShort:qs,meridiemParse:qd},Vt={},Un={},wn;function nu(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 or(o){return o&&o.toLowerCase().replace("_","-")}function ou(o){for(var t=0,e,n,i,l;t<o.length;){for(l=or(o[t]).split("-"),e=l.length,n=or(o[t+1]),n=n?n.split("-"):null;e>0;){if(i=ho(l.slice(0,e).join("-")),i)return i;if(n&&n.length>=e&&nu(l,n)>=e-1)break;e--}t++}return wn}function iu(o){return!!(o&&o.match("^[^/\\\\]*$"))}function ho(o){var t=null,e;if(Vt[o]===void 0&&typeof module<"u"&&module&&module.exports&&iu(o))try{t=wn._abbr,e=require,e("./locale/"+o),Ke(t)}catch{Vt[o]=null}return Vt[o]}function Ke(o,t){var e;return o&&(zt(t)?e=We(o):e=Oi(o,t),e?wn=e:typeof console<"u"&&console.warn&&console.warn("Locale "+o+" not found. Did you forget to load it?")),wn._abbr}function Oi(o,t){if(t!==null){var e,n=nr;if(t.abbr=o,Vt[o]!=null)Zs("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=Vt[o]._config;else if(t.parentLocale!=null)if(Vt[t.parentLocale]!=null)n=Vt[t.parentLocale]._config;else if(e=ho(t.parentLocale),e!=null)n=e._config;else return Un[t.parentLocale]||(Un[t.parentLocale]=[]),Un[t.parentLocale].push({name:o,config:t}),null;return Vt[o]=new ui(di(n,t)),Un[o]&&Un[o].forEach(function(i){Oi(i.name,i.config)}),Ke(o),Vt[o]}else return delete Vt[o],null}function su(o,t){if(t!=null){var e,n,i=nr;Vt[o]!=null&&Vt[o].parentLocale!=null?Vt[o].set(di(Vt[o]._config,t)):(n=ho(o),n!=null&&(i=n._config),t=di(i,t),n==null&&(t.abbr=o),e=new ui(t),e.parentLocale=Vt[o],Vt[o]=e),Ke(o)}else Vt[o]!=null&&(Vt[o].parentLocale!=null?(Vt[o]=Vt[o].parentLocale,o===Ke()&&Ke(o)):Vt[o]!=null&&delete Vt[o]);return Vt[o]}function We(o){var t;if(o&&o._locale&&o._locale._abbr&&(o=o._locale._abbr),!o)return wn;if(!ce(o)){if(t=ho(o),t)return t;o=[o]}return ou(o)}function ru(){return Ri(Vt)}function Ei(o){var t,e=o._a;return e&&ft(o).overflow===-2&&(t=e[Fe]<0||e[Fe]>11?Fe:e[Oe]<1||e[Oe]>Ci(e[xt],e[Fe])?Oe:e[Kt]<0||e[Kt]>24||e[Kt]===24&&(e[ue]!==0||e[ye]!==0||e[$e]!==0)?Kt:e[ue]<0||e[ue]>59?ue:e[ye]<0||e[ye]>59?ye:e[$e]<0||e[$e]>999?$e:-1,ft(o)._overflowDayOfYear&&(t<xt||t>Oe)&&(t=Oe),ft(o)._overflowWeeks&&t===-1&&(t=dd),ft(o)._overflowWeekday&&t===-1&&(t=ud),ft(o).overflow=t),o}var lu=/^\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)?)?$/,au=/^\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)?)?$/,cu=/Z|[+-]\d\d(?::?\d\d)?/,go=[["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]],Si=[["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/]],du=/^\/?Date\((-?\d+)/i,uu=/^(?:(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}))$/,Ru={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ir(o){var t,e,n=o._i,i=lu.exec(n)||au.exec(n),l,s,a,c,d=go.length,u=Si.length;if(i){for(ft(o).iso=!0,t=0,e=d;t<e;t++)if(go[t][1].exec(i[1])){s=go[t][0],l=go[t][2]!==!1;break}if(s==null){o._isValid=!1;return}if(i[3]){for(t=0,e=u;t<e;t++)if(Si[t][1].exec(i[3])){a=(i[2]||" ")+Si[t][0];break}if(a==null){o._isValid=!1;return}}if(!l&&a!=null){o._isValid=!1;return}if(i[4])if(cu.exec(i[4]))c="Z";else{o._isValid=!1;return}o._f=s+(a||"")+(c||""),Ni(o)}else o._isValid=!1}function hu(o,t,e,n,i,l){var s=[gu(o),ks.indexOf(t),parseInt(e,10),parseInt(n,10),parseInt(i,10)];return l&&s.push(parseInt(l,10)),s}function gu(o){var t=parseInt(o,10);return t<=49?2e3+t:t<=999?1900+t:t}function Tu(o){return o.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function fu(o,t,e){if(o){var n=qs.indexOf(o),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return ft(e).weekdayMismatch=!0,e._isValid=!1,!1}return!0}function mu(o,t,e){if(o)return Ru[o];if(t)return 0;var n=parseInt(e,10),i=n%100,l=(n-i)/100;return l*60+i}function sr(o){var t=uu.exec(Tu(o._i)),e;if(t){if(e=hu(t[4],t[3],t[2],t[5],t[6],t[7]),!fu(t[1],e,o))return;o._a=e,o._tzm=mu(t[8],t[9],t[10]),o._d=Dn.apply(null,o._a),o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),ft(o).rfc2822=!0}else o._isValid=!1}function pu(o){var t=du.exec(o._i);if(t!==null){o._d=new Date(+t[1]);return}if(ir(o),o._isValid===!1)delete o._isValid;else return;if(sr(o),o._isValid===!1)delete o._isValid;else return;o._strict?o._isValid=!1:ot.createFromInputFallback(o)}ot.createFromInputFallback=ie("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 pn(o,t,e){return o??t??e}function Iu(o){var t=new Date(ot.now());return o._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Xi(o){var t,e,n=[],i,l,s;if(!o._d){for(i=Iu(o),o._w&&o._a[Oe]==null&&o._a[Fe]==null&&Cu(o),o._dayOfYear!=null&&(s=pn(o._a[xt],i[xt]),(o._dayOfYear>Wn(s)||o._dayOfYear===0)&&(ft(o)._overflowDayOfYear=!0),e=Dn(s,0,o._dayOfYear),o._a[Fe]=e.getUTCMonth(),o._a[Oe]=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[Kt]===24&&o._a[ue]===0&&o._a[ye]===0&&o._a[$e]===0&&(o._nextDay=!0,o._a[Kt]=0),o._d=(o._useUTC?Dn:Sd).apply(null,n),l=o._useUTC?o._d.getUTCDay():o._d.getDay(),o._tzm!=null&&o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),o._nextDay&&(o._a[Kt]=24),o._w&&typeof o._w.d<"u"&&o._w.d!==l&&(ft(o).weekdayMismatch=!0)}}function Cu(o){var t,e,n,i,l,s,a,c,d;t=o._w,t.GG!=null||t.W!=null||t.E!=null?(l=1,s=4,e=pn(t.GG,o._a[xt],Yn(Wt(),1,4).year),n=pn(t.W,1),i=pn(t.E,1),(i<1||i>7)&&(c=!0)):(l=o._locale._week.dow,s=o._locale._week.doy,d=Yn(Wt(),l,s),e=pn(t.gg,o._a[xt],d.year),n=pn(t.w,d.week),t.d!=null?(i=t.d,(i<0||i>6)&&(c=!0)):t.e!=null?(i=t.e+l,(t.e<0||t.e>6)&&(c=!0)):i=l),n<1||n>be(e,l,s)?ft(o)._overflowWeeks=!0:c!=null?ft(o)._overflowWeekday=!0:(a=js(e,n,i,l,s),o._a[xt]=a.year,o._dayOfYear=a.dayOfYear)}ot.ISO_8601=function(){},ot.RFC_2822=function(){};function Ni(o){if(o._f===ot.ISO_8601){ir(o);return}if(o._f===ot.RFC_2822){sr(o);return}o._a=[],ft(o).empty=!0;var t=""+o._i,e,n,i,l,s,a=t.length,c=0,d,u;for(i=Qs(o._f,o._locale).match(hi)||[],u=i.length,e=0;e<u;e++)l=i[e],n=(t.match(ld(l,o))||[])[0],n&&(s=t.substr(0,t.indexOf(n)),s.length>0&&ft(o).unusedInput.push(s),t=t.slice(t.indexOf(n)+n.length),c+=n.length),gn[l]?(n?ft(o).empty=!1:ft(o).unusedTokens.push(l),cd(l,n,o)):o._strict&&!n&&ft(o).unusedTokens.push(l);ft(o).charsLeftOver=a-c,t.length>0&&ft(o).unusedInput.push(t),o._a[Kt]<=12&&ft(o).bigHour===!0&&o._a[Kt]>0&&(ft(o).bigHour=void 0),ft(o).parsedDateParts=o._a.slice(0),ft(o).meridiem=o._meridiem,o._a[Kt]=Lu(o._locale,o._a[Kt],o._meridiem),d=ft(o).era,d!==null&&(o._a[xt]=o._locale.erasConvertYear(d,o._a[xt])),Xi(o),Ei(o)}function Lu(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 Pu(o){var t,e,n,i,l,s,a=!1,c=o._f.length;if(c===0){ft(o).invalidFormat=!0,o._d=new Date(NaN);return}for(i=0;i<c;i++)l=0,s=!1,t=ci({},o),o._useUTC!=null&&(t._useUTC=o._useUTC),t._f=o._f[i],Ni(t),li(t)&&(s=!0),l+=ft(t).charsLeftOver,l+=ft(t).unusedTokens.length*10,ft(t).score=l,a?l<n&&(n=l,e=t):(n==null||l<n||s)&&(n=l,e=t,s&&(a=!0));ve(o,e||t)}function Mu(o){if(!o._d){var t=Ti(o._i),e=t.day===void 0?t.date:t.day;o._a=Ds([t.year,t.month,e,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),Xi(o)}}function Ou(o){var t=new Fn(Ei(rr(o)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function rr(o){var t=o._i,e=o._f;return o._locale=o._locale||We(o._l),t===null||e===void 0&&t===""?eo({nullInput:!0}):(typeof t=="string"&&(o._i=t=o._locale.preparse(t)),de(t)?new Fn(Ei(t)):(Nn(t)?o._d=t:ce(e)?Pu(o):e?Ni(o):Eu(o),li(o)||(o._d=null),o))}function Eu(o){var t=o._i;zt(t)?o._d=new Date(ot.now()):Nn(t)?o._d=new Date(t.valueOf()):typeof t=="string"?pu(o):ce(t)?(o._a=Ds(t.slice(0),function(e){return parseInt(e,10)}),Xi(o)):Be(t)?Mu(o):Xe(t)?o._d=new Date(t):ot.createFromInputFallback(o)}function lr(o,t,e,n,i){var l={};return(t===!0||t===!1)&&(n=t,t=void 0),(e===!0||e===!1)&&(n=e,e=void 0),(Be(o)&&si(o)||ce(o)&&o.length===0)&&(o=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=i,l._l=e,l._i=o,l._f=t,l._strict=n,Ou(l)}function Wt(o,t,e,n){return lr(o,t,e,n,!1)}var Su=ie("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=Wt.apply(null,arguments);return this.isValid()&&o.isValid()?o<this?this:o:eo()}),Xu=ie("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=Wt.apply(null,arguments);return this.isValid()&&o.isValid()?o>this?this:o:eo()});function ar(o,t){var e,n;if(t.length===1&&ce(t[0])&&(t=t[0]),!t.length)return Wt();for(e=t[0],n=1;n<t.length;++n)(!t[n].isValid()||t[n][o](e))&&(e=t[n]);return e}function Nu(){var o=[].slice.call(arguments,0);return ar("isBefore",o)}function Fu(){var o=[].slice.call(arguments,0);return ar("isAfter",o)}var yu=function(){return Date.now?Date.now():+new Date},Zn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function bu(o){var t,e=!1,n,i=Zn.length;for(t in o)if(Pt(o,t)&&!(Zt.call(Zn,t)!==-1&&(o[t]==null||!isNaN(o[t]))))return!1;for(n=0;n<i;++n)if(o[Zn[n]]){if(e)return!1;parseFloat(o[Zn[n]])!==pt(o[Zn[n]])&&(e=!0)}return!0}function Wu(){return this._isValid}function Vu(){return Re(NaN)}function To(o){var t=Ti(o),e=t.year||0,n=t.quarter||0,i=t.month||0,l=t.week||t.isoWeek||0,s=t.day||0,a=t.hour||0,c=t.minute||0,d=t.second||0,u=t.millisecond||0;this._isValid=bu(t),this._milliseconds=+u+d*1e3+c*6e4+a*1e3*60*60,this._days=+s+l*7,this._months=+i+n*3+e*12,this._data={},this._locale=We(),this._bubble()}function fo(o){return o instanceof To}function Fi(o){return o<0?Math.round(-1*o)*-1:Math.round(o)}function Du(o,t,e){var n=Math.min(o.length,t.length),i=Math.abs(o.length-t.length),l=0,s;for(s=0;s<n;s++)pt(o[s])!==pt(t[s])&&l++;return l+i}function cr(o,t){ut(o,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+Me(~~(e/60),2)+t+Me(~~e%60,2)})}cr("Z",":"),cr("ZZ",""),lt("Z",ao),lt("ZZ",ao),Xt(["Z","ZZ"],function(o,t,e){e._useUTC=!0,e._tzm=yi(ao,o)});var Yu=/([\+\-]|\d\d)/gi;function yi(o,t){var e=(t||"").match(o),n,i,l;return e===null?null:(n=e[e.length-1]||[],i=(n+"").match(Yu)||["-",0,0],l=+(i[1]*60)+pt(i[2]),l===0?0:i[0]==="+"?l:-l)}function bi(o,t){var e,n;return t._isUTC?(e=t.clone(),n=(de(o)||Nn(o)?o.valueOf():Wt(o).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+n),ot.updateOffset(e,!1),e):Wt(o).local()}function Wi(o){return-Math.round(o._d.getTimezoneOffset())}ot.updateOffset=function(){};function Uu(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=yi(ao,o),o===null)return this}else Math.abs(o)<16&&!e&&(o=o*60);return!this._isUTC&&t&&(i=Wi(this)),this._offset=o,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==o&&(!t||this._changeInProgress?hr(this,Re(o-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,ot.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:Wi(this)}function wu(o,t){return o!=null?(typeof o!="string"&&(o=-o),this.utcOffset(o,t),this):-this.utcOffset()}function Zu(o){return this.utcOffset(0,o)}function Qu(o){return this._isUTC&&(this.utcOffset(0,o),this._isUTC=!1,o&&this.subtract(Wi(this),"m")),this}function vu(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var o=yi(sd,this._i);o!=null?this.utcOffset(o):this.utcOffset(0,!0)}return this}function Ku(o){return this.isValid()?(o=o?Wt(o).utcOffset():0,(this.utcOffset()-o)%60===0):!1}function Hu(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _u(){if(!zt(this._isDSTShifted))return this._isDSTShifted;var o={},t;return ci(o,this),o=rr(o),o._a?(t=o._isUTC?Le(o._a):Wt(o._a),this._isDSTShifted=this.isValid()&&Du(o._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Au(){return this.isValid()?!this._isUTC:!1}function Gu(){return this.isValid()?this._isUTC:!1}function dr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var xu=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ku=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Re(o,t){var e=o,n=null,i,l,s;return fo(o)?e={ms:o._milliseconds,d:o._days,M:o._months}:Xe(o)||!isNaN(+o)?(e={},t?e[t]=+o:e.milliseconds=+o):(n=xu.exec(o))?(i=n[1]==="-"?-1:1,e={y:0,d:pt(n[Oe])*i,h:pt(n[Kt])*i,m:pt(n[ue])*i,s:pt(n[ye])*i,ms:pt(Fi(n[$e]*1e3))*i}):(n=ku.exec(o))?(i=n[1]==="-"?-1:1,e={y:ze(n[2],i),M:ze(n[3],i),w:ze(n[4],i),d:ze(n[5],i),h:ze(n[6],i),m:ze(n[7],i),s:ze(n[8],i)}):e==null?e={}:typeof e=="object"&&("from"in e||"to"in e)&&(s=Ju(Wt(e.from),Wt(e.to)),e={},e.ms=s.milliseconds,e.M=s.months),l=new To(e),fo(o)&&Pt(o,"_locale")&&(l._locale=o._locale),fo(o)&&Pt(o,"_isValid")&&(l._isValid=o._isValid),l}Re.fn=To.prototype,Re.invalid=Vu;function ze(o,t){var e=o&&parseFloat(o.replace(",","."));return(isNaN(e)?0:e)*t}function ur(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 Ju(o,t){var e;return o.isValid()&&t.isValid()?(t=bi(t,o),o.isBefore(t)?e=ur(o,t):(e=ur(t,o),e.milliseconds=-e.milliseconds,e.months=-e.months),e):{milliseconds:0,months:0}}function Rr(o,t){return function(e,n){var i,l;return n!==null&&!isNaN(+n)&&(Zs(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."),l=e,e=n,n=l),i=Re(e,n),hr(this,i,o),this}}function hr(o,t,e,n){var i=t._milliseconds,l=Fi(t._days),s=Fi(t._months);o.isValid()&&(n=n??!0,s&&Bs(o,Vn(o,"Month")+s*e),l&&xs(o,"Date",Vn(o,"Date")+l*e),i&&o._d.setTime(o._d.valueOf()+i*e),n&&ot.updateOffset(o,l||s))}var Bu=Rr(1,"add"),$u=Rr(-1,"subtract");function gr(o){return typeof o=="string"||o instanceof String}function zu(o){return de(o)||Nn(o)||gr(o)||Xe(o)||qu(o)||ju(o)||o===null||o===void 0}function ju(o){var t=Be(o)&&!si(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,l,s=n.length;for(i=0;i<s;i+=1)l=n[i],e=e||Pt(o,l);return t&&e}function qu(o){var t=ce(o),e=!1;return t&&(e=o.filter(function(n){return!Xe(n)&&gr(o)}).length===0),t&&e}function tR(o){var t=Be(o)&&!si(o),e=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,l;for(i=0;i<n.length;i+=1)l=n[i],e=e||Pt(o,l);return t&&e}function eR(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 nR(o,t){arguments.length===1&&(arguments[0]?zu(arguments[0])?(o=arguments[0],t=void 0):tR(arguments[0])&&(t=arguments[0],o=void 0):(o=void 0,t=void 0));var e=o||Wt(),n=bi(e,this).startOf("day"),i=ot.calendarFormat(this,n)||"sameElse",l=t&&(Pe(t[i])?t[i].call(this,e):t[i]);return this.format(l||this.localeData().calendar(i,this,Wt(e)))}function oR(){return new Fn(this)}function iR(o,t){var e=de(o)?o:Wt(o);return this.isValid()&&e.isValid()?(t=se(t)||"millisecond",t==="millisecond"?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf()):!1}function sR(o,t){var e=de(o)?o:Wt(o);return this.isValid()&&e.isValid()?(t=se(t)||"millisecond",t==="millisecond"?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf()):!1}function rR(o,t,e,n){var i=de(o)?o:Wt(o),l=de(t)?t:Wt(t);return this.isValid()&&i.isValid()&&l.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,e):!this.isBefore(i,e))&&(n[1]===")"?this.isBefore(l,e):!this.isAfter(l,e))):!1}function lR(o,t){var e=de(o)?o:Wt(o),n;return this.isValid()&&e.isValid()?(t=se(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 aR(o,t){return this.isSame(o,t)||this.isAfter(o,t)}function cR(o,t){return this.isSame(o,t)||this.isBefore(o,t)}function dR(o,t,e){var n,i,l;if(!this.isValid())return NaN;if(n=bi(o,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,t=se(t),t){case"year":l=mo(this,n)/12;break;case"month":l=mo(this,n);break;case"quarter":l=mo(this,n)/3;break;case"second":l=(this-n)/1e3;break;case"minute":l=(this-n)/6e4;break;case"hour":l=(this-n)/36e5;break;case"day":l=(this-n-i)/864e5;break;case"week":l=(this-n-i)/6048e5;break;default:l=this-n}return e?l:re(l)}function mo(o,t){if(o.date()<t.date())return-mo(t,o);var e=(t.year()-o.year())*12+(t.month()-o.month()),n=o.clone().add(e,"months"),i,l;return t-n<0?(i=o.clone().add(e-1,"months"),l=(t-n)/(n-i)):(i=o.clone().add(e+1,"months"),l=(t-n)/(i-n)),-(e+l)||0}ot.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",ot.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function uR(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function RR(o){if(!this.isValid())return null;var t=o!==!0,e=t?this.clone().utc():this;return e.year()<0||e.year()>9999?oo(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",oo(e,"Z")):oo(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function hR(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var o="moment",t="",e,n,i,l;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",l=t+'[")]',this.format(e+n+i+l)}function gR(o){o||(o=this.isUtc()?ot.defaultFormatUtc:ot.defaultFormat);var t=oo(this,o);return this.localeData().postformat(t)}function TR(o,t){return this.isValid()&&(de(o)&&o.isValid()||Wt(o).isValid())?Re({to:this,from:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function fR(o){return this.from(Wt(),o)}function mR(o,t){return this.isValid()&&(de(o)&&o.isValid()||Wt(o).isValid())?Re({from:this,to:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function pR(o){return this.to(Wt(),o)}function Tr(o){var t;return o===void 0?this._locale._abbr:(t=We(o),t!=null&&(this._locale=t),this)}var fr=ie("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 mr(){return this._locale}var po=1e3,In=60*po,Io=60*In,pr=(365*400+97)*24*Io;function Cn(o,t){return(o%t+t)%t}function Ir(o,t,e){return o<100&&o>=0?new Date(o+400,t,e)-pr:new Date(o,t,e).valueOf()}function Cr(o,t,e){return o<100&&o>=0?Date.UTC(o+400,t,e)-pr:Date.UTC(o,t,e)}function IR(o){var t,e;if(o=se(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?Cr:Ir,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-=Cn(t+(this._isUTC?0:this.utcOffset()*In),Io);break;case"minute":t=this._d.valueOf(),t-=Cn(t,In);break;case"second":t=this._d.valueOf(),t-=Cn(t,po);break}return this._d.setTime(t),ot.updateOffset(this,!0),this}function CR(o){var t,e;if(o=se(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?Cr:Ir,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+=Io-Cn(t+(this._isUTC?0:this.utcOffset()*In),Io)-1;break;case"minute":t=this._d.valueOf(),t+=In-Cn(t,In)-1;break;case"second":t=this._d.valueOf(),t+=po-Cn(t,po)-1;break}return this._d.setTime(t),ot.updateOffset(this,!0),this}function LR(){return this._d.valueOf()-(this._offset||0)*6e4}function PR(){return Math.floor(this.valueOf()/1e3)}function MR(){return new Date(this.valueOf())}function OR(){var o=this;return[o.year(),o.month(),o.date(),o.hour(),o.minute(),o.second(),o.millisecond()]}function ER(){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 SR(){return this.isValid()?this.toISOString():null}function XR(){return li(this)}function NR(){return ve({},ft(this))}function FR(){return ft(this).overflow}function yR(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ut("N",0,0,"eraAbbr"),ut("NN",0,0,"eraAbbr"),ut("NNN",0,0,"eraAbbr"),ut("NNNN",0,0,"eraName"),ut("NNNNN",0,0,"eraNarrow"),ut("y",["y",1],"yo","eraYear"),ut("y",["yy",2],0,"eraYear"),ut("y",["yyy",3],0,"eraYear"),ut("y",["yyyy",4],0,"eraYear"),lt("N",Vi),lt("NN",Vi),lt("NNN",Vi),lt("NNNN",KR),lt("NNNNN",HR),Xt(["N","NN","NNN","NNNN","NNNNN"],function(o,t,e,n){var i=e._locale.erasParse(o,n,e._strict);i?ft(e).era=i:ft(e).invalidEra=o}),lt("y",Tn),lt("yy",Tn),lt("yyy",Tn),lt("yyyy",Tn),lt("yo",_R),Xt(["y","yy","yyy","yyyy"],xt),Xt(["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 bR(o,t){var e,n,i,l=this._eras||We("en")._eras;for(e=0,n=l.length;e<n;++e)switch(typeof l[e].since==="string"&&(i=ot(l[e].since).startOf("day"),l[e].since=i.valueOf()),typeof l[e].until){case"undefined":l[e].until=1/0;break;case"string":i=ot(l[e].until).startOf("day").valueOf(),l[e].until=i.valueOf();break}return l}function WR(o,t,e){var n,i,l=this.eras(),s,a,c;for(o=o.toUpperCase(),n=0,i=l.length;n<i;++n)if(s=l[n].name.toUpperCase(),a=l[n].abbr.toUpperCase(),c=l[n].narrow.toUpperCase(),e)switch(t){case"N":case"NN":case"NNN":if(a===o)return l[n];break;case"NNNN":if(s===o)return l[n];break;case"NNNNN":if(c===o)return l[n];break}else if([s,a,c].indexOf(o)>=0)return l[n]}function VR(o,t){var e=o.since<=o.until?1:-1;return t===void 0?ot(o.since).year():ot(o.since).year()+(t-o.offset)*e}function DR(){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 YR(){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 UR(){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 wR(){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()-ot(i[o].since).year())*e+i[o].offset;return this.year()}function ZR(o){return Pt(this,"_erasNameRegex")||Di.call(this),o?this._erasNameRegex:this._erasRegex}function QR(o){return Pt(this,"_erasAbbrRegex")||Di.call(this),o?this._erasAbbrRegex:this._erasRegex}function vR(o){return Pt(this,"_erasNarrowRegex")||Di.call(this),o?this._erasNarrowRegex:this._erasRegex}function Vi(o,t){return t.erasAbbrRegex(o)}function KR(o,t){return t.erasNameRegex(o)}function HR(o,t){return t.erasNarrowRegex(o)}function _R(o,t){return t._eraYearOrdinalRegex||Tn}function Di(){var o=[],t=[],e=[],n=[],i,l,s,a,c,d=this.eras();for(i=0,l=d.length;i<l;++i)s=Ne(d[i].name),a=Ne(d[i].abbr),c=Ne(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")}ut(0,["gg",2],0,function(){return this.weekYear()%100}),ut(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Co(o,t){ut(0,[o,o.length],0,t)}Co("gggg","weekYear"),Co("ggggg","weekYear"),Co("GGGG","isoWeekYear"),Co("GGGGG","isoWeekYear"),lt("G",lo),lt("g",lo),lt("GG",bt,ee),lt("gg",bt,ee),lt("GGGG",mi,fi),lt("gggg",mi,fi),lt("GGGGG",ro,io),lt("ggggg",ro,io),bn(["gggg","ggggg","GGGG","GGGGG"],function(o,t,e,n){t[n.substr(0,2)]=pt(o)}),bn(["gg","GG"],function(o,t,e,n){t[n]=ot.parseTwoDigitYear(o)});function AR(o){return Lr.call(this,o,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function GR(o){return Lr.call(this,o,this.isoWeek(),this.isoWeekday(),1,4)}function xR(){return be(this.year(),1,4)}function kR(){return be(this.isoWeekYear(),1,4)}function JR(){var o=this.localeData()._week;return be(this.year(),o.dow,o.doy)}function BR(){var o=this.localeData()._week;return be(this.weekYear(),o.dow,o.doy)}function Lr(o,t,e,n,i){var l;return o==null?Yn(this,n,i).year:(l=be(o,n,i),t>l&&(t=l),$R.call(this,o,t,e,n,i))}function $R(o,t,e,n,i){var l=js(o,t,e,n,i),s=Dn(l.year,0,l.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}ut("Q",0,"Qo","quarter"),lt("Q",Ks),Xt("Q",function(o,t){t[Fe]=(pt(o)-1)*3});function zR(o){return o==null?Math.ceil((this.month()+1)/3):this.month((o-1)*3+this.month()%3)}ut("D",["DD",2],"Do","date"),lt("D",bt,fn),lt("DD",bt,ee),lt("Do",function(o,t){return o?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Xt(["D","DD"],Oe),Xt("Do",function(o,t){t[Oe]=pt(o.match(bt)[0])});var Pr=mn("Date",!0);ut("DDD",["DDDD",3],"DDDo","dayOfYear"),lt("DDD",so),lt("DDDD",Hs),Xt(["DDD","DDDD"],function(o,t,e){e._dayOfYear=pt(o)});function jR(o){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return o==null?t:this.add(o-t,"d")}ut("m",["mm",2],0,"minute"),lt("m",bt,pi),lt("mm",bt,ee),Xt(["m","mm"],ue);var qR=mn("Minutes",!1);ut("s",["ss",2],0,"second"),lt("s",bt,pi),lt("ss",bt,ee),Xt(["s","ss"],ye);var th=mn("Seconds",!1);ut("S",0,0,function(){return~~(this.millisecond()/100)}),ut(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ut(0,["SSS",3],0,"millisecond"),ut(0,["SSSS",4],0,function(){return this.millisecond()*10}),ut(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ut(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ut(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ut(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ut(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),lt("S",so,Ks),lt("SS",so,ee),lt("SSS",so,Hs);var He,Mr;for(He="SSSS";He.length<=9;He+="S")lt(He,Tn);function eh(o,t){t[$e]=pt(("0."+o)*1e3)}for(He="S";He.length<=9;He+="S")Xt(He,eh);Mr=mn("Milliseconds",!1),ut("z",0,0,"zoneAbbr"),ut("zz",0,0,"zoneName");function nh(){return this._isUTC?"UTC":""}function oh(){return this._isUTC?"Coordinated Universal Time":""}var $=Fn.prototype;$.add=Bu,$.calendar=nR,$.clone=oR,$.diff=dR,$.endOf=CR,$.format=gR,$.from=TR,$.fromNow=fR,$.to=mR,$.toNow=pR,$.get=hd,$.invalidAt=FR,$.isAfter=iR,$.isBefore=sR,$.isBetween=rR,$.isSame=lR,$.isSameOrAfter=aR,$.isSameOrBefore=cR,$.isValid=XR,$.lang=fr,$.locale=Tr,$.localeData=mr,$.max=Xu,$.min=Su,$.parsingFlags=NR,$.set=gd,$.startOf=IR,$.subtract=$u,$.toArray=OR,$.toObject=ER,$.toDate=MR,$.toISOString=RR,$.inspect=hR,typeof Symbol<"u"&&Symbol.for!=null&&($[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),$.toJSON=SR,$.toString=uR,$.unix=PR,$.valueOf=LR,$.creationData=yR,$.eraName=DR,$.eraNarrow=YR,$.eraAbbr=UR,$.eraYear=wR,$.year=Gs,$.isLeapYear=Rd,$.weekYear=AR,$.isoWeekYear=GR,$.quarter=$.quarters=zR,$.month=$s,$.daysInMonth=Md,$.week=$.weeks=bd,$.isoWeek=$.isoWeeks=Wd,$.weeksInYear=JR,$.weeksInWeekYear=BR,$.isoWeeksInYear=xR,$.isoWeeksInISOWeekYear=kR,$.date=Pr,$.day=$.days=Gd,$.weekday=xd,$.isoWeekday=kd,$.dayOfYear=jR,$.hour=$.hours=tu,$.minute=$.minutes=qR,$.second=$.seconds=th,$.millisecond=$.milliseconds=Mr,$.utcOffset=Uu,$.utc=Zu,$.local=Qu,$.parseZone=vu,$.hasAlignedHourOffset=Ku,$.isDST=Hu,$.isLocal=Au,$.isUtcOffset=Gu,$.isUtc=dr,$.isUTC=dr,$.zoneAbbr=nh,$.zoneName=oh,$.dates=ie("dates accessor is deprecated. Use date instead.",Pr),$.months=ie("months accessor is deprecated. Use month instead",$s),$.years=ie("years accessor is deprecated. Use year instead",Gs),$.zone=ie("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",wu),$.isDSTShifted=ie("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_u);function ih(o){return Wt(o*1e3)}function sh(){return Wt.apply(null,arguments).parseZone()}function Or(o){return o}var Mt=ui.prototype;Mt.calendar=Ac,Mt.longDateFormat=Jc,Mt.invalidDate=$c,Mt.ordinal=qc,Mt.preparse=Or,Mt.postformat=Or,Mt.relativeTime=ed,Mt.pastFuture=nd,Mt.set=Hc,Mt.eras=bR,Mt.erasParse=WR,Mt.erasConvertYear=VR,Mt.erasAbbrRegex=QR,Mt.erasNameRegex=ZR,Mt.erasNarrowRegex=vR,Mt.months=Id,Mt.monthsShort=Cd,Mt.monthsParse=Pd,Mt.monthsRegex=Ed,Mt.monthsShortRegex=Od,Mt.week=Xd,Mt.firstDayOfYear=yd,Mt.firstDayOfWeek=Fd,Mt.weekdays=vd,Mt.weekdaysMin=Hd,Mt.weekdaysShort=Kd,Mt.weekdaysParse=Ad,Mt.weekdaysRegex=Jd,Mt.weekdaysShortRegex=Bd,Mt.weekdaysMinRegex=$d,Mt.isPM=jd,Mt.meridiem=eu;function Lo(o,t,e,n){var i=We(),l=Le().set(n,t);return i[e](l,o)}function Er(o,t,e){if(Xe(o)&&(t=o,o=void 0),o=o||"",t!=null)return Lo(o,t,e,"month");var n,i=[];for(n=0;n<12;n++)i[n]=Lo(o,n,e,"month");return i}function Yi(o,t,e,n){typeof o=="boolean"?(Xe(t)&&(e=t,t=void 0),t=t||""):(t=o,e=t,o=!1,Xe(t)&&(e=t,t=void 0),t=t||"");var i=We(),l=o?i._week.dow:0,s,a=[];if(e!=null)return Lo(t,(e+l)%7,n,"day");for(s=0;s<7;s++)a[s]=Lo(t,(s+l)%7,n,"day");return a}function rh(o,t){return Er(o,t,"months")}function lh(o,t){return Er(o,t,"monthsShort")}function ah(o,t,e){return Yi(o,t,e,"weekdays")}function ch(o,t,e){return Yi(o,t,e,"weekdaysShort")}function dh(o,t,e){return Yi(o,t,e,"weekdaysMin")}Ke("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=pt(o%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return o+e}}),ot.lang=ie("moment.lang is deprecated. Use moment.locale instead.",Ke),ot.langData=ie("moment.langData is deprecated. Use moment.localeData instead.",We);var Ve=Math.abs;function uh(){var o=this._data;return this._milliseconds=Ve(this._milliseconds),this._days=Ve(this._days),this._months=Ve(this._months),o.milliseconds=Ve(o.milliseconds),o.seconds=Ve(o.seconds),o.minutes=Ve(o.minutes),o.hours=Ve(o.hours),o.months=Ve(o.months),o.years=Ve(o.years),this}function Sr(o,t,e,n){var i=Re(t,e);return o._milliseconds+=n*i._milliseconds,o._days+=n*i._days,o._months+=n*i._months,o._bubble()}function Rh(o,t){return Sr(this,o,t,1)}function hh(o,t){return Sr(this,o,t,-1)}function Xr(o){return o<0?Math.floor(o):Math.ceil(o)}function gh(){var o=this._milliseconds,t=this._days,e=this._months,n=this._data,i,l,s,a,c;return o>=0&&t>=0&&e>=0||o<=0&&t<=0&&e<=0||(o+=Xr(Ui(e)+t)*864e5,t=0,e=0),n.milliseconds=o%1e3,i=re(o/1e3),n.seconds=i%60,l=re(i/60),n.minutes=l%60,s=re(l/60),n.hours=s%24,t+=re(s/24),c=re(Nr(t)),e+=c,t-=Xr(Ui(c)),a=re(e/12),e%=12,n.days=t,n.months=e,n.years=a,this}function Nr(o){return o*4800/146097}function Ui(o){return o*146097/4800}function Th(o){if(!this.isValid())return NaN;var t,e,n=this._milliseconds;if(o=se(o),o==="month"||o==="quarter"||o==="year")switch(t=this._days+n/864e5,e=this._months+Nr(t),o){case"month":return e;case"quarter":return e/3;case"year":return e/12}else switch(t=this._days+Math.round(Ui(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 De(o){return function(){return this.as(o)}}var Fr=De("ms"),fh=De("s"),mh=De("m"),ph=De("h"),Ih=De("d"),Ch=De("w"),Lh=De("M"),Ph=De("Q"),Mh=De("y"),Oh=Fr;function Eh(){return Re(this)}function Sh(o){return o=se(o),this.isValid()?this[o+"s"]():NaN}function je(o){return function(){return this.isValid()?this._data[o]:NaN}}var Xh=je("milliseconds"),Nh=je("seconds"),Fh=je("minutes"),yh=je("hours"),bh=je("days"),Wh=je("months"),Vh=je("years");function Dh(){return re(this.days()/7)}var Ye=Math.round,Ln={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Yh(o,t,e,n,i){return i.relativeTime(t||1,!!e,o,n)}function Uh(o,t,e,n){var i=Re(o).abs(),l=Ye(i.as("s")),s=Ye(i.as("m")),a=Ye(i.as("h")),c=Ye(i.as("d")),d=Ye(i.as("M")),u=Ye(i.as("w")),R=Ye(i.as("y")),h=l<=e.ss&&["s",l]||l<e.s&&["ss",l]||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||u<=1&&["w"]||u<e.w&&["ww",u]),h=h||d<=1&&["M"]||d<e.M&&["MM",d]||R<=1&&["y"]||["yy",R],h[2]=t,h[3]=+o>0,h[4]=n,Yh.apply(null,h)}function wh(o){return o===void 0?Ye:typeof o=="function"?(Ye=o,!0):!1}function Zh(o,t){return Ln[o]===void 0?!1:t===void 0?Ln[o]:(Ln[o]=t,o==="s"&&(Ln.ss=t-1),!0)}function Qh(o,t){if(!this.isValid())return this.localeData().invalidDate();var e=!1,n=Ln,i,l;return typeof o=="object"&&(t=o,o=!1),typeof o=="boolean"&&(e=o),typeof t=="object"&&(n=Object.assign({},Ln,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),i=this.localeData(),l=Uh(this,!e,n,i),e&&(l=i.pastFuture(+this,l)),i.postformat(l)}var wi=Math.abs;function Pn(o){return(o>0)-(o<0)||+o}function Po(){if(!this.isValid())return this.localeData().invalidDate();var o=wi(this._milliseconds)/1e3,t=wi(this._days),e=wi(this._months),n,i,l,s,a=this.asSeconds(),c,d,u,R;return a?(n=re(o/60),i=re(n/60),o%=60,n%=60,l=re(e/12),e%=12,s=o?o.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",d=Pn(this._months)!==Pn(a)?"-":"",u=Pn(this._days)!==Pn(a)?"-":"",R=Pn(this._milliseconds)!==Pn(a)?"-":"",c+"P"+(l?d+l+"Y":"")+(e?d+e+"M":"")+(t?u+t+"D":"")+(i||n||o?"T":"")+(i?R+i+"H":"")+(n?R+n+"M":"")+(o?R+s+"S":"")):"P0D"}var Lt=To.prototype;Lt.isValid=Wu,Lt.abs=uh,Lt.add=Rh,Lt.subtract=hh,Lt.as=Th,Lt.asMilliseconds=Fr,Lt.asSeconds=fh,Lt.asMinutes=mh,Lt.asHours=ph,Lt.asDays=Ih,Lt.asWeeks=Ch,Lt.asMonths=Lh,Lt.asQuarters=Ph,Lt.asYears=Mh,Lt.valueOf=Oh,Lt._bubble=gh,Lt.clone=Eh,Lt.get=Sh,Lt.milliseconds=Xh,Lt.seconds=Nh,Lt.minutes=Fh,Lt.hours=yh,Lt.days=bh,Lt.weeks=Dh,Lt.months=Wh,Lt.years=Vh,Lt.humanize=Qh,Lt.toISOString=Po,Lt.toString=Po,Lt.toJSON=Po,Lt.locale=Tr,Lt.localeData=mr,Lt.toIsoString=ie("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Po),Lt.lang=fr,ut("X",0,0,"unix"),ut("x",0,0,"valueOf"),lt("x",lo),lt("X",rd),Xt("X",function(o,t,e){e._d=new Date(parseFloat(o)*1e3)}),Xt("x",function(o,t,e){e._d=new Date(pt(o))});ot.version="2.30.1",vc(Wt),ot.fn=$,ot.min=Nu,ot.max=Fu,ot.now=yu,ot.utc=Le,ot.unix=ih,ot.months=rh,ot.isDate=Nn,ot.locale=Ke,ot.invalid=eo,ot.duration=Re,ot.isMoment=de,ot.weekdays=ah,ot.parseZone=sh,ot.localeData=We,ot.isDuration=fo,ot.monthsShort=lh,ot.weekdaysMin=dh,ot.defineLocale=Oi,ot.updateLocale=su,ot.locales=ru,ot.weekdaysShort=ch,ot.normalizeUnits=se,ot.relativeTimeRounding=wh,ot.relativeTimeThreshold=Zh,ot.calendarFormat=eR,ot.prototype=$,ot.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 Zi{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(),l=t?null:i.getTd();n>=e.length&&(n=e.length-1);const s=e[n],a=[];let c=l,d=e,u=n;for(;;){if(u<0&&c?.linkTdPrevId){const f=i.getTdById(c.linkTdPrevId);if(f){d=f.value,u=d.length-1,c=f;continue}}if(u<0)break;const T=d[u];if(T.controlId!==s.controlId||T.controlComponent===r.ControlComponent.PREFIX||T.controlComponent===r.ControlComponent.PRE_TEXT)break;T.controlComponent===r.ControlComponent.VALUE&&a.unshift(T),u--}c=l;let R=e,h=n+1;for(;;){if(h>=R.length&&c?.linkTdNextId){const f=i.getTdById(c.linkTdNextId);if(f){R=f.value,h=0,c=f;continue}}const T=R[h];if(!T||T.controlId!==s.controlId||T.controlComponent===r.ControlComponent.POSTFIX||T.controlComponent===r.ControlComponent.POST_TEXT)break;T.controlComponent===r.ControlComponent.VALUE&&a.push(T),h++}return a.filter(T=>T.type!==r.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 i=e.range||this.control.getRange(),l=e.elementList||this.control.getElementList(),s=l[i.startIndex],a=this.element.controlId||s?.controlId,c=this.element.originControlId||s?.originControlId,d=!!a&&s?.controlId!==a&&this._findNearestTextAncestorId(l,s?.originControlId)===a;d||(this.control.mergeControl(e),this.control.shrinkBoundary(e));const{startIndex:u,endIndex:R}=i,h=this.control.getDraw();u!==R?h.spliceElementList(l,u+1,R-u,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):d?this._removePlaceholdersByControl(l,a,c||null):this.control.removePlaceholder(u,{elementList:l});const g=l[u],T=this.element.control||g.control;d?this._removePlaceholdersByControl(l,a,c||null):this._removeControlPlaceholders(l,u);const f=g.type&&!te.includes(g.type)||g.controlComponent===r.ControlComponent.PREFIX||g.controlComponent===r.ControlComponent.PRE_TEXT?Dt(g,["control","controlId","originControlId",...Jt]):qt(g,["type"]);f.controlId=a,T&&(f.control=T),c?f.originControlId=c:delete f.originControlId;const m=this.options.mode===r.EditorMode.FORM&&this.options.modeRule.form.inputTraceEnabled,p=i.startIndex+1,C=[],I=P=>{const M=C.length?C:l,N=C.length?C.length-1:i.startIndex;wt(M,[P],N,{editorOptions:this.options}),C.push(P)};for(let P=0;P<t.length;P++){const M=t[P];if(M.type===r.ElementType.CONTROL&&M.control){const N=M,F=N.controlId||gt(),S=N.control?.value||[],W=N.control?.type===r.ControlType.TEXTFIELD,b={...qt(f,["underline","textDecoration"]),controlId:F,type:r.ElementType.CONTROL,control:N.control,originControlId:a},D=W?r.ControlComponent.PRETEXTFIX:r.ControlComponent.PREFIX,X=W?r.ControlComponent.POSTTEXTFIX:r.ControlComponent.POSTFIX,O=W?N.control?.preTextFix||this.options.control.preTextFix:N.control?.prefix||this.options.control.prefix;for(let L=0;L<O.length;L++){const V={...b,value:O[L],controlComponent:D};I(V)}for(let L=0;L<S.length;L++){const V=S[L],y={...b,...V,controlComponent:r.ControlComponent.VALUE};(y.color===this.options.control.bracketColor||y.color===this.options.control.placeholderColor)&&(y.color=this.options.defaultColor),I(y)}if(S.length===0){const L=N.control?.placeholder||"";for(let V=0;V<L.length;V++){const y={...b,value:L[V],controlComponent:r.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};I(y)}}const E=W?N.control?.postTextFix||this.options.control.postTextFix:N.control?.postfix||this.options.control.postfix;for(let L=0;L<E.length;L++){const V={...b,value:E[L],controlComponent:X};I(V)}}else if(M.type||M.value){(g.controlComponent===r.ControlComponent.PRE_TEXT||g.controlComponent===r.ControlComponent.POST_TEXT||g.controlComponent===r.ControlComponent.PREFIX||g.controlComponent===r.ControlComponent.POSTFIX)&&(f.color=this.options.defaultColor);const F=qt(M,["control","controlId","controlComponent","originControlId"]),S={...f,...F,controlComponent:r.ControlComponent.VALUE};(S.color===this.options.control.bracketColor||S.color===this.options.control.placeholderColor||S.color===this.options.control.textFixColor)&&(S.color=this.options.defaultColor),S.strikeout&&delete S.strikeout,m&&(S.textDecoration={style:r.TextDecorationStyle.DOUBLE},S.underline=!0),I(S)}}return C.length&&h.spliceElementList(l,p,0,C),i.startIndex+C.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 l=e;for(;l>=0&&i(t[l]);)l--;let s=e+1;for(;s<t.length&&i(t[s]);)s++;for(let a=s-1;a>l;a--)t[a].controlComponent===r.ControlComponent.PLACEHOLDER&&t.splice(a,1)}_removePlaceholdersByControl(t,e,n){if(e)for(let i=t.length-1;i>=0;i--){const l=t[i];l.controlId===e&&(l.originControlId||null)===n&&l.controlComponent===r.ControlComponent.PLACEHOLDER&&t.splice(i,1)}}_findNearestTextAncestorId(t,e){if(!e)return null;const n=new Set;let i=e,l=null;for(;i&&!n.has(i);){n.add(i);let s;for(let a=0;a<t.length;a++){const c=t[a];if(c.controlId===i&&c.control?.type&&(s=c,c.controlComponent===r.ControlComponent.PREFIX||c.controlComponent===r.ControlComponent.PRE_TEXT||c.controlComponent===r.ControlComponent.PRETEXTFIX||c.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT))break}if(!s)break;s.control?.type===r.ControlType.TEXT&&(l=i),i=s.originControlId||null}return l}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:l,endIndex:s}=i;return this.control.getDraw().spliceElementList(n,l+1,s-l,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(l,t)),l}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:l}=n,s=e[i],a=e[l],c=this.control.getDraw(),d=this.options.mode===r.EditorMode.FORM,u=this.element.controlId||s.controlId,R=this.element.originControlId||s.originControlId||null,h=X=>{if(!X)return null;const O=new Set;let E=X,L=null;for(;E&&!O.has(E);){O.add(E);let V;for(let y=0;y<e.length;y++){const U=e[y];if(U.controlId===E&&U.control?.type&&(V=U,U.controlComponent===r.ControlComponent.PREFIX||U.controlComponent===r.ControlComponent.PRE_TEXT||U.controlComponent===r.ControlComponent.PRETEXTFIX||U.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT))break}if(!V)break;V.control?.type===r.ControlType.TEXT&&(L=E),E=V.originControlId||null}return L},g=h(R),T=!!g,f=s.controlId===u&&(s.originControlId||null)===R,m=s.controlComponent===r.ControlComponent.VALUE,p=X=>{for(let O=i-1;O>=0;O--){const E=e[O];if(E.controlId===X&&!E.originControlId){if(E.controlComponent===r.ControlComponent.VALUE||E.controlComponent===r.ControlComponent.PLACEHOLDER)return O;if(E.controlComponent===r.ControlComponent.PREFIX||E.controlComponent===r.ControlComponent.PRE_TEXT||E.controlComponent===r.ControlComponent.PRETEXTFIX||E.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)break}if(E.controlId&&E.controlId!==X&&E.originControlId!==X)break}return-1},C=(X,O)=>{for(let E=X;E>=0;E--){const L=e[E];if(L.controlId===O&&!L.originControlId&&(L.controlComponent===r.ControlComponent.VALUE||L.controlComponent===r.ControlComponent.PLACEHOLDER||L.controlComponent===r.ControlComponent.PREFIX||L.controlComponent===r.ControlComponent.PRE_TEXT||L.controlComponent===r.ControlComponent.PRETEXTFIX||L.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT))return E;if(L.controlId&&L.controlId!==O&&L.originControlId!==O)break}for(let E=X+1;E<e.length;E++){const L=e[E];if(L.controlId===O&&!L.originControlId&&(L.controlComponent===r.ControlComponent.VALUE||L.controlComponent===r.ControlComponent.PLACEHOLDER||L.controlComponent===r.ControlComponent.POSTFIX||L.controlComponent===r.ControlComponent.POST_TEXT||L.controlComponent===r.ControlComponent.POSTTEXTFIX||L.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT))return E;if(L.controlId&&L.controlId!==O&&L.originControlId!==O)break}return X},P=T&&f&&(s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT||s.controlComponent===r.ControlComponent.PRETEXTFIX||s.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||s.controlComponent===r.ControlComponent.POSTFIX||s.controlComponent===r.ControlComponent.POST_TEXT||s.controlComponent===r.ControlComponent.POSTTEXTFIX||s.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||s.controlComponent===r.ControlComponent.PLACEHOLDER||s.controlComponent===r.ControlComponent.TEXTFIXLABEL),M=e[l+1],N=!!M?.originControlId&&!!M?.controlId&&M.originControlId!==M.controlId&&(M.controlComponent===r.ControlComponent.PREFIX||M.controlComponent===r.ControlComponent.PRE_TEXT||M.controlComponent===r.ControlComponent.PRETEXTFIX||M.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||M.controlComponent===r.ControlComponent.PLACEHOLDER||M.controlComponent===r.ControlComponent.TEXTFIXLABEL),F=!!M?.originControlId&&!!M?.controlId&&M.originControlId!==M.controlId&&(M.controlComponent===r.ControlComponent.PREFIX||M.controlComponent===r.ControlComponent.PRE_TEXT||M.controlComponent===r.ControlComponent.PRETEXTFIX||M.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||M.controlComponent===r.ControlComponent.POSTFIX||M.controlComponent===r.ControlComponent.POST_TEXT||M.controlComponent===r.ControlComponent.POSTTEXTFIX||M.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||M.controlComponent===r.ControlComponent.PLACEHOLDER||M.controlComponent===r.ControlComponent.TEXTFIXLABEL),S=X=>this.options.mode===r.EditorMode.FORM?i:this.control.removeControl(X),W=s.controlComponent===r.ControlComponent.VALUE&&!s.originControlId&&!!M?.originControlId&&!!u&&h(M.originControlId)===u,Y=!!u&&!this.control.getIsExistValueByElementListIndex(e,i),b=()=>{if(s.controlComponent!==r.ControlComponent.VALUE)return null;let X=i;for(let L=i;L>=0;L--){const V=e[L];if(!(V.controlId===s.controlId&&(V.originControlId||null)===(s.originControlId||null))||V.controlComponent!==r.ControlComponent.VALUE)break;if(!V.strikeout){X=L;break}}const O=e[X];if(!O||O.strikeout)return null;O.strikeout=!0,O.deletePerson="SWJ",O.deleteTime=ot(new Date).format("YYYY-MM-DD HH:mm:ss");let E=Math.max(X-1,0);for(let L=X-1;L>=0;L--){const V=e[L];if(!(V.controlId===O.controlId&&(V.originControlId||null)===(O.originControlId||null))){E=L;break}if(V.controlComponent!==r.ControlComponent.VALUE){E=L;break}if(!V.strikeout){E=L;break}E=Math.max(L-1,0)}return this.draws.render({curIndex:E,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),queueMicrotask(()=>{this.ranges.setRange(E,E),this.draws.setCursor(E)}),E};if(this.options.mode===r.EditorMode.FORM&&s.control?.type===r.ControlType.TEXT&&t.key===r.KeyMap.Backspace&&console.log("[text-keydown:before]",{key:t.key,startIndex:i,endIndex:l,startValue:s?.value,startComponent:s?.controlComponent,startControlId:s?.controlId,startOriginControlId:s?.originControlId||null,endNextComponent:M?.controlComponent,endNextControlId:M?.controlId,endNextOriginControlId:M?.originControlId||null,isNestedChildBoundary:P,isParentValueBeforeNestedChild:W,isCurrentTextControlEmpty:Y}),t.key===r.KeyMap.Backspace){if(i===l&&Y&&(s.controlComponent===r.ControlComponent.PLACEHOLDER||s.controlComponent===r.ControlComponent.POSTFIX||s.controlComponent===r.ControlComponent.POST_TEXT||s.controlComponent===r.ControlComponent.POSTTEXTFIX||s.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT))return i;if(d&&i===l&&g&&!f&&(s.controlComponent===r.ControlComponent.POSTFIX||s.controlComponent===r.ControlComponent.POST_TEXT||s.controlComponent===r.ControlComponent.POSTTEXTFIX||s.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)){const O=p(g);return O>=0?O:i}if(i===l&&P&&!(d&&s.controlComponent===r.ControlComponent.VALUE&&!s.originControlId))return S(i);if(this.options.mode===r.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&(!T||m)){if(i===l&&s.controlComponent===r.ControlComponent.VALUE){const O=b();if(O!==null)return O}return s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT||s.controlComponent===r.ControlComponent.PLACEHOLDER?i:this.strikeout()}else{if(s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT||s.controlComponent===r.ControlComponent.PLACEHOLDER)return i;if(i!==l){c.spliceElementList(e,i+1,l-i);const O=e[i+1];return(O?.controlComponent===r.ControlComponent.POSTFIX||O?.controlComponent===r.ControlComponent.POST_TEXT||O?.controlComponent===r.ControlComponent.POSTTEXTFIX||O?.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(i),i===0&&e[0].type===r.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i}else{const O=e[i-1],E=e[i+1];return!s.originControlId&&O?.controlId===s.controlId&&O?.originControlId===s.originControlId&&O?.controlComponent===r.ControlComponent.VALUE&&(s.controlComponent===r.ControlComponent.POSTFIX||s.controlComponent===r.ControlComponent.POST_TEXT||s.controlComponent===r.ControlComponent.POSTTEXTFIX||s.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)&&this.options.mode!==r.EditorMode.FORM?(c.spliceElementList(e,i-1,1),this.getValue().length||this.control.addPlaceholder(i-2),i-2):E?.controlComponent===r.ControlComponent.POSTFIX||E?.controlComponent===r.ControlComponent.POST_TEXT||E?.controlComponent===r.ControlComponent.POSTTEXTFIX||E?.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT?E.originControlId?W?(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),C(Math.max(i-1,0),s.controlId)):S(i):(c.spliceElementList(e,i,1),this.control.addPlaceholder(i-1),C(Math.max(i-1,0),s.controlId)):(c.spliceElementList(e,i,1),i===1&&e[0].type===r.ElementType.SPLIT_TAG||i===0?c.fixPosition(!0)??i-1:C(Math.max(i-1,0),s.controlId))}}}else if(t.key===r.KeyMap.Delete){if(i===l&&Y&&(s.controlComponent===r.ControlComponent.PLACEHOLDER||s.controlComponent===r.ControlComponent.POSTFIX||s.controlComponent===r.ControlComponent.POST_TEXT||s.controlComponent===r.ControlComponent.POSTTEXTFIX||s.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT))return l;if(i===l&&(N||F)){if(W){const L=e[l+1];if(L?.controlComponent===r.ControlComponent.VALUE&&L.controlId===s.controlId&&!L.originControlId)return c.spliceElementList(e,l+1,1),this.getValue().length||this.control.addPlaceholder(i),i}return S(l+1)}const X=e[l+1],O=!!s.originControlId;if(this.options.mode===r.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&(!O||s.controlComponent===r.ControlComponent.VALUE))return a.controlComponent===r.ControlComponent.POSTFIX||a.controlComponent===r.ControlComponent.POST_TEXT||a.controlComponent===r.ControlComponent.POSTTEXTFIX||a.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||s.controlComponent===r.ControlComponent.PLACEHOLDER?l:X?.controlComponent===r.ControlComponent.POSTFIX||X?.controlComponent===r.ControlComponent.POST_TEXT||X?.controlComponent===r.ControlComponent.POSTTEXTFIX||X?.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT?X.originControlId?W?(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i):S(i+1):(c.spliceElementList(e,i+1,1),this.control.addPlaceholder(i),i):this.strikeout();{const L=e[l+1];return s.controlComponent===r.ControlComponent.PLACEHOLDER?l:L?.controlComponent===r.ControlComponent.POSTFIX||L?.controlComponent===r.ControlComponent.POST_TEXT||L?.controlComponent===r.ControlComponent.POSTTEXTFIX||L?.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT?L.originControlId?W?(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i):S(i+1):(c.spliceElementList(e,i+1,1),this.control.addPlaceholder(i),i):i!==l?(c.spliceElementList(e,i+1,l-i),i===0&&e[0].type===r.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i):L?(c.spliceElementList(e,i+1,1),i===0&&e[0].type===r.ElementType.SPLIT_TAG?c.fixPosition(!0)??i:i):(c.getTd()?.linkTdNextId&&s.controlId&&this.removeNextControlElement(s.controlId),l)}}return l}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 l=i[t+1];return(l?.controlComponent===r.ControlComponent.POSTFIX||l?.controlComponent===r.ControlComponent.POST_TEXT||l?.controlComponent===r.ControlComponent.POSTTEXTFIX||l?.controlComponent===r.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 null;const s=this.ranges.getSelectionElementList(),a=this.position.getCursorPosition(),c=ot(new Date).format("YYYY-MM-DD HH:mm:ss"),d=h=>{queueMicrotask(()=>{this.ranges.setRange(h,h),this.draws.setCursor(h),this.options.mode===r.EditorMode.FORM&&console.log("[text-sync-trace-cursor]",{index:h,range:this.ranges.getRange(),cursorIndex:this.position.getCursorPosition()?.index})})},u=h=>{const g=this.control.getElementList(),T=g[h],f=T?.controlId,m=T?.originControlId||null;let p=-1;for(let C=h-1;C>=0;C--){const I=g[C];if(I.controlId===f&&(I.originControlId||null)===m&&I.controlComponent===r.ControlComponent.VALUE)return this.options.mode===r.EditorMode.FORM&&console.log("[text-prev-trace-index]",{from:h,to:C,reason:"prev-value"}),C;if(m){if(I.controlId&&I.controlId!==f&&I.originControlId!==m)break}else{if(I.controlId===f&&(I.controlComponent===r.ControlComponent.PREFIX||I.controlComponent===r.ControlComponent.PRE_TEXT||I.controlComponent===r.ControlComponent.PRETEXTFIX||I.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)){p=C;break}if(I.controlId&&I.controlId!==f&&!I.originControlId)break;if(I.originControlId===f&&(I.controlComponent===r.ControlComponent.POSTFIX||I.controlComponent===r.ControlComponent.POST_TEXT||I.controlComponent===r.ControlComponent.POSTTEXTFIX||I.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT))return this.options.mode===r.EditorMode.FORM&&console.log("[text-prev-trace-index]",{from:h,to:C,reason:"nested-postfix"}),C}}if(p>=0){const C=p+1,I=g[C];return I?.controlId===f&&(I.controlComponent===r.ControlComponent.PLACEHOLDER||I.controlComponent===r.ControlComponent.VALUE)?(this.options.mode===r.EditorMode.FORM&&console.log("[text-prev-trace-index]",{from:h,to:C,reason:"prefix-next-editable"}),C):(this.options.mode===r.EditorMode.FORM&&console.log("[text-prev-trace-index]",{from:h,to:p,reason:"prefix"}),p)}return this.options.mode===r.EditorMode.FORM&&console.log("[text-prev-trace-index]",{from:h,to:h,reason:"self"}),h},R=h=>{const g=this.control.getElementList(),T=g[h];if(!T?.controlId||T.controlComponent===r.ControlComponent.VALUE&&(T.metrics?.width??0)>0)return h;for(let f=h+1;f<g.length;f++){const m=g[f];if(m.controlId!==T.controlId||(m.originControlId||null)!==(T.originControlId||null))break;if(m.controlComponent===r.ControlComponent.VALUE&&(m.metrics?.width??0)>0)return f}for(let f=h-1;f>=0;f--){const m=g[f];if(m.controlId!==T.controlId||(m.originControlId||null)!==(T.originControlId||null))break;if(m.controlComponent===r.ControlComponent.VALUE&&(m.metrics?.width??0)>0)return f}return h};if(s?.length){if(!this.element.strikeout){const h=s.findIndex(g=>!g.strikeout);return s.forEach(g=>{g.deletePerson="SWJ",g.deleteTime=c,g.strikeout=!!~h}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),this.control.getRange().endIndex??null}}else{const h=R(a.index),g=this.control.getElementList()[h],T=this.control.getElementList();if(this.options.mode===r.EditorMode.FORM&&console.log("[text-strikeout]",{cursorIndex:a.index,targetIndex:h,targetValue:g?.value,targetComponent:g?.controlComponent,targetControlId:g?.controlId,targetOriginControlId:g?.originControlId||null}),!this.control.getElementList()[h].strikeout&&g?.metrics.width>0){this.control.getElementList()[h].strikeout=!0,this.control.getElementList()[h].deletePerson="SWJ",this.control.getElementList()[h].deleteTime=c;const f=u(h);return this.options.mode===r.EditorMode.FORM&&console.log("[text-strikeout:after]",{targetIndex:h,newIndex:f}),this.ranges.setRange(f,f),this.draws.render({curIndex:f,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),d(f),f??null}else if(n>=0&&n<T.length&&T[n]?.metrics?.width!==void 0&&T[n].metrics.width<=0&&!T[n]?.strikeout){T.splice(n,1);const f=n-1;return this.ranges.setRange(f,f),this.draws.render({curIndex:f,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),d(f),f??null}}return n??null}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:l}=this.ranges.getRange(),a=this.draws.getElementList()[l];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}class yr{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(`${q}-date-container`),t.setAttribute(he,r.EditorComponent.POPUP);const e=document.createElement("div");e.classList.add(`${q}-date-wrap`);const n=document.createElement("div");n.classList.add(`${q}-date-title`);const i=document.createElement("span");i.classList.add(`${q}-date-title__pre-year`),i.innerText="<<";const l=document.createElement("span");l.classList.add(`${q}-date-title__pre-month`),l.innerText="<";const s=document.createElement("span");s.classList.add(`${q}-date-title__now`);const a=document.createElement("span");a.classList.add(`${q}-date-title__next-month`),a.innerText=">";const c=document.createElement("span");c.classList.add(`${q}-date-title__next-year`),c.innerText=">>",n.append(i),n.append(l),n.append(s),n.append(a),n.append(c);const d=document.createElement("div");d.classList.add(`${q}-date-week`);const{weeks:{sun:u,mon:R,tue:h,wed:g,thu:T,fri:f,sat:m}}=this.lang;[u,R,h,g,T,f,m].forEach(D=>{const X=document.createElement("span");X.innerText=`${D}`,d.append(X)});const C=document.createElement("div");C.classList.add(`${q}-date-day`),e.append(n),e.append(d),e.append(C);const I=document.createElement("ul");I.classList.add(`${q}-time-wrap`);let P,M,N;[this.lang.hour,this.lang.minute,this.lang.second].forEach((D,X)=>{const O=document.createElement("li"),E=document.createElement("span");E.innerText=D,O.append(E);const L=document.createElement("ol"),V=X===0,y=X===1,U=V?24:60;for(let Q=0;Q<U;Q++){const K=document.createElement("li");K.innerText=`${String(Q).padStart(2,"0")}`,K.setAttribute("data-id",`${Q}`),L.append(K)}V?P=L:y?M=L:N=L,O.append(L),I.append(O)});const S=document.createElement("div");S.classList.add(`${q}-date-menu`);const W=document.createElement("button");W.classList.add(`${q}-date-menu__time`),W.innerText=this.lang.timeSelect;const Y=document.createElement("button");Y.classList.add(`${q}-date-menu__now`),Y.innerText=this.lang.now;const b=document.createElement("button");return b.classList.add(`${q}-date-menu__submit`),b.innerText=this.lang.confirm,S.append(W),S.append(Y),S.append(b),t.append(e),t.append(I),t.append(S),this.draw.getContainer().append(t),{container:t,dateWrap:e,datePickerWeek:d,timeWrap:I,title:{preYear:i,preMonth:l,now:s,nextMonth:a,nextYear:c},day:C,time:{hour:P,minute:M,second:N},menu:{time:W,now:Y,submit:b}}}_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,l=this.draw.getHeight(),s=this.draw.getPageGap(),c=(i??this.draw.getPageNo())*(l+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:l,fri:s,sat:a}}=this.lang,c=[t,e,n,i,l,s,a];this.dom.datePickerWeek.childNodes.forEach((h,g)=>{const T=h;T.innerText=c[g]});const d=this.dom.time.hour.previousElementSibling;d.innerText=this.lang.hour;const u=this.dom.time.minute.previousElementSibling;u.innerText=this.lang.minute;const R=this.dom.time.second.previousElementSibling;R.innerText=this.lang.second}_update(){const t=new Date,e=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();let l=null,s=null,a=null;this.pickDate&&(l=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 R=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 T=g-h+1;for(let m=T;m<=g;m++){const p=document.createElement("div");p.classList.add("disable"),p.innerText=`${m}`,p.onclick=()=>{const C=d-2;this.now=new Date(c,C,m),this._setDatePick(c,C,m)},this.dom.day.append(p)}for(let m=1;m<=R;m++){const p=document.createElement("div");e===c&&n===d&&i===m&&p.classList.add("active"),this.pickDate&&l===c&&s===d&&a===m&&p.classList.add("select"),p.innerText=`${m}`,p.onclick=C=>{const I=d-1;this.now=new Date(c,I,m),this._setDatePick(c,I,m),C.stopPropagation()},this.dom.day.append(p)}const f=42-h-R;for(let m=1;m<=f;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:l,minute:s,second:a}=this.dom.time;[l,s,a].forEach(u=>{u.querySelectorAll("li").forEach(R=>R.classList.remove("active"))}),[[l,e],[s,n],[a,i]].forEach(([u,R])=>{const h=u.querySelector(`[data-id='${R}']`);h.classList.add("active"),t&&ji(u,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(),l=(t.getMonth()+1).toString(),s=t.getDate().toString(),a=t.getHours(),c=a%12===0?12:a%12,d=t.getMinutes().toString(),u=t.getSeconds().toString(),R=t.getMilliseconds().toString(),h={"y+":i,"Y+":i,"M+":l,"d+":s,"D+":s,"h+":c.toString(),"H+":a.toString(),"m+":d,"s+":u,"S+":R};for(const g in h){const T=new RegExp("("+g+")").exec(e),f=g;T&&(n=n.replace(T[1],T[1].length===1?h[f]:h[f].padStart(T[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 Qn{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:l,endIndex:s}=n;for(let a=l;a<=s;a++){const c=e[a];c.controlComponent===r.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=l,c=this.control.getDraw();s!==a?c.spliceElementList(i,s+1,a-s):this.control.removePlaceholder(s,{elementList:i});const d=i[s],u=d.type&&!te.includes(d.type)||d.controlComponent===r.ControlComponent.PREFIX||d.controlComponent===r.ControlComponent.PRE_TEXT?Dt(d,["control","controlId",...Jt]):qt(d,["type"]),R=l.startIndex+1;for(let h=0;h<t.length;h++){const g={...u,...t[h],controlComponent:r.ControlComponent.VALUE};wt(i,[g],s,{editorOptions:this.options}),c.spliceElementList(i,R+h,0,[g])}return R+t.length-1}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const l=this.control.getValueRange(t);if(!l)return-1;const{startIndex:s,endIndex:a}=l;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(),l=e.range||this.control.getRange(),s=this.getValue(e)[0],a=s?Dt(s,ge):Dt(i[l.startIndex],Jt),c=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~c)return;const d=qt(i[c],ge),u=c+1,R=this.control.getDraw();for(let h=0;h<t.length;h++){const g={...a,...d,type:r.ElementType.TEXT,value:t[h],controlComponent:r.ControlComponent.VALUE};(g.color===this.options.control.bracketColor||g.color===this.options.control.placeholderColor)&&(g.color=this.options.defaultColor),wt(i,[g],c,{editorOptions:this.options}),R.spliceElementList(i,u+h,0,[g])}if(!e.range){const h=u+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:l}=n,s=e[i],a=e[l],c=this.control.getDraw();if(t.key===r.KeyMap.Backspace)return i!==l?(c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT||a.controlComponent===r.ControlComponent.POSTFIX||a.controlComponent===r.ControlComponent.POST_TEXT||s.controlComponent===r.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(t.key===r.KeyMap.Delete){if(i!==l)return c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i;{const d=e[l+1];return(s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT)&&d.controlComponent===r.ControlComponent.PLACEHOLDER||d.controlComponent===r.ControlComponent.POSTFIX||d.controlComponent===r.ControlComponent.POST_TEXT||s.controlComponent===r.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}}return l}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 yr(this.draw,{onSubmit:this._setDate.bind(this)});const i=this.getValue().map(s=>s.value).join("")||"",l=this.element.control?.dateFormat;this.datePicker.render({value:i,position:t,dateFormat:l}),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 Zi{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=>!Ia(P)||ll.test(P.value)))return-1;const i=e.elementList||this.control.getElementList(),l=e.range||this.control.getRange();this.control.shrinkBoundary(e);const s=dt(t),{startIndex:a,endIndex:c}=l,d=i[a];let u=null;for(let P=a;P>=0;P--)if(i[P].controlComponent===r.ControlComponent.PREFIX){u=i[P];break}const R=u?.control||this.element.control;if(this.control.getIsExistValueByElementListIndex(i,a)){let P=a;for(;P>0;){const N=i[P];if(N.controlId!==d.controlId||N.controlComponent===r.ControlComponent.PREFIX||N.controlComponent===r.ControlComponent.PRE_TEXT)break;s.unshift(N),P--}let M=c+1;for(;M<i.length;){const N=i[M];if(N.controlId!==d.controlId||N.controlComponent===r.ControlComponent.POSTFIX||N.controlComponent===r.ControlComponent.POST_TEXT)break;s.push(N),M++}}const h=Rs(s);if(Number.isNaN(Number(h))||!Number.isFinite(Number(h)))return-1;const g=R?.numberExclusiveOptions,T=g?.maxLength??null,f=g?.decimalPlaces??null,m=h.replace(/[.-]/g,"").length;if(T!=null&&m>T||f!=null&&(h.split(".")[1]||"").length>f)return-1;const p=Number(h),C=g?.minValue,I=g?.maxValue;return C!=null&&p<C||I!=null&&p>I?-1:super.setValue(t,e,n)}_setNumberValue(t){const e=this.control.getElementList(),n=this.control.getRange(),{startIndex:i}=n;let l=null;for(let F=i;F>=0;F--)if(e[F].controlComponent===r.ControlComponent.PREFIX){l=e[F];break}const a=(l?.control||this.element.control)?.numberExclusiveOptions,c=a?.minValue,d=a?.maxValue,u=a?.decimalPlaces,R=a?.minLength,h=a?.maxLength;let g=t;u!=null&&(g=parseFloat(t.toFixed(u)));const T=g.toString(),f=T.replace(/[.-]/g,"").length;if(R!=null&&f<R||h!=null&&f>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===r.ControlComponent.PREFIX){m=F;break}let p=m+1;for(let F=m+1;F<e.length;F++)if(e[F].controlComponent===r.ControlComponent.POSTFIX){p=F;break}const C=this.options.mode===r.EditorMode.FORM,I=C&&this.options.modeRule.form.inputTraceEnabled,P=C&&this.options.modeRule.form.deleteTraceEnabled,M=ot(new Date).format("YYYY-MM-DD HH:mm:ss");if(P)for(let F=m+1;F<p;F++){const S=e[F];S.controlComponent===r.ControlComponent.VALUE&&!S.strikeout&&S.value&&(S.strikeout=!0,S.deletePerson="SYSTEM",S.deleteTime=M),S.controlComponent===r.ControlComponent.PLACEHOLDER&&(this.control.getDraw().spliceElementList(e,F,1),p--,F--)}else{const F=m+1,S=p-F;S>0&&this.control.getDraw().spliceElementList(e,F,S),p=m+1}p=m+1;for(let F=m+1;F<e.length;F++)if(e[F].controlComponent===r.ControlComponent.POSTFIX){p=F;break}const N=[];for(let F=0;F<T.length;F++){const S={type:r.ElementType.TEXT,value:T[F],controlComponent:r.ControlComponent.VALUE,controlId:e[m].controlId};I&&(S.textDecoration={style:r.TextDecorationStyle.DOUBLE},S.underline=!0),N.push(S)}for(let F=0;F<N.length;F++)this.control.getDraw().spliceElementList(e,p+F,0,[N[F]]);return this.control.repaintControl({curIndex:p+N.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 l=null;for(let T=n;T>=0;T--)if(t[T].controlComponent===r.ControlComponent.PREFIX){l=t[T];break}const s=l?.control||this.element.control,c=this.getValue().filter(T=>!T.strikeout),d=c.length>0?Rs(c):"",u=s?.numberExclusiveOptions,R=u?.minValue,h=u?.maxValue,g=u?.decimalPlaces;this.inputPopup=new vh({control:this.control,currentValue:d,minValue:R,maxValue:h,decimalPlaces:g,onConfirm:T=>{if(!T||T.trim()==="")return this._clearNumberValue(),!0;const f=parseFloat(T);return Number.isNaN(f)||!Number.isFinite(f)?!1:this._setNumberValue(f)},onTab:T=>{this.destroy(),setTimeout(()=>{this.control.initNextControl({direction: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===r.ControlComponent.PREFIX){i=c;break}let l=i+1;for(let c=i+1;c<t.length;c++)if(t[c].controlComponent===r.ControlComponent.POSTFIX){l=c;break}const s=i+1,a=l-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:l}=n,s=e[i],a=e[l],c=this.control.getDraw();if(t.key==="Backspace")return s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT||s.controlComponent===r.ControlComponent.PLACEHOLDER?this.control.removeControl(i):a.controlComponent===r.ControlComponent.POSTFIX||a.controlComponent===r.ControlComponent.POST_TEXT?i:i!==l?(c.spliceElementList(e,i+1,l-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 u=e[l+1];return s.controlComponent===r.ControlComponent.PLACEHOLDER||a.controlComponent===r.ControlComponent.POSTFIX||a.controlComponent===r.ControlComponent.POST_TEXT?this.control.removeControl(i):s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRE_TEXT||u?.controlComponent===r.ControlComponent.POSTFIX||u?.controlComponent===r.ControlComponent.POST_TEXT?l:i!==l?(c.spliceElementList(e,i+1,l-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):l}destroy(){this.inputPopup&&(this.inputPopup.destroy(),this.inputPopup=null),this.isPopup=!1}}class vh{options;popupDom;constructor(t){this.options=t,this.popupDom=null}create(){const{currentValue:t,minValue:e,maxValue:n,decimalPlaces:i,onConfirm:l,onTab:s,onClose:a}=this.options,c=document.createElement("div");c.classList.add(`${q}-number-input-modal`),c.setAttribute(he,r.EditorComponent.POPUP);const d=document.createElement("div");d.classList.add(`${q}-number-input-modal__content`);const u=document.createElement("div");if(u.classList.add(`${q}-number-input-modal__title`),u.textContent="请输入数值",d.appendChild(u),e!==void 0||n!==void 0){const C=document.createElement("div");C.classList.add(`${q}-number-input-modal__hint`);let I="有效范围:";e!==void 0&&n!==void 0?I+=`${e} ~ ${n}`:e!==void 0?I+=`≥ ${e}`:I+=`≤ ${n}`,i!=null&&(I+=`,保留${i}位小数`),C.textContent=I,d.appendChild(C)}const R=document.createElement("input");R.classList.add(`${q}-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),d.appendChild(R);const h=document.createElement("div");h.classList.add(`${q}-number-input-modal__error`),h.style.display="none",d.appendChild(h);const g=document.createElement("div");g.classList.add(`${q}-number-input-modal__buttons`);const T=document.createElement("button");T.classList.add(`${q}-number-input-modal__cancel`),T.textContent="取消",T.onclick=()=>{a()},g.appendChild(T);const f=document.createElement("button");f.classList.add(`${q}-number-input-modal__confirm`),f.textContent="确定";const m=()=>{const C=R.value.trim();if(!C)return l("");const I=parseFloat(C);return Number.isNaN(I)||!Number.isFinite(I)?(h.textContent="请输入有效的数值",h.style.display="block",!1):i!=null&&(C.split(".")[1]||"").length>i?(h.textContent=`小数位数不能超过${i}位`,h.style.display="block",!1):e!==void 0&&I<e?(h.textContent=`数值不能小于 ${e}`,h.style.display="block",!1):n!==void 0&&I>n?(h.textContent=`数值不能大于 ${n}`,h.style.display="block",!1):(h.style.display="none",l(C))};f.onclick=()=>{m()&&a()},g.appendChild(f),d.appendChild(g),c.appendChild(d),R.onkeydown=C=>{C.key==="Enter"?f.click():C.key==="Tab"?(C.preventDefault(),m()&&(a(),s(C.shiftKey?Ut.UP:Ut.DOWN))):C.key==="Escape"&&a()},this.options.control.getContainer().appendChild(c),this.popupDom=c}destroy(){this.popupDom&&(this.popupDom.remove(),this.popupDom=null)}}class Kh{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,l=this._getFieldValue(n),s=this.optionItemContainers[e];if(s){const a=l===i;s.style.display=a?"":"none"}}})}_render(){const{title:t,onClose:e,onCancel:n,onConfirm:i}=this.options,l=document.createElement("div");l.classList.add("dialog-mask"),l.setAttribute(he,r.EditorComponent.COMPONENT),document.body.append(l);const s=document.createElement("div");s.classList.add("dialog-container"),s.setAttribute(he,r.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 u=document.createElement("i");u.onclick=()=>{e&&e(),this._dispose()},c.append(d),c.append(u),a.append(c);const R=document.createElement("div");R.classList.add("dialog-option");for(let f=0;f<this.data.length;f++){const m=this.data[f],p=document.createElement("div");if(p.classList.add("dialog-option__item"),m.visible===!1&&(p.style.display="none"),m.label){const C=document.createElement("span");C.append(document.createTextNode(m.label)),p.append(C),m.required&&C.classList.add("dialog-option__item--require")}if(m.type==="radio"){const C=document.createElement("div");C.classList.add("dialog-radio-group"),m.horizontal&&C.classList.add("dialog-radio-group--horizontal"),m.options?.forEach(I=>{const P=document.createElement("label");P.classList.add("dialog-radio-item");const M=document.createElement("input");M.type="radio",M.name=m.name,M.value=I.value,I.value===(m.value||"")&&(M.checked=!0);const N=document.createElement("span");N.textContent=I.label,P.append(M),P.append(N),C.append(P),M.addEventListener("change",()=>{this._updateFieldVisibility()}),this.inputList.push(M)}),p.append(C)}else if(m.type==="select"){const C=document.createElement("select"),I=m.value||"";m.options?.forEach(P=>{const M=document.createElement("option");M.value=P.value,M.label=P.label,P.value===I&&(M.selected=!0),C.append(M)}),C.name=m.name,C.value=I,C.addEventListener("change",()=>{this._updateFieldVisibility()}),m.width&&(C.style.width=`${m.width}px`),p.append(C),this.inputList.push(C)}else if(m.type==="textarea"){const C=document.createElement("textarea");C.name=m.name,C.value=m.value||"",C.placeholder=m.placeholder||"",m.width&&(C.style.width=`${m.width}px`),m.height&&(C.style.height=`${m.height}px`),p.append(C),this.inputList.push(C)}else{const C=document.createElement("input");C.type=m.type,C.name=m.name,C.value=m.value||"",C.placeholder=m.placeholder||"",m.width&&(C.style.width=`${m.width}px`),m.height&&(C.style.height=`${m.height}px`),p.append(C),this.inputList.push(C)}R.append(p),this.optionItemContainers.push(p)}a.append(R);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 T=document.createElement("button");T.append(document.createTextNode("确定")),T.type="submit",T.onclick=()=>{if(i){const f=new Set,m=[];for(const p of this.inputList)if(!f.has(p.name))if(p instanceof HTMLInputElement&&p.type==="radio"){const C=this.inputList.find(I=>I.name===p.name&&I instanceof HTMLInputElement&&I.checked);C&&(m.push({name:p.name,value:C.value}),f.add(p.name))}else m.push({name:p.name,value:p.value}),f.add(p.name);i(m)}this._dispose()},h.append(T),a.append(h),document.body.append(s),this.container=s,this.mask=l,this._updateFieldVisibility()}_dispose(){this.mask?.remove(),this.container?.remove()}}class qe{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:l}=this.control.mergeControl(e),s=this.control.getDraw(),{startIndex:a}=l,d=i[a].controlId;let u=a;for(let p=a;p>=0;p--){const C=i[p];if(C.controlId!==d)break;if(C.controlComponent===r.ControlComponent.PREFIX){u=p;break}}let R=a;for(let p=a;p<i.length;p++){const C=i[p];if(C.controlId!==d){R=p;break}if(C.controlComponent===r.ControlComponent.POSTFIX){R=p;break}}const h=u+1,g=R-1;g>=h&&s.spliceElementList(i,h,g-h+1);const T=i[u],f=Dt(T,["control","controlId",...Jt]),m=u+1;for(let p=0;p<t.length;p++){const C={...f,...t[p],controlComponent:r.ControlComponent.VALUE};C.color="#fff",C.highlight="#1677FF",wt(i,[C],u,{editorOptions:this.options}),s.spliceElementList(i,m+p,0,[C])}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 l=this.control.getValueRange(t);if(!l)return-1;const{startIndex:s,endIndex:a}=l;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,l=e[i];return!!l?.originControlId&&!!l?.controlId&&l.originControlId!==l.controlId&&l.control?.type===r.ControlType.BUTTON&&!l.control?.buttonText&&(t.key===r.KeyMap.Backspace||t.key===r.KeyMap.Delete)?this.control.removeControl(i):l?.controlComponent==="value"&&l.control?.type==="button"&&l.control?.buttonText?t.key===r.KeyMap.Backspace||t.key===r.KeyMap.Delete?(l.controlId&&this.removeByValue(e,l.controlId),i):null:(t.key===r.KeyMap.Backspace&&l?.controlComponent==="value"&&l.control?.type==="button"&&!l.control?.buttonText,null)}removeByValue(t,e){return qe.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:l}=this.range.getRange(),s=!0,a=l;this.draw.render({curIndex:a,isSetCursor:s}),setTimeout(()=>{qe.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()||qe.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 l=e[n]?.controlId,s=e[n]?.control;if(!(l?.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(`${q}-button-input-modal`),this.inputModal.setAttribute(he,r.EditorComponent.POPUP),this.inputModal.oncontextmenu=c=>{c.preventDefault(),c.stopPropagation()};const e=document.createElement("div");e.classList.add(`${q}-button-input-modal__content`),e.oncontextmenu=c=>{c.preventDefault(),c.stopPropagation()};const n=document.createElement("div");n.classList.add(`${q}-button-input-modal__title`),n.innerText="请输入按钮展开文字(用逗号分隔)";const i=document.createElement("textarea");i.classList.add(`${q}-button-input-modal__textarea`),i.placeholder="例如:选项1,选项2,选项3",i.rows=5;const l=document.createElement("div");l.classList.add(`${q}-button-input-modal__buttons`);const s=document.createElement("button");s.classList.add(`${q}-button-input-modal__cancel`),s.innerText="取消",s.onclick=()=>this.closeInputModal();const a=document.createElement("button");a.classList.add(`${q}-button-input-modal__confirm`),a.innerText="确认",a.onclick=()=>{const c=i.value.trim();if(c){const d=c.split(/[,,]/).map((u,R)=>({value:u.trim(),code:String(R+1)})).filter(u=>u.value);if(d.length>0&&t[0]?.controlId){const u={controlId:t[0].controlId,element:[{...t[0],newButtonValue:d}]};this.draw.getCommand().executeButton(u)}}this.closeInputModal()},l.appendChild(s),l.appendChild(a),e.appendChild(n),e.appendChild(i),e.appendChild(l),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 Kh({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:l=>{const s=l.find(h=>h.name==="buttonLabel")?.value?.trim()||"按钮",a=l.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 u=[];for(let h=0;h<s.length;h++)u.push({value:s[h],controlComponent:r.ControlComponent.VALUE});const R=this.setValue(u);R!==-1&&this.control.repaintControl({curIndex:R}),this.isPopup=!1}})}destroy(){this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}}class br{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(),l=t?null:i.getTd();n>=e.length&&(n=e.length-1);const s=e[n],a=[];let c=l;if(s.controlComponent===r.ControlComponent.PRETEXTFIX||s.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT){let T=n+1;for(;T<e.length;){const f=e[T];if(f.controlId!==s.controlId||f.controlComponent!==r.ControlComponent.PRETEXTFIX&&f.controlComponent!==r.ControlComponent.PRETEXTFIX_TEXT){n=T-1;break}T++}}let d=e,u=n;for(;;){if(u<0&&c?.linkTdPrevId){const f=i.getTdById(c.linkTdPrevId);if(f){d=f.value,u=d.length-1,c=f;continue}}if(u<0)break;const T=d[u];if(T.controlId!==s.controlId||T.controlComponent===r.ControlComponent.PRETEXTFIX||T.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||T.controlComponent===r.ControlComponent.TEXTFIXLABEL)break;T.controlComponent===r.ControlComponent.VALUE&&a.unshift(T),u--}c=l;let R=e,h=n+1;for(;;){if(h>=R.length&&c?.linkTdNextId){const f=i.getTdById(c.linkTdNextId);if(f){R=f.value,h=0,c=f;continue}}const T=R[h];if(!T||T.controlId!==s.controlId||T.controlComponent===r.ControlComponent.POSTTEXTFIX||T.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||T.controlComponent===r.ControlComponent.TEXTFIXLABEL)break;T.controlComponent===r.ControlComponent.VALUE&&a.push(T),h++}return a.filter(T=>T.type!==r.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===r.EditorMode.FORM||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:s,endIndex:a}=l,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],u=i[s+1];let R=d.originControlId||d.controlId,h=d.originControlId&&(d.controlComponent===r.ControlComponent.POSTFIX||d.controlComponent===r.ControlComponent.POSTTEXTFIX||d.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===r.ControlComponent.POST_TEXT);if(!h&&d.controlId&&(d.controlComponent===r.ControlComponent.POSTFIX||d.controlComponent===r.ControlComponent.POSTTEXTFIX||d.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===r.ControlComponent.POST_TEXT)&&u?.controlId&&u.controlId!==d.controlId)if(u.controlComponent===r.ControlComponent.PREFIX||u.controlComponent===r.ControlComponent.PRETEXTFIX)for(let p=s;p>=0;p--){const C=i[p];if(C.controlId===d.controlId&&(C.controlComponent===r.ControlComponent.PREFIX||C.controlComponent===r.ControlComponent.PRETEXTFIX)){for(let I=p-1;I>=0;I--){const P=i[I];if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===r.ControlComponent.PRETEXTFIX||P.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||P.controlComponent===r.ControlComponent.PREFIX||P.controlComponent===r.ControlComponent.PRE_TEXT)){R=P.controlId,h=!0;break}if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===r.ControlComponent.POSTFIX||P.controlComponent===r.ControlComponent.POSTTEXTFIX))break}break}}else(u.controlComponent===r.ControlComponent.POSTFIX||u.controlComponent===r.ControlComponent.POSTTEXTFIX)&&(R=u.controlId,h=!0);if(!h&&d.controlId&&(d.controlComponent===r.ControlComponent.POSTFIX||d.controlComponent===r.ControlComponent.POSTTEXTFIX||d.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===r.ControlComponent.POST_TEXT))for(let p=s;p>=0;p--){const C=i[p];if(C.controlId===d.controlId&&(C.controlComponent===r.ControlComponent.PREFIX||C.controlComponent===r.ControlComponent.PRETEXTFIX)){for(let I=p-1;I>=0;I--){const P=i[I];if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===r.ControlComponent.PRETEXTFIX||P.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||P.controlComponent===r.ControlComponent.PREFIX||P.controlComponent===r.ControlComponent.PRE_TEXT)){R=P.controlId,h=!0;break}if(P.controlId&&P.controlId!==d.controlId&&(P.controlComponent===r.ControlComponent.POSTFIX||P.controlComponent===r.ControlComponent.POSTTEXTFIX))break}break}}const g=d.type&&!te.includes(d.type)||d.controlComponent===r.ControlComponent.PRETEXTFIX||d.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT?Dt(d,["control","controlId",...Jt]):qt(d,["type"]);h&&(g.controlId=R,delete g.originControlId);const T=l.startIndex+1,f=[],m=p=>{const C=f.length?f:i,I=f.length?f.length-1:l.startIndex;wt(C,[p],I,{editorOptions:this.options}),f.push(p)};for(let p=0;p<t.length;p++){const C=t[p];if(C.type===r.ElementType.CONTROL&&C.control){const I=C,P=I.controlId||gt(),M=I.control?.value||[],N=I.control?.type===r.ControlType.TEXTFIELD,F={...g,controlId:P,type:r.ElementType.CONTROL,control:I.control,originControlId:R},S=N?r.ControlComponent.PRETEXTFIX:r.ControlComponent.PREFIX,W=N?r.ControlComponent.POSTTEXTFIX:r.ControlComponent.POSTFIX,Y=N?I.control?.preTextFix||this.options.control.preTextFix:I.control?.prefix||this.options.control.prefix;for(let D=0;D<Y.length;D++){const X={...F,value:Y[D],controlComponent:S};m(X)}for(let D=0;D<M.length;D++){const X=M[D],O={...F,...X,controlComponent:r.ControlComponent.VALUE,type:X.type};(O.color===this.options.control.textFixColor||O.color===this.options.control.placeholderColor)&&(O.color=this.options.defaultColor),m(O)}if(M.length===0){const D=I.control?.placeholder||"";for(let X=0;X<D.length;X++){const O={...F,value:D[X],controlComponent:r.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};m(O)}}const b=N?I.control?.postTextFix||this.options.control.postTextFix:I.control?.postfix||this.options.control.postfix;for(let D=0;D<b.length;D++){const X={...F,value:b[D],controlComponent:W};m(X)}}else if(C.type||C.value){g.color=this.options.defaultColor;const I={...g,...C,controlComponent:r.ControlComponent.VALUE};(I.color===this.options.control.textFixColor||I.color===this.options.control.placeholderColor)&&(I.color=this.options.defaultColor),m(I)}}return f.length&&c.spliceElementList(i,T,0,f),l.startIndex+f.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:l,endIndex:s}=i;return this.control.getDraw().spliceElementList(n,l+1,s-l,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(l,t)),l}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange(),i=n.startIndex,l=n.endIndex;if(t.key===r.KeyMap.Backspace&&i===l&&i>0){const m=e[i-1],p=m?.controlComponent===r.ControlComponent.POSTFIX||m?.controlComponent===r.ControlComponent.POSTTEXTFIX,C=m?.controlComponent===r.ControlComponent.PLACEHOLDER,I=!!m?.controlId,M=this.draws.getPosition().getPositionList(),N=M[i],F=M[i-1],S=N&&F&&N.rowIndex===F.rowIndex;if((p||C)&&I&&S)return this.control.removeControl(i-1)}this.control.shrinkBoundary();const{startIndex:s,endIndex:a}=n,c=e[s],d=this.control.getDraw(),u=e[a+1],R=!!c?.originControlId&&!!c?.controlId&&c.originControlId!==c.controlId,h=R&&(c.controlComponent===r.ControlComponent.PREFIX||c.controlComponent===r.ControlComponent.PRE_TEXT||c.controlComponent===r.ControlComponent.PRETEXTFIX||c.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===r.ControlComponent.POSTFIX||c.controlComponent===r.ControlComponent.POST_TEXT||c.controlComponent===r.ControlComponent.POSTTEXTFIX||c.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===r.ControlComponent.PLACEHOLDER||c.controlComponent===r.ControlComponent.TEXTFIXLABEL),g=R&&c.control?.type===r.ControlType.BUTTON&&c.controlComponent===r.ControlComponent.VALUE,T=!!u?.originControlId&&!!u?.controlId&&u.originControlId!==u.controlId&&(u.controlComponent===r.ControlComponent.PREFIX||u.controlComponent===r.ControlComponent.PRE_TEXT||u.controlComponent===r.ControlComponent.PRETEXTFIX||u.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||u.controlComponent===r.ControlComponent.PLACEHOLDER||u.controlComponent===r.ControlComponent.TEXTFIXLABEL),f=!!u?.originControlId&&!!u?.controlId&&u.originControlId!==u.controlId&&u.control?.type===r.ControlType.BUTTON;if(t.key===r.KeyMap.Backspace){if(s===a&&(g||h&&c.controlComponent!==r.ControlComponent.POSTFIX&&c.controlComponent!==r.ControlComponent.POST_TEXT&&c.controlComponent!==r.ControlComponent.POSTTEXTFIX&&c.controlComponent!==r.ControlComponent.POSTTEXTFIX_TEXT))return this.control.removeControl(s);if(this.options.mode===r.EditorMode.FORM)this.strikeout();else{if(s!==a)return e.slice(s,a+1).some(C=>C.controlComponent===r.ControlComponent.POSTTEXTFIX||C.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)?s:(d.spliceElementList(e,s+1,a-s),this.getValue().length||this.control.addPlaceholder(s),s===0&&e[0].type===r.ElementType.SPLIT_TAG?d.fixPosition(!0)??s:s);{const m=e[s-1];return m?.controlId===c.controlId&&m?.originControlId===c.originControlId&&m?.controlComponent===r.ControlComponent.VALUE&&(c.controlComponent===r.ControlComponent.POSTFIX||c.controlComponent===r.ControlComponent.POST_TEXT||c.controlComponent===r.ControlComponent.POSTTEXTFIX||c.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)?(d.spliceElementList(e,s-1,1),this.getValue().length||this.control.addPlaceholder(s-2),s-2):c.controlComponent===r.ControlComponent.PRETEXTFIX||c.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===r.ControlComponent.POSTTEXTFIX||c.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===r.ControlComponent.TEXTFIXLABEL||c.controlComponent===r.ControlComponent.PLACEHOLDER?s:(d.spliceElementList(e,s,1),this.getValue().length||this.control.addPlaceholder(s-1),s===1&&e[0].type===r.ElementType.SPLIT_TAG||s===0?d.fixPosition(!0)??s-1:s-1)}}}else if(t.key===r.KeyMap.Delete){if(s===a&&(h||g))return this.control.removeControl(s);if(s===a&&(T||f))return this.control.removeControl(a+1);if(this.options.mode===r.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===r.ElementType.SPLIT_TAG?d.fixPosition(!0)??s:s):(u||d.getTd()?.linkTdNextId&&c.controlId&&this.removeNextControlElement(c.controlId),u&&((c.controlComponent===r.ControlComponent.PRETEXTFIX||c.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)&&(u.controlComponent===r.ControlComponent.PLACEHOLDER||u.controlComponent===r.ControlComponent.TEXTFIXLABEL)||u.controlComponent===r.ControlComponent.POSTTEXTFIX||u.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===r.ControlComponent.PLACEHOLDER||c.controlComponent===r.ControlComponent.TEXTFIXLABEL)?s:(d.spliceElementList(e,s+1,1),this.getValue().length||this.control.addPlaceholder(s),s===0&&e[0].type===r.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=ot(new Date).format("YYYY-MM-DD HH:mm:ss");if(s?.length){if(!this.element.strikeout){const d=s.findIndex(u=>!u.strikeout);s.forEach(u=>{u.deletePerson="SWJ",u.deleteTime=c,u.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 u=--a.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const h=u;this.draws.render({curIndex:h,isSetCursor:!0}),a.index=u,this.position.setCursorPosition(a),this.ranges.setRange(u,u)},100)}else{const{elementList:u,range:R}=this.control.mergeControl(n),h=R.startIndex;if(h>=0&&h<u.length&&u[h]?.metrics?.width!==void 0&&u[h].metrics.width<=0&&!u[h]?.strikeout){this.draws.spliceElementList(u,R.startIndex,1,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule});const g=!0,T=R.startIndex-1;this.draws.render({curIndex:T,isSetCursor:g}),a.index=T,delete a.value,this.position.setCursorPosition(a),this.ranges.setRange(T,T)}}}}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:l}=this.ranges.getRange(),a=this.draws.getElementList()[l];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}const Hh={indent:" ",divider:"────────────────"};class Wr{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:l,endIndex:s}=n;for(let a=l;a<=s;a++){const c=e[a];c.controlComponent===r.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e),s=this.control.getDraw(),{startIndex:a}=l,d=i[a].controlId;let u=a;for(let p=a;p>=0;p--){const C=i[p];if(C.controlId!==d)break;if(C.controlComponent===r.ControlComponent.PREFIX){u=p;break}}let R=a;for(let p=a;p<i.length;p++){const C=i[p];if(C.controlId!==d){R=p;break}if(C.controlComponent===r.ControlComponent.POSTFIX){R=p;break}}const h=u+1,g=R-1;g>=h&&s.spliceElementList(i,h,g-h+1);const T=i[u],f=Dt(T,["control","controlId",...Jt]),m=u+1;for(let p=0;p<t.length;p++){const C={...f,...t[p],value:t[p].value===`
|
|
110
|
+
`?k:t[p].value,controlComponent:r.ControlComponent.VALUE};(C.color===this.options.control.bracketColor||C.color===this.options.control.placeholderColor)&&(C.color=this.options.defaultColor),wt(i,[C],u,{editorOptions:this.options}),s.spliceElementList(i,m+p,0,[C])}return m+t.length-1}keydown(t){if(this.control.getIsDisabledControl()||this.options.mode===r.EditorMode.FORM)return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i}=n,l=e[i];if(t.key===r.KeyMap.Backspace||t.key===r.KeyMap.Delete){const s=l.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===r.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 l=e[i];l.controlId===n&&l.control&&l.control._justCreated&&(t=!0,delete l.control._justCreated)}t||this.showMenstrualHistoryDialog()}generateDisplayText(t){const{indent:e,divider:n}=Hh,{isMenopause:i,periodMin:l,periodMax:s,menarcheAge:a,cycleMin:c,cycleMax:d}=t,u=`${e}月经持续${l}~${s}天`,R=`${e}生理周期持续${c}~${d}天${k}`;let h;return i?h=`初潮年龄${a}岁${n}闭经年龄${t.menopauseAge||"_"}岁`:h=`初潮年龄${a}岁${n}末次日期${t.lastPeriod||"____-__-__"}`,`${k} ${u}
|
|
106
111
|
${h}
|
|
107
112
|
${R} `}textToElements(t){const e=[],n=t.split(`
|
|
108
|
-
`);return n.forEach((i,
|
|
113
|
+
`);return n.forEach((i,l)=>{for(let s=0;s<i.length;s++)e.push({value:i[s],controlComponent:r.ControlComponent.VALUE});l<n.length-1&&e.push({value:k,controlComponent:r.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
114
|
<div class="menstrual-history-modal__mask"></div>
|
|
110
115
|
<div class="menstrual-history-modal__container">
|
|
111
116
|
<div class="menstrual-history-modal__header">
|
|
@@ -181,8 +186,8 @@ ${R} `}textToElements(t){const e=[],n=t.split(`
|
|
|
181
186
|
<button class="btn-confirm">确认</button>
|
|
182
187
|
</div>
|
|
183
188
|
</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"]'),u=()=>{this.closeModal()};n.addEventListener("click",R=>{R.stopPropagation()}),e.addEventListener("click",u),i.addEventListener("click",u),r.addEventListener("click",u),d.forEach(R=>{R.addEventListener("change",()=>{const h=R.value==="true";a.style.display=h?"none":"block",c.style.display=h?"block":"none"})}),s.addEventListener("click",R=>{R.preventDefault(),R.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 C=T[P];C.controlId===m&&C.control&&(C.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()}}l.AreaMode=void 0,(function(o){o.EDIT="edit",o.READONLY="readonly",o.FORM="form"})(l.AreaMode||(l.AreaMode={}));class Oh{controlBorder;textFieldUnderline;draw;range;listener;eventBus;controlSearch;options;controlOptions;activeControl;activeControlValue;preElement;constructor(t){this.controlBorder=new Lc(t),this.textFieldUnderline=new Ch(t),this.draw=t,this.range=t.getRange(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.controlSearch=new pc(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,u=!!s?.originControlId;let R=!1;if(u){const p=s.originControlId;for(let I=t;I<n.length;I++){const L=n[I];if(L.controlId===p&&!L.originControlId){R=!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&&!R)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 u=n[d];if(u.controlId&&u.controlId!==r.controlId&&(u.controlComponent===l.ControlComponent.PRETEXTFIX||u.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT||u.controlComponent===l.ControlComponent.PREFIX||u.controlComponent===l.ControlComponent.PRE_TEXT))return!0;if(u.controlId&&u.controlId!==r.controlId&&(u.controlComponent===l.ControlComponent.POSTFIX||u.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 u=e;u<n.length;u++){const R=n[u];if(R.controlId===a&&!R.originControlId){if(R.controlComponent===l.ControlComponent.POSTTEXTFIX||R.controlComponent===l.ControlComponent.POSTTEXTFIX_TEXT||R.controlComponent===l.ControlComponent.POSTFIX||R.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 u=c!==-1?c:s,R=d!==-1?d-1:a;return{controlId:e,originControlId:n,parentControlId:r,startIndex:u,endIndex:R<u?u:R}}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 Mn||this.activeControl instanceof Yn||this.activeControl instanceof Dn||this.activeControl instanceof $e){const u=this.activeControl.getElement();n?.controlId!==u?.controlId?this.destroyControl():n.controlComponent===l.ControlComponent.POSTFIX?this.activeControl.destroy():this.activeControl.awake()}if(this.activeControl){const u=this.activeControl.getElement(),R=n.controlId,h=u.controlId;if(R&&R===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(!R){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 u=n.originControlId;for(let R=this.range.getRange().startIndex;R>=0;R--){const h=t[R];if(h.controlId===u&&!h.originControlId&&h.control){r=h.control,s=h;break}if(h.controlId===u&&!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 u=this.getElementList();for(let R=this.range.getRange().startIndex;R>=0;R--){const h=u[R];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 u=n.controlId;for(let R=this.range.getRange().startIndex;R>=0;R--){const h=t[R];if(h.controlId===u&&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 Si(s,this);else if(r.type===l.ControlType.SELECT){const u=new Mn(s,this);this.activeControl=u,(d||this.draw.getMode()===l.EditorMode.FORM)&&u.awake()}else if(r.type===l.ControlType.CHECKBOX)this.activeControl=new _n(s,this);else if(r.type===l.ControlType.RADIO)this.activeControl=new Ko(s,this);else if(r.type===l.ControlType.DATE){const u=new Yn(s,this);this.activeControl=u,u.awake()}else if(r.type===l.ControlType.NUMBER){const u=new Dn(s,this);this.activeControl=u,d&&u.awake()}else if(r.type===l.ControlType.BUTTON){const u=new $e(s,this);if(this.activeControl=u,d){u.awake();return}}else if(r.type===l.ControlType.MENSTRUAL_HISTORY){const u=new fr(s,this);this.activeControl=u,u.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 Mn||this.activeControl instanceof Yn||this.activeControl instanceof Dn||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=Mt(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 Yn||this.activeControl instanceof Mn)&&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.hide||a.control?.hide||a.area?.hide){const d=Ge(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 u=s[d];if(u.controlId!==a.controlId||u.controlComponent!==l.ControlComponent.PREFIX&&u.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 u=s[d];if(u.controlId!==a.controlId||u.controlComponent===l.ControlComponent.VALUE||u.controlComponent===l.ControlComponent.PREFIX||u.controlComponent===l.ControlComponent.PRE_TEXT||u.controlComponent===l.ControlComponent.PRETEXTFIX||u.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 u=s[d];if(u.controlId!==a.controlId||u.controlComponent===l.ControlComponent.VALUE||u.controlComponent===l.ControlComponent.PREFIX||u.controlComponent===l.ControlComponent.PRE_TEXT||u.controlComponent===l.ControlComponent.PRETEXTFIX||u.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 u=s[d];if(u.controlId!==a.controlId||u.controlComponent!==l.ControlComponent.PRETEXTFIX&&u.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,u=i.control?.type===l.ControlType.BUTTON&&!i.control?.buttonText?`${c}_text`:"";let R=t;for(;R>=0;){const L=n[R];let P=!1;if(a?P=L.controlId===c&&L.originControlId===d:P=L.controlId===c&&!L.originControlId,!P){r=R;break}R--}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(u)for(let L=n.length-1;L>=0;L--)n[L].controlId===u&&(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 u=ct(r.placeholder),R=Dt(i,At),h=s+1;for(let g=0;g<u.length;g++){const f=u[g],T={...R,value:f===`
|
|
185
|
-
`?_:f,controlId:i.controlId,type:l.ElementType.CONTROL,control:i.control,controlComponent:l.ControlComponent.PLACEHOLDER,color:this.controlOptions.placeholderColor};wt(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=(u,R)=>{let h=0;for(;h<u.length;){const g=u[h];if(h++,g.type===l.ElementType.TABLE){const P=g.trList;for(let C=0;C<P.length;C++){const S=P[C];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),R):c(N.value,R))}}}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<u.length;){const P=u[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(se(P,No))),p++}if(f===l.ControlType.TEXT||f===l.ControlType.TEXTFIELD||f===l.ControlType.DATE||f===l.ControlType.NUMBER)s.push({...g.control,zone:R,value:I||null,innerText:I||null,elementList:Mt(L)});else if(f===l.ControlType.SELECT||f===l.ControlType.CHECKBOX||f===l.ControlType.RADIO){const P=T?.split(",").map(C=>m?.find(S=>S.code===C)?.value).filter(Boolean).join("");s.push({...g.control,zone:R,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:u,elementList:R}of d)c(R,u);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 C=L[P];for(let S=0;S<C.tdList.length;S++){const F=C.tdList[S];i(F.value,F.id)}}}if(!d.control||d.type===l.ElementType.SPLIT_TAG)continue;const u=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(!u)continue;const{value:R,isSubmitHistory:h=!0}=u;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(R)?R:R?[{value:R}]:[];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(R)?R:R?[{value:R}]:[];L.length&&bt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new Si(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(R))continue;const L=new Mn(d,this);this.activeControl=L,R?L.setSelect(R,m,p):L.clearSelect(m,p)}else if(g===l.ControlType.CHECKBOX){if(Array.isArray(R))continue;const L=new _n(d,this);this.activeControl=L;const P=R?R.split(","):[];L.setSelect(P,m,p)}else if(g===l.ControlType.RADIO){if(Array.isArray(R))continue;const L=new Ko(d,this);this.activeControl=L;const P=R?[R]:[];L.setSelect(P,m,p)}else if(g===l.ControlType.DATE){const L=new Yn(d,this);this.activeControl=L,Mo(R)?(R.length&&bt(R,{isHandleFirstElement:!1,editorOptions:this.options}),L.setValue(R,m,p)):$r(R)?L.setSelect(R,m,p):L.clearSelect(m,p)}else if(g===l.ControlType.NUMBER){const L=Array.isArray(R)?R:R?[{value:R}]:[];L.length&&bt(L,{isHandleFirstElement:!1,editorOptions:this.options});const P=new Dn(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(R)?R:R?[{value:R}]:[];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 u=s.trList;for(let R=0;R<u.length;R++){const h=u[R];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(u=>u.id&&s.controlId===u.id||u.conceptId&&s.control.conceptId===u.conceptId||u.areaId&&s.areaId===u.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:u,isSubmitHistory:R=!0}=d;if(e=!0,R&&(n=!0),this.setControlProperties({...c.control,...u,value:c.control.value},{elementList:s,range:{startIndex:a-1,endIndex:a-1}}),At.forEach(g=>{const f=u[g];f&&Reflect.set(c,g,f)}),c.control?.type===l.ControlType.NUMBER&&u.numberExclusiveOptions){const g={...c.control.numberExclusiveOptions,...u.numberExclusiveOptions},f=g?.minValue,T=g?.maxValue,m=new Dn(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=Mt(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 u=0;u<d.tdList.length;u++){const h=d.tdList[u].value;e(h)}}}if(s.controlId){const a=se(s,[...Xo,...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 Mt(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 t=this.activeControl.getElement(),e=this.getControlKey(t);if(!e)return null;const n=this.getOrderedNavigableControlContexts(),i=n.findIndex(r=>r.controlKey===e);return i<=0?null:n[i-1]}getNextControlContext(){if(!this.activeControl)return null;const t=this.activeControl.getElement(),e=this.getControlKey(t);if(!e)return null;const n=this.getOrderedNavigableControlContexts(),i=n.findIndex(r=>r.controlKey===e);return i===-1||i>=n.length-1?null:n[i+1]}initNextControl(t={}){const{direction:e=Ut.DOWN}=t;let n=null;if(e===Ut.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})}getControlKey(t){return t?.controlId?`${t.controlId}_${t.originControlId||""}`:null}getControlStartIndex(t,e){const n=this.getControlKey(t[e]);if(!n)return e;let i=e;for(;i>0&&this.getControlKey(t[i-1])===n;)i--;return i}getControlEnterIndex(t,e){const n=this.getControlStartIndex(t,e),i=this.getControlKey(t[n]);if(!i)return e;let r=n,s=n;for(;s<t.length;){const a=t[s];if(this.getControlKey(a)!==i)break;if(a.controlComponent===l.ControlComponent.PREFIX||a.controlComponent===l.ControlComponent.PRE_TEXT||a.controlComponent===l.ControlComponent.PRETEXTFIX||a.controlComponent===l.ControlComponent.PRETEXTFIX_TEXT){r=s,s++;continue}return r}return r}isNavigableControlElement(t,e){return!t?.controlId||!t.control?!1:this.options.mode!==l.EditorMode.FORM?!0:!(vt(t)||e?.disabled||t.area?.mode===l.AreaMode.READONLY||t.control.disabled||t.control.readonly||t.control.buttonText||t.control.type===l.ControlType.TEXTFIELD&&!t.originControlId)}getOrderedNavigableControlContexts(){const t=[],e=(n,i,r)=>{let s=0;for(;s<n.length;){const a=n[s];if(a.type===l.ElementType.TABLE){const d=a.trList||[];for(let u=0;u<d.length;u++){const R=d[u],h=R.tdList;for(let g=0;g<h.length;g++){const f=h[g];e(f.value,{isTable:!0,index:s,trIndex:u,tdIndex:g,tdId:f.id,trId:R.id,tableId:a.id},f)}}s++;continue}const c=this.getControlKey(a);c&&this.isNavigableControlElement(a,r)&&t[t.length-1]?.controlKey!==c&&t.push({controlKey:c,positionContext:{...i},nextIndex:this.getControlEnterIndex(n,s)}),s++}};return e(this.draw.getOriginalElementList(),{isTable:!1}),t}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 u=n.metrics.width,R=e.elementList.length-1;for(;R>=0;){const h=e.elementList[R];if(u+=h.metrics.width,e.elementList[R-1]?.controlComponent===l.ControlComponent.PREFIX){c=h;break}R--}c&&u<a&&(n.control.rowFlex===l.RowFlex.CENTER?c.left=(a-u)/2:n.control.rowFlex===l.RowFlex.RIGHT&&(c.left=a-u-n.metrics.width))}const d=a-i;if(d>0){const u=c?.left||0,R=r-e.width-n.metrics.width,h=Math.min(R,d);n.left=h-u,e.width+=h-u}}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 u=!1,R=i,h=s,g=e;for(;R>=0;){const p=g[R];if(p.controlId!==a.controlId)break;if(p.type!==l.ElementType.SPLIT_TAG&&(d.unshift(p),u&&(g.splice(R,1),e[0].type===l.ElementType.SPLIT_TAG?e.splice(0,1):(n.startIndex++,n.endIndex++),e.unshift(p)),c.startIndex=R),R===0&&p.controlComponent!==l.ControlComponent.PREFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){g=h.value,R=h.value.length-1,u=!0;continue}if(R===0&&p.controlComponent!==l.ControlComponent.PRETEXTFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){g=h.value,R=h.value.length-1,u=!0;continue}R--}u=!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),u&&(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,u=!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,u=!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 Ch{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}}function Tr(o,t){const e=n=>{for(let i=0;i<n.length;i++){const r=n[i];if(t(r),r.valueList?.length&&e(r.valueList),r.control?.value?.length&&e(r.control.value),r.type===l.ElementType.TABLE&&r.trList?.length)for(let s=0;s<r.trList.length;s++){const a=r.trList[s];for(let c=0;c<a.tdList.length;c++)e(a.tdList[c].value)}}};e(o)}function Sh(o){const t=o.control;return t?t.type===l.ControlType.TEXT||t.type===l.ControlType.TEXTFIELD||t.type===l.ControlType.DATE||t.type===l.ControlType.NUMBER?xe(t.value||[])||null:(t.type===l.ControlType.SELECT||t.type===l.ControlType.CHECKBOX||t.type===l.ControlType.RADIO)&&t.code?.split(",").map(e=>t.valueSets?.find(n=>n.code===e)?.value).filter(Boolean).join("")||null:null}function Eh(o){const t=new Map,e=new Set,n=new Set,i=(r,s,a)=>{if(!r||s==null)return;const c=t.get(r)||[];c.push({label:r,source:a,value:s}),t.set(r,c)};return Tr(o,r=>{r.control&&r.controlId&&!e.has(r.controlId)&&(e.add(r.controlId),i(r.control.label,Sh(r),"control"));const s=r.id;if(s&&!n.has(s)&&(r.type===l.ElementType.MACRO||r.type===l.ElementType.CUSTOM_MACRO||r.type===l.ElementType.REUSABLE_ITEM)){n.add(s);let a;r.type===l.ElementType.MACRO?a=r.value:r.type===l.ElementType.CUSTOM_MACRO?a=r.macroConfig?.value:r.type===l.ElementType.REUSABLE_ITEM&&(a=r.reusableItemConfig?.value),i(r.label,a,"macro")}}),t}function mr(o,t){const{label:e,regex:n,source:i="all"}=o;if(!e||!n)return!1;const r=t.get(e);if(!r?.length)return!1;let s;try{s=new RegExp(n)}catch(a){return console.warn("子模板匹配正则无效:",n,a),!1}return r.some(a=>i!=="all"&&a.source!==i?!1:s.test(a.value))}function Xh(o,t,e="and"){return o?.length?e==="or"?o.some(n=>mr(n,t)):o.every(n=>mr(n,t)):!0}class Nh{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:u,verticalAlign:R},scale:h}=this.options,{metrics:g,checkbox:f}=r.elementList[i];if(R===l.VerticalAlign.TOP||R===l.VerticalAlign.MIDDLE){let L=i+1,P=null;for(;L<r.elementList.length&&(P=r.elementList[L],!(P.value!==_&&P.value!==To));)L++;if(P){const{metrics:{boundingBoxAscent:C,boundingBoxDescent:S}}=P,F=C+S;F>g.height&&(R===l.VerticalAlign.TOP?s-=C-g.height:R===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=u,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 Fh{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:u,verticalAlign:R},scale:h}=this.options,{metrics:g,radio:f}=r.elementList[i];if(R===l.VerticalAlign.TOP||R===l.VerticalAlign.MIDDLE){let L=i+1,P=null;for(;L<r.elementList.length&&(P=r.elementList[L],!(P.value!==_&&P.value!==To));)L++;if(P){const{metrics:{boundingBoxAscent:C,boundingBoxDescent:S}}=P,F=C+S;F>g.height&&(R===l.VerticalAlign.TOP?s-=C-g.height:R===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:u,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 go={fontSize:11,smallFontSize:9,lineHeight:12,dividerWidth:40,gap:4,totalHeight:36};class yh{draw;options;inputModal=null;isPopup=!1;constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=go,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"),u=t.menstrualData;d.font=`${i}px "Microsoft YaHei", sans-serif`;let R=a;d.font=`${r}px "Microsoft YaHei", sans-serif`;let h=0;if(u){const f=this.getValue(u.menarcheAge);d.font=`${i}px "Microsoft YaHei", sans-serif`,f&&(R+=d.measureText(`${f}岁`).width+s);let T="";if(u.isMenopause){const P=this.getValue(u.menopauseAge);P&&(T=`${P}岁`)}else{const P=this.getValue(u.lastPeriod);P&&(T=P)}T&&(R+=d.measureText(T).width+s),d.font=`${r}px "Microsoft YaHei", sans-serif`;const m=this.getValue(u.periodMin),p=this.getValue(u.periodMax);if(m||p){const P=`${m||""}~${p||""}`;h=Math.max(h,d.measureText(P).width)}const I=this.getValue(u.cycleMin),L=this.getValue(u.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(R,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=`${go.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=go,s=r.fontSize*i,a=r.lineHeight*i,c=r.dividerWidth*i,d=n-a*1.5,u=e+c/2;t.font=`${s}px "Microsoft YaHei", sans-serif`;const R=t.measureText("~").width,h=u-R/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=go,a=s.fontSize*r,c=s.smallFontSize*r,d=s.lineHeight*r,u=s.gap*r,R=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 O=`${f}岁`;t.fillText(O,e,g),T=e+t.measureText(O).width+u}const m=T+R/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 C=t.measureText(P).width,S=m-C/2;t.fillText(P,S,p),this.drawDivider(t,T,g-a/2,R,r),t.font=`${a}px "Microsoft YaHei", sans-serif`;let F="";if(i.isMenopause){const O=this.getValue(i.menopauseAge);O&&(F=`${O}岁`)}else{const O=this.getValue(i.lastPeriod);O&&(F=O)}F&&t.fillText(F,T+R+u,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 E="";V||Y?E=`${V||""}~${Y||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,E="~");const W=t.measureText(E).width,X=m-W/2;t.fillText(E,X,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=`
|
|
189
|
+
`,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"),l=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"]'),u=()=>{this.closeModal()};n.addEventListener("click",R=>{R.stopPropagation()}),e.addEventListener("click",u),i.addEventListener("click",u),l.addEventListener("click",u),d.forEach(R=>{R.addEventListener("change",()=>{const h=R.value==="true";a.style.display=h?"none":"block",c.style.display=h?"block":"none"})}),s.addEventListener("click",R=>{R.preventDefault(),R.stopPropagation();const h=this.inputModal;if(!h)return;const g=h.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let T;g?T={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||"_"}:T={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 f=this.control.getElementList(),m=this.element.controlId;for(let P=0;P<f.length;P++){const M=f[P];M.controlId===m&&M.control&&(M.control.menstrualData=T)}const p=this.generateDisplayText(T),C=this.textToElements(p);this.closeModal();const I=this.setValue(C);I!==-1&&(this.control.repaintControl({curIndex:I}),this.control.emitControlContentChange({}))})}closeModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}destroy(){this.closeModal()}}class _h{controlBorder;textFieldUnderline;draw;range;listener;eventBus;controlSearch;options;controlOptions;activeControl;activeControlValue;preElement;constructor(t){this.controlBorder=new Qc(t),this.textFieldUnderline=new Ah(t),this.draw=t,this.range=t.getRange(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.controlSearch=new Zc(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===r.ElementType.TABLE){const i=e.trList;for(let l=0;l<i.length;l++){const s=i[l];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===r.ControlType.MENSTRUAL_HISTORY&&this.options.mode===r.EditorMode.PRINT&&(e.controlComponent===r.ControlComponent.PREFIX||e.controlComponent===r.ControlComponent.POSTFIX)||e.control?.type===r.ControlType.SELECT&&this.options.mode===r.EditorMode.PRINT&&(e.controlComponent===r.ControlComponent.PREFIX||e.controlComponent===r.ControlComponent.POSTFIX)||e.control?.type===r.ControlType.NUMBER&&this.options.mode===r.EditorMode.PRINT&&(e.controlComponent===r.ControlComponent.PREFIX||e.controlComponent===r.ControlComponent.POSTFIX)||e.control?.type===r.ControlType.TEXT&&this.options.mode===r.EditorMode.PRINT&&e.strikeout&&e.deletePerson)return!1;if(e.control?.minWidth){if(e.controlComponent===r.ControlComponent.PREFIX||e.controlComponent===r.ControlComponent.POSTFIX)return e.value="",!0}else{const i=this.options.mode===r.EditorMode.FORM;if(e.control?.preText&&e.controlComponent===r.ControlComponent.PRE_TEXT){if(i)return!0;let l=!1,s=n+1;for(;s<t.length;){const a=t[s];if(e.controlId!==a.controlId)break;if(a.controlComponent===r.ControlComponent.VALUE){l=!0;break}s++}return l}if(e.control?.postText&&e.controlComponent===r.ControlComponent.POST_TEXT){if(i)return!0;let l=!1,s=n-1;for(;s<t.length;){const a=t[s];if(e.controlId!==a.controlId)break;if(a.controlComponent===r.ControlComponent.VALUE){l=!0;break}s--}return l}}if(e.control?.preTextFix&&e.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT){let i=!1,l=n+1;for(;l<t.length;){const s=t[l];if(e.controlId!==s.controlId)break;if(s.controlComponent===r.ControlComponent.VALUE){i=!0;break}l++}return i}if(e.control?.postTextFix&&e.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT){let i=!1,l=n-1;for(;l<t.length;){const s=t[l];if(e.controlId!==s.controlId)break;if(s.controlComponent===r.ControlComponent.VALUE){i=!0;break}l--}return i}return e.controlComponent!==r.ControlComponent.PREFIX&&e.controlComponent!==r.ControlComponent.POSTFIX&&e.controlComponent!==r.ControlComponent.PLACEHOLDER&&e.controlComponent!==r.ControlComponent.PRETEXTFIX&&e.controlComponent!==r.ControlComponent.POSTTEXTFIX&&e.controlComponent!==r.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===r.ControlComponent.PLACEHOLDER)return!1;if(t===e&&t>0){const s=n[t-1],a=s?.controlComponent===r.ControlComponent.POSTFIX||s?.controlComponent===r.ControlComponent.POSTTEXTFIX,c=s?.controlComponent===r.ControlComponent.PLACEHOLDER,d=!!s?.controlId,u=!!s?.originControlId;let R=!1;if(u){const p=s.originControlId;for(let C=t;C<n.length;C++){const I=n[C];if(I.controlId===p&&!I.originControlId){R=!0;break}if(I.controlId&&I.controlId!==p&&I.originControlId!==p)break}}const g=this.draw.getPosition().getPositionList(),T=g[t],f=g[t-1],m=T&&f&&T.rowIndex===f.rowIndex;if((a||c)&&d&&m&&!R)return!1}if(t===e&&(i.controlComponent===r.ControlComponent.POSTFIX||i.controlComponent===r.ControlComponent.POSTTEXTFIX))return!0;const l=n[e];return!!(i.controlId&&i.controlId===l.controlId&&l.controlComponent!==r.ControlComponent.POSTFIX&&l.controlComponent!==r.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===r.ControlComponent.POSTFIX||i.controlComponent===r.ControlComponent.POSTTEXTFIX}getIsRangeWithinControl(){const{range:{startIndex:t,endIndex:e},elementList:n}=this.range.getRangeElement();if(!~t&&!~e)return!1;const i=n[t],l=n[e];if(i?.controlId&&i.controlId===l.controlId&&l.controlComponent!==r.ControlComponent.POSTFIX&&l.controlComponent!==r.ControlComponent.POSTTEXTFIX&&l.controlComponent!==r.ControlComponent.POSTTEXTFIX_TEXT&&l.controlComponent!==r.ControlComponent.POST_TEXT)return!0;if(l?.originControlId&&(l.controlComponent===r.ControlComponent.POSTFIX||l.controlComponent===r.ControlComponent.POSTTEXTFIX)){const s=l.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(!l?.originControlId&&l?.controlId&&(l.controlComponent===r.ControlComponent.POSTFIX||l.controlComponent===r.ControlComponent.POSTTEXTFIX)){const s=n[e+1];if(s?.controlId&&s.controlId!==l.controlId&&(s.controlComponent===r.ControlComponent.PREFIX||s.controlComponent===r.ControlComponent.PRETEXTFIX))return!0;if(s?.controlId&&s.controlId!==l.controlId&&(s.controlComponent===r.ControlComponent.POSTFIX||s.controlComponent===r.ControlComponent.POSTTEXTFIX))return s.originControlId,!0;for(let a=e;a>=0;a--){const c=n[a];if(c.controlId===l.controlId&&(c.controlComponent===r.ControlComponent.PREFIX||c.controlComponent===r.ControlComponent.PRETEXTFIX)){for(let d=a-1;d>=0;d--){const u=n[d];if(u.controlId&&u.controlId!==l.controlId&&(u.controlComponent===r.ControlComponent.PRETEXTFIX||u.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||u.controlComponent===r.ControlComponent.PREFIX||u.controlComponent===r.ControlComponent.PRE_TEXT))return!0;if(u.controlId&&u.controlId!==l.controlId&&(u.controlComponent===r.ControlComponent.POSTFIX||u.controlComponent===r.ControlComponent.POSTTEXTFIX))break}break}}}if(l?.originControlId){const s=l.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===r.ControlComponent.PRETEXTFIX||d.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||d.controlComponent===r.ControlComponent.PREFIX||d.controlComponent===r.ControlComponent.PRE_TEXT)for(let u=e;u<n.length;u++){const R=n[u];if(R.controlId===a&&!R.originControlId){if(R.controlComponent===r.ControlComponent.POSTTEXTFIX||R.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||R.controlComponent===r.ControlComponent.POSTFIX||R.controlComponent===r.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 l=t[i];l.controlComponent===r.ControlComponent.PREFIX||l.controlComponent===r.ControlComponent.PRETEXTFIX?e++:(l.controlComponent===r.ControlComponent.POSTFIX||l.controlComponent===r.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 l=(t.elementList||this.getElementList())[e];if(l.controlComponent===r.ControlComponent.POSTFIX||l.controlComponent===r.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===r.ControlComponent.POSTFIX?!1:!!this.activeControl.getElement()?.control?.pasteDisabled}getIsExistValueByElementListIndex(t,e){const n=t[e];if(!n.controlId)return!1;if(n.control?.type===r.ControlType.CHECKBOX||n.control?.type===r.ControlType.RADIO)return!!n.control?.code;if(n.controlComponent===r.ControlComponent.VALUE)return!0;if(n.controlComponent===r.ControlComponent.PLACEHOLDER)return!1;if(n.controlComponent===r.ControlComponent.PREFIX||n.controlComponent===r.ControlComponent.PRE_TEXT){let i=e+1;for(;i<t.length;){const l=t[i];if(l.controlId!==n.controlId)return!1;if(l.controlComponent===r.ControlComponent.VALUE)return!0;if(l.controlComponent===r.ControlComponent.PLACEHOLDER)return!1;i++}}if(n.controlComponent===r.ControlComponent.PRETEXTFIX||n.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT){let i=e+1;for(;i<t.length;){const l=t[i];if(l.controlId!==n.controlId)return!1;if(l.controlComponent===r.ControlComponent.VALUE)return!0;if(l.controlComponent===r.ControlComponent.PLACEHOLDER||l.controlComponent===r.ControlComponent.TEXTFIXLABEL)return!1;i++}}if(n.controlComponent===r.ControlComponent.POSTFIX||n.controlComponent===r.ControlComponent.POSTTEXTFIX){let i=e-1;for(;i>=0;){const l=t[i];if(l.controlId!==n.controlId)return!1;if(l.controlComponent===r.ControlComponent.VALUE)return!0;if(l.controlComponent===r.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 l=n;for(;l>0;){const a=e[l];if(a.controlId!==i.controlId||a.controlComponent===r.ControlComponent.PREFIX||a.controlComponent===r.ControlComponent.PRE_TEXT||a.controlComponent===r.ControlComponent.PRETEXTFIX||a.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)break;l--}let s=n+1;for(;s<e.length;){const a=e[s];if(a.controlId!==i.controlId||a.controlComponent===r.ControlComponent.POSTFIX||a.controlComponent===r.ControlComponent.POST_TEXT||a.controlComponent===r.ControlComponent.POSTTEXTFIX||a.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)break;s++}return l===s?null:{startIndex:l,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!==r.ControlType.TEXT)return null;const i=this.getElementList(),l=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===r.ControlComponent.PREFIX||g.controlComponent===r.ControlComponent.PRE_TEXT||g.controlComponent===r.ControlComponent.PRETEXTFIX||g.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)&&(c=h),d===-1&&(g.controlComponent===r.ControlComponent.POSTFIX||g.controlComponent===r.ControlComponent.POST_TEXT||g.controlComponent===r.ControlComponent.POSTTEXTFIX||g.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)&&(d=h))}if(s===-1)return null;const u=c!==-1?c:s,R=d!==-1?d-1:a;return e?{controlId:e,originControlId:n,parentControlId:l,startIndex:u,endIndex:R<u?u:R}:null}getActiveNestedTextLimit(){const t=this.getActiveTextControlLimit();return!t?.parentControlId||!this.getElementList().some(n=>n.controlId===t.parentControlId&&!n.originControlId&&n.control?.type===r.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 l=[];let s=n;for(;s>0;){const c=e[s];if(c.controlId!==i.controlId)break;l.unshift(c),s--}let a=n+1;for(;a<e.length;){const c=e[a];if(c.controlId!==i.controlId)break;l.push(c),a++}return l}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,l=this.activeControl.getElement();i?.length?n=i[0].control:(n=Qe(dt(l)).control,n.value=[]);const s={state:t,control:n,controlId:l.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 Xn||this.activeControl instanceof Qn||this.activeControl instanceof vn||this.activeControl instanceof qe){const h=this.activeControl.getElement();n?.controlId!==h?.controlId?this.destroyControl():n.controlComponent===r.ControlComponent.POSTFIX?this.activeControl.destroy():this.activeControl.awake()}if(this.activeControl){const h=this.activeControl.getElement(),g=n.controlId,T=n.originControlId||null,f=h.controlId,m=h.originControlId||null;if(g&&g===f&&T===m){this.updateActiveControlValue(),this.preElement=n;return}if(n.originControlId&&n.originControlId===f&&T===m){const p=this.activeControl.getElement();if(!((p?.control?.type===r.ControlType.TEXTFIELD||p?.control?.type===r.ControlType.TEXT)&&n.controlId!==f)){this.updateActiveControlValue(),this.preElement=n;return}}if(n.originControlId&&n.controlId&&n.controlId,!n.originControlId&&n.controlId&&n.controlId!==f&&(this.activeControl.getElement()?.originControlId,n.controlId),n.controlId&&n.controlId===f&&n.originControlId){this.updateActiveControlValue(),this.preElement=n;return}if(!g){const p=this.getElementList(),C=this.getRange(),{startIndex:I}=C;let P=null;for(let M=I;M>=0;M--){const N=p[M];if(N.controlComponent===r.ControlComponent.PRETEXTFIX||N.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||N.controlComponent===r.ControlComponent.PREFIX||N.controlComponent===r.ControlComponent.PRE_TEXT){P=N.controlId||null;break}if(N.controlId&&N.controlId!==f||N.controlComponent===r.ControlComponent.POSTTEXTFIX||N.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||N.controlComponent===r.ControlComponent.POSTFIX||N.controlComponent===r.ControlComponent.POST_TEXT)break}if(P===f){this.updateActiveControlValue(),this.preElement=n;return}}}}if(this.destroyControl(),this.draw.isReadonly())return;let l=n.control,s=n;const a=h=>{if(!h)return null;const g=new Set;let T=h,f=null;for(;T&&!g.has(T);){g.add(T);let m;for(let p=0;p<t.length;p++){const C=t[p];if(C.controlId===T&&C.control?.type&&(m=C,C.controlComponent===r.ControlComponent.PREFIX||C.controlComponent===r.ControlComponent.PRE_TEXT||C.controlComponent===r.ControlComponent.PRETEXTFIX||C.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT))break}if(!m)break;m.control?.type===r.ControlType.TEXT&&(f=T),T=m.originControlId||null}return f};if(this.draw.getMode()===r.EditorMode.FORM&&n.control?.type===r.ControlType.TEXT&&!!n.originControlId&&(n.controlComponent===r.ControlComponent.PREFIX||n.controlComponent===r.ControlComponent.PRE_TEXT||n.controlComponent===r.ControlComponent.POSTFIX||n.controlComponent===r.ControlComponent.POST_TEXT||n.controlComponent===r.ControlComponent.PLACEHOLDER)){const h=a(n.originControlId);if(h){const g=t.find(T=>T.controlId===h&&!!T.control);g?.control?.type===r.ControlType.TEXT&&(l=g.control,s=g)}}if(n.originControlId&&!l){let h;for(let f=this.range.getRange().startIndex;f>=0;f--){const m=t[f];if(m.controlId===n.controlId&&m.originControlId===n.originControlId&&m.control&&(h=m.control,s=m,m.controlComponent===r.ControlComponent.PREFIX||m.controlComponent===r.ControlComponent.PRETEXTFIX||m.controlComponent===r.ControlComponent.PRE_TEXT||m.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)||m.controlId&&m.controlId!==n.controlId&&m.controlId!==n.originControlId&&m.originControlId!==n.originControlId)break}const g=n.originControlId;let T;for(let f=this.range.getRange().startIndex;f>=0;f--){const m=t[f];if(m.controlId===g&&m.control){T=m.control;break}if(m.controlId===g&&(m.controlComponent===r.ControlComponent.PRETEXTFIX||m.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||m.controlComponent===r.ControlComponent.PREFIX||m.controlComponent===r.ControlComponent.PRE_TEXT)){m.control&&(T=m.control);break}}if(this.draw.getMode()===r.EditorMode.FORM&&T?.type===r.ControlType.TEXTFIELD&&h&&h.type!==r.ControlType.TEXTFIELD)l=h;else if(T){l=T;const f=t.find(m=>m.controlId===g&&m.control);f&&(s=f)}else h&&(l=h)}else if(!l&&n.controlId){const h=this.getElementList();for(let g=this.range.getRange().startIndex;g>=0;g--){const T=h[g];if(T.controlId!==n.controlId)break;if(T.control){l=T.control,s=T;break}if(T.controlComponent===r.ControlComponent.PRETEXTFIX||T.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||T.controlComponent===r.ControlComponent.PREFIX||T.controlComponent===r.ControlComponent.PRE_TEXT)break}}if(!l)return;if(l?.type===r.ControlType.TEXTFIELD&&this.draw.getMode()!==r.EditorMode.EDIT)if(n.originControlId){const h=n.controlId;for(let g=this.range.getRange().startIndex;g>=0;g--){const T=t[g];if(T.controlId===h&&T.originControlId===n.originControlId&&T.control&&T.control.type!==r.ControlType.TEXTFIELD){l=T.control,s=T;break}if(T.controlComponent===r.ControlComponent.PREFIX||T.controlComponent===r.ControlComponent.PRETEXTFIX)break}if(l?.type===r.ControlType.TEXTFIELD)return}else return;const d=this.draw.getPosition().getPositionContext(),u=this.range.getRange().startIndex,R=!!(d.isDirectHit&&d.index===u&&t[d.index]?.controlId===s.controlId);if(l?.type===r.ControlType.TEXTFIELD)this.activeControl=new br(s,this);else if(l.type===r.ControlType.TEXT)this.activeControl=new Zi(s,this);else if(l.type===r.ControlType.SELECT){const h=new Xn(s,this);this.activeControl=h,(R||this.draw.getMode()===r.EditorMode.FORM)&&h.awake()}else if(l.type===r.ControlType.CHECKBOX)this.activeControl=new zn(s,this);else if(l.type===r.ControlType.RADIO)this.activeControl=new zo(s,this);else if(l.type===r.ControlType.DATE){const h=new Qn(s,this);this.activeControl=h,h.awake()}else if(l.type===r.ControlType.NUMBER){const h=new vn(s,this);this.activeControl=h,R&&h.awake()}else if(l.type===r.ControlType.BUTTON){const h=new qe(s,this);if(this.activeControl=h,R){h.awake();return}}else if(l.type===r.ControlType.MENSTRUAL_HISTORY){const h=new Wr(s,this);this.activeControl=h,h.awake()}this.updateActiveControlValue(),this.preElement=s,s.controlComponent!==r.ControlComponent.POSTFIX&&s.controlComponent!==r.ControlComponent.POSTTEXTFIX&&this.emitControlChange(r.ControlState.ACTIVE)}destroyControl(t={}){if(!this.activeControl)return;const{isEmitEvent:e=!0}=t;(this.activeControl instanceof Xn||this.activeControl instanceof Qn||this.activeControl instanceof vn||this.activeControl instanceof Wr)&&this.activeControl.destroy(),e&&this.preElement?.controlComponent!==r.ControlComponent.POSTFIX&&this.preElement?.controlComponent!==r.ControlComponent.POSTTEXTFIX&&this.emitControlChange(r.ControlState.INACTIVE),this.preElement=null,this.activeControl=null,this.activeControlValue=[]}repaintControl(t={}){const{curIndex:e,isCompute:n=!0,isSubmitHistory:i=!0,isSetCursor:l=!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:l,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:l}=t?.context?.range||this.getRange();if(!i[l]?.controlId)return;const s=t?.controlValue||this.getControlElementList(t?.context);let a;if(s?.length?a=Ct(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 Qn||this.activeControl instanceof Xn)&&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!==r.ControlComponent.VALUE&&t[e+1]?.controlComponent===r.ControlComponent.VALUE)return!1;let i=e;for(;i>0&&t[i].controlComponent===r.ControlComponent.VALUE;)i--;let l=e+1;for(;l<t.length;){if(t[l].controlComponent!==r.ControlComponent.VALUE){l--;break}l++}if(i!==l){const s=this.range.getRange();return this.range.replaceRange({...s,startIndex:i,endIndex:l}),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),!0}return!1}moveCursor(t){const{index:e,trIndex:n,tdIndex:i,tdValueIndex:l}=t;let s=this.draw.getOriginalElementList(),a;const c=t.isTable?l:e;if(t.isTable?(s=s[e].trList[n].tdList[i].value,a=s[l]):a=s[e],a.control?.hide||a.area?.hide){const d=dn(s,c);return{newIndex:d,newElement:s[d]}}if(a.controlComponent===r.ControlComponent.VALUE)return{newIndex:c,newElement:a};if(a.controlComponent===r.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===r.ControlComponent.PREFIX||a.controlComponent===r.ControlComponent.PRE_TEXT){let d=c+1;for(;d<s.length;){const u=s[d];if(u.controlId!==a.controlId||u.controlComponent!==r.ControlComponent.PREFIX&&u.controlComponent!==r.ControlComponent.PRE_TEXT)return{newIndex:d-1,newElement:s[d-1]};d++}}else if(a.controlComponent===r.ControlComponent.PLACEHOLDER){let d=c-1;for(;d>0;){const u=s[d];if(u.controlId!==a.controlId||u.controlComponent===r.ControlComponent.VALUE||u.controlComponent===r.ControlComponent.PREFIX||u.controlComponent===r.ControlComponent.PRE_TEXT||u.controlComponent===r.ControlComponent.PRETEXTFIX||u.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:s[d]};d--}}else if(a.controlComponent===r.ControlComponent.POST_TEXT||a.controlComponent===r.ControlComponent.TEXTFIXLABEL||a.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT){let d=c-1;for(;d>0;){const u=s[d];if(u.controlId!==a.controlId||u.controlComponent===r.ControlComponent.VALUE||u.controlComponent===r.ControlComponent.PREFIX||u.controlComponent===r.ControlComponent.PRE_TEXT||u.controlComponent===r.ControlComponent.PRETEXTFIX||u.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:s[d]};d--}}else if(a.controlComponent===r.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===r.ControlComponent.PRETEXTFIX||a.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT){let d=c+1;for(;d<s.length;){const u=s[d];if(u.controlId!==a.controlId||u.controlComponent!==r.ControlComponent.PRETEXTFIX&&u.controlComponent!==r.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:I=!0}=i.control;if(!I)return null;const P=this.draw.getMode();if(P===r.EditorMode.FORM&&this.options.modeRule[P].controlDeletableDisabled)return null}let l=-1,s=-1;const a=!!i.originControlId,c=i.controlId,d=i.originControlId,u=i.control?.type===r.ControlType.BUTTON&&!i.control?.buttonText?`${c}_text`:"";let R=t;for(;R>=0;){const I=n[R];let P=!1;if(a?P=I.controlId===c&&I.originControlId===d:P=I.controlId===c&&!I.originControlId,!P){l=R;break}R--}let h=t;for(;h<n.length;){const I=n[h];let P=!1;if(a?P=I.controlId===c&&I.originControlId===d:P=I.controlId===c&&!I.originControlId,!P){s=h-1;break}h++}if(h===n.length&&(s=h-1),!~l&&!~s)return t;l=~l?l:0;const g=n[l+1],T=g.control,f=T?.type&&[r.ControlType.TEXT,r.ControlType.TEXTFIELD,r.ControlType.DATE,r.ControlType.NUMBER,r.ControlType.SELECT,r.ControlType.BUTTON].includes(T.type);let m=n[0]?.type===r.ElementType.SPLIT_TAG;if(!e.removeNext&&f&&!a&&g.controlComponent!==r.ControlComponent.PREFIX&&g.type!==r.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const I=this.draw.getTd();I&&this.createRemoveControlHandler(I,i.controlId,!0)}if(!e.removeNext&&f&&!a&&g.controlComponent!==r.ControlComponent.PRETEXTFIX&&g.type!==r.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const I=this.draw.getTd();I&&this.createRemoveControlHandler(I,i.controlId,!0)}if(!e.removePrev&&f&&!a&&n[s].controlComponent!==r.ControlComponent.POSTFIX)if(e.removeNext)e.removeNext();else{const I=this.draw.getTd();m=!!I?.linkTdNextId,I&&this.createRemoveControlHandler(I,i.controlId,!1)}if(!e.removePrev&&f&&!a&&n[s].controlComponent!==r.ControlComponent.POSTTEXTFIX)if(e.removeNext)e.removeNext();else{const I=this.draw.getTd();m=!!I?.linkTdNextId,I&&this.createRemoveControlHandler(I,i.controlId,!1)}this.draw.spliceElementList(n,l+1,s-l);let p=0;if(u)for(let I=n.length-1;I>=0;I--)n[I].controlId===u&&(I<=l&&p++,n.splice(I,1));const C=l-p;return!e.elementList&&m&&l===0?this.draw.fixPosition(!0)??C:C}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],l=n[t+1];if(i.controlComponent===r.ControlComponent.PLACEHOLDER||i.controlComponent===r.ControlComponent.TEXTFIXLABEL||l?.controlComponent===r.ControlComponent.PLACEHOLDER||l?.controlComponent===r.ControlComponent.TEXTFIXLABEL){let s=!1,a=t;for(;a<n.length;){const c=n[a];if(c.controlId!==i.controlId)break;c.controlComponent===r.ControlComponent.PLACEHOLDER||c.controlComponent===r.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],l=i.control;if(!l.placeholder)return;let s=t;for(;s>=0;){const g=n[s];if(g.controlId!==i.controlId){s++;break}if(g.controlComponent===r.ControlComponent.PREFIX||g.controlComponent===r.ControlComponent.PRE_TEXT||g.controlComponent===r.ControlComponent.PRETEXTFIX||g.controlComponent===r.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===r.ControlComponent.PLACEHOLDER||g.controlComponent===r.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===r.ControlComponent.POSTFIX||g.controlComponent===r.ControlComponent.POST_TEXT||g.controlComponent===r.ControlComponent.POSTTEXTFIX||g.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)break}else if(g.controlId!==i.controlId&&(g.controlComponent===r.ControlComponent.VALUE||g.controlComponent===r.ControlComponent.PREFIX||g.controlComponent===r.ControlComponent.PRE_TEXT)){c=!0;break}d++}if(c)return;const u=Tt(l.placeholder),R=Dt(i,Jt),h=s+1;for(let g=0;g<u.length;g++){const T=u[g],f={...R,value:T===`
|
|
190
|
+
`?k:T,controlId:i.controlId,type:r.ElementType.CONTROL,control:i.control,controlComponent:r.ControlComponent.PLACEHOLDER,color:this.controlOptions.placeholderColor};wt(n,[f],s,{editorOptions:this.options}),this.draw.spliceElementList(n,h+g,0,[f])}}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(),l=n[i];let s=i;for(;s>0;){const c=n[s];if(c.controlId!==l.controlId)break;c.control={...c.control,...t},s--}let a=i+1;for(;a<n.length;){const c=n[a];if(c.controlId!==l.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:l}=t,s=[];if(!e&&!i&&!n)return s;const a=new Set,c=(u,R)=>{let h=0;for(;h<u.length;){const g=u[h];if(h++,g.type===r.ElementType.TABLE){const P=g.trList;for(let M=0;M<P.length;M++){const N=P[M];for(let F=0;F<N.tdList.length;F++){const S=N.tdList[F],W=S.originalId??S.id;a.has(W)||(a.add(W),S.linkTdNextId?c(this.draw.getSplitTdValues(W),R):c(S.value,R))}}}if(!g.control||n&&g.control.groupId!==n||e&&g.controlId!==e||i&&g.control.conceptId!==i||l&&g.areaId!==l)continue;const{type:T,code:f,valueSets:m}=g.control;let p=h,C="";const I=[];for(;p<u.length;){const P=u[p];if(P.controlId!==g.controlId)break;(T===r.ControlType.TEXT||T===r.ControlType.TEXTFIELD||T===r.ControlType.DATE||T===r.ControlType.NUMBER)&&P.controlComponent===r.ControlComponent.VALUE&&(C+=P.value,I.push(qt(P,wo))),p++}if(T===r.ControlType.TEXT||T===r.ControlType.TEXTFIELD||T===r.ControlType.DATE||T===r.ControlType.NUMBER)s.push({...g.control,zone:R,value:C||null,innerText:C||null,elementList:Ct(I)});else if(T===r.ControlType.SELECT||T===r.ControlType.CHECKBOX||T===r.ControlType.RADIO){const P=f?.split(",").map(M=>m?.find(N=>N.code===M)?.value).filter(Boolean).join("");s.push({...g.control,zone:R,value:f||null,innerText:P||null})}h=p}},d=[{zone:r.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:r.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:r.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:u,elementList:R}of d)c(R,u);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===r.ElementType.TABLE){const I=d.trList;for(let P=0;P<I.length;P++){const M=I[P];for(let N=0;N<M.tdList.length;N++){const F=M.tdList[N];i(F.value,F.id)}}}if(!d.control||d.type===r.ElementType.SPLIT_TAG)continue;const u=t.find(I=>(!I.groupId||I.groupId===d.control?.groupId)&&(I.id&&d.controlId===I.id||I.conceptId&&d.control.conceptId===I.conceptId||I.areaId&&d.areaId===I.areaId));if(!u)continue;const{value:R,isSubmitHistory:h=!0}=u;e=!0,h&&(n=!0);const{type:g}=d.control,{range:T,fullRange:f}=this.mergeControl({elementList:s,range:{startIndex:c,endIndex:c},tdId:a}),m={range:f??T,elementList:s,tdId:a},p={isIgnoreDisabledRule:!0,isIgnoreDeletedRule:!0};if(g===r.ControlType.TEXTFIELD){const I=Array.isArray(R)?R:R?[{value:R}]:[];I.length&&yt(I,{isHandleFirstElement:!1,editorOptions:this.options});const P=new br(d,this);this.activeControl=P,I.length?P.setValue(I,m,p):P.clearValue(m,p)}else if(g===r.ControlType.TEXT){const I=Array.isArray(R)?R:R?[{value:R}]:[];I.length&&yt(I,{isHandleFirstElement:!1,editorOptions:this.options});const P=new Zi(d,this);this.activeControl=P,I.length?P.setValue(I,m,p):P.clearValue(m,p)}else if(g===r.ControlType.SELECT){if(Array.isArray(R))continue;const I=new Xn(d,this);this.activeControl=I,R?I.setSelect(R,m,p):I.clearSelect(m,p)}else if(g===r.ControlType.CHECKBOX){if(Array.isArray(R))continue;const I=new zn(d,this);this.activeControl=I;const P=R?R.split(","):[];I.setSelect(P,m,p)}else if(g===r.ControlType.RADIO){if(Array.isArray(R))continue;const I=new zo(d,this);this.activeControl=I;const P=R?[R]:[];I.setSelect(P,m,p)}else if(g===r.ControlType.DATE){const I=new Qn(d,this);this.activeControl=I,bo(R)?(R.length&&yt(R,{isHandleFirstElement:!1,editorOptions:this.options}),I.setValue(R,m,p)):hl(R)?I.setSelect(R,m,p):I.clearSelect(m,p)}else if(g===r.ControlType.NUMBER){const I=Array.isArray(R)?R:R?[{value:R}]:[];I.length&&yt(I,{isHandleFirstElement:!1,editorOptions:this.options});const P=new vn(d,this);this.activeControl=P,I.length?P.setValue(I,m,p):P.clearValue(m,p)}else if(g===r.ControlType.BUTTON){const I=Array.isArray(R)?R:R?[{value:R}]:[];I.length&&yt(I,{isHandleFirstElement:!1,editorOptions:this.options});const P=new qe(d,this);this.activeControl=P,I.length?P.setValue(I,m,p):P.clearSelect(m,p)}this.emitControlContentChange({context:m}),this.activeControl=null;let C=c;for(;C<s.length&&s[C].controlId===d.controlId;)C++;c=C}};this.destroyControl({isEmitEvent:!1});const l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const s of l)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 l=0;for(;l<i.length;){const s=i[l];if(l++,s.type===r.ElementType.TABLE){const u=s.trList;for(let R=0;R<u.length;R++){const h=u[R];for(let g=0;g<h.tdList.length;g++){const T=h.tdList[g];e(T.value)}}}if(!s.control)continue;const a=t.find(u=>u.id&&s.controlId===u.id||u.conceptId&&s.control.conceptId===u.conceptId||u.areaId&&s.areaId===u.areaId);if(!a)continue;const{extension:c}=a;this.setControlProperties({extension:c},{elementList:i,range:{startIndex:l,endIndex:l}});let d=l;for(;d<i.length&&i[d].controlId===s.controlId;)d++;l=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===r.ElementType.TABLE){const g=c.trList;for(let T=0;T<g.length;T++){const f=g[T];for(let m=0;m<f.tdList.length;m++){const p=f.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:u,isSubmitHistory:R=!0}=d;if(e=!0,R&&(n=!0),this.setControlProperties({...c.control,...u,value:c.control.value},{elementList:s,range:{startIndex:a-1,endIndex:a-1}}),Jt.forEach(g=>{const T=u[g];T&&Reflect.set(c,g,T)}),c.control?.type===r.ControlType.NUMBER&&u.numberExclusiveOptions){const g={...c.control.numberExclusiveOptions,...u.numberExclusiveOptions},T=g?.minValue,f=g?.maxValue,m=new vn(c,this),p=m.getValue({elementList:s,range:{startIndex:a-1,endIndex:a-1}});if(p.length>0){const C=p.map(P=>P.value).join(""),I=Number(C);!Number.isNaN(I)&&Number.isFinite(I)&&(T!=null&&I<T||f!=null&&I>f)&&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}},l={header:this.draw.getHeaderElementList(),main:this.draw.getOriginalMainElementList(),footer:this.draw.getFooterElementList()};for(const s in l){const a=l[s];i(a)}if(e){for(const s in l){const a=s,c=Ct(l[a],{isClassifyArea:!0,extraPickAttrs:["id","controlId"]});l[a]=c,yt(c,{editorOptions:this.options,isForceCompensation:!0})}this.draw.setEditorData(l),n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1})}}getList(){const t=[];function e(i){for(let l=0;l<i.length;l++){const s=i[l];if(s.type===r.ElementType.TABLE){const a=s.trList;for(let c=0;c<a.length;c++){const d=a[c];for(let u=0;u<d.tdList.length;u++){const h=d.tdList[u].value;e(h)}}}if(s.controlId){const a=qt(s,[...Uo,...En]);t.push(a)}}}const n=[this.draw.getHeader().getElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooter().getElementList()];for(const i of n)e(i);return Ct(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 u=d;u>0;u--){const R=c[u];if(R.type===r.ElementType.TABLE){const g=R.trList||[];for(let T=g.length-1;T>=0;T--){const f=g[T],m=f.tdList;for(let p=m.length-1;p>=0;p--){const C=m[p],I=i(C.value,C.value.length-1);if(I)return{positionContext:{isTable:!0,index:u,trIndex:T,tdIndex:p,tdId:C.id,trId:f.id,tableId:R.id},nextIndex:I.nextIndex}}}}if(!R.controlId||R.controlId===n.controlId)continue;let h=u;for(;h>0;){const g=c[h];if(g.controlComponent===r.ControlComponent.VALUE||g.controlComponent===r.ControlComponent.PREFIX||g.controlComponent===r.ControlComponent.PRE_TEXT||g.controlComponent===r.ControlComponent.PRETEXTFIX||g.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)break;h--}return{positionContext:{isTable:!1},nextIndex:h}}return null}const{startIndex:l}=this.range.getRange(),s=this.getElementList(),a=i(s,l);if(a)return{positionContext:e.isTable?e:a.positionContext,nextIndex:a.nextIndex};if(n.tableId){const c=this.draw.getOriginalElementList(),{index:d,trIndex:u,tdIndex:R}=e,h=c[d].trList;for(let T=u;T>=0;T--){const f=h[T],m=f.tdList;for(let p=m.length-1;p>=0;p--){if(u===T&&p>=R)continue;const C=m[p],I=i(C.value,C.value.length-1);if(I)return{positionContext:{isTable:!0,index:e.index,trIndex:T,tdIndex:p,tdId:C.id,trId:f.id,tableId:n.tableId},nextIndex:I.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 u=d;u<c.length;u++){const R=c[u];if(R.type===r.ElementType.TABLE){const h=R.trList||[];for(let g=0;g<h.length;g++){const T=h[g],f=T.tdList;for(let m=0;m<f.length;m++){const p=f[m],C=i(p.value,0);if(C)return{positionContext:{isTable:!0,index:u,trIndex:g,tdIndex:m,tdId:p.id,trId:T.id,tableId:R.id},nextIndex:C.nextIndex}}}}if(!(!R.controlId||R.controlId===n.controlId||c[u+1]?.controlComponent===r.ControlComponent.PREFIX||c[u+1]?.controlComponent===r.ControlComponent.PRE_TEXT||c[u+1]?.controlComponent===r.ControlComponent.PRETEXTFIX||c[u+1]?.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT))return{positionContext:{isTable:!1},nextIndex:u}}return null}const{endIndex:l}=this.range.getRange(),s=this.getElementList(),a=i(s,l);if(a)return{positionContext:e.isTable?e:a.positionContext,nextIndex:a.nextIndex};if(n.tableId){const c=this.draw.getOriginalElementList(),{index:d,trIndex:u,tdIndex:R}=e,h=c[d].trList;for(let T=u;T<h.length;T++){const f=h[T],m=f.tdList;for(let p=0;p<m.length;p++){if(u===T&&p<=R)continue;const C=m[p],I=i(C.value,0);if(I)return{positionContext:{isTable:!0,index:e.index,trIndex:T,tdIndex:p,tdId:C.id,trId:f.id,tableId:n.tableId},nextIndex:I.nextIndex}}}const g=i(c,d+1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}initNextControl(t={}){const{direction:e=Ut.DOWN}=t;let n=null;if(e===Ut.UP?n=this.getPreControlContext():n=this.getNextControlContext(),!n)return;const{nextIndex:i,positionContext:l}=n,s=this.draw.getPosition();s.setPositionContext(l),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:l}=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===r.RowFlex.CENTER||n.control?.rowFlex===r.RowFlex.RIGHT)){let u=n.metrics.width,R=e.elementList.length-1;for(;R>=0;){const h=e.elementList[R];if(u+=h.metrics.width,e.elementList[R-1]?.controlComponent===r.ControlComponent.PREFIX){c=h;break}R--}c&&u<a&&(n.control.rowFlex===r.RowFlex.CENTER?c.left=(a-u)/2:n.control.rowFlex===r.RowFlex.RIGHT&&(c.left=a-u-n.metrics.width))}const d=a-i;if(d>0){const u=c?.left||0,R=l-e.width-n.metrics.width,h=Math.min(R,d);n.left=h-u,e.width+=h-u}}mergeControl(t={}){const e=t.elementList||this.getElementList(),n=t.range||this.getRange(),{startIndex:i}=n,l=t.tdId??this.draw.getPosition().getPositionContext().tdId,s=l?this.draw.getTdById(l):void 0,a=e[i];if(!a?.controlId)return{range:n,elementList:[],tdId:l};const c={startIndex:i,endIndex:i},d=[];let u=!1,R=i,h=s,g=e;for(;R>=0;){const p=g[R];if(p.controlId!==a.controlId)break;if(p.type!==r.ElementType.SPLIT_TAG&&(d.unshift(p),u&&(g.splice(R,1),e[0].type===r.ElementType.SPLIT_TAG?e.splice(0,1):(n.startIndex++,n.endIndex++),e.unshift(p)),c.startIndex=R),R===0&&p.controlComponent!==r.ControlComponent.PREFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){g=h.value,R=h.value.length-1,u=!0;continue}if(R===0&&p.controlComponent!==r.ControlComponent.PRETEXTFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){g=h.value,R=h.value.length-1,u=!0;continue}R--}u=!1;let T=i+1,f=s,m=e;for(;T<m.length;){const p=m[T];if(p.controlId!==a.controlId)break;if(p.type!==r.ElementType.SPLIT_TAG&&(d.push(p),u&&(m.splice(T,1),e.push(p),T--)),T===m.length-1&&p.controlComponent!==r.ControlComponent.POSTFIX&&f?.linkTdNextId&&(f=this.draw.getTdById(f.linkTdNextId),f)){m=f.value,T=0,u=!0;continue}if(T===m.length-1&&p.controlComponent!==r.ControlComponent.POSTTEXTFIX&&f?.linkTdNextId&&(f=this.draw.getTdById(f.linkTdNextId),f)){m=f.value,T=0,u=!0;continue}T++}return c.endIndex=c.startIndex+d.length,{range:n,elementList:e,tdId:l,fullRange:{startIndex:c.startIndex,endIndex:c.endIndex-2}}}}class Ah{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}}function Vr(o,t){const e=n=>{for(let i=0;i<n.length;i++){const l=n[i];if(t(l),l.valueList?.length&&e(l.valueList),l.control?.value?.length&&e(l.control.value),l.type===r.ElementType.TABLE&&l.trList?.length)for(let s=0;s<l.trList.length;s++){const a=l.trList[s];for(let c=0;c<a.tdList.length;c++)e(a.tdList[c].value)}}};e(o)}function Gh(o){const t=o.control;return t?t.type===r.ControlType.TEXT||t.type===r.ControlType.TEXTFIELD||t.type===r.ControlType.DATE||t.type===r.ControlType.NUMBER?ke(t.value||[])||null:(t.type===r.ControlType.SELECT||t.type===r.ControlType.CHECKBOX||t.type===r.ControlType.RADIO)&&t.code?.split(",").map(e=>t.valueSets?.find(n=>n.code===e)?.value).filter(Boolean).join("")||null:null}function xh(o){const t=new Map,e=new Set,n=new Set,i=(l,s,a)=>{if(!l||s==null)return;const c=t.get(l)||[];c.push({label:l,source:a,value:s}),t.set(l,c)};return Vr(o,l=>{l.control&&l.controlId&&!e.has(l.controlId)&&(e.add(l.controlId),i(l.control.label,Gh(l),"control"));const s=l.id;if(s&&!n.has(s)&&(l.type===r.ElementType.MACRO||l.type===r.ElementType.CUSTOM_MACRO||l.type===r.ElementType.REUSABLE_ITEM)){n.add(s);let a;l.type===r.ElementType.MACRO?a=l.value:l.type===r.ElementType.CUSTOM_MACRO?a=l.macroConfig?.value:l.type===r.ElementType.REUSABLE_ITEM&&(a=l.reusableItemConfig?.value),i(l.label,a,"macro")}}),t}function Dr(o,t){const{label:e,regex:n,source:i="all"}=o;if(!e||!n)return!1;const l=t.get(e);if(!l?.length)return!1;let s;try{s=new RegExp(n)}catch(a){return console.warn("子模板匹配正则无效:",n,a),!1}return l.some(a=>i!=="all"&&a.source!==i?!1:s.test(a.value))}function kh(o,t,e="and"){return o?.length?e==="or"?o.some(n=>Dr(n,t)):o.every(n=>Dr(n,t)):!0}class Jh{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:l}=t;let{y:s}=t;const{checkbox:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:u,verticalAlign:R},scale:h}=this.options,{metrics:g,checkbox:T}=l.elementList[i];if(R===r.VerticalAlign.TOP||R===r.VerticalAlign.MIDDLE){let I=i+1,P=null;for(;I<l.elementList.length&&(P=l.elementList[I],!(P.value!==k&&P.value!==Eo));)I++;if(P){const{metrics:{boundingBoxAscent:M,boundingBoxDescent:N}}=P,F=M+N;F>g.height&&(R===r.VerticalAlign.TOP?s-=M-g.height:R===r.VerticalAlign.MIDDLE&&(s-=(F-g.height)/2))}}const f=Math.round(n+a*h),m=Math.round(s-g.height+c),p=g.width-a*2*h,C=g.height;e.save(),e.beginPath(),e.translate(.5,.5),T?.value?(e.lineWidth=c,e.strokeStyle=d,e.rect(f,m,p,C),e.stroke(),e.beginPath(),e.fillStyle=d,e.fillRect(f,m,p,C),e.beginPath(),e.strokeStyle=u,e.lineWidth=c*2*h,e.moveTo(f+2*h,m+C/2),e.lineTo(f+p/2,m+C-3*h),e.lineTo(f+p-2*h,m+3*h),e.stroke()):(e.lineWidth=c,e.rect(f,m,p,C),e.stroke()),e.closePath(),e.restore()}}class Bh{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:l}=t;let{y:s}=t;const{radio:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:u,verticalAlign:R},scale:h}=this.options,{metrics:g,radio:T}=l.elementList[i];if(R===r.VerticalAlign.TOP||R===r.VerticalAlign.MIDDLE){let I=i+1,P=null;for(;I<l.elementList.length&&(P=l.elementList[I],!(P.value!==k&&P.value!==Eo));)I++;if(P){const{metrics:{boundingBoxAscent:M,boundingBoxDescent:N}}=P,F=M+N;F>g.height&&(R===r.VerticalAlign.TOP?s-=M-g.height:R===r.VerticalAlign.MIDDLE&&(s-=(F-g.height)/2))}}const f=Math.round(n+a*h),m=Math.round(s-g.height+c),p=g.width-a*2*h,C=g.height;e.save(),e.beginPath(),e.translate(.5,.5),e.strokeStyle=T?.value?d:u,e.lineWidth=c,e.arc(f+p/2,m+C/2,p/2,0,Math.PI*2),e.stroke(),T?.value&&(e.beginPath(),e.fillStyle=d,e.arc(f+p/2,m+C/2,p/3,0,Math.PI*2),e.fill()),e.closePath(),e.restore()}}const Mo={fontSize:11,smallFontSize:9,lineHeight:12,dividerWidth:40,gap:4,totalHeight:36};class $h{draw;options;inputModal=null;isPopup=!1;constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=Mo,n=this.options.scale,i=e.fontSize*n,l=e.smallFontSize*n,s=e.gap*n,a=e.dividerWidth*n,d=document.createElement("canvas").getContext("2d"),u=t.menstrualData;d.font=`${i}px "Microsoft YaHei", sans-serif`;let R=a;d.font=`${l}px "Microsoft YaHei", sans-serif`;let h=0;if(u){const T=this.getValue(u.menarcheAge);d.font=`${i}px "Microsoft YaHei", sans-serif`,T&&(R+=d.measureText(`${T}岁`).width+s);let f="";if(u.isMenopause){const P=this.getValue(u.menopauseAge);P&&(f=`${P}岁`)}else{const P=this.getValue(u.lastPeriod);P&&(f=P)}f&&(R+=d.measureText(f).width+s),d.font=`${l}px "Microsoft YaHei", sans-serif`;const m=this.getValue(u.periodMin),p=this.getValue(u.periodMax);if(m||p){const P=`${m||""}~${p||""}`;h=Math.max(h,d.measureText(P).width)}const C=this.getValue(u.cycleMin),I=this.getValue(u.cycleMax);if(C||I){const P=`${C||""}~${I||""}`;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(R,h),height:e.totalHeight*n}}getValue(t){return!t||t===""||t==="_"||t==="____-__-__"?"":t}render(t){const{ctx:e,x:n,y:i,element:l}=t,s=l.menstrualData,a=this.options.scale;e.save(),e.font=`${Mo.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 l=Mo,s=l.fontSize*i,a=l.lineHeight*i,c=l.dividerWidth*i,d=n-a*1.5,u=e+c/2;t.font=`${s}px "Microsoft YaHei", sans-serif`;const R=t.measureText("~").width,h=u-R/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,l){const s=Mo,a=s.fontSize*l,c=s.smallFontSize*l,d=s.lineHeight*l,u=s.gap*l,R=s.dividerWidth*l,h=n-d*2,g=h+d*2;t.font=`${a}px "Microsoft YaHei", sans-serif`;const T=this.getValue(i.menarcheAge);let f=e;if(T){const O=`${T}岁`;t.fillText(O,e,g),f=e+t.measureText(O).width+u}const m=f+R/2,p=h+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const C=this.getValue(i.periodMin),I=this.getValue(i.periodMax);let P="";C||I?P=`${C||""}~${I||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,P="~");const M=t.measureText(P).width,N=m-M/2;t.fillText(P,N,p),this.drawDivider(t,f,g-a/2,R,l),t.font=`${a}px "Microsoft YaHei", sans-serif`;let F="";if(i.isMenopause){const O=this.getValue(i.menopauseAge);O&&(F=`${O}岁`)}else{const O=this.getValue(i.lastPeriod);O&&(F=O)}F&&t.fillText(F,f+R+u,g);const S=g+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const W=this.getValue(i.cycleMin),Y=this.getValue(i.cycleMax);let b="";W||Y?b=`${W||""}~${Y||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,b="~");const D=t.measureText(b).width,X=m-D/2;t.fillText(b,X,S)}drawDivider(t,e,n,i,l){t.save(),t.beginPath(),t.strokeStyle=this.options.defaultColor,t.lineWidth=.5*l,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===r.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
191
|
<div class="menstrual-history-modal__mask"></div>
|
|
187
192
|
<div class="menstrual-history-modal__container">
|
|
188
193
|
<div class="menstrual-history-modal__header">
|
|
@@ -258,7 +263,7 @@ ${R} `}textToElements(t){const e=[],n=t.split(`
|
|
|
258
263
|
<button class="btn-confirm">确认</button>
|
|
259
264
|
</div>
|
|
260
265
|
</div>
|
|
261
|
-
`,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".menstrual-history-modal__mask"),
|
|
266
|
+
`,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".menstrual-history-modal__mask"),l=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"),u=this.inputModal.querySelector("#mh-edit-isMenopauseForm"),R=this.inputModal.querySelectorAll('input[name="mh-edit-isMenopause"]'),h=()=>{this.clearMenstrualHistoryEditor()};l.addEventListener("click",g=>{g.stopPropagation()}),i.addEventListener("click",h),s.addEventListener("click",h),a.addEventListener("click",h),R.forEach(g=>{g.addEventListener("change",()=>{const T=g.value==="true";d.style.display=T?"none":"block",u.style.display=T?"block":"none"})}),c.addEventListener("click",g=>{g.preventDefault(),g.stopPropagation();const T=this.inputModal;if(!T)return;const f=T.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let m;f?m={isMenopause:!0,periodMin:T.querySelector("#mh-edit-periodMin2")?.value||"",periodMax:T.querySelector("#mh-edit-periodMax2")?.value||"",menarcheAge:T.querySelector("#mh-edit-menarcheAge2")?.value||"",menopauseAge:T.querySelector("#mh-edit-menopauseAge")?.value||"",cycleMin:T.querySelector("#mh-edit-cycleMin2")?.value||"",cycleMax:T.querySelector("#mh-edit-cycleMax2")?.value||""}:m={isMenopause:!1,periodMin:T.querySelector("#mh-edit-periodMin")?.value||"",periodMax:T.querySelector("#mh-edit-periodMax")?.value||"",menarcheAge:T.querySelector("#mh-edit-menarcheAge1")?.value||"",lastPeriod:T.querySelector("#mh-edit-lastPeriod")?.value||"",cycleMin:T.querySelector("#mh-edit-cycleMin")?.value||"",cycleMax:T.querySelector("#mh-edit-cycleMax")?.value||""},this.clearMenstrualHistoryEditor();const p=this.draw.getElementList(),C=e.index;this.draw.spliceElementList(p,C,1);const I={type:"menstrualHistory",value:"",menstrualData:m};this.draw.spliceElementList(p,C,0,[I]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}}const Yr={fontSize:16,totalWidth:85,totalHeight:75,symbolGap:12,lineGap:20};class zh{draw;options;inputModal=null;isPopup=!1;constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(){const t=Yr,e=this.options.scale;return{width:t.totalWidth*e,height:t.totalHeight*e}}render(t){const{ctx:e,x:n,y:i,element:l}=t,s=l.fetalHeartData,a=this.options.scale;e.save();const c=Yr,d=c.fontSize*a,u=c.symbolGap*a,R=c.lineGap*a,h=c.totalHeight*a,g=n+c.totalWidth*a/2,f=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=f+m*.7,C=f+m*1.7,I=f+m*2.7,P=f+h-m*.3;this.drawVerticalLine(e,g,f,P-f,a);const M=g-u,N=g+u;this.drawSymbol(e,M,p,s?.a),this.drawSymbol(e,N,p,s?.b);const F=M-R,S=N+R;e.fillText("-",F,C),this.drawSymbol(e,M,C,s?.c),this.drawSymbol(e,N,C,s?.d),e.fillText("-",S,C),this.drawSymbol(e,M,I,s?.e),this.drawSymbol(e,N,I,s?.f),e.restore()}drawSymbol(t,e,n,i){const l=i?"+":"-";t.fillText(l,e,n)}drawVerticalLine(t,e,n,i,l){t.save(),t.beginPath(),t.strokeStyle=this.options.defaultColor,t.lineWidth=.5*l,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===r.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
267
|
<div class="fetal-heart-position-modal__mask"></div>
|
|
263
268
|
<div class="fetal-heart-position-modal__container">
|
|
264
269
|
<div class="fetal-heart-position-modal__header">
|
|
@@ -304,7 +309,7 @@ ${R} `}textToElements(t){const e=[],n=t.split(`
|
|
|
304
309
|
<button class="btn-confirm">确认</button>
|
|
305
310
|
</div>
|
|
306
311
|
</div>
|
|
307
|
-
`,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".fetal-heart-position-modal__mask"),
|
|
312
|
+
`,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".fetal-heart-position-modal__mask"),l=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()};l.addEventListener("click",u=>{u.stopPropagation()}),i.addEventListener("click",d),s.addEventListener("click",d),a.addEventListener("click",d),c.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation();const R=this.inputModal;if(!R)return;const h={a:R.querySelector("#fh-a")?.checked||!1,b:R.querySelector("#fh-b")?.checked||!1,c:R.querySelector("#fh-c")?.checked||!1,d:R.querySelector("#fh-d")?.checked||!1,e:R.querySelector("#fh-e")?.checked||!1,f:R.querySelector("#fh-f")?.checked||!1};this.clearFetalHeartPositionEditor();const g=this.draw.getElementList(),T=e.index;this.draw.spliceElementList(g,T,1);const f={type:"fetalHeartPosition",value:"",fetalHeartData:h};this.draw.spliceElementList(g,T,0,[f]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}}const Ue={fontSize:12,deciduousFontSize:10,smallFontSize:9,totalHeight:60,toothGap:2,halfGap:8,minLineHalfWidth:50,maxLineHalfWidth:85},Ur=["La","B","F","M","I","D","L","P"];class jh{draw;options;inputModal=null;isPopup=!1;finallyAdd=null;toothSurfaceMap={};supernumeraryToothMap={};constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=Ue,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:l,deciduousFontSize:s,smallFontSize:a,toothGap:c}=Ue,d=(f,m,p)=>{let C=0;const I=(P,M)=>`${P}-${M}`;return m.forEach(P=>{const M=I(p,P),N=t?.toothSurfaceMap?.[M]||[],F=t?.supernumeraryToothMap?.[M];C+=s*e*.6,N.length>0&&(C+=a*e*N.length*.5),F&&(C+=s*e*.4),C+=c*e}),f.forEach(P=>{const M=I(p,P),N=t?.toothSurfaceMap?.[M]||[],F=t?.supernumeraryToothMap?.[M];C+=l*e*.6,N.length>0&&(C+=a*e*N.length*.5),F&&(C+=l*e*.4),C+=c*e}),C},u=Math.max(d(t?.upperLeft||[],t?.upperLeftLetter||[],"upperLeft"),d(t?.lowerLeft||[],t?.lowerLeftLetter||[],"lowerLeft")),R=Math.max(d(t?.upperRight||[],t?.upperRightLetter||[],"upperRight"),d(t?.lowerRight||[],t?.lowerRightLetter||[],"lowerRight")),g=Math.max(u,R)/e+Ue.halfGap;return Math.max(n,Math.min(i,g))*e}render(t){const{ctx:e,x:n,y:i,element:l}=t,s=l.toothPositionData,a=this.options.scale;e.save();const c=Ue.fontSize*a,d=Ue.deciduousFontSize*a,u=Ue.smallFontSize*a,R=Ue.toothGap*a,h=Ue.totalHeight*a,g=Ue.halfGap*a,T=2*a,f=(N,F)=>`${N}-${F}`,m=this.calculateLineHalfWidth(s,a),p=m*2,C=n+m,I=i;e.beginPath(),e.rect(C-m,I-h/2,p,h),e.clip(),e.beginPath(),e.strokeStyle=this.options.defaultColor,e.lineWidth=1*a,e.moveTo(C,I-h/2+10*a),e.lineTo(C,I+h/2-10*a),e.stroke(),e.beginPath(),e.moveTo(C-m,I),e.lineTo(C+m,I),e.stroke();const P=(N,F,S,W,Y)=>{const b=f(N,F),D=s?.toothSurfaceMap?.[b]||[],X=Ur.filter(U=>D.includes(U)),O=s?.supernumeraryToothMap?.[b],E=F.toString(),V=typeof F=="string"?d:c;e.font=`${V}px "Microsoft YaHei", sans-serif`,e.textBaseline="middle";let y=S;if(O){e.font=`${V}px "Microsoft YaHei", sans-serif`;const z=e.measureText("(").width,rt=e.measureText(E).width;e.font=`${u}px "Microsoft YaHei", sans-serif`;const at=e.measureText("S").width;let A=z+rt+z;A+=at+T;let it=0,ct="";return X.length>0&&(e.font=`${u}px "Microsoft YaHei", sans-serif`,ct=X.join(","),it=e.measureText(ct).width+T/2),Y==="right"?(y=S-A,X.length>0&&(e.font=`${u}px "Microsoft YaHei", sans-serif`,e.fillText(ct,y-it-T/2,W-V*.4)),e.font=`${V}px "Microsoft YaHei", sans-serif`,e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText("(",y,W),y+=z,e.font=`${u}px "Microsoft YaHei", sans-serif`,O==="Si"&&(e.fillText("S",y,W-V*.4),y+=at+T),e.font=`${V}px "Microsoft YaHei", sans-serif`,e.fillText(E,y,W),y+=rt,O==="iS"&&(e.font=`${u}px "Microsoft YaHei", sans-serif`,e.fillText("S",y,W-V*.4),y+=at),e.font=`${V}px "Microsoft YaHei", sans-serif`,e.fillText(")",y,W),S-A-it-R):(e.font=`${V}px "Microsoft YaHei", sans-serif`,e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText("(",y,W),y+=z,e.font=`${u}px "Microsoft YaHei", sans-serif`,O==="Si"&&(e.fillText("S",y,W-V*.4),y+=at+T),e.font=`${V}px "Microsoft YaHei", sans-serif`,e.fillText(E,y,W),y+=rt,O==="iS"&&(e.font=`${u}px "Microsoft YaHei", sans-serif`,e.fillText("S",y,W-V*.4),y+=at),e.font=`${V}px "Microsoft YaHei", sans-serif`,e.fillText(")",y,W),y+=z,X.length>0&&(e.font=`${u}px "Microsoft YaHei", sans-serif`,e.fillText(ct,y+T/2,W-V*.4),y+=it),y+R)}else{e.font=`${V}px "Microsoft YaHei", sans-serif`;const U=e.measureText(E).width;let Q=0,K="";return X.length>0&&(e.font=`${u}px "Microsoft YaHei", sans-serif`,K=X.join(","),Q=e.measureText(K).width+T/2,e.font=`${V}px "Microsoft YaHei", sans-serif`),Y==="right"?(y=S-U,X.length>0&&(e.font=`${u}px "Microsoft YaHei", sans-serif`,e.fillText(K,y-Q-T/2,W-V*.4),e.font=`${V}px "Microsoft YaHei", sans-serif`),e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText(E,y,W),S-U-Q-R):(e.textAlign="left",e.fillStyle=this.options.defaultColor,e.fillText(E,y,W),y+=U,X.length>0&&(e.font=`${u}px "Microsoft YaHei", sans-serif`,e.fillText(K,y+T/2,W-V*.4),y+=Q),y+R)}},M=(N,F,S,W,Y,b)=>{let D=W;b==="right"?([...F].reverse().forEach(E=>{D=P(S,E,D,Y,b)}),[...N].reverse().forEach(E=>{D=P(S,E,D,Y,b)})):(F.forEach(X=>{D=P(S,X,D,Y,b)}),N.forEach(X=>{D=P(S,X,D,Y,b)}))};M(s?.upperLeft||[],s?.upperLeftLetter||[],"upperLeft",C-g,I-h/4,"right"),M(s?.upperRight||[],s?.upperRightLetter||[],"upperRight",C+g,I-h/4,"left"),M(s?.lowerLeft||[],s?.lowerLeftLetter||[],"lowerLeft",C-g,I+h/4,"right"),M(s?.lowerRight||[],s?.lowerRightLetter||[],"lowerRight",C+g,I+h/4,"left"),e.restore()}clearToothPositionEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderToothPositionEditor(t,e){if(this.options.mode===r.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
313
|
<div class="tooth-position-modal__mask"></div>
|
|
309
314
|
<div class="tooth-position-modal__container">
|
|
310
315
|
<div class="tooth-position-modal__header">
|
|
@@ -488,24 +493,24 @@ ${R} `}textToElements(t){const e=[],n=t.split(`
|
|
|
488
493
|
<button class="btn-confirm">确认</button>
|
|
489
494
|
</div>
|
|
490
495
|
</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",u=>{u.stopPropagation()}),i.addEventListener("click",d),s.addEventListener("click",d),a.addEventListener("click",d),c.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation();const R=this.inputModal;if(!R)return;const h=this.collectData(R);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 R=t.querySelectorAll(".tooth-grid-number-item.selected");if(R.length>0){const h=R[R.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const u=n();u!==null?e=u: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 R=t.querySelectorAll(".tooth-grid-letter-item.selected");if(R.length>0){const h=R[R.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const u=n();u!==null?e=u: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=(u,R)=>`${u}-${R}`,i=(u,R)=>{const h=n(u,R),g=this.toothSurfaceMap[h]||[],f=Lr.filter(P=>g.includes(P)),T=this.supernumeraryToothMap[h],m=R.toString(),I=typeof R=="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">
|
|
496
|
+
`,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"),l=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()};l.addEventListener("click",u=>{u.stopPropagation()}),i.addEventListener("click",d),s.addEventListener("click",d),a.addEventListener("click",d),c.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation();const R=this.inputModal;if(!R)return;const h=this.collectData(R);this.clearToothPositionEditor();const g=this.draw.getElementList(),T=e.index;this.draw.spliceElementList(g,T,1);const f={type:"toothPosition",value:"",toothPositionData:h};this.draw.spliceElementList(g,T,0,[f]),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(l=>{const s=t[l];s&&s.length>0&&s.forEach(a=>{const c=e.querySelector(`.tooth-grid-number-item[data-position="${l}"][data-value="${a}"]`);c&&c.classList.add("selected")})}),["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"].forEach(l=>{const s=t[l];s&&s.length>0&&s.forEach(a=>{const c=e.querySelector(`.tooth-grid-letter-item[data-position="${l}"][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 l=e.querySelectorAll(".tooth-grid-number-item.selected"),s=e.querySelectorAll(".tooth-grid-letter-item.selected");if(l.length>0){const a=l[l.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 l=t.querySelectorAll(".tooth-grid-number-item.selected"),s=t.querySelectorAll(".tooth-grid-letter-item.selected");if(l.length>0){const a=l[l.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=l=>{l.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=l=>{const s=["A","B","C","D","E"];l.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"),l=t.querySelectorAll(".tooth-grid-number-row");e.length>0&&n.length===0?(i.forEach(s=>s.classList.add("hidden")),l.forEach(s=>s.classList.remove("hidden"))):n.length>0&&e.length===0?(l.forEach(s=>s.classList.add("hidden")),i.forEach(s=>s.classList.remove("hidden"))):(i.forEach(s=>s.classList.remove("hidden")),l.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 R=t.querySelectorAll(".tooth-grid-number-item.selected");if(R.length>0){const h=R[R.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const u=n();u!==null?e=u: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 R=t.querySelectorAll(".tooth-grid-letter-item.selected");if(R.length>0){const h=R[R.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const u=n();u!==null?e=u: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(l=>{t.querySelectorAll(`.tooth-grid-number-item[data-position="${l}"].selected`).forEach(a=>{const c=parseInt(a.dataset.value||"0");c>0&&e[l].push(c)})}),["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"].forEach(l=>{t.querySelectorAll(`.tooth-grid-letter-item[data-position="${l}"].selected`).forEach(a=>{const c=a.dataset.value;c&&e[l].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=(u,R)=>`${u}-${R}`,i=(u,R)=>{const h=n(u,R),g=this.toothSurfaceMap[h]||[],T=Ur.filter(P=>g.includes(P)),f=this.supernumeraryToothMap[h],m=R.toString(),C=typeof R=="string"?"tooth-preview-tooth-value tooth-preview-tooth-value--deciduous":"tooth-preview-tooth-value",I=T.length>0?`<sup class="tooth-preview-surface">${T.join(",")}</sup>`:"";if(f){const P='<sup class="tooth-preview-supernumerary">S</sup>';return f==="Si"?`<span class="tooth-preview-tooth">
|
|
492
497
|
<span class="tooth-preview-tooth-bracket">(</span>
|
|
493
498
|
${P}
|
|
494
|
-
<span class="${
|
|
499
|
+
<span class="${C}">${m}</span>
|
|
495
500
|
<span class="tooth-preview-tooth-bracket">)</span>
|
|
496
|
-
${
|
|
501
|
+
${I}
|
|
497
502
|
</span>`:`<span class="tooth-preview-tooth">
|
|
498
503
|
<span class="tooth-preview-tooth-bracket">(</span>
|
|
499
|
-
<span class="${
|
|
504
|
+
<span class="${C}">${m}</span>
|
|
500
505
|
${P}
|
|
501
506
|
<span class="tooth-preview-tooth-bracket">)</span>
|
|
502
|
-
${
|
|
507
|
+
${I}
|
|
503
508
|
</span>`}else return`<span class="tooth-preview-tooth">
|
|
504
|
-
<span class="${
|
|
505
|
-
${
|
|
506
|
-
</span>`},
|
|
507
|
-
`,
|
|
508
|
-
`,Sr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Cr],{type:"text/javascript;charset=utf-8"});function Dh(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})}}const Er='(function(){"use strict";var F=(e=>(e.HALF="half",e.ONE_THIRD="one-third",e.QUARTER="quarter",e))(F||{}),M=(e=>(e.ARABIC="arabic",e.CHINESE="chinese",e))(M||{});const K="";F.HALF+"",1/2,F.ONE_THIRD+"",1/3,F.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","subTemplateContent","subTemplateRelation","subTemplateConditions","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,F.HALF,F.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?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,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=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,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,b=A===v.TEXTFIELD,h=b?c.PRETEXTFIX:c.PREFIX,x=n.controlComponent===h,m=A===v.CHECKBOX||A===v.RADIO;if(x||m&&(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO)){const X=E(u+1,n.controlId,b,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&&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=H(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(H(n)),u++;continue}const J=t.control?.type;if(J===v.CHECKBOX||J===v.RADIO){let A=u-1,b=!1;for(;A>=i-1;){const h=T[A];if(h.controlId===s&&!h.originControlId)if(h.controlComponent===c.CHECKBOX){b=h.checkbox?.value===!0;break}else if(h.controlComponent===c.RADIO){b=h.radio?.value===!0;break}else if(h.controlComponent===c.VALUE){A--;continue}else break;A--}if(b){const h={value:n.value||""},x=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const m of x){const X=n[m];if(X!==void 0){if(m==="color"&&C){const V=C.control?.bracketColor,U=C.control?.placeholderColor;if(X===V||X===U)continue}h[m]=X}}p.push(h)}}else{const A={value:n.value||""},b=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const h of b){const x=n[h];if(x!==void 0){if(h==="color"&&C){const m=C.control?.bracketColor,X=C.control?.placeholderColor;if(x===m||x===X)continue}A[h]=x}}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',Xr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Er],{type:"text/javascript;charset=utf-8"});function Uh(o){let t;try{if(t=Xr&&(self.URL||self.webkitURL).createObjectURL(Xr),!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(Er),{name:o?.name})}}class wh{draw;wordCountWorker;catalogWorker;groupWorker;valueWorker;constructor(t){this.draw=t,this.wordCountWorker=new Vh,this.catalogWorker=new Yh,this.groupWorker=new Dh,this.valueWorker=new Uh}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:ve,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 Zh{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:[u,R]},ascent:h}=e;i=u,r=R+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,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**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,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 4:{const d=t.x-this.mousedownX,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**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,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**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 u=document.createElement("div");u.classList.add("image-navigate");const R=document.createElement("i");R.classList.add("image-pre"),R.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())},u.append(R),this.imagePre=R;const h=document.createElement("span");h.classList.add("image-count"),this.imageCount=h,u.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,u.append(g),d.append(u);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;Vi(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,C=!1;i.onmousedown=S=>{C=!0,L=S.x,P=S.y,t.style.cursor="move"},t.onmousemove=S=>{C&&(r+=S.x-L,s+=S.y-P,L=S.x,P=S.y,this._setPreviewerTransform(a,c,r,s))},t.onmouseup=()=>{C=!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 Qh{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}]};wt(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 Nr{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 vh{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,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**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,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 4:{const d=t.x-this.mousedownX,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**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,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**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 Nr(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 Nr(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 Kh{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 vh(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 Ei={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:"双击编辑页脚"}},Hh={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 _h{currentLocale;langMap=new Map([["zhCN",Ei],["en",Hh]]);constructor(t){this.currentLocale=t}registerLangMap(t,e){const n=this.langMap.get(t);this.langMap.set(t,Yi(n||Ei,e))}getLocale(){return this.currentLocale}setLocale(t){this.currentLocale=t}getLang(){return this.langMap.get(this.currentLocale)||Ei}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 xh{promiseList;constructor(){this.promiseList=[]}add(t){this.promiseList.push(t)}clearAll(){this.promiseList=[]}allSettled(){return Promise.allSettled(this.promiseList)}}class Gh{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",kr(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 Ah{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 Gh(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(),Co(()=>{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(),u=c+d;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${z}-zone-indicator`);const R=this.draw.getHeader(),h=this.draw.getFooter(),g=e?R.getHeight():h.getHeight(),f=e?R.getHeaderTop():c-h.getFooterBottom()-g;for(let T=0;T<r.length;T++){const m=u*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,C=document.createElement("div");C.innerText=this.i18n.t(`frame.${e?"header":"footer"}`),C.style.top=`${P}px`,C.style.transform=`translate(${n*t}px, ${i*t}px) scale(${t})`,this.indicatorContainer.append(C);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 kh{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*bi[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 Jh{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(R=>R.listType===t&&R.listStyle===e)||!t){this.unsetList();return}const c=lt();s.forEach(R=>{R.listId=c,R.listType=t,R.listStyle=e});const d=i===r,u=d?r:i;this.draw.render({curIndex:u,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 u=r[d];if(u.value===_&&!u.listWrap)break;if(u.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,u)=>(u.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:u,scale:R}=this.options;for(let m=1;m<i.length&&i[m]?.type===l.ElementType.TAB;m++)d+=u*R;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)*R,height:p*R}};this.draw.getCheckboxParticle().render({ctx:t,x:f-I*R,y:T,index:0,row:{...e,elementList:[L,...e.elementList]}})}else{let m="";if(c.listType===l.ListType.UL?m=Wo[c.listStyle]||Wo[_e.DISC]:m=`${s+1}${l.KeyMap.PERIOD}`,!m)return;t.save(),t.font=this.getListFontStyle(i,R),t.fillText(m,f,T),t.restore()}}}class Un{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-Un.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 Fr{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+=(Un.WIDTH+Un.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 Bh{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 u=c.tdList[d],R=this.getElementListByGroupId(u.value,e);if(R.length)return n.push(...R),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 u=c.tdList[d],R=this.getContextByGroupId(u.value,e);if(R)return{...R,isTable:!0,index:n,trIndex:a,tdIndex:d,tdId:u.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,u)=>{const{x:R,y:h,width:g,height:f}=d;i?.includes(u)?(t.globalAlpha=a,t.fillStyle=c):(t.globalAlpha=s,t.fillStyle=r),t.fillRect(R,h,g,f)}),t.restore(),this.clearFillInfo()}}class $h{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 zh{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 jh{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(),u=this.draw.getMargins(),R=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}}=R[T.startIndex],p=c===l.LineNumberType.PAGE?f+1:T.rowIndex+1,I=d.measureText(t,{value:`${p}`}),L=u[3]-(I.width+a)*n,P=m[1]-I.actualBoundingBoxAscent*n;t.fillText(`${p}`,L,P)}t.restore()}}class qh{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,u=this.draw.getHeight()-c-this.footer.getExtraHeight()-s[2]+r[2]*e;t.rect(a,c,d,u),t.stroke(),t.restore()}}function tg(o,t){const{value:e,oldValue:n}=t;n.isTable&&!e.isTable&&o.getTableTool().dispose()}class eg{draw;eventBus;constructor(t){this.draw=t,this.eventBus=t.getEventBus(),this.execute()}execute(){this.eventBus.on("positionContextChange",t=>{tg(this.draw,t)})}}class ng{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=[],u=c/e;for(let f=0;f<e;f++)d.push({width:u});const R=[];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:[]});R.push(m)}const h={type:l.ElementType.TABLE,value:"",colgroup:d,trList:R};bt([h],{editorOptions:this.options}),wt(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 R=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>=R+1&&(T.rowspan+=1)}}}const d=lt(),u={height:c.height,id:d,tdList:[]};for(let R=0;R<c.tdList.length;R++){const h=c.tdList[R],g=lt();u.tdList.push({id:g,rowspan:1,colspan:h.colspan,value:[{value:_,size:16,tableId:i,trId:d,tdId:g}]})}a.splice(n,0,u),this.position.setPositionContext({isTable:!0,index:e,trIndex:n,tdIndex:0,tdId:u.tdList[0].id,trId:u.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 u=lt(),R={height:d.height,id:u,tdList:[]};for(let h=0;h<d.tdList.length;h++){const g=d.tdList[h],f=lt();R.tdList.push({id:f,rowspan:1,colspan:g.colspan,value:[{value:_,size:16,tableId:i,trId:u,tdId:f}]})}a.splice(n+1,0,R),this.position.setPositionContext({isTable:!0,index:e,trIndex:n+1,tdIndex:0,tdId:R.tdList[0].id,trId:R.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 R=0;R<a.length;R++){const h=a[R],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 R=0;R<a.length;R++){const h=a[R],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 u=0;u<d;u++){const h=a[u].tdList;for(let g=0;g<h.length;g++){const f=h[g];f.rowIndex+f.rowspan>d&&f.rowspan--}}for(let u=0;u<c.tdList.length;u++){const R=c.tdList[u];if(R.rowspan>1){const h=lt(),g=a[n+1];g.tdList.splice(u,0,{id:h,rowspan:R.rowspan-1,colspan:R.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(R=>R.tdList.length>1)){this.deleteTable();return}for(let R=0;R<a.length;R++){const h=a[R];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,u=this.draw.getOriginalElementList()[a].trList;let R=u[r].tdList[n],h=u[s].tdList[i];(R.x>h.x||R.y>h.y)&&([R,h]=[h,R]);const g=R.colIndex,f=h.colIndex+(h.colspan-1),T=R.rowIndex,m=h.rowIndex+(h.rowspan-1),p=[];for(let X=0;X<u.length;X++){const O=u[X],M=[];for(let b=0;b<O.tdList.length;b++){const y=O.tdList[b],D=y.colIndex,U=y.rowIndex;D>=g&&D<=f&&U>=T&&U<=m&&M.push(y)}M.length&&p.push(M)}if(!p.length)return;const I=p[p.length-1],L=p[0][0],P=I[I.length-1],C=L.x,S=L.y,F=P.x+P.width,N=P.y+P.height;for(let X=0;X<p.length;X++){const O=p[X];for(let M=0;M<O.length;M++){const b=O[M],y=b.x,D=b.y,U=y+b.width,Q=D+b.height;if(C>y||S>D||F<U||N<Q)return}}const V=[],Y=p[0][0],E=Y.value[0];for(let X=0;X<p.length;X++){const O=p[X];for(let M=0;M<O.length;M++){const b=O[M];if(!(X===0&&M===0)){V.push(b.id);const D=b.value.length>1?0:1;for(let U=D;U<b.value.length;U++){const Q=b.value[U];De(je,E,Q),Y.value.push(Q)}}X===0&&M!==0&&(Y.colspan+=b.colspan),X!==0&&Y.colIndex===b.colIndex&&(Y.rowspan+=b.rowspan)}}for(let X=0;X<u.length;X++){const O=u[X];let M=0;for(;M<O.tdList.length;){const b=O.tdList[M];V.includes(b.id)&&(O.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 u=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<u;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 R=d.value.length-1;this.range.setRange(R,R),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],u=d.tdList[i];a.colgroup.splice(i+1,0,{width:this.options.table.defaultColMinWidth});for(let R=0;R<c.length;R++){const h=c[R];let g=0;for(;g<h.tdList.length;){const f=h.tdList[g];if(f.rowIndex!==u.rowIndex)f.colIndex<=u.colIndex&&f.colIndex+f.colspan>u.colIndex&&f.colspan++;else if(f.id===u.id){const T=lt();d.tdList.splice(g+u.colspan,0,{id:T,rowspan:u.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,u=c[r].tdList[i];let R=-1,h=0;for(;h<c.length;){if(h===R){h++;continue}const g=c[h];let f=0;for(;f<g.tdList.length;){const T=g.tdList[f];if(T.id===u.id){const m=lt(),p=lt();c.splice(h+u.rowspan,0,{id:m,height:this.options.table.defaultTrMinHeight,tdList:[{id:p,rowspan:1,colspan:u.colspan,value:[{value:_,size:16,tableId:a.id,trId:m,tdId:p}]}]}),R=h+u.rowspan}else T.rowIndex>=u.rowIndex&&T.rowIndex<u.rowIndex+u.rowspan&&T.rowIndex+T.rowspan>=u.rowIndex+u.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,u=c[d].tdList.length-1;this.range.replaceRange({startIndex:r,endIndex:s,tableId:n,startTdIndex:0,endTdIndex:u,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
|
+
<span class="${C}">${m}</span>
|
|
510
|
+
${I}
|
|
511
|
+
</span>`},l=(u,R,h)=>{const g=[];return R.forEach(T=>{g.push(i(h,T))}),u.forEach(T=>{g.push(i(h,T))}),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=l(t?.upperLeft||[],t?.upperLeftLetter||[],"upperLeft")),a&&(a.innerHTML=l(t?.upperRight||[],t?.upperRightLetter||[],"upperRight")),c&&(c.innerHTML=l(t?.lowerLeft||[],t?.lowerLeftLetter||[],"lowerLeft")),d&&(d.innerHTML=l(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 l=i.dataset.surface;if(!l)return;const s=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.toothSurfaceMap[s]||(this.toothSurfaceMap[s]=[]);const a=this.toothSurfaceMap[s],c=a.indexOf(l);c>-1?(a.splice(c,1),i.classList.remove("selected")):(a.push(l),i.classList.add("selected")),this.updatePreview()})}),t.querySelectorAll(".tooth-supernumerary-item").forEach(i=>{i.addEventListener("click",()=>{if(!this.finallyAdd)return;const l=i.dataset.supernumerary;if(!l)return;const s=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.supernumeraryToothMap[s]===l?(delete this.supernumeraryToothMap[s],i.classList.remove("selected")):(t.querySelectorAll(".tooth-supernumerary-item").forEach(a=>a.classList.remove("selected")),this.supernumeraryToothMap[s]=l,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(l=>{const s=l.dataset.surface;n.includes(s||"")?l.classList.add("selected"):l.classList.remove("selected")});const i=this.supernumeraryToothMap[e];t.querySelectorAll(".tooth-supernumerary-item").forEach(l=>{l.dataset.supernumerary===i?l.classList.add("selected"):l.classList.remove("selected")})}}const wr='(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',Zr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",wr],{type:"text/javascript;charset=utf-8"});function qh(o){let t;try{if(t=Zr&&(self.URL||self.webkitURL).createObjectURL(Zr),!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(wr),{name:o?.name})}}const Qr=`(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)}})();
|
|
512
|
+
`,vr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Qr],{type:"text/javascript;charset=utf-8"});function tg(o){let t;try{if(t=vr&&(self.URL||self.webkitURL).createObjectURL(vr),!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(Qr),{name:o?.name})}}const Kr=`(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)}})();
|
|
513
|
+
`,Hr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Kr],{type:"text/javascript;charset=utf-8"});function eg(o){let t;try{if(t=Hr&&(self.URL||self.webkitURL).createObjectURL(Hr),!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(Kr),{name:o?.name})}}const _r='(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 b(e){if(typeof structuredClone=="function")return structuredClone(e);if(!e||typeof e!="object")return e;let d={};return Array.isArray(e)?d=e.map(f=>b(f)):Object.keys(e).forEach(f=>{d[f]=b(e[f])}),d}function D(e,d){const f={};for(const L in e)d.includes(L)&&(f[L]=e[L]);return f}function ee(e,d){return e.length!==d.length?!1:!e.some(f=>!d.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","subTemplateContent","subTemplateRelation","subTemplateConditions","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||{}),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 p=(e=>(e.FIRST="first",e.SECOND="second",e.THIRD="third",e.FOURTH="fourth",e.FIFTH="fifth",e.SIXTH="sixth",e))(p||{});p.FIRST+"",p.SECOND+"",p.THIRD+"",p.FOURTH+"",p.FIFTH+"",p.SIXTH+"",p.FIRST+"",p.SECOND+"",p.THIRD+"",p.FOURTH+"",p.FIFTH+"",p.SIXTH+"",p.FIRST,p.SECOND,p.THIRD,p.FOURTH,p.FIFTH,p.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||{}),n=(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))(n||{}),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,n.PREFIX,n.POSTFIX,n.PRE_TEXT,n.POST_TEXT,n.PRETEXTFIX,n.PRETEXTFIX_TEXT,n.POSTTEXTFIX,n.POSTTEXTFIX_TEXT,n.PLACEHOLDER,n.TEXTFIXLABEL,n.CHECKBOX,n.RADIO,n.UNDERLINE;function ne(e,d){const f=Object.keys(e),L=Object.keys(d);if(f.length!==L.length)return!1;for(let S=0;S<f.length;S++){const R=f[S];if(R!=="value"&&!(R==="groupIds"&&Array.isArray(e[R])&&Array.isArray(d[R])&&ee(e[R],d[R]))&&e[R]!==d[R])return!1}return!0}function k(e,d={}){const{extraPickAttrs:f}=d,L=[...te];f&&L.push(...f);const S={value:e?.value===K?`\n`:e?.value};return e&&L.forEach(R=>{const T=e[R];T!==void 0&&(S[R]=T)}),S}function P(e,d={}){const{extraPickAttrs:f,isClassifyArea:L=!1,isClone:S=!0,editorOptions:R}=d,T=(S?b(e):e).filter(t=>t.type!==o.SPLIT_TAG),B=[];let r=0;for(;r<T.length;){let t=T[r];if(r===0&&t.value===K&&!t.listId&&(!t.type||t.type===o.TEXT)){r++;continue}if(t.areaId){const s=t.areaId,O=t.area,E=[];for(;r<T.length;){const l=T[r];if(s!==l.areaId){r--;break}delete l.area,delete l.areaId,E.push(l),r++}const a=P(E,d);if(L){const l={type:o.AREA,value:"",areaId:s,area:O};l.valueList=a,t=l}else{B.splice(r,0,...a);continue}}else if(t.titleId&&t.level){const s=t.titleId;if(s){const O=t.level,E={type:o.TITLE,title:t.title,titleId:s,value:"",level:O},a=[];for(;r<T.length;){const l=T[r];if(s!==l.titleId){r--;break}delete l.level,delete l.title,a.push(l),r++}E.valueList=P(a,d),t=E}}else if(t.listId&&t.listType){const s=t.listId;if(s){const O=t.listType,E=t.listStyle,a=t?.label,l={type:o.LIST,value:"",label:a||"",listId:s,listType:O,listStyle:E},I=[];for(;r<T.length;){const c=T[r];if(s!==c.listId){r--;break}delete c.listType,delete c.listStyle,I.push(c),r++}l.valueList=P(I,d),t=l}}else if(t.type===o.TABLE){if(t.pagingId){let s=r+1,O=0;for(;s<T.length;){const E=T[s];if(E.pagingId===t.pagingId){t.height+=E.height;const a=E.trList.filter(l=>!l.pagingRepeat).filter(l=>(l.tdList=l.tdList.filter(I=>{if(I.originalId){for(let c=0;c<t.trList.length;c++){const u=t.trList[c].tdList.find(({id:i})=>i===I.originalId);if(u){I.value[0]?.type===o.SPLIT_TAG&&I.value.splice(0,1),u.value.push(...I.value),u.rowspan=u.originalRowspan??u.rowspan;break}}return!1}return!0}),!l.originalId));t.trList.push(...a),t.trList?.forEach(l=>l.minHeight=l.originalMinHeight??l.minHeight),s++,O++}else break}r+=O}if(t.trList)for(let s=0;s<t.trList.length;s++){const O=t.trList[s];delete O.id;for(let E=0;E<O.tdList.length;E++){const a=O.tdList[E],l={colspan:a.colspan,rowspan:a.rowspan,value:P(a.value,{...d,isClassifyArea:!1})};oe.forEach(I=>{const c=a[I];c!==void 0&&(l[I]=c)}),O.tdList[E]=l}}}else if(t.type===o.HYPERLINK){const s=t.hyperlinkId;if(s){const O={type:o.HYPERLINK,value:"",url:t.url},E=[];for(;r<T.length;){const a=T[r];if(s!==a.hyperlinkId){r--;break}delete a.type,delete a.url,E.push(a),r++}O.valueList=P(E,d),t=O}}else if(t.type===o.DATE){const s=t.dateId;if(s){const O={type:o.DATE,value:"",dateFormat:t.dateFormat},E=[];for(;r<T.length;){const a=T[r];if(s!==a.dateId){r--;break}delete a.type,delete a.dateFormat,E.push(a),r++}O.valueList=P(E,d),t=O}}else if(t.type!==o.BUTTON){if(t.controlId){const s=t.controlId;if(!(t.controlComponent===n.PREFIX||t.controlComponent===n.PRETEXTFIX||t.controlComponent===n.PRETEXTFIX_TEXT)&&t.controlComponent===n.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 I=!1;for(let c=r-1;c>=0;c--){const C=T[c],u=C.controlComponent===n.PREFIX||C.controlComponent===n.PRETEXTFIX||C.controlComponent===n.PRETEXTFIX_TEXT;if(C.controlId===s&&u){I=!0;break}if(C.controlId!==s)break}if(!I){const c=b(t);delete c.controlId,delete c.control,delete c.controlComponent,delete c.originControlId,B.push(c),r++;continue}}r++;continue}if(t.controlComponent===n.PLACEHOLDER||t.controlComponent===n.POSTFIX||t.controlComponent===n.POSTTEXTFIX||t.controlComponent===n.POSTTEXTFIX_TEXT||t.controlComponent===n.POST_TEXT||t.controlComponent===n.PRE_TEXT||t.controlComponent===n.CHECKBOX||t.controlComponent===n.RADIO){r++;continue}const E=(l,I,c,C)=>{if(C===v.CHECKBOX||C===v.RADIO){let i=-1;for(let F=l;F<T.length&&T[F].controlId===I;F++)i=F;return i}const u=c?[n.POSTTEXTFIX,n.POSTTEXTFIX_TEXT]:[n.POSTFIX];for(let i=l;i<T.length;i++){const F=T[i];if(F.controlId===I&&u.includes(F.controlComponent))return i}return-1},a=(l,I,c)=>{const C=[];let u=l;for(;u<=I;){const i=T[u];if(i.controlId&&i.controlId!==c&&i.control){const A=i.control?.type,g=A===v.TEXTFIELD,h=g?n.PRETEXTFIX:n.PREFIX,H=i.controlComponent===h,x=A===v.CHECKBOX||A===v.RADIO;if(H||x&&(i.controlComponent===n.CHECKBOX||i.controlComponent===n.RADIO)){const X=E(u+1,i.controlId,g,A);if(X!==-1){const V=T.slice(u,X+1).map(le=>{const $=b(le);return delete $.originControlId,$}),U=P(V,d);U.length>0&&C.push(U[0]),u=X+1;continue}}}if(!(i.controlId===c&&(i.controlComponent===n.VALUE||!i.controlComponent)&&(!i.originControlId||i.originControlId===c)||i.originControlId===c&&i.controlComponent===n.VALUE||i.controlId===c&&(i.controlComponent===n.CHECKBOX||i.controlComponent===n.RADIO)&&!i.originControlId)){u++;continue}if(i.type===o.MENSTRUAL_HISTORY||i.type===o.FETAL_HEART_POSITION||i.type===o.TOOTH_POSITION||i.type===o.MACRO||i.type===o.CUSTOM_MACRO||i.type===o.REUSABLE_ITEM||i.type===o.LIST||i.type===o.SPECIAL_SYMBOLS){const A=b(i);delete A.controlId,delete A.control,delete A.controlComponent,delete A.originControlId,C.push(A),u++;continue}if(i.controlComponent===n.CHECKBOX||i.controlComponent===n.RADIO){C.push(b(i)),u++;continue}const J=t.control?.type;if(J===v.CHECKBOX||J===v.RADIO){let A=u-1,g=!1;for(;A>=l-1;){const h=T[A];if(h.controlId===c&&!h.originControlId)if(h.controlComponent===n.CHECKBOX){g=h.checkbox?.value===!0;break}else if(h.controlComponent===n.RADIO){g=h.radio?.value===!0;break}else if(h.controlComponent===n.VALUE){A--;continue}else break;A--}if(g){const h={value:i.value||""},H=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const x of H){const X=i[x];if(X!==void 0){if(x==="color"&&R){const V=R.control?.bracketColor,U=R.control?.placeholderColor;if(X===V||X===U)continue}h[x]=X}}C.push(h)}}else{const A={value:i.value||""},g=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const h of g){const H=i[h];if(H!==void 0){if(h==="color"&&R){const x=R.control?.bracketColor,X=R.control?.placeholderColor;if(H===x||H===X)continue}A[h]=H}}C.push(A)}u++}return C};if(t.controlComponent===n.PREFIX){const l=t.control?.type===v.TEXTFIELD,I=E(r+1,s,l);if(I!==-1){const c=a(r+1,I-1,s),C=D(t,w),u={...t.control,...C,value:c},i={...D(t,y),type:o.CONTROL,value:"",control:u,controlId:s};t=k(i,{extraPickAttrs:f}),r=I}}if(t.controlComponent===n.PRETEXTFIX){const l=E(r+1,s,!0);if(l!==-1){const I=a(r+1,l-1,s),c=D(t,w),C={...t.control,...c,value:I},u={...D(t,y),type:o.CONTROL,value:"",control:C,controlId:s};t=k(u,{extraPickAttrs:f}),r=l}}if(t.controlComponent===n.PRETEXTFIX_TEXT){const l=E(r+1,s,!0);if(l!==-1){const I=a(r+1,l-1,s),c=D(t,w),C={...t.control,...c,value:I},u={...D(t,y),type:o.CONTROL,value:"",control:C,controlId:s};t=k(u,{extraPickAttrs:f}),r=l}}}}const G=k(t,{extraPickAttrs:f});if(!t.type||t.type===o.TEXT||t.type===o.SUBSCRIPT||t.type===o.SUPERSCRIPT)for(;r<T.length;){const s=T[r+1];if(r++,s&&ne(G,k(s,{extraPickAttrs:f}))){const O=s.value===K?`\n`:s.value;G.value+=O}else break}else r++;B.push(G)}return B}onmessage=e=>{const d=e.data,{options:f,data:L}=d,{extraPickAttrs:S=[]}=f||{},R={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(R)}})();\n',Ar=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",_r],{type:"text/javascript;charset=utf-8"});function ng(o){let t;try{if(t=Ar&&(self.URL||self.webkitURL).createObjectURL(Ar),!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(_r),{name:o?.name})}}class og{draw;wordCountWorker;catalogWorker;groupWorker;valueWorker;constructor(t){this.draw=t,this.wordCountWorker=new qh,this.catalogWorker=new tg,this.groupWorker=new eg,this.valueWorker=new ng}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=l=>{t(l.data)},this.catalogWorker.onerror=l=>{e(l)};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:_e,data:i.data,options:dt(this.draw.getOptions())})},this.valueWorker.onerror=i=>{n(i)},this.valueWorker.postMessage({data:this.draw.getOriginValue(t),options:t})})}}class ig{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:l,resizerSize:s}=this._createResizerDom();this.resizerSelection=e,this.resizerHandleList=n,this.resizerImageContainer=i,this.resizerImage=l,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,l=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,l=t.imgFloatPosition.y*n+d;else if(e){const{coordinate:{leftTop:[u,R]},ascent:h}=e;i=u,l=R+d+h}return{x:i,y:l}}_createResizerDom(){const{scale:t}=this.options,e=document.createElement("div");e.classList.add(`${q}-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(`${q}-resizer-size-view`);const l=document.createElement("span");i.append(l),e.append(i);const s=document.createElement("div");s.classList.add(`${q}-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:l}}_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:l,y:s}=this._getElementPosition(this.curElement,this.curPosition);this.resizerImageContainer.style.left=`${l}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,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**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,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 4:{const d=t.x-this.mousedownX,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**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,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 7:n=this.mousedownX-t.x;break}const l=this.curElement.width+n/e,s=this.curElement.height+i/e;if(l<=0||s<=0)return;this.width=l,this.height=s;const a=l*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(`${q}-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(`${q}-image-container`);const i=document.createElement("img");i.src=this.curElementSrc,i.draggable=!1,n.append(i),this.previewerImage=i,t.append(n);let l=0,s=0,a=1,c=0;const d=document.createElement("div");d.classList.add(`${q}-image-menu`);const u=document.createElement("div");u.classList.add("image-navigate");const R=document.createElement("i");R.classList.add("image-pre"),R.onclick=()=>{const N=this.imageList.findIndex(F=>F.id===this.curShowElement?.id);N<=0||(this.curShowElement=this.imageList[N-1],i.src=this.curShowElement.value,this._updateImageNavigate())},u.append(R),this.imagePre=R;const h=document.createElement("span");h.classList.add("image-count"),this.imageCount=h,u.append(h);const g=document.createElement("i");g.classList.add("image-next"),g.onclick=()=>{const N=this.imageList.findIndex(F=>F.id===this.curShowElement?.id);N>=this.imageList.length-1||(this.curShowElement=this.imageList[N+1],i.src=this.curShowElement.value,this._updateImageNavigate())},this.imageNext=g,u.append(g),d.append(u);const T=document.createElement("i");T.classList.add("zoom-in"),T.onclick=()=>{a+=.1,this._setPreviewerTransform(a,c,l,s)},d.append(T);const f=document.createElement("i");f.onclick=()=>{a-.1<=.1||(a-=.1,this._setPreviewerTransform(a,c,l,s))},f.classList.add("zoom-out"),d.append(f);const m=document.createElement("i");m.classList.add("rotate"),m.onclick=()=>{c+=1,this._setPreviewerTransform(a,c,l,s)},d.append(m);const p=document.createElement("i");p.classList.add("original-size"),p.onclick=()=>{l=0,s=0,a=1,c=0,this._setPreviewerTransform(a,c,l,s)},d.append(p);const C=document.createElement("i");C.classList.add("image-download"),C.onclick=()=>{const{mime:N}=this.previewerDrawOption;xi(i.src,`${this.curElement?.id}.${N||"png"}`)},d.append(C),t.append(d),this.previewerContainer=t,document.body.append(t);let I=0,P=0,M=!1;i.onmousedown=N=>{M=!0,I=N.x,P=N.y,t.style.cursor="move"},t.onmousemove=N=>{M&&(l+=N.x-I,s+=N.y-P,I=N.x,P=N.y,this._setPreviewerTransform(a,c,l,s))},t.onmouseup=()=>{M=!1,t.style.cursor="auto"},t.onwheel=N=>{if(N.preventDefault(),N.stopPropagation(),N.deltaY<0)a+=.1;else{if(a-.1<=.1)return;a-=.1}this._setPreviewerTransform(a,c,l,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,l=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=l?"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===r.EditorMode.PRINT&&this.options.modeRule[r.EditorMode.PRINT]?.imagePreviewerDisabled||t===r.EditorMode.READONLY&&this.options.modeRule[r.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===r.EditorMode.PRINT&&this.options.modeRule[r.EditorMode.PRINT]?.imagePreviewerDisabled||i===r.EditorMode.READONLY&&this.options.modeRule[r.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,l=t.height*n;this._updateResizerSizeView(i,l);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,l),this.resizerSelection.style.display="block",this.curElement=t,this.curPosition=e,this.width=i,this.height=l}clearResizer(){this.resizerSelection.style.display="none",document.removeEventListener("keydown",this._keydown)}}class sg{draw;range;datePicker;options;constructor(t){this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.datePicker=new yr(t,{onSubmit:this._setValue.bind(this)})}_setValue(t){if(!t)return;const e=this.getDateElementRange();if(!e)return;const[n,i]=e,l=this.draw.getElementList(),s=l[n+1];this.draw.spliceElementList(l,n+1,i-n),this.range.setRange(n,n);const a={type:r.ElementType.DATE,value:"",dateFormat:s.dateFormat,valueList:[{value:t}]};wt(l,[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 l=this.draw.getElementList(),s=l[n];if(s.type!==r.ElementType.DATE)return null;let a=n;for(;a>=0;){if(l[a].dateId!==s.dateId){t=a;break}a--}let c=n+1;for(;c<l.length;){if(l[c].dateId!==s.dateId){e=c-1;break}c++}return c===l.length&&(e=c-1),!~t||!~e?null:[t,e]}clearDatePicker(){this.datePicker.dispose()}renderDatePicker(t,e){const n=this.draw.getElementList(),i=this.getDateElementRange(),l=i?n.slice(i[0]+1,i[1]+1).map(s=>s.value).join(""):"";this.datePicker.render({value:l,position:e,dateFormat:t.dateFormat})}}class Gr{element;videoCache;constructor(t){this.element=t,this.videoCache=new Map}snapshot(t,e,n){return new Promise((i,l)=>{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=>{l(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 rg{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:l,resizerHandleList:s}=this._createBlockItem();this.blockItem=n,this.blockContainer.append(this.blockItem),this.blockCache=new Map,this.resizerMask=i,this.resizerSelection=l,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(`${q}-block-item`);const i=document.createElement("div");i.style.display="none",i.classList.add(`${q}-resizer-selection`),i.style.borderColor=e,i.style.borderWidth=`${t}px`;const l=[];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),l.push(c)}const s=document.createElement("div");return s.classList.add(`${q}-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:l}}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options;this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let l=0;l<8;l++){const s=l===0||l===6||l===7?-n:l===1||l===5?t/2:t-n,a=l===0||l===1||l===2?-n:l===3||l===7?e/2-n:e-n;this.resizerHandleList[l].style.transform=`scale(${i})`,this.resizerHandleList[l].style.left=`${s}px`,this.resizerHandleList[l].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 l=this._mousemove.bind(this);document.addEventListener("mousemove",l),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",l),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,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**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,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 4:{const d=t.x-this.mousedownX,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**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,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 7:n=this.mousedownX-t.x;break}const l=this.getBlockWidth()+n/e,s=this.element.height+i/e;if(l<=0||s<=0)return;this.width=l,this.height=s;const a=l*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===r.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 Gr(this.element);const l=this.block.snapshot(t,e,n);this.draw.getImageObserver().add(l),this.blockCache.set(this.element.id,this.block)}}render(){const t=this.element.block;t.type===r.BlockType.IFRAME?(this.block=new nn(this.element),this.block.render(this.blockItem)):t.type===r.BlockType.VIDEO&&(this.block=new Gr(this.element),this.block.render(this.blockItem))}setClientRects(t,e,n){const i=this.draw.getHeight(),l=this.draw.getPageGap(),s=t*(i+l),{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 lg{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(`${q}-block-container`),t}getDraw(){return this.draw}getBlockContainer(){return this.blockContainer}render(t,e,n,i,l){const s=n.id;let a=this.blockMap.get(s);a||(a=new rg(this,n),a.render(),this.blockMap.set(s,a)),this.draw.isPrintMode()?a.snapshot(t,i,l):a.setClientRects(e,i,l)}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===r.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 Qi={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:"双击编辑页脚"}},ag={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 cg{currentLocale;langMap=new Map([["zhCN",Qi],["en",ag]]);constructor(t){this.currentLocale=t}registerLangMap(t,e){const n=this.langMap.get(t);this.langMap.set(t,ki(n||Qi,e))}getLocale(){return this.currentLocale}setLocale(t){this.currentLocale=t}getLang(){return this.langMap.get(this.currentLocale)||Qi}t(t){const e=t.split(".");let n="",i=this.getLang();for(let l=0;l<e.length;l++){const s=e[l],a=Reflect.get(i,s);if(a)n=i=a;else return""}return n}}class dg{promiseList;constructor(){this.promiseList=[]}add(t){this.promiseList.push(t)}clearAll(){this.promiseList=[]}allSettled(){return Promise.allSettled(this.promiseList)}}class ug{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=r.EditorZone.MAIN;const l=[],{header:s,footer:a}=t.getOptions();s.disabled||l.push(r.EditorZone.HEADER),a.disabled||l.push(r.EditorZone.FOOTER),l.length&&this._watchMouseMoveZoneChange(l)}_watchMouseMoveZoneChange(t){this.pageContainer.addEventListener("mousemove",dl(e=>{if(!(this.isDisableMouseMove||!this.draw.getIsPagingMode())){if(this.draw.getMode()!==r.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()===r.EditorZone.MAIN&&(n===r.EditorZone.HEADER||n===r.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(`${q}-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===r.EditorZone.HEADER?"headerTip":"footerTip"}`)):this.tipContainer.classList.remove("show")}}class Rg{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=r.EditorZone.MAIN,this.indicatorContainer=null,this.options.zone.tipDisabled||new ug(t,this)}isHeaderActive(){return this.getZone()===r.EditorZone.HEADER}isMainActive(){return this.getZone()===r.EditorZone.MAIN}isFooterActive(){return this.getZone()===r.EditorZone.FOOTER}getZone(){return this.currentZone}setZone(t){const{header:e,footer:n}=this.options;!e.editable&&t===r.EditorZone.HEADER||!n.editable&&t===r.EditorZone.FOOTER||this.currentZone!==t&&(this.currentZone=t,this.draw.getRange().clearRange(),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),this.drawZoneIndicator(),Vo(()=>{const i=this.draw.getListener();i.zoneChange&&i.zoneChange(t);const l=this.draw.getEventBus();l.isSubscribe("zoneChange")&&l.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?r.EditorZone.HEADER:t>s?r.EditorZone.FOOTER:r.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,l=this.draw.getPageList(),s=this.draw.getMargins(),a=this.draw.getInnerWidth(),c=this.draw.getHeight(),d=this.draw.getPageGap(),u=c+d;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${q}-zone-indicator`);const R=this.draw.getHeader(),h=this.draw.getFooter(),g=e?R.getHeight():h.getHeight(),T=e?R.getHeaderTop():c-h.getFooterBottom()-g;for(let f=0;f<l.length;f++){const m=u*f+T,p=s[3]-this.INDICATOR_PADDING,C=s[3]+a+this.INDICATOR_PADDING,I=e?m-this.INDICATOR_PADDING:m+g+this.INDICATOR_PADDING,P=e?m+g+this.INDICATOR_PADDING:m-this.INDICATOR_PADDING,M=document.createElement("div");M.innerText=this.i18n.t(`frame.${e?"header":"footer"}`),M.style.top=`${P}px`,M.style.transform=`translate(${n*t}px, ${i*t}px) scale(${t})`,this.indicatorContainer.append(M);const N=document.createElement("span");N.classList.add(`${q}-zone-indicator-border__top`),N.style.top=`${I}px`,N.style.width=`${a}px`,N.style.marginLeft=`${s[3]}px`,this.indicatorContainer.append(N);const F=document.createElement("span");F.classList.add(`${q}-zone-indicator-border__left`),F.style.top=`${m}px`,F.style.height=`${g}px`,F.style.left=`${p}px`,this.indicatorContainer.append(F);const S=document.createElement("span");S.classList.add(`${q}-zone-indicator-border__bottom`),S.style.top=`${P}px`,this.indicatorContainer.append(S);const W=document.createElement("span");W.classList.add(`${q}-zone-indicator-border__right`),W.style.top=`${m}px`,W.style.height=`${g}px`,W.style.left=`${C}px`,this.indicatorContainer.append(W)}this.container.append(this.indicatorContainer)}_clearZoneIndicator(){this.indicatorContainer?.remove(),this.indicatorContainer=null}}class hg{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],l=this.draw.getHeight(),s=this.getHeight(),a=l-t-s;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:a,innerWidth:e,zone:r.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*Ai[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(),l=[];let s=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(s+c.height>i)break;l.push(c),s+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:l,pageNo:e,startIndex:0,innerWidth:n,zone:r.EditorZone.FOOTER}),t.restore()}}class gg{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:l}=this.range.getRange();if(!~i&&!~l)return;const s=this.range.getRangeParagraphElementList();if(!s||!s.length)return;if(s.find(R=>R.listType===t&&R.listStyle===e)||!t){this.unsetList();return}const c=gt();s.forEach(R=>{R.listId=c,R.listType=t,R.listStyle=e});const d=i===l,u=d?l:i;this.draw.render({curIndex:u,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 l=this.draw.getElementList(),s=l[n];if(s.listId){let d=n+1;for(;d<l.length;){const u=l[d];if(u.value===k&&!u.listWrap)break;if(u.listId!==s.listId){this.draw.spliceElementList(l,d,0,[{value:k}]);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,l=e[i]?.listId,s=[];const a=e.length;for(;i<a;){const c=e[i];if(l&&l===c.listId)s.push(c);else if(c.listId&&c.listId!==l){if(s.length){const d=this.getListStyleWidth(t,s);n.set(l,d)}l=c.listId,s=l?[c]:[]}i++}if(s.length){const c=this.getListStyleWidth(t,s);n.set(l,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,l=e[0];if(l.listStyle&&l.listStyle!==r.ListStyle.DECIMAL)return l.listStyle===r.ListStyle.CHECKBOX?(i.width+this.LIST_GAP)*n:this.UN_COUNT_STYLE_WIDTH*n;const s=e.reduce((d,u)=>(u.value===k&&(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)}${r.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:l,listIndex:s,ascent:a}=e,c=i[0];if(c.value!==k||c.listWrap)return;let d=0;const{defaultTabWidth:u,scale:R}=this.options;for(let m=1;m<i.length&&i[m]?.type===r.ElementType.TAB;m++)d+=u*R;const{coordinate:{leftTop:[h,g]}}=n,T=h-l+d,f=g+a;if(c.listStyle===r.ListStyle.CHECKBOX){const{width:m,height:p,gap:C}=this.options.checkbox,I={...c,checkbox:{value:!!c.checkbox?.value},metrics:{...c.metrics,width:(m+C*2)*R,height:p*R}};this.draw.getCheckboxParticle().render({ctx:t,x:T-C*R,y:f,index:0,row:{...e,elementList:[I,...e.elementList]}})}else{let m="";if(c.listType===r.ListType.UL?m=Ko[c.listStyle]||Ko[xe.DISC]:m=`${s+1}${r.KeyMap.PERIOD}`,!m)return;t.save(),t.font=this.getListFontStyle(i,R),t.fillText(m,T,f),t.restore()}}}class Kn{options;static WIDTH=12;static HEIGHT=9;static GAP=3;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:l,lineBreak:{color:s,lineWidth:a}}=this.options;t.save(),t.beginPath();const c=i-Kn.HEIGHT*l/2,d=n+e.metrics.width;t.translate(d,c),t.scale(l,l),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(),l=this.draw.getInnerWidth(),s=this.draw.getMargins();let a=s[3];e.disabled||(a+=(Kn.WIDTH+Kn.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:l})}render(t,e){const{placeholder:n=this.options.placeholder}=e||{},{data:i,font:l,size:s,color:a,opacity:c}=n;this._recovery(),this.elementList=[{value:i,font:l,size:s,color:a}],yt(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 Tg{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()!==r.EditorZone.MAIN)return null;const t=this.range.getSelection();if(!t)return null;const e=gt();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 l=t[i];if(l.type===r.ElementType.TABLE){const s=l.trList;for(let a=0;a<s.length;a++){const c=s[a];for(let d=0;d<c.tdList.length;d++){const u=c.tdList[d],R=this.getElementListByGroupId(u.value,e);if(R.length)return n.push(...R),n}}}if(l?.groupIds?.includes(e)&&(n.push(l),!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 l=n[i],s=l.groupIds,a=s.findIndex(c=>c===t);s.splice(a,1),s.length||delete l.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===r.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 u=c.tdList[d],R=this.getContextByGroupId(u.value,e);if(R)return{...R,isTable:!0,index:n,trIndex:a,tdIndex:d,tdId:u.id,trId:c.id,tableId:i.tableId}}}}const l=t[n+1];if(i.groupIds?.includes(e)&&!l?.groupIds?.includes(e))return{isTable:!1,startIndex:n,endIndex:n}}return null}clearFillInfo(){this.fillRectMap.clear()}recordFillInfo(t,e,n,i,l){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:l})}}render(t){if(!this.fillRectMap.size)return;const e=this.range.getRange(),i=this.draw.getElementList()[e.endIndex]?.groupIds,{group:{backgroundColor:l,opacity:s,activeOpacity:a,activeBackgroundColor:c}}=this.options;t.save(),this.fillRectMap.forEach((d,u)=>{const{x:R,y:h,width:g,height:T}=d;i?.includes(u)?(t.globalAlpha=a,t.fillStyle=c):(t.globalAlpha=s,t.fillStyle=l),t.fillRect(R,h,g,T)}),t.restore(),this.clearFillInfo()}}class fg{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:l,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*l,0,Math.PI*2),t.fill(),t.closePath(),t.restore()}}class mg{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 pg{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{scale:n,lineNumber:{color:i,size:l,font:s,right:a,type:c}}=this.options,d=this.draw.getTextParticle(),u=this.draw.getMargins(),R=this.draw.getPosition().getOriginalMainPositionList(),g=this.draw.getPageRowList()[e];t.save(),t.fillStyle=i,t.font=`${l*n}px ${s}`;for(let T=0;T<g.length;T++){const f=g[T],{coordinate:{leftBottom:m}}=R[f.startIndex],p=c===r.LineNumberType.PAGE?T+1:f.rowIndex+1,C=d.measureText(t,{value:`${p}`}),I=u[3]-(C.width+a)*n,P=m[1]-C.actualBoundingBoxAscent*n;t.fillText(`${p}`,I,P)}t.restore()}}class Ig{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:l}}=this.options;t.save(),t.translate(.5,.5),t.strokeStyle=n,t.lineWidth=i*e;const s=this.draw.getMargins(),a=s[3]-l[3]*e,c=s[0]+this.header.getExtraHeight()-l[0]*e,d=this.draw.getInnerWidth()+(l[1]+l[3])*e,u=this.draw.getHeight()-c-this.footer.getExtraHeight()-s[2]+l[2]*e;t.rect(a,c,d,u),t.stroke(),t.restore()}}function Cg(o,t){const{value:e,oldValue:n}=t;n.isTable&&!e.isTable&&o.getTableTool().dispose()}class Lg{draw;eventBus;constructor(t){this.draw=t,this.eventBus=t.getEventBus(),this.execute()}execute(){this.eventBus.on("positionContextChange",t=>{Cg(this.draw,t)})}}class Pg{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:l}=this.options.table,s=this.draw.getElementList();let a=0;if(s[n]?.listId){const T=this.position.getPositionList(),{rowIndex:f}=T[n];a=this.draw.getRowList()[f]?.offsetX||0}const c=this.draw.getContextInnerWidth()-a,d=[],u=c/e;for(let T=0;T<e;T++)d.push({width:u});const R=[];for(let T=0;T<t;T++){const f=[],m={height:l,tdList:f};for(let p=0;p<e;p++)f.push({colspan:1,rowspan:1,value:[]});R.push(m)}const h={type:r.ElementType.TABLE,value:"",colgroup:d,trList:R};yt([h],{editorOptions:this.options}),wt(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 R=c.tdList[0].rowIndex;for(let h=0;h<n;h++){const g=a[h];for(let T=0;T<g.tdList.length;T++){const f=g.tdList[T];f.rowspan>1&&f.rowIndex+f.rowspan>=R+1&&(f.rowspan+=1)}}}const d=gt(),u={height:c.height,id:d,tdList:[]};for(let R=0;R<c.tdList.length;R++){const h=c.tdList[R],g=gt();u.tdList.push({id:g,rowspan:1,colspan:h.colspan,value:[{value:k,size:16,tableId:i,trId:d,tdId:g}]})}a.splice(n,0,u),this.position.setPositionContext({isTable:!0,index:e,trIndex:n,tdIndex:0,tdId:u.tdList[0].id,trId:u.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 T=a[g];for(let f=0;f<T.tdList.length;f++){const m=T.tdList[f];m.rowspan>1&&m.rowIndex+m.rowspan>=h+1&&(m.rowspan+=1)}}}const u=gt(),R={height:d.height,id:u,tdList:[]};for(let h=0;h<d.tdList.length;h++){const g=d.tdList[h],T=gt();R.tdList.push({id:T,rowspan:1,colspan:g.colspan,value:[{value:k,size:16,tableId:i,trId:u,tdId:T}]})}a.splice(n+1,0,R),this.position.setPositionContext({isTable:!0,index:e,trIndex:n+1,tdIndex:0,tdId:R.tdList[0].id,trId:R.id,tableId:s.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}adjustColWidth(t){if(t.type!==r.ElementType.TABLE)return;const{defaultColMinWidth:e}=this.options.table,n=t.colgroup,i=n.reduce((s,a)=>s+a.width,0),l=this.draw.getOriginalInnerWidth();if(i>l){const s=n.filter(c=>c.width>e),a=(i-l)/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 R=0;R<a.length;R++){const h=a[R],g=gt();h.tdList.splice(c,0,{id:g,rowspan:1,colspan:1,value:[{value:k,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 R=0;R<a.length;R++){const h=a[R],g=gt();h.tdList.splice(c,0,{id:g,rowspan:1,colspan:1,value:[{value:k,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 u=0;u<d;u++){const h=a[u].tdList;for(let g=0;g<h.length;g++){const T=h[g];T.rowIndex+T.rowspan>d&&T.rowspan--}}for(let u=0;u<c.tdList.length;u++){const R=c.tdList[u];if(R.rowspan>1){const h=gt(),g=a[n+1];g.tdList.splice(u,0,{id:h,rowspan:R.rowspan-1,colspan:R.colspan,value:[{value:k,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(R=>R.tdList.length>1)){this.deleteTable();return}for(let R=0;R<a.length;R++){const h=a[R];for(let g=0;g<h.tdList.length;g++){const T=h.tdList[g];T.colIndex<=d&&T.colIndex+T.colspan>d&&(T.colspan>1?T.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,l=t.index;if(n.pagingId){l=t.index-n.pagingIndex;for(let a=l+1;a<e.length&&e[a].pagingId===n.pagingId;a++)i++}e.splice(l,i);const s=l-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:l,endTrIndex:s}=this.range.getRange();if(!e)return;const{index:a}=t,u=this.draw.getOriginalElementList()[a].trList;let R=u[l].tdList[n],h=u[s].tdList[i];(R.x>h.x||R.y>h.y)&&([R,h]=[h,R]);const g=R.colIndex,T=h.colIndex+(h.colspan-1),f=R.rowIndex,m=h.rowIndex+(h.rowspan-1),p=[];for(let X=0;X<u.length;X++){const O=u[X],E=[];for(let L=0;L<O.tdList.length;L++){const V=O.tdList[L],y=V.colIndex,U=V.rowIndex;y>=g&&y<=T&&U>=f&&U<=m&&E.push(V)}E.length&&p.push(E)}if(!p.length)return;const C=p[p.length-1],I=p[0][0],P=C[C.length-1],M=I.x,N=I.y,F=P.x+P.width,S=P.y+P.height;for(let X=0;X<p.length;X++){const O=p[X];for(let E=0;E<O.length;E++){const L=O[E],V=L.x,y=L.y,U=V+L.width,Q=y+L.height;if(M>V||N>y||F<U||S<Q)return}}const W=[],Y=p[0][0],b=Y.value[0];for(let X=0;X<p.length;X++){const O=p[X];for(let E=0;E<O.length;E++){const L=O[E];if(!(X===0&&E===0)){W.push(L.id);const y=L.value.length>1?0:1;for(let U=y;U<L.value.length;U++){const Q=L.value[U];Ze(en,b,Q),Y.value.push(Q)}}X===0&&E!==0&&(Y.colspan+=L.colspan),X!==0&&Y.colIndex===L.colIndex&&(Y.rowspan+=L.rowspan)}}for(let X=0;X<u.length;X++){const O=u[X];let E=0;for(;E<O.tdList.length;){const L=O.tdList[E];W.includes(L.id)&&(O.tdList.splice(E,1),E--),E++}}this.position.setPositionContext({...t,trIndex:Y.trIndex,tdIndex:Y.tdIndex});const D=Y.value.length-1;this.range.setRange(D,D),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 u=d.colspan;if(d.colspan>1){for(let h=1;h<d.colspan;h++){const g=gt();c.tdList.splice(n+h,0,{id:g,rowspan:1,colspan:1,value:[{value:k,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 T=0;T<u;T++){const f=gt();g.tdList.splice(d.colIndex,0,{id:f,rowspan:1,colspan:1,value:[{value:k,size:16,tableId:s.id,trId:g.id,tdId:f}]})}}d.rowspan=1}const R=d.value.length-1;this.range.setRange(R,R),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:l}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,d=c[l],u=d.tdList[i];a.colgroup.splice(i+1,0,{width:this.options.table.defaultColMinWidth});for(let R=0;R<c.length;R++){const h=c[R];let g=0;for(;g<h.tdList.length;){const T=h.tdList[g];if(T.rowIndex!==u.rowIndex)T.colIndex<=u.colIndex&&T.colIndex+T.colspan>u.colIndex&&T.colspan++;else if(T.id===u.id){const f=gt();d.tdList.splice(g+u.colspan,0,{id:f,rowspan:u.rowspan,colspan:1,value:[{value:k,size:16,tableId:a.id,trId:h.id,tdId:f}]}),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:l}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,u=c[l].tdList[i];let R=-1,h=0;for(;h<c.length;){if(h===R){h++;continue}const g=c[h];let T=0;for(;T<g.tdList.length;){const f=g.tdList[T];if(f.id===u.id){const m=gt(),p=gt();c.splice(h+u.rowspan,0,{id:m,height:this.options.table.defaultTrMinHeight,tdList:[{id:p,rowspan:1,colspan:u.colspan,value:[{value:k,size:16,tableId:a.id,trId:m,tdId:p}]}]}),R=h+u.rowspan}else f.rowIndex>=u.rowIndex&&f.rowIndex<u.rowIndex+u.rowspan&&f.rowIndex+f.rowspan>=u.rowIndex+u.rowspan&&f.rowspan++;T++}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 l=e[i];for(let s=0;s<l.length;s++){const a=l[s];!a||a.verticalAlign===t||!a.verticalAlign&&t===r.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,l=this.draw.getOriginalElementList()[n];if(!l.borderType&&t===r.TableBorder.ALL||l.borderType===t)return;l.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,l=this.draw.getOriginalElementList()[n];if(!l.borderColor&&t===this.options.table.defaultBorderColor||l.borderColor===t)return;l.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:l}=this.range.getRange();this.draw.render({curIndex:l})}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:l}=this.range.getRange();this.draw.render({curIndex:l})}tableTdBackgroundColor(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i<e.length;i++){const l=e[i];for(let s=0;s<l.length;s++){const a=l[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:l,endIndex:s}=this.range.getRange(),c=this.draw.getOriginalElementList()[e].trList,d=c.length-1,u=c[d].tdList.length-1;this.range.replaceRange({startIndex:l,endIndex:s,tableId:n,startTdIndex:0,endTdIndex:u,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],l=this.draw.getOptions().table.tdPadding,s=i.tdPadding||l,a=document.createElement("div");a.className="table-properties-modal",a.setAttribute("editor-component","table-properties-modal"),a.innerHTML=`
|
|
509
514
|
<div class="table-properties-modal__mask"></div>
|
|
510
515
|
<div class="table-properties-modal__container">
|
|
511
516
|
<div class="table-properties-modal__header">
|
|
@@ -535,15 +540,14 @@ ${R} `}textToElements(t){const e=[],n=t.split(`
|
|
|
535
540
|
<button class="btn-confirm">确定</button>
|
|
536
541
|
</div>
|
|
537
542
|
</div>
|
|
538
|
-
`,document.body.appendChild(a);const c=a.querySelector(".table-properties-modal__mask"),d=a.querySelector(".table-properties-modal__close"),u=a.querySelector(".btn-cancel"),R=a.querySelector(".btn-confirm"),h=()=>{a.remove()};c.addEventListener("click",h),d.addEventListener("click",h),u.addEventListener("click",h),R.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})})}}class og{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,u=this.draw.getOriginalMainElementList();if(!u[c]||!u[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],u=c[c.length-1],R=n[3],h=Math.ceil(d.coordinate.leftTop[1]),g=Math.ceil(u.coordinate.rightBottom[1]-h);t.textBaseline="middle",s.backgroundColor&&(t.fillStyle=s.backgroundColor,t.fillRect(R,h,i,g)),s.borderColor&&(t.strokeStyle=s.borderColor,t.strokeRect(R,h,i,g)),s.placeholder&&a.length<=1&&new Fr(this.draw).render(t,{placeholder:{...ki,...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:Mt(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(wi(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 ig{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,u=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),R=(r||i.left)*n,h=(s||i.top)*n+u;this._drawImage(t,R,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:u,top:R,width:h,height:g,value:f}=d,T=(u||r.left)*i,m=(R||r.top)*i+c.coordinate.leftTop[1];this._drawImage(t,T,m,h*i,g*i,f)}}}}}class sg{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 yr=1024,rg=['[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 br(o,t,e){for(let n=0;n<e.length;n+=yr){const i=e.slice(n,n+yr);o.splice(t+n,0,...i)}}class lg{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 _h(e.locale),this.historyManager=new Ba(this),this.position=new $a(this),this.zone=new Ah(this),this.range=new za(this),this.margin=new tc(this),this.background=new ja(this),this.badge=new ig(this),this.search=new ec(this),this.group=new Bh(this),this.area=new og(this),this.underline=new oc(this),this.strikeout=new nc(this),this.highlight=new qa(this),this.previewer=new Zh(this),this.imageParticle=new vi(this),this.laTexParticle=new _i(this),this.textParticle=new ic(this),this.tableParticle=new lc(this),this.tableTool=new ac(this),this.tableOperate=new ng(this),this.pageNumber=new an(this),this.lineNumber=new jh(this),this.waterMark=new mc(this),this.placeholder=new Fr(this),this.header=new Rc(this,n.header),this.footer=new kh(this,n.footer),this.hyperlinkParticle=new cc(this),this.labelParticle=new dc(this),this.macroParticle=new uc(this),this.dateParticle=new Qh(this),this.separatorParticle=new fc(this),this.pageBreakParticle=new Tc(this),this.superscriptParticle=new hc,this.subscriptParticle=new gc,this.checkboxParticle=new Nh(this),this.radioParticle=new Fh(this),this.menstrualHistoryParticle=new yh(this),this.fetalHeartPositionParticle=new bh(this),this.toothPositionParticle=new Wh(this),this.blockParticle=new Kh(this),this.listParticle=new Jh(this),this.lineBreakParticle=new Un(this),this.whiteSpaceParticle=new $h(this),this.control=new Oh(this),this.pageBorder=new qh(this),this.graffiti=new sg(this,n.graffiti),this.scrollObserver=new sc(this),this.selectionObserver=new rc(this),this.imageObserver=new xh,new zh(this),this.canvasEvent=new ka(this),this.cursor=new Ra(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new Ja(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new wh(this),new eg(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.macroParticle.clearInlineEditor({isSubmitHistory:!1}),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)}getSubTemplateRuntimeEndIndex(t,e,n){let i=e+1;for(;i<t.length&&t[i].subTemplateParentId===n;)i++;return i}syncSubTemplateExpandedState(t,e,n,i,r){let s=!1;const a=this.getSubTemplateRuntimeEndIndex(t,e,n.id);if(i&&!n.subTemplateContent?.length&&(i=!1),n.subTemplateExpanded!==i&&(n.subTemplateExpanded=i,s=!0),!!n.hide!==r&&(n.hide=r,s=!0),!i)return a>e+1&&(t.splice(e+1,a-e-1),s=!0),s;if(a===e+1){const c=at(n.subTemplateContent||[]);bt(c,{isHandleFirstElement:!1,editorOptions:this.options});for(let d=0;d<c.length;d++)c[d].subTemplateParentId=n.id;c.length&&(t.splice(e+1,0,...c),s=!0)}return s}applySubTemplateRuntimeState(t,e){const n=i=>{let r=!1,s=0;for(;s<i.length;){const a=i[s];if(a.type===l.ElementType.SUB_TEMPLATE){const c=!!a.subTemplateConditions?.length;if(this.mode===l.EditorMode.EDIT&&c)r=this.syncSubTemplateExpandedState(i,s,a,!0,!0)||r;else if((this.mode===l.EditorMode.FORM||this.mode===l.EditorMode.PRINT)&&c){const d=e?Xh(a.subTemplateConditions,e,a.subTemplateRelation):!1;r=this.syncSubTemplateExpandedState(i,s,a,d,!0)||r}else this.mode!==l.EditorMode.FORM&&this.mode!==l.EditorMode.PRINT&&(r=this.syncSubTemplateExpandedState(i,s,a,!1,!1)||r)}if(a.valueList?.length&&(r=n(a.valueList)||r),a.control?.value?.length&&(r=n(a.control.value)||r),a.type===l.ElementType.TABLE&&a.trList?.length)for(let c=0;c<a.trList.length;c++){const d=a.trList[c];for(let u=0;u<d.tdList.length;u++)r=n(d.tdList[u].value)||r}s++}return r};return n(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 u of d.tdList)this.updateTextFieldPlaceholderVisibility(u.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,u=c.control.type;let R=!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()&&(R=!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)&&(R=!0),L.controlComponent===l.ControlComponent.VALUE&&L.control&&L.control.type!==u&&(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(!R&&!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&&R){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:!!Wi(e,n=>!!n&&n.nodeType===1&&!!n.getAttribute(ue)):!1}isTargetInsideExternalOverlay(t){const e=this.getEventTarget(t);return!e||this.isTargetInsideEditor(e)?!1:!!e.closest(rg)}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,u=n+1;d||this.newSpliceElementList(r,u,i-n),this.newSpliceElementList(r,u,0,t),a=n+t.length}else{const d=n===i,u=n+1;d||this.newSpliceElementList(r,u,i-n),this.newSpliceElementList(r,u,0,t),a=n+t.length;const R=r[u-1];t[0].listId&&R&&!R.listId&&R?.value===_&&(!R.type||R.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,u=n+1,R=c[n];if(R?.controlComponent===l.ControlComponent.PRE_TEXT||R?.controlComponent===l.ControlComponent.POST_TEXT||R?.controlComponent===l.ControlComponent.PREFIX||R?.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,u,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,u,0,t),s=n+t.length}else{const c=this.getElementList(),d=n===i,u=n+1;if(c[u]?.control?.type=="TextField"||c[n]?.control?.type=="TextField"){d||this.newSpliceElementList(c,u,i-n);for(let R=0;R<t.length;R++)if(t[R]?.type===l.ElementType.MENSTRUAL_HISTORY||t[R]?.type===l.ElementType.FETAL_HEART_POSITION||t[R]?.type===l.ElementType.TOOTH_POSITION||t[R]?.type===l.ElementType.MACRO||t[R]?.type===l.ElementType.CUSTOM_MACRO||t[R]?.type===l.ElementType.REUSABLE_ITEM||t[R]?.type===l.ElementType.SUB_TEMPLATE||t[R]?.type===l.ElementType.SPECIAL_SYMBOLS){t[R].controlComponent=l.ControlComponent.VALUE;const h=c[n]?.controlId||c[u]?.controlId;!t[R].controlId&&h&&(t[R].controlId=h)}this.newSpliceElementList(c,u,0,t),s=n+t.length}else{d||this.spliceElementList(c,u,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,u,0,t),s=n+t.length;const R=c[u-1];t[0].listId&&R&&!R.listId&&R?.value===_&&(!R.type||R.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,R=t[d]?.listId;if(R&&t[e-1]?.listId!==R){let h=d;for(;h<t.length;){const g=t[h];if(g.listId!==R||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];(vt(f)||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 u=0;u<i.length;u++)!i[u].controlComponent&&d?.controlComponent&&(i[u].controlId=d.controlId,i[u].control=d.control,i[u].controlComponent=d.controlComponent),d=i[u];br(t,e,i)}}newSpliceElementList(t,e,n,i,r){const{isIgnoreDeletedRule:s=!1}=r||{},{group:a,modeRule:c}=this.options;if(n>0){const u=e+n,h=t[u]?.listId;if(h&&t[e-1]?.listId!==h){let g=u;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=u-1;for(;f>=e;){const T=t[f];(vt(T)||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 u=0;u<i.length;u++)d&&(i[u].originControlId=d);br(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:Mt(e.header,{extraPickAttrs:n,editorOptions:this.options}),main:Mt(e.main,{extraPickAttrs:n,isClassifyArea:!0,editorOptions:this.options}),footer:Mt(e.footer,{extraPickAttrs:n,editorOptions:this.options}),graffiti:e.graffiti};return{version:ve,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(ue,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:u=[]}=t,{defaultSize:R,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),C=[],S=this._collectTextControlValueSet(n);n.length&&C.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,E=0,W=0;for(let X=0;X<n.length;X++){const O=C[C.length-1],M=n[X];this.clearElementEffect(M);const b=this.getElementRowMargin(M),y={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},D=O.offsetX||M.listId&&P.get(M.listId)||0,U=e-D,Q=O.elementList.length===1;if(F+=Q?D:0,N+=Q&&O.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 K=M.control?.type===l.ControlType.TEXTFIELD,v=M.controlId,w=!!v&&!!S?.has(v);K?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(vt(M)&&!this.isDesignMode()){const K=O.elementList[O.elementList.length-1];y.height=K?.metrics.height||this.options.defaultSize*h,y.boundingBoxAscent=K?.metrics.boundingBoxAscent||0,y.boundingBoxDescent=K?.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)y.width=0,y.height=0,y.boundingBoxDescent=0;else{const K=M.width*h,v=M.height*h;if(K>U){const w=v*U/K;M.width=U/h,M.height=w/h,y.width=U,y.height=w,y.boundingBoxDescent=w}else y.width=K,y.height=v,y.boundingBoxDescent=v;if(M.imgCaption?.value){const w=M.imgCaption.size||g.size,Z=M.imgCaption.top??g.top,J=(w+Z)*h;y.boundingBoxAscent+=J}}else if(M.type===l.ElementType.TABLE){const K=M.tdPadding||f;if(M.pagingId){let x=X+1,A=0;for(;x<n.length;){const $=n[x];if($.pagingId===M.pagingId){const B=$.trList.filter(pt=>!pt.pagingRepeat).filter(pt=>(pt.tdList=pt.tdList.filter(Xt=>{if(Xt.originalId){for(let Lt=0;Lt<M.trList.length;Lt++){const yt=M.trList[Lt],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}),!pt.originalId));M.trList.push(...B),M.height+=$.height,x++,A++}else break}A&&n.splice(X+1,A)}M.pagingIndex=M.pagingIndex??0,this.tableParticle.computeTrHeight(M,x=>this.computeRowList({innerWidth:(x.width-(K[1]+K[3]))*h,elementList:x.value,isFromTable:!0,isPagingMode:i})),M.trList?.forEach(x=>{x.tdList.forEach(A=>{this.tdMap.set(A.id,A)})});const v=this.tableParticle.getTableHeight(M),w=this.tableParticle.getTableWidth(M);M.width=w,M.height=v;const Z=w*h,J=v*h;if(y.width=Z,y.height=J,y.boundingBoxDescent=J,y.boundingBoxAscent=-b,n[X+1]?.type===l.ElementType.TABLE&&(y.boundingBoxAscent-=b),i){const x=this.getHeight(),A=this.getMainOuterHeight();let $=A;for(let Lt=0;Lt<C.length;Lt++){const yt=C[Lt],Yt=yt.offsetY||0;yt.height+$+Yt>x||C[Lt-1]?.isPageBreak?$=A+yt.height+Yt:$+=yt.height+Yt}const B=b*2,pt=M.trList[0].height*h;($+pt+B>x||M.pagingIndex!==0&&M.trList[0].pagingRepeat||n[X-1]?.type===l.ElementType.PAGE_BREAK)&&($=A);let Xt=x-($+B);if(J>Xt){const Lt=M.trList;let yt=0,Yt=0,St=0;for(let Tt=0;Tt<Lt.length;Tt++){const Pt=Lt[Tt],Ht=Pt.height*h;if($+B+St+Ht>x){const Qt=Pt;let Ve=0;const qt={...at(Qt),id:lt(),originalId:Qt.originalId??Qt.id,minHeight:void 0,tdList:M.colgroup.map((mt,ie)=>{if(Ve--,Ve>0)return;const _t=Qt.tdList.find(Ye=>Ye.colIndex===ie),Bt=_t??this.tableParticle.findPreRowSpanTd(Lt,Tt,ie);_t&&(Ve=_t.colspan);const ze=lt();return Bt.originalRowspan=Bt.rowspan,_t?{..._t,id:ze,originalId:_t.originalId??_t.id,linkTdPrevId:_t.id,tdIndex:ie,original:Bt}:{id:ze,originalId:Bt.originalId??Bt.id,linkTdPrevId:Bt.id,tdIndex:ie,colIndex:ie,colspan:1,rowspan:1,value:[],rowList:[],original:Bt}}).filter(mt=>!!mt)},de=qt.tdList,xt=de.map(mt=>mt.original);xt.forEach((mt,ie)=>{const _t=[];let Bt=Xt;if(mt.rowspan>1){const Ye=Lt.slice(mt.trIndex,mt.trIndex+Tt-mt.trIndex);Bt+=Ye.reduce((Cf,Sf)=>Sf.height*h+Cf,0)}for(;mt.mainHeight*h>Bt&&mt.rowList?.length;){const Ye=mt.rowList.pop();mt.value.splice(mt.value.length-Ye.elementList.length),_t.unshift(Ye),mt.mainHeight-=Ye.height}const ze=de[ie];ze.rowList=_t,ze.value=_t.map(Ye=>Ye.elementList).flat()});let Me=!0;const Xi=Qt.tdList.some(mt=>mt.rowList?.length),wr=qt.tdList.some(mt=>mt.rowList?.length),Ni=Qt.minHeight>Xt;if(wr||Ni){(Xi||!wr&&Ni)&&(Ni&&(Qt.originalMinHeight=Qt.minHeight,Qt.minHeight=Xt,qt.minHeight=Math.max(Qt.originalMinHeight-Xt,T)),qt.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})}),Lt.splice(yt+1,0,qt),yt+=1,Yt=Lt.length-yt,Me=!1),xt.forEach(mt=>{if(mt.rowspan>1){const ie=mt.rowspan-(Tt-mt.trIndex);mt.rowspan=Tt-mt.trIndex+(Xi?1:0);const _t=qt.tdList.find(Bt=>Bt.colIndex===mt.colIndex);Xi?_t.rowspan=ie:(_t.original.linkTdNextId=_t.id,Qt.tdList.push({...mt,..._t,rowspan:ie}),Qt.tdList.sort((Bt,ze)=>Bt.colIndex-ze.colIndex),_t.value=[])}}),Me&&xt.forEach((mt,ie)=>{mt.value.push(...de[ie].value)});break}}yt=Tt+1,Yt=Lt.length-yt,St+=Ht,Xt-=Ht}if(Yt){const Tt=Lt.splice(yt,Yt),Pt=M.pagingId||lt();M.pagingId=Pt;const Ht=at(M);Ht.originalId=M.originalId??M.id,Ht.pagingId=Pt,Ht.pagingIndex=M.pagingIndex+1;const Qt=Lt.filter(de=>de.pagingRepeat);if(Qt.length){const de=at(Qt);de.forEach(xt=>xt.id=lt()),Tt.unshift(...de)}Ht.trList=Tt,Ht.id=lt(),Ht.trList?.forEach(de=>{de.tdList.forEach(xt=>{if(delete xt.valueStartIndex,xt.linkTdPrevId){const Me=this.getTdById(xt.linkTdPrevId);xt.valueStartIndex=Me?(Me.valueStartIndex??0)+Me.value.length:0,this.splitTdValueMap.has(xt.originalId)?this.splitTdValueMap.get(xt.originalId).push(...xt.value):Me&&this.splitTdValueMap.set(xt.originalId,[...Me.value,...xt.value])}xt.value.forEach(Me=>this.updateElementTableInfo(Me,Ht,de,xt))})}),this.spliceElementList(n,X+1,0,[Ht]),this.tableParticle.computeTrHeight(M);const Ve=this.tableParticle.getTableHeight(M),qt=Ve*h;M.height=Ve,y.height=qt,y.boundingBoxDescent=qt}}if(M.pagingId){const Lt=this.position.getPositionContext();if(Lt.isTable){let yt=-1,Yt=-1,St=X;for(;St<n.length;){const Tt=n[St];if(Tt.pagingId!==M.pagingId)break;const Pt=Tt.trList.findIndex(Ht=>Ht.id===Lt.trId);if(~Pt){yt=St,Yt=Pt;break}St++}~yt&&(Lt.index=yt,Lt.trIndex=Yt,this.position.setPositionContext(Lt))}}}this.initTableElementIndex(M,X)}else if(M.type===l.ElementType.SEPARATOR){const{separator:{lineWidth:K}}=this.options,v=M.lineWidth||K;M.width=U/h,y.width=U,y.height=v*h,y.boundingBoxAscent=-b,y.boundingBoxDescent=-b+y.height}else if(M.type===l.ElementType.PAGE_BREAK)M.width=U/h,y.width=U,y.height=R;else if(M.type===l.ElementType.RADIO||M.controlComponent===l.ControlComponent.RADIO){const{width:K,height:v,gap:w}=this.options.radio,Z=K+w*2;M.width=Z,y.width=Z*h,y.height=v*h}else if(M.type===l.ElementType.CHECKBOX||M.controlComponent===l.ControlComponent.CHECKBOX){const{width:K,height:v,gap:w}=this.options.checkbox,Z=K+w*2;M.width=Z,y.width=Z*h,y.height=v*h}else if(M.type===l.ElementType.MENSTRUAL_HISTORY){const K=this.menstrualHistoryParticle.computeSize(M);M.width=K.width/h,y.width=K.width,y.height=K.height,y.boundingBoxAscent=K.height,y.boundingBoxDescent=0}else if(M.type===l.ElementType.FETAL_HEART_POSITION){const K=this.fetalHeartPositionParticle.computeSize();M.width=K.width/h,y.width=K.width,y.height=K.height,y.boundingBoxAscent=K.height/2,y.boundingBoxDescent=K.height/2}else if(M.type===l.ElementType.TOOTH_POSITION){const K=this.toothPositionParticle.computeSize(M);M.width=K.width/h,y.width=K.width,y.height=K.height,y.boundingBoxAscent=K.height/2,y.boundingBoxDescent=K.height/2}else if(M.type===l.ElementType.TAB)y.width=m*h,y.height=R*h,y.boundingBoxDescent=0,y.boundingBoxAscent=this.textParticle.getBasisWordBoundingBoxAscent(L,L.font);else if(M.type===l.ElementType.BLOCK){if(!M.width)y.width=U;else{const K=M.width*h;y.width=Math.min(K,U)}y.height=M.height*h,y.boundingBoxDescent=y.height,y.boundingBoxAscent=0}else if(M.type===l.ElementType.LABEL){const{defaultSize:K,label:{defaultPadding:v}}=this.options;L.font=this.getElementFont(M);const w=this.textParticle.measureText(L,M);y.width=(w.width+v[1]+v[3])*h,y.height=(M.size||K)*h,y.boundingBoxDescent=0,y.boundingBoxAscent=(v[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:K}=this.options;L.font=this.getElementFont(M);const v=this.getMode(),w=v===l.EditorMode.EDIT,Z=v===l.EditorMode.FORM;if(w){const J=M.label||M.value||"";L.font=this.getElementFont(M);const x=L.measureText(J),A=8*h,$=4*h;y.width=x.width+A*2;const B=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;y.height=B+$*2;const pt=this.textParticle.measureBasisWord(L,this.getElementFont(M));y.boundingBoxAscent=pt.actualBoundingBoxAscent*h,y.boundingBoxDescent=pt.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 pt=x||`请选择${B}`,Xt=L.measureText(pt),Lt=L.measureText("[").width,yt=6*h+2*h;y.width=Lt+Xt.width+yt+Lt}else{const pt=x||`请输入${B}`,Xt=L.measureText(pt),Lt=L.measureText("[").width;y.width=Lt+Xt.width+Lt}y.height=(M.size||K)*h,y.boundingBoxDescent=$.actualBoundingBoxDescent*h,y.boundingBoxAscent=$.actualBoundingBoxAscent*h}else{const A=M.label||"",$=x||`请输入${A}`,B=L.measureText($);y.width=B.width,y.height=(M.size||K)*h,y.boundingBoxDescent=B.actualBoundingBoxDescent,y.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}`,pt=L.measureText(B),Xt=L.measureText("[").width;y.width=Xt+pt.width+Xt,y.height=(M.size||K)*h,y.boundingBoxDescent=$.actualBoundingBoxDescent*h,y.boundingBoxAscent=$.actualBoundingBoxAscent*h}else{const $=x||`获取 ${A}`,B=L.measureText($);y.width=B.width,y.height=(M.size||K)*h,y.boundingBoxDescent=B.actualBoundingBoxDescent,y.boundingBoxAscent=B.actualBoundingBoxAscent}}else if(M.type===l.ElementType.SUB_TEMPLATE){const J=M.label||"子模板";if(Z){const x=L.measureText(J),A=8*h,$=4*h,B=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;y.width=x.width+A*2,y.height=B+$*2;const pt=this.textParticle.measureBasisWord(L,this.getElementFont(M));y.boundingBoxAscent=pt.actualBoundingBoxAscent*h,y.boundingBoxDescent=pt.actualBoundingBoxDescent*h}else{const x=L.measureText(J);y.width=x.width,y.height=(M.size||K)*h,y.boundingBoxDescent=x.actualBoundingBoxDescent,y.boundingBoxAscent=x.actualBoundingBoxAscent}}else{const J=M.label||"",x=M.value||`获取 ${J}`,A=L.measureText(x);y.width=A.width,y.height=(M.size||K)*h,y.boundingBoxDescent=A.actualBoundingBoxDescent,y.boundingBoxAscent=A.actualBoundingBoxAscent}}else{const K=M.size||R;(M.type===l.ElementType.SUPERSCRIPT||M.type===l.ElementType.SUBSCRIPT)&&(M.actualSize=Math.ceil(K*.6)),y.height=(M.actualSize||K)*h,L.font=this.getElementFont(M);const v=this.textParticle.measureText(L,M);y.width=v.width*h,M.letterSpacing&&(y.width+=M.letterSpacing*h);const w=this.textParticle.measureBasisWord(L,M.font);y.boundingBoxAscent=w.actualBoundingBoxAscent*h,y.boundingBoxDescent=w.actualBoundingBoxDescent*h,M.type===l.ElementType.SUPERSCRIPT?y.boundingBoxAscent+=y.height/2:M.type===l.ElementType.SUBSCRIPT&&(y.boundingBoxDescent+=y.height/2)}const G=!vt(M)&&(M.imgDisplay!==l.ImageDisplay.INLINE&&M.type===l.ElementType.IMAGE||M.type===l.ElementType.LATEX)?y.height+b:y.boundingBoxAscent+b,H=b+y.boundingBoxAscent+y.boundingBoxDescent+b,tt=Object.assign(M,{metrics:y,left:0,style:this.getElementFont(M,h)});tt.control?.minWidth&&(tt.controlComponent&&(W+=y.width),tt.controlComponent===l.ControlComponent.POSTFIX&&(this.control.setMinWidthControlInfo({row:O,rowElement:tt,availableWidth:U,controlRealWidth:W}),W=0));const st=n[X-1];let et=n[X+1],nt=O.width+y.width;if(this.options.wordBreak===l.WordBreak.BREAK_WORD&&(!st?.type||st?.type===l.ElementType.TEXT)&&(!M.type||M.type===l.ElementType.TEXT)){const K=`${st?.value||""}${M.value}`;if(this.WORD_LIKE_REG.test(K)){const{width:w,endElement:Z}=this.textParticle.measureWord(L,n,X),J=w*h;Z&&J<=U?(nt+=J,et=Z):st&&(nt+=J)}const v=this.textParticle.measurePunctuationWidth(L,et);nt+=v*h}M.listId&&(M.listId!==Y?E=0:M.value===_&&!M.listWrap&&E++),Y=M.listId;const q=this.position.setSurroundPosition({pageNo:V,rowElement:tt,row:O,rowElementRect:{x:F,y:N,height:H,width:y.width},availableWidth:U,surroundElementList:u});F=q.x,nt+=q.rowIncreaseWidth,F+=y.width;let dt=!1;if(this.mode===l.EditorMode.FORM&&M.control?.type===l.ControlType.BUTTON&&M.controlComponent===l.ControlComponent.PREFIX&&O.elementList.filter(K=>K.controlId!==M.controlId).length>0){const K=M.controlId;if(n.some(w=>w.controlId===`${K}_text`&&w.control?.type===l.ControlType.BUTTON)){let w=0;for(let Z=X;Z<n.length;Z++){const J=n[Z];if(J.controlId!==K)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===`${K}_text`){L.font=this.getElementFont(J);const x=this.textParticle.measureText(L,J);w+=x.width*h}}dt=O.width+w>U}}const ot=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||X!==0&&M.value===_&&!M.area?.hide||dt,ut=nt>U,ht=ot||ut;if(ht){const K={width:y.width,height:H,startIndex:X,elementList:[tt],ascent:G,rowIndex:O.rowIndex+1,rowFlex:n[X]?.rowFlex||n[X+1]?.rowFlex,isPageBreak:M.type===l.ElementType.PAGE_BREAK};if(tt.controlComponent!==l.ControlComponent.PREFIX&&tt.control?.indentation===l.ControlIndentation.VALUE_START){const v=O.elementList.findIndex(w=>w.controlId===tt.controlId&&w.controlComponent!==l.ControlComponent.PREFIX);if(~v){const Z=this.position.computeRowPosition({row:O,innerWidth:this.getInnerWidth()})[v];Z&&(K.offsetX=Z.coordinate.leftTop[0])}}M.listId&&(K.isList=!0,K.offsetX=P.get(M.listId),K.listIndex=E),K.offsetY=!r&&M.area?.top&&M.areaId!==n[X-1]?.areaId?M.area.top*h:0,C.push(K)}else O.width+=y.width,X===0&&(sn(n[1])||n[1]?.areaId)?(O.height=p,O.ascent=p):O.height<H&&(O.height=H,O.ascent=G),O.elementList.push(tt);if((ht||X===n.length-1)&&(O.isWidthNotEnough=ut&&!ot,!O.isSurround&&(st?.rowFlex===l.RowFlex.JUSTIFY||st?.rowFlex===l.RowFlex.ALIGNMENT&&O.isWidthNotEnough))){const K=O.elementList[0]?.value===_?O.elementList.slice(1):O.elementList,v=(U-O.width)/(K.length-1);for(let w=0;w<K.length-1;w++){const Z=K[w];Z.metrics.width+=v}O.width=U}if(ht){F=s,N+=O.height,i&&!r&&c&&(N-a+d+H>c||M.type===l.ElementType.PAGE_BREAK)&&(N=a,oa(u,V),V+=1),tt.left=0;const K=C[C.length-1];F=this.position.setSurroundPosition({pageNo:V,rowElement:tt,row:K,rowElementRect:{x:F,y:N,height:H,width:y.width},availableWidth:U,surroundElementList:u}).x,F+=y.width}}return C}_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((R,h)=>R+h.height+(h.offsetY||0),0);const c=this.getPagePixelRatio(),d=this.pageList[0],u=Number(d.style.height.replace("px",""));if(s>u)d.style.height=`${s}px`,d.height=s*c;else{const R=s<i?i:s;d.style.height=`${R}px`,d.height=R*c}this._initPageContext(this.ctxList[0])}else for(let c=0;c<this.rowList.length;c++){const d=this.rowList[c],u=d.offsetY||0;if(d.height+u+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+u,t.push([d]),a++}else s+=d.height+u,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 u=0;u<d.elementList.length;u++){const R=d.elementList[u],h=d.elementList[u-1],g=R.highlight||this.control.getControlHighlight(r,d.startIndex+u);if(g){h&&h.highlight&&h.highlight!==R.highlight&&this.highlight.render(t);const{coordinate:{leftTop:[f,T]}}=i[d.startIndex+u],m=R.left||0;this.highlight.recordFillInfo(t,f-m,T+s-a,R.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:u,positionList:R,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 C=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 E=F.elementList[Y],W=E.metrics,{ascent:X,coordinate:{leftTop:[O,M]}}=R[F.startIndex+Y],b=F.elementList[Y-1];if(vt(E)&&!this.isDesignMode())this.textParticle.complete();else if(E.type===l.ElementType.IMAGE)this.textParticle.complete(),E.imgDisplay!==l.ImageDisplay.SURROUND&&E.imgDisplay!==l.ImageDisplay.FLOAT_TOP&&E.imgDisplay!==l.ImageDisplay.FLOAT_BOTTOM&&this.imageParticle.render(t,E,O,M+X);else if(E.type===l.ElementType.LATEX)this.textParticle.complete(),this.laTexParticle.render(t,E,O,M+X);else if(E.type===l.ElementType.TABLE)L&&(N.x=O,N.y=M,V=E),this.tableParticle.render(t,E,O,M);else if(E.type===l.ElementType.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(t,E,O,M+X);else if(E.type===l.ElementType.LABEL)this.textParticle.complete(),this.labelParticle.render(t,E,O,M+X);else if(E.type===l.ElementType.MACRO||E.type===l.ElementType.CUSTOM_MACRO||E.type===l.ElementType.REUSABLE_ITEM||E.type===l.ElementType.SUB_TEMPLATE)this.textParticle.complete(),this.macroParticle.render(t,E,O,M+X);else if(E.type===l.ElementType.DATE){const H=F.elementList[Y+1];(!b||b.dateId!==E.dateId)&&this.textParticle.complete(),this.textParticle.record(t,E,O,M+X),(!H||H.dateId!==E.dateId)&&this.textParticle.complete()}else E.type===l.ElementType.SUPERSCRIPT?(this.textParticle.complete(),this.superscriptParticle.render(t,E,O,M+X)):E.type===l.ElementType.SUBSCRIPT?(this.underline.render(t),this.textParticle.complete(),this.subscriptParticle.render(t,E,O,M+X)):E.type===l.ElementType.SEPARATOR?this.separatorParticle.render(t,E,O,M):E.type===l.ElementType.PAGE_BREAK?this.mode!==l.EditorMode.CLEAN&&!p&&this.pageBreakParticle.render(t,E,O,M):E.type===l.ElementType.CHECKBOX||E.controlComponent===l.ControlComponent.CHECKBOX?(this.textParticle.complete(),this.checkboxParticle.render({ctx:t,x:O,y:M+X,index:Y,row:F})):E.type===l.ElementType.RADIO||E.controlComponent===l.ControlComponent.RADIO?(this.textParticle.complete(),this.radioParticle.render({ctx:t,x:O,y:M+X,index:Y,row:F})):E.type===l.ElementType.MENSTRUAL_HISTORY?(this.textParticle.complete(),this.menstrualHistoryParticle.render({ctx:t,x:O,y:M+X,index:Y,row:F,element:E})):E.type===l.ElementType.FETAL_HEART_POSITION?(this.textParticle.complete(),this.fetalHeartPositionParticle.render({ctx:t,x:O,y:M+X,index:Y,row:F,element:E})):E.type===l.ElementType.TOOTH_POSITION?(this.textParticle.complete(),this.toothPositionParticle.render({ctx:t,x:O,y:M+X,index:Y,row:F,element:E})):E.type===l.ElementType.TAB?this.textParticle.complete():E.rowFlex===l.RowFlex.ALIGNMENT||E.rowFlex===l.RowFlex.JUSTIFY?(this.textParticle.record(t,E,O,M+X),this.textParticle.complete()):E.type===l.ElementType.BLOCK?(this.textParticle.complete(),this.blockParticle.render(t,d,E,O,M+X)):(E.left&&this.textParticle.complete(),this.textParticle.record(t,E,O,M+X),(E.width||E.letterSpacing||_r.test(E.value))&&this.textParticle.complete());if(f&&!p&&this.mode!==l.EditorMode.CLEAN&&!F.isWidthNotEnough&&Y===F.elementList.length-1&&this.lineBreakParticle.render(t,E,O,M+F.height/2),m&&Gr.test(E.value)&&this.whiteSpaceParticle.render(t,E,O,M+F.height/2),E.control?.border){b?.control?.border&&b.controlId!==E.controlId&&this.control.drawBorder(t);const H=this.getElementRowMargin(E);this.control.recordBorderInfo(O,M+H,E.metrics.width,F.height-2*H)}else b?.control?.border&&this.control.drawBorder(t);if(E.control?.type===l.ControlType.TEXT){const H=E.controlComponent===l.ControlComponent.VALUE,tt=E.controlComponent===l.ControlComponent.POSTFIX||E.controlComponent===l.ControlComponent.POST_TEXT;H&&E.control?.underline&&((!b||b.controlId!==E.controlId||b.controlComponent!==l.ControlComponent.VALUE&&b.controlComponent!==l.ControlComponent.PLACEHOLDER)&&this.control.startTextFieldUnderline(E.controlId,O,M+F.height),this.control.recordTextFieldUnderlineWidth(E.metrics.width)),tt&&this.control.drawTextFieldUnderline(t)}else b?.control?.type===l.ControlType.TEXT&&this.control.drawTextFieldUnderline(t);if((E.underline||E.control?.underline)&&E.controlComponent!==l.ControlComponent.PLACEHOLDER&&!(E.control?.type===l.ControlType.TEXT&&E.control?.underline)){b?.type===l.ElementType.SUBSCRIPT&&E.type!==l.ElementType.SUBSCRIPT&&this.underline.render(t);const H=this.getElementRowMargin(E),tt=E.left||0;let st=0;E.type===l.ElementType.SUBSCRIPT&&(st=this.subscriptParticle.getOffsetY(E));const et=E.control?.underline?this.options.underlineColor:E.color;this.underline.recordFillInfo(t,O-tt,M+F.height-H+st,W.width+tt,0,et,E.textDecoration?.style)}else(b?.underline||b?.control?.underline)&&(b?.control?.type===l.ControlType.TEXT&&b?.control?.underline||this.underline.render(t));if(E.strikeout){if(!E.type||zt.includes(E.type)){b&&(b.type===l.ElementType.SUBSCRIPT&&E.type!==l.ElementType.SUBSCRIPT||b.type===l.ElementType.SUPERSCRIPT&&E.type!==l.ElementType.SUPERSCRIPT||this.getElementSize(b)!==this.getElementSize(E))&&this.strikeout.render(t);const H=this.textParticle.measureBasisWord(t,this.getElementFont(E));let tt=M+X+H.actualBoundingBoxDescent*n-W.height/2;E.type===l.ElementType.SUBSCRIPT?tt+=this.subscriptParticle.getOffsetY(E):E.type===l.ElementType.SUPERSCRIPT&&(tt+=this.superscriptParticle.getOffsetY(E)),this.strikeout.recordFillInfo(t,O,tt,W.width)}}else b?.strikeout&&this.strikeout.render(t);const{zone:y,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)),y===g&&U!==Q&&U<=C&&C<=Q){const H=this.position.getPositionContext();if(!H.isTable&&!E.tdId||H.tdId===E.tdId||G)if(U===C){const tt=u[U+1];tt&&tt.value===_&&(N.x=O+W.width,N.y=M,N.height=F.height,N.width+=this.options.rangeMinWidth)}else{let tt=W.width;tt===0&&F.elementList.length===1&&(tt=this.options.rangeMinWidth),N.width||(N.x=O,N.y=M,N.height=F.height),N.width+=tt}}if(!r.disabled&&E.groupIds&&this.group.recordFillInfo(E,O,M,W.width,F.height),C++,E.type===l.ElementType.TABLE&&!vt(E)){const H=E.tdPadding||i,tt=H[1]+H[3];for(let st=0;st<E.trList.length;st++){const et=E.trList[st];for(let nt=0;nt<et.tdList.length;nt++){const q=et.tdList[nt];this.drawRow(t,{elementList:q.value,positionList:q.positionList,rowList:q.rowList,pageNo:d,startIndex:0,innerWidth:(q.width-tt)*n,zone:g,isDrawLineBreak:f,td:q})}}}}if(F.isList&&this.listParticle.drawListStyle(t,F,R[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:E,width:W,height:X}=N;this.range.render(t,Y,E,W,X)}if(L&&V&&V.id===P){const{coordinate:{leftTop:[Y,E]}}=R[F.startIndex];this.tableParticle.drawRange(t,V,Y,E)}}}}_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 u=d.imgFloatPosition;this.imageParticle.render(t,d,u.x*n,u.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:u,lineNumber:R,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),u.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),R.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=(O,M)=>{n.push({label:O,duration:Vt()-M})};this.renderCount++;const r=this.mode===l.EditorMode.EDIT||this.mode===l.EditorMode.FORM||this.mode===l.EditorMode.PRINT?Eh([...this.getHeaderElementList(),...this.elementList,...this.getFooterElementList()]):null,s=this.applySubTemplateRuntimeState(this.getHeaderElementList(),r)||this.applySubTemplateRuntimeState(this.elementList,r)||this.applySubTemplateRuntimeState(this.getFooterElementList(),r);let{endIndex:a}=this.range.getRange();const{isCrossRowCol:c}=this.range.getRange();if(!c&&~a){const O=this.getElementList(),M=O[a],y=M?.type===l.ElementType.SUB_TEMPLATE&&M.subTemplateExpanded?l.LocationPosition.AFTER:l.LocationPosition.BEFORE,D=Ge(O,a,y);D!==a&&!vt(O[D])&&(this.range.setRange(D,D),a=D)}let d;const u=this.position.getPositionContext();if(c)d=this.getOriginalElementList()[u.index];else{const O=~a?a:0,M=this.getElementList();d=en(M,O)}const{header:R,footer:h}=this.options,{isSubmitHistory:g=!0,isSetCursor:f=!0,isLazy:T=!0,isInit:m=!1,isSourceHistory:p=!1,isFirstRender:I=!1,isDel:L=!1}=t||{};let{isCompute:P=!0}=t||{};s&&(P=!0);let{curIndex:C}=t||{};const{traceLabel:S}=t||{},F=this.getInnerWidth(),N=this.getIsPagingMode(),V=this.pageRowList.length;if(P){if(this.splitTdValueMap.clear(),this.tdMap.clear(),this.position.setFloatPositionList([]),N){if(!R.disabled){const et=Vt();this.header.compute(),i("header.compute",et)}if(!h.disabled){const et=Vt();this.footer.compute(),i("footer.compute",et)}}const O=this.getMargins(),M=this.getHeight(),b=this.header.getExtraHeight(),y=this.getMainOuterHeight(),D=O[3],U=O[0]+b,Q=Zo(this.elementList),G=Vt();this.rowList=this.computeRowList({startX:D,startY:U,pageHeight:M,mainOuterHeight:y,isPagingMode:N,innerWidth:F,surroundElementList:Q,elementList:this.elementList}),i("computeRowList",G);const H=Vt();this.pageRowList=this._computePageList(),i("computePageList",H);const tt=Vt();this.position.computePositionList(),i("computePositionList",tt);const st=Vt();if(this.area.compute(),i("area.compute",st),!this.isPrintMode()){const et=this.search.getSearchKeyword();if(et){const q=Vt();this.search.compute(et),i("search.compute",q)}const nt=Vt();this.control.computeHighlightList(),i("control.computeHighlightList",nt)}if(this.isGraffitiMode()){const et=Vt();this.graffiti.compute(),i("graffiti.compute",et)}}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let O=0;O<this.pageRowList.length;O++)this.pageList[O]||this._createPage(O);const Y=this.pageRowList.length,E=this.pageList.length;if(E>Y){const O=E-Y;this.ctxList.splice(Y,O),this.pageList.splice(Y,O).forEach(M=>M.remove())}const W=Vt();if(T&&N?this._lazyRender():this._immediateRender(),i(T&&N?"lazyRender":"immediateRender",W),f){if(P&&d?.tableId){const{index:O}=u,b=this.getOriginalElementList()[O];if(d.tableId!==b?.id){const D=this.findTableChildrenElement(!0,d.tableId,d);D&&u.index!==D.originalIndex&&(u.index=D.originalIndex,u.tableId=D.table.id,u.trIndex=D.trIndex,u.trId=D.tr.id,u.tdIndex=D.tdIndex,u.tdId=D.td.id,C=D.elementIndex,this.position.setPositionContext(u),this.range.setRange(C,C),this.updateTableTool())}const y=this.getElementList();y[a]!==d&&(C=y.findIndex(D=>D===d))}C=this.setCursor(C)}else this.range.getIsSelection()&&this.cursor.focus();if(L){let O;const M=this.position.getPositionContext();O=this.range.getRange().startIndex-1,M.index=O}(g&&!I||C!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(C);const X=Vt();Co(()=>{const O=Vt();this.range.setRangeStyle(),P&&this.control.getActiveControl()&&this.control.reAwakeControl(),P&&!this.isReadonly()&&this.getMode()!==l.EditorMode.FORM&&u.isTable&&this.getOriginalElementList()[u.index].type===l.ElementType.TABLE&&this.tableTool.render(),P&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),V!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(g||p)&&!m&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"));const M=Vt();So(this.options,S||"render",M-e,[...n,{label:"nextTick.wait",duration:O-X},{label:"nextTick.callback",duration:M-O}],{isCompute:P,pageCount:this.pageRowList.length})}),f&&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 u=0;u<d.trList.length;u++){const R=d.trList[u],h=R.tdList.find(g=>t?s?.linkTdPrevId===g.id:s?.id===g.linkTdPrevId);if(h){n.index=a,n.trIndex=u,n.tableId=d.id,n.trId=R.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,u=this.getOriginalElementList()[s].trList?.[a].tdList[c].positionList;t===void 0&&u&&(t=u.length-1);const R=u?.[t];this.position.setCursorPosition(R||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&&ul.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=wo(this.elementList),i=wo(this.header.getElementList()),r=wo(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.macroParticle.clearInlineEditor({isSubmitHistory:!1}),this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getMacroParticle().clearInlineEditor({isSubmitHistory:!1}),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[u,R]of d.trList.entries())for(const[h,g]of R.tdList.entries()){const f=g.value.findIndex(typeof n=="function"?n:T=>T===n);if(f>=0)return{originalIndex:c,table:d,tr:R,trIndex:u,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 Wr{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;updateSubTemplate;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.updateSubTemplate=t.updateSubTemplate.bind(t),this.expandSubTemplate=t.expandSubTemplate.bind(t),this.collapseSubTemplate=t.collapseSubTemplate.bind(t),this.toggleSubTemplate=t.toggleSubTemplate.bind(t)}}function ag(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 cg(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=ag(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 u=document.createElement("style"),R=`
|
|
543
|
+
`,document.body.appendChild(a);const c=a.querySelector(".table-properties-modal__mask"),d=a.querySelector(".table-properties-modal__close"),u=a.querySelector(".btn-cancel"),R=a.querySelector(".btn-confirm"),h=()=>{a.remove()};c.addEventListener("click",h),d.addEventListener("click",h),u.addEventListener("click",h),R.addEventListener("click",()=>{const g=parseInt(a.querySelector("#tdPaddingTop").value)||0,T=parseInt(a.querySelector("#tdPaddingRight").value)||0,f=parseInt(a.querySelector("#tdPaddingBottom").value)||0,m=parseInt(a.querySelector("#tdPaddingLeft").value)||0;i.tdPadding=[g,T,f,m],h();const{endIndex:p}=this.range.getRange();this.draw.render({curIndex:p,isCompute:!0})})}}r.AreaMode=void 0,(function(o){o.EDIT="edit",o.READONLY="readonly",o.FORM="form"})(r.AreaMode||(r.AreaMode={}));class Mg{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 r.AreaMode.EDIT:return!1;case r.AreaMode.READONLY:return!0;case r.AreaMode.FORM:return!this.draw.getControl().getIsRangeWithinControl();default:return!1}}insertArea(t){const{id:e,value:n,area:i,position:l,range:s}=t;if(this.zone.getZone()!==r.EditorZone.MAIN&&this.zone.setZone(r.EditorZone.MAIN),this.draw.getPosition().setPositionContext({isTable:!1}),s&&!this.getActiveAreaId()){const{startIndex:c,endIndex:d}=s,u=this.draw.getOriginalMainElementList();if(!u[c]||!u[d])return null;this.range.setRange(s.startIndex,s.endIndex)}else if(l===r.LocationPosition.BEFORE)this.range.setRange(0,0);else{const d=this.draw.getOriginalMainElementList().length-1;this.range.setRange(d,d)}const a=e||gt();return this.draw.insertElementList([{type:r.ElementType.AREA,value:"",areaId:a,valueList:n,area:dt(i)}]),a}render(t,e){if(!this.areaInfoMap.size)return;t.save();const n=this.draw.getMargins(),i=this.draw.getInnerWidth();for(const l of this.areaInfoMap){const{area:s,positionList:a}=l[1];if(s?.hide||!s?.backgroundColor&&!s?.borderColor&&!s?.placeholder)continue;const c=a.filter(T=>T.pageNo===e);if(!c.length)continue;t.translate(.5,.5);const d=c[0],u=c[c.length-1],R=n[3],h=Math.ceil(d.coordinate.leftTop[1]),g=Math.ceil(u.coordinate.rightBottom[1]-h);t.textBaseline="middle",s.backgroundColor&&(t.fillStyle=s.backgroundColor,t.fillRect(R,h,i,g)),s.borderColor&&(t.strokeStyle=s.borderColor,t.strokeRect(R,h,i,g)),s.placeholder&&a.length<=1&&new xr(this.draw).render(t,{placeholder:{...rs,...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],l=i.areaId;if(l){const s=this.areaInfoMap.get(l);s?(s.elementList.push(i),s.positionList.push(e[n])):this.areaInfoMap.set(l,{id:l,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:Ct(n.elementList)}:null}getContextByAreaId(t,e){const n=this.draw.getOriginalMainElementList();for(let i=0;i<n.length;i++){const l=n[i];if(e?.position===r.LocationPosition.OUTER_BEFORE){if(n[i+1]?.areaId!==t)continue}else if(e?.position===r.LocationPosition.AFTER){if(!(l.areaId===t&&n[i+1]?.areaId!==t))continue}else if(e?.position===r.LocationPosition.OUTER_AFTER){if(!(l.areaId!==t&&n[i-1]?.areaId===t))continue}else if(l.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 l=["top","hide"];Object.entries(t.properties).forEach(([s,a])=>{if($i(a))return;const c=s;n.area[c]=a,l.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,l=this.draw.getOriginalMainElementList(),s=t.value;yt([{type:r.ElementType.AREA,value:"",valueList:s,areaId:n.id,area:n.area}],{editorOptions:this.options}),this.draw.spliceElementList(l,i[0].index,i.length,s,{isIgnoreDeletedRule:!0}),this.draw.render({isSetCursor:!1})}}class Og{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,l,s){if(this.imageCache.has(s)){const a=this.imageCache.get(s);t.drawImage(a,e,n,i,l)}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,l)}}}render(t,e){if(e===0&&this.mainBadge){const{scale:n,badge:i}=this.options,{left:l,top:s,width:a,height:c,value:d}=this.mainBadge,u=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),R=(l||i.left)*n,h=(s||i.top)*n+u;this._drawImage(t,R,h,a*n,c*n,d)}if(this.areaBadgeMap.size){const n=this.draw.getArea().getAreaInfo();if(n.size){const{scale:i,badge:l}=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:u,top:R,width:h,height:g,value:T}=d,f=(u||l.left)*i,m=(R||l.top)*i+c.coordinate.leftTop[1];this._drawImage(t,f,m,h*i,g*i,T)}}}}}class Eg{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 l=this.draw.getPageNo();let s=this.data.find(d=>d.pageNo===l);if(this.startStroke&&(s||(s={pageNo:l,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:l},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||l)*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 kr=1024,Sg=['[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 Jr(o,t,e){for(let n=0;n<e.length;n+=kr){const i=e.slice(n,n+kr);o.splice(t+n,0,...i)}}class Xg{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;readonlyModeData;splitTdValueMap=new Map;tdMap=new Map;constructor(t,e,n,i,l,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=l,this.override=s,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new cg(e.locale),this.historyManager=new Tc(this),this.position=new fc(this),this.zone=new Rg(this),this.range=new mc(this),this.margin=new Cc(this),this.background=new pc(this),this.badge=new Og(this),this.search=new Lc(this),this.group=new Tg(this),this.area=new Mg(this),this.underline=new Mc(this),this.strikeout=new Pc(this),this.highlight=new Ic(this),this.previewer=new ig(this),this.imageParticle=new qi(this),this.laTexParticle=new ns(this),this.textParticle=new Oc(this),this.tableParticle=new Xc(this),this.tableTool=new Nc(this),this.tableOperate=new Pg(this),this.pageNumber=new hn(this),this.lineNumber=new pg(this),this.waterMark=new wc(this),this.placeholder=new xr(this),this.header=new Wc(this,n.header),this.footer=new hg(this,n.footer),this.hyperlinkParticle=new Fc(this),this.labelParticle=new yc(this),this.macroParticle=new bc(this),this.dateParticle=new sg(this),this.separatorParticle=new Yc(this),this.pageBreakParticle=new Uc(this),this.superscriptParticle=new Vc,this.subscriptParticle=new Dc,this.checkboxParticle=new Jh(this),this.radioParticle=new Bh(this),this.menstrualHistoryParticle=new $h(this),this.fetalHeartPositionParticle=new zh(this),this.toothPositionParticle=new jh(this),this.blockParticle=new lg(this),this.listParticle=new gg(this),this.lineBreakParticle=new Kn(this),this.whiteSpaceParticle=new fg(this),this.control=new _h(this),this.pageBorder=new Ig(this),this.graffiti=new Eg(this,n.graffiti),this.scrollObserver=new Ec(this),this.selectionObserver=new Sc(this),this.imageObserver=new dg,new mg(this),this.canvasEvent=new hc(this),this.cursor=new Va(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new gc(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new og(this),new Lg(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.readonlyModeData=null,this.interactionPaused=!1,this.overlayActiveCount=0,this.globalShortcutSuspended=!1,this.mode===r.EditorMode.PRINT&&this.setPrintData(),this.mode===r.EditorMode.READONLY&&this.setReadonlyData(),this.mode,r.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=dt(this.printModeData);["header","main","footer"].forEach(l=>{t[l]=this.control.filterAssistElement(t[l])});const n=t,i=this.removeStrikeout(n);t.main=i.main.filter(l=>!l.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)}setReadonlyData(){this.readonlyModeData||(this.readonlyModeData=dt({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const t=dt(this.readonlyModeData);["header","main","footer"].forEach(n=>{const i=Ct(t[n],{editorOptions:this.options});t[n]=sn(i),yt(t[n],{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData(t)}clearReadonlyData(){if(this.readonlyModeData){const t=dt(this.readonlyModeData);this.readonlyModeData=null,this.setEditorData(t)}}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}setMode(t){if(this.mode===t)return;const e=this.mode;this.macroParticle.clearInlineEditor({isSubmitHistory:!1}),this.mode=t,this.options.mode=t,e===r.EditorMode.READONLY&&t!==r.EditorMode.READONLY&&this.clearReadonlyData();const n=new Map,i=s=>{s.forEach(a=>{a.controlId&&(a.controlComponent==="value"&&n.set(a.controlId,!0),a.checked&&n.set(a.controlId,!0))})};i(this.elementList),this.elementList.forEach(s=>{s.type==="table"&&s.trList?.forEach(a=>{a.tdList?.forEach(c=>{i(c.value)})})});const l=s=>{s.forEach(a=>{if(!(!a.control&&!a.controlId)&&(a.controlComponent==="value"&&a.strikeout&&(t===r.EditorMode.PRINT?a.hide=!0:a.hide=!1),!!a.control&&!(a.type!=="control"&&a.control.type!=="button"))){if(a.control.type==="TextField"&&(a.controlComponent==="placeholder"||a.controlComponent==="preTextFix"||a.controlComponent==="preTextFixText"||a.controlComponent==="postTextFix"||a.controlComponent==="postTextFixText"||a.controlComponent==="textFixLabel")&&(t===r.EditorMode.EDIT?a.hide=!1:a.hide=!0),a.control.type==="text"&&(a.controlComponent==="placeholder"||a.controlComponent==="prefix"||a.controlComponent==="postfix")&&(t===r.EditorMode.EDIT||t===r.EditorMode.FORM?a.hide=!1:a.hide=!0),a.control.type==="number"||a.control.type==="select"||a.control.type==="date"||a.control.type==="checkbox"||a.control.type==="radio"){if(a.controlComponent==="placeholder"||a.controlComponent==="prefix"||a.controlComponent==="postfix"){const d=n.get(a.controlId);a.control.type==="select"&&t===r.EditorMode.PRINT||t===r.EditorMode.PRINT&&!d?a.hide=!0:a.hide=!1}a.control.type==="number"&&a.controlComponent==="value"&&(t===r.EditorMode.PRINT&&a.strikeout?a.hide=!0:t!==r.EditorMode.PRINT&&a.strikeout&&(a.hide=!1))}a.control.type==="button"&&(a.hide=!1,a.control.hide=!1),a.control.type==="menstrualHistory"&&(a.controlComponent==="prefix"||a.controlComponent==="postfix")&&(t===r.EditorMode.PRINT?a.hide=!0:a.hide=!1)}})};l(this.elementList),this.elementList.forEach(s=>{s.type==="table"&&s.trList.forEach(a=>{a.tdList.forEach(c=>{l(c.value)})})}),t===r.EditorMode.FORM?(this.elementList.filter(s=>s.type==="control").map(s=>{s.control?.type==="button"&&s.control.buttonText&&(s.color="#1677FF",s.highlight="transparent")}),this.hideTextFieldWhitespace(this.elementList,!0),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):t===r.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===r.EditorMode.PRINT?(this.elementList.filter(s=>s?.control?.type==="button").map(s=>{(s?.controlComponent==="prefix"||s?.controlComponent==="postfix")&&(s.color="transparent",s.highlight="transparent"),s?.controlComponent==="value"&&!s.control.buttonText&&(s.color="transparent",s.highlight="transparent")}),this.setPrintData()):(this.clearPrintData(),this.elementList.filter(s=>s?.control?.type==="button").map(s=>{(s?.controlComponent==="prefix"||s?.controlComponent==="postfix")&&!s.control.buttonText&&s.type==="control"&&(s.color="transparent",s.highlight="#1677FF"),s?.controlComponent==="value"&&!s.control.buttonText&&(s.color="#fff",s.highlight="#1677FF"),s?.type==="text"&&s.control.buttonText&&(s.color="#000"),s?.type==="control"&&s?.controlComponent==="value"&&s.control.buttonText&&(s.color="#000",s.highlight="transparent")})),t===r.EditorMode.READONLY?this.setReadonlyData():this.clearReadonlyData(),this.mode===r.EditorMode.PRINT&&this.clearPrintData(),this.clearSideEffect(),this.control.destroyControl(),this.range.clearRange(),this.render({isSetCursor:!1,isSubmitHistory:!1})}hideTextFieldWhitespace(t,e){const n=a=>a?/^[\s\u00A0\u2000-\u200B\u3000\n\r\t]+$/.test(a):!1,i=(a,c)=>{for(let d=0;d<a.length;d++){const u=a[d];if(u.type===r.ElementType.TABLE&&u.trList)for(const R of u.trList)for(const h of R.tdList)i(h.value,c);u.originControlId&&u.controlId&&u.originControlId!==u.controlId&&c.add(u.originControlId)}},l=new Set;e&&i(t,l),(a=>{for(let c=0;c<a.length;c++){const d=a[c];if(d.type===r.ElementType.TABLE&&d.trList)for(const u of d.trList)for(const R of u.tdList)this.hideTextFieldWhitespace(R.value,e);d.control?.type===r.ControlType.TEXTFIELD&&d.controlComponent===r.ControlComponent.VALUE&&n(d.value)&&(d.controlId&&l.has(d.controlId)?d.hide=!1:d.hide=e)}})(t)}getSubTemplateRuntimeEndIndex(t,e,n){let i=e+1;for(;i<t.length&&t[i].subTemplateParentId===n;)i++;return i}syncSubTemplateExpandedState(t,e,n,i,l){let s=!1;const a=this.getSubTemplateRuntimeEndIndex(t,e,n.id);if(i&&!n.subTemplateContent?.length&&(i=!1),n.subTemplateExpanded!==i&&(n.subTemplateExpanded=i,s=!0),!!n.hide!==l&&(n.hide=l,s=!0),!i)return a>e+1&&(t.splice(e+1,a-e-1),s=!0),s;if(a===e+1){const c=dt(n.subTemplateContent||[]);yt(c,{isHandleFirstElement:!1,editorOptions:this.options});for(let d=0;d<c.length;d++)c[d].subTemplateParentId=n.id;c.length&&(t.splice(e+1,0,...c),s=!0)}return s}applySubTemplateRuntimeState(t,e){const n=i=>{let l=!1,s=0;for(;s<i.length;){const a=i[s];if(a.type===r.ElementType.SUB_TEMPLATE){const c=!!a.subTemplateConditions?.length;if(this.mode===r.EditorMode.EDIT&&c)l=this.syncSubTemplateExpandedState(i,s,a,!0,!0)||l;else if((this.mode===r.EditorMode.FORM||this.mode===r.EditorMode.PRINT)&&c){const d=e?kh(a.subTemplateConditions,e,a.subTemplateRelation):!1;l=this.syncSubTemplateExpandedState(i,s,a,d,!0)||l}else this.mode!==r.EditorMode.FORM&&this.mode!==r.EditorMode.PRINT&&(l=this.syncSubTemplateExpandedState(i,s,a,!1,!1)||l)}if(a.valueList?.length&&(l=n(a.valueList)||l),a.control?.value?.length&&(l=n(a.control.value)||l),a.type===r.ElementType.TABLE&&a.trList?.length)for(let c=0;c<a.trList.length;c++){const d=a.trList[c];for(let u=0;u<d.tdList.length;u++)l=n(d.tdList[u].value)||l}s++}return l};return n(t)}updateTextFieldPlaceholderVisibility(t,e,n){const i=[r.ControlType.TEXT,r.ControlType.TEXTFIELD,r.ControlType.SELECT,r.ControlType.DATE,r.ControlType.CHECKBOX,r.ControlType.RADIO,r.ControlType.NUMBER];(s=>{let a=0;for(;a<s.length;){const c=s[a];if(c.type===r.ElementType.TABLE&&c.trList)for(const d of c.trList)for(const u of d.tdList)this.updateTextFieldPlaceholderVisibility(u.value,e,n);if(c.control?.type&&i.includes(c.control.type)&&(c.controlComponent===r.ControlComponent.PREFIX||c.controlComponent===r.ControlComponent.PRETEXTFIX||c.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===r.ControlComponent.PRE_TEXT)){const d=c.controlId,u=c.control.type;let R=!1,h=!1,g=!1;const T=[],f=[],m=[];let p=-1,C=a;for(;C<s.length;){const I=s[C];if(I.controlId!==d){const P=I.controlId;let M=u===r.ControlType.TEXT,N=C;if(M)for(;N<s.length&&s[N].controlId===P;)N++;else for(;N<s.length;){const F=s[N];if(F.controlId!==P)break;F.controlComponent===r.ControlComponent.VALUE&&(F.value&&F.value.trim()||F.type===r.ElementType.MENSTRUAL_HISTORY||F.type===r.ElementType.FETAL_HEART_POSITION||F.type===r.ElementType.TOOTH_POSITION||F.type===r.ElementType.MACRO||F.type===r.ElementType.CUSTOM_MACRO)&&(M=!0),N++}M&&(h=!0),C=N;continue}if((I.controlComponent===r.ControlComponent.PREFIX||I.controlComponent===r.ControlComponent.PRETEXTFIX||I.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)&&f.push(C),I.controlComponent===r.ControlComponent.VALUE&&I.value&&I.value.trim()&&(R=!0),I.controlComponent===r.ControlComponent.VALUE&&(I.type===r.ElementType.MENSTRUAL_HISTORY||I.type===r.ElementType.FETAL_HEART_POSITION||I.type===r.ElementType.TOOTH_POSITION||I.type===r.ElementType.MACRO||I.type===r.ElementType.CUSTOM_MACRO)&&(R=!0),I.controlComponent===r.ControlComponent.VALUE&&I.control&&I.control.type!==u&&(h=!0),I.controlComponent===r.ControlComponent.PLACEHOLDER&&(g=!0,T.push(C)),I.controlComponent===r.ControlComponent.POSTFIX||I.controlComponent===r.ControlComponent.POSTTEXTFIX||I.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT){m.push(C),p=C;break}C++}if(R||h){if(g&&T.length>0)for(const I of T)s[I].hide=!0}else if(g&&T.length>0)for(const I of T)s[I].hide=!e;else e&&c.control?.placeholder&&(p>0?this.control.addPlaceholder(p-1):this.control.addPlaceholder(a));if(n)if(e&&(R||h)){for(const I of f)s[I].hide=!0;for(const I of m)s[I].hide=!0}else if(e){for(const I of f)s[I].hide=!1;for(const I of m)s[I].hide=!1}else{for(const I of f)s[I].hide=!0;for(const I of m)s[I].hide=!0}else{for(const I of f)s[I].hide=!1;for(const I of m)s[I].hide=!1}a=C}a++}})(t)}isReadonly(){if(this.area.getActiveAreaInfo()?.area?.mode)return this.area.isReadonly();switch(this.mode){case r.EditorMode.DESIGN:return!1;case r.EditorMode.READONLY:case r.EditorMode.PRINT:case r.EditorMode.GRAFFITI:return!0;case r.EditorMode.FORM:if(this.control.getIsRangeWithinControl()){const t=this.getElementList(),{startIndex:e}=this.range.getRange(),n=t[e];if(n?.control?.type===r.ControlType.TEXTFIELD){const i=n.controlId;if(i){for(let l=0;l<t.length;l++)if(t[l].originControlId===i&&t[l].controlId!==i)return!1}return!0}}return!this.control.getIsRangeWithinControl();default:return!1}}isDisabled(){if(this.mode===r.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 l=n[t],s=n[t+1];return!!(l?.title?.disabled&&s?.title?.disabled&&l.titleId===s.titleId||l?.control?.disabled&&s?.control?.disabled&&l.controlId===s.controlId)}return n.slice(t+1,e+1).some(l=>l.title?.disabled||l.control?.disabled)}isDesignMode(){return this.mode===r.EditorMode.DESIGN}isPrintMode(){return this.mode===r.EditorMode.PRINT}isGraffitiMode(){return this.mode===r.EditorMode.GRAFFITI}getOriginalWidth(){const{paperDirection:t,width:e,height:n}=this.options;return t===r.PaperDirection.VERTICAL?e:n}getOriginalHeight(){const{paperDirection:t,width:e,height:n}=this.options;return t===r.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===r.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(l=>l*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:!!Gi(e,n=>!!n&&n.nodeType===1&&!!n.getAttribute(he)):!1}isTargetInsideExternalOverlay(t){const e=this.getEventTarget(t);return!e||this.isTargetInsideEditor(e)?!1:!!e.closest(Sg)}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:l}=e;return t[n].trList[i].tdList[l].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:l}=e;return t[n]?.trList?.[i].tdList[l].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:l}=t;return l?this.getOriginalElementList()[e].trList[n].tdList[i]:null}getTdByPosition(t){const{index:e,trIndex:n,tdIndex:i,isTable:l}=t;return l?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 l=this.getElementList(),{isSubmitHistory:s=!0}=e;yt(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,u=n+1;d||this.newSpliceElementList(l,u,i-n),this.newSpliceElementList(l,u,0,t),a=n+t.length}else{const d=n===i,u=n+1;d||this.newSpliceElementList(l,u,i-n),this.newSpliceElementList(l,u,0,t),a=n+t.length;const R=l[u-1];t[0].listId&&R&&!R.listId&&R?.value===k&&(!R.type||R.type===r.ElementType.TEXTFIELD)&&(l.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:l=!0}=e;yt(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,u=n+1,R=c[n];if(R?.controlComponent===r.ControlComponent.PRE_TEXT||R?.controlComponent===r.ControlComponent.POST_TEXT||R?.controlComponent===r.ControlComponent.PREFIX||R?.controlComponent===r.ControlComponent.POSTFIX)for(let T=0;T<t.length;T++)t[T].control||(t[T].color=this.options.defaultColor);d&&(c[n]?.control?.type===r.ControlType.TEXTFIELD||c[n]?.control?.type===r.ControlType.TEXT)&&this.control.removePlaceholder(n),d||this.newSpliceElementList(c,u,i-n);const g=c[n]?.controlId||c[n-1]?.controlId||c[n+1]?.controlId;for(let T=0;T<t.length;T++){if(t[T]?.control?.type=="button"&&!t[T]?.control?.buttonText&&(t[T]?.controlComponent==="prefix"||t[T]?.controlComponent==="postfix"?(t[T].color="transparent",t[T].highlight="#1677FF"):(t[T].color="#fff",t[T].highlight="#1677FF")),t[T]?.type===r.ElementType.MENSTRUAL_HISTORY||t[T]?.type===r.ElementType.FETAL_HEART_POSITION||t[T]?.type===r.ElementType.TOOTH_POSITION||t[T]?.type===r.ElementType.MACRO||t[T]?.type===r.ElementType.CUSTOM_MACRO||t[T]?.type===r.ElementType.REUSABLE_ITEM||t[T]?.type===r.ElementType.SUB_TEMPLATE||t[T]?.type===r.ElementType.SPECIAL_SYMBOLS){t[T].controlComponent=r.ControlComponent.VALUE;let f=c[n]?.controlId;f||(f=c[n-1]?.controlId),f||(f=c[n+1]?.controlId),!t[T].controlId&&f&&(t[T].controlId=f)}g&&t[T]?.control&&t[T].controlId&&t[T].controlId!==g&&(t[T].originControlId=g)}this.newSpliceElementList(c,u,0,t),s=n+t.length}else{const c=this.getElementList(),d=n===i,u=n+1;if(c[u]?.control?.type=="TextField"||c[n]?.control?.type=="TextField"){d||this.newSpliceElementList(c,u,i-n);for(let R=0;R<t.length;R++)if(t[R]?.type===r.ElementType.MENSTRUAL_HISTORY||t[R]?.type===r.ElementType.FETAL_HEART_POSITION||t[R]?.type===r.ElementType.TOOTH_POSITION||t[R]?.type===r.ElementType.MACRO||t[R]?.type===r.ElementType.CUSTOM_MACRO||t[R]?.type===r.ElementType.REUSABLE_ITEM||t[R]?.type===r.ElementType.SUB_TEMPLATE||t[R]?.type===r.ElementType.SPECIAL_SYMBOLS){t[R].controlComponent=r.ControlComponent.VALUE;const h=c[n]?.controlId||c[u]?.controlId;!t[R].controlId&&h&&(t[R].controlId=h)}this.newSpliceElementList(c,u,0,t),s=n+t.length}else{d||this.spliceElementList(c,u,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,u,0,t),s=n+t.length;const R=c[u-1];t[0].listId&&R&&!R.listId&&R?.value===k&&(!R.type||R.type===r.ElementType.TEXT)&&(c.splice(n,1),s-=1)}}~s&&(this.range.setRange(s,s),this.render({curIndex:s,isSubmitHistory:l}))}appendElementList(t,e={}){if(!t.length)return;yt(t,{isHandleFirstElement:!1,editorOptions:this.options});let n;const{isPrepend:i,isSubmitHistory:l=!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:l})}spliceElementList(t,e,n,i,l){const{isIgnoreDeletedRule:s=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const d=e+n,R=t[d]?.listId;if(R&&t[e-1]?.listId!==R){let h=d;for(;h<t.length;){const g=t[h];if(g.listId!==R||g.value===k)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 T=t[g];(_t(T)||h!==!1&&T?.control?.deletable!==!1&&(!T.controlId||this.mode!==r.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(g,1),g--}}else t.splice(e,n)}if(i?.length){let d=t[e];for(let u=0;u<i.length;u++)!i[u].controlComponent&&d?.controlComponent&&(i[u].controlId=d.controlId,i[u].control=d.control,i[u].controlComponent=d.controlComponent),d=i[u];Jr(t,e,i)}}newSpliceElementList(t,e,n,i,l){const{isIgnoreDeletedRule:s=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const u=e+n,h=t[u]?.listId;if(h&&t[e-1]?.listId!==h){let g=u;for(;g<t.length;){const T=t[g];if(T.listId!==h||T.value===k)break;delete T.listId,delete T.listType,delete T.listStyle,g++}}if(!s&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const g=this.getTd()?.deletable;let T=u-1;for(;T>=e;){const f=t[T];(_t(f)||g!==!1&&f?.control?.deletable!==!1&&(!f.controlId||this.mode!==r.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(T,1),T--}}else t.splice(e,n)}const d=t[e]?.controlId;if(i?.length){for(let u=0;u<i.length;u++)d&&(i[u].originControlId=d);Jr(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,l=!!n&&i!==n;l&&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),l&&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===r.PageMode.PAGING}setPageMode(t){if(!t||this.options.pageMode===t)return;if(this.options.pageMode=t,t===r.PageMode.PAGING){const{height:i}=this.options,l=this.getPagePixelRatio(),s=this.pageList[0];s.style.height=`${i}px`,s.height=i*l,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(r.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 l=this.position.getCursorPosition();this.render({isSubmitHistory:!1,isSetCursor:!!l,curIndex:l?.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,l)=>{i.width=e*t,i.height=n*t,this._initPageContext(this.ctxList[l])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperSize(t,e){this.options.width=t,this.options.height=e;const n=this.getPagePixelRatio(),i=this.getWidth(),l=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((s,a)=>{s.width=i*n,s.height=l*n,s.style.width=`${i}px`,s.style.height=`${l}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((l,s)=>{l.width=n*e,l.height=i*e,l.style.width=`${n}px`,l.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,n=this.readonlyModeData;let i=n?.main||this.elementList;return Number.isInteger(e)&&e>=0&&e<this.pageRowList.length&&(i=this.pageRowList[e].flatMap(s=>s.elementList)),{header:n?.header||this.getHeaderElementList(),main:i,footer: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:Ct(e.header,{extraPickAttrs:n,editorOptions:this.options}),main:Ct(e.main,{extraPickAttrs:n,isClassifyArea:!0,editorOptions:this.options}),footer:Ct(e.footer,{extraPickAttrs:n,editorOptions:this.options}),graffiti:e.graffiti};return{version:_e,data:i,options:dt(this.options)}}setValue(t,e){const{header:n,main:i,footer:l}=dt(t);if(!n&&!i&&!l)return;const{isSetCursor:s=!1}=e||{};[n,i,l].forEach(d=>{d&&yt(d,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:n,main:i,footer:l}),this.mode===r.EditorMode.READONLY&&(this.readonlyModeData=null,this.setReadonlyData()),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(he,r.EditorComponent.MAIN)}_createPageContainer(){const t=document.createElement("div");return t.classList.add(`${q}-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 l=this.getPagePixelRatio();i.width=e*l,i.height=n*l,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,l=t.font||i,s=t.actualSize||t.size||n;return`${t.italic?"italic ":""}${t.bold?"bold ":""}${s*e}px ${l}`}getElementSize(t){return t.actualSize||t.size||this.options.defaultSize}getElementRowMargin(t){const{defaultSize:e,defaultBasicRowMarginHeight:n,defaultRowMargin:i,scale:l}=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)*l}computeRowList(t){const{innerWidth:e,elementList:n,isPagingMode:i=!1,isFromTable:l=!1,startX:s=0,startY:a=0,pageHeight:c=0,mainOuterHeight:d=0,surroundElementList:u=[]}=t,{defaultSize:R,scale:h,imgCaption:g,table:{tdPadding:T,defaultTrMinHeight:f},defaultTabWidth:m}=this.options,p=this.getDefaultBasicRowMarginHeight(),I=document.createElement("canvas").getContext("2d"),P=this.listParticle.computeListStyle(I,n),M=[],N=this._collectTextControlValueSet(n),F=this._collectTextControlHasContentSet(n);n.length&&M.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:n?.[0]?.rowFlex||n?.[1]?.rowFlex});let S=s,W=a,Y=0,b,D=0,X=0;for(let O=0;O<n.length;O++){const E=M[M.length-1],L=n[O];this.clearElementEffect(L);const V=this.getElementRowMargin(L),y={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},U=E.offsetX||L.listId&&P.get(L.listId)||0,Q=e-U,K=E.elementList.length===1;if(S+=K?U:0,W+=K&&E.offsetY||0,(L.control?.type===r.ControlType.TEXTFIELD||L.control?.type===r.ControlType.TEXT)&&!this.isDesignMode()&&(L.controlComponent===r.ControlComponent.PRETEXTFIX||L.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||L.controlComponent===r.ControlComponent.POSTTEXTFIX||L.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT||L.controlComponent===r.ControlComponent.TEXTFIXLABEL||L.controlComponent===r.ControlComponent.PLACEHOLDER||L.controlComponent===r.ControlComponent.PREFIX||L.controlComponent===r.ControlComponent.POSTFIX)){const w=L.control?.type===r.ControlType.TEXTFIELD,v=L.controlId,Z=!!v&&!!N?.has(v);if(w){const _=!!v&&!!F?.has(v);this.mode===r.EditorMode.EDIT?L.controlComponent===r.ControlComponent.PLACEHOLDER||L.controlComponent===r.ControlComponent.TEXTFIXLABEL?L.hide=_:L.hide=!1:L.hide=!0}else{const _=!!v&&!!F?.has(v);this.mode===r.EditorMode.EDIT||this.mode===r.EditorMode.FORM?L.controlComponent===r.ControlComponent.PLACEHOLDER||L.controlComponent===r.ControlComponent.TEXTFIXLABEL?L.hide=_:L.hide=!1:L.hide=!0}}if(_t(L)&&!this.isDesignMode()){const w=E.elementList[E.elementList.length-1];y.height=w?.metrics.height||this.options.defaultSize*h,y.boundingBoxAscent=w?.metrics.boundingBoxAscent||0,y.boundingBoxDescent=w?.metrics.boundingBoxDescent||0}else if(L.type===r.ElementType.IMAGE||L.type===r.ElementType.LATEX)if(L.imgDisplay===r.ImageDisplay.SURROUND||L.imgDisplay===r.ImageDisplay.FLOAT_TOP||L.imgDisplay===r.ImageDisplay.FLOAT_BOTTOM)y.width=0,y.height=0,y.boundingBoxDescent=0;else{const w=L.width*h,v=L.height*h;if(w>Q){const Z=v*Q/w;L.width=Q/h,L.height=Z/h,y.width=Q,y.height=Z,y.boundingBoxDescent=Z}else y.width=w,y.height=v,y.boundingBoxDescent=v;if(L.imgCaption?.value){const Z=L.imgCaption.size||g.size,_=L.imgCaption.top??g.top,x=(Z+_)*h;y.boundingBoxAscent+=x}}else if(L.type===r.ElementType.TABLE){const w=L.tdPadding||T;if(L.pagingId){let G=O+1,B=0;for(;G<n.length;){const st=n[G];if(st.pagingId===L.pagingId){const J=st.trList.filter(Rt=>!Rt.pagingRepeat).filter(Rt=>(Rt.tdList=Rt.tdList.filter(ht=>{if(ht.originalId){for(let et=0;et<L.trList.length;et++){const tt=L.trList[et],nt=tt.tdList.find(({id:j})=>j===ht.originalId);if(nt){ht.value[0]?.type===r.ElementType.SPLIT_TAG&&ht.value.splice(0,1),nt.value.push(...ht.value.map(j=>this.updateElementTableInfo(j,L,tt,nt))),nt.rowspan=nt.originalRowspan??nt.rowspan;break}}return!1}return!0}),!Rt.originalId));L.trList.push(...J),L.height+=st.height,G++,B++}else break}B&&n.splice(O+1,B)}L.pagingIndex=L.pagingIndex??0,this.tableParticle.computeTrHeight(L,G=>this.computeRowList({innerWidth:(G.width-(w[1]+w[3]))*h,elementList:G.value,isFromTable:!0,isPagingMode:i})),L.trList?.forEach(G=>{G.tdList.forEach(B=>{this.tdMap.set(B.id,B)})});const v=this.tableParticle.getTableHeight(L),Z=this.tableParticle.getTableWidth(L);L.width=Z,L.height=v;const _=Z*h,x=v*h;if(y.width=_,y.height=x,y.boundingBoxDescent=x,y.boundingBoxAscent=-V,n[O+1]?.type===r.ElementType.TABLE&&(y.boundingBoxAscent-=V),i){const G=this.getHeight(),B=this.getMainOuterHeight();let st=B;for(let et=0;et<M.length;et++){const tt=M[et],nt=tt.offsetY||0;tt.height+st+nt>G||M[et-1]?.isPageBreak?st=B+tt.height+nt:st+=tt.height+nt}const J=V*2,Rt=L.trList[0].height*h;(st+Rt+J>G||L.pagingIndex!==0&&L.trList[0].pagingRepeat||n[O-1]?.type===r.ElementType.PAGE_BREAK)&&(st=B);let ht=G-(st+J);if(x>ht){const et=L.trList;let tt=0,nt=0,j=0;for(let H=0;H<et.length;H++){const Ot=et[H],Et=Ot.height*h;if(st+J+j+Et>G){const Qt=Ot;let kt=0;const Ht={...dt(Qt),id:gt(),originalId:Qt.originalId??Qt.id,minHeight:void 0,tdList:L.colgroup.map((It,ae)=>{if(kt--,kt>0)return;const At=Qt.tdList.find(we=>we.colIndex===ae),jt=At??this.tableParticle.findPreRowSpanTd(et,H,ae);At&&(kt=At.colspan);const tn=gt();return jt.originalRowspan=jt.rowspan,At?{...At,id:tn,originalId:At.originalId??At.id,linkTdPrevId:At.id,tdIndex:ae,original:jt}:{id:tn,originalId:jt.originalId??jt.id,linkTdPrevId:jt.id,tdIndex:ae,colIndex:ae,colspan:1,rowspan:1,value:[],rowList:[],original:jt}}).filter(It=>!!It)},vt=Ht.tdList,Gt=vt.map(It=>It.original);Gt.forEach((It,ae)=>{const At=[];let jt=ht;if(It.rowspan>1){const we=et.slice(It.trIndex,It.trIndex+H-It.trIndex);jt+=we.reduce((_T,AT)=>AT.height*h+_T,0)}for(;It.mainHeight*h>jt&&It.rowList?.length;){const we=It.rowList.pop();It.value.splice(It.value.length-we.elementList.length),At.unshift(we),It.mainHeight-=we.height}const tn=vt[ae];tn.rowList=At,tn.value=At.map(we=>we.elementList).flat()});let Ee=!0;const vi=Qt.tdList.some(It=>It.rowList?.length),tl=Ht.tdList.some(It=>It.rowList?.length),Ki=Qt.minHeight>ht;if(tl||Ki){(vi||!tl&&Ki)&&(Ki&&(Qt.originalMinHeight=Qt.minHeight,Qt.minHeight=ht,Ht.minHeight=Math.max(Qt.originalMinHeight-ht,f)),Ht.tdList.forEach(It=>{It.original.linkTdNextId=It.id,It.value.length&&It.value[0].value!==k&&It.value.unshift({...It.original.value.slice(-1).pop(),value:k,type:r.ElementType.SPLIT_TAG})}),et.splice(tt+1,0,Ht),tt+=1,nt=et.length-tt,Ee=!1),Gt.forEach(It=>{if(It.rowspan>1){const ae=It.rowspan-(H-It.trIndex);It.rowspan=H-It.trIndex+(vi?1:0);const At=Ht.tdList.find(jt=>jt.colIndex===It.colIndex);vi?At.rowspan=ae:(At.original.linkTdNextId=At.id,Qt.tdList.push({...It,...At,rowspan:ae}),Qt.tdList.sort((jt,tn)=>jt.colIndex-tn.colIndex),At.value=[])}}),Ee&&Gt.forEach((It,ae)=>{It.value.push(...vt[ae].value)});break}}tt=H+1,nt=et.length-tt,j+=Et,ht-=Et}if(nt){const H=et.splice(tt,nt),Ot=L.pagingId||gt();L.pagingId=Ot;const Et=dt(L);Et.originalId=L.originalId??L.id,Et.pagingId=Ot,Et.pagingIndex=L.pagingIndex+1;const Qt=et.filter(vt=>vt.pagingRepeat);if(Qt.length){const vt=dt(Qt);vt.forEach(Gt=>Gt.id=gt()),H.unshift(...vt)}Et.trList=H,Et.id=gt(),Et.trList?.forEach(vt=>{vt.tdList.forEach(Gt=>{if(delete Gt.valueStartIndex,Gt.linkTdPrevId){const Ee=this.getTdById(Gt.linkTdPrevId);Gt.valueStartIndex=Ee?(Ee.valueStartIndex??0)+Ee.value.length:0,this.splitTdValueMap.has(Gt.originalId)?this.splitTdValueMap.get(Gt.originalId).push(...Gt.value):Ee&&this.splitTdValueMap.set(Gt.originalId,[...Ee.value,...Gt.value])}Gt.value.forEach(Ee=>this.updateElementTableInfo(Ee,Et,vt,Gt))})}),this.spliceElementList(n,O+1,0,[Et]),this.tableParticle.computeTrHeight(L);const kt=this.tableParticle.getTableHeight(L),Ht=kt*h;L.height=kt,y.height=Ht,y.boundingBoxDescent=Ht}}if(L.pagingId){const et=this.position.getPositionContext();if(et.isTable){let tt=-1,nt=-1,j=O;for(;j<n.length;){const H=n[j];if(H.pagingId!==L.pagingId)break;const Ot=H.trList.findIndex(Et=>Et.id===et.trId);if(~Ot){tt=j,nt=Ot;break}j++}~tt&&(et.index=tt,et.trIndex=nt,this.position.setPositionContext(et))}}}this.initTableElementIndex(L,O)}else if(L.type===r.ElementType.SEPARATOR){const{separator:{lineWidth:w}}=this.options,v=L.lineWidth||w;L.width=Q/h,y.width=Q,y.height=v*h,y.boundingBoxAscent=-V,y.boundingBoxDescent=-V+y.height}else if(L.type===r.ElementType.PAGE_BREAK)L.width=Q/h,y.width=Q,y.height=R;else if(L.type===r.ElementType.RADIO||L.controlComponent===r.ControlComponent.RADIO){const{width:w,height:v,gap:Z}=this.options.radio,_=w+Z*2;L.width=_,y.width=_*h,y.height=v*h}else if(L.type===r.ElementType.CHECKBOX||L.controlComponent===r.ControlComponent.CHECKBOX){const{width:w,height:v,gap:Z}=this.options.checkbox,_=w+Z*2;L.width=_,y.width=_*h,y.height=v*h}else if(L.type===r.ElementType.MENSTRUAL_HISTORY){const w=this.menstrualHistoryParticle.computeSize(L);L.width=w.width/h,y.width=w.width,y.height=w.height,y.boundingBoxAscent=w.height,y.boundingBoxDescent=0}else if(L.type===r.ElementType.FETAL_HEART_POSITION){const w=this.fetalHeartPositionParticle.computeSize();L.width=w.width/h,y.width=w.width,y.height=w.height,y.boundingBoxAscent=w.height/2,y.boundingBoxDescent=w.height/2}else if(L.type===r.ElementType.TOOTH_POSITION){const w=this.toothPositionParticle.computeSize(L);L.width=w.width/h,y.width=w.width,y.height=w.height,y.boundingBoxAscent=w.height/2,y.boundingBoxDescent=w.height/2}else if(L.type===r.ElementType.TAB)y.width=m*h,y.height=R*h,y.boundingBoxDescent=0,y.boundingBoxAscent=this.textParticle.getBasisWordBoundingBoxAscent(I,I.font);else if(L.type===r.ElementType.BLOCK){if(!L.width)y.width=Q;else{const w=L.width*h;y.width=Math.min(w,Q)}y.height=L.height*h,y.boundingBoxDescent=y.height,y.boundingBoxAscent=0}else if(L.type===r.ElementType.LABEL){const{defaultSize:w,label:{defaultPadding:v}}=this.options;I.font=this.getElementFont(L);const Z=this.textParticle.measureText(I,L);y.width=(Z.width+v[1]+v[3])*h,y.height=(L.size||w)*h,y.boundingBoxDescent=0,y.boundingBoxAscent=(v[0]+Z.actualBoundingBoxAscent)*h}else if(L.type===r.ElementType.MACRO||L.type===r.ElementType.CUSTOM_MACRO||L.type===r.ElementType.REUSABLE_ITEM||L.type===r.ElementType.SUB_TEMPLATE){const{defaultSize:w}=this.options;I.font=this.getElementFont(L);const v=this.getMode(),Z=v===r.EditorMode.EDIT,_=v===r.EditorMode.FORM;if(v===r.EditorMode.READONLY&&L.type!==r.ElementType.SUB_TEMPLATE){const x=xo(L),G=I.measureText(x);y.width=G.width,y.height=(L.size||w)*h,y.boundingBoxDescent=G.actualBoundingBoxDescent,y.boundingBoxAscent=G.actualBoundingBoxAscent}else if(Z){const x=L.label||L.value||"";I.font=this.getElementFont(L);const G=I.measureText(x),B=8*h,st=4*h;y.width=G.width+B*2;const J=G.actualBoundingBoxAscent+G.actualBoundingBoxDescent;y.height=J+st*2;const Rt=this.textParticle.measureBasisWord(I,this.getElementFont(L));y.boundingBoxAscent=Rt.actualBoundingBoxAscent*h,y.boundingBoxDescent=Rt.actualBoundingBoxDescent*h}else if(L.type===r.ElementType.CUSTOM_MACRO){const x=L.macroConfig,G=x?.value||"";if(_){const B=x?.type||"text",st=this.textParticle.measureText(I,L),J=L.label||"";if(B==="select"){const Rt=G||`请选择${J}`,ht=I.measureText(Rt),et=I.measureText("[").width,tt=6*h+2*h;y.width=et+ht.width+tt+et}else{const Rt=G||`请输入${J}`,ht=I.measureText(Rt),et=I.measureText("[").width;y.width=et+ht.width+et}y.height=(L.size||w)*h,y.boundingBoxDescent=st.actualBoundingBoxDescent*h,y.boundingBoxAscent=st.actualBoundingBoxAscent*h}else{const B=L.label||"",st=G||`请输入${B}`,J=I.measureText(st);y.width=J.width,y.height=(L.size||w)*h,y.boundingBoxDescent=J.actualBoundingBoxDescent,y.boundingBoxAscent=J.actualBoundingBoxAscent}}else if(L.type===r.ElementType.REUSABLE_ITEM){const G=L.reusableItemConfig?.value||"",B=L.label||"";if(_){const st=this.textParticle.measureText(I,L),J=G||`获取 ${B}`,Rt=I.measureText(J),ht=I.measureText("[").width;y.width=ht+Rt.width+ht,y.height=(L.size||w)*h,y.boundingBoxDescent=st.actualBoundingBoxDescent*h,y.boundingBoxAscent=st.actualBoundingBoxAscent*h}else{const st=G||`获取 ${B}`,J=I.measureText(st);y.width=J.width,y.height=(L.size||w)*h,y.boundingBoxDescent=J.actualBoundingBoxDescent,y.boundingBoxAscent=J.actualBoundingBoxAscent}}else if(L.type===r.ElementType.SUB_TEMPLATE){const x=L.label||"子模板";if(_){const G=I.measureText(x),B=8*h,st=4*h,J=G.actualBoundingBoxAscent+G.actualBoundingBoxDescent;y.width=G.width+B*2,y.height=J+st*2;const Rt=this.textParticle.measureBasisWord(I,this.getElementFont(L));y.boundingBoxAscent=Rt.actualBoundingBoxAscent*h,y.boundingBoxDescent=Rt.actualBoundingBoxDescent*h}else{const G=I.measureText(x);y.width=G.width,y.height=(L.size||w)*h,y.boundingBoxDescent=G.actualBoundingBoxDescent,y.boundingBoxAscent=G.actualBoundingBoxAscent}}else{const x=L.label||"",G=L.value||`获取 ${x}`,B=I.measureText(G);y.width=B.width,y.height=(L.size||w)*h,y.boundingBoxDescent=B.actualBoundingBoxDescent,y.boundingBoxAscent=B.actualBoundingBoxAscent}}else{const w=L.size||R;(L.type===r.ElementType.SUPERSCRIPT||L.type===r.ElementType.SUBSCRIPT)&&(L.actualSize=Math.ceil(w*.6)),y.height=(L.actualSize||w)*h,I.font=this.getElementFont(L);const v=this.textParticle.measureText(I,L);y.width=v.width*h,L.letterSpacing&&(y.width+=L.letterSpacing*h);const Z=this.textParticle.measureBasisWord(I,L.font);y.boundingBoxAscent=Z.actualBoundingBoxAscent*h,y.boundingBoxDescent=Z.actualBoundingBoxDescent*h,L.type===r.ElementType.SUPERSCRIPT?y.boundingBoxAscent+=y.height/2:L.type===r.ElementType.SUBSCRIPT&&(y.boundingBoxDescent+=y.height/2)}const z=!_t(L)&&(L.imgDisplay!==r.ImageDisplay.INLINE&&L.type===r.ElementType.IMAGE||L.type===r.ElementType.LATEX)?y.height+V:y.boundingBoxAscent+V,rt=V+y.boundingBoxAscent+y.boundingBoxDescent+V,at=Object.assign(L,{metrics:y,left:0,style:this.getElementFont(L,h)});at.control?.minWidth&&(at.controlComponent&&(X+=y.width),at.controlComponent===r.ControlComponent.POSTFIX&&(this.control.setMinWidthControlInfo({row:E,rowElement:at,availableWidth:Q,controlRealWidth:X}),X=0));const A=n[O-1];let it=n[O+1],ct=E.width+y.width;if(this.options.wordBreak===r.WordBreak.BREAK_WORD&&(!A?.type||A?.type===r.ElementType.TEXT)&&(!L.type||L.type===r.ElementType.TEXT)){const w=`${A?.value||""}${L.value}`;if(this.WORD_LIKE_REG.test(w)){const{width:Z,endElement:_}=this.textParticle.measureWord(I,n,O),x=Z*h;_&&x<=Q?(ct+=x,it=_):A&&(ct+=x)}const v=this.textParticle.measurePunctuationWidth(I,it);ct+=v*h}L.listId&&(L.listId!==b?D=0:L.value===k&&!L.listWrap&&D++),b=L.listId;const Nt=this.position.setSurroundPosition({pageNo:Y,rowElement:at,row:E,rowElementRect:{x:S,y:W,height:rt,width:y.width},availableWidth:Q,surroundElementList:u});S=Nt.x,ct+=Nt.rowIncreaseWidth,S+=y.width;let Ft=!1;if(this.mode===r.EditorMode.FORM&&L.control?.type===r.ControlType.BUTTON&&L.controlComponent===r.ControlComponent.PREFIX&&E.elementList.filter(w=>w.controlId!==L.controlId).length>0){const w=L.controlId;if(n.some(Z=>Z.controlId===`${w}_text`&&Z.control?.type===r.ControlType.BUTTON)){let Z=0;for(let _=O;_<n.length;_++){const x=n[_];if(x.controlId!==w)break;I.font=this.getElementFont(x);const G=this.textParticle.measureText(I,x);if(Z+=G.width*h,x.controlComponent===r.ControlComponent.POSTFIX)break}for(let _=0;_<n.length;_++){const x=n[_];if(x.controlId===`${w}_text`){I.font=this.getElementFont(x);const G=this.textParticle.measureText(I,x);Z+=G.width*h}}Ft=E.width+Z>Q}}const St=L.type===r.ElementType.SEPARATOR||L.type===r.ElementType.TABLE||A?.type===r.ElementType.TABLE||A?.type===r.ElementType.BLOCK||L.type===r.ElementType.BLOCK||A?.imgDisplay===r.ImageDisplay.INLINE||L.imgDisplay===r.ImageDisplay.INLINE||A?.listId!==L.listId||A?.areaId!==L.areaId&&!L.area?.hide||L.control?.flexDirection===r.FlexDirection.COLUMN&&(L.controlComponent===r.ControlComponent.CHECKBOX||L.controlComponent===r.ControlComponent.RADIO)&&A?.controlComponent===r.ControlComponent.VALUE||O!==0&&L.value===k&&!L.area?.hide||Ft,le=ct>Q,ne=St||le;if(ne){const w={width:y.width,height:rt,startIndex:O,elementList:[at],ascent:z,rowIndex:E.rowIndex+1,rowFlex:n[O]?.rowFlex||n[O+1]?.rowFlex,isPageBreak:L.type===r.ElementType.PAGE_BREAK};if(at.controlComponent!==r.ControlComponent.PREFIX&&at.control?.indentation===r.ControlIndentation.VALUE_START){const v=E.elementList.findIndex(Z=>Z.controlId===at.controlId&&Z.controlComponent!==r.ControlComponent.PREFIX);if(~v){const _=this.position.computeRowPosition({row:E,innerWidth:this.getInnerWidth()})[v];_&&(w.offsetX=_.coordinate.leftTop[0])}}L.listId&&(w.isList=!0,w.offsetX=P.get(L.listId),w.listIndex=D),w.offsetY=!l&&L.area?.top&&L.areaId!==n[O-1]?.areaId?L.area.top*h:0,M.push(w)}else E.width+=y.width,O===0&&(cn(n[1])||n[1]?.areaId)?(E.height=p,E.ascent=p):E.height<rt&&(E.height=rt,E.ascent=z),E.elementList.push(at);if((ne||O===n.length-1)&&(E.isWidthNotEnough=le&&!St,!E.isSurround&&(A?.rowFlex===r.RowFlex.JUSTIFY||A?.rowFlex===r.RowFlex.ALIGNMENT&&E.isWidthNotEnough))){const w=E.elementList[0]?.value===k?E.elementList.slice(1):E.elementList,v=(Q-E.width)/(w.length-1);for(let Z=0;Z<w.length-1;Z++){const _=w[Z];_.metrics.width+=v}E.width=Q}if(ne){S=s,W+=E.height,i&&!l&&c&&(W-a+d+rt>c||L.type===r.ElementType.PAGE_BREAK)&&(W=a,Oa(u,Y),Y+=1),at.left=0;const w=M[M.length-1];S=this.position.setSurroundPosition({pageNo:Y,rowElement:at,row:w,rowElementRect:{x:S,y:W,height:rt,width:y.width},availableWidth:Q,surroundElementList:u}).x,S+=y.width}}return M}_collectTextControlValueSet(t){if(this.isDesignMode()||this.mode===r.EditorMode.EDIT)return null;const e=new Set;for(let i=0;i<t.length;i++){const l=t[i];l.controlId&&(l.control?.type===r.ControlType.TEXT||l.control?.type===r.ControlType.TEXTFIELD)&&e.add(l.controlId)}const n=new Set;for(let i=0;i<t.length;i++){const l=t[i];l.controlId&&l.controlComponent===r.ControlComponent.VALUE&&e.has(l.controlId)&&n.add(l.controlId)}return n}_collectTextControlHasContentSet(t){if(this.isDesignMode())return null;const e=new Set;let n=0;for(;n<t.length;){const i=t[n];if(i.controlId&&(i.control?.type===r.ControlType.TEXT||i.control?.type===r.ControlType.TEXTFIELD)&&(i.controlComponent===r.ControlComponent.PREFIX||i.controlComponent===r.ControlComponent.PRE_TEXT||i.controlComponent===r.ControlComponent.PRETEXTFIX||i.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)){const l=i.controlId;let s=!1,a=n+1;for(;a<t.length;){const c=t[a];if(c.controlId===l&&(c.controlComponent===r.ControlComponent.POSTFIX||c.controlComponent===r.ControlComponent.POST_TEXT||c.controlComponent===r.ControlComponent.POSTTEXTFIX||c.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT))break;if(c.controlId===l&&c.controlComponent===r.ControlComponent.VALUE&&(s=!0),c.controlId!==l&&c.controlId){(i.control?.type===r.ControlType.TEXT||c.controlComponent===r.ControlComponent.VALUE)&&(s=!0);const d=c.controlId;for(a++;a<t.length&&t[a].controlId===d;)a++;continue}a++}s&&e.add(l)}n++}return e}_computePageList(){const t=[[]],{pageMode:e,pageNumber:{maxPageNo:n}}=this.options,i=this.getHeight(),l=this.getMainOuterHeight();let s=l,a=0;if(e===r.PageMode.CONTINUITY){t[0]=this.rowList,s+=this.rowList.reduce((R,h)=>R+h.height+(h.offsetY||0),0);const c=this.getPagePixelRatio(),d=this.pageList[0],u=Number(d.style.height.replace("px",""));if(s>u)d.style.height=`${s}px`,d.height=s*c;else{const R=s<i?i:s;d.style.height=`${R}px`,d.height=R*c}this._initPageContext(this.ctxList[0])}else for(let c=0;c<this.rowList.length;c++){const d=this.rowList[c],u=d.offsetY||0;if(d.height+u+s>i||this.rowList[c-1]?.isPageBreak){if(Number.isInteger(n)&&a>=n){this.elementList=this.elementList.slice(0,d.startIndex);break}s=l+d.height+u,t.push([d]),a++}else s+=d.height+u,t[a].push(d)}return t}_drawHighlight(t,e){const{rowList:n,positionList:i,elementList:l}=e,s=this.getDefaultBasicRowMarginHeight(),a=this.getHighlightMarginHeight();for(let c=0;c<n.length;c++){const d=n[c];for(let u=0;u<d.elementList.length;u++){const R=d.elementList[u],h=d.elementList[u-1],g=R.highlight||this.control.getControlHighlight(l,d.startIndex+u);if(g){h&&h.highlight&&h.highlight!==R.highlight&&this.highlight.render(t);const{coordinate:{leftTop:[T,f]}}=i[d.startIndex+u],m=R.left||0;this.highlight.recordFillInfo(t,T-m,f+s-a,R.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:l,lineBreak:s,whiteSpace:a}=this.options,{rowList:c,pageNo:d,elementList:u,positionList:R,startIndex:h,zone:g,isDrawLineBreak:T=!s.disabled,td:f,isDrawWhiteSpace:m=!a.disabled}=e,p=this.isPrintMode(),C=this.isGraffitiMode(),{isCrossRowCol:I,tableId:P}=this.range.getRange();let M=h;for(let N=0;N<c.length;N++){const F=c[N],S={x:0,y:0,width:0,height:0};let W=null;for(let Y=0;Y<F.elementList.length;Y++){const b=F.elementList[Y],D=b.metrics,{ascent:X,coordinate:{leftTop:[O,E]}}=R[F.startIndex+Y],L=F.elementList[Y-1];if(_t(b)&&!this.isDesignMode())this.textParticle.complete();else if(b.type===r.ElementType.IMAGE)this.textParticle.complete(),b.imgDisplay!==r.ImageDisplay.SURROUND&&b.imgDisplay!==r.ImageDisplay.FLOAT_TOP&&b.imgDisplay!==r.ImageDisplay.FLOAT_BOTTOM&&this.imageParticle.render(t,b,O,E+X);else if(b.type===r.ElementType.LATEX)this.textParticle.complete(),this.laTexParticle.render(t,b,O,E+X);else if(b.type===r.ElementType.TABLE)I&&(S.x=O,S.y=E,W=b),this.tableParticle.render(t,b,O,E);else if(b.type===r.ElementType.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(t,b,O,E+X);else if(b.type===r.ElementType.LABEL)this.textParticle.complete(),this.labelParticle.render(t,b,O,E+X);else if(b.type===r.ElementType.MACRO||b.type===r.ElementType.CUSTOM_MACRO||b.type===r.ElementType.REUSABLE_ITEM||b.type===r.ElementType.SUB_TEMPLATE)this.textParticle.complete(),this.macroParticle.render(t,b,O,E+X);else if(b.type===r.ElementType.DATE){const z=F.elementList[Y+1];(!L||L.dateId!==b.dateId)&&this.textParticle.complete(),this.textParticle.record(t,b,O,E+X),(!z||z.dateId!==b.dateId)&&this.textParticle.complete()}else b.type===r.ElementType.SUPERSCRIPT?(this.textParticle.complete(),this.superscriptParticle.render(t,b,O,E+X)):b.type===r.ElementType.SUBSCRIPT?(this.underline.render(t),this.textParticle.complete(),this.subscriptParticle.render(t,b,O,E+X)):b.type===r.ElementType.SEPARATOR?this.separatorParticle.render(t,b,O,E):b.type===r.ElementType.PAGE_BREAK?this.mode!==r.EditorMode.CLEAN&&!p&&this.pageBreakParticle.render(t,b,O,E):b.type===r.ElementType.CHECKBOX||b.controlComponent===r.ControlComponent.CHECKBOX?(this.textParticle.complete(),this.checkboxParticle.render({ctx:t,x:O,y:E+X,index:Y,row:F})):b.type===r.ElementType.RADIO||b.controlComponent===r.ControlComponent.RADIO?(this.textParticle.complete(),this.radioParticle.render({ctx:t,x:O,y:E+X,index:Y,row:F})):b.type===r.ElementType.MENSTRUAL_HISTORY?(this.textParticle.complete(),this.menstrualHistoryParticle.render({ctx:t,x:O,y:E+X,index:Y,row:F,element:b})):b.type===r.ElementType.FETAL_HEART_POSITION?(this.textParticle.complete(),this.fetalHeartPositionParticle.render({ctx:t,x:O,y:E+X,index:Y,row:F,element:b})):b.type===r.ElementType.TOOTH_POSITION?(this.textParticle.complete(),this.toothPositionParticle.render({ctx:t,x:O,y:E+X,index:Y,row:F,element:b})):b.type===r.ElementType.TAB?this.textParticle.complete():b.rowFlex===r.RowFlex.ALIGNMENT||b.rowFlex===r.RowFlex.JUSTIFY?(this.textParticle.record(t,b,O,E+X),this.textParticle.complete()):b.type===r.ElementType.BLOCK?(this.textParticle.complete(),this.blockParticle.render(t,d,b,O,E+X)):(b.left&&this.textParticle.complete(),this.textParticle.record(t,b,O,E+X),(b.width||b.letterSpacing||rl.test(b.value))&&this.textParticle.complete());if(T&&!p&&this.mode!==r.EditorMode.CLEAN&&!F.isWidthNotEnough&&Y===F.elementList.length-1&&this.lineBreakParticle.render(t,b,O,E+F.height/2),m&&al.test(b.value)&&this.whiteSpaceParticle.render(t,b,O,E+F.height/2),b.control?.border){L?.control?.border&&L.controlId!==b.controlId&&this.control.drawBorder(t);const z=this.getElementRowMargin(b);this.control.recordBorderInfo(O,E+z,b.metrics.width,F.height-2*z)}else L?.control?.border&&this.control.drawBorder(t);if(b.control?.type===r.ControlType.TEXT){const z=b.controlComponent===r.ControlComponent.VALUE,rt=b.controlComponent===r.ControlComponent.POSTFIX||b.controlComponent===r.ControlComponent.POST_TEXT,at=!!L&&L.originControlId===b.controlId&&(L.controlComponent===r.ControlComponent.POSTFIX||L.controlComponent===r.ControlComponent.POST_TEXT||L.controlComponent===r.ControlComponent.POSTTEXTFIX||L.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT);b.originControlId&&(b.controlComponent===r.ControlComponent.PREFIX||b.controlComponent===r.ControlComponent.PRE_TEXT||b.controlComponent===r.ControlComponent.PRETEXTFIX||b.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t),z&&b.control?.underline&&!b.underline&&((!L||L.controlId!==b.controlId||at||L.controlComponent!==r.ControlComponent.VALUE&&L.controlComponent!==r.ControlComponent.PLACEHOLDER)&&this.control.startTextFieldUnderline(b.controlId,O,E+F.height),this.control.recordTextFieldUnderlineWidth(b.metrics.width)),rt&&this.control.drawTextFieldUnderline(t),b.originControlId&&(b.controlComponent===r.ControlComponent.POSTFIX||b.controlComponent===r.ControlComponent.POST_TEXT||b.controlComponent===r.ControlComponent.POSTTEXTFIX||b.controlComponent===r.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t)}else L?.control?.type===r.ControlType.TEXT&&this.control.drawTextFieldUnderline(t);if((b.underline||b.control?.underline)&&b.controlComponent!==r.ControlComponent.PLACEHOLDER&&!(b.control?.type===r.ControlType.TEXT&&b.control?.underline&&!b.underline)){L?.type===r.ElementType.SUBSCRIPT&&b.type!==r.ElementType.SUBSCRIPT&&this.underline.render(t);const z=this.getElementRowMargin(b),rt=b.left||0;let at=0;b.type===r.ElementType.SUBSCRIPT&&(at=this.subscriptParticle.getOffsetY(b));const A=b.control?.underline?this.options.underlineColor:b.color;this.underline.recordFillInfo(t,O-rt,E+F.height-z+at,D.width+rt,0,A,b.textDecoration?.style)}else(L?.underline||L?.control?.underline)&&(L?.control?.type===r.ControlType.TEXT&&L?.control?.underline&&!L.underline||this.underline.render(t));if(b.strikeout){if(!b.type||te.includes(b.type)){L&&(L.type===r.ElementType.SUBSCRIPT&&b.type!==r.ElementType.SUBSCRIPT||L.type===r.ElementType.SUPERSCRIPT&&b.type!==r.ElementType.SUPERSCRIPT||this.getElementSize(L)!==this.getElementSize(b))&&this.strikeout.render(t);const z=this.textParticle.measureBasisWord(t,this.getElementFont(b));let rt=E+X+z.actualBoundingBoxDescent*n-D.height/2;b.type===r.ElementType.SUBSCRIPT?rt+=this.subscriptParticle.getOffsetY(b):b.type===r.ElementType.SUPERSCRIPT&&(rt+=this.superscriptParticle.getOffsetY(b)),this.strikeout.recordFillInfo(t,O,rt,D.width)}}else L?.strikeout&&this.strikeout.render(t);const{zone:V,splitTdRange:y}=this.range.getRange();let{startIndex:U,endIndex:Q}=this.range.getRange(),K=!1;if(f&&y&&[f.originalId,f.id].includes(y.originalId)&&(K=!0,U=y.startIndex-(f.valueStartIndex??0),Q=y.endIndex-(f.valueStartIndex??0)),V===g&&U!==Q&&U<=M&&M<=Q){const z=this.position.getPositionContext();if(!z.isTable&&!b.tdId||z.tdId===b.tdId||K)if(U===M){const rt=u[U+1];rt&&rt.value===k&&(S.x=O+D.width,S.y=E,S.height=F.height,S.width+=this.options.rangeMinWidth)}else{let rt=D.width;rt===0&&F.elementList.length===1&&(rt=this.options.rangeMinWidth),S.width||(S.x=O,S.y=E,S.height=F.height),S.width+=rt}}if(!l.disabled&&b.groupIds&&this.group.recordFillInfo(b,O,E,D.width,F.height),M++,b.type===r.ElementType.TABLE&&!_t(b)){const z=b.tdPadding||i,rt=z[1]+z[3];for(let at=0;at<b.trList.length;at++){const A=b.trList[at];for(let it=0;it<A.tdList.length;it++){const ct=A.tdList[it];this.drawRow(t,{elementList:ct.value,positionList:ct.positionList,rowList:ct.rowList,pageNo:d,startIndex:0,innerWidth:(ct.width-rt)*n,zone:g,isDrawLineBreak:T,td:ct})}}}}if(F.isList&&this.listParticle.drawListStyle(t,F,R[F.startIndex]),this.textParticle.complete(),this.control.drawBorder(t),this.underline.render(t),this.strikeout.render(t),this.group.render(t),!p&&!C){if(S.width&&S.height){const{x:Y,y:b,width:D,height:X}=S;this.range.render(t,Y,b,D,X)}if(I&&W&&W.id===P){const{coordinate:{leftTop:[Y,b]}}=R[F.startIndex];this.tableParticle.drawRange(t,W,Y,b)}}}}_drawFloat(t,e){const{scale:n}=this.options,i=this.position.getFloatPositionList(),{imgDisplays:l,pageNo:s}=e;for(let a=0;a<i.length;a++){const c=i[a],d=c.element;if((s===c.pageNo||c.zone===r.EditorZone.HEADER||c.zone==r.EditorZone.FOOTER)&&d.imgDisplay&&l.includes(d.imgDisplay)&&d.type===r.ElementType.IMAGE){const u=d.imgFloatPosition;this.imageParticle.render(t,d,u.x*n,u.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:l}=t,{inactiveAlpha:s,pageMode:a,header:c,footer:d,pageNumber:u,lineNumber:R,pageBorder:h}=this.options,g=this.mode===r.EditorMode.PRINT,T=this.getInnerWidth(),f=this.ctxList[l];f.globalAlpha=this.zone.isMainActive()?1:s,this._clearPage(l),(!g||!this.options.modeRule[r.EditorMode.PRINT]?.backgroundDisabled)&&this.background.render(f,l),g||this.area.render(f,l),a!==r.PageMode.CONTINUITY&&this.options.watermark.data&&this.waterMark.render(f,l),g||this.margin.render(f,l),this._drawFloat(f,{pageNo:l,imgDisplays:[r.ImageDisplay.FLOAT_BOTTOM]}),g||this.control.renderHighlightList(f,l);const m=i[0]?.startIndex;this.drawRow(f,{elementList:e,positionList:n,rowList:i,pageNo:l,startIndex:m,innerWidth:T,zone:r.EditorZone.MAIN}),this.getIsPagingMode()&&(c.disabled||this.header.render(f,l),u.disabled||this.pageNumber.render(f,l),d.disabled||this.footer.render(f,l)),this._drawFloat(f,{pageNo:l,imgDisplays:[r.ImageDisplay.FLOAT_TOP,r.ImageDisplay.SURROUND]}),!g&&this.search.getSearchKeyword()&&this.search.render(f,l),this.elementList.length<=1&&!this.elementList[0]?.listId&&this.placeholder.render(f),R.disabled||this.lineNumber.render(f,l),h.disabled||this.pageBorder.render(f),this.badge.render(f,l),this.isGraffitiMode()&&this.graffiti.render(f,l)}_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 l=Number(i.target.dataset.index);this._drawPage({elementList:e,positionList:t,rowList:this.pageRowList[l],pageNo:l})}})}),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=Yt(),n=[],i=(O,E)=>{n.push({label:O,duration:Yt()-E})};this.renderCount++;const l=this.mode===r.EditorMode.EDIT||this.mode===r.EditorMode.FORM||this.mode===r.EditorMode.PRINT?xh([...this.getHeaderElementList(),...this.elementList,...this.getFooterElementList()]):null,s=this.applySubTemplateRuntimeState(this.getHeaderElementList(),l)||this.applySubTemplateRuntimeState(this.elementList,l)||this.applySubTemplateRuntimeState(this.getFooterElementList(),l);let{endIndex:a}=this.range.getRange();const{isCrossRowCol:c}=this.range.getRange();if(!c&&~a){const O=this.getElementList(),E=O[a],V=E?.type===r.ElementType.SUB_TEMPLATE&&E.subTemplateExpanded?r.LocationPosition.AFTER:r.LocationPosition.BEFORE,y=dn(O,a,V);y!==a&&!_t(O[y])&&(this.range.setRange(y,y),a=y)}let d;const u=this.position.getPositionContext();if(c)d=this.getOriginalElementList()[u.index];else{const O=~a?a:0,E=this.getElementList();d=rn(E,O)}const{header:R,footer:h}=this.options,{isSubmitHistory:g=!0,isSetCursor:T=!0,isLazy:f=!0,isInit:m=!1,isSourceHistory:p=!1,isFirstRender:C=!1,isDel:I=!1}=t||{};let{isCompute:P=!0}=t||{};s&&(P=!0);let{curIndex:M}=t||{};const{traceLabel:N}=t||{},F=this.getInnerWidth(),S=this.getIsPagingMode(),W=this.pageRowList.length;if(P){if(this.splitTdValueMap.clear(),this.tdMap.clear(),this.position.setFloatPositionList([]),S){if(!R.disabled){const A=Yt();this.header.compute(),i("header.compute",A)}if(!h.disabled){const A=Yt();this.footer.compute(),i("footer.compute",A)}}const O=this.getMargins(),E=this.getHeight(),L=this.header.getExtraHeight(),V=this.getMainOuterHeight(),y=O[3],U=O[0]+L,Q=Jo(this.elementList),K=Yt();this.rowList=this.computeRowList({startX:y,startY:U,pageHeight:E,mainOuterHeight:V,isPagingMode:S,innerWidth:F,surroundElementList:Q,elementList:this.elementList}),i("computeRowList",K);const z=Yt();this.pageRowList=this._computePageList(),i("computePageList",z);const rt=Yt();this.position.computePositionList(),i("computePositionList",rt);const at=Yt();if(this.area.compute(),i("area.compute",at),!this.isPrintMode()){const A=this.search.getSearchKeyword();if(A){const ct=Yt();this.search.compute(A),i("search.compute",ct)}const it=Yt();this.control.computeHighlightList(),i("control.computeHighlightList",it)}if(this.isGraffitiMode()){const A=Yt();this.graffiti.compute(),i("graffiti.compute",A)}}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let O=0;O<this.pageRowList.length;O++)this.pageList[O]||this._createPage(O);const Y=this.pageRowList.length,b=this.pageList.length;if(b>Y){const O=b-Y;this.ctxList.splice(Y,O),this.pageList.splice(Y,O).forEach(E=>E.remove())}const D=Yt();if(f&&S?this._lazyRender():this._immediateRender(),i(f&&S?"lazyRender":"immediateRender",D),T){if(P&&d?.tableId){const{index:O}=u,L=this.getOriginalElementList()[O];if(d.tableId!==L?.id){const y=this.findTableChildrenElement(!0,d.tableId,d);y&&u.index!==y.originalIndex&&(u.index=y.originalIndex,u.tableId=y.table.id,u.trIndex=y.trIndex,u.trId=y.tr.id,u.tdIndex=y.tdIndex,u.tdId=y.td.id,M=y.elementIndex,this.position.setPositionContext(u),this.range.setRange(M,M),this.updateTableTool())}const V=this.getElementList();V[a]!==d&&(M=V.findIndex(y=>y===d))}M=this.setCursor(M)}else this.range.getIsSelection()&&this.cursor.focus();if(I){let O;const E=this.position.getPositionContext();O=this.range.getRange().startIndex-1,E.index=O}(g&&!C||M!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(M);const X=Yt();Vo(()=>{const O=Yt();this.range.setRangeStyle(),P&&this.control.getActiveControl()&&this.control.reAwakeControl(),P&&!this.isReadonly()&&this.getMode()!==r.EditorMode.FORM&&u.isTable&&this.getOriginalElementList()[u.index].type===r.ElementType.TABLE&&this.tableTool.render(),P&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),W!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(g||p)&&!m&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"));const E=Yt();Do(this.options,N||"render",E-e,[...n,{label:"nextTick.wait",duration:O-X},{label:"nextTick.callback",duration:E-O}],{isCompute:P,pageCount:this.pageRowList.length})}),T&&this.fixPosition()}fixPosition(t=!1){let e;const n=this.position.getPositionContext();if(n.isTable){const i=this.getElementList(),l=this.range.getRange().startIndex;if(t||l>=i.length){const s=this.getTd(),a=n.index+(t?-1:1),d=this.getOriginalElementList()[a];if(!d?.trList)return;e=l-i.length;for(let u=0;u<d.trList.length;u++){const R=d.trList[u],h=R.tdList.find(g=>t?s?.linkTdPrevId===g.id:s?.id===g.linkTdPrevId);if(h){n.index=a,n.trIndex=u,n.tableId=d.id,n.trId=R.id,n.tdId=h?.id,e=t?h.value.length-1:e+(h.value[0]?.type===r.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,u=this.getOriginalElementList()[s].trList?.[a].tdList[c].positionList;t===void 0&&u&&(t=u.length-1);const R=u?.[t];this.position.setCursorPosition(R||null)}else t!==void 0&&t>=n.length&&(t=n.length-1),this.position.setCursorPosition(t!==void 0&&t>=0?n[t]:null);let l=!0;if(t!==void 0&&e.isImage&&e.isDirectHit){const s=i[t];if(s&&Nl.includes(s.type)){l=!1;const a=this.position.getCursorPosition();this.previewer.updateResizer(s,a)}}return this.cursor.drawCursor({isShow:l}),t}submitHistory(t){const e=this.position.getPositionContext(),n=ko(this.elementList),i=ko(this.header.getElementList()),l=ko(this.footer.getElementList()),s=dt(this.range.getRange()),a=this.pageNo,c=dt(e),d=this.zone.getZone();this.historyManager.execute(()=>{this.zone.setZone(d),this.setPageNo(a),this.position.setPositionContext(dt(c)),this.header.setElementList(dt(i)),this.footer.setElementList(dt(l)),this.elementList=dt(n),this.range.replaceRange(dt(s)),this.render({curIndex:t,isSubmitHistory:!1,isSourceHistory:!0})})}destroy(){this.macroParticle.clearInlineEditor({isSubmitHistory:!1}),this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getMacroParticle().clearInlineEditor({isSubmitHistory:!1}),this.getPreviewer().clearResizer(),this.getTableTool().dispose(),this.getHyperlinkParticle().clearHyperlinkPopup(),this.getDateParticle().clearDatePicker()}updateTableTool(){if(this.getMode()===r.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((l,s)=>{l.tableIndex=e,l.tableId=t.id,l.trIndex=i,l.trId=n.id,l.tdIndex=s,this.tdMap.set(l.id,l)})})}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:l}=i,s=this.getOriginalElementList();let a=l;t&&(a=l>s.length?s.length-1:l);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[u,R]of d.trList.entries())for(const[h,g]of R.tdList.entries()){const T=g.value.findIndex(typeof n=="function"?n:f=>f===n);if(T>=0)return{originalIndex:c,table:d,tr:R,trIndex:u,td:g,tdIndex:h,elementIndex:T}}}}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 l=-1;for(;l<0;){const s=this.getTdById(i.linkTdPrevId);if(s){l=e-(s.valueStartIndex??0);const a=Math.max(0,l);this.spliceElementList(s.value,a+1,s.value.length-a-1),i=s}else l=0}}else{let l=1;for(;l>0;){const s=this.getTdById(i.linkTdNextId);if(s){const a=s.valueStartIndex??0;l=n-(a+s.value.length);const c=Math.min(s.value.length,n-a+1);this.spliceElementList(s.value,0,c),i=s}else l=0}}}getTablesByPagingId(t,e,n){const i=[],l=[];if(t[n].pagingId===e){i.push(n),l.push(t[n]);for(let s=n-1;s>=0&&t[s].pagingId===e;s--)l.unshift(t[s]),i.push(s);for(let s=n+1;s<t.length&&t[s].pagingId===e;s++)l.push(t[s]),i.push(s)}return{list:l,startIndex:i.sort()[0]}}}class Br{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;updateSubTemplate;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.updateSubTemplate=t.updateSubTemplate.bind(t),this.expandSubTemplate=t.expandSubTemplate.bind(t),this.collapseSubTemplate=t.collapseSubTemplate.bind(t),this.toggleSubTemplate=t.toggleSubTemplate.bind(t)}}function Ng(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 Fg(o,t){const{width:e,height:n,direction:i=r.PaperDirection.VERTICAL}=t,l=document.createElement("iframe");l.style.visibility="hidden",l.style.position="absolute",l.style.left="0",l.style.top="0",l.style.width="0",l.style.height="0",l.style.border="none",document.body.append(l);const s=l.contentWindow,a=s.document;a.open();const c=document.createElement("div"),d=Ng(e,n);o.forEach(h=>{const g=document.createElement("img");g.style.width=i===r.PaperDirection.HORIZONTAL?d.height:d.width,g.style.height=i===r.PaperDirection.HORIZONTAL?d.width:d.height,g.src=h,c.append(g)});const u=document.createElement("style"),R=`
|
|
539
544
|
* {
|
|
540
545
|
margin: 0;
|
|
541
546
|
padding: 0;
|
|
542
547
|
}
|
|
543
548
|
@page {
|
|
544
549
|
margin: 0;
|
|
545
|
-
size: ${d.size} ${i===
|
|
546
|
-
}`;u.append(document.createTextNode(R)),setTimeout(()=>{a.write(`${u.outerHTML}${c.innerHTML}`),s.print(),a.close(),window.addEventListener("mouseover",()=>{
|
|
547
|
-
`?
|
|
548
|
-
`?_:r[d];e.splice(c+d,0,{...a,value:u})}}}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 u={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,u)}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 u={type:"button",buttonLabel:r,buttonText:!0,label:r,code:s,value:d,hide:!1},R=[];R.push({value:"[",controlId:c,type:l.ElementType.CONTROL,control:u,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++)R.push({value:L[P],controlId:c,type:l.ElementType.CONTROL,control:u,controlComponent:l.ControlComponent.VALUE,color:"#000",hide:!1});i.length>1&&m<i.length-1&&R.push({value:_,controlId:c,type:l.ElementType.CONTROL,control:u,controlComponent:l.ControlComponent.VALUE,color:"#000",hide:!1})}R.push({value:"]",controlId:c,type:l.ElementType.CONTROL,control:u,controlComponent:l.ControlComponent.POSTFIX,color:"#1677FF",hide:!1});for(let m=0;m<R.length;m++)e.splice(a+m,0,R[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===_?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 u=this.range.getTextLikeSelectionElementList();if(u?.length)d=u,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 R=!1;d.forEach(h=>{!h.size&&t===a||h.size&&h.size===t||(h.size=t,R=!0)}),R&&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:u}=this.range.getRange(),h=this.draw.getElementList()[u],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:u}):this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(u=>{u.size||(u.size=i),!(u.size>=r)&&(u.size+2>r?u.size=r:u.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:u}=this.range.getRange(),h=this.draw.getElementList()[u],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:u}):this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(u=>{u.size||(u.size=i),!(u.size<=r)&&(u.size-2<r?u.size=r:u.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&&!tl(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(R=>{!R.type&&R.value===_||(t?(R.level=t,R.titleId=a,Hn(R)&&(R.size=c[Gi[t]],R.bold=!0)):R.titleId&&(delete R.titleId,delete R.title,delete R.level,delete R.size,delete R.bold))});const d=n===i,u=d?i:n;this.draw.render({curIndex:u,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 u={value:Fi,type:l.ElementType.SEPARATOR,dashArray:t,...e};wt(a,[u],r,{editorOptions:this.options}),r!==0&&a[r].value===_?(this.draw.spliceElementList(a,r,1,[u]),c=r-1):(this.draw.spliceElementList(a,r+1,0,[u]),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:Fi}])}addWatermark(t){if(this.draw.isReadonly())return;const n=this.draw.getOptions(),{color:i,size:r,opacity:s,font:a,gap:c}=Yo;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={...Yo},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});cg(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||Vi(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:xe(t),main:xe(e),footer:xe(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=Zo(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=Mt(this.range.getSelectionElementList()||[]),a=this.draw.getElementList(),c=Ue(a[i?e:e+1],{extraPickAttrs:["id","controlComponent"]}),d=Ue(a[n],{extraPickAttrs:["id","controlComponent"]}),u=this.draw.getRowList(),R=this.position.getPositionList(),h=R[e],g=R[n],f=h?.pageNo,T=g?.pageNo,m=h?.rowIndex,p=g?.rowIndex,I=u[m],L=u[p];let P=0,C=0;this.draw.getCursor().getHitLineStartIndex()||(P=I?.elementList[0]?.value===_?h?.index-I?.startIndex:h?.index-I?.startIndex+1),h===g?C=P:C=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:tt,pageNo:st,coordinate:{leftTop:et,rightTop:nt},lineHeight:q}=V[H];U===null||U!==tt?(G&&S.push(G),G={x:et[0],y:et[1]+st*(F+N),width:nt[0]-et[0],height:q},U=tt,Q=et[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:tt}=Q;S.push({x:G[0],y:G[1]+H*(F+N),width:0,height:tt})}const Y=this.draw.getZone().getZone(),{isTable:E,trIndex:W,tdIndex:X,index:O}=this.position.getPositionContext();let M=null;if(E){const Q=this.draw.getOriginalElementList()[O]||null;Q&&(M=Mt([Q])[0])}let b=null,y=null,D=e-1;for(;D>0;){const U=a[D],Q=a[D-1];if(U.titleId&&U.titleId!==Q?.titleId){b=U.titleId,y=R[D].pageNo;break}D--}return at({isCollapsed:i,startElement:c,endElement:d,startPageNo:f,endPageNo:T,startRowNo:m,endRowNo:p,startColNo:P,endColNo:C,rangeRects:S,zone:Y,isTable:E,trIndex:W??null,tdIndex:X??null,tableElement:M,selectionText:r,selectionElementList:s,titleId:b,titleStartPageNo:y})}getRangeRow(){const t=this.range.getRangeRowElementList();return t?Mt(t):null}getRangeParagraph(){const t=this.range.getRangeParagraphElementList();return t?Mt(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:u,startTrIndex:R,startTdIndex:h}=a;let g=i;if(a.tableId){const m=r.find(p=>p.id===u);m&&(g=m.trList?.[R]?.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();wt(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 u=a[d];if(d++,u.type===l.ElementType.TABLE){const R=u.trList;for(let h=0;h<R.length;h++){const g=R[h];for(let f=0;f<g.tdList.length;f++){const T=g.tdList[f];r(T.value,c)}}}u.type===l.ElementType.CONTROL&&u.control?.value&&r(u.control.value,!0),(e&&u.id===e||n&&u.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:u}=i[a],R=c[d],h=R.controlId&&R.controlComponent===l.ControlComponent.VALUE;if(u||h){if(Object.assign(R,t.properties),R.id){const g=Bl(R.id);g&&Object.assign(g,t.properties)}}else{const g=Mt([{...R,...t.properties}],{extraPickAttrs:["id"]});g.length>0&&g[0]?(De(He,R,g[0]),bt(g,{isHandleFirstElement:!1,editorOptions:this.options}),c[d]=g[0]):Object.assign(R,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 u=d.trList;for(let R=0;R<u.length;R++){const h=u[R];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 u=d.trList;for(let R=0;R<u.length;R++){const h=u[R];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 Mt(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 u=d.trList;for(let R=0;R<u.length;R++){const h=u[R];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 C=P.trList;for(let S=0;S<C.length;S++){const F=C[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 C=L;for(;C<p.length;){if(p[C+1]?.titleId!==I)return{isTable:!1,startIndex:C,endIndex:C};C++}}}return null}const i=n(e,t);if(!i)return;const{isTable:r,index:s,startTdIndex:a,endTdIndex:c,startTrIndex:d,endTrIndex:u,trIndex:R,tdIndex:h,tdId:g,trId:f,tableId:T,endIndex:m}=i;this.position.setPositionContext({isTable:r,index:s,trIndex:R,tdIndex:h,tdId:g,trId:f,tableId:T}),this.range.setRange(m,m,T,a,c,d,u),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===_)for(;n+1<t.length;){const r=t[n+1];if(r.value!==_&&r.value!==To)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:u,endIndex:R}=n;this.position.setPositionContext({isTable:i,index:r,trIndex:s,tdIndex:a,tdId:c,trId:d,tableId:u}),this.range.setRange(R,R),this.draw.render({curIndex:R,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=Do(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 u=c.trList;for(let R=0;R<u.length;R++){const h=u[R];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:R,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,...$t,...In,...He];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 R=i;R>=0;R--){const h=r[R];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 R=r[i-1];if(R?.controlId)for(let h=i-1;h>=0;h--){const g=r[h];if(g.controlId!==R.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 u=[...je,...$t,...In,...He];De(u,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 u=[];let R=c;for(;R<s.length;){const h=s[R];if(R++,d.titleId!==h.titleId){if(h.level&&Vo[h.level]<=Vo[d.level])break;u.push(h)}}n.push({...d.title,value:xe(u),elementList:Mt(u),zone:a}),c=R}},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:u,tdIndex:R,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?.[u].tdList[R];T=P?.value[h]||null,p=P?.positionList?.[h]||null,f={element:m[d],trIndex:u,tdIndex:R}}else T=m[d]||null,p=I[d]||null;let L=null;if(p){const{pageNo:P,coordinate:{leftTop:C,rightTop:S},lineHeight:F}=p,N=this.draw.getOriginalHeight(),V=this.draw.getOriginalPageGap();L={x:C[0],y:C[1]+P*(N+V),width:S[0]-C[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,...$t,...In,...He];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(Oo(i)){const c=this.draw.getOriginalRowList();if(s=e===l.LocationPosition.BEFORE?c[i]?.startIndex:c[i+1]?.startIndex-1,!Oo(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,u)=>{for(const R of d){if(R.type===l.ElementType.TABLE){const g=R.trList;for(const f of g)for(const T of f.tdList)a(T.value,u);continue}if(R.type!==l.ElementType.MACRO&&R.type!==l.ElementType.CUSTOM_MACRO&&R.type!==l.ElementType.REUSABLE_ITEM||e&&R.id!==e||n&&R.dictCode!==n||i&&R.label!==i||r&&R.areaId!==r)continue;const h={id:R.id,type:R.type,label:R.label,dictCode:R.dictCode,zone:u};R.type===l.ElementType.MACRO?h.value=R.value:R.type===l.ElementType.CUSTOM_MACRO?(h.macroConfig=R.macroConfig,h.value=R.macroConfig?.value):R.type===l.ElementType.REUSABLE_ITEM&&(h.reusableItemConfig=R.reusableItemConfig,h.value=R.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:u}of c)a(u,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 u=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)u(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}))}},R=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const h of R)u(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:u,code:R,isSubmitHistory:h=!0}=d;e=!0,h&&(n=!0),c.type===l.ElementType.MACRO?c.value=u:c.type===l.ElementType.CUSTOM_MACRO?c.macroConfig?(c.macroConfig.value=u,R!==void 0&&(c.macroConfig.code=R)):c.macroConfig={type:"text",value:u}:c.type===l.ElementType.REUSABLE_ITEM&&(c.reusableItemConfig?c.reusableItemConfig.value=u:c.reusableItemConfig={value:u})}},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=R=>{for(let h=0;h<R.length;h++){const g=R[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))}},u=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const R of u)d(R);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 u=0;u<c.length;u++){const R=c[u];if(R.type===l.ElementType.TABLE){const h=R.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:u,trIndex:g,tdIndex:T,tableId:R.tableId,trId:f.id,tdId:m.id}}}}if(!(R.type!==l.ElementType.MACRO&&R.type!==l.ElementType.CUSTOM_MACRO&&R.type!==l.ElementType.REUSABLE_ITEM)&&!(e&&R.id!==e)&&!(n&&R.dictCode!==n)&&!(i&&R.label!==i)&&!(r&&R.areaId!==r))return{zone:d,index:u}}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 u=s(d,c);if(u){this.setZone(u.zone),this.position.setPositionContext({isTable:u.isTable||!1,index:u.index,trIndex:u.trIndex,tdIndex:u.tdIndex,tableId:u.tableId,trId:u.trId,tdId:u.tdId}),this.range.replaceRange({startIndex:u.index,endIndex:u.index}),this.draw.render({curIndex:u.index,isCompute:!1,isSubmitHistory:!1});break}}}insertSubTemplate(t){const{label:e,templateId:n,content:i,conditions:r,relation:s="and",isSubmitHistory:a=!0}=t,c={id:lt(),value:e,type:l.ElementType.SUB_TEMPLATE,label:e,templateId:n,subTemplateContent:i?.map(d=>at(d)),subTemplateRelation:s,subTemplateConditions:r?.map(d=>({...d})),subTemplateExpanded:!1};this.insertElementList([c],{isSubmitHistory:a})}updateSubTemplate(t){const{id:e,properties:n,isSubmitHistory:i=!0}=t;if(!e)return;const r=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];let s=!1;for(let a=0;a<r.length;a++)Tr(r[a],c=>{c.id!==e||c.type!==l.ElementType.SUB_TEMPLATE||(Object.assign(c,{...n,value:n.label??c.value,subTemplateContent:n.subTemplateContent?n.subTemplateContent.map(d=>at(d)):c.subTemplateContent?.map(d=>at(d)),subTemplateConditions:n.subTemplateConditions?n.subTemplateConditions.map(d=>({...d})):c.subTemplateConditions?.map(d=>({...d}))}),s=!0)});s&&this.draw.render({isSubmitHistory:i,isCompute:!0})}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)){const c=n||a.subTemplateContent;if(!c?.length){console.warn("子模板内容为空,无法展开");return}a.subTemplateExpanded=!0,a.hide=!0;const d=at(c);bt(d,{isHandleFirstElement:!1,editorOptions:this.options});for(let u=0;u<d.length;u++)d[u].subTemplateParentId=a.id;r.splice(s+1,0,...d),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].subTemplateParentId===s.id;)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)){a.subTemplateExpanded?this.collapseSubTemplate({id:e,isSubmitHistory:i}):this.expandSubTemplate({id:e,content:n,isSubmitHistory:i});return}}}}class gg{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 fg{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 Yr={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:Tg,EDIT_ATTRIBUTE:mg,COPY:pg,PASTE:Lg}}=pn;function Dr(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 Ig=[{key:pg,name:"复制控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&Dr(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeCopyControl(e)}},{key:Lg,name:"粘贴控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.editorTextFocus&&o.options.mode===l.EditorMode.EDIT&&ra(),callback:o=>{o.executePasteControl()}},{key:Tg,i18nPath:"contextmenu.control.delete",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&o.options.mode!==l.EditorMode.FORM,callback:o=>{o.executeRemoveControl()}},{key:mg,i18nPath:"contextmenu.control.editAttribute",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&Dr(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeTriggerControlEditAttribute(e)}}],{GLOBAL:{CUT:Pg,COPY:Mg,PASTE:Og,SELECT_ALL:Cg,PRINT:Sg}}=pn,Eg=[{key:Pg,i18nPath:"contextmenu.global.cut",shortCut:`${Ke?"⌘":"Ctrl"} + X`,when:o=>!o.isReadonly,callback:o=>{o.executeCut()}},{key:Mg,i18nPath:"contextmenu.global.copy",shortCut:`${Ke?"⌘":"Ctrl"} + C`,when:o=>o.editorHasSelection||o.isCrossRowCol,callback:o=>{o.executeCopy()}},{key:Og,i18nPath:"contextmenu.global.paste",shortCut:`${Ke?"⌘":"Ctrl"} + V`,when:o=>!o.isReadonly&&o.editorTextFocus,callback:o=>{o.executePaste()}},{key:Cg,i18nPath:"contextmenu.global.selectAll",shortCut:`${Ke?"⌘":"Ctrl"} + A`,when:o=>o.editorTextFocus,callback:o=>{o.executeSelectAll()}},{isDivider:!0},{key:Sg,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:o=>{o.executePrint()}}],{HYPERLINK:{DELETE:Xg,CANCEL:Ng,EDIT:Fg}}=pn,yg=[{key:Xg,i18nPath:"contextmenu.hyperlink.delete",when:o=>!o.isReadonly&&o.startElement?.type===l.ElementType.HYPERLINK,callback:o=>{o.executeDeleteHyperlink()}},{key:Ng,i18nPath:"contextmenu.hyperlink.cancel",when:o=>!o.isReadonly&&o.startElement?.type===l.ElementType.HYPERLINK,callback:o=>{o.executeCancelHyperlink()}},{key:Fg,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:bg,SAVE_AS:Wg,TEXT_WRAP:Vg,TEXT_WRAP_EMBED:Yg,TEXT_WRAP_UP_DOWN:Dg,TEXT_WRAP_SURROUND:Ug,TEXT_WRAP_FLOAT_TOP:wg,TEXT_WRAP_FLOAT_BOTTOM:Zg}}=pn,Qg=[{key:bg,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:Wg,i18nPath:"contextmenu.image.saveAs",icon:"image",when:o=>!o.editorHasSelection&&o.startElement?.type===l.ElementType.IMAGE,callback:o=>{o.executeSaveAsImageElement()}},{key:Vg,i18nPath:"contextmenu.image.textWrap",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===l.ElementType.IMAGE,childMenus:[{key:Yg,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.BLOCK)}},{key:Dg,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.INLINE)}},{key:Ug,i18nPath:"contextmenu.image.textWrapType.surround",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.SURROUND)}},{key:wg,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.FLOAT_TOP)}},{key:Zg,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,l.ImageDisplay.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:vg,BORDER_ALL:Kg,BORDER_EMPTY:Hg,BORDER_DASH:_g,BORDER_EXTERNAL:xg,BORDER_INTERNAL:Gg,BORDER_TD:Ag,BORDER_TD_TOP:kg,BORDER_TD_LEFT:Jg,BORDER_TD_BOTTOM:Bg,BORDER_TD_RIGHT:$g,BORDER_TD_BACK:zg,BORDER_TD_FORWARD:jg,VERTICAL_ALIGN:qg,VERTICAL_ALIGN_TOP:tf,VERTICAL_ALIGN_MIDDLE:ef,VERTICAL_ALIGN_BOTTOM:nf,INSERT_ROW_COL:of,INSERT_TOP_ROW:sf,INSERT_BOTTOM_ROW:rf,INSERT_LEFT_COL:lf,INSERT_RIGHT_COL:af,DELETE_ROW_COL:cf,DELETE_ROW:df,DELETE_COL:uf,DELETE_TABLE:Rf,MERGE_CELL:hf,CANCEL_MERGE_CELL:gf}}=pn,ff=[{isDivider:!0},{key:vg,i18nPath:"contextmenu.table.border",icon:"border-all",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:Kg,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.ALL)}},{key:Hg,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.EMPTY)}},{key:_g,i18nPath:"contextmenu.table.borderDash",icon:"border-dash",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.DASH)}},{key:xg,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.EXTERNAL)}},{key:Gg,i18nPath:"contextmenu.table.borderInternal",icon:"border-internal",when:()=>!0,callback:o=>{o.executeTableBorderType(l.TableBorder.INTERNAL)}},{key:Ag,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:kg,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.TOP)}},{key:$g,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.RIGHT)}},{key:Bg,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.BOTTOM)}},{key:Jg,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:o=>{o.executeTableTdBorderType(l.TdBorder.LEFT)}},{key:jg,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:o=>{o.executeTableTdSlashType(l.TdSlash.FORWARD)}},{key:zg,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:o=>{o.executeTableTdSlashType(l.TdSlash.BACK)}}]}]},{key:qg,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:tf,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(l.VerticalAlign.TOP)}},{key:ef,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(l.VerticalAlign.MIDDLE)}},{key:nf,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(l.VerticalAlign.BOTTOM)}}]},{key:of,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:sf,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:o=>{o.executeInsertTableTopRow()}},{key:rf,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:o=>{o.executeInsertTableBottomRow()}},{key:lf,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:o=>{o.executeInsertTableLeftCol()}},{key:af,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:o=>{o.executeInsertTableRightCol()}}]},{key:cf,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==l.EditorMode.FORM,childMenus:[{key:df,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:o=>{o.executeDeleteTableRow()}},{key:uf,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:o=>{o.executeDeleteTableCol()}},{key:Rf,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:o=>{o.executeDeleteTable()}}]},{key:hf,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:o=>!o.isReadonly&&o.isCrossRowCol&&o.options.mode!==l.EditorMode.FORM,callback:o=>{o.executeMergeTableCell()}},{key:gf,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 Tf{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=[...Eg,...ff,...Qg,...Ig,...yg],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(t);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(t){const e=this.draw.isReadonly(),{isCrossRowCol:n,startIndex:i,endIndex:r}=this.range.getRange(),s=!!(~i||~r),a=s&&i!==r,{isTable:c,trIndex:d,tdIndex:u,index:R}=this.position.getPositionContext(),h=t?this.command.getPositionContextByEvent(t,{isMustDirectHit:!0}):null;let g=null;if(c){const P=this.draw.getOriginalElementList()[R]||null;P&&(g=Mt([P],{extraPickAttrs:["id"]})[0])}const f=c&&!!n,T=this.draw.getElementList();let m=T[i]||null,p=T[r]||null;h?.element&&(m=h.element,p=h.element),h?.tableInfo?.element&&(g=h.tableInfo.element);const I=this.draw.getZone().getZone();return{startElement:m,endElement:p,isReadonly:e,editorHasSelection:a,editorTextFocus:s,isCrossRowCol:f,zone:I,isInTable:c,trIndex:d??null,tdIndex:u??null,tableElement:g,options:this.options}}_createContextMenuContainer(){const t=document.createElement("div");return t.classList.add(`${z}-contextmenu-container`),t.setAttribute(ue,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 C=e[P];if(C.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`),C.childMenus){const Y=this._filterMenuList(C.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(),X=W.left+W.width,O=W.top;c=this._render({contextMenuList:Y,left:X,top:O,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=()=>{C.callback&&this.context&&C.callback(this.command,this.context),this.dispose()};const F=document.createElement("i");S.append(F),C.icon&&F.classList.add(`${z}-contextmenu-${C.icon}`);const N=document.createElement("span"),V=C.i18nPath?this._formatName(this.i18n.t(C.i18nPath)):this._formatName(C.name||"");if(N.append(document.createTextNode(V)),S.append(N),C.shortCut){const Y=document.createElement("span");Y.classList.add(`${z}-shortcut`),Y.append(document.createTextNode(C.shortCut)),S.append(Y)}a.append(S)}}const d=document.createElement("div");d.classList.add(`${z}-contextmenu-divider`),a.append(d);const u=document.createElement("div");u.classList.add(`${z}-contextmenu-item`),u.onmouseenter=()=>{this._setHoverStatus(u,!0),this._removeSubMenu(s)},u.onmouseleave=()=>{this._setHoverStatus(u,!1)},u.onclick=()=>{this.dispose()};const R=document.createElement("i");u.append(R);const h=document.createElement("span");h.append(document.createTextNode(this.i18n.t("contextmenu.global.cancel"))),u.append(h),a.append(u),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(Yr),n=new RegExp(`${e.join("|")}`);let i=t;if(n.test(i)){const r=new RegExp(Yr.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 mf=[{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:Ke?l.KeyMap.COMMA:l.KeyMap.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSuperscript()}},{key:Ke?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)}}],pf=[{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)}}],Lf=[{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 If{draw;command;globalShortcutList;agentShortcutList;constructor(t,e){this.draw=t,this.command=e,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...mf,...pf,...Lf]),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 Pf{editor;constructor(t){this.editor=t}use(t,e){t(this.editor,e)}}class Mf{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 Of{paste;copy;drop}class Ur{command;version;listener;eventBus;override;register;destroy;use;draw;constructor(t,e,n={}){const i=Do(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=ve,this.listener=new gg,this.eventBus=new Mf,this.override=new Of,this.draw=new lg(t,i,{header:r,main:s,footer:a,graffiti:c},this.listener,this.eventBus,this.override);const u=this.draw;this.command=new Wr(new hg(u)),u.setCommand(this.command);const R=new Tf(u,this.command),h=new If(u,this.command);this.register=new fg({contextMenu:R,shortcut:h,i18n:u.getI18n()}),this.destroy=()=>{u.destroy(),h.removeEvent(),R.removeEvent(),this.eventBus.dangerouslyClearAll()};const g=new Pf(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=Wr,l.EDITOR_CLIPBOARD=Ln,l.EDITOR_COMPONENT=ue,l.Editor=Ur,l.INTERNAL_CONTEXT_MENU_KEY=pn,l.INTERNAL_SHORTCUT_KEY=fs,l.LETTER_CLASS=mo,l.createDomFromElementList=nn,l.default=Ur,l.getElementListByHTML=on,l.getTextFromElementList=xe,l.splitText=ct,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
549
|
-
//# sourceMappingURL=canvas-editor.umd.cjs.map
|
|
550
|
+
size: ${d.size} ${i===r.PaperDirection.HORIZONTAL?"landscape":"portrait"};
|
|
551
|
+
}`;u.append(document.createTextNode(R)),setTimeout(()=>{a.write(`${u.outerHTML}${c.innerHTML}`),s.print(),a.close(),window.addEventListener("mouseover",()=>{l?.remove()},{once:!0})})}const yg=[r.ControlType.TEXT,r.ControlType.TEXTFIELD],$r=["id","titleId","listId","areaId","hyperlinkId","dateId","labelId","tableId","trId","tdId","pagingId","menstrualHistoryId","fetalHeartPositionId","toothPositionId"];function Oo(o,t){for(let e=0;e<o.length;e++){const n=o[e];if(n.type===r.ElementType.CONTROL&&n.controlId===t&&n.control)return dt(n);if(n.control?.value?.length){const i=Oo(n.control.value,t);if(i)return i}if(n.valueList?.length){const i=Oo(n.valueList,t);if(i)return i}if(n.type===r.ElementType.TABLE&&n.trList?.length)for(let i=0;i<n.trList.length;i++){const l=n.trList[i];for(let s=0;s<l.tdList.length;s++){const a=l.tdList[s],c=Oo(a.value,t);if(c)return c}}}return null}function bg(o){const t=new Map,e=new Map,n=a=>a&&(t.has(a)||t.set(a,gt()),t.get(a)),i=a=>a&&(e.has(a)||e.set(a,gt()),e.get(a)),l=a=>{a.controlId&&(a.controlId=n(a.controlId)),a.originControlId&&(a.originControlId=n(a.originControlId));for(let c=0;c<$r.length;c++){const d=$r[c],u=a[d];if(typeof u=="string"){const R=a;R[d]=i(u)}}a.groupIds?.length&&(a.groupIds=a.groupIds.map(c=>i(c))),a.valueList?.length&&a.valueList.forEach(l),a.control?.value?.length&&a.control.value.forEach(l),a.trList?.length&&a.trList.forEach(c=>{const d=c;typeof d.id=="string"&&(d.id=i(d.id)),c.tdList.forEach(u=>{const R=u;typeof R.id=="string"&&(R.id=i(R.id)),u.value.forEach(l)})})},s=dt(o);return l(s),s}function Wg(o,t,e){let n=-1;const i=!!e;for(let l=0;l<o.length;l++){const s=o[l];if(i?s.controlId===t&&s.originControlId===e:s.controlId===t&&!s.originControlId)n=l;else if(~n)break}return n}class Vg{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 l=s=>{if(!s)return null;for(let a=t;a>=0;a--){const c=e[a];if(c.controlId===s&&c.control?.type===r.ControlType.TEXTFIELD&&(c.controlComponent===r.ControlComponent.PRETEXTFIX||c.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===r.ControlComponent.PREFIX||c.controlComponent===r.ControlComponent.PRE_TEXT))return s}return null};return i=l(n.controlId)||l(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()||ba(this.canvasEvent,t)}copyControl(t){if(!t)return;const e=Ct(this.draw.getElementList(),{editorOptions:this.options}),n=Oo(e,t);n&&Sa({element:n})}pasteControl(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=ms();if(!e?.element)return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const l=this.draw.getElementList(),s=bg(e.element),a=s.controlId;if(!a)return;const c=Ao([s]);if(!c.length)return;yt(c,{isHandleFirstElement:!1,editorOptions:this.options});let d=n,u=n,R=i,h=!1,g;const T=n===i;let f=this.control.getActiveControl();!f&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),f=this.control.getActiveControl());const m=f?.getElement();if(m?.control?.type&&yg.includes(m.control.type)&&this.control.getIsRangeWithinControl()){h=!0,g=m.controlId;const I=l[n];T&&(I?.control?.type===r.ControlType.TEXTFIELD||I?.control?.type===r.ControlType.TEXT)&&this.control.removePlaceholder(n)}else if(m?.controlId){const I=Wg(l,m.controlId,m.originControlId);~I&&(d=I,u=I,R=I)}wt(l,c,d,{isBreakWhenWrap:!0,editorOptions:this.options}),g&&c.forEach(I=>{I.controlId===a&&!I.originControlId&&(I.originControlId=g)});const p=d+1;u!==R&&this.draw.spliceElementList(l,u+1,R-u),this.draw.spliceElementList(l,p,0,c);const C=d+c.length;this.range.setRange(C,C),this.draw.render({curIndex:C}),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(),l=n===i;if(l&&e[n].value===k&&n===0)return;l?this.draw.spliceElementList(e,n,1):this.draw.spliceElementList(e,n+1,i-n);const s=l?n-1:n;this.range.setRange(s,s),this.draw.render({curIndex:s})}setRange(t,e,n,i,l,s,a){if(t<0||e<0||e<t)return;this.range.setRange(t,e,n,i,l,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,l=this.draw.getOriginalElementList();if(e){const s=l.findIndex(u=>u.id===e);if(!~s)return;const c=l[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=>{ge.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 l={},s=[];if(i?.length)s=i,l={isSetCursor:!1};else{const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===k&&(s.push(d),l={curIndex:a})}s.length&&(s.forEach(a=>{ge.forEach(c=>{delete a[c]})}),this.draw.render(l))}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(l=>l.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 l=null;n.forEach(h=>{const g=e[h];g.controlComponent===r.ControlComponent.VALUE&&(i.push(h),l||(l=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===r.ControlComponent.PREFIX||g.controlComponent===r.ControlComponent.PRE_TEXT){s=h+1;break}s===-1&&(s=h+1)}}if(s===-1&&n.length>0){const h=[];e.forEach((g,T)=>{g.controlId===t.controlId&&g.control?.type==="button"&&h.push(T)}),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:r.ElementType.CONTROL,control:{type:"button",buttonLabel:a,code:t.code,value:[{value:a}],label:a,hide:!1},controlComponent:r.ControlComponent.VALUE,color:l?.color||"#fff",highlight:l?.highlight||"#1677FF",style:l?.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(),u=!0,R=d;this.draw.render({curIndex:R,isSetCursor:u})}else if(t.controlId){const n=t.controlId;if(e.forEach(l=>{l.controlId===n&&l.control&&(t.label!==void 0&&(l.control.label=t.label),t.placeholder!==void 0&&(l.control.placeholder=t.placeholder),t.code!==void 0&&(l.control.code=t.code),t.value!==void 0&&(l.control.value=t.value?[{value:t.value}]:null),t.valueSets!==void 0&&(l.control.valueSets=t.valueSets),t.dateFormat!==void 0&&(l.control.dateFormat=t.dateFormat),t.numberExclusiveOptions!==void 0&&(l.control.numberExclusiveOptions=t.numberExclusiveOptions),t.underline!==void 0&&(l.control.underline=t.underline))}),t.placeholder!==void 0){const l=t.placeholder,s=[];if(e.forEach((a,c)=>{a.controlId===n&&a.controlComponent==="placeholder"&&s.push({element:a,index:c})}),s.length===l.length)s.forEach((a,c)=>{a.element.value=l[c]===`
|
|
552
|
+
`?k:l[c]});else if(s.length>0){const a={...s[0].element};s.sort((d,u)=>u.index-d.index).forEach(d=>{e.splice(d.index,1)});const c=Math.min(...s.map(d=>d.index));for(let d=0;d<l.length;d++){const u=l[d]===`
|
|
553
|
+
`?k:l[d];e.splice(c+d,0,{...a,value:u})}}}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 u={value:e.label[d],controlId:e.controlId,type:r.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,u)}const{startIndex:l,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:l}=this.range.getRange(),s=!0,a=l;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:l}=this.range.getRange(),s=!0,a=l;this.draw.render({curIndex:a,isSetCursor:s}),n(!0)})}insertButtonValue(t){const e=this.draw.getElementList(),n=t.controlId,i=t.element[0].newButtonValue,l=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 u={type:"button",buttonLabel:l,buttonText:!0,label:l,code:s,value:d,hide:!1},R=[];R.push({value:"[",controlId:c,type:r.ElementType.CONTROL,control:u,controlComponent:r.ControlComponent.PREFIX,color:"#1677FF",hide:!1});for(let m=0;m<i.length;m++){const p=i[m],C=i.length>1?`${m+1}.${p.value}`:p.value,I=Tt(C);for(let P=0;P<I.length;P++)R.push({value:I[P],controlId:c,type:r.ElementType.CONTROL,control:u,controlComponent:r.ControlComponent.VALUE,color:"#000",hide:!1});i.length>1&&m<i.length-1&&R.push({value:k,controlId:c,type:r.ElementType.CONTROL,control:u,controlComponent:r.ControlComponent.VALUE,color:"#000",hide:!1})}R.push({value:"]",controlId:c,type:r.ElementType.CONTROL,control:u,controlComponent:r.ControlComponent.POSTFIX,color:"#1677FF",hide:!1});for(let m=0;m<R.length;m++)e.splice(a+m,0,R[m]);const{startIndex:h,endIndex:g}=this.range.getRange(),T=!0,f=g;this.draw.render({curIndex:f,isSetCursor:T})}font(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length)l.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===k?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:l,maxSize:s,defaultSize:a}=this.options;if(t<l||t>s)return;let c={},d=[];const u=this.range.getTextLikeSelectionElementList();if(u?.length)d=u,c={isSetCursor:!1};else{const{endIndex:h}=this.range.getRange(),T=this.draw.getElementList()[h];this.range.setDefaultStyle({size:t}),T?.value===k?(d.push(T),c={curIndex:h}):this.draw.render({curIndex:h,isCompute:!1,isSubmitHistory:!1})}if(!d.length)return;let R=!1;d.forEach(h=>{!h.size&&t===a||h.size&&h.size===t||(h.size=t,R=!0)}),R&&this.draw.render(c)}sizeAdd(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,maxSize:l}=this.options,s=this.range.getTextLikeSelectionElementList();let a={},c=[];if(s?.length)c=s,a={isSetCursor:!1};else{const{endIndex:u}=this.range.getRange(),h=this.draw.getElementList()[u],T=this.range.getDefaultStyle()?.size||h.size||i;this.range.setDefaultStyle({size:T+2>l?l:T+2}),h?.value===k?(c.push(h),a={curIndex:u}):this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(u=>{u.size||(u.size=i),!(u.size>=l)&&(u.size+2>l?u.size=l:u.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:l}=this.options,s=this.range.getTextLikeSelectionElementList();let a={},c=[];if(s?.length)c=s,a={isSetCursor:!1};else{const{endIndex:u}=this.range.getRange(),h=this.draw.getElementList()[u],T=this.range.getDefaultStyle()?.size||h.size||i;this.range.setDefaultStyle({size:T-2<l?l:T-2}),h?.value===k?(c.push(h),a={curIndex:u}):this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(u=>{u.size||(u.size=i),!(u.size<=l)&&(u.size-2<l?u.size=l:u.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 l=i.findIndex(s=>!s.bold);i.forEach(s=>{s.bold=!!~l}),this.draw.render({isSetCursor:!1})}else{let l=!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===k?c.bold=!c.bold:l=!1,this.draw.render({isSubmitHistory:l,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 l=i.findIndex(s=>!s.italic);i.forEach(s=>{s.italic=!!~l}),this.draw.render({isSetCursor:!1})}else{let l=!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===k?c.italic=!c.italic:l=!1,this.draw.render({isSubmitHistory:l,curIndex:s,isCompute:!1})}}underline(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length){const s=l.some(a=>!a.underline||!t&&a.textDecoration||t&&!a.textDecoration||t&&a.textDecoration&&!ml(a.textDecoration,t));l.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===k?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 l=i.findIndex(s=>!s.strikeout);i.forEach(s=>{s.strikeout=!!~l}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let l=!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===k?c.strikeout=!c.strikeout:l=!1,this.draw.render({isSubmitHistory:l,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 l=i.findIndex(s=>s.type===r.ElementType.SUPERSCRIPT);i.forEach(s=>{~l?s.type===r.ElementType.SUPERSCRIPT&&(s.type=r.ElementType.TEXT,delete s.actualSize):(!s.type||s.type===r.ElementType.TEXT||s.type===r.ElementType.SUBSCRIPT)&&(s.type=r.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 l=i.findIndex(s=>s.type===r.ElementType.SUBSCRIPT);i.forEach(s=>{~l?s.type===r.ElementType.SUBSCRIPT&&(s.type=r.ElementType.TEXT,delete s.actualSize):(!s.type||s.type===r.ElementType.TEXT||s.type===r.ElementType.SUPERSCRIPT)&&(s.type=r.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 l=this.range.getSelectionElementList();if(l?.length)l.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===k?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 l=this.range.getSelectionElementList();if(l?.length)l.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===k?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 l=this.draw.getElementList(),s=n===i?this.range.getRangeParagraphElementList():l.slice(n+1,i+1);if(!s||!s.length)return;const a=gt(),c=this.draw.getOptions().title;s.forEach(R=>{!R.type&&R.value===k||(t?(R.level=t,R.titleId=a,$n(R)&&(R.size=c[is[t]],R.bold=!0)):R.titleId&&(delete R.titleId,delete R.title,delete R.level,delete R.size,delete R.bold))});const d=n===i,u=d?i:n;this.draw.render({curIndex:u,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 l=this.range.getRangeRowElementList();if(!l)return;l.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 l=this.range.getRangeRowElementList();if(!l)return;l.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 l=this.range.getRangeRowElementList();if(!l)return;l.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:r.ElementType.HYPERLINK,value:"",valueList:e,url:n,hyperlinkId:i||gt()}])}getHyperlinkRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const l=this.draw.getElementList(),s=l[n];if(s.type!==r.ElementType.HYPERLINK)return null;let a=n;for(;a>0;){if(l[a].hyperlinkId!==s.hyperlinkId){t=a+1;break}a--}let c=n+1;for(;c<l.length;){if(l[c].hyperlinkId!==s.hyperlinkId){e=c-1;break}c++}return c===l.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,l]=e;this.draw.spliceElementList(n,i,l-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,l]=e;for(let a=i;a<=l;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(),[l,s]=n;for(let c=l;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:l,endIndex:s}=this.range.getRange();if(!~l&&!~s)return;const a=this.draw.getElementList();let c=-1;const d=a[s+1];if(d&&d.type===r.ElementType.SEPARATOR){if(d.dashArray&&d.dashArray.join()===t.join())return;c=s,Object.assign(d,{dashArray:t,...e})}else{const u={value:Hi,type:r.ElementType.SEPARATOR,dashArray:t,...e};wt(a,[u],l,{editorOptions:this.options}),l!==0&&a[l].value===k?(this.draw.spliceElementList(a,l,1,[u]),c=l-1):(this.draw.spliceElementList(a,l+1,0,[u]),c=l)}this.range.setRange(c,c),this.draw.render({curIndex:c})}pageBreak(){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.insertElementList([{type:r.ElementType.PAGE_BREAK,value:Hi}])}addWatermark(t){if(this.draw.isReadonly())return;const n=this.draw.getOptions(),{color:i,size:l,opacity:s,font:a,gap:c}=_o;n.watermark.data=t.data,n.watermark.type=t.type||r.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||l,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={..._o},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 l=t.id||gt();return this.insertElementList([{...t,id:l,type:r.ElementType.IMAGE}]),l}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:l}=this.options;t!==1&&this.draw.setPageScale(1);const s=await this.draw.getDataURL({pixelRatio:e,mode:r.EditorMode.PRINT});Fg(s,{width:i,height:l,direction:n}),t!==1&&this.draw.setPageScale(t)}replaceImageElement(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==r.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!==r.ElementType.IMAGE||xi(n.value,`${n.id}.png`)}setImageCrop(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==r.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===r.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===r.ImageDisplay.SURROUND||e===r.ImageDisplay.FLOAT_TOP||e===r.ImageDisplay.FLOAT_BOTTOM){const l=this.position.getPositionList(),{pageNo:s,coordinate:{leftTop:a}}=l[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:ln(e,t).innerHTML,main:ln(n,t).innerHTML,footer:ln(i,t).innerHTML}}getText(){const t=this.options,e=this.draw.getHeaderElementList(),n=this.draw.getOriginalMainElementList(),i=this.draw.getFooterElementList();return{header:ke(e,t),main:ke(n,t),footer:ke(i,t)}}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),l=this.draw.getHeight(),s=this.draw.getMainOuterHeight(),a=l-(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=dt(t);yt(n,{isHandleFirstElement:!1,editorOptions:this.options});const i=Jo(n);return this.draw.computeRowList({innerWidth:e,elementList:n,surroundElementList:i}).reduce((s,a)=>s+a.height+(a.offsetY||0),0)}getRange(){return dt(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,l=this.range.toString(),s=Ct(this.range.getSelectionElementList()||[]),a=this.draw.getElementList(),c=Qe(a[i?e:e+1],{extraPickAttrs:["id","controlComponent"]}),d=Qe(a[n],{extraPickAttrs:["id","controlComponent"]}),u=this.draw.getRowList(),R=this.position.getPositionList(),h=R[e],g=R[n],T=h?.pageNo,f=g?.pageNo,m=h?.rowIndex,p=g?.rowIndex,C=u[m],I=u[p];let P=0,M=0;this.draw.getCursor().getHitLineStartIndex()||(P=C?.elementList[0]?.value===k?h?.index-C?.startIndex:h?.index-C?.startIndex+1),h===g?M=P:M=I.elementList[0]?.value===k?g.index-I.startIndex:g.index-I.startIndex+1;const N=[],F=this.draw.getOriginalHeight(),S=this.draw.getOriginalPageGap(),W=this.position.getSelectionPositionList();if(W){let U=null,Q=0,K=null;for(let z=0;z<W.length;z++){const{rowNo:rt,pageNo:at,coordinate:{leftTop:A,rightTop:it},lineHeight:ct}=W[z];U===null||U!==rt?(K&&N.push(K),K={x:A[0],y:A[1]+at*(F+S),width:it[0]-A[0],height:ct},U=rt,Q=A[0]):K.width=it[0]-Q,z===W.length-1&&K&&N.push(K)}}else{const Q=this.position.getPositionList()[n],{coordinate:{rightTop:K},pageNo:z,lineHeight:rt}=Q;N.push({x:K[0],y:K[1]+z*(F+S),width:0,height:rt})}const Y=this.draw.getZone().getZone(),{isTable:b,trIndex:D,tdIndex:X,index:O}=this.position.getPositionContext();let E=null;if(b){const Q=this.draw.getOriginalElementList()[O]||null;Q&&(E=Ct([Q])[0])}let L=null,V=null,y=e-1;for(;y>0;){const U=a[y],Q=a[y-1];if(U.titleId&&U.titleId!==Q?.titleId){L=U.titleId,V=R[y].pageNo;break}y--}return dt({isCollapsed:i,startElement:c,endElement:d,startPageNo:T,endPageNo:f,startRowNo:m,endRowNo:p,startColNo:P,endColNo:M,rangeRects:N,zone:Y,isTable:b,trIndex:D??null,tdIndex:X??null,tableElement:E,selectionText:l,selectionElementList:s,titleId:L,titleStartPageNo:V})}getRangeRow(){const t=this.range.getRangeRowElementList();return t?Ct(t):null}getRangeParagraph(){const t=this.range.getRangeParagraphElementList();return t?Ct(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(),l=this.draw.getOriginalMainElementList();for(let s=0;s<e.length;s++){const a=e[s],{startIndex:c,endIndex:d,tableId:u,startTrIndex:R,startTdIndex:h}=a;let g=i;if(a.tableId){const m=l.find(p=>p.id===u);m&&(g=m.trList?.[R]?.tdList?.[h]?.positionList||[])}const T=dt(g[c]),f=dt(g[d]);n.push({range:a,startPosition:T,endPosition:f})}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:l}=e;i||this.range.shrinkRange(),console.log(t,"payload");const s=dt(t),{startIndex:a}=this.range.getRange(),c=this.draw.getElementList();wt(c,s,a,{ignoreContextKeys:l,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(dt(t),e)}updateElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;const i=[];function l(a,c=!1){let d=0;for(;d<a.length;){const u=a[d];if(d++,u.type===r.ElementType.TABLE){const R=u.trList;for(let h=0;h<R.length;h++){const g=R[h];for(let T=0;T<g.tdList.length;T++){const f=g.tdList[T];l(f.value,c)}}}u.type===r.ElementType.CONTROL&&u.control?.value&&l(u.control.value,!0),(e&&u.id===e||n&&u.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)l(a);if(i.length){for(let a=0;a<i.length;a++){const{elementList:c,index:d,isInsideControl:u}=i[a],R=c[d],h=R.controlId&&R.controlComponent===r.ControlComponent.VALUE;if(u||h){if(Object.assign(R,t.properties),R.id){const g=Ra(R.id);g&&Object.assign(g,t.properties)}}else{const g=Ct([{...R,...t.properties}],{extraPickAttrs:["id"]});g.length>0&&g[0]?(Ze(Ge,R,g[0]),yt(g,{isHandleFirstElement:!1,editorOptions:this.options}),c[d]=g[0]):Object.assign(R,t.properties)}}this.draw.render({isSetCursor:!1})}}deleteElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;let i=!1;function l(a){let c=0;for(;c<a.length;){const d=a[c];if(d.type===r.ElementType.TABLE){const u=d.trList;for(let R=0;R<u.length;R++){const h=u[R];for(let g=0;g<h.tdList.length;g++){const T=h.tdList[g];l(T.value)}}}d.type===r.ElementType.CONTROL&&d.control?.value&&l(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)l(a);i&&this.draw.render({isSetCursor:!1})}getElementById(t){const{id:e,conceptId:n}=t,i=[];if(!e&&!n)return i;const l=a=>{let c=0;for(;c<a.length;){const d=a[c];if(c++,d.type===r.ElementType.TABLE){const u=d.trList;for(let R=0;R<u.length;R++){const h=u[R];for(let g=0;g<h.tdList.length;g++){const T=h.tdList[g];l(T.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)l(a);return Ct(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 l=a=>{let c=a.length-1;for(;c>=0;){const d=a[c];if(d.type===r.ElementType.TABLE){const u=d.trList;for(let R=0;R<u.length;R++){const h=u[R];for(let g=0;g<h.tdList.length;g++){const T=h.tdList[g];l(T.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)l(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,C){for(let I=0;I<p.length;I++){const P=p[I];if(P.type===r.ElementType.TABLE){const M=P.trList;for(let N=0;N<M.length;N++){const F=M[N];for(let S=0;S<F.tdList.length;S++){const W=F.tdList[S],Y=n(W.value,C);if(Y)return{...Y,isTable:!0,index:I,trIndex:N,tdIndex:S,tdId:W.id,trId:F.id,tableId:P.id}}}}if(P.titleId===C){let M=I;for(;M<p.length;){if(p[M+1]?.titleId!==C)return{isTable:!1,startIndex:M,endIndex:M};M++}}}return null}const i=n(e,t);if(!i)return;const{isTable:l,index:s,startTdIndex:a,endTdIndex:c,startTrIndex:d,endTrIndex:u,trIndex:R,tdIndex:h,tdId:g,trId:T,tableId:f,endIndex:m}=i;this.position.setPositionContext({isTable:l,index:s,trIndex:R,tdIndex:h,tdId:g,trId:T,tableId:f}),this.range.setRange(m,m,f,a,c,d,u),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===k)for(;n+1<t.length;){const l=t[n+1];if(l.value!==k&&l.value!==Eo)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,l=this.draw.getOriginalInnerWidth(),s=a=>a!==void 0?an(a,{innerWidth:l}):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:l,trIndex:s,tdIndex:a,tdId:c,trId:d,tableId:u,endIndex:R}=n;this.position.setPositionContext({isTable:i,index:l,trIndex:s,tdIndex:a,tdId:c,trId:d,tableId:u}),this.range.setRange(R,R),this.draw.render({curIndex:R,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=xn(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(l,s){let a=0;for(;a<l.length;){const c=l[a];if(a++,c.type===r.ElementType.TABLE){const u=c.trList;for(let R=0;R<u.length;R++){const h=u[R];for(let g=0;g<h.tdList.length;g++){const T=h.tdList[g],f=n(T.value,s);if(f)return{...f,positionContext:{isTable:!0,index:a-1,trIndex:R,tdIndex:g,tdId:c.tdId,trId:c.trId,tableId:c.tableId}}}}}if(c?.controlId!==t)continue;let d=a-1;if(e?.position===r.LocationPosition.OUTER_AFTER){if(!(c.controlComponent===r.ControlComponent.POSTFIX&&l[a+1]?.controlComponent!==r.ControlComponent.POST_TEXT))continue}else if(e?.position===r.LocationPosition.OUTER_BEFORE)d-=1;else if(e?.position===r.LocationPosition.AFTER){if(d-=1,c.controlComponent!==r.ControlComponent.PLACEHOLDER&&c.controlComponent!==r.ControlComponent.POSTFIX&&c.controlComponent!==r.ControlComponent.POST_TEXT)continue}else if(c.controlComponent!==r.ControlComponent.PREFIX&&c.controlComponent!==r.ControlComponent.PRE_TEXT||l[a]?.controlComponent===r.ControlComponent.PREFIX||l[a]?.controlComponent===r.ControlComponent.PRE_TEXT)continue;return{zone:s,range:{startIndex:d,endIndex:d},positionContext:{isTable:!1}}}return null}const i=[{zone:r.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:r.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:r.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const l of i){const s=n(l.elementList,l.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=dt(t),{startIndex:i}=this.range.getRange(),l=this.draw.getElementList(),s=rn(l,i);if(!s)return;const a=[...en,...Bt,...En,...Ge];Ze(a,s,n),this.draw.insertElementTextField([n])}insertControl(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=dt(t),{startIndex:i}=this.range.getRange(),l=this.draw.getElementList(),s=rn(l,i);if(!s)return;const a=l[i],c=a?.controlComponent===r.ControlComponent.POSTFIX||a?.controlComponent===r.ControlComponent.POSTTEXTFIX;let d=!1;if(a?.controlId&&!c)for(let R=i;R>=0;R--){const h=l[R];if(h.controlId!==a.controlId)break;if(h.controlComponent===r.ControlComponent.PRETEXTFIX||h.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT){h.control?.type===r.ControlType.TEXTFIELD&&(d=!0);break}}if(!d&&!c){const R=l[i-1];if(R?.controlId)for(let h=i-1;h>=0;h--){const g=l[h];if(g.controlId!==R.controlId)break;if(g.controlComponent===r.ControlComponent.PRETEXTFIX||g.controlComponent===r.ControlComponent.PRETEXTFIX_TEXT){g.control?.type===r.ControlType.TEXTFIELD&&(d=!0);break}}}if(d&&t.control?.type===r.ControlType.TEXTFIELD)return;const u=[...en,...Bt,...En,...Ge];Ze(u,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===r.ElementType.TABLE){const h=d.trList;for(let g=0;g<h.length;g++){const T=h[g];for(let f=0;f<T.tdList.length;f++){const m=T.tdList[f];i(m.value,a)}}}if(d?.title?.conceptId!==e)continue;const u=[];let R=c;for(;R<s.length;){const h=s[R];if(R++,d.titleId!==h.titleId){if(h.level&&Ho[h.level]<=Ho[d.level])break;u.push(h)}}n.push({...d.title,value:ke(u),elementList:Ct(u),zone:a}),c=R}},l=[{zone:r.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:r.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:r.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:s,elementList:a}of l)i(a,s);return n}getPositionContextByEvent(t,e={}){const n=t.target?.dataset.index;if(!n)return null;const{isMustDirectHit:i=!0}=e,l=Number(n),s=this.position.getPositionByXY({x:t.offsetX,y:t.offsetY,pageNo:l}),{isDirectHit:a,isTable:c,index:d,trIndex:u,tdIndex:R,tdValueIndex:h,zone:g}=s;if(i&&!a||g&&g!==this.zone.getZone())return null;let T=null,f=null;const m=this.draw.getOriginalElementList();let p=null;const C=this.position.getOriginalPositionList();if(c){const P=m[d].trList?.[u].tdList[R];f=P?.value[h]||null,p=P?.positionList?.[h]||null,T={element:m[d],trIndex:u,tdIndex:R}}else f=m[d]||null,p=C[d]||null;let I=null;if(p){const{pageNo:P,coordinate:{leftTop:M,rightTop:N},lineHeight:F}=p,S=this.draw.getOriginalHeight(),W=this.draw.getOriginalPageGap();I={x:M[0],y:M[1]+P*(S+W),width:N[0]-M[0],height:F}}return{pageNo:l,element:f,rangeRect:I,tableInfo:T}}insertTitle(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=dt(t),{startIndex:i}=this.range.getRange(),l=this.draw.getElementList(),s=rn(l,i);if(!s)return;const a=[...en,...Bt,...En,...Ge];n.valueList?.forEach(c=>{Ze(a,s,c)}),this.draw.insertElementList([n])}focus(t){const{position:e=r.LocationPosition.AFTER,isMoveCursorToVisible:n=!0,rowNo:i,range:l}=t||{};let s=-1;if(l)this.range.replaceRange(l),s=e===r.LocationPosition.BEFORE?l.startIndex:l.endIndex;else if(Wo(i)){const c=this.draw.getOriginalRowList();if(s=e===r.LocationPosition.BEFORE?c[i]?.startIndex:c[i+1]?.startIndex-1,!Wo(s))return;this.range.setRange(s,s)}else s=e===r.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===r.LocationPosition.OUTER_AFTER){const l=this.draw.getOriginalMainElementList();l[l.length-1].areaId===t&&this.draw.appendElementList([{value:k}],{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:l}=t,s=[],a=(d,u)=>{for(const R of d){if(R.type===r.ElementType.TABLE){const g=R.trList;for(const T of g)for(const f of T.tdList)a(f.value,u);continue}if(R.type!==r.ElementType.MACRO&&R.type!==r.ElementType.CUSTOM_MACRO&&R.type!==r.ElementType.REUSABLE_ITEM||e&&R.id!==e||n&&R.dictCode!==n||i&&R.label!==i||l&&R.areaId!==l)continue;const h={id:R.id,type:R.type,label:R.label,dictCode:R.dictCode,zone:u};R.type===r.ElementType.MACRO?h.value=R.value:R.type===r.ElementType.CUSTOM_MACRO?(h.macroConfig=R.macroConfig,h.value=R.macroConfig?.value):R.type===r.ElementType.REUSABLE_ITEM&&(h.reusableItemConfig=R.reusableItemConfig,h.value=R.reusableItemConfig?.value),s.push(h)}},c=[{zone:r.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:r.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:r.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:d,elementList:u}of c)a(u,d);return s}getMacroList(){const t=[],e=i=>{for(const l of i){if(l.type===r.ElementType.TABLE){const s=l.trList;for(const a of s)for(const c of a.tdList)e(c.value);continue}(l.type===r.ElementType.MACRO||l.type===r.ElementType.CUSTOM_MACRO||l.type===r.ElementType.REUSABLE_ITEM)&&t.push(l)}},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:l,value:s,code:a,isSubmitHistory:c=!0}=t;let d=!1;const u=h=>{for(let g=0;g<h.length;g++){const T=h[g];if(T.type===r.ElementType.TABLE){const f=T.trList;for(const m of f)for(const p of m.tdList)u(p.value);continue}T.type!==r.ElementType.MACRO&&T.type!==r.ElementType.CUSTOM_MACRO&&T.type!==r.ElementType.REUSABLE_ITEM||e&&T.id!==e||n&&T.dictCode!==n||i&&T.label!==i||l&&T.areaId!==l||(d=!0,T.type===r.ElementType.MACRO?T.value=s:T.type===r.ElementType.CUSTOM_MACRO?T.macroConfig?(T.macroConfig.value=s,a!==void 0&&(T.macroConfig.code=a)):T.macroConfig={type:"text",value:s}:T.type===r.ElementType.REUSABLE_ITEM&&(T.reusableItemConfig?T.reusableItemConfig.value=s:T.reusableItemConfig={value:s}))}},R=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const h of R)u(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===r.ElementType.TABLE){const g=c.trList;for(const T of g)for(const f of T.tdList)i(f.value);continue}if(c.type!==r.ElementType.MACRO&&c.type!==r.ElementType.CUSTOM_MACRO&&c.type!==r.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:u,code:R,isSubmitHistory:h=!0}=d;e=!0,h&&(n=!0),c.type===r.ElementType.MACRO?c.value=u:c.type===r.ElementType.CUSTOM_MACRO?c.macroConfig?(c.macroConfig.value=u,R!==void 0&&(c.macroConfig.code=R)):c.macroConfig={type:"text",value:u}:c.type===r.ElementType.REUSABLE_ITEM&&(c.reusableItemConfig?c.reusableItemConfig.value=u:c.reusableItemConfig={value:u})}},l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const s of l)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:l,properties:s,isSubmitHistory:a=!0}=t;let c=!1;const d=R=>{for(let h=0;h<R.length;h++){const g=R[h];if(g.type===r.ElementType.TABLE){const T=g.trList;for(const f of T)for(const m of f.tdList)d(m.value);continue}g.type!==r.ElementType.MACRO&&g.type!==r.ElementType.CUSTOM_MACRO&&g.type!==r.ElementType.REUSABLE_ITEM||e&&g.id!==e||n&&g.dictCode!==n||i&&g.label!==i||l&&g.areaId!==l||(c=!0,Object.assign(g,s))}},u=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const R of u)d(R);c&&this.draw.render({isSubmitHistory:a,isSetCursor:!1})}locationMacro(t){const{id:e,dictCode:n,label:i,areaId:l}=t,s=(c,d)=>{for(let u=0;u<c.length;u++){const R=c[u];if(R.type===r.ElementType.TABLE){const h=R.trList;for(let g=0;g<h.length;g++){const T=h[g];for(let f=0;f<T.tdList.length;f++){const m=T.tdList[f],p=s(m.value,d);if(p)return{...p,isTable:!0,index:u,trIndex:g,tdIndex:f,tableId:R.tableId,trId:T.id,tdId:m.id}}}}if(!(R.type!==r.ElementType.MACRO&&R.type!==r.ElementType.CUSTOM_MACRO&&R.type!==r.ElementType.REUSABLE_ITEM)&&!(e&&R.id!==e)&&!(n&&R.dictCode!==n)&&!(i&&R.label!==i)&&!(l&&R.areaId!==l))return{zone:d,index:u}}return null},a=[{zone:r.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:r.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:r.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:c,elementList:d}of a){const u=s(d,c);if(u){this.setZone(u.zone),this.position.setPositionContext({isTable:u.isTable||!1,index:u.index,trIndex:u.trIndex,tdIndex:u.tdIndex,tableId:u.tableId,trId:u.trId,tdId:u.tdId}),this.range.replaceRange({startIndex:u.index,endIndex:u.index}),this.draw.render({curIndex:u.index,isCompute:!1,isSubmitHistory:!1});break}}}insertSubTemplate(t){const{label:e,templateId:n,content:i,conditions:l,relation:s="and",isSubmitHistory:a=!0}=t,c={id:gt(),value:e,type:r.ElementType.SUB_TEMPLATE,label:e,templateId:n,subTemplateContent:i?.map(d=>dt(d)),subTemplateRelation:s,subTemplateConditions:l?.map(d=>({...d})),subTemplateExpanded:!1};this.insertElementList([c],{isSubmitHistory:a})}updateSubTemplate(t){const{id:e,properties:n,isSubmitHistory:i=!0}=t;if(!e)return;const l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];let s=!1;for(let a=0;a<l.length;a++)Vr(l[a],c=>{c.id!==e||c.type!==r.ElementType.SUB_TEMPLATE||(Object.assign(c,{...n,value:n.label??c.value,subTemplateContent:n.subTemplateContent?n.subTemplateContent.map(d=>dt(d)):c.subTemplateContent?.map(d=>dt(d)),subTemplateConditions:n.subTemplateConditions?n.subTemplateConditions.map(d=>({...d})):c.subTemplateConditions?.map(d=>({...d}))}),s=!0)});s&&this.draw.render({isSubmitHistory:i,isCompute:!0})}expandSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,l=this.draw.getOriginalMainElementList();for(let s=0;s<l.length;s++){const a=l[s];if(a.type===r.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){const c=n||a.subTemplateContent;if(!c?.length){console.warn("子模板内容为空,无法展开");return}a.subTemplateExpanded=!0,a.hide=!0;const d=dt(c);yt(d,{isHandleFirstElement:!1,editorOptions:this.options});for(let u=0;u<d.length;u++)d[u].subTemplateParentId=a.id;l.splice(s+1,0,...d),this.draw.render({isSubmitHistory:i,isCompute:!0});return}}}collapseSubTemplate(t){const{id:e,isSubmitHistory:n=!0}=t,i=this.draw.getOriginalMainElementList();for(let l=0;l<i.length;l++){const s=i[l];if(s.type===r.ElementType.SUB_TEMPLATE&&(!e||s.id===e)){s.subTemplateExpanded=!1,s.hide=!1;let a=l+1;for(;a<i.length&&i[a].subTemplateParentId===s.id;)a++;a>l+1&&i.splice(l+1,a-l-1),this.draw.render({isSubmitHistory:n,isCompute:!0});return}}}toggleSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,l=this.draw.getOriginalMainElementList();for(let s=0;s<l.length;s++){const a=l[s];if(a.type===r.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){a.subTemplateExpanded?this.collapseSubTemplate({id:e,isSubmitHistory:i}):this.expandSubTemplate({id:e,content:n,isSubmitHistory:i});return}}}}class Dg{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 Yg{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 zr={SELECTED_TEXT:"%s"},Mn={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:Ug,EDIT_ATTRIBUTE:wg,COPY:Zg,PASTE:Qg}}=Mn;function jr(o,t){if(t!==r.EditorMode.EDIT)return!1;const n=o?.control?.type,i=o?.controlComponent,l=n===r.ControlType.TEXT||n===r.ControlType.TEXTFIELD||n===r.ControlType.NUMBER||n===r.ControlType.SELECT||n===r.ControlType.DATE||n===r.ControlType.CHECKBOX||n===r.ControlType.RADIO||n===r.ControlType.BUTTON,s=i==="prefix"||i==="preText"||i==="preTextFix"||i==="textFixLabel"||n===r.ControlType.BUTTON&&i==="value";return l&&s}const vg=[{key:Zg,name:"复制控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&jr(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeCopyControl(e)}},{key:Qg,name:"粘贴控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.editorTextFocus&&o.options.mode===r.EditorMode.EDIT&&Xa(),callback:o=>{o.executePasteControl()}},{key:Ug,i18nPath:"contextmenu.control.delete",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&o.options.mode!==r.EditorMode.FORM,callback:o=>{o.executeRemoveControl()}},{key:wg,i18nPath:"contextmenu.control.editAttribute",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&jr(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeTriggerControlEditAttribute(e)}}],{GLOBAL:{CUT:Kg,COPY:Hg,PASTE:_g,SELECT_ALL:Ag,PRINT:Gg}}=Mn,xg=[{key:Kg,i18nPath:"contextmenu.global.cut",shortCut:`${Ae?"⌘":"Ctrl"} + X`,when:o=>!o.isReadonly,callback:o=>{o.executeCut()}},{key:Hg,i18nPath:"contextmenu.global.copy",shortCut:`${Ae?"⌘":"Ctrl"} + C`,when:o=>o.editorHasSelection||o.isCrossRowCol,callback:o=>{o.executeCopy()}},{key:_g,i18nPath:"contextmenu.global.paste",shortCut:`${Ae?"⌘":"Ctrl"} + V`,when:o=>!o.isReadonly&&o.editorTextFocus,callback:o=>{o.executePaste()}},{key:Ag,i18nPath:"contextmenu.global.selectAll",shortCut:`${Ae?"⌘":"Ctrl"} + A`,when:o=>o.editorTextFocus,callback:o=>{o.executeSelectAll()}},{isDivider:!0},{key:Gg,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:o=>{o.executePrint()}}],{HYPERLINK:{DELETE:kg,CANCEL:Jg,EDIT:Bg}}=Mn,$g=[{key:kg,i18nPath:"contextmenu.hyperlink.delete",when:o=>!o.isReadonly&&o.startElement?.type===r.ElementType.HYPERLINK,callback:o=>{o.executeDeleteHyperlink()}},{key:Jg,i18nPath:"contextmenu.hyperlink.cancel",when:o=>!o.isReadonly&&o.startElement?.type===r.ElementType.HYPERLINK,callback:o=>{o.executeCancelHyperlink()}},{key:Bg,i18nPath:"contextmenu.hyperlink.edit",when:o=>!o.isReadonly&&o.startElement?.type===r.ElementType.HYPERLINK,callback:(o,t)=>{const e=window.prompt(o.executeTranslate("contextmenu.hyperlink.edit"),t.startElement?.url);e&&o.executeEditHyperlink(e)}}],{IMAGE:{CHANGE:zg,SAVE_AS:jg,TEXT_WRAP:qg,TEXT_WRAP_EMBED:tT,TEXT_WRAP_UP_DOWN:eT,TEXT_WRAP_SURROUND:nT,TEXT_WRAP_FLOAT_TOP:oT,TEXT_WRAP_FLOAT_BOTTOM:iT}}=Mn,sT=[{key:zg,i18nPath:"contextmenu.image.change",icon:"image-change",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===r.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:jg,i18nPath:"contextmenu.image.saveAs",icon:"image",when:o=>!o.editorHasSelection&&o.startElement?.type===r.ElementType.IMAGE,callback:o=>{o.executeSaveAsImageElement()}},{key:qg,i18nPath:"contextmenu.image.textWrap",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===r.ElementType.IMAGE,childMenus:[{key:tT,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,r.ImageDisplay.BLOCK)}},{key:eT,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,r.ImageDisplay.INLINE)}},{key:nT,i18nPath:"contextmenu.image.textWrapType.surround",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,r.ImageDisplay.SURROUND)}},{key:oT,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,r.ImageDisplay.FLOAT_TOP)}},{key:iT,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,r.ImageDisplay.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:rT,BORDER_ALL:lT,BORDER_EMPTY:aT,BORDER_DASH:cT,BORDER_EXTERNAL:dT,BORDER_INTERNAL:uT,BORDER_TD:RT,BORDER_TD_TOP:hT,BORDER_TD_LEFT:gT,BORDER_TD_BOTTOM:TT,BORDER_TD_RIGHT:fT,BORDER_TD_BACK:mT,BORDER_TD_FORWARD:pT,VERTICAL_ALIGN:IT,VERTICAL_ALIGN_TOP:CT,VERTICAL_ALIGN_MIDDLE:LT,VERTICAL_ALIGN_BOTTOM:PT,INSERT_ROW_COL:MT,INSERT_TOP_ROW:OT,INSERT_BOTTOM_ROW:ET,INSERT_LEFT_COL:ST,INSERT_RIGHT_COL:XT,DELETE_ROW_COL:NT,DELETE_ROW:FT,DELETE_COL:yT,DELETE_TABLE:bT,MERGE_CELL:WT,CANCEL_MERGE_CELL:VT}}=Mn,DT=[{isDivider:!0},{key:rT,i18nPath:"contextmenu.table.border",icon:"border-all",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==r.EditorMode.FORM,childMenus:[{key:lT,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:o=>{o.executeTableBorderType(r.TableBorder.ALL)}},{key:aT,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:o=>{o.executeTableBorderType(r.TableBorder.EMPTY)}},{key:cT,i18nPath:"contextmenu.table.borderDash",icon:"border-dash",when:()=>!0,callback:o=>{o.executeTableBorderType(r.TableBorder.DASH)}},{key:dT,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:o=>{o.executeTableBorderType(r.TableBorder.EXTERNAL)}},{key:uT,i18nPath:"contextmenu.table.borderInternal",icon:"border-internal",when:()=>!0,callback:o=>{o.executeTableBorderType(r.TableBorder.INTERNAL)}},{key:RT,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:hT,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:o=>{o.executeTableTdBorderType(r.TdBorder.TOP)}},{key:fT,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:o=>{o.executeTableTdBorderType(r.TdBorder.RIGHT)}},{key:TT,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:o=>{o.executeTableTdBorderType(r.TdBorder.BOTTOM)}},{key:gT,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:o=>{o.executeTableTdBorderType(r.TdBorder.LEFT)}},{key:pT,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:o=>{o.executeTableTdSlashType(r.TdSlash.FORWARD)}},{key:mT,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:o=>{o.executeTableTdSlashType(r.TdSlash.BACK)}}]}]},{key:IT,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==r.EditorMode.FORM,childMenus:[{key:CT,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(r.VerticalAlign.TOP)}},{key:LT,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(r.VerticalAlign.MIDDLE)}},{key:PT,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(r.VerticalAlign.BOTTOM)}}]},{key:MT,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==r.EditorMode.FORM,childMenus:[{key:OT,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:o=>{o.executeInsertTableTopRow()}},{key:ET,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:o=>{o.executeInsertTableBottomRow()}},{key:ST,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:o=>{o.executeInsertTableLeftCol()}},{key:XT,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:o=>{o.executeInsertTableRightCol()}}]},{key:NT,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==r.EditorMode.FORM,childMenus:[{key:FT,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:o=>{o.executeDeleteTableRow()}},{key:yT,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:o=>{o.executeDeleteTableCol()}},{key:bT,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:o=>{o.executeDeleteTable()}}]},{key:WT,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:o=>!o.isReadonly&&o.isCrossRowCol&&o.options.mode!==r.EditorMode.FORM,callback:o=>{o.executeMergeTableCell()}},{key:VT,i18nPath:"contextmenu.table.mergeCancelCell",icon:"merge-cancel-cell",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==r.EditorMode.FORM,callback:o=>{o.executeCancelMergeTableCell()}}];class YT{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=[...xg,...DT,...sT,...vg,...$g],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 l=t[i];l.disable||l.key&&e.includes(l.key)||(l.isDivider||l.when?.(this.context))&&n.push(l)}return n}_proxyContextMenuEvent=t=>{this.context=this._getContext(t);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(t){const e=this.draw.isReadonly(),{isCrossRowCol:n,startIndex:i,endIndex:l}=this.range.getRange(),s=!!(~i||~l),a=s&&i!==l,{isTable:c,trIndex:d,tdIndex:u,index:R}=this.position.getPositionContext(),h=t?this.command.getPositionContextByEvent(t,{isMustDirectHit:!0}):null;let g=null;if(c){const P=this.draw.getOriginalElementList()[R]||null;P&&(g=Ct([P],{extraPickAttrs:["id"]})[0])}const T=c&&!!n,f=this.draw.getElementList();let m=f[i]||null,p=f[l]||null;h?.element&&(m=h.element,p=h.element),h?.tableInfo?.element&&(g=h.tableInfo.element);const C=this.draw.getZone().getZone();return{startElement:m,endElement:p,isReadonly:e,editorHasSelection:a,editorTextFocus:s,isCrossRowCol:T,zone:C,isInTable:c,trIndex:d??null,tdIndex:u??null,tableElement:g,options:this.options}}_createContextMenuContainer(){const t=document.createElement("div");return t.classList.add(`${q}-contextmenu-container`),t.setAttribute(he,r.EditorComponent.CONTEXTMENU),this.container.append(t),t}_render(t){const{contextMenuList:e,left:n,top:i,parentMenuContainer:l}=t,s=this._createContextMenuContainer(),a=document.createElement("div");a.classList.add(`${q}-contextmenu-content`);let c=null;l&&this.contextMenuRelationShip.set(l,s);for(let P=0;P<e.length;P++){const M=e[P];if(M.isDivider){if(P!==0&&P!==e.length-1&&!e[P-1]?.isDivider){const N=document.createElement("div");N.classList.add(`${q}-contextmenu-divider`),a.append(N)}}else{const N=document.createElement("div");if(N.classList.add(`${q}-contextmenu-item`),M.childMenus){const Y=this._filterMenuList(M.childMenus);Y.some(D=>!D.isDivider)&&(N.classList.add(`${q}-contextmenu-sub-item`),N.onmouseenter=()=>{this._setHoverStatus(N,!0),this._removeSubMenu(s);const D=N.getBoundingClientRect(),X=D.left+D.width,O=D.top;c=this._render({contextMenuList:Y,left:X,top:O,parentMenuContainer:s})},N.onmouseleave=D=>{(!c||!c.contains(D.relatedTarget))&&this._setHoverStatus(N,!1)})}else N.onmouseenter=()=>{this._setHoverStatus(N,!0),this._removeSubMenu(s)},N.onmouseleave=()=>{this._setHoverStatus(N,!1)},N.onclick=()=>{M.callback&&this.context&&M.callback(this.command,this.context),this.dispose()};const F=document.createElement("i");N.append(F),M.icon&&F.classList.add(`${q}-contextmenu-${M.icon}`);const S=document.createElement("span"),W=M.i18nPath?this._formatName(this.i18n.t(M.i18nPath)):this._formatName(M.name||"");if(S.append(document.createTextNode(W)),N.append(S),M.shortCut){const Y=document.createElement("span");Y.classList.add(`${q}-shortcut`),Y.append(document.createTextNode(M.shortCut)),N.append(Y)}a.append(N)}}const d=document.createElement("div");d.classList.add(`${q}-contextmenu-divider`),a.append(d);const u=document.createElement("div");u.classList.add(`${q}-contextmenu-item`),u.onmouseenter=()=>{this._setHoverStatus(u,!0),this._removeSubMenu(s)},u.onmouseleave=()=>{this._setHoverStatus(u,!1)},u.onclick=()=>{this.dispose()};const R=document.createElement("i");u.append(R);const h=document.createElement("span");h.append(document.createTextNode(this.i18n.t("contextmenu.global.cancel"))),u.append(h),a.append(u),s.append(a),s.style.display="block";const g=window.innerWidth,T=s.getBoundingClientRect(),f=T.width,m=n+f>g?n-f:n;s.style.left=`${m}px`;const p=window.innerHeight,C=T.height,I=i+C>p?i-C:i;return s.style.top=`${I}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(`${q}-contextmenu-item`).forEach(n=>n.classList.remove("hover")),t.classList.add("hover")):t.classList.remove("hover")}_formatName(t){const e=Object.values(zr),n=new RegExp(`${e.join("|")}`);let i=t;if(n.test(i)){const l=new RegExp(zr.SELECTED_TEXT,"g");if(l.test(i)){const s=this.range.toString();i=i.replace(l,s)}}return i}registerContextMenuList(t){this.contextMenuList.push(...t)}dispose(){this.contextMenuContainerList.forEach(t=>t.remove()),this.contextMenuContainerList=[],this.contextMenuRelationShip.clear()}}const UT=[{key:r.KeyMap.X,ctrl:!0,shift:!0,callback:o=>{o.executeStrikeout()}},{key:r.KeyMap.LEFT_BRACKET,mod:!0,callback:o=>{o.executeSizeAdd()}},{key:r.KeyMap.RIGHT_BRACKET,mod:!0,callback:o=>{o.executeSizeMinus()}},{key:r.KeyMap.B,mod:!0,callback:o=>{o.executeBold()}},{key:r.KeyMap.I,mod:!0,callback:o=>{o.executeItalic()}},{key:r.KeyMap.U,mod:!0,callback:o=>{o.executeUnderline()}},{key:Ae?r.KeyMap.COMMA:r.KeyMap.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSuperscript()}},{key:Ae?r.KeyMap.PERIOD:r.KeyMap.LEFT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSubscript()}},{key:r.KeyMap.L,mod:!0,callback:o=>{o.executeRowFlex(r.RowFlex.LEFT)}},{key:r.KeyMap.E,mod:!0,callback:o=>{o.executeRowFlex(r.RowFlex.CENTER)}},{key:r.KeyMap.R,mod:!0,callback:o=>{o.executeRowFlex(r.RowFlex.RIGHT)}},{key:r.KeyMap.J,mod:!0,callback:o=>{o.executeRowFlex(r.RowFlex.ALIGNMENT)}},{key:r.KeyMap.J,mod:!0,shift:!0,callback:o=>{o.executeRowFlex(r.RowFlex.JUSTIFY)}}],wT=[{key:r.KeyMap.ZERO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(null)}},{key:r.KeyMap.ONE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(r.TitleLevel.FIRST)}},{key:r.KeyMap.TWO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(r.TitleLevel.SECOND)}},{key:r.KeyMap.THREE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(r.TitleLevel.THIRD)}},{key:r.KeyMap.FOUR,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(r.TitleLevel.FOURTH)}},{key:r.KeyMap.FIVE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(r.TitleLevel.FIFTH)}},{key:r.KeyMap.SIX,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(r.TitleLevel.SIXTH)}}],ZT=[{key:r.KeyMap.I,shift:!0,mod:!0,callback:o=>{o.executeList(r.ListType.UL,r.ListStyle.DISC)}},{key:r.KeyMap.U,shift:!0,mod:!0,callback:o=>{o.executeList(r.ListType.OL)}}];class QT{draw;command;globalShortcutList;agentShortcutList;constructor(t,e){this.draw=t,this.command=e,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...UT,...wT,...ZT]),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?Ie(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 vT{editor;constructor(t){this.editor=t}use(t,e){t(this.editor,e)}}class KT{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 HT{paste;copy;drop}class qr{command;version;listener;eventBus;override;register;destroy;use;draw;constructor(t,e,n={}){const i=xn(n);e=dt(e);let l=[],s=[],a=[],c=[];Array.isArray(e)?s=e:(l=e.header||[],s=e.main,a=e.footer||[],c=e.graffiti||[]),[l,s,a].forEach(T=>{yt(T,{editorOptions:i,isForceCompensation:!0})}),this.version=_e,this.listener=new Dg,this.eventBus=new KT,this.override=new HT,this.draw=new Xg(t,i,{header:l,main:s,footer:a,graffiti:c},this.listener,this.eventBus,this.override);const u=this.draw;this.command=new Br(new Vg(u)),u.setCommand(this.command);const R=new YT(u,this.command),h=new QT(u,this.command);this.register=new Yg({contextMenu:R,shortcut:h,i18n:u.getI18n()}),this.destroy=()=>{u.destroy(),h.removeEvent(),R.removeEvent(),this.eventBus.dangerouslyClearAll()};const g=new vT(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)}}r.Command=Br,r.EDITOR_CLIPBOARD=On,r.EDITOR_COMPONENT=he,r.Editor=qr,r.INTERNAL_CONTEXT_MENU_KEY=Mn,r.INTERNAL_SHORTCUT_KEY=Ws,r.LETTER_CLASS=So,r.createDomFromElementList=ln,r.default=qr,r.getElementListByHTML=an,r.getTextFromElementList=ke,r.splitText=Tt,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|