ht-emr 0.7.34 → 0.7.35
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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:transparent;display:flex;justify-content:center;align-items:center;z-index:2000}.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:transparent;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:transparent;display:flex;justify-content:center;align-items:center;z-index:2000}.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__container{position:relative;top:auto;left:auto;transform:none;background:#fff;border-radius:8px;box-shadow:0 4px 12px #00000026;min-width:400px;max-width:90vw;max-height:calc(100vh - 48px);display:flex;flex-direction:column;pointer-events:auto}.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}.ce-button-input-modal,.ce-button-edit-modal,.ce-number-input-modal,.tooth-position-edit-modal,.tooth-position-create-modal{inset:0;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box;overflow:auto;background:transparent;pointer-events:none}.ce-button-input-modal__content,.ce-button-edit-modal__content,.ce-number-input-modal__content,.tooth-position-modal__container{pointer-events:auto}.ce-button-input-modal__content,.ce-button-edit-modal__content,.ce-number-input-modal__content{max-height:calc(100vh - 48px);overflow:auto}.tooth-position-modal__mask{display:none}.tooth-position-modal__container{position:relative;top:auto;left:auto;transform:none;display:flex;flex-direction:column;max-height:calc(100vh - 48px)}.ant-modal-mask{display:none!important}.ant-modal-wrap{position:fixed!important;inset:0!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:24px!important;box-sizing:border-box!important;overflow:auto!important;pointer-events:none!important}.ant-modal{top:auto!important;margin:0!important;padding-bottom:0!important;max-width:calc(100vw - 48px)!important;max-height:calc(100vh - 48px)!important;pointer-events:auto!important}.ant-modal-content{max-height:calc(100vh - 48px)!important;overflow:auto!important}.dialog-mask{display:none}.dialog-container{position:fixed;inset:0;overflow:auto;z-index:999;margin:0;padding:24px;box-sizing:border-box;display:flex;justify-content:center;align-items:center;pointer-events:none}.dialog{position:relative;padding:0 30px 30px;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px;max-height:calc(100vh - 48px);overflow:auto;pointer-events:auto}.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(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
const Fs = "0.7.
|
|
2
|
+
const Fs = "0.7.35";
|
|
3
3
|
var Gn;
|
|
4
4
|
(function(o) {
|
|
5
5
|
o.HALF = "half", o.ONE_THIRD = "one-third", o.QUARTER = "quarter";
|
|
@@ -24951,8 +24951,10 @@ class NT {
|
|
|
24951
24951
|
}
|
|
24952
24952
|
if (i?.length) {
|
|
24953
24953
|
let c = t[e];
|
|
24954
|
-
for (let d = 0; d < i.length; d++)
|
|
24955
|
-
|
|
24954
|
+
for (let d = 0; d < i.length; d++) {
|
|
24955
|
+
const R = i[d].value === A && (c?.controlComponent === h.PREFIX || c?.controlComponent === h.PRE_TEXT || c?.controlComponent === h.PRETEXTFIX || c?.controlComponent === h.PRETEXTFIX_TEXT);
|
|
24956
|
+
!i[d].controlComponent && c?.controlComponent && !R && (i[d].controlId = c.controlId, i[d].control = c.control, i[d].controlComponent = c.controlComponent), c = i[d];
|
|
24957
|
+
}
|
|
24956
24958
|
tl(t, e, i);
|
|
24957
24959
|
}
|
|
24958
24960
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
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:transparent;display:flex;justify-content:center;align-items:center;z-index:2000}.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:transparent;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:transparent;display:flex;justify-content:center;align-items:center;z-index:2000}.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__container{position:relative;top:auto;left:auto;transform:none;background:#fff;border-radius:8px;box-shadow:0 4px 12px #00000026;min-width:400px;max-width:90vw;max-height:calc(100vh - 48px);display:flex;flex-direction:column;pointer-events:auto}.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}.ce-button-input-modal,.ce-button-edit-modal,.ce-number-input-modal,.tooth-position-edit-modal,.tooth-position-create-modal{inset:0;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box;overflow:auto;background:transparent;pointer-events:none}.ce-button-input-modal__content,.ce-button-edit-modal__content,.ce-number-input-modal__content,.tooth-position-modal__container{pointer-events:auto}.ce-button-input-modal__content,.ce-button-edit-modal__content,.ce-number-input-modal__content{max-height:calc(100vh - 48px);overflow:auto}.tooth-position-modal__mask{display:none}.tooth-position-modal__container{position:relative;top:auto;left:auto;transform:none;display:flex;flex-direction:column;max-height:calc(100vh - 48px)}.ant-modal-mask{display:none!important}.ant-modal-wrap{position:fixed!important;inset:0!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:24px!important;box-sizing:border-box!important;overflow:auto!important;pointer-events:none!important}.ant-modal{top:auto!important;margin:0!important;padding-bottom:0!important;max-width:calc(100vw - 48px)!important;max-height:calc(100vh - 48px)!important;pointer-events:auto!important}.ant-modal-content{max-height:calc(100vh - 48px)!important;overflow:auto!important}.dialog-mask{display:none}.dialog-container{position:fixed;inset:0;overflow:auto;z-index:999;margin:0;padding:24px;box-sizing:border-box;display:flex;justify-content:center;align-items:center;pointer-events:none}.dialog{position:relative;padding:0 30px 30px;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px;max-height:calc(100vh - 48px);overflow:auto;pointer-events:auto}.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(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
(function(s,pn){typeof exports=="object"&&typeof module<"u"?pn(exports):typeof define=="function"&&define.amd?define(["exports"],pn):(s=typeof globalThis<"u"?globalThis:s||self,pn(s["canvas-editor"]={}))})(this,(function(s){"use strict";const pn="0.7.
|
|
2
|
+
(function(s,pn){typeof exports=="object"&&typeof module<"u"?pn(exports):typeof define=="function"&&define.amd?define(["exports"],pn):(s=typeof globalThis<"u"?globalThis:s||self,pn(s["canvas-editor"]={}))})(this,(function(s){"use strict";const pn="0.7.35";s.MaxHeightRatio=void 0,(function(o){o.HALF="half",o.ONE_THIRD="one-third",o.QUARTER="quarter"})(s.MaxHeightRatio||(s.MaxHeightRatio={})),s.NumberType=void 0,(function(o){o.ARABIC="arabic",o.CHINESE="chinese"})(s.NumberType||(s.NumberType={})),s.ImageDisplay=void 0,(function(o){o.INLINE="inline",o.BLOCK="block",o.SURROUND="surround",o.FLOAT_TOP="float-top",o.FLOAT_BOTTOM="float-bottom"})(s.ImageDisplay||(s.ImageDisplay={})),s.LocationPosition=void 0,(function(o){o.BEFORE="before",o.AFTER="after",o.OUTER_BEFORE="outer-before",o.OUTER_AFTER="outer-after"})(s.LocationPosition||(s.LocationPosition={})),s.FlexDirection=void 0,(function(o){o.ROW="row",o.COLUMN="column"})(s.FlexDirection||(s.FlexDirection={}));const K="",Fs=`
|
|
3
3
|
`,ai=" ",Xs=" ",oa=["·","、",":",":",",",",",".","。",";",";","?","?","!","!"],Ns={[s.MaxHeightRatio.HALF]:1/2,[s.MaxHeightRatio.ONE_THIRD]:1/3,[s.MaxHeightRatio.QUARTER]:1/4},ci={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:"ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"},ia="中";s.RowFlex=void 0,(function(o){o.LEFT="left",o.CENTER="center",o.RIGHT="right",o.ALIGNMENT="alignment",o.JUSTIFY="justify"})(s.RowFlex||(s.RowFlex={}));const di=/[0-9.]/,sa=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,ra=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\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,la=new RegExp(`${ra.source}|${sa.source}`,"g"),aa=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,ui=new RegExp(`^[${K}
|
|
4
4
|
]`),ca=/[^0-9\+\-\.eE,]/,da=/\s/;function ua(o,t){let e;return function(...n){e&&window.clearTimeout(e),e=window.setTimeout(()=>{o.apply(this,n)},t)}}function Ra(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 Ri(o,t){if(!o||typeof o!="object")return o;let e={};return Array.isArray(o)?e=o.map(n=>Ri(n,t)):Object.keys(o).forEach(n=>{t.includes(n)||(e[n]=Ri(o[n],t))}),e}function at(o){if(typeof structuredClone=="function")return structuredClone(o);if(!o||typeof o!="object")return o;let t={};return Array.isArray(o)?t=o.map(e=>at(e)):Object.keys(o).forEach(e=>{t[e]=at(o[e])}),t}function hi(o){return o&&o.nodeType===1&&o.tagName.toLowerCase()==="body"}function ys(o,t,e){if(o&&!hi(o))for(o=o;o;){if(!t||t(o)||hi(o))return t&&!t(o)&&hi(o)?null:o;o=o.parentNode}return null}function mt(){function o(){return((1+Math.random())*65536|0).toString(16).substring(1)}return o()+o()+"-"+o()+"-"+o()+"-"+o()+"-"+o()+o()+o()}function St(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(la))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 bs(o,t){const e=document.createElement("a");e.href=o,e.download=t,e.click()}function ha(o,t){ga(3,o,t)}function ga(o,t,e){let n=0,i=0;const l=function(r){n=new Date().getTime()-i<300?n+1:0,i=new Date().getTime(),n>=o-1&&(e(r),n=0)};t.addEventListener("click",l)}function Eo(o){return Object.prototype.toString.call(o)==="[object Object]"}function gi(o){return Array.isArray(o)}function Ti(o){return Object.prototype.toString.call(o)==="[object Number]"}function Ta(o){return Object.prototype.toString.call(o)==="[object String]"}function Vs(o,t){if(Eo(o)&&Eo(t)){const e=t;for(const[n,i]of Object.entries(o))e[n]?e[n]=Vs(i,e[n]):e[n]=i}else gi(o)&&gi(t)&&t.push(...o);return t}function fi(o){if(typeof queueMicrotask=="function"){queueMicrotask(()=>{o()});return}if(typeof Promise<"u"){Promise.resolve().then(()=>{o()});return}setTimeout(()=>{o()},0)}function fa(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 r=n.length-1-l;i=`${e[l]}${i}`,i=`${t[Number(n[r])]}${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 un(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 Ws(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 xt(o,t){const e={};for(const n in o)t.includes(n)&&(e[n]=o[n]);return e}function Ee(o,t){const e={};for(const n in o)t.includes(n)||(e[n]=o[n]);return e}function ma(o){const e=new TextEncoder().encode(o),n=Array.from(e,l=>String.fromCharCode(l));return window.btoa(n.join(""))}function Ca(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 Ys(o,t){return o.length!==t.length?!1:!o.some(e=>!t.includes(e))}function pa(o,t){if(!Eo(o)||!Eo(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 Ia(o,t){const e=o.x,n=o.x+o.width,i=o.y,l=o.y+o.height,r=t.x,a=t.x+t.width,c=t.y,d=t.y+t.height;return!(e>a||n<r||i>d||l<c)}function Us(o){return o==null}function Lo(o){return o.replace(/\r\n|\r/g,`
|
|
5
5
|
`)}function ws(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",r=new RegExp(t.source,l);r.lastIndex=n;const a=r.exec(o);return a?{index:a.index,length:a[0].length}:{index:-1,length:0}}function Zs(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,r=o.scrollTop,a=r+o.clientHeight;i<r?o.scrollTop=i:l>a&&(o.scrollTop=l-o.clientHeight)}function ie(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function Ea(o,t){return o.performance.enabled&&t>=o.performance.threshold}function mi(o,t,e,n=[],i){if(!Ea(o,e))return;const l={duration:Number(e.toFixed(2)),breakdown:n.map(r=>({label:r.label,duration:Number(r.duration.toFixed(2))})),...i};console.log(`[canvas-editor perf] ${t}`,l)}const La=12,Pa={width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF",dragFloatImageDisabled:!1},ze="editor-component",lt="ce",no=`${lt}-clipboard`,Po={print:{imagePreviewerDisabled:!1,backgroundDisabled:!1},compare:{imagePreviewerDisabled:!1,backgroundDisabled:!1},readonly:{imagePreviewerDisabled:!1},form:{controlDeletableDisabled:!1,inputTraceEnabled:!0,deleteTraceEnabled:!0}};var Jt;(function(o){o.UP="top",o.DOWN="down",o.LEFT="left",o.RIGHT="right"})(Jt||(Jt={}));const In=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),Ma=typeof navigator<"u"&&/iPad|iPhone/.test(navigator.userAgent),Oa=/Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Sa=typeof navigator<"u"&&/Firefox/.test(navigator.userAgent);s.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"})(s.ElementType||(s.ElementType={}));const Ne=["bold","color","highlight","font","size","italic","underline","strikeout","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],le=["rowFlex","rowMargin"],Da=["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"],Fa=["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"],Xa=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],En=["tdId","trId","tableId"],Ci=["level","titleId","title"],bn=["listId","listType","listStyle"],pi=["control","controlId","controlComponent"],Re=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"],Rn=["areaId","area"],Ii=[...En,...Ci,...bn,...Rn],Le=[s.ElementType.TEXT,s.ElementType.HYPERLINK,s.ElementType.SUBSCRIPT,s.ElementType.SUPERSCRIPT,s.ElementType.CONTROL,s.ElementType.DATE],Na=[s.ElementType.IMAGE,s.ElementType.LATEX],ya=[s.ElementType.BLOCK,s.ElementType.PAGE_BREAK,s.ElementType.SEPARATOR,s.ElementType.TABLE],ba=["HR","TABLE","UL","OL"],Va=[s.ElementType.TITLE,s.ElementType.LIST];class Vn{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||Vn.sandbox),n.setAttribute("allow",[e?.allow||Vn.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 vs{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===s.ElementType.TABLE){const l=i.trList;for(let r=0;r<l.length;r++){const a=l[r];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];e(d.value)}}}else i.type===s.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===s.ElementType.TABLE){const l=i.trList;for(const r of l)for(const a of r.tdList)n+=this._countImagesBeforeTarget(a.value,e)}else i.type===s.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(`${lt}-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(),r=this.draw.getPageGap(),a=this.draw.getPageNo()*(l+r),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,r=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${e}" viewBox="0 0 ${t} ${e}">
|
|
@@ -561,7 +561,7 @@ ${h} `}textToElements(t){const e=[],n=t.split(`
|
|
|
561
561
|
<button class="btn-confirm">确定</button>
|
|
562
562
|
</div>
|
|
563
563
|
</div>
|
|
564
|
-
`,document.body.appendChild(a);const c=a.querySelector(".table-properties-modal__mask"),d=a.querySelector(".table-properties-modal__close"),u=a.querySelector(".btn-cancel"),h=a.querySelector(".btn-confirm"),R=()=>{a.remove()};c.addEventListener("click",R),d.addEventListener("click",R),u.addEventListener("click",R),h.addEventListener("click",()=>{const T=parseInt(a.querySelector("#tdPaddingTop").value)||0,g=parseInt(a.querySelector("#tdPaddingRight").value)||0,f=parseInt(a.querySelector("#tdPaddingBottom").value)||0,C=parseInt(a.querySelector("#tdPaddingLeft").value)||0;i.tdPadding=[T,g,f,C],R();const{endIndex:p}=this.range.getRange();this.draw.render({curIndex:p,isCompute:!0})})}}s.AreaMode=void 0,(function(o){o.EDIT="edit",o.READONLY="readonly",o.FORM="form"})(s.AreaMode||(s.AreaMode={}));class wT{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 s.AreaMode.EDIT:return!1;case s.AreaMode.READONLY:return!0;case s.AreaMode.FORM:return!this.draw.getControl().getIsRangeWithinControl();default:return!1}}insertArea(t){const{id:e,value:n,area:i,position:l,range:r}=t;if(this.zone.getZone()!==s.EditorZone.MAIN&&this.zone.setZone(s.EditorZone.MAIN),this.draw.getPosition().setPositionContext({isTable:!1}),r&&!this.getActiveAreaId()){const{startIndex:c,endIndex:d}=r,u=this.draw.getOriginalMainElementList();if(!u[c]||!u[d])return null;this.range.setRange(r.startIndex,r.endIndex)}else if(l===s.LocationPosition.BEFORE)this.range.setRange(0,0);else{const d=this.draw.getOriginalMainElementList().length-1;this.range.setRange(d,d)}const a=e||mt();return this.draw.insertElementList([{type:s.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 l of this.areaInfoMap){const{area:r,positionList:a}=l[1];if(r?.hide||!r?.backgroundColor&&!r?.borderColor&&!r?.placeholder)continue;const c=a.filter(g=>g.pageNo===e);if(!c.length)continue;t.translate(.5,.5);const d=c[0],u=c[c.length-1],h=n[3],R=Math.ceil(d.coordinate.leftTop[1]),T=Math.ceil(u.coordinate.rightBottom[1]-R);t.textBaseline="middle",r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fillRect(h,R,i,T)),r.borderColor&&(t.strokeStyle=r.borderColor,t.strokeRect(h,R,i,T)),r.placeholder&&a.length<=1&&new wl(this.draw).render(t,{placeholder:{...ks,...r.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 r=this.areaInfoMap.get(l);r?(r.elementList.push(i),r.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:Yt(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===s.LocationPosition.OUTER_BEFORE){if(n[i+1]?.areaId!==t)continue}else if(e?.position===s.LocationPosition.AFTER){if(!(l.areaId===t&&n[i+1]?.areaId!==t))continue}else if(e?.position===s.LocationPosition.OUTER_AFTER){if(!(l.areaId!==t&&n[i-1]?.areaId===t))continue}else if(l.areaId!==t)continue;const r=this.position.getOriginalMainPositionList();return{range:{startIndex:i,endIndex:i},elementPosition:r[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(([r,a])=>{if(Us(a))return;const c=r;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(),r=t.value;qt([{type:s.ElementType.AREA,value:"",valueList:r,areaId:n.id,area:n.area}],{editorOptions:this.options}),this.draw.spliceElementList(l,i[0].index,i.length,r,{isIgnoreDeletedRule:!0}),this.draw.render({isSetCursor:!1})}}class ZT{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,r){if(this.imageCache.has(r)){const a=this.imageCache.get(r);t.drawImage(a,e,n,i,l)}else{const a=new Image;a.setAttribute("crossOrigin","Anonymous"),a.src=r,a.onload=()=>{this.imageCache.set(r,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:r,width:a,height:c,value:d}=this.mainBadge,u=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),h=(l||i.left)*n,R=(r||i.top)*n+u;this._drawImage(t,h,R,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 r of n){const{positionList:a}=r[1],c=a[0];if(c.pageNo!==e)continue;const d=this.areaBadgeMap.get(r[0]);if(!d)continue;const{left:u,top:h,width:R,height:T,value:g}=d,f=(u||l.left)*i,C=(h||l.top)*i+c.coordinate.leftTop[1];this._drawImage(t,f,C,R*i,T*i,g)}}}}}class vT{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 r=this.data.find(d=>d.pageNo===l);if(this.startStroke&&(r||(r={pageNo:l,strokes:[]},this.data.push(r)),r.strokes.push(this.startStroke),this.startStroke=null),!r?.strokes?.length)return;const{scale:a}=this.options;r.strokes[r.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:r}=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)*r,t.moveTo(c.points[0]*r,c.points[1]*r);for(let d=2;d<c.points.length;d+=2)t.lineTo(c.points[d]*r,c.points[d+1]*r);t.stroke()}t.restore()}}const Zl=1024,QT=['[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 vl(o,t,e){for(let n=0;n<e.length;n+=Zl){const i=e.slice(n,n+Zl);o.splice(t+n,0,...i)}}class KT{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,r){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=r,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new PT(e.locale),this.historyManager=new Od(this),this.position=new Sd(this),this.zone=new ST(this),this.range=new Dd(this),this.margin=new Nd(this),this.background=new Fd(this),this.badge=new ZT(this),this.search=new yd(this),this.group=new XT(this),this.area=new wT(this),this.underline=new Vd(this),this.strikeout=new bd(this),this.highlight=new Xd(this),this.previewer=new CT(this),this.imageParticle=new vs(this),this.laTexParticle=new Hs(this),this.textParticle=new Wd(this),this.tableParticle=new wd(this),this.tableTool=new Zd(this),this.tableOperate=new UT(this),this.pageNumber=new _n(this),this.lineNumber=new bT(this),this.waterMark=new Gd(this),this.placeholder=new wl(this),this.header=new Hd(this,n.header),this.footer=new DT(this,n.footer),this.hyperlinkParticle=new vd(this),this.labelParticle=new Qd(this),this.macroParticle=new Kd(this),this.dateParticle=new pT(this),this.separatorParticle=new Bd(this),this.pageBreakParticle=new kd(this),this.superscriptParticle=new Ad,this.subscriptParticle=new _d,this.checkboxParticle=new aT(this),this.radioParticle=new cT(this),this.menstrualHistoryParticle=new dT(this),this.fetalHeartPositionParticle=new uT(this),this.toothPositionParticle=new RT(this),this.blockParticle=new ET(this),this.listParticle=new FT(this),this.lineBreakParticle=new Io(this),this.whiteSpaceParticle=new NT(this),this.control=new oT(this),this.pageBorder=new VT(this),this.graffiti=new vT(this,n.graffiti),this.scrollObserver=new Yd(this),this.selectionObserver=new Ud(this),this.imageObserver=new MT,new yT(this),this.canvasEvent=new Pd(this),this.cursor=new Zc(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new Md(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new mT(this),new YT(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.isPrintLikeMode()&&this.setPrintData(),this.mode===s.EditorMode.READONLY&&this.setReadonlyData(),this.mode,s.EditorMode.FORM,this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}setPrintData(){this.printModeData||(this.printModeData=at({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const t=at(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(at(this.printModeData)),this.printModeData=null)}setReadonlyData(){this.readonlyModeData||(this.readonlyModeData=at({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const t=at(this.readonlyModeData);["header","main","footer"].forEach(n=>{const i=Yt(t[n],{editorOptions:this.options});t[n]=wn(i),qt(t[n],{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData(t)}clearReadonlyData(){if(this.readonlyModeData){const t=at(this.readonlyModeData);this.readonlyModeData=null,this.setEditorData(t)}}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}isPrintLikeMode(t=this.mode){return t===s.EditorMode.PRINT||t===s.EditorMode.COMPARE}getIsButtonRowStartPrefix(t,e,n){const i=t[e];if(this.isPrintLikeMode()||i.control?.type!==s.ControlType.BUTTON||i.control.buttonText||i.control.minWidth||i.controlComponent!==s.ControlComponent.PREFIX||!i.value)return!1;const l=t[e+1];return!l||l.controlId!==i.controlId||(l.originControlId||null)!==(i.originControlId||null)||l.controlComponent!==s.ControlComponent.VALUE||l.buttonValueLayout?!1:n.elementList.every(r=>r.value===K||de(r))}getElementLayoutWidth(t){return t.control?.type===s.ControlType.BUTTON&&!t.control.buttonText&&t.controlComponent===s.ControlComponent.PREFIX&&t.left&&t.left<0?Math.max(0,t.metrics.width+t.left):t.metrics.width}isContentReadonly(){if(this.mode===s.EditorMode.COMPARE)return!0;if(this.area.getActiveAreaInfo()?.area?.mode)return this.area.isReadonly();switch(this.mode){case s.EditorMode.DESIGN:return!1;case s.EditorMode.READONLY:case s.EditorMode.PRINT:case s.EditorMode.GRAFFITI:return!0;case s.EditorMode.FORM:if(this.control.getIsRangeWithinControl()){const t=this.getElementList(),{startIndex:e}=this.range.getRange(),n=t[e];if(n?.control?.type===s.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}}isSelectionDisabled(){return this.mode===s.EditorMode.COMPARE?!1:this.area.getActiveAreaInfo()?.area?.mode?this.area.isReadonly():this.mode===s.EditorMode.READONLY||this.mode===s.EditorMode.PRINT||this.mode===s.EditorMode.GRAFFITI}setMode(t){if(this.mode===t)return;const e=this.mode;this.macroParticle.clearInlineEditor({isSubmitHistory:!1}),this.mode=t,this.options.mode=t;const n=this.isPrintLikeMode(t);this.isPrintLikeMode(e)&&this.clearPrintData(),e===s.EditorMode.READONLY&&t!==s.EditorMode.READONLY&&this.clearReadonlyData(),n&&!this.printModeData&&(this.printModeData=at({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const i=new Map,l=a=>{a.forEach(c=>{c.controlId&&(c.controlComponent==="value"&&i.set(c.controlId,!0),c.checked&&i.set(c.controlId,!0))})};l(this.elementList),this.elementList.forEach(a=>{a.type==="table"&&a.trList?.forEach(c=>{c.tdList?.forEach(d=>{l(d.value)})})});const r=a=>{a.forEach(c=>{if(!(!c.control&&!c.controlId)&&(c.controlComponent==="value"&&c.strikeout&&(n?c.hide=!0:c.hide=!1),!!c.control&&!(c.type!=="control"&&c.control.type!=="button"))){if(c.control.type==="TextField"&&(c.controlComponent==="placeholder"||c.controlComponent==="preTextFix"||c.controlComponent==="preTextFixText"||c.controlComponent==="postTextFix"||c.controlComponent==="postTextFixText"||c.controlComponent==="textFixLabel")&&(t===s.EditorMode.EDIT?c.hide=!1:c.hide=!0),c.control.type==="text"&&(c.controlComponent==="placeholder"||c.controlComponent==="prefix"||c.controlComponent==="postfix")&&(t===s.EditorMode.EDIT||t===s.EditorMode.FORM?c.hide=!1:c.hide=!0),c.control.type==="number"||c.control.type==="select"||c.control.type==="date"||c.control.type==="checkbox"||c.control.type==="radio"){if(c.controlComponent==="placeholder"||c.controlComponent==="prefix"||c.controlComponent==="postfix"){const u=i.get(c.controlId);c.control.type==="select"&&n||n&&!u?c.hide=!0:c.hide=!1}c.control.type==="number"&&c.controlComponent==="value"&&(n&&c.strikeout?c.hide=!0:!n&&c.strikeout&&(c.hide=!1))}c.control.type==="button"&&(c.hide=!1,c.control.hide=!1),c.control.type==="menstrualHistory"&&(c.controlComponent==="prefix"||c.controlComponent==="postfix")&&(n?c.hide=!0:c.hide=!1)}})};r(this.elementList),this.elementList.forEach(a=>{a.type==="table"&&a.trList.forEach(c=>{c.tdList.forEach(d=>{r(d.value)})})}),t===s.EditorMode.FORM?(this.elementList.filter(a=>a.type==="control").map(a=>{a.control?.type==="button"&&(a.controlComponent==="prefix"||a.controlComponent==="postfix"?(a.color="#1677FF",a.highlight="transparent"):a.controlComponent==="value"&&(a.color=this.options.defaultColor,a.highlight="transparent"))}),this.hideTextFieldWhitespace(this.elementList,!0),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):t===s.EditorMode.EDIT?(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!1,!0)),n?(this.elementList.filter(a=>a?.control?.type==="button").map(a=>{(a?.controlComponent==="prefix"||a?.controlComponent==="postfix")&&(a.color="transparent",a.highlight="transparent"),a?.controlComponent==="value"&&!a.control.buttonText&&(a.color=this.options.defaultColor,a.highlight="transparent")}),this.setPrintData()):(this.clearPrintData(),this.elementList.filter(a=>a?.control?.type==="button").map(a=>{(a?.controlComponent==="prefix"||a?.controlComponent==="postfix")&&(a.color="#1677FF",a.highlight="transparent"),a?.controlComponent==="value"&&!a.control.buttonText&&(a.color=this.options.defaultColor,a.highlight="transparent"),a?.type==="text"&&a.control.buttonText&&(a.color="#000"),a?.type==="control"&&a?.controlComponent==="value"&&a.control.buttonText&&(a.color="#000",a.highlight="transparent")})),t===s.EditorMode.READONLY&&this.setReadonlyData(),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===s.ElementType.TABLE&&u.trList)for(const h of u.trList)for(const R of h.tdList)i(R.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===s.ElementType.TABLE&&d.trList)for(const u of d.trList)for(const h of u.tdList)this.hideTextFieldWhitespace(h.value,e);d.control?.type===s.ControlType.TEXTFIELD&&d.controlComponent===s.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 r=!1;const a=this.getSubTemplateRuntimeEndIndex(t,e,n.id);if(i&&!n.subTemplateContent?.length&&(i=!1),n.subTemplateExpanded!==i&&(n.subTemplateExpanded=i,r=!0),!!n.hide!==l&&(n.hide=l,r=!0),!i)return a>e+1&&(t.splice(e+1,a-e-1),r=!0),r;if(a===e+1){const c=at(n.subTemplateContent||[]);qt(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),r=!0)}return r}applySubTemplateRuntimeState(t,e){const n=i=>{let l=!1,r=0;for(;r<i.length;){const a=i[r];if(a.type===s.ElementType.SUB_TEMPLATE){const c=!!a.subTemplateConditions?.length;if(this.mode===s.EditorMode.EDIT&&c)l=this.syncSubTemplateExpandedState(i,r,a,!0,!0)||l;else if((this.mode===s.EditorMode.FORM||this.isPrintLikeMode())&&c){const d=e?lT(a.subTemplateConditions,e,a.subTemplateRelation):!1;l=this.syncSubTemplateExpandedState(i,r,a,d,!0)||l}else this.mode!==s.EditorMode.FORM&&!this.isPrintLikeMode()&&(l=this.syncSubTemplateExpandedState(i,r,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===s.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}r++}return l};return n(t)}updateTextFieldPlaceholderVisibility(t,e,n){const i=[s.ControlType.TEXT,s.ControlType.TEXTFIELD,s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.CHECKBOX,s.ControlType.RADIO,s.ControlType.NUMBER];(r=>{let a=0;for(;a<r.length;){const c=r[a];if(c.type===s.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===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PRE_TEXT)){const d=c.controlId,u=c.control.type;let h=!1,R=!1,T=!1;const g=[],f=[],C=[];let p=-1,I=a;for(;I<r.length;){const m=r[I];if(m.controlId!==d){const L=m.controlId;let P=u===s.ControlType.TEXT,M=I;if(P)for(;M<r.length&&r[M].controlId===L;)M++;else for(;M<r.length;){const F=r[M];if(F.controlId!==L)break;F.controlComponent===s.ControlComponent.VALUE&&(F.value&&F.value.trim()||F.type===s.ElementType.MENSTRUAL_HISTORY||F.type===s.ElementType.FETAL_HEART_POSITION||F.type===s.ElementType.TOOTH_POSITION||F.type===s.ElementType.MACRO||F.type===s.ElementType.CUSTOM_MACRO)&&(P=!0),M++}P&&(R=!0),I=M;continue}if((m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&f.push(I),m.controlComponent===s.ControlComponent.VALUE&&m.value&&m.value.trim()&&(h=!0),m.controlComponent===s.ControlComponent.VALUE&&(m.type===s.ElementType.MENSTRUAL_HISTORY||m.type===s.ElementType.FETAL_HEART_POSITION||m.type===s.ElementType.TOOTH_POSITION||m.type===s.ElementType.MACRO||m.type===s.ElementType.CUSTOM_MACRO)&&(h=!0),m.controlComponent===s.ControlComponent.VALUE&&m.control&&m.control.type!==u&&(R=!0),m.controlComponent===s.ControlComponent.PLACEHOLDER&&(T=!0,g.push(I)),m.controlComponent===s.ControlComponent.POSTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){C.push(I),p=I;break}I++}if(h||R){if(T&&g.length>0)for(const m of g)r[m].hide=!0}else if(T&&g.length>0)for(const m of g)r[m].hide=!e;else e&&c.control?.placeholder&&(p>0?this.control.addPlaceholder(p-1):this.control.addPlaceholder(a));if(n)if(e&&(h||R)){for(const m of f)r[m].hide=!0;for(const m of C)r[m].hide=!0}else if(e){for(const m of f)r[m].hide=!1;for(const m of C)r[m].hide=!1}else{for(const m of f)r[m].hide=!0;for(const m of C)r[m].hide=!0}else{for(const m of f)r[m].hide=!1;for(const m of C)r[m].hide=!1}a=I}a++}})(t)}isReadonly(){return this.isContentReadonly()}isDisabled(){if(this.mode===s.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],r=n[t+1];return!!(l?.title?.disabled&&r?.title?.disabled&&l.titleId===r.titleId||l?.control?.disabled&&r?.control?.disabled&&l.controlId===r.controlId)}return n.slice(t+1,e+1).some(l=>l.title?.disabled||l.control?.disabled)}isDesignMode(){return this.mode===s.EditorMode.DESIGN}isPrintMode(){return this.mode===s.EditorMode.PRINT}isGraffitiMode(){return this.mode===s.EditorMode.GRAFFITI}getOriginalWidth(){const{paperDirection:t,width:e,height:n}=this.options;return t===s.PaperDirection.VERTICAL?e:n}getOriginalHeight(){const{paperDirection:t,width:e,height:n}=this.options;return t===s.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,r=this.getOriginalElementList()[e],a=r.trList[n].tdList[i],c=this.getTdPadding(r);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===s.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:!!ys(e,n=>!!n&&n.nodeType===1&&!!n.getAttribute(ze)):!1}isTargetInsideExternalOverlay(t){const e=this.getEventTarget(t);return!e||this.isTargetInsideEditor(e)?!1:!!e.closest(QT)}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:r=!0}=e;qt(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 h=l[u-1];t[0].listId&&h&&!h.listId&&h?.value===K&&(!h.type||h.type===s.ElementType.TEXTFIELD)&&(l.splice(n,1),a-=1)}this.control.destroyControl(),~a&&(this.range.setRange(a,a),this.render({curIndex:a,isSubmitHistory:r}))}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;qt(t,{isHandleFirstElement:!1,editorOptions:this.options});let r=-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,h=c[n],R=c[u],T=M=>!!(M&&(M.controlComponent===s.ControlComponent.POSTFIX||M.controlComponent===s.ControlComponent.POST_TEXT||M.controlComponent===s.ControlComponent.POSTTEXTFIX||M.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)),g=M=>!!(M&&(M.controlComponent===s.ControlComponent.PREFIX||M.controlComponent===s.ControlComponent.PRE_TEXT||M.controlComponent===s.ControlComponent.PRETEXTFIX||M.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)),f=M=>{if(M)return c.find(F=>F.controlId===M&&!F.originControlId&&!!F.control?.type)},C=h?.originControlId&&R?.originControlId===h.originControlId&&h.controlId&&R.controlId&&h.controlId!==R.controlId&&T(h)&&g(R)?f(h.originControlId):void 0,p=C?.control?.type===s.ControlType.TEXTFIELD,I=!!(h?.originControlId&&T(h)&&R?.controlId===h.originControlId&&!R.originControlId&&R.control?.type===s.ControlType.TEXTFIELD&&T(R)),m=!!(h?.originControlId&&T(h)&&R?.controlId===h.originControlId&&!R.originControlId&&R.control?.type===s.ControlType.TEXTFIELD&&R.controlComponent===s.ControlComponent.VALUE);if(h?.controlComponent===s.ControlComponent.PRE_TEXT||h?.controlComponent===s.ControlComponent.POST_TEXT||h?.controlComponent===s.ControlComponent.PREFIX||h?.controlComponent===s.ControlComponent.POSTFIX)for(let M=0;M<t.length;M++)t[M].control||(t[M].color=this.options.defaultColor);d&&!I&&!m&&(c[n]?.control?.type===s.ControlType.TEXTFIELD||c[n]?.control?.type===s.ControlType.TEXT)&&this.control.removePlaceholder(n),d||this.newSpliceElementList(c,u,i-n);const P=I||m||p?h.originControlId:c[n]?.controlId||c[n-1]?.controlId||c[n+1]?.controlId;for(let M=0;M<t.length;M++){if((I||m||p)&&!t[M].control&&(t[M].controlId=P,t[M].control=p?C?.control:R.control,t[M].controlComponent=s.ControlComponent.VALUE,delete t[M].originControlId),t[M]?.control?.type=="button"&&!t[M]?.control?.buttonText&&(t[M]?.controlComponent==="prefix"||t[M]?.controlComponent==="postfix"?(t[M].color="#1677FF",t[M].highlight="transparent"):(t[M].color=this.options.defaultColor,t[M].highlight="transparent")),t[M]?.type===s.ElementType.MENSTRUAL_HISTORY||t[M]?.type===s.ElementType.FETAL_HEART_POSITION||t[M]?.type===s.ElementType.TOOTH_POSITION||t[M]?.type===s.ElementType.MACRO||t[M]?.type===s.ElementType.CUSTOM_MACRO||t[M]?.type===s.ElementType.REUSABLE_ITEM||t[M]?.type===s.ElementType.SUB_TEMPLATE||t[M]?.type===s.ElementType.SPECIAL_SYMBOLS){t[M].controlComponent=s.ControlComponent.VALUE;let F=c[n]?.controlId;F||(F=c[n-1]?.controlId),F||(F=c[n+1]?.controlId),!t[M].controlId&&F&&(t[M].controlId=F)}P&&t[M]?.control&&t[M].controlId&&t[M].controlId!==P&&(t[M].originControlId=P)}this.newSpliceElementList(c,u,0,t),r=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 h=0;h<t.length;h++)if(t[h]?.type===s.ElementType.MENSTRUAL_HISTORY||t[h]?.type===s.ElementType.FETAL_HEART_POSITION||t[h]?.type===s.ElementType.TOOTH_POSITION||t[h]?.type===s.ElementType.MACRO||t[h]?.type===s.ElementType.CUSTOM_MACRO||t[h]?.type===s.ElementType.REUSABLE_ITEM||t[h]?.type===s.ElementType.SUB_TEMPLATE||t[h]?.type===s.ElementType.SPECIAL_SYMBOLS){t[h].controlComponent=s.ControlComponent.VALUE;const R=c[n]?.controlId||c[u]?.controlId;!t[h].controlId&&R&&(t[h].controlId=R)}this.newSpliceElementList(c,u,0,t),r=n+t.length}else{d||this.spliceElementList(c,u,i-n);for(let R=0;R<t.length;R++)t[R]?.control?.type=="button"&&!t[R]?.control?.buttonText&&(t[R]?.controlComponent==="prefix"||t[R]?.controlComponent==="postfix"?(t[R].color="#1677FF",t[R].highlight="transparent"):(t[R].color=this.options.defaultColor,t[R].highlight="transparent"));this.spliceElementList(c,u,0,t),r=n+t.length;const h=c[u-1];t[0].listId&&h&&!h.listId&&h?.value===K&&(!h.type||h.type===s.ElementType.TEXT)&&(c.splice(n,1),r-=1)}}~r&&(this.range.setRange(r,r),this.render({curIndex:r,isSubmitHistory:l}))}appendElementList(t,e={}){if(!t.length)return;qt(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:r=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const d=e+n,h=t[d]?.listId;if(h&&t[e-1]?.listId!==h){let R=d;for(;R<t.length;){const T=t[R];if(T.listId!==h||T.value===K)break;delete T.listId,delete T.listType,delete T.listStyle,R++}}if(!r&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const R=this.getTd()?.deletable;let T=d-1;for(;T>=e;){const g=t[T];(de(g)||R!==!1&&g?.control?.deletable!==!1&&(!g.controlId||this.mode!==s.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&g?.title?.deletable!==!1&&(a.deletable!==!1||!g.groupIds?.length)&&(g?.area?.deletable!==!1||g?.areaIndex!==0))&&t.splice(T,1),T--}}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];vl(t,e,i)}}newSpliceElementList(t,e,n,i,l){const{isIgnoreDeletedRule:r=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const u=e+n,R=t[u]?.listId;if(R&&t[e-1]?.listId!==R){let T=u;for(;T<t.length;){const g=t[T];if(g.listId!==R||g.value===K)break;delete g.listId,delete g.listType,delete g.listStyle,T++}}if(!r&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const T=this.getTd()?.deletable;let g=u-1;for(;g>=e;){const f=t[g];(de(f)||T!==!1&&f?.control?.deletable!==!1&&(!f.controlId||this.mode!==s.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)}const d=t[e]?.controlId;if(i?.length){for(let u=0;u<i.length;u++)d&&i[u].controlId!==d&&(i[u].originControlId=d);vl(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 r=this.pageList.map(a=>a.toDataURL());return e&&this.setPagePixelRatio(null),l&&this.setMode(i),r}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===s.PageMode.PAGING}setPageMode(t){if(!t||this.options.pageMode===t)return;if(this.options.pageMode=t,t===s.PageMode.PAGING){const{height:i}=this.options,l=this.getPagePixelRatio(),r=this.pageList[0];r.style.height=`${i}px`,r.height=i*l,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(s.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((r,a)=>{r.width=n*e,r.height=i*e,r.style.width=`${n}px`,r.style.height=`${i}px`,r.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((r,a)=>{r.width=i*n,r.height=l*n,r.style.width=`${i}px`,r.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,r)=>{l.width=n*e,l.height=i*e,l.style.width=`${n}px`,l.style.height=`${i}px`,this._initPageContext(this.ctxList[r])}),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(r=>r.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:Yt(e.header,{extraPickAttrs:n,editorOptions:this.options}),main:Yt(e.main,{extraPickAttrs:n,isClassifyArea:!0,editorOptions:this.options}),footer:Yt(e.footer,{extraPickAttrs:n,editorOptions:this.options}),graffiti:e.graffiti};return{version:pn,data:i,options:at(this.options)}}setValue(t,e){const{header:n,main:i,footer:l}=at(t);if(!n&&!i&&!l)return;const{isSetCursor:r=!1}=e||{};[n,i,l].forEach(d=>{d&&qt(d,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:n,main:i,footer:l}),this.mode===s.EditorMode.READONLY?(this.readonlyModeData=null,this.setReadonlyData()):this.isPrintLikeMode()&&(this.printModeData=null,this.setPrintData()),this.historyManager.recovery();const c=r?i?.length?i.length-1:0:void 0;c!==void 0&&this.range.setRange(c,c),this.render({curIndex:c,isSetCursor:r,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(ze,s.EditorComponent.MAIN)}_createPageContainer(){const t=document.createElement("div");return t.classList.add(`${lt}-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 r=i.getContext("2d");this._initPageContext(r),this.pageList.push(i),this.ctxList.push(r)}_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,r=t.actualSize||t.size||n;return`${t.italic?"italic ":""}${t.bold?"bold ":""}${r*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,r=t.size||e;let a=1;return r<12?a=r/12:r>30&&(a=1+(r-30)/30),n*a*(t.rowMargin??i)*l}computeRowList(t){const{innerWidth:e,elementList:n,isPagingMode:i=!1,isFromTable:l=!1,startX:r=0,startY:a=0,pageHeight:c=0,mainOuterHeight:d=0,surroundElementList:u=[]}=t,{defaultSize:h,scale:R,imgCaption:T,table:{tdPadding:g,defaultTrMinHeight:f},defaultTabWidth:C}=this.options,p=this.getDefaultBasicRowMarginHeight(),m=document.createElement("canvas").getContext("2d"),L=this.listParticle.computeListStyle(m,n),P=[],M=this._collectTextControlValueSet(n),F=this._collectTextControlHasContentSet(n);n.length&&P.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:n?.[0]?.rowFlex||n?.[1]?.rowFlex});let y=r,Y=a,V=0,S,N=0,b=0;for(let X=0;X<n.length;X++){const O=P[P.length-1],E=n[X];this.clearElementEffect(E);const W=this.getElementRowMargin(E),D={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},U=O.offsetX||E.listId&&L.get(E.listId)||0,v=e-U,Q=O.elementList.length===1;if(y+=Q?U:0,Y+=Q&&O.offsetY||0,(E.control?.type===s.ControlType.TEXTFIELD||E.control?.type===s.ControlType.TEXT)&&!this.isDesignMode()&&(E.controlComponent===s.ControlComponent.PRETEXTFIX||E.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||E.controlComponent===s.ControlComponent.TEXTFIXLABEL||E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.PREFIX||E.controlComponent===s.ControlComponent.POSTFIX)){const nt=E.control?.type===s.ControlType.TEXTFIELD,J=E.controlId,_=!!J&&!!M?.has(J);if(nt){const B=!!J&&!!F?.has(J);this.mode===s.EditorMode.EDIT?E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.TEXTFIXLABEL?E.hide=B:E.hide=!1:E.hide=!0}else{const B=!!J&&!!F?.has(J);this.mode===s.EditorMode.EDIT||this.mode===s.EditorMode.FORM?E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.TEXTFIXLABEL?E.hide=B:E.hide=!1:E.hide=!0}}if(de(E)&&!this.isDesignMode()){const nt=O.elementList[O.elementList.length-1];D.height=nt?.metrics.height||this.options.defaultSize*R,D.boundingBoxAscent=nt?.metrics.boundingBoxAscent||0,D.boundingBoxDescent=nt?.metrics.boundingBoxDescent||0}else if(E.type===s.ElementType.IMAGE||E.type===s.ElementType.LATEX)if(E.imgDisplay===s.ImageDisplay.SURROUND||E.imgDisplay===s.ImageDisplay.FLOAT_TOP||E.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)D.width=0,D.height=0,D.boundingBoxDescent=0;else{const nt=E.width*R,J=E.height*R;if(nt>v){const _=J*v/nt;E.width=v/R,E.height=_/R,D.width=v,D.height=_,D.boundingBoxDescent=_}else D.width=nt,D.height=J,D.boundingBoxDescent=J;if(E.imgCaption?.value){const _=E.imgCaption.size||T.size,B=E.imgCaption.top??T.top,st=(_+B)*R;D.boundingBoxAscent+=st}}else if(E.type===s.ElementType.TABLE){const nt=E.tdPadding||g;if(E.pagingId){let z=X+1,ut=0;for(;z<n.length;){const Rt=n[z];if(Rt.pagingId===E.pagingId){const Dt=Rt.trList.filter(Xt=>!Xt.pagingRepeat).filter(Xt=>(Xt.tdList=Xt.tdList.filter(At=>{if(At.originalId){for(let Ft=0;Ft<E.trList.length;Ft++){const Bt=E.trList[Ft],_t=Bt.tdList.find(({id:re})=>re===At.originalId);if(_t){At.value[0]?.type===s.ElementType.SPLIT_TAG&&At.value.splice(0,1),_t.value.push(...At.value.map(re=>this.updateElementTableInfo(re,E,Bt,_t))),_t.rowspan=_t.originalRowspan??_t.rowspan;break}}return!1}return!0}),!Xt.originalId));E.trList.push(...Dt),E.height+=Rt.height,z++,ut++}else break}ut&&n.splice(X+1,ut)}E.pagingIndex=E.pagingIndex??0,this.tableParticle.computeTrHeight(E,z=>this.computeRowList({innerWidth:(z.width-(nt[1]+nt[3]))*R,elementList:z.value,isFromTable:!0,isPagingMode:i})),E.trList?.forEach(z=>{z.tdList.forEach(ut=>{this.tdMap.set(ut.id,ut)})});const J=this.tableParticle.getTableHeight(E),_=this.tableParticle.getTableWidth(E);E.width=_,E.height=J;const B=_*R,st=J*R;if(D.width=B,D.height=st,D.boundingBoxDescent=st,D.boundingBoxAscent=-W,n[X+1]?.type===s.ElementType.TABLE&&(D.boundingBoxAscent-=W),i){const z=this.getHeight(),ut=this.getMainOuterHeight();let Rt=ut;for(let Ft=0;Ft<P.length;Ft++){const Bt=P[Ft],_t=Bt.offsetY||0;Bt.height+Rt+_t>z||P[Ft-1]?.isPageBreak?Rt=ut+Bt.height+_t:Rt+=Bt.height+_t}const Dt=W*2,Xt=E.trList[0].height*R;(Rt+Xt+Dt>z||E.pagingIndex!==0&&E.trList[0].pagingRepeat||n[X-1]?.type===s.ElementType.PAGE_BREAK)&&(Rt=ut);let At=z-(Rt+Dt);if(st>At){const Ft=E.trList;let Bt=0,_t=0,re=0;for(let Tt=0;Tt<Ft.length;Tt++){const Lt=Ft[Tt],Vt=Lt.height*R;if(Rt+Dt+re+Vt>z){const Pt=Lt;let Et=0;const Mt={...at(Pt),id:mt(),originalId:Pt.originalId??Pt.id,minHeight:void 0,tdList:E.colgroup.map((ft,It)=>{if(Et--,Et>0)return;const gt=Pt.tdList.find($t=>$t.colIndex===It),j=gt??this.tableParticle.findPreRowSpanTd(Ft,Tt,It);gt&&(Et=gt.colspan);const q=mt();return j.originalRowspan=j.rowspan,gt?{...gt,id:q,originalId:gt.originalId??gt.id,linkTdPrevId:gt.id,tdIndex:It,original:j}:{id:q,originalId:j.originalId??j.id,linkTdPrevId:j.id,tdIndex:It,colIndex:It,colspan:1,rowspan:1,value:[],rowList:[],original:j}}).filter(ft=>!!ft)},Zt=Mt.tdList,ce=Zt.map(ft=>ft.original);ce.forEach((ft,It)=>{const gt=[];let j=At;if(ft.rowspan>1){const $t=Ft.slice(ft.trIndex,ft.trIndex+Tt-ft.trIndex);j+=$t.reduce((Te,me)=>me.height*R+Te,0)}for(;ft.mainHeight*R>j&&ft.rowList?.length;){const $t=ft.rowList.pop();ft.value.splice(ft.value.length-$t.elementList.length),gt.unshift($t),ft.mainHeight-=$t.height}const q=Zt[It];q.rowList=gt,q.value=gt.map($t=>$t.elementList).flat()});let Ct=!0;const it=Pt.tdList.some(ft=>ft.rowList?.length),vt=Mt.tdList.some(ft=>ft.rowList?.length),Nt=Pt.minHeight>At;if(vt||Nt){(it||!vt&&Nt)&&(Nt&&(Pt.originalMinHeight=Pt.minHeight,Pt.minHeight=At,Mt.minHeight=Math.max(Pt.originalMinHeight-At,f)),Mt.tdList.forEach(ft=>{ft.original.linkTdNextId=ft.id,ft.value.length&&ft.value[0].value!==K&&ft.value.unshift({...ft.original.value.slice(-1).pop(),value:K,type:s.ElementType.SPLIT_TAG})}),Ft.splice(Bt+1,0,Mt),Bt+=1,_t=Ft.length-Bt,Ct=!1),ce.forEach(ft=>{if(ft.rowspan>1){const It=ft.rowspan-(Tt-ft.trIndex);ft.rowspan=Tt-ft.trIndex+(it?1:0);const gt=Mt.tdList.find(j=>j.colIndex===ft.colIndex);it?gt.rowspan=It:(gt.original.linkTdNextId=gt.id,Pt.tdList.push({...ft,...gt,rowspan:It}),Pt.tdList.sort((j,q)=>j.colIndex-q.colIndex),gt.value=[])}}),Ct&&ce.forEach((ft,It)=>{ft.value.push(...Zt[It].value)});break}}Bt=Tt+1,_t=Ft.length-Bt,re+=Vt,At-=Vt}if(_t){const Tt=Ft.splice(Bt,_t),Lt=E.pagingId||mt();E.pagingId=Lt;const Vt=at(E);Vt.originalId=E.originalId??E.id,Vt.pagingId=Lt,Vt.pagingIndex=E.pagingIndex+1;const Pt=Ft.filter(Zt=>Zt.pagingRepeat);if(Pt.length){const Zt=at(Pt);Zt.forEach(ce=>ce.id=mt()),Tt.unshift(...Zt)}Vt.trList=Tt,Vt.id=mt(),Vt.trList?.forEach(Zt=>{Zt.tdList.forEach(ce=>{if(delete ce.valueStartIndex,ce.linkTdPrevId){const Ct=this.getTdById(ce.linkTdPrevId);ce.valueStartIndex=Ct?(Ct.valueStartIndex??0)+Ct.value.length:0,this.splitTdValueMap.has(ce.originalId)?this.splitTdValueMap.get(ce.originalId).push(...ce.value):Ct&&this.splitTdValueMap.set(ce.originalId,[...Ct.value,...ce.value])}ce.value.forEach(Ct=>this.updateElementTableInfo(Ct,Vt,Zt,ce))})}),this.spliceElementList(n,X+1,0,[Vt]),this.tableParticle.computeTrHeight(E);const Et=this.tableParticle.getTableHeight(E),Mt=Et*R;E.height=Et,D.height=Mt,D.boundingBoxDescent=Mt}}if(E.pagingId){const Ft=this.position.getPositionContext();if(Ft.isTable){let Bt=-1,_t=-1,re=X;for(;re<n.length;){const Tt=n[re];if(Tt.pagingId!==E.pagingId)break;const Lt=Tt.trList.findIndex(Vt=>Vt.id===Ft.trId);if(~Lt){Bt=re,_t=Lt;break}re++}~Bt&&(Ft.index=Bt,Ft.trIndex=_t,this.position.setPositionContext(Ft))}}}this.initTableElementIndex(E,X)}else if(E.type===s.ElementType.SEPARATOR){const{separator:{lineWidth:nt}}=this.options,J=E.lineWidth||nt;E.width=v/R,D.width=v,D.height=J*R,D.boundingBoxAscent=-W,D.boundingBoxDescent=-W+D.height}else if(E.type===s.ElementType.PAGE_BREAK)E.width=v/R,D.width=v,D.height=h;else if(E.type===s.ElementType.RADIO||E.controlComponent===s.ControlComponent.RADIO){const{width:nt,height:J,gap:_}=this.options.radio,B=nt+_*(E.controlComponent?1:2);E.width=B,D.width=B*R,D.height=J*R}else if(E.type===s.ElementType.CHECKBOX||E.controlComponent===s.ControlComponent.CHECKBOX){const{width:nt,height:J,gap:_}=this.options.checkbox,B=nt+_*(E.controlComponent?1:2);E.width=B,D.width=B*R,D.height=J*R}else if(E.type===s.ElementType.MENSTRUAL_HISTORY){const nt=this.menstrualHistoryParticle.computeSize(E);E.width=nt.width/R,D.width=nt.width,D.height=nt.height,D.boundingBoxAscent=nt.height,D.boundingBoxDescent=0}else if(E.type===s.ElementType.FETAL_HEART_POSITION){const nt=this.fetalHeartPositionParticle.computeSize();E.width=nt.width/R,D.width=nt.width,D.height=nt.height,D.boundingBoxAscent=nt.height/2,D.boundingBoxDescent=nt.height/2}else if(E.type===s.ElementType.TOOTH_POSITION){const nt=this.toothPositionParticle.computeSize(E);E.width=nt.width/R,D.width=nt.width,D.height=nt.height,D.boundingBoxAscent=nt.height/2,D.boundingBoxDescent=nt.height/2}else if(E.type===s.ElementType.TAB)D.width=C*R,D.height=h*R,D.boundingBoxDescent=0,D.boundingBoxAscent=this.textParticle.getBasisWordBoundingBoxAscent(m,m.font);else if(E.type===s.ElementType.BLOCK){if(!E.width)D.width=v;else{const nt=E.width*R;D.width=Math.min(nt,v)}D.height=E.height*R,D.boundingBoxDescent=D.height,D.boundingBoxAscent=0}else if(E.type===s.ElementType.LABEL){const{defaultSize:nt,label:{defaultPadding:J}}=this.options;m.font=this.getElementFont(E);const _=this.textParticle.measureText(m,E);D.width=(_.width+J[1]+J[3])*R,D.height=(E.size||nt)*R,D.boundingBoxDescent=0,D.boundingBoxAscent=(J[0]+_.actualBoundingBoxAscent)*R}else if(E.type===s.ElementType.MACRO||E.type===s.ElementType.CUSTOM_MACRO||E.type===s.ElementType.REUSABLE_ITEM||E.type===s.ElementType.SUB_TEMPLATE){const{defaultSize:nt}=this.options;m.font=this.getElementFont(E);const J=this.getMode(),_=J===s.EditorMode.EDIT,B=J===s.EditorMode.FORM;if(J===s.EditorMode.READONLY&&E.type!==s.ElementType.SUB_TEMPLATE){const st=No(E),z=m.measureText(st);D.width=z.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=z.actualBoundingBoxDescent,D.boundingBoxAscent=z.actualBoundingBoxAscent}else if(_){const st=E.label||E.value||"";m.font=this.getElementFont(E);const z=m.measureText(st),ut=8*R,Rt=4*R;D.width=z.width+ut*2;const Dt=z.actualBoundingBoxAscent+z.actualBoundingBoxDescent;D.height=Dt+Rt*2;const Xt=this.textParticle.measureBasisWord(m,this.getElementFont(E));D.boundingBoxAscent=Xt.actualBoundingBoxAscent*R,D.boundingBoxDescent=Xt.actualBoundingBoxDescent*R}else if(E.type===s.ElementType.CUSTOM_MACRO){const st=E.macroConfig,z=st?.value||"";if(B){const ut=st?.type||"text",Rt=this.textParticle.measureText(m,E),Dt=E.label||"";if(ut==="select"){const Xt=z||`请选择${Dt}`,At=m.measureText(Xt),Ft=m.measureText("[").width,Bt=6*R+2*R;D.width=Ft+At.width+Bt+Ft}else{const Xt=z||`请输入${Dt}`,At=m.measureText(Xt),Ft=m.measureText("[").width;D.width=Ft+At.width+Ft}D.height=(E.size||nt)*R,D.boundingBoxDescent=Rt.actualBoundingBoxDescent*R,D.boundingBoxAscent=Rt.actualBoundingBoxAscent*R}else{const ut=E.label||"",Rt=z||`请输入${ut}`,Dt=m.measureText(Rt);D.width=Dt.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=Dt.actualBoundingBoxDescent,D.boundingBoxAscent=Dt.actualBoundingBoxAscent}}else if(E.type===s.ElementType.REUSABLE_ITEM){const z=E.reusableItemConfig?.value||"",ut=E.label||"";if(B){const Rt=this.textParticle.measureText(m,E),Dt=z||`获取 ${ut}`,Xt=m.measureText(Dt),At=m.measureText("[").width;D.width=At+Xt.width+At,D.height=(E.size||nt)*R,D.boundingBoxDescent=Rt.actualBoundingBoxDescent*R,D.boundingBoxAscent=Rt.actualBoundingBoxAscent*R}else{const Rt=z||`获取 ${ut}`,Dt=m.measureText(Rt);D.width=Dt.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=Dt.actualBoundingBoxDescent,D.boundingBoxAscent=Dt.actualBoundingBoxAscent}}else if(E.type===s.ElementType.SUB_TEMPLATE){const st=E.label||"子模板";if(B){const z=m.measureText(st),ut=8*R,Rt=4*R,Dt=z.actualBoundingBoxAscent+z.actualBoundingBoxDescent;D.width=z.width+ut*2,D.height=Dt+Rt*2;const Xt=this.textParticle.measureBasisWord(m,this.getElementFont(E));D.boundingBoxAscent=Xt.actualBoundingBoxAscent*R,D.boundingBoxDescent=Xt.actualBoundingBoxDescent*R}else{const z=m.measureText(st);D.width=z.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=z.actualBoundingBoxDescent,D.boundingBoxAscent=z.actualBoundingBoxAscent}}else{const st=E.label||"",z=E.value||`获取 ${st}`,ut=m.measureText(z);D.width=ut.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=ut.actualBoundingBoxDescent,D.boundingBoxAscent=ut.actualBoundingBoxAscent}}else{const nt=E.size||h;(E.type===s.ElementType.SUPERSCRIPT||E.type===s.ElementType.SUBSCRIPT)&&(E.actualSize=Math.ceil(nt*.6)),D.height=(E.actualSize||nt)*R,m.font=this.getElementFont(E);const J=this.textParticle.measureText(m,E),_=E.buttonValueLayoutPrefixOffset?m.measureText("[").width:0;D.width=Math.max(0,J.width-_)*R,E.letterSpacing&&(D.width+=E.letterSpacing*R);const B=this.textParticle.measureBasisWord(m,E.font);D.boundingBoxAscent=B.actualBoundingBoxAscent*R,D.boundingBoxDescent=B.actualBoundingBoxDescent*R,E.type===s.ElementType.SUPERSCRIPT?D.boundingBoxAscent+=D.height/2:E.type===s.ElementType.SUBSCRIPT&&(D.boundingBoxDescent+=D.height/2)}const w=!de(E)&&(E.imgDisplay!==s.ImageDisplay.INLINE&&E.type===s.ElementType.IMAGE||E.type===s.ElementType.LATEX)?D.height+W:D.boundingBoxAscent+W,et=W+D.boundingBoxAscent+D.boundingBoxDescent+W,G=Object.assign(E,{metrics:D,left:0,style:this.getElementFont(E,R)});this.getIsButtonRowStartPrefix(n,X,O)&&(G.left=-D.width);const A=this.getElementLayoutWidth(G);G.control?.minWidth&&(G.controlComponent&&(b+=D.width),G.controlComponent===s.ControlComponent.POSTFIX&&(this.control.setMinWidthControlInfo({row:O,rowElement:G,availableWidth:v,controlRealWidth:b}),b=0));const k=n[X-1];let tt=n[X+1],x=O.width+A;if(this.options.wordBreak===s.WordBreak.BREAK_WORD&&(!k?.type||k?.type===s.ElementType.TEXT)&&(!E.type||E.type===s.ElementType.TEXT)){const nt=`${k?.value||""}${E.value}`;if(this.WORD_LIKE_REG.test(nt)){const{width:_,endElement:B}=this.textParticle.measureWord(m,n,X),st=_*R;B&&st<=v?(x+=st,tt=B):k&&(x+=st)}const J=this.textParticle.measurePunctuationWidth(m,tt);x+=J*R}E.listId&&(E.listId!==S?N=0:E.value===K&&!E.listWrap&&N++),S=E.listId;const yt=this.position.setSurroundPosition({pageNo:V,rowElement:G,row:O,rowElementRect:{x:y,y:Y,height:et,width:A},availableWidth:v,surroundElementList:u});y=yt.x,x+=yt.rowIncreaseWidth,y+=A;let wt=!1;if(this.mode===s.EditorMode.FORM&&E.control?.type===s.ControlType.BUTTON&&E.controlComponent===s.ControlComponent.PREFIX&&O.elementList.filter(nt=>nt.controlId!==E.controlId).length>0){const nt=E.controlId;if(n.some(_=>_.controlId===`${nt}_text`&&_.control?.type===s.ControlType.BUTTON)){let _=0;for(let B=X;B<n.length;B++){const st=n[B];if(st.controlId!==nt)break;m.font=this.getElementFont(st);const z=this.textParticle.measureText(m,st);if(_+=z.width*R,st.controlComponent===s.ControlComponent.POSTFIX)break}for(let B=0;B<n.length;B++){const st=n[B];if(st.controlId===`${nt}_text`){m.font=this.getElementFont(st);const z=this.textParticle.measureText(m,st);_+=z.width*R}}wt=O.width+_>v}}const Ie=E.type===s.ElementType.SEPARATOR||E.type===s.ElementType.TABLE||k?.type===s.ElementType.TABLE||k?.type===s.ElementType.BLOCK||E.type===s.ElementType.BLOCK||k?.imgDisplay===s.ImageDisplay.INLINE||E.imgDisplay===s.ImageDisplay.INLINE||k?.listId!==E.listId||k?.areaId!==E.areaId&&!E.area?.hide||E.control?.flexDirection===s.FlexDirection.COLUMN&&(E.controlComponent===s.ControlComponent.CHECKBOX||E.controlComponent===s.ControlComponent.RADIO)&&k?.controlComponent===s.ControlComponent.VALUE||X!==0&&E.value===K&&!E.area?.hide||wt,ne=x>v,ue=Ie||ne;if(ue){const nt={width:A,height:et,startIndex:X,elementList:[G],ascent:w,rowIndex:O.rowIndex+1,rowFlex:n[X]?.rowFlex||n[X+1]?.rowFlex,isPageBreak:E.type===s.ElementType.PAGE_BREAK};if(G.controlComponent!==s.ControlComponent.PREFIX&&G.control?.indentation===s.ControlIndentation.VALUE_START){const J=O.elementList.findIndex(_=>_.controlId===G.controlId&&_.controlComponent!==s.ControlComponent.PREFIX);if(~J){const B=this.position.computeRowPosition({row:O,innerWidth:this.getInnerWidth()})[J];B&&(nt.offsetX=B.coordinate.leftTop[0])}}E.listId&&(nt.isList=!0,nt.offsetX=L.get(E.listId),nt.listIndex=N),nt.offsetY=!l&&E.area?.top&&E.areaId!==n[X-1]?.areaId?E.area.top*R:0,P.push(nt)}else O.width+=A,X===0&&(Kn(n[1])||n[1]?.areaId)?(O.height=p,O.ascent=p):O.height<et&&(O.height=et,O.ascent=w),O.elementList.push(G);if((ue||X===n.length-1)&&(O.isWidthNotEnough=ne&&!Ie,!O.isSurround&&(k?.rowFlex===s.RowFlex.JUSTIFY||k?.rowFlex===s.RowFlex.ALIGNMENT&&O.isWidthNotEnough))){const nt=O.elementList[0]?.value===K?O.elementList.slice(1):O.elementList,J=(v-O.width)/(nt.length-1);for(let _=0;_<nt.length-1;_++){const B=nt[_];B.metrics.width+=J}O.width=v}if(ue){y=r,Y+=O.height,i&&!l&&c&&(Y-a+d+et>c||E.type===s.ElementType.PAGE_BREAK)&&(Y=a,Xc(u,V),V+=1),G.left=0;const nt=P[P.length-1];y=this.position.setSurroundPosition({pageNo:V,rowElement:G,row:nt,rowElementRect:{x:y,y:Y,height:et,width:A},availableWidth:v,surroundElementList:u}).x,y+=A}}return P}_collectTextControlValueSet(t){if(this.isDesignMode()||this.mode===s.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===s.ControlType.TEXT||l.control?.type===s.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===s.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===s.ControlType.TEXT||i.control?.type===s.ControlType.TEXTFIELD)&&(i.controlComponent===s.ControlComponent.PREFIX||i.controlComponent===s.ControlComponent.PRE_TEXT||i.controlComponent===s.ControlComponent.PRETEXTFIX||i.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){const l=i.controlId;let r=!1,a=n+1;for(;a<t.length;){const c=t[a];if(c.controlId===l&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))break;if(c.controlId===l&&c.controlComponent===s.ControlComponent.VALUE&&(r=!0),c.controlId!==l&&c.controlId){(i.control?.type===s.ControlType.TEXT||c.controlComponent===s.ControlComponent.VALUE)&&(r=!0);const d=c.controlId;for(a++;a<t.length&&t[a].controlId===d;)a++;continue}a++}r&&e.add(l)}n++}return e}_computePageList(){const t=[[]],{pageMode:e,pageNumber:{maxPageNo:n}}=this.options,i=this.getHeight(),l=this.getMainOuterHeight();let r=l,a=0;if(e===s.PageMode.CONTINUITY){t[0]=this.rowList,r+=this.rowList.reduce((h,R)=>h+R.height+(R.offsetY||0),0);const c=this.getPagePixelRatio(),d=this.pageList[0],u=Number(d.style.height.replace("px",""));if(r>u)d.style.height=`${r}px`,d.height=r*c;else{const h=r<i?i:r;d.style.height=`${h}px`,d.height=h*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+r>i||this.rowList[c-1]?.isPageBreak){if(Number.isInteger(n)&&a>=n){this.elementList=this.elementList.slice(0,d.startIndex);break}r=l+d.height+u,t.push([d]),a++}else r+=d.height+u,t[a].push(d)}return t}_drawHighlight(t,e){const{rowList:n,positionList:i,elementList:l}=e,r=this.getDefaultBasicRowMarginHeight(),a=this.getHighlightMarginHeight();for(let c=0;c<n.length;c++){const d=n[c];let u="";for(let h=0;h<d.elementList.length;h++){const R=d.elementList[h],T=d.startIndex+h,g=l[T]===R?T:l.indexOf(R),f=~g?g:T,C=this.control.getControlHighlight(l,f),p=R.highlight||C;if(p){u&&u!==p&&this.highlight.render(t);const I=i[f],{coordinate:{leftTop:[m,L]}}=I,P=R.left||0,M=!R.highlight&&!!C&&this.control.getIsInlineControlBackground(l,f),F=M?L+I.ascent-R.metrics.boundingBoxAscent-a:L+r-a,y=M?R.metrics.boundingBoxAscent+R.metrics.boundingBoxDescent+2*a:d.height-2*r+2*a;this.highlight.recordFillInfo(t,m-P,F,R.metrics.width+P,y,p)}else u&&this.highlight.render(t);u=p}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:r,whiteSpace:a}=this.options,{rowList:c,pageNo:d,elementList:u,positionList:h,startIndex:R,zone:T,isDrawLineBreak:g=!r.disabled,td:f,isDrawWhiteSpace:C=!a.disabled}=e,p=this.isPrintLikeMode(),I=this.isSelectionDisabled(),{isCrossRowCol:m,tableId:L}=this.range.getRange();let P=R;for(let M=0;M<c.length;M++){const F=c[M],y={x:0,y:0,width:0,height:0};let Y=null;for(let V=0;V<F.elementList.length;V++){const S=F.elementList[V],N=S.metrics,{ascent:b,coordinate:{leftTop:[X,O]}}=h[F.startIndex+V],E=F.elementList[V-1];if(de(S)&&!this.isDesignMode())this.textParticle.complete();else if(S.type===s.ElementType.IMAGE)this.textParticle.complete(),S.imgDisplay!==s.ImageDisplay.SURROUND&&S.imgDisplay!==s.ImageDisplay.FLOAT_TOP&&S.imgDisplay!==s.ImageDisplay.FLOAT_BOTTOM&&this.imageParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.LATEX)this.textParticle.complete(),this.laTexParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.TABLE)m&&(y.x=X,y.y=O,Y=S),this.tableParticle.render(t,S,X,O);else if(S.type===s.ElementType.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.LABEL)this.textParticle.complete(),this.labelParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.MACRO||S.type===s.ElementType.CUSTOM_MACRO||S.type===s.ElementType.REUSABLE_ITEM||S.type===s.ElementType.SUB_TEMPLATE)this.textParticle.complete(),this.macroParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.DATE){const w=F.elementList[V+1];(!E||E.dateId!==S.dateId)&&this.textParticle.complete(),this.textParticle.record(t,S,X,O+b),(!w||w.dateId!==S.dateId)&&this.textParticle.complete()}else if(S.type===s.ElementType.SUPERSCRIPT)this.textParticle.complete(),this.superscriptParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.SUBSCRIPT)this.underline.render(t),this.textParticle.complete(),this.subscriptParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.SEPARATOR)this.separatorParticle.render(t,S,X,O);else if(S.type===s.ElementType.PAGE_BREAK)this.mode!==s.EditorMode.CLEAN&&!p&&this.pageBreakParticle.render(t,S,X,O);else if(S.type===s.ElementType.CHECKBOX||S.controlComponent===s.ControlComponent.CHECKBOX)this.textParticle.complete(),this.checkboxParticle.render({ctx:t,x:X,y:O+b,index:V,row:F});else if(S.type===s.ElementType.RADIO||S.controlComponent===s.ControlComponent.RADIO)this.textParticle.complete(),this.radioParticle.render({ctx:t,x:X,y:O+b,index:V,row:F});else if(S.type===s.ElementType.MENSTRUAL_HISTORY)this.textParticle.complete(),this.menstrualHistoryParticle.render({ctx:t,x:X,y:O+b,index:V,row:F,element:S});else if(S.type===s.ElementType.FETAL_HEART_POSITION)this.textParticle.complete(),this.fetalHeartPositionParticle.render({ctx:t,x:X,y:O+b,index:V,row:F,element:S});else if(S.type===s.ElementType.TOOTH_POSITION)this.textParticle.complete(),this.toothPositionParticle.render({ctx:t,x:X,y:O+b,index:V,row:F,element:S});else if(S.type===s.ElementType.TAB)this.textParticle.complete();else if(S.rowFlex===s.RowFlex.ALIGNMENT||S.rowFlex===s.RowFlex.JUSTIFY)this.textParticle.record(t,S,X,O+b),this.textParticle.complete();else if(S.type===s.ElementType.BLOCK)this.textParticle.complete(),this.blockParticle.render(t,d,S,X,O+b);else{const w=S.buttonValueLayoutPrefixOffset===!0;(S.left||w)&&this.textParticle.complete(),this.textParticle.record(t,S,X,O+b),(w||S.width||S.letterSpacing||aa.test(S.value))&&this.textParticle.complete()}if(g&&!p&&this.mode!==s.EditorMode.CLEAN&&!F.isWidthNotEnough&&V===F.elementList.length-1&&this.lineBreakParticle.render(t,S,X,O+F.height/2),C&&da.test(S.value)&&this.whiteSpaceParticle.render(t,S,X,O+F.height/2),S.control?.border){E?.control?.border&&E.controlId!==S.controlId&&this.control.drawBorder(t);const w=this.getElementRowMargin(S);this.control.recordBorderInfo(X,O+w,S.metrics.width,F.height-2*w)}else E?.control?.border&&this.control.drawBorder(t);if(S.control?.type===s.ControlType.TEXT){const w=S.controlComponent===s.ControlComponent.VALUE,et=S.controlComponent===s.ControlComponent.POSTFIX||S.controlComponent===s.ControlComponent.POST_TEXT,G=!!E&&E.originControlId===S.controlId&&(E.controlComponent===s.ControlComponent.POSTFIX||E.controlComponent===s.ControlComponent.POST_TEXT||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT);S.originControlId&&(S.controlComponent===s.ControlComponent.PREFIX||S.controlComponent===s.ControlComponent.PRE_TEXT||S.controlComponent===s.ControlComponent.PRETEXTFIX||S.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t),w&&S.control?.underline&&!S.underline&&((!E||E.controlId!==S.controlId||G||E.controlComponent!==s.ControlComponent.VALUE&&E.controlComponent!==s.ControlComponent.PLACEHOLDER)&&this.control.startTextFieldUnderline(S.controlId,X,O+F.height),this.control.recordTextFieldUnderlineWidth(S.metrics.width)),et&&this.control.drawTextFieldUnderline(t),S.originControlId&&(S.controlComponent===s.ControlComponent.POSTFIX||S.controlComponent===s.ControlComponent.POST_TEXT||S.controlComponent===s.ControlComponent.POSTTEXTFIX||S.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t)}else E?.control?.type===s.ControlType.TEXT&&this.control.drawTextFieldUnderline(t);if((S.underline||S.control?.underline)&&S.controlComponent!==s.ControlComponent.PLACEHOLDER&&!(S.control?.type===s.ControlType.TEXT&&S.control?.underline&&!S.underline)){E?.type===s.ElementType.SUBSCRIPT&&S.type!==s.ElementType.SUBSCRIPT&&this.underline.render(t);const w=this.getElementRowMargin(S),et=S.left||0;let G=0;S.type===s.ElementType.SUBSCRIPT&&(G=this.subscriptParticle.getOffsetY(S));const A=S.control?.underline?this.options.underlineColor:S.color;this.underline.recordFillInfo(t,X-et,O+F.height-w+G,N.width+et,0,A,S.textDecoration?.style)}else(E?.underline||E?.control?.underline)&&(E?.control?.type===s.ControlType.TEXT&&E?.control?.underline&&!E.underline||this.underline.render(t));if(S.strikeout){if(!S.type||Le.includes(S.type)){E&&(E.type===s.ElementType.SUBSCRIPT&&S.type!==s.ElementType.SUBSCRIPT||E.type===s.ElementType.SUPERSCRIPT&&S.type!==s.ElementType.SUPERSCRIPT||this.getElementSize(E)!==this.getElementSize(S))&&this.strikeout.render(t);const w=this.textParticle.measureBasisWord(t,this.getElementFont(S));let et=O+b+w.actualBoundingBoxDescent*n-N.height/2;S.type===s.ElementType.SUBSCRIPT?et+=this.subscriptParticle.getOffsetY(S):S.type===s.ElementType.SUPERSCRIPT&&(et+=this.superscriptParticle.getOffsetY(S)),this.strikeout.recordFillInfo(t,X,et,N.width)}}else E?.strikeout&&this.strikeout.render(t);const{zone:W,splitTdRange:D}=this.range.getRange();let{startIndex:U,endIndex:v}=this.range.getRange(),Q=!1;if(f&&D&&[f.originalId,f.id].includes(D.originalId)&&(Q=!0,U=D.startIndex-(f.valueStartIndex??0),v=D.endIndex-(f.valueStartIndex??0)),W===T&&U!==v&&U<=P&&P<=v){const w=this.position.getPositionContext();if(!w.isTable&&!S.tdId||w.tdId===S.tdId||Q)if(U===P){const et=u[U+1];et&&et.value===K&&(y.x=X+N.width,y.y=O,y.height=F.height,y.width+=this.options.rangeMinWidth)}else{let et=N.width;et===0&&F.elementList.length===1&&(et=this.options.rangeMinWidth),y.width||(y.x=X,y.y=O,y.height=F.height),y.width+=et}}if(!l.disabled&&S.groupIds&&this.group.recordFillInfo(S,X,O,N.width,F.height),P++,S.type===s.ElementType.TABLE&&!de(S)){const w=S.tdPadding||i,et=w[1]+w[3];for(let G=0;G<S.trList.length;G++){const A=S.trList[G];for(let k=0;k<A.tdList.length;k++){const tt=A.tdList[k];this.drawRow(t,{elementList:tt.value,positionList:tt.positionList,rowList:tt.rowList,pageNo:d,startIndex:0,innerWidth:(tt.width-et)*n,zone:T,isDrawLineBreak:g,td:tt})}}}}if(F.isList&&this.listParticle.drawListStyle(t,F,h[F.startIndex]),this.textParticle.complete(),this.control.drawBorder(t),this.underline.render(t),this.strikeout.render(t),this.group.render(t),!I){if(y.width&&y.height){const{x:V,y:S,width:N,height:b}=y;this.range.render(t,V,S,N,b)}if(m&&Y&&Y.id===L){const{coordinate:{leftTop:[V,S]}}=h[F.startIndex];this.tableParticle.drawRange(t,Y,V,S)}}}this.control.renderQualityMarks(t,e.elementList,e.positionList,e.rowList,e.pageNo,e.zone,e.innerWidth)}_drawFloat(t,e){const{scale:n}=this.options,i=this.position.getFloatPositionList(),{imgDisplays:l,pageNo:r}=e;for(let a=0;a<i.length;a++){const c=i[a],d=c.element;if((r===c.pageNo||c.zone===s.EditorZone.HEADER||c.zone==s.EditorZone.FOOTER)&&d.imgDisplay&&l.includes(d.imgDisplay)&&d.type===s.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:r,pageMode:a,header:c,footer:d,pageNumber:u,lineNumber:h,pageBorder:R}=this.options,T=this.isPrintLikeMode(),g=this.mode===s.EditorMode.COMPARE?this.options.modeRule[s.EditorMode.COMPARE]:this.options.modeRule[s.EditorMode.PRINT],f=this.getInnerWidth(),C=this.ctxList[l];C.globalAlpha=this.zone.isMainActive()?1:r,this._clearPage(l),(!T||!g?.backgroundDisabled)&&this.background.render(C,l),T||this.area.render(C,l),a!==s.PageMode.CONTINUITY&&this.options.watermark.data&&this.waterMark.render(C,l),T||this.margin.render(C,l),this._drawFloat(C,{pageNo:l,imgDisplays:[s.ImageDisplay.FLOAT_BOTTOM]}),T||this.control.renderHighlightList(C,l);const p=i[0]?.startIndex;this.drawRow(C,{elementList:e,positionList:n,rowList:i,pageNo:l,startIndex:p,innerWidth:f,zone:s.EditorZone.MAIN}),this.getIsPagingMode()&&(c.disabled||this.header.render(C,l),u.disabled||this.pageNumber.render(C,l),d.disabled||this.footer.render(C,l)),this._drawFloat(C,{pageNo:l,imgDisplays:[s.ImageDisplay.FLOAT_TOP,s.ImageDisplay.SURROUND]}),!T&&this.search.getSearchKeyword()&&this.search.render(C,l),this.elementList.length<=1&&!this.elementList[0]?.listId&&this.placeholder.render(C),h.disabled||this.lineNumber.render(C,l),R.disabled||this.pageBorder.render(C),this.badge.render(C,l),this.isGraffitiMode()&&this.graffiti.render(C,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=ie(),n=[],i=(X,O)=>{n.push({label:X,duration:ie()-O})};this.renderCount++;const l=this.mode===s.EditorMode.EDIT||this.mode===s.EditorMode.FORM||this.isPrintLikeMode()?rT([...this.getHeaderElementList(),...this.elementList,...this.getFooterElementList()]):null,r=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 X=this.getElementList(),O=X[a],W=O?.type===s.ElementType.SUB_TEMPLATE&&O.subTemplateExpanded?s.LocationPosition.AFTER:s.LocationPosition.BEFORE,D=Hn(X,a,W);D!==a&&!de(X[D])&&(this.range.setRange(D,D),a=D)}let d;const u=this.position.getPositionContext();if(c)d=this.getOriginalElementList()[u.index];else{const X=~a?a:0,O=this.getElementList();d=Zn(O,X)}const{header:h,footer:R}=this.options,{isSubmitHistory:T=!0,isSetCursor:g=!0,isLazy:f=!0,isInit:C=!1,isSourceHistory:p=!1,isFirstRender:I=!1,isDel:m=!1}=t||{};let{isCompute:L=!0}=t||{};r&&(L=!0);let{curIndex:P}=t||{};const{traceLabel:M}=t||{},F=this.getInnerWidth(),y=this.getIsPagingMode(),Y=this.pageRowList.length;if(L){if(this.splitTdValueMap.clear(),this.tdMap.clear(),this.position.setFloatPositionList([]),y){if(!h.disabled){const A=ie();this.header.compute(),i("header.compute",A)}if(!R.disabled){const A=ie();this.footer.compute(),i("footer.compute",A)}}const X=this.getMargins(),O=this.getHeight(),E=this.header.getExtraHeight(),W=this.getMainOuterHeight(),D=X[3],U=X[0]+E,v=yi(this.elementList),Q=ie();this.rowList=this.computeRowList({startX:D,startY:U,pageHeight:O,mainOuterHeight:W,isPagingMode:y,innerWidth:F,surroundElementList:v,elementList:this.elementList}),i("computeRowList",Q);const w=ie();this.pageRowList=this._computePageList(),i("computePageList",w);const et=ie();this.position.computePositionList(),i("computePositionList",et);const G=ie();if(this.area.compute(),i("area.compute",G),!this.isPrintLikeMode()){const A=this.search.getSearchKeyword();if(A){const tt=ie();this.search.compute(A),i("search.compute",tt)}const k=ie();this.control.computeHighlightList(),i("control.computeHighlightList",k)}if(this.isGraffitiMode()){const A=ie();this.graffiti.compute(),i("graffiti.compute",A)}}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let X=0;X<this.pageRowList.length;X++)this.pageList[X]||this._createPage(X);const V=this.pageRowList.length,S=this.pageList.length;if(S>V){const X=S-V;this.ctxList.splice(V,X),this.pageList.splice(V,X).forEach(O=>O.remove())}const N=ie();if(f&&y?this._lazyRender():this._immediateRender(),i(f&&y?"lazyRender":"immediateRender",N),g){if(L&&d?.tableId){const{index:X}=u,E=this.getOriginalElementList()[X];if(d.tableId!==E?.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,P=D.elementIndex,this.position.setPositionContext(u),this.range.setRange(P,P),this.updateTableTool())}const W=this.getElementList();W[a]!==d&&(P=W.findIndex(D=>D===d))}P=this.setCursor(P)}else this.range.getIsSelection()&&this.cursor.focus();if(m){let X;const O=this.position.getPositionContext();X=this.range.getRange().startIndex-1,O.index=X}(T&&!I||P!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(P);const b=ie();fi(()=>{const X=ie();this.range.setRangeStyle(),L&&this.control.getActiveControl()&&this.control.reAwakeControl(),L&&!this.isReadonly()&&this.getMode()!==s.EditorMode.FORM&&u.isTable&&this.getOriginalElementList()[u.index].type===s.ElementType.TABLE&&this.tableTool.render(),L&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),Y!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(T||p)&&!C&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"));const O=ie();mi(this.options,M||"render",O-e,[...n,{label:"nextTick.wait",duration:X-b},{label:"nextTick.callback",duration:O-X}],{isCompute:L,pageCount:this.pageRowList.length})}),g&&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 r=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 h=d.trList[u],R=h.tdList.find(T=>t?r?.linkTdPrevId===T.id:r?.id===T.linkTdPrevId);if(R){n.index=a,n.trIndex=u,n.tableId=d.id,n.trId=h.id,n.tdId=R?.id,e=t?R.value.length-1:e+(R.value[0]?.type===s.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}getInlineBackgroundControlType(t,e){if(e===void 0)return;const n=t[e],i=n?.controlId;return i?n.control?.type?n.control.type:t.find(r=>r.controlId===i&&r.originControlId===n.originControlId&&!!r.control?.type)?.control?.type:void 0}getIsHideInlineBackgroundControlCursor(t,e){if(this.options.mode!==s.EditorMode.EDIT&&this.options.mode!==s.EditorMode.FORM)return!1;const n=e!==void 0?t[e]:void 0;if(n?.controlComponent===s.ControlComponent.POSTFIX||n?.controlComponent===s.ControlComponent.POST_TEXT||n?.controlComponent===s.ControlComponent.POSTTEXTFIX||n?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)return!1;const i=this.getInlineBackgroundControlType(t,e);return!!(i&&[s.ControlType.NUMBER,s.ControlType.SELECT,s.ControlType.DATE].includes(i))}setCursor(t){const e=this.position.getPositionContext(),n=this.position.getPositionList(),i=this.getElementList();if(e.isTable){const{index:r,trIndex:a,tdIndex:c}=e,u=this.getOriginalElementList()[r].trList?.[a].tdList[c].positionList;t===void 0&&u&&(t=u.length-1);const h=u?.[t];this.position.setCursorPosition(h||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 r=i[t];if(r&&Na.includes(r.type)){l=!1;const a=this.position.getCursorPosition();this.previewer.updateResizer(r,a)}}return l&&this.getIsHideInlineBackgroundControlCursor(i,t)&&(l=!1),this.cursor.drawCursor({isShow:l}),t}submitHistory(t){const e=this.position.getPositionContext(),n=Ni(this.elementList),i=Ni(this.header.getElementList()),l=Ni(this.footer.getElementList()),r=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(l)),this.elementList=at(n),this.range.replaceRange(at(r)),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()===s.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,r)=>{l.tableIndex=e,l.tableId=t.id,l.trIndex=i,l.trId=n.id,l.tdIndex=r,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,r=this.getOriginalElementList();let a=l;t&&(a=l>r.length?r.length-1:l);for(let c=a;t?c>=0:c<r.length;t?c--:c++){const d=r[c];if(d&&[d.originalId,d.id].includes(e))for(const[u,h]of d.trList.entries())for(const[R,T]of h.tdList.entries()){const g=T.value.findIndex(typeof n=="function"?n:f=>f===n);if(g>=0)return{originalIndex:c,table:d,tr:h,trIndex:u,td:T,tdIndex:R,elementIndex:g}}}}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 r=this.getTdById(i.linkTdPrevId);if(r){l=e-(r.valueStartIndex??0);const a=Math.max(0,l);this.spliceElementList(r.value,a+1,r.value.length-a-1),i=r}else l=0}}else{let l=1;for(;l>0;){const r=this.getTdById(i.linkTdNextId);if(r){const a=r.valueStartIndex??0;l=n-(a+r.value.length);const c=Math.min(r.value.length,n-a+1);this.spliceElementList(r.value,0,c),i=r}else l=0}}}getTablesByPagingId(t,e,n){const i=[],l=[];if(t[n].pagingId===e){i.push(n),l.push(t[n]);for(let r=n-1;r>=0&&t[r].pagingId===e;r--)l.unshift(t[r]),i.push(r);for(let r=n+1;r<t.length&&t[r].pagingId===e;r++)l.push(t[r]),i.push(r)}return{list:l,startIndex:i.sort()[0]}}}class Ql{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;executeSetControlQualityMarks;executeSetButtonContent;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;getButtonContent;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.executeSetControlQualityMarks=t.setControlQualityMarks.bind(t),this.executeSetButtonContent=t.setButtonContent.bind(t),this.getControlValue=t.getControlValue.bind(t),this.getButtonContent=t.getButtonContent.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 HT(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 AT(o,t){const{width:e,height:n,direction:i=s.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 r=l.contentWindow,a=r.document;a.open();const c=document.createElement("div"),d=HT(e,n);o.forEach(R=>{const T=document.createElement("img");T.style.width=i===s.PaperDirection.HORIZONTAL?d.height:d.width,T.style.height=i===s.PaperDirection.HORIZONTAL?d.width:d.height,T.src=R,c.append(T)});const u=document.createElement("style"),h=`
|
|
564
|
+
`,document.body.appendChild(a);const c=a.querySelector(".table-properties-modal__mask"),d=a.querySelector(".table-properties-modal__close"),u=a.querySelector(".btn-cancel"),h=a.querySelector(".btn-confirm"),R=()=>{a.remove()};c.addEventListener("click",R),d.addEventListener("click",R),u.addEventListener("click",R),h.addEventListener("click",()=>{const T=parseInt(a.querySelector("#tdPaddingTop").value)||0,g=parseInt(a.querySelector("#tdPaddingRight").value)||0,f=parseInt(a.querySelector("#tdPaddingBottom").value)||0,C=parseInt(a.querySelector("#tdPaddingLeft").value)||0;i.tdPadding=[T,g,f,C],R();const{endIndex:p}=this.range.getRange();this.draw.render({curIndex:p,isCompute:!0})})}}s.AreaMode=void 0,(function(o){o.EDIT="edit",o.READONLY="readonly",o.FORM="form"})(s.AreaMode||(s.AreaMode={}));class wT{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 s.AreaMode.EDIT:return!1;case s.AreaMode.READONLY:return!0;case s.AreaMode.FORM:return!this.draw.getControl().getIsRangeWithinControl();default:return!1}}insertArea(t){const{id:e,value:n,area:i,position:l,range:r}=t;if(this.zone.getZone()!==s.EditorZone.MAIN&&this.zone.setZone(s.EditorZone.MAIN),this.draw.getPosition().setPositionContext({isTable:!1}),r&&!this.getActiveAreaId()){const{startIndex:c,endIndex:d}=r,u=this.draw.getOriginalMainElementList();if(!u[c]||!u[d])return null;this.range.setRange(r.startIndex,r.endIndex)}else if(l===s.LocationPosition.BEFORE)this.range.setRange(0,0);else{const d=this.draw.getOriginalMainElementList().length-1;this.range.setRange(d,d)}const a=e||mt();return this.draw.insertElementList([{type:s.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 l of this.areaInfoMap){const{area:r,positionList:a}=l[1];if(r?.hide||!r?.backgroundColor&&!r?.borderColor&&!r?.placeholder)continue;const c=a.filter(g=>g.pageNo===e);if(!c.length)continue;t.translate(.5,.5);const d=c[0],u=c[c.length-1],h=n[3],R=Math.ceil(d.coordinate.leftTop[1]),T=Math.ceil(u.coordinate.rightBottom[1]-R);t.textBaseline="middle",r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fillRect(h,R,i,T)),r.borderColor&&(t.strokeStyle=r.borderColor,t.strokeRect(h,R,i,T)),r.placeholder&&a.length<=1&&new wl(this.draw).render(t,{placeholder:{...ks,...r.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 r=this.areaInfoMap.get(l);r?(r.elementList.push(i),r.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:Yt(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===s.LocationPosition.OUTER_BEFORE){if(n[i+1]?.areaId!==t)continue}else if(e?.position===s.LocationPosition.AFTER){if(!(l.areaId===t&&n[i+1]?.areaId!==t))continue}else if(e?.position===s.LocationPosition.OUTER_AFTER){if(!(l.areaId!==t&&n[i-1]?.areaId===t))continue}else if(l.areaId!==t)continue;const r=this.position.getOriginalMainPositionList();return{range:{startIndex:i,endIndex:i},elementPosition:r[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(([r,a])=>{if(Us(a))return;const c=r;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(),r=t.value;qt([{type:s.ElementType.AREA,value:"",valueList:r,areaId:n.id,area:n.area}],{editorOptions:this.options}),this.draw.spliceElementList(l,i[0].index,i.length,r,{isIgnoreDeletedRule:!0}),this.draw.render({isSetCursor:!1})}}class ZT{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,r){if(this.imageCache.has(r)){const a=this.imageCache.get(r);t.drawImage(a,e,n,i,l)}else{const a=new Image;a.setAttribute("crossOrigin","Anonymous"),a.src=r,a.onload=()=>{this.imageCache.set(r,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:r,width:a,height:c,value:d}=this.mainBadge,u=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),h=(l||i.left)*n,R=(r||i.top)*n+u;this._drawImage(t,h,R,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 r of n){const{positionList:a}=r[1],c=a[0];if(c.pageNo!==e)continue;const d=this.areaBadgeMap.get(r[0]);if(!d)continue;const{left:u,top:h,width:R,height:T,value:g}=d,f=(u||l.left)*i,C=(h||l.top)*i+c.coordinate.leftTop[1];this._drawImage(t,f,C,R*i,T*i,g)}}}}}class vT{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 r=this.data.find(d=>d.pageNo===l);if(this.startStroke&&(r||(r={pageNo:l,strokes:[]},this.data.push(r)),r.strokes.push(this.startStroke),this.startStroke=null),!r?.strokes?.length)return;const{scale:a}=this.options;r.strokes[r.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:r}=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)*r,t.moveTo(c.points[0]*r,c.points[1]*r);for(let d=2;d<c.points.length;d+=2)t.lineTo(c.points[d]*r,c.points[d+1]*r);t.stroke()}t.restore()}}const Zl=1024,QT=['[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 vl(o,t,e){for(let n=0;n<e.length;n+=Zl){const i=e.slice(n,n+Zl);o.splice(t+n,0,...i)}}class KT{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,r){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=r,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new PT(e.locale),this.historyManager=new Od(this),this.position=new Sd(this),this.zone=new ST(this),this.range=new Dd(this),this.margin=new Nd(this),this.background=new Fd(this),this.badge=new ZT(this),this.search=new yd(this),this.group=new XT(this),this.area=new wT(this),this.underline=new Vd(this),this.strikeout=new bd(this),this.highlight=new Xd(this),this.previewer=new CT(this),this.imageParticle=new vs(this),this.laTexParticle=new Hs(this),this.textParticle=new Wd(this),this.tableParticle=new wd(this),this.tableTool=new Zd(this),this.tableOperate=new UT(this),this.pageNumber=new _n(this),this.lineNumber=new bT(this),this.waterMark=new Gd(this),this.placeholder=new wl(this),this.header=new Hd(this,n.header),this.footer=new DT(this,n.footer),this.hyperlinkParticle=new vd(this),this.labelParticle=new Qd(this),this.macroParticle=new Kd(this),this.dateParticle=new pT(this),this.separatorParticle=new Bd(this),this.pageBreakParticle=new kd(this),this.superscriptParticle=new Ad,this.subscriptParticle=new _d,this.checkboxParticle=new aT(this),this.radioParticle=new cT(this),this.menstrualHistoryParticle=new dT(this),this.fetalHeartPositionParticle=new uT(this),this.toothPositionParticle=new RT(this),this.blockParticle=new ET(this),this.listParticle=new FT(this),this.lineBreakParticle=new Io(this),this.whiteSpaceParticle=new NT(this),this.control=new oT(this),this.pageBorder=new VT(this),this.graffiti=new vT(this,n.graffiti),this.scrollObserver=new Yd(this),this.selectionObserver=new Ud(this),this.imageObserver=new MT,new yT(this),this.canvasEvent=new Pd(this),this.cursor=new Zc(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new Md(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new mT(this),new YT(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.isPrintLikeMode()&&this.setPrintData(),this.mode===s.EditorMode.READONLY&&this.setReadonlyData(),this.mode,s.EditorMode.FORM,this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}setPrintData(){this.printModeData||(this.printModeData=at({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const t=at(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(at(this.printModeData)),this.printModeData=null)}setReadonlyData(){this.readonlyModeData||(this.readonlyModeData=at({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const t=at(this.readonlyModeData);["header","main","footer"].forEach(n=>{const i=Yt(t[n],{editorOptions:this.options});t[n]=wn(i),qt(t[n],{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData(t)}clearReadonlyData(){if(this.readonlyModeData){const t=at(this.readonlyModeData);this.readonlyModeData=null,this.setEditorData(t)}}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}isPrintLikeMode(t=this.mode){return t===s.EditorMode.PRINT||t===s.EditorMode.COMPARE}getIsButtonRowStartPrefix(t,e,n){const i=t[e];if(this.isPrintLikeMode()||i.control?.type!==s.ControlType.BUTTON||i.control.buttonText||i.control.minWidth||i.controlComponent!==s.ControlComponent.PREFIX||!i.value)return!1;const l=t[e+1];return!l||l.controlId!==i.controlId||(l.originControlId||null)!==(i.originControlId||null)||l.controlComponent!==s.ControlComponent.VALUE||l.buttonValueLayout?!1:n.elementList.every(r=>r.value===K||de(r))}getElementLayoutWidth(t){return t.control?.type===s.ControlType.BUTTON&&!t.control.buttonText&&t.controlComponent===s.ControlComponent.PREFIX&&t.left&&t.left<0?Math.max(0,t.metrics.width+t.left):t.metrics.width}isContentReadonly(){if(this.mode===s.EditorMode.COMPARE)return!0;if(this.area.getActiveAreaInfo()?.area?.mode)return this.area.isReadonly();switch(this.mode){case s.EditorMode.DESIGN:return!1;case s.EditorMode.READONLY:case s.EditorMode.PRINT:case s.EditorMode.GRAFFITI:return!0;case s.EditorMode.FORM:if(this.control.getIsRangeWithinControl()){const t=this.getElementList(),{startIndex:e}=this.range.getRange(),n=t[e];if(n?.control?.type===s.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}}isSelectionDisabled(){return this.mode===s.EditorMode.COMPARE?!1:this.area.getActiveAreaInfo()?.area?.mode?this.area.isReadonly():this.mode===s.EditorMode.READONLY||this.mode===s.EditorMode.PRINT||this.mode===s.EditorMode.GRAFFITI}setMode(t){if(this.mode===t)return;const e=this.mode;this.macroParticle.clearInlineEditor({isSubmitHistory:!1}),this.mode=t,this.options.mode=t;const n=this.isPrintLikeMode(t);this.isPrintLikeMode(e)&&this.clearPrintData(),e===s.EditorMode.READONLY&&t!==s.EditorMode.READONLY&&this.clearReadonlyData(),n&&!this.printModeData&&(this.printModeData=at({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const i=new Map,l=a=>{a.forEach(c=>{c.controlId&&(c.controlComponent==="value"&&i.set(c.controlId,!0),c.checked&&i.set(c.controlId,!0))})};l(this.elementList),this.elementList.forEach(a=>{a.type==="table"&&a.trList?.forEach(c=>{c.tdList?.forEach(d=>{l(d.value)})})});const r=a=>{a.forEach(c=>{if(!(!c.control&&!c.controlId)&&(c.controlComponent==="value"&&c.strikeout&&(n?c.hide=!0:c.hide=!1),!!c.control&&!(c.type!=="control"&&c.control.type!=="button"))){if(c.control.type==="TextField"&&(c.controlComponent==="placeholder"||c.controlComponent==="preTextFix"||c.controlComponent==="preTextFixText"||c.controlComponent==="postTextFix"||c.controlComponent==="postTextFixText"||c.controlComponent==="textFixLabel")&&(t===s.EditorMode.EDIT?c.hide=!1:c.hide=!0),c.control.type==="text"&&(c.controlComponent==="placeholder"||c.controlComponent==="prefix"||c.controlComponent==="postfix")&&(t===s.EditorMode.EDIT||t===s.EditorMode.FORM?c.hide=!1:c.hide=!0),c.control.type==="number"||c.control.type==="select"||c.control.type==="date"||c.control.type==="checkbox"||c.control.type==="radio"){if(c.controlComponent==="placeholder"||c.controlComponent==="prefix"||c.controlComponent==="postfix"){const u=i.get(c.controlId);c.control.type==="select"&&n||n&&!u?c.hide=!0:c.hide=!1}c.control.type==="number"&&c.controlComponent==="value"&&(n&&c.strikeout?c.hide=!0:!n&&c.strikeout&&(c.hide=!1))}c.control.type==="button"&&(c.hide=!1,c.control.hide=!1),c.control.type==="menstrualHistory"&&(c.controlComponent==="prefix"||c.controlComponent==="postfix")&&(n?c.hide=!0:c.hide=!1)}})};r(this.elementList),this.elementList.forEach(a=>{a.type==="table"&&a.trList.forEach(c=>{c.tdList.forEach(d=>{r(d.value)})})}),t===s.EditorMode.FORM?(this.elementList.filter(a=>a.type==="control").map(a=>{a.control?.type==="button"&&(a.controlComponent==="prefix"||a.controlComponent==="postfix"?(a.color="#1677FF",a.highlight="transparent"):a.controlComponent==="value"&&(a.color=this.options.defaultColor,a.highlight="transparent"))}),this.hideTextFieldWhitespace(this.elementList,!0),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):t===s.EditorMode.EDIT?(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!1,!0)),n?(this.elementList.filter(a=>a?.control?.type==="button").map(a=>{(a?.controlComponent==="prefix"||a?.controlComponent==="postfix")&&(a.color="transparent",a.highlight="transparent"),a?.controlComponent==="value"&&!a.control.buttonText&&(a.color=this.options.defaultColor,a.highlight="transparent")}),this.setPrintData()):(this.clearPrintData(),this.elementList.filter(a=>a?.control?.type==="button").map(a=>{(a?.controlComponent==="prefix"||a?.controlComponent==="postfix")&&(a.color="#1677FF",a.highlight="transparent"),a?.controlComponent==="value"&&!a.control.buttonText&&(a.color=this.options.defaultColor,a.highlight="transparent"),a?.type==="text"&&a.control.buttonText&&(a.color="#000"),a?.type==="control"&&a?.controlComponent==="value"&&a.control.buttonText&&(a.color="#000",a.highlight="transparent")})),t===s.EditorMode.READONLY&&this.setReadonlyData(),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===s.ElementType.TABLE&&u.trList)for(const h of u.trList)for(const R of h.tdList)i(R.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===s.ElementType.TABLE&&d.trList)for(const u of d.trList)for(const h of u.tdList)this.hideTextFieldWhitespace(h.value,e);d.control?.type===s.ControlType.TEXTFIELD&&d.controlComponent===s.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 r=!1;const a=this.getSubTemplateRuntimeEndIndex(t,e,n.id);if(i&&!n.subTemplateContent?.length&&(i=!1),n.subTemplateExpanded!==i&&(n.subTemplateExpanded=i,r=!0),!!n.hide!==l&&(n.hide=l,r=!0),!i)return a>e+1&&(t.splice(e+1,a-e-1),r=!0),r;if(a===e+1){const c=at(n.subTemplateContent||[]);qt(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),r=!0)}return r}applySubTemplateRuntimeState(t,e){const n=i=>{let l=!1,r=0;for(;r<i.length;){const a=i[r];if(a.type===s.ElementType.SUB_TEMPLATE){const c=!!a.subTemplateConditions?.length;if(this.mode===s.EditorMode.EDIT&&c)l=this.syncSubTemplateExpandedState(i,r,a,!0,!0)||l;else if((this.mode===s.EditorMode.FORM||this.isPrintLikeMode())&&c){const d=e?lT(a.subTemplateConditions,e,a.subTemplateRelation):!1;l=this.syncSubTemplateExpandedState(i,r,a,d,!0)||l}else this.mode!==s.EditorMode.FORM&&!this.isPrintLikeMode()&&(l=this.syncSubTemplateExpandedState(i,r,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===s.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}r++}return l};return n(t)}updateTextFieldPlaceholderVisibility(t,e,n){const i=[s.ControlType.TEXT,s.ControlType.TEXTFIELD,s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.CHECKBOX,s.ControlType.RADIO,s.ControlType.NUMBER];(r=>{let a=0;for(;a<r.length;){const c=r[a];if(c.type===s.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===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PRE_TEXT)){const d=c.controlId,u=c.control.type;let h=!1,R=!1,T=!1;const g=[],f=[],C=[];let p=-1,I=a;for(;I<r.length;){const m=r[I];if(m.controlId!==d){const L=m.controlId;let P=u===s.ControlType.TEXT,M=I;if(P)for(;M<r.length&&r[M].controlId===L;)M++;else for(;M<r.length;){const F=r[M];if(F.controlId!==L)break;F.controlComponent===s.ControlComponent.VALUE&&(F.value&&F.value.trim()||F.type===s.ElementType.MENSTRUAL_HISTORY||F.type===s.ElementType.FETAL_HEART_POSITION||F.type===s.ElementType.TOOTH_POSITION||F.type===s.ElementType.MACRO||F.type===s.ElementType.CUSTOM_MACRO)&&(P=!0),M++}P&&(R=!0),I=M;continue}if((m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&f.push(I),m.controlComponent===s.ControlComponent.VALUE&&m.value&&m.value.trim()&&(h=!0),m.controlComponent===s.ControlComponent.VALUE&&(m.type===s.ElementType.MENSTRUAL_HISTORY||m.type===s.ElementType.FETAL_HEART_POSITION||m.type===s.ElementType.TOOTH_POSITION||m.type===s.ElementType.MACRO||m.type===s.ElementType.CUSTOM_MACRO)&&(h=!0),m.controlComponent===s.ControlComponent.VALUE&&m.control&&m.control.type!==u&&(R=!0),m.controlComponent===s.ControlComponent.PLACEHOLDER&&(T=!0,g.push(I)),m.controlComponent===s.ControlComponent.POSTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){C.push(I),p=I;break}I++}if(h||R){if(T&&g.length>0)for(const m of g)r[m].hide=!0}else if(T&&g.length>0)for(const m of g)r[m].hide=!e;else e&&c.control?.placeholder&&(p>0?this.control.addPlaceholder(p-1):this.control.addPlaceholder(a));if(n)if(e&&(h||R)){for(const m of f)r[m].hide=!0;for(const m of C)r[m].hide=!0}else if(e){for(const m of f)r[m].hide=!1;for(const m of C)r[m].hide=!1}else{for(const m of f)r[m].hide=!0;for(const m of C)r[m].hide=!0}else{for(const m of f)r[m].hide=!1;for(const m of C)r[m].hide=!1}a=I}a++}})(t)}isReadonly(){return this.isContentReadonly()}isDisabled(){if(this.mode===s.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],r=n[t+1];return!!(l?.title?.disabled&&r?.title?.disabled&&l.titleId===r.titleId||l?.control?.disabled&&r?.control?.disabled&&l.controlId===r.controlId)}return n.slice(t+1,e+1).some(l=>l.title?.disabled||l.control?.disabled)}isDesignMode(){return this.mode===s.EditorMode.DESIGN}isPrintMode(){return this.mode===s.EditorMode.PRINT}isGraffitiMode(){return this.mode===s.EditorMode.GRAFFITI}getOriginalWidth(){const{paperDirection:t,width:e,height:n}=this.options;return t===s.PaperDirection.VERTICAL?e:n}getOriginalHeight(){const{paperDirection:t,width:e,height:n}=this.options;return t===s.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,r=this.getOriginalElementList()[e],a=r.trList[n].tdList[i],c=this.getTdPadding(r);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===s.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:!!ys(e,n=>!!n&&n.nodeType===1&&!!n.getAttribute(ze)):!1}isTargetInsideExternalOverlay(t){const e=this.getEventTarget(t);return!e||this.isTargetInsideEditor(e)?!1:!!e.closest(QT)}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:r=!0}=e;qt(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 h=l[u-1];t[0].listId&&h&&!h.listId&&h?.value===K&&(!h.type||h.type===s.ElementType.TEXTFIELD)&&(l.splice(n,1),a-=1)}this.control.destroyControl(),~a&&(this.range.setRange(a,a),this.render({curIndex:a,isSubmitHistory:r}))}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;qt(t,{isHandleFirstElement:!1,editorOptions:this.options});let r=-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,h=c[n],R=c[u],T=M=>!!(M&&(M.controlComponent===s.ControlComponent.POSTFIX||M.controlComponent===s.ControlComponent.POST_TEXT||M.controlComponent===s.ControlComponent.POSTTEXTFIX||M.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)),g=M=>!!(M&&(M.controlComponent===s.ControlComponent.PREFIX||M.controlComponent===s.ControlComponent.PRE_TEXT||M.controlComponent===s.ControlComponent.PRETEXTFIX||M.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)),f=M=>{if(M)return c.find(F=>F.controlId===M&&!F.originControlId&&!!F.control?.type)},C=h?.originControlId&&R?.originControlId===h.originControlId&&h.controlId&&R.controlId&&h.controlId!==R.controlId&&T(h)&&g(R)?f(h.originControlId):void 0,p=C?.control?.type===s.ControlType.TEXTFIELD,I=!!(h?.originControlId&&T(h)&&R?.controlId===h.originControlId&&!R.originControlId&&R.control?.type===s.ControlType.TEXTFIELD&&T(R)),m=!!(h?.originControlId&&T(h)&&R?.controlId===h.originControlId&&!R.originControlId&&R.control?.type===s.ControlType.TEXTFIELD&&R.controlComponent===s.ControlComponent.VALUE);if(h?.controlComponent===s.ControlComponent.PRE_TEXT||h?.controlComponent===s.ControlComponent.POST_TEXT||h?.controlComponent===s.ControlComponent.PREFIX||h?.controlComponent===s.ControlComponent.POSTFIX)for(let M=0;M<t.length;M++)t[M].control||(t[M].color=this.options.defaultColor);d&&!I&&!m&&(c[n]?.control?.type===s.ControlType.TEXTFIELD||c[n]?.control?.type===s.ControlType.TEXT)&&this.control.removePlaceholder(n),d||this.newSpliceElementList(c,u,i-n);const P=I||m||p?h.originControlId:c[n]?.controlId||c[n-1]?.controlId||c[n+1]?.controlId;for(let M=0;M<t.length;M++){if((I||m||p)&&!t[M].control&&(t[M].controlId=P,t[M].control=p?C?.control:R.control,t[M].controlComponent=s.ControlComponent.VALUE,delete t[M].originControlId),t[M]?.control?.type=="button"&&!t[M]?.control?.buttonText&&(t[M]?.controlComponent==="prefix"||t[M]?.controlComponent==="postfix"?(t[M].color="#1677FF",t[M].highlight="transparent"):(t[M].color=this.options.defaultColor,t[M].highlight="transparent")),t[M]?.type===s.ElementType.MENSTRUAL_HISTORY||t[M]?.type===s.ElementType.FETAL_HEART_POSITION||t[M]?.type===s.ElementType.TOOTH_POSITION||t[M]?.type===s.ElementType.MACRO||t[M]?.type===s.ElementType.CUSTOM_MACRO||t[M]?.type===s.ElementType.REUSABLE_ITEM||t[M]?.type===s.ElementType.SUB_TEMPLATE||t[M]?.type===s.ElementType.SPECIAL_SYMBOLS){t[M].controlComponent=s.ControlComponent.VALUE;let F=c[n]?.controlId;F||(F=c[n-1]?.controlId),F||(F=c[n+1]?.controlId),!t[M].controlId&&F&&(t[M].controlId=F)}P&&t[M]?.control&&t[M].controlId&&t[M].controlId!==P&&(t[M].originControlId=P)}this.newSpliceElementList(c,u,0,t),r=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 h=0;h<t.length;h++)if(t[h]?.type===s.ElementType.MENSTRUAL_HISTORY||t[h]?.type===s.ElementType.FETAL_HEART_POSITION||t[h]?.type===s.ElementType.TOOTH_POSITION||t[h]?.type===s.ElementType.MACRO||t[h]?.type===s.ElementType.CUSTOM_MACRO||t[h]?.type===s.ElementType.REUSABLE_ITEM||t[h]?.type===s.ElementType.SUB_TEMPLATE||t[h]?.type===s.ElementType.SPECIAL_SYMBOLS){t[h].controlComponent=s.ControlComponent.VALUE;const R=c[n]?.controlId||c[u]?.controlId;!t[h].controlId&&R&&(t[h].controlId=R)}this.newSpliceElementList(c,u,0,t),r=n+t.length}else{d||this.spliceElementList(c,u,i-n);for(let R=0;R<t.length;R++)t[R]?.control?.type=="button"&&!t[R]?.control?.buttonText&&(t[R]?.controlComponent==="prefix"||t[R]?.controlComponent==="postfix"?(t[R].color="#1677FF",t[R].highlight="transparent"):(t[R].color=this.options.defaultColor,t[R].highlight="transparent"));this.spliceElementList(c,u,0,t),r=n+t.length;const h=c[u-1];t[0].listId&&h&&!h.listId&&h?.value===K&&(!h.type||h.type===s.ElementType.TEXT)&&(c.splice(n,1),r-=1)}}~r&&(this.range.setRange(r,r),this.render({curIndex:r,isSubmitHistory:l}))}appendElementList(t,e={}){if(!t.length)return;qt(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:r=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const d=e+n,h=t[d]?.listId;if(h&&t[e-1]?.listId!==h){let R=d;for(;R<t.length;){const T=t[R];if(T.listId!==h||T.value===K)break;delete T.listId,delete T.listType,delete T.listStyle,R++}}if(!r&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const R=this.getTd()?.deletable;let T=d-1;for(;T>=e;){const g=t[T];(de(g)||R!==!1&&g?.control?.deletable!==!1&&(!g.controlId||this.mode!==s.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&g?.title?.deletable!==!1&&(a.deletable!==!1||!g.groupIds?.length)&&(g?.area?.deletable!==!1||g?.areaIndex!==0))&&t.splice(T,1),T--}}else t.splice(e,n)}if(i?.length){let d=t[e];for(let u=0;u<i.length;u++){const h=i[u].value===K&&(d?.controlComponent===s.ControlComponent.PREFIX||d?.controlComponent===s.ControlComponent.PRE_TEXT||d?.controlComponent===s.ControlComponent.PRETEXTFIX||d?.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT);!i[u].controlComponent&&d?.controlComponent&&!h&&(i[u].controlId=d.controlId,i[u].control=d.control,i[u].controlComponent=d.controlComponent),d=i[u]}vl(t,e,i)}}newSpliceElementList(t,e,n,i,l){const{isIgnoreDeletedRule:r=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const u=e+n,R=t[u]?.listId;if(R&&t[e-1]?.listId!==R){let T=u;for(;T<t.length;){const g=t[T];if(g.listId!==R||g.value===K)break;delete g.listId,delete g.listType,delete g.listStyle,T++}}if(!r&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const T=this.getTd()?.deletable;let g=u-1;for(;g>=e;){const f=t[g];(de(f)||T!==!1&&f?.control?.deletable!==!1&&(!f.controlId||this.mode!==s.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)}const d=t[e]?.controlId;if(i?.length){for(let u=0;u<i.length;u++)d&&i[u].controlId!==d&&(i[u].originControlId=d);vl(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 r=this.pageList.map(a=>a.toDataURL());return e&&this.setPagePixelRatio(null),l&&this.setMode(i),r}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===s.PageMode.PAGING}setPageMode(t){if(!t||this.options.pageMode===t)return;if(this.options.pageMode=t,t===s.PageMode.PAGING){const{height:i}=this.options,l=this.getPagePixelRatio(),r=this.pageList[0];r.style.height=`${i}px`,r.height=i*l,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(s.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((r,a)=>{r.width=n*e,r.height=i*e,r.style.width=`${n}px`,r.style.height=`${i}px`,r.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((r,a)=>{r.width=i*n,r.height=l*n,r.style.width=`${i}px`,r.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,r)=>{l.width=n*e,l.height=i*e,l.style.width=`${n}px`,l.style.height=`${i}px`,this._initPageContext(this.ctxList[r])}),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(r=>r.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:Yt(e.header,{extraPickAttrs:n,editorOptions:this.options}),main:Yt(e.main,{extraPickAttrs:n,isClassifyArea:!0,editorOptions:this.options}),footer:Yt(e.footer,{extraPickAttrs:n,editorOptions:this.options}),graffiti:e.graffiti};return{version:pn,data:i,options:at(this.options)}}setValue(t,e){const{header:n,main:i,footer:l}=at(t);if(!n&&!i&&!l)return;const{isSetCursor:r=!1}=e||{};[n,i,l].forEach(d=>{d&&qt(d,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:n,main:i,footer:l}),this.mode===s.EditorMode.READONLY?(this.readonlyModeData=null,this.setReadonlyData()):this.isPrintLikeMode()&&(this.printModeData=null,this.setPrintData()),this.historyManager.recovery();const c=r?i?.length?i.length-1:0:void 0;c!==void 0&&this.range.setRange(c,c),this.render({curIndex:c,isSetCursor:r,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(ze,s.EditorComponent.MAIN)}_createPageContainer(){const t=document.createElement("div");return t.classList.add(`${lt}-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 r=i.getContext("2d");this._initPageContext(r),this.pageList.push(i),this.ctxList.push(r)}_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,r=t.actualSize||t.size||n;return`${t.italic?"italic ":""}${t.bold?"bold ":""}${r*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,r=t.size||e;let a=1;return r<12?a=r/12:r>30&&(a=1+(r-30)/30),n*a*(t.rowMargin??i)*l}computeRowList(t){const{innerWidth:e,elementList:n,isPagingMode:i=!1,isFromTable:l=!1,startX:r=0,startY:a=0,pageHeight:c=0,mainOuterHeight:d=0,surroundElementList:u=[]}=t,{defaultSize:h,scale:R,imgCaption:T,table:{tdPadding:g,defaultTrMinHeight:f},defaultTabWidth:C}=this.options,p=this.getDefaultBasicRowMarginHeight(),m=document.createElement("canvas").getContext("2d"),L=this.listParticle.computeListStyle(m,n),P=[],M=this._collectTextControlValueSet(n),F=this._collectTextControlHasContentSet(n);n.length&&P.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:n?.[0]?.rowFlex||n?.[1]?.rowFlex});let y=r,Y=a,V=0,S,N=0,b=0;for(let X=0;X<n.length;X++){const O=P[P.length-1],E=n[X];this.clearElementEffect(E);const W=this.getElementRowMargin(E),D={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},U=O.offsetX||E.listId&&L.get(E.listId)||0,v=e-U,Q=O.elementList.length===1;if(y+=Q?U:0,Y+=Q&&O.offsetY||0,(E.control?.type===s.ControlType.TEXTFIELD||E.control?.type===s.ControlType.TEXT)&&!this.isDesignMode()&&(E.controlComponent===s.ControlComponent.PRETEXTFIX||E.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||E.controlComponent===s.ControlComponent.TEXTFIXLABEL||E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.PREFIX||E.controlComponent===s.ControlComponent.POSTFIX)){const nt=E.control?.type===s.ControlType.TEXTFIELD,J=E.controlId,_=!!J&&!!M?.has(J);if(nt){const B=!!J&&!!F?.has(J);this.mode===s.EditorMode.EDIT?E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.TEXTFIXLABEL?E.hide=B:E.hide=!1:E.hide=!0}else{const B=!!J&&!!F?.has(J);this.mode===s.EditorMode.EDIT||this.mode===s.EditorMode.FORM?E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.TEXTFIXLABEL?E.hide=B:E.hide=!1:E.hide=!0}}if(de(E)&&!this.isDesignMode()){const nt=O.elementList[O.elementList.length-1];D.height=nt?.metrics.height||this.options.defaultSize*R,D.boundingBoxAscent=nt?.metrics.boundingBoxAscent||0,D.boundingBoxDescent=nt?.metrics.boundingBoxDescent||0}else if(E.type===s.ElementType.IMAGE||E.type===s.ElementType.LATEX)if(E.imgDisplay===s.ImageDisplay.SURROUND||E.imgDisplay===s.ImageDisplay.FLOAT_TOP||E.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)D.width=0,D.height=0,D.boundingBoxDescent=0;else{const nt=E.width*R,J=E.height*R;if(nt>v){const _=J*v/nt;E.width=v/R,E.height=_/R,D.width=v,D.height=_,D.boundingBoxDescent=_}else D.width=nt,D.height=J,D.boundingBoxDescent=J;if(E.imgCaption?.value){const _=E.imgCaption.size||T.size,B=E.imgCaption.top??T.top,st=(_+B)*R;D.boundingBoxAscent+=st}}else if(E.type===s.ElementType.TABLE){const nt=E.tdPadding||g;if(E.pagingId){let z=X+1,ut=0;for(;z<n.length;){const Rt=n[z];if(Rt.pagingId===E.pagingId){const Dt=Rt.trList.filter(Xt=>!Xt.pagingRepeat).filter(Xt=>(Xt.tdList=Xt.tdList.filter(At=>{if(At.originalId){for(let Ft=0;Ft<E.trList.length;Ft++){const Bt=E.trList[Ft],_t=Bt.tdList.find(({id:re})=>re===At.originalId);if(_t){At.value[0]?.type===s.ElementType.SPLIT_TAG&&At.value.splice(0,1),_t.value.push(...At.value.map(re=>this.updateElementTableInfo(re,E,Bt,_t))),_t.rowspan=_t.originalRowspan??_t.rowspan;break}}return!1}return!0}),!Xt.originalId));E.trList.push(...Dt),E.height+=Rt.height,z++,ut++}else break}ut&&n.splice(X+1,ut)}E.pagingIndex=E.pagingIndex??0,this.tableParticle.computeTrHeight(E,z=>this.computeRowList({innerWidth:(z.width-(nt[1]+nt[3]))*R,elementList:z.value,isFromTable:!0,isPagingMode:i})),E.trList?.forEach(z=>{z.tdList.forEach(ut=>{this.tdMap.set(ut.id,ut)})});const J=this.tableParticle.getTableHeight(E),_=this.tableParticle.getTableWidth(E);E.width=_,E.height=J;const B=_*R,st=J*R;if(D.width=B,D.height=st,D.boundingBoxDescent=st,D.boundingBoxAscent=-W,n[X+1]?.type===s.ElementType.TABLE&&(D.boundingBoxAscent-=W),i){const z=this.getHeight(),ut=this.getMainOuterHeight();let Rt=ut;for(let Ft=0;Ft<P.length;Ft++){const Bt=P[Ft],_t=Bt.offsetY||0;Bt.height+Rt+_t>z||P[Ft-1]?.isPageBreak?Rt=ut+Bt.height+_t:Rt+=Bt.height+_t}const Dt=W*2,Xt=E.trList[0].height*R;(Rt+Xt+Dt>z||E.pagingIndex!==0&&E.trList[0].pagingRepeat||n[X-1]?.type===s.ElementType.PAGE_BREAK)&&(Rt=ut);let At=z-(Rt+Dt);if(st>At){const Ft=E.trList;let Bt=0,_t=0,re=0;for(let Tt=0;Tt<Ft.length;Tt++){const Lt=Ft[Tt],Vt=Lt.height*R;if(Rt+Dt+re+Vt>z){const Pt=Lt;let Et=0;const Mt={...at(Pt),id:mt(),originalId:Pt.originalId??Pt.id,minHeight:void 0,tdList:E.colgroup.map((ft,It)=>{if(Et--,Et>0)return;const gt=Pt.tdList.find($t=>$t.colIndex===It),j=gt??this.tableParticle.findPreRowSpanTd(Ft,Tt,It);gt&&(Et=gt.colspan);const q=mt();return j.originalRowspan=j.rowspan,gt?{...gt,id:q,originalId:gt.originalId??gt.id,linkTdPrevId:gt.id,tdIndex:It,original:j}:{id:q,originalId:j.originalId??j.id,linkTdPrevId:j.id,tdIndex:It,colIndex:It,colspan:1,rowspan:1,value:[],rowList:[],original:j}}).filter(ft=>!!ft)},Zt=Mt.tdList,ce=Zt.map(ft=>ft.original);ce.forEach((ft,It)=>{const gt=[];let j=At;if(ft.rowspan>1){const $t=Ft.slice(ft.trIndex,ft.trIndex+Tt-ft.trIndex);j+=$t.reduce((Te,me)=>me.height*R+Te,0)}for(;ft.mainHeight*R>j&&ft.rowList?.length;){const $t=ft.rowList.pop();ft.value.splice(ft.value.length-$t.elementList.length),gt.unshift($t),ft.mainHeight-=$t.height}const q=Zt[It];q.rowList=gt,q.value=gt.map($t=>$t.elementList).flat()});let Ct=!0;const it=Pt.tdList.some(ft=>ft.rowList?.length),vt=Mt.tdList.some(ft=>ft.rowList?.length),Nt=Pt.minHeight>At;if(vt||Nt){(it||!vt&&Nt)&&(Nt&&(Pt.originalMinHeight=Pt.minHeight,Pt.minHeight=At,Mt.minHeight=Math.max(Pt.originalMinHeight-At,f)),Mt.tdList.forEach(ft=>{ft.original.linkTdNextId=ft.id,ft.value.length&&ft.value[0].value!==K&&ft.value.unshift({...ft.original.value.slice(-1).pop(),value:K,type:s.ElementType.SPLIT_TAG})}),Ft.splice(Bt+1,0,Mt),Bt+=1,_t=Ft.length-Bt,Ct=!1),ce.forEach(ft=>{if(ft.rowspan>1){const It=ft.rowspan-(Tt-ft.trIndex);ft.rowspan=Tt-ft.trIndex+(it?1:0);const gt=Mt.tdList.find(j=>j.colIndex===ft.colIndex);it?gt.rowspan=It:(gt.original.linkTdNextId=gt.id,Pt.tdList.push({...ft,...gt,rowspan:It}),Pt.tdList.sort((j,q)=>j.colIndex-q.colIndex),gt.value=[])}}),Ct&&ce.forEach((ft,It)=>{ft.value.push(...Zt[It].value)});break}}Bt=Tt+1,_t=Ft.length-Bt,re+=Vt,At-=Vt}if(_t){const Tt=Ft.splice(Bt,_t),Lt=E.pagingId||mt();E.pagingId=Lt;const Vt=at(E);Vt.originalId=E.originalId??E.id,Vt.pagingId=Lt,Vt.pagingIndex=E.pagingIndex+1;const Pt=Ft.filter(Zt=>Zt.pagingRepeat);if(Pt.length){const Zt=at(Pt);Zt.forEach(ce=>ce.id=mt()),Tt.unshift(...Zt)}Vt.trList=Tt,Vt.id=mt(),Vt.trList?.forEach(Zt=>{Zt.tdList.forEach(ce=>{if(delete ce.valueStartIndex,ce.linkTdPrevId){const Ct=this.getTdById(ce.linkTdPrevId);ce.valueStartIndex=Ct?(Ct.valueStartIndex??0)+Ct.value.length:0,this.splitTdValueMap.has(ce.originalId)?this.splitTdValueMap.get(ce.originalId).push(...ce.value):Ct&&this.splitTdValueMap.set(ce.originalId,[...Ct.value,...ce.value])}ce.value.forEach(Ct=>this.updateElementTableInfo(Ct,Vt,Zt,ce))})}),this.spliceElementList(n,X+1,0,[Vt]),this.tableParticle.computeTrHeight(E);const Et=this.tableParticle.getTableHeight(E),Mt=Et*R;E.height=Et,D.height=Mt,D.boundingBoxDescent=Mt}}if(E.pagingId){const Ft=this.position.getPositionContext();if(Ft.isTable){let Bt=-1,_t=-1,re=X;for(;re<n.length;){const Tt=n[re];if(Tt.pagingId!==E.pagingId)break;const Lt=Tt.trList.findIndex(Vt=>Vt.id===Ft.trId);if(~Lt){Bt=re,_t=Lt;break}re++}~Bt&&(Ft.index=Bt,Ft.trIndex=_t,this.position.setPositionContext(Ft))}}}this.initTableElementIndex(E,X)}else if(E.type===s.ElementType.SEPARATOR){const{separator:{lineWidth:nt}}=this.options,J=E.lineWidth||nt;E.width=v/R,D.width=v,D.height=J*R,D.boundingBoxAscent=-W,D.boundingBoxDescent=-W+D.height}else if(E.type===s.ElementType.PAGE_BREAK)E.width=v/R,D.width=v,D.height=h;else if(E.type===s.ElementType.RADIO||E.controlComponent===s.ControlComponent.RADIO){const{width:nt,height:J,gap:_}=this.options.radio,B=nt+_*(E.controlComponent?1:2);E.width=B,D.width=B*R,D.height=J*R}else if(E.type===s.ElementType.CHECKBOX||E.controlComponent===s.ControlComponent.CHECKBOX){const{width:nt,height:J,gap:_}=this.options.checkbox,B=nt+_*(E.controlComponent?1:2);E.width=B,D.width=B*R,D.height=J*R}else if(E.type===s.ElementType.MENSTRUAL_HISTORY){const nt=this.menstrualHistoryParticle.computeSize(E);E.width=nt.width/R,D.width=nt.width,D.height=nt.height,D.boundingBoxAscent=nt.height,D.boundingBoxDescent=0}else if(E.type===s.ElementType.FETAL_HEART_POSITION){const nt=this.fetalHeartPositionParticle.computeSize();E.width=nt.width/R,D.width=nt.width,D.height=nt.height,D.boundingBoxAscent=nt.height/2,D.boundingBoxDescent=nt.height/2}else if(E.type===s.ElementType.TOOTH_POSITION){const nt=this.toothPositionParticle.computeSize(E);E.width=nt.width/R,D.width=nt.width,D.height=nt.height,D.boundingBoxAscent=nt.height/2,D.boundingBoxDescent=nt.height/2}else if(E.type===s.ElementType.TAB)D.width=C*R,D.height=h*R,D.boundingBoxDescent=0,D.boundingBoxAscent=this.textParticle.getBasisWordBoundingBoxAscent(m,m.font);else if(E.type===s.ElementType.BLOCK){if(!E.width)D.width=v;else{const nt=E.width*R;D.width=Math.min(nt,v)}D.height=E.height*R,D.boundingBoxDescent=D.height,D.boundingBoxAscent=0}else if(E.type===s.ElementType.LABEL){const{defaultSize:nt,label:{defaultPadding:J}}=this.options;m.font=this.getElementFont(E);const _=this.textParticle.measureText(m,E);D.width=(_.width+J[1]+J[3])*R,D.height=(E.size||nt)*R,D.boundingBoxDescent=0,D.boundingBoxAscent=(J[0]+_.actualBoundingBoxAscent)*R}else if(E.type===s.ElementType.MACRO||E.type===s.ElementType.CUSTOM_MACRO||E.type===s.ElementType.REUSABLE_ITEM||E.type===s.ElementType.SUB_TEMPLATE){const{defaultSize:nt}=this.options;m.font=this.getElementFont(E);const J=this.getMode(),_=J===s.EditorMode.EDIT,B=J===s.EditorMode.FORM;if(J===s.EditorMode.READONLY&&E.type!==s.ElementType.SUB_TEMPLATE){const st=No(E),z=m.measureText(st);D.width=z.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=z.actualBoundingBoxDescent,D.boundingBoxAscent=z.actualBoundingBoxAscent}else if(_){const st=E.label||E.value||"";m.font=this.getElementFont(E);const z=m.measureText(st),ut=8*R,Rt=4*R;D.width=z.width+ut*2;const Dt=z.actualBoundingBoxAscent+z.actualBoundingBoxDescent;D.height=Dt+Rt*2;const Xt=this.textParticle.measureBasisWord(m,this.getElementFont(E));D.boundingBoxAscent=Xt.actualBoundingBoxAscent*R,D.boundingBoxDescent=Xt.actualBoundingBoxDescent*R}else if(E.type===s.ElementType.CUSTOM_MACRO){const st=E.macroConfig,z=st?.value||"";if(B){const ut=st?.type||"text",Rt=this.textParticle.measureText(m,E),Dt=E.label||"";if(ut==="select"){const Xt=z||`请选择${Dt}`,At=m.measureText(Xt),Ft=m.measureText("[").width,Bt=6*R+2*R;D.width=Ft+At.width+Bt+Ft}else{const Xt=z||`请输入${Dt}`,At=m.measureText(Xt),Ft=m.measureText("[").width;D.width=Ft+At.width+Ft}D.height=(E.size||nt)*R,D.boundingBoxDescent=Rt.actualBoundingBoxDescent*R,D.boundingBoxAscent=Rt.actualBoundingBoxAscent*R}else{const ut=E.label||"",Rt=z||`请输入${ut}`,Dt=m.measureText(Rt);D.width=Dt.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=Dt.actualBoundingBoxDescent,D.boundingBoxAscent=Dt.actualBoundingBoxAscent}}else if(E.type===s.ElementType.REUSABLE_ITEM){const z=E.reusableItemConfig?.value||"",ut=E.label||"";if(B){const Rt=this.textParticle.measureText(m,E),Dt=z||`获取 ${ut}`,Xt=m.measureText(Dt),At=m.measureText("[").width;D.width=At+Xt.width+At,D.height=(E.size||nt)*R,D.boundingBoxDescent=Rt.actualBoundingBoxDescent*R,D.boundingBoxAscent=Rt.actualBoundingBoxAscent*R}else{const Rt=z||`获取 ${ut}`,Dt=m.measureText(Rt);D.width=Dt.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=Dt.actualBoundingBoxDescent,D.boundingBoxAscent=Dt.actualBoundingBoxAscent}}else if(E.type===s.ElementType.SUB_TEMPLATE){const st=E.label||"子模板";if(B){const z=m.measureText(st),ut=8*R,Rt=4*R,Dt=z.actualBoundingBoxAscent+z.actualBoundingBoxDescent;D.width=z.width+ut*2,D.height=Dt+Rt*2;const Xt=this.textParticle.measureBasisWord(m,this.getElementFont(E));D.boundingBoxAscent=Xt.actualBoundingBoxAscent*R,D.boundingBoxDescent=Xt.actualBoundingBoxDescent*R}else{const z=m.measureText(st);D.width=z.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=z.actualBoundingBoxDescent,D.boundingBoxAscent=z.actualBoundingBoxAscent}}else{const st=E.label||"",z=E.value||`获取 ${st}`,ut=m.measureText(z);D.width=ut.width,D.height=(E.size||nt)*R,D.boundingBoxDescent=ut.actualBoundingBoxDescent,D.boundingBoxAscent=ut.actualBoundingBoxAscent}}else{const nt=E.size||h;(E.type===s.ElementType.SUPERSCRIPT||E.type===s.ElementType.SUBSCRIPT)&&(E.actualSize=Math.ceil(nt*.6)),D.height=(E.actualSize||nt)*R,m.font=this.getElementFont(E);const J=this.textParticle.measureText(m,E),_=E.buttonValueLayoutPrefixOffset?m.measureText("[").width:0;D.width=Math.max(0,J.width-_)*R,E.letterSpacing&&(D.width+=E.letterSpacing*R);const B=this.textParticle.measureBasisWord(m,E.font);D.boundingBoxAscent=B.actualBoundingBoxAscent*R,D.boundingBoxDescent=B.actualBoundingBoxDescent*R,E.type===s.ElementType.SUPERSCRIPT?D.boundingBoxAscent+=D.height/2:E.type===s.ElementType.SUBSCRIPT&&(D.boundingBoxDescent+=D.height/2)}const w=!de(E)&&(E.imgDisplay!==s.ImageDisplay.INLINE&&E.type===s.ElementType.IMAGE||E.type===s.ElementType.LATEX)?D.height+W:D.boundingBoxAscent+W,et=W+D.boundingBoxAscent+D.boundingBoxDescent+W,G=Object.assign(E,{metrics:D,left:0,style:this.getElementFont(E,R)});this.getIsButtonRowStartPrefix(n,X,O)&&(G.left=-D.width);const A=this.getElementLayoutWidth(G);G.control?.minWidth&&(G.controlComponent&&(b+=D.width),G.controlComponent===s.ControlComponent.POSTFIX&&(this.control.setMinWidthControlInfo({row:O,rowElement:G,availableWidth:v,controlRealWidth:b}),b=0));const k=n[X-1];let tt=n[X+1],x=O.width+A;if(this.options.wordBreak===s.WordBreak.BREAK_WORD&&(!k?.type||k?.type===s.ElementType.TEXT)&&(!E.type||E.type===s.ElementType.TEXT)){const nt=`${k?.value||""}${E.value}`;if(this.WORD_LIKE_REG.test(nt)){const{width:_,endElement:B}=this.textParticle.measureWord(m,n,X),st=_*R;B&&st<=v?(x+=st,tt=B):k&&(x+=st)}const J=this.textParticle.measurePunctuationWidth(m,tt);x+=J*R}E.listId&&(E.listId!==S?N=0:E.value===K&&!E.listWrap&&N++),S=E.listId;const yt=this.position.setSurroundPosition({pageNo:V,rowElement:G,row:O,rowElementRect:{x:y,y:Y,height:et,width:A},availableWidth:v,surroundElementList:u});y=yt.x,x+=yt.rowIncreaseWidth,y+=A;let wt=!1;if(this.mode===s.EditorMode.FORM&&E.control?.type===s.ControlType.BUTTON&&E.controlComponent===s.ControlComponent.PREFIX&&O.elementList.filter(nt=>nt.controlId!==E.controlId).length>0){const nt=E.controlId;if(n.some(_=>_.controlId===`${nt}_text`&&_.control?.type===s.ControlType.BUTTON)){let _=0;for(let B=X;B<n.length;B++){const st=n[B];if(st.controlId!==nt)break;m.font=this.getElementFont(st);const z=this.textParticle.measureText(m,st);if(_+=z.width*R,st.controlComponent===s.ControlComponent.POSTFIX)break}for(let B=0;B<n.length;B++){const st=n[B];if(st.controlId===`${nt}_text`){m.font=this.getElementFont(st);const z=this.textParticle.measureText(m,st);_+=z.width*R}}wt=O.width+_>v}}const Ie=E.type===s.ElementType.SEPARATOR||E.type===s.ElementType.TABLE||k?.type===s.ElementType.TABLE||k?.type===s.ElementType.BLOCK||E.type===s.ElementType.BLOCK||k?.imgDisplay===s.ImageDisplay.INLINE||E.imgDisplay===s.ImageDisplay.INLINE||k?.listId!==E.listId||k?.areaId!==E.areaId&&!E.area?.hide||E.control?.flexDirection===s.FlexDirection.COLUMN&&(E.controlComponent===s.ControlComponent.CHECKBOX||E.controlComponent===s.ControlComponent.RADIO)&&k?.controlComponent===s.ControlComponent.VALUE||X!==0&&E.value===K&&!E.area?.hide||wt,ne=x>v,ue=Ie||ne;if(ue){const nt={width:A,height:et,startIndex:X,elementList:[G],ascent:w,rowIndex:O.rowIndex+1,rowFlex:n[X]?.rowFlex||n[X+1]?.rowFlex,isPageBreak:E.type===s.ElementType.PAGE_BREAK};if(G.controlComponent!==s.ControlComponent.PREFIX&&G.control?.indentation===s.ControlIndentation.VALUE_START){const J=O.elementList.findIndex(_=>_.controlId===G.controlId&&_.controlComponent!==s.ControlComponent.PREFIX);if(~J){const B=this.position.computeRowPosition({row:O,innerWidth:this.getInnerWidth()})[J];B&&(nt.offsetX=B.coordinate.leftTop[0])}}E.listId&&(nt.isList=!0,nt.offsetX=L.get(E.listId),nt.listIndex=N),nt.offsetY=!l&&E.area?.top&&E.areaId!==n[X-1]?.areaId?E.area.top*R:0,P.push(nt)}else O.width+=A,X===0&&(Kn(n[1])||n[1]?.areaId)?(O.height=p,O.ascent=p):O.height<et&&(O.height=et,O.ascent=w),O.elementList.push(G);if((ue||X===n.length-1)&&(O.isWidthNotEnough=ne&&!Ie,!O.isSurround&&(k?.rowFlex===s.RowFlex.JUSTIFY||k?.rowFlex===s.RowFlex.ALIGNMENT&&O.isWidthNotEnough))){const nt=O.elementList[0]?.value===K?O.elementList.slice(1):O.elementList,J=(v-O.width)/(nt.length-1);for(let _=0;_<nt.length-1;_++){const B=nt[_];B.metrics.width+=J}O.width=v}if(ue){y=r,Y+=O.height,i&&!l&&c&&(Y-a+d+et>c||E.type===s.ElementType.PAGE_BREAK)&&(Y=a,Xc(u,V),V+=1),G.left=0;const nt=P[P.length-1];y=this.position.setSurroundPosition({pageNo:V,rowElement:G,row:nt,rowElementRect:{x:y,y:Y,height:et,width:A},availableWidth:v,surroundElementList:u}).x,y+=A}}return P}_collectTextControlValueSet(t){if(this.isDesignMode()||this.mode===s.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===s.ControlType.TEXT||l.control?.type===s.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===s.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===s.ControlType.TEXT||i.control?.type===s.ControlType.TEXTFIELD)&&(i.controlComponent===s.ControlComponent.PREFIX||i.controlComponent===s.ControlComponent.PRE_TEXT||i.controlComponent===s.ControlComponent.PRETEXTFIX||i.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){const l=i.controlId;let r=!1,a=n+1;for(;a<t.length;){const c=t[a];if(c.controlId===l&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))break;if(c.controlId===l&&c.controlComponent===s.ControlComponent.VALUE&&(r=!0),c.controlId!==l&&c.controlId){(i.control?.type===s.ControlType.TEXT||c.controlComponent===s.ControlComponent.VALUE)&&(r=!0);const d=c.controlId;for(a++;a<t.length&&t[a].controlId===d;)a++;continue}a++}r&&e.add(l)}n++}return e}_computePageList(){const t=[[]],{pageMode:e,pageNumber:{maxPageNo:n}}=this.options,i=this.getHeight(),l=this.getMainOuterHeight();let r=l,a=0;if(e===s.PageMode.CONTINUITY){t[0]=this.rowList,r+=this.rowList.reduce((h,R)=>h+R.height+(R.offsetY||0),0);const c=this.getPagePixelRatio(),d=this.pageList[0],u=Number(d.style.height.replace("px",""));if(r>u)d.style.height=`${r}px`,d.height=r*c;else{const h=r<i?i:r;d.style.height=`${h}px`,d.height=h*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+r>i||this.rowList[c-1]?.isPageBreak){if(Number.isInteger(n)&&a>=n){this.elementList=this.elementList.slice(0,d.startIndex);break}r=l+d.height+u,t.push([d]),a++}else r+=d.height+u,t[a].push(d)}return t}_drawHighlight(t,e){const{rowList:n,positionList:i,elementList:l}=e,r=this.getDefaultBasicRowMarginHeight(),a=this.getHighlightMarginHeight();for(let c=0;c<n.length;c++){const d=n[c];let u="";for(let h=0;h<d.elementList.length;h++){const R=d.elementList[h],T=d.startIndex+h,g=l[T]===R?T:l.indexOf(R),f=~g?g:T,C=this.control.getControlHighlight(l,f),p=R.highlight||C;if(p){u&&u!==p&&this.highlight.render(t);const I=i[f],{coordinate:{leftTop:[m,L]}}=I,P=R.left||0,M=!R.highlight&&!!C&&this.control.getIsInlineControlBackground(l,f),F=M?L+I.ascent-R.metrics.boundingBoxAscent-a:L+r-a,y=M?R.metrics.boundingBoxAscent+R.metrics.boundingBoxDescent+2*a:d.height-2*r+2*a;this.highlight.recordFillInfo(t,m-P,F,R.metrics.width+P,y,p)}else u&&this.highlight.render(t);u=p}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:r,whiteSpace:a}=this.options,{rowList:c,pageNo:d,elementList:u,positionList:h,startIndex:R,zone:T,isDrawLineBreak:g=!r.disabled,td:f,isDrawWhiteSpace:C=!a.disabled}=e,p=this.isPrintLikeMode(),I=this.isSelectionDisabled(),{isCrossRowCol:m,tableId:L}=this.range.getRange();let P=R;for(let M=0;M<c.length;M++){const F=c[M],y={x:0,y:0,width:0,height:0};let Y=null;for(let V=0;V<F.elementList.length;V++){const S=F.elementList[V],N=S.metrics,{ascent:b,coordinate:{leftTop:[X,O]}}=h[F.startIndex+V],E=F.elementList[V-1];if(de(S)&&!this.isDesignMode())this.textParticle.complete();else if(S.type===s.ElementType.IMAGE)this.textParticle.complete(),S.imgDisplay!==s.ImageDisplay.SURROUND&&S.imgDisplay!==s.ImageDisplay.FLOAT_TOP&&S.imgDisplay!==s.ImageDisplay.FLOAT_BOTTOM&&this.imageParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.LATEX)this.textParticle.complete(),this.laTexParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.TABLE)m&&(y.x=X,y.y=O,Y=S),this.tableParticle.render(t,S,X,O);else if(S.type===s.ElementType.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.LABEL)this.textParticle.complete(),this.labelParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.MACRO||S.type===s.ElementType.CUSTOM_MACRO||S.type===s.ElementType.REUSABLE_ITEM||S.type===s.ElementType.SUB_TEMPLATE)this.textParticle.complete(),this.macroParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.DATE){const w=F.elementList[V+1];(!E||E.dateId!==S.dateId)&&this.textParticle.complete(),this.textParticle.record(t,S,X,O+b),(!w||w.dateId!==S.dateId)&&this.textParticle.complete()}else if(S.type===s.ElementType.SUPERSCRIPT)this.textParticle.complete(),this.superscriptParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.SUBSCRIPT)this.underline.render(t),this.textParticle.complete(),this.subscriptParticle.render(t,S,X,O+b);else if(S.type===s.ElementType.SEPARATOR)this.separatorParticle.render(t,S,X,O);else if(S.type===s.ElementType.PAGE_BREAK)this.mode!==s.EditorMode.CLEAN&&!p&&this.pageBreakParticle.render(t,S,X,O);else if(S.type===s.ElementType.CHECKBOX||S.controlComponent===s.ControlComponent.CHECKBOX)this.textParticle.complete(),this.checkboxParticle.render({ctx:t,x:X,y:O+b,index:V,row:F});else if(S.type===s.ElementType.RADIO||S.controlComponent===s.ControlComponent.RADIO)this.textParticle.complete(),this.radioParticle.render({ctx:t,x:X,y:O+b,index:V,row:F});else if(S.type===s.ElementType.MENSTRUAL_HISTORY)this.textParticle.complete(),this.menstrualHistoryParticle.render({ctx:t,x:X,y:O+b,index:V,row:F,element:S});else if(S.type===s.ElementType.FETAL_HEART_POSITION)this.textParticle.complete(),this.fetalHeartPositionParticle.render({ctx:t,x:X,y:O+b,index:V,row:F,element:S});else if(S.type===s.ElementType.TOOTH_POSITION)this.textParticle.complete(),this.toothPositionParticle.render({ctx:t,x:X,y:O+b,index:V,row:F,element:S});else if(S.type===s.ElementType.TAB)this.textParticle.complete();else if(S.rowFlex===s.RowFlex.ALIGNMENT||S.rowFlex===s.RowFlex.JUSTIFY)this.textParticle.record(t,S,X,O+b),this.textParticle.complete();else if(S.type===s.ElementType.BLOCK)this.textParticle.complete(),this.blockParticle.render(t,d,S,X,O+b);else{const w=S.buttonValueLayoutPrefixOffset===!0;(S.left||w)&&this.textParticle.complete(),this.textParticle.record(t,S,X,O+b),(w||S.width||S.letterSpacing||aa.test(S.value))&&this.textParticle.complete()}if(g&&!p&&this.mode!==s.EditorMode.CLEAN&&!F.isWidthNotEnough&&V===F.elementList.length-1&&this.lineBreakParticle.render(t,S,X,O+F.height/2),C&&da.test(S.value)&&this.whiteSpaceParticle.render(t,S,X,O+F.height/2),S.control?.border){E?.control?.border&&E.controlId!==S.controlId&&this.control.drawBorder(t);const w=this.getElementRowMargin(S);this.control.recordBorderInfo(X,O+w,S.metrics.width,F.height-2*w)}else E?.control?.border&&this.control.drawBorder(t);if(S.control?.type===s.ControlType.TEXT){const w=S.controlComponent===s.ControlComponent.VALUE,et=S.controlComponent===s.ControlComponent.POSTFIX||S.controlComponent===s.ControlComponent.POST_TEXT,G=!!E&&E.originControlId===S.controlId&&(E.controlComponent===s.ControlComponent.POSTFIX||E.controlComponent===s.ControlComponent.POST_TEXT||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT);S.originControlId&&(S.controlComponent===s.ControlComponent.PREFIX||S.controlComponent===s.ControlComponent.PRE_TEXT||S.controlComponent===s.ControlComponent.PRETEXTFIX||S.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t),w&&S.control?.underline&&!S.underline&&((!E||E.controlId!==S.controlId||G||E.controlComponent!==s.ControlComponent.VALUE&&E.controlComponent!==s.ControlComponent.PLACEHOLDER)&&this.control.startTextFieldUnderline(S.controlId,X,O+F.height),this.control.recordTextFieldUnderlineWidth(S.metrics.width)),et&&this.control.drawTextFieldUnderline(t),S.originControlId&&(S.controlComponent===s.ControlComponent.POSTFIX||S.controlComponent===s.ControlComponent.POST_TEXT||S.controlComponent===s.ControlComponent.POSTTEXTFIX||S.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t)}else E?.control?.type===s.ControlType.TEXT&&this.control.drawTextFieldUnderline(t);if((S.underline||S.control?.underline)&&S.controlComponent!==s.ControlComponent.PLACEHOLDER&&!(S.control?.type===s.ControlType.TEXT&&S.control?.underline&&!S.underline)){E?.type===s.ElementType.SUBSCRIPT&&S.type!==s.ElementType.SUBSCRIPT&&this.underline.render(t);const w=this.getElementRowMargin(S),et=S.left||0;let G=0;S.type===s.ElementType.SUBSCRIPT&&(G=this.subscriptParticle.getOffsetY(S));const A=S.control?.underline?this.options.underlineColor:S.color;this.underline.recordFillInfo(t,X-et,O+F.height-w+G,N.width+et,0,A,S.textDecoration?.style)}else(E?.underline||E?.control?.underline)&&(E?.control?.type===s.ControlType.TEXT&&E?.control?.underline&&!E.underline||this.underline.render(t));if(S.strikeout){if(!S.type||Le.includes(S.type)){E&&(E.type===s.ElementType.SUBSCRIPT&&S.type!==s.ElementType.SUBSCRIPT||E.type===s.ElementType.SUPERSCRIPT&&S.type!==s.ElementType.SUPERSCRIPT||this.getElementSize(E)!==this.getElementSize(S))&&this.strikeout.render(t);const w=this.textParticle.measureBasisWord(t,this.getElementFont(S));let et=O+b+w.actualBoundingBoxDescent*n-N.height/2;S.type===s.ElementType.SUBSCRIPT?et+=this.subscriptParticle.getOffsetY(S):S.type===s.ElementType.SUPERSCRIPT&&(et+=this.superscriptParticle.getOffsetY(S)),this.strikeout.recordFillInfo(t,X,et,N.width)}}else E?.strikeout&&this.strikeout.render(t);const{zone:W,splitTdRange:D}=this.range.getRange();let{startIndex:U,endIndex:v}=this.range.getRange(),Q=!1;if(f&&D&&[f.originalId,f.id].includes(D.originalId)&&(Q=!0,U=D.startIndex-(f.valueStartIndex??0),v=D.endIndex-(f.valueStartIndex??0)),W===T&&U!==v&&U<=P&&P<=v){const w=this.position.getPositionContext();if(!w.isTable&&!S.tdId||w.tdId===S.tdId||Q)if(U===P){const et=u[U+1];et&&et.value===K&&(y.x=X+N.width,y.y=O,y.height=F.height,y.width+=this.options.rangeMinWidth)}else{let et=N.width;et===0&&F.elementList.length===1&&(et=this.options.rangeMinWidth),y.width||(y.x=X,y.y=O,y.height=F.height),y.width+=et}}if(!l.disabled&&S.groupIds&&this.group.recordFillInfo(S,X,O,N.width,F.height),P++,S.type===s.ElementType.TABLE&&!de(S)){const w=S.tdPadding||i,et=w[1]+w[3];for(let G=0;G<S.trList.length;G++){const A=S.trList[G];for(let k=0;k<A.tdList.length;k++){const tt=A.tdList[k];this.drawRow(t,{elementList:tt.value,positionList:tt.positionList,rowList:tt.rowList,pageNo:d,startIndex:0,innerWidth:(tt.width-et)*n,zone:T,isDrawLineBreak:g,td:tt})}}}}if(F.isList&&this.listParticle.drawListStyle(t,F,h[F.startIndex]),this.textParticle.complete(),this.control.drawBorder(t),this.underline.render(t),this.strikeout.render(t),this.group.render(t),!I){if(y.width&&y.height){const{x:V,y:S,width:N,height:b}=y;this.range.render(t,V,S,N,b)}if(m&&Y&&Y.id===L){const{coordinate:{leftTop:[V,S]}}=h[F.startIndex];this.tableParticle.drawRange(t,Y,V,S)}}}this.control.renderQualityMarks(t,e.elementList,e.positionList,e.rowList,e.pageNo,e.zone,e.innerWidth)}_drawFloat(t,e){const{scale:n}=this.options,i=this.position.getFloatPositionList(),{imgDisplays:l,pageNo:r}=e;for(let a=0;a<i.length;a++){const c=i[a],d=c.element;if((r===c.pageNo||c.zone===s.EditorZone.HEADER||c.zone==s.EditorZone.FOOTER)&&d.imgDisplay&&l.includes(d.imgDisplay)&&d.type===s.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:r,pageMode:a,header:c,footer:d,pageNumber:u,lineNumber:h,pageBorder:R}=this.options,T=this.isPrintLikeMode(),g=this.mode===s.EditorMode.COMPARE?this.options.modeRule[s.EditorMode.COMPARE]:this.options.modeRule[s.EditorMode.PRINT],f=this.getInnerWidth(),C=this.ctxList[l];C.globalAlpha=this.zone.isMainActive()?1:r,this._clearPage(l),(!T||!g?.backgroundDisabled)&&this.background.render(C,l),T||this.area.render(C,l),a!==s.PageMode.CONTINUITY&&this.options.watermark.data&&this.waterMark.render(C,l),T||this.margin.render(C,l),this._drawFloat(C,{pageNo:l,imgDisplays:[s.ImageDisplay.FLOAT_BOTTOM]}),T||this.control.renderHighlightList(C,l);const p=i[0]?.startIndex;this.drawRow(C,{elementList:e,positionList:n,rowList:i,pageNo:l,startIndex:p,innerWidth:f,zone:s.EditorZone.MAIN}),this.getIsPagingMode()&&(c.disabled||this.header.render(C,l),u.disabled||this.pageNumber.render(C,l),d.disabled||this.footer.render(C,l)),this._drawFloat(C,{pageNo:l,imgDisplays:[s.ImageDisplay.FLOAT_TOP,s.ImageDisplay.SURROUND]}),!T&&this.search.getSearchKeyword()&&this.search.render(C,l),this.elementList.length<=1&&!this.elementList[0]?.listId&&this.placeholder.render(C),h.disabled||this.lineNumber.render(C,l),R.disabled||this.pageBorder.render(C),this.badge.render(C,l),this.isGraffitiMode()&&this.graffiti.render(C,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=ie(),n=[],i=(X,O)=>{n.push({label:X,duration:ie()-O})};this.renderCount++;const l=this.mode===s.EditorMode.EDIT||this.mode===s.EditorMode.FORM||this.isPrintLikeMode()?rT([...this.getHeaderElementList(),...this.elementList,...this.getFooterElementList()]):null,r=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 X=this.getElementList(),O=X[a],W=O?.type===s.ElementType.SUB_TEMPLATE&&O.subTemplateExpanded?s.LocationPosition.AFTER:s.LocationPosition.BEFORE,D=Hn(X,a,W);D!==a&&!de(X[D])&&(this.range.setRange(D,D),a=D)}let d;const u=this.position.getPositionContext();if(c)d=this.getOriginalElementList()[u.index];else{const X=~a?a:0,O=this.getElementList();d=Zn(O,X)}const{header:h,footer:R}=this.options,{isSubmitHistory:T=!0,isSetCursor:g=!0,isLazy:f=!0,isInit:C=!1,isSourceHistory:p=!1,isFirstRender:I=!1,isDel:m=!1}=t||{};let{isCompute:L=!0}=t||{};r&&(L=!0);let{curIndex:P}=t||{};const{traceLabel:M}=t||{},F=this.getInnerWidth(),y=this.getIsPagingMode(),Y=this.pageRowList.length;if(L){if(this.splitTdValueMap.clear(),this.tdMap.clear(),this.position.setFloatPositionList([]),y){if(!h.disabled){const A=ie();this.header.compute(),i("header.compute",A)}if(!R.disabled){const A=ie();this.footer.compute(),i("footer.compute",A)}}const X=this.getMargins(),O=this.getHeight(),E=this.header.getExtraHeight(),W=this.getMainOuterHeight(),D=X[3],U=X[0]+E,v=yi(this.elementList),Q=ie();this.rowList=this.computeRowList({startX:D,startY:U,pageHeight:O,mainOuterHeight:W,isPagingMode:y,innerWidth:F,surroundElementList:v,elementList:this.elementList}),i("computeRowList",Q);const w=ie();this.pageRowList=this._computePageList(),i("computePageList",w);const et=ie();this.position.computePositionList(),i("computePositionList",et);const G=ie();if(this.area.compute(),i("area.compute",G),!this.isPrintLikeMode()){const A=this.search.getSearchKeyword();if(A){const tt=ie();this.search.compute(A),i("search.compute",tt)}const k=ie();this.control.computeHighlightList(),i("control.computeHighlightList",k)}if(this.isGraffitiMode()){const A=ie();this.graffiti.compute(),i("graffiti.compute",A)}}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let X=0;X<this.pageRowList.length;X++)this.pageList[X]||this._createPage(X);const V=this.pageRowList.length,S=this.pageList.length;if(S>V){const X=S-V;this.ctxList.splice(V,X),this.pageList.splice(V,X).forEach(O=>O.remove())}const N=ie();if(f&&y?this._lazyRender():this._immediateRender(),i(f&&y?"lazyRender":"immediateRender",N),g){if(L&&d?.tableId){const{index:X}=u,E=this.getOriginalElementList()[X];if(d.tableId!==E?.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,P=D.elementIndex,this.position.setPositionContext(u),this.range.setRange(P,P),this.updateTableTool())}const W=this.getElementList();W[a]!==d&&(P=W.findIndex(D=>D===d))}P=this.setCursor(P)}else this.range.getIsSelection()&&this.cursor.focus();if(m){let X;const O=this.position.getPositionContext();X=this.range.getRange().startIndex-1,O.index=X}(T&&!I||P!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(P);const b=ie();fi(()=>{const X=ie();this.range.setRangeStyle(),L&&this.control.getActiveControl()&&this.control.reAwakeControl(),L&&!this.isReadonly()&&this.getMode()!==s.EditorMode.FORM&&u.isTable&&this.getOriginalElementList()[u.index].type===s.ElementType.TABLE&&this.tableTool.render(),L&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),Y!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(T||p)&&!C&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"));const O=ie();mi(this.options,M||"render",O-e,[...n,{label:"nextTick.wait",duration:X-b},{label:"nextTick.callback",duration:O-X}],{isCompute:L,pageCount:this.pageRowList.length})}),g&&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 r=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 h=d.trList[u],R=h.tdList.find(T=>t?r?.linkTdPrevId===T.id:r?.id===T.linkTdPrevId);if(R){n.index=a,n.trIndex=u,n.tableId=d.id,n.trId=h.id,n.tdId=R?.id,e=t?R.value.length-1:e+(R.value[0]?.type===s.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}getInlineBackgroundControlType(t,e){if(e===void 0)return;const n=t[e],i=n?.controlId;return i?n.control?.type?n.control.type:t.find(r=>r.controlId===i&&r.originControlId===n.originControlId&&!!r.control?.type)?.control?.type:void 0}getIsHideInlineBackgroundControlCursor(t,e){if(this.options.mode!==s.EditorMode.EDIT&&this.options.mode!==s.EditorMode.FORM)return!1;const n=e!==void 0?t[e]:void 0;if(n?.controlComponent===s.ControlComponent.POSTFIX||n?.controlComponent===s.ControlComponent.POST_TEXT||n?.controlComponent===s.ControlComponent.POSTTEXTFIX||n?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)return!1;const i=this.getInlineBackgroundControlType(t,e);return!!(i&&[s.ControlType.NUMBER,s.ControlType.SELECT,s.ControlType.DATE].includes(i))}setCursor(t){const e=this.position.getPositionContext(),n=this.position.getPositionList(),i=this.getElementList();if(e.isTable){const{index:r,trIndex:a,tdIndex:c}=e,u=this.getOriginalElementList()[r].trList?.[a].tdList[c].positionList;t===void 0&&u&&(t=u.length-1);const h=u?.[t];this.position.setCursorPosition(h||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 r=i[t];if(r&&Na.includes(r.type)){l=!1;const a=this.position.getCursorPosition();this.previewer.updateResizer(r,a)}}return l&&this.getIsHideInlineBackgroundControlCursor(i,t)&&(l=!1),this.cursor.drawCursor({isShow:l}),t}submitHistory(t){const e=this.position.getPositionContext(),n=Ni(this.elementList),i=Ni(this.header.getElementList()),l=Ni(this.footer.getElementList()),r=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(l)),this.elementList=at(n),this.range.replaceRange(at(r)),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()===s.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,r)=>{l.tableIndex=e,l.tableId=t.id,l.trIndex=i,l.trId=n.id,l.tdIndex=r,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,r=this.getOriginalElementList();let a=l;t&&(a=l>r.length?r.length-1:l);for(let c=a;t?c>=0:c<r.length;t?c--:c++){const d=r[c];if(d&&[d.originalId,d.id].includes(e))for(const[u,h]of d.trList.entries())for(const[R,T]of h.tdList.entries()){const g=T.value.findIndex(typeof n=="function"?n:f=>f===n);if(g>=0)return{originalIndex:c,table:d,tr:h,trIndex:u,td:T,tdIndex:R,elementIndex:g}}}}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 r=this.getTdById(i.linkTdPrevId);if(r){l=e-(r.valueStartIndex??0);const a=Math.max(0,l);this.spliceElementList(r.value,a+1,r.value.length-a-1),i=r}else l=0}}else{let l=1;for(;l>0;){const r=this.getTdById(i.linkTdNextId);if(r){const a=r.valueStartIndex??0;l=n-(a+r.value.length);const c=Math.min(r.value.length,n-a+1);this.spliceElementList(r.value,0,c),i=r}else l=0}}}getTablesByPagingId(t,e,n){const i=[],l=[];if(t[n].pagingId===e){i.push(n),l.push(t[n]);for(let r=n-1;r>=0&&t[r].pagingId===e;r--)l.unshift(t[r]),i.push(r);for(let r=n+1;r<t.length&&t[r].pagingId===e;r++)l.push(t[r]),i.push(r)}return{list:l,startIndex:i.sort()[0]}}}class Ql{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;executeSetControlQualityMarks;executeSetButtonContent;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;getButtonContent;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.executeSetControlQualityMarks=t.setControlQualityMarks.bind(t),this.executeSetButtonContent=t.setButtonContent.bind(t),this.getControlValue=t.getControlValue.bind(t),this.getButtonContent=t.getButtonContent.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 HT(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 AT(o,t){const{width:e,height:n,direction:i=s.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 r=l.contentWindow,a=r.document;a.open();const c=document.createElement("div"),d=HT(e,n);o.forEach(R=>{const T=document.createElement("img");T.style.width=i===s.PaperDirection.HORIZONTAL?d.height:d.width,T.style.height=i===s.PaperDirection.HORIZONTAL?d.width:d.height,T.src=R,c.append(T)});const u=document.createElement("style"),h=`
|
|
565
565
|
* {
|
|
566
566
|
margin: 0;
|
|
567
567
|
padding: 0;
|