@qxs-bns/components-wc 0.0.22 → 0.0.24

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.
Files changed (153) hide show
  1. package/es/editor/blocksuite-editor.mjs +14 -14
  2. package/es/editor/blocksuite-editor.mjs.map +1 -1
  3. package/es/entry-subject.mjs +1 -1
  4. package/es/index.mjs +1 -1
  5. package/es/subject/action.mjs +18 -18
  6. package/es/subject/action.mjs.map +1 -1
  7. package/es/subject/blank-fill.mjs +21 -21
  8. package/es/subject/blank-fill.mjs.map +1 -1
  9. package/es/subject/layout.mjs +3 -3
  10. package/es/subject/layout.mjs.map +1 -1
  11. package/es/subject/list.mjs +43 -43
  12. package/es/subject/list.mjs.map +1 -1
  13. package/es/subject/page-end.mjs +8 -8
  14. package/es/subject/page-end.mjs.map +1 -1
  15. package/es/subject/scale.mjs +19 -19
  16. package/es/subject/scale.mjs.map +1 -1
  17. package/es/subject/single.mjs +48 -48
  18. package/es/subject/single.mjs.map +1 -1
  19. package/es/subject/text-fill.mjs +21 -21
  20. package/es/subject/text-fill.mjs.map +1 -1
  21. package/lib/editor/blocksuite-editor.cjs +4 -4
  22. package/lib/editor/blocksuite-editor.cjs.map +1 -1
  23. package/lib/entry-subject.cjs +1 -1
  24. package/lib/index.cjs +1 -1
  25. package/lib/subject/action.cjs +20 -20
  26. package/lib/subject/action.cjs.map +1 -1
  27. package/lib/subject/blank-fill.cjs +22 -22
  28. package/lib/subject/blank-fill.cjs.map +1 -1
  29. package/lib/subject/layout.cjs +4 -4
  30. package/lib/subject/layout.cjs.map +1 -1
  31. package/lib/subject/list.cjs +51 -51
  32. package/lib/subject/list.cjs.map +1 -1
  33. package/lib/subject/page-end.cjs +8 -8
  34. package/lib/subject/page-end.cjs.map +1 -1
  35. package/lib/subject/scale.cjs +21 -21
  36. package/lib/subject/scale.cjs.map +1 -1
  37. package/lib/subject/single.cjs +50 -50
  38. package/lib/subject/single.cjs.map +1 -1
  39. package/lib/subject/text-fill.cjs +22 -22
  40. package/lib/subject/text-fill.cjs.map +1 -1
  41. package/package.json +3 -3
  42. package/es/entry-all.mjs +0 -2
  43. package/es/entry-all.mjs.map +0 -1
  44. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs +0 -7
  45. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs.map +0 -1
  46. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs +0 -7
  47. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs.map +0 -1
  48. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs +0 -7
  49. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs.map +0 -1
  50. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs +0 -7
  51. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs.map +0 -1
  52. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs +0 -2
  53. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs.map +0 -1
  54. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs +0 -2
  55. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs.map +0 -1
  56. package/es/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs +0 -2
  57. package/es/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs.map +0 -1
  58. package/es/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs +0 -2
  59. package/es/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs.map +0 -1
  60. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs +0 -7
  61. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs.map +0 -1
  62. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs +0 -7
  63. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs.map +0 -1
  64. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs +0 -7
  65. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs.map +0 -1
  66. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs +0 -7
  67. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs.map +0 -1
  68. package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs +0 -2
  69. package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs.map +0 -1
  70. package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs +0 -2
  71. package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs.map +0 -1
  72. package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs +0 -2
  73. package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs.map +0 -1
  74. package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs +0 -2
  75. package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs.map +0 -1
  76. package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs +0 -2
  77. package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs.map +0 -1
  78. package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs +0 -2
  79. package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs.map +0 -1
  80. package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs +0 -2
  81. package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs.map +0 -1
  82. package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs +0 -2
  83. package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs.map +0 -1
  84. package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs +0 -2
  85. package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs.map +0 -1
  86. package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs +0 -2
  87. package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs.map +0 -1
  88. package/es/subject/rich-text.mjs +0 -27
  89. package/es/subject/rich-text.mjs.map +0 -1
  90. package/lib/entry-all.cjs +0 -2
  91. package/lib/entry-all.cjs.map +0 -1
  92. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs +0 -7
  93. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs.map +0 -1
  94. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs +0 -7
  95. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs.map +0 -1
  96. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs +0 -7
  97. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs.map +0 -1
  98. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs +0 -7
  99. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs.map +0 -1
  100. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs +0 -2
  101. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs.map +0 -1
  102. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs +0 -2
  103. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs.map +0 -1
  104. package/lib/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs +0 -2
  105. package/lib/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs.map +0 -1
  106. package/lib/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs +0 -2
  107. package/lib/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs.map +0 -1
  108. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs +0 -7
  109. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs.map +0 -1
  110. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs +0 -7
  111. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs.map +0 -1
  112. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs +0 -8
  113. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs.map +0 -1
  114. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs +0 -7
  115. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs.map +0 -1
  116. package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs +0 -2
  117. package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs.map +0 -1
  118. package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs +0 -2
  119. package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs.map +0 -1
  120. package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs +0 -2
  121. package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs.map +0 -1
  122. package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs +0 -2
  123. package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs.map +0 -1
  124. package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs +0 -2
  125. package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs.map +0 -1
  126. package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs +0 -2
  127. package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs.map +0 -1
  128. package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs +0 -2
  129. package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs.map +0 -1
  130. package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs +0 -2
  131. package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs.map +0 -1
  132. package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs +0 -2
  133. package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs.map +0 -1
  134. package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs +0 -2
  135. package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs.map +0 -1
  136. package/lib/subject/rich-text.cjs +0 -27
  137. package/lib/subject/rich-text.cjs.map +0 -1
  138. package/types/base/define.d.ts +0 -1
  139. package/types/base/uid.d.ts +0 -1
  140. package/types/editor/blocksuite-editor.d.ts +0 -84
  141. package/types/editor/index.d.ts +0 -3
  142. package/types/index.d.ts +0 -4
  143. package/types/subject/action.d.ts +0 -23
  144. package/types/subject/blank-fill.d.ts +0 -49
  145. package/types/subject/index.d.ts +0 -20
  146. package/types/subject/layout.d.ts +0 -7
  147. package/types/subject/list.d.ts +0 -43
  148. package/types/subject/page-end.d.ts +0 -10
  149. package/types/subject/rich-text.d.ts +0 -30
  150. package/types/subject/scale.d.ts +0 -42
  151. package/types/subject/single.d.ts +0 -79
  152. package/types/subject/text-fill.d.ts +0 -54
  153. package/types/subject/type.d.ts +0 -7
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("lit"),t=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),s=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs"),i=require("../base/define.cjs"),r=require("../base/uid.cjs"),o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,n=(e,t,s,i)=>{for(var r,n=i>1?void 0:i?a(t,s):t,l=e.length-1;l>=0;l--)(r=e[l])&&(n=(i?r(t,s,n):r(n))||n);return i&&n&&o(t,s,n),n};class l extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"VALIDATION_ERROR",s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;super(e),this.code=t,this.field=s,this.row=i,this.name="SubjectError"}static from(e){return new l(e.message,e.code,e.field,e.row)}}const c=e.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>`,p=e.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg>`,h=e.html`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>`;function d(e){return e.replace(/^\d+\.\s*/,"").replace(/[\s,,。.!!??;;::、'"“”‘’()()\[\]【】\-_/\\]+/g,"").toLowerCase()}function u(e){const t=document.createElement("div");t.textContent=e,Object.assign(t.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(t),setTimeout(()=>{t.style.opacity="0",setTimeout(()=>t.remove(),300)},2500)}exports.QxsSubjectSingle=class extends e.LitElement{constructor(){super(...arguments),this.orderIndex=0,this.isEdit=!1,this.isSave=!1,this.isSet=!1,this.isKey=!1,this.showAction=!0,this.showAdd=!0,this.showAnswerSetting=!1,this.showKey=!1,this.showAnalysis=!0,this.type="single",this.answerCheckType=1,this.examAnswerRelationType=0,this.richTextContent="",this.analysis="",this.leastAnswerCount=0,this.examExpand="",this.customId="",this.examId=0,this.categoryId="",this.uploadImage=async e=>new Promise((t,s)=>{const i=new FileReader;i.onload=e=>t(e.target?.result),i.onerror=s,i.readAsDataURL(e)}),this.tagList=[],this.categoryList=[],this.aiAnswer="",this.resourceList=[],this.showTag=!1,this.showCategory=!1,this.showAi=!1,this.showResource=!1,this.showJump=!1,this.hasJump=!1,this.searchApi="",this.modelValue="",this.useModel=!1,this._answers=[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.title="",this._title="",this._analysis="",this._richText="",this._showRichText=!1,this._leastAnswerCount=0,this._answerCheckType=1,this._isKey=!1,this._orderList=[],this._selectedTagList=[],this._categoryId="",this._searchResults=[],this._searchOpen=!1,this._searchLoading=!1,this._resultDialogOpen=!1,this._resultDialogIndex=0,this._resultDialogValue="",this._sortDropdownOpen=!1,this._imageViewerOpen=!1,this._imageViewerIndex=0,this._videoViewerOpen=!1,this._correctHintDialogOpen=!1,this._hasShownCorrectHint=!1,this._searchTimer=null,this._searchToken=0,this.TITLE_MAX=200,this.ANSWER_MAX=100,this._handleDocumentClick=e=>{const t=e.composedPath(),s=this.shadowRoot?.querySelector(".multi-select-wrapper"),i=this.shadowRoot?.querySelector(".search-wrap");s&&!t.includes(s)&&(this._sortDropdownOpen=!1),i&&!t.includes(i)&&(this._searchOpen=!1),this.requestUpdate()}}get answerList(){return this._answers}set answerList(e){if(this.isEdit)return;const t=Array.isArray(e)?e:[];this._answers=t.length?t.map(e=>({...e})):[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.requestUpdate("answerList")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),this._syncExternalProps()}firstUpdated(){this._syncExternalProps()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick),this._searchTimer&&(window.clearTimeout(this._searchTimer),this._searchTimer=null)}willUpdate(e){e.has("isEdit")&&this.isEdit&&this._syncProps(),!this.isEdit&&(e.has("title")||e.has("answerList")||e.has("analysis")||e.has("leastAnswerCount")||e.has("answerCheckType")||e.has("tagList")||e.has("categoryId")||e.has("richTextContent"))&&this._syncExternalProps(),e.has("isKey")&&(this._isKey=this.isKey),e.has("tagList")&&(this._selectedTagList=Array.isArray(this.tagList)?this.tagList.map(e=>({...e})):[]),e.has("categoryId")&&(this._categoryId=this.categoryId?String(this.categoryId):""),(e.has("examExpand")||e.has("answerList"))&&this._syncExamExpand(),e.has("modelValue")&&this.useModel&&(this._title=this.modelValue)}_syncExternalProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._leastAnswerCount=Number(this.leastAnswerCount)||0,this._answerCheckType=this.answerCheckType||1,this._isKey=this.isKey,this._selectedTagList=Array.isArray(this.tagList)?this.tagList.map(e=>({...e})):[],this._categoryId=this.categoryId?String(this.categoryId):"",this._richText=this.richTextContent||"",this._showRichText=!!this.richTextContent,this.answerList?.length&&(this._answers=this.answerList.map(e=>({...e,title:e.title||"",isCorrect:!!e.isCorrect})))}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._leastAnswerCount=Number(this.leastAnswerCount)||0,this._answerCheckType=this.answerCheckType||1,this._isKey=this.isKey,this._selectedTagList=Array.isArray(this.tagList)?this.tagList.map(e=>({...e})):[],this._categoryId=this.categoryId?String(this.categoryId):"",this._richText=this.richTextContent||"",this._showRichText=!!this.richTextContent,this.answerList?.length&&(this._answers=this.answerList.map(e=>({...e,title:e.title||"",isCorrect:!!e.isCorrect}))),this._syncExamExpand()}_syncExamExpand(){if(!this.examExpand||!this.answerList?.length)return;const e=this.examExpand.split(","),t=this.answerList;this._orderList=e.map(e=>{const s=t.findIndex((t,s)=>String(t.answerId??t.orderIndex??s+1)===String(e));return s>=0?this._label(s):""}).filter(Boolean)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t??null}))}_searchAnswerType(){return"single"===this.type?0:"multiple"===this.type?1:5}_queueSearch(e){this._searchTimer&&(window.clearTimeout(this._searchTimer),this._searchTimer=null);const t=e.trim();if(!t||!this.searchApi&&"function"!=typeof this.searchHandler)return this._searchResults=[],this._searchOpen=!1,void(this._searchLoading=!1);this._searchTimer=window.setTimeout(()=>{this._runSearch(t)},300)}async _runSearch(e){const t=++this._searchToken;this._searchLoading=!0,this._searchOpen=!0,this.requestUpdate();try{let s=[];if("function"==typeof this.searchHandler)s=await this.searchHandler(e,this._searchAnswerType());else if(this.searchApi){const t=new URLSearchParams({searchKey:e,answerType:String(this._searchAnswerType())}),i=await fetch(`${this.searchApi}${this.searchApi.includes("?")?"&":"?"}${t.toString()}`);if(!i.ok)throw new Error(`HTTP ${i.status}`);const r=await i.json();s=(Array.isArray(r)?r:Array.isArray(r?.data)?r.data:[]).map(e=>({...e,value:e?.value||e?.title||""}))}if(t!==this._searchToken)return;this._searchResults=Array.isArray(s)?s:[]}catch(e){if(t!==this._searchToken)return;this._searchResults=[],u(e?.message||"题库搜索失败")}finally{t===this._searchToken&&(this._searchLoading=!1,this.requestUpdate())}}_selectSearchResult(e){const t=e.value||e.title||"";this._title=t,this._searchResults=[],this._searchOpen=!1,this.useModel&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title})),this._emit("title-select",{...e,id:e.id??e.examId??e.questionId,title:e.title||t,value:t,customId:this.customId||""})}_applyAiAnswer(){if(!this.aiAnswer?.trim())return void u("暂无 AI 推荐答案");const e=this.aiAnswer.split(/\r?\n/).map(e=>d(e)).filter(Boolean);let t=0;if("single"===this.type){let s=!1;this._answers=this._answers.map(i=>{const r=!s&&e.includes(d(i.title||""));return r&&(s=!0,t++),{...i,isCorrect:r}})}else this._answers=this._answers.map(s=>{const i=e.includes(d(s.title||""));return i&&t++,{...s,isCorrect:i}});t?this.requestUpdate():u("未找到匹配的选项,请检查选项内容是否一致")}_removeTag(e){this._selectedTagList=this._selectedTagList.filter(t=>String(t.tagId)!==String(e)),this._emit("tag-change",{value:this._selectedTagList,customId:this.customId||"",examId:this.examId||0})}_chooseTag(){this._emit("choose-tag",{value:this._selectedTagList,customId:this.customId||"",examId:this.examId||0})}_onCategoryChange(e){this._categoryId=e,this._emit("category-change",{value:e,customId:this.customId||"",examId:this.examId||0})}_setRelation(e,t){const s=e.customAnswerId?{...e}:{...e,customAnswerId:e.answerId||r.uid()};this._answers=this._answers.map((e,i)=>i===t?s:e),this.requestUpdate(),this._emit("set-relation",{customId:this.customId||"",examId:this.examId||0,answerIndex:t,answer:s})}_relationLength(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>e+(Array.isArray(t?.relationAnswers)?t.relationAnswers.length:0),0)}_imageResources(){return(this.resourceList||[]).filter(e=>1===e.resourceType).map(e=>e.resource.middle||e.resource.url).filter(Boolean)}_videoResource(){return(this.resourceList||[]).find(e=>2===e.resourceType)?.resource||null}_openImageViewer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._imageResources().length&&(this._imageViewerIndex=e,this._imageViewerOpen=!0)}_closeImageViewer(){this._imageViewerOpen=!1}_moveImage(e){const t=this._imageResources();t.length&&(this._imageViewerIndex=(this._imageViewerIndex+e+t.length)%t.length)}_openVideoViewer(){this._videoResource()?.url&&(this._videoViewerOpen=!0)}_closeVideoViewer(){this._videoViewerOpen=!1}_label(e){return String.fromCharCode(65+e)}get _titlePlaceholder(){return"single"===this.type?"单选题":"multiple"===this.type?"多选题":"排序题"}_setCorrect(e,t){"single"===this.type?(this._answers.forEach(e=>{e.isCorrect=!1}),e.isCorrect=t):e.isCorrect=t,this.requestUpdate()}_onTitleInput(e){const t=e.target;t.value.length>this.TITLE_MAX&&(t.value=t.value.slice(0,this.TITLE_MAX)),this._title=t.value,this._queueSearch(this._title),this.useModel&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}_onAnswerInput(e,t){const s=e.target;s.value.length>this.ANSWER_MAX&&(s.value=s.value.slice(0,this.ANSWER_MAX)),this._answers[t].title=s.value,this.requestUpdate()}_addAnswer(e){if(this.isSave)return;const t=[...this._answers];t.splice(e+1,0,{title:"",isCorrect:!1,customAnswerId:r.uid()}),this._answers=t}_deleteAnswer(e){this._answers.length<3||this.isSave||(this._answers=this._answers.filter((t,s)=>s!==e))}_toggleSortItem(e){const t=this._orderList.indexOf(e);this._orderList=t>=0?this._orderList.filter(t=>t!==e):[...this._orderList,e],this.requestUpdate()}_removeSortItem(e){this._orderList=this._orderList.filter(t=>t!==e),this.requestUpdate()}_getSortOrder(e){const t=this._orderList.indexOf(this._label(e));return t>=0?t+1:null}_sortAnswerValue(e){const t=e.charCodeAt(0)-65,s=this._answers[t];return s?.answerId??t+1}_shouldShowCorrectHint(){return"sort"===this.type?!this._orderList.length:!this._answers.some(e=>!!e.isCorrect)}async toJSON(){return new Promise((e,t)=>{const s={customId:this.customId||void 0,answerType:this.type,orderIndex:this.orderIndex},i=this.isEdit?this._title:this.title||"",r=this.isEdit?this._answers:this.answerList||[],o=this.isEdit?this._answerCheckType:this.answerCheckType||1,a=this.isEdit?this._leastAnswerCount:Number(this.leastAnswerCount)||0,n=this.isEdit?this._analysis:this.analysis||"",c=this._selectedTagList||[],p=this.isEdit?this._orderList.map(e=>this._sortAnswerValue(e)).join(","):this.examExpand||"",h=this.isEdit?this._showRichText:!!this.richTextContent,d=this.isEdit?this._richText:this.richTextContent||"",u=this.isEdit?this._orderList:(()=>{const e=this.examExpand;return e?e.split(",").map(e=>{const t=this.answerList?.findIndex((t,s)=>String(t.answerId??t.orderIndex??s+1)===String(e));return t>=0?this._label(t):""}).filter(Boolean):[]})();if(!i)return void t(new l("题目标题不能为空!","EMPTY_TITLE","title",s));if(this.showTag&&0===c.length)return void t(new l("请选择标签/关键信息","EMPTY_TAGS","tagList",s));if(!o)return void t(new l("请选择答题设置","NO_ANSWER_CHECK_TYPE","answerCheckType",s));let g="",x=!1,m=0;if("multiple"===this.type||"single"===this.type)r.forEach((e,t)=>{e.title?.trim()||(g+=`选项${String.fromCharCode(65+t)}未填写。`),e.isCorrect&&(x=!0,m++)});else if("sort"===this.type&&(u.length&&(x=!0),x&&u.length<a))return void t(new l(`排序题至少需要设置${a}项排序答案`,"SORT_COUNT_INVALID","orderList",s));if(g)return void t(new l(g,"ANSWER_EMPTY","answers",s));if(new Set(r.map(e=>e.title)).size!==r.length)return void t(new l("选项不能重复","DUPLICATE_ANSWERS","answers",s));if("multiple"===this.type){if(1===m)return void t(new l("请至少设置两个支持选项","CORRECT_COUNT_INVALID","answers",s));if(x&&m<a)return void t(new l("至少选几项与支持选项数不符","LEAST_ANSWER_COUNT_INVALID","answers",s))}if((2===o||3===o)&&!x)return void t(new l("请设置支持选项","NO_CORRECT_ANSWER","answers",s));const w={answerType:String(this.type),title:i,answers:r.filter(e=>e.title).map((e,t)=>({...e,orderIndex:t+1})),examExpand:p,analysis:n,isSetCorrectAnswer:x,leastAnswerCount:a||"",examRichTextContent:h?d:"",examAnswerRelationType:this.examAnswerRelationType,isKey:this._isKey,answerCheckType:o,categoryId:this._categoryId||"",memberTagInfo:c,tagInfos:c,aiAnswer:this.aiAnswer||"",resourceList:this.resourceList||[],examResourceBOList:this.resourceList||[]};this.customId&&(w.customId=this.customId),e(w)})}validate(){const e=[],t={customId:this.customId||void 0,answerType:this.type,orderIndex:this.orderIndex},s=this.isEdit?this._title:this.title||"",i=this.isEdit?this._answers:this.answerList||[],r=this.isEdit?this._answerCheckType:this.answerCheckType||1,o=this.isEdit?this._leastAnswerCount:Number(this.leastAnswerCount)||0,a=this._selectedTagList||[],n=this.isEdit?this._orderList:(()=>{const e=this.examExpand;return e?e.split(",").map(e=>{const t=this.answerList?.findIndex((t,s)=>String(t.answerId??t.orderIndex??s+1)===String(e));return t>=0?this._label(t):""}).filter(Boolean):[]})();s||e.push(new l("题目标题不能为空!","EMPTY_TITLE","title",t)),this.showTag&&0===a.length&&e.push(new l("请选择标签/关键信息","EMPTY_TAGS","tagList",t)),r||e.push(new l("请选择答题设置","NO_ANSWER_CHECK_TYPE","answerCheckType",t));let c=!1,p=0;"multiple"===this.type||"single"===this.type?i.forEach((s,i)=>{s.title?.trim()||e.push(new l(`选项${String.fromCharCode(65+i)}未填写`,"ANSWER_EMPTY","answers",t)),s.isCorrect&&(c=!0,p++)}):"sort"===this.type&&(n.length&&(c=!0),c&&n.length<o&&e.push(new l(`排序题至少需要设置${o}项排序答案`,"SORT_COUNT_INVALID","orderList",t)));return new Set(i.map(e=>e.title)).size!==i.length&&i.length>0&&e.push(new l("选项不能重复","DUPLICATE_ANSWERS","answers",t)),"multiple"===this.type&&(1===p&&i.length>0&&e.push(new l("请至少设置两个支持选项","CORRECT_COUNT_INVALID","answers",t)),c&&p<o&&e.push(new l("至少选几项与支持选项数不符","LEAST_ANSWER_COUNT_INVALID","answers",t))),2!==r&&3!==r||c||e.push(new l("请设置支持选项","NO_CORRECT_ANSWER","answers",t)),e}_openResultDialog(e){this._resultDialogIndex=e,this._resultDialogValue=this._answers[e].resultItem||"",this._resultDialogOpen=!0}_saveResultDialog(){this._answers[this._resultDialogIndex].resultItem=this._resultDialogValue,this._resultDialogOpen=!1,this.requestUpdate()}_renderCorrectHintDialog(){return this._correctHintDialogOpen?e.html`
1
+ "use strict";var e=require("lit"),t=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("../base/uid.cjs"),r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?o(t,s):t,l=e.length-1;l>=0;l--)(a=e[l])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&r(t,s,n),n};class n extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"VALIDATION_ERROR",s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;super(e),this.code=t,this.field=s,this.row=i,this.name="SubjectError"}static from(e){return new n(e.message,e.code,e.field,e.row)}}const l=e.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>`,c=e.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg>`,h=e.html`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>`;function p(e){return e.replace(/^\d+\.\s*/,"").replace(/[\s,,。.!!??;;::、'"“”‘’()()[\]【】\-_/\\]+/g,"").toLowerCase()}function d(e){const t=document.createElement("div");t.textContent=e,Object.assign(t.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(t),setTimeout(()=>{t.style.opacity="0",setTimeout(()=>t.remove(),300)},2500)}exports.QxsSubjectSingle=class extends e.LitElement{constructor(){super(...arguments),this["order-index"]=0,this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["show-answer-setting"]=!1,this["show-key"]=!1,this["show-analysis"]=!0,this.type="single",this["answer-check-type"]=1,this["exam-answer-relation-type"]=0,this["rich-text-content"]="",this.analysis="",this["least-answer-count"]=0,this["exam-expand"]="",this["custom-id"]="",this["exam-id"]=0,this["category-id"]="",this["upload-image"]=async e=>new Promise((t,s)=>{const i=new FileReader;i.onload=e=>t(e.target?.result),i.onerror=s,i.readAsDataURL(e)}),this["tag-list"]=[],this["category-list"]=[],this["ai-answer"]="",this["resource-list"]=[],this["show-tag"]=!1,this["show-category"]=!1,this["show-ai"]=!1,this["show-resource"]=!1,this["show-jump"]=!1,this["has-jump"]=!1,this["search-api"]="",this["model-value"]="",this["use-model"]=!1,this._answers=[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.title="",this._title="",this._analysis="",this._richText="",this._showRichText=!1,this._leastAnswerCount=0,this._answerCheckType=1,this._isKey=!1,this._orderList=[],this._selectedTagList=[],this._categoryId="",this._searchResults=[],this._searchOpen=!1,this._searchLoading=!1,this._resultDialogOpen=!1,this._resultDialogIndex=0,this._resultDialogValue="",this._sortDropdownOpen=!1,this._imageViewerOpen=!1,this._imageViewerIndex=0,this._videoViewerOpen=!1,this._correctHintDialogOpen=!1,this._hasShownCorrectHint=!1,this._searchTimer=null,this._searchToken=0,this.TITLE_MAX=200,this.ANSWER_MAX=100,this._handleDocumentClick=e=>{const t=e.composedPath(),s=this.shadowRoot?.querySelector(".multi-select-wrapper"),i=this.shadowRoot?.querySelector(".search-wrap");s&&!t.includes(s)&&(this._sortDropdownOpen=!1),i&&!t.includes(i)&&(this._searchOpen=!1),this.requestUpdate()}}get"answer-list"(){return this._answers}set"answer-list"(e){if(this["is-edit"])return;const t=Array.isArray(e)?e:[];this._answers=t.length?t.map(e=>({...e})):[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.requestUpdate("answer-list")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),this._syncExternalProps()}firstUpdated(){this._syncExternalProps()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick),this._searchTimer&&(window.clearTimeout(this._searchTimer),this._searchTimer=null)}willUpdate(e){e.has("is-edit")&&this["is-edit"]&&this._syncProps(),!this["is-edit"]&&(e.has("title")||e.has("answer-list")||e.has("analysis")||e.has("least-answer-count")||e.has("answer-check-type")||e.has("tag-list")||e.has("category-id")||e.has("rich-text-content"))&&this._syncExternalProps(),e.has("is-key")&&(this._isKey=this["is-key"]),e.has("tag-list")&&(this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(e=>({...e})):[]),e.has("category-id")&&(this._categoryId=this["category-id"]?String(this["category-id"]):""),(e.has("exam-expand")||e.has("answer-list"))&&this._syncExamExpand(),e.has("model-value")&&this["use-model"]&&(this._title=this["model-value"])}_syncExternalProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._leastAnswerCount=Number(this["least-answer-count"])||0,this._answerCheckType=this["answer-check-type"]||1,this._isKey=this["is-key"],this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(e=>({...e})):[],this._categoryId=this["category-id"]?String(this["category-id"]):"",this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"],this["answer-list"]?.length&&(this._answers=this["answer-list"].map(e=>({...e,title:e.title||"",isCorrect:!!e.isCorrect})))}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._leastAnswerCount=Number(this["least-answer-count"])||0,this._answerCheckType=this["answer-check-type"]||1,this._isKey=this["is-key"],this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(e=>({...e})):[],this._categoryId=this["category-id"]?String(this["category-id"]):"",this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"],this["answer-list"]?.length&&(this._answers=this["answer-list"].map(e=>({...e,title:e.title||"",isCorrect:!!e.isCorrect}))),this._syncExamExpand()}_syncExamExpand(){if(!this["exam-expand"]||!this["answer-list"]?.length)return;const e=this["exam-expand"].split(","),t=this["answer-list"];this._orderList=e.map(e=>{const s=t.findIndex((t,s)=>String(t.answerId??t.orderIndex??s+1)===String(e));return s>=0?this._label(s):""}).filter(Boolean)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t??null}))}_searchAnswerType(){return"single"===this.type?0:"multiple"===this.type?1:5}_queueSearch(e){this._searchTimer&&(window.clearTimeout(this._searchTimer),this._searchTimer=null);const t=e.trim();if(!t||!this["search-api"]&&"function"!=typeof this["search-handler"])return this._searchResults=[],this._searchOpen=!1,void(this._searchLoading=!1);this._searchTimer=window.setTimeout(()=>{this._runSearch(t)},300)}async _runSearch(e){const t=++this._searchToken;this._searchLoading=!0,this._searchOpen=!0,this.requestUpdate();try{let s=[];if("function"==typeof this["search-handler"])s=await this["search-handler"](e,this._searchAnswerType());else if(this["search-api"]){const t=new URLSearchParams({searchKey:e,answerType:String(this._searchAnswerType())}),i=await fetch(`${this["search-api"]}${this["search-api"].includes("?")?"&":"?"}${t.toString()}`);if(!i.ok)throw new Error(`HTTP ${i.status}`);const r=await i.json();s=(Array.isArray(r)?r:Array.isArray(r?.data)?r.data:[]).map(e=>({...e,value:e?.value||e?.title||""}))}if(t!==this._searchToken)return;this._searchResults=Array.isArray(s)?s:[]}catch(e){if(t!==this._searchToken)return;this._searchResults=[],d(e?.message||"题库搜索失败")}finally{t===this._searchToken&&(this._searchLoading=!1,this.requestUpdate())}}_selectSearchResult(e){const t=e.value||e.title||"";this._title=t,this._searchResults=[],this._searchOpen=!1,this["use-model"]&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title})),this._emit("title-select",{...e,id:e.id??e.examId??e.questionId,title:e.title||t,value:t,customId:this["custom-id"]||""})}_applyAiAnswer(){if(!this["ai-answer"]?.trim())return void d("暂无 AI 推荐答案");const e=this["ai-answer"].split(/\r?\n/).map(e=>p(e)).filter(Boolean);let t=0;if("single"===this.type){let s=!1;this._answers=this._answers.map(i=>{const r=!s&&e.includes(p(i.title||""));return r&&(s=!0,t++),{...i,isCorrect:r}})}else this._answers=this._answers.map(s=>{const i=e.includes(p(s.title||""));return i&&t++,{...s,isCorrect:i}});t?this.requestUpdate():d("未找到匹配的选项,请检查选项内容是否一致")}_removeTag(e){this._selectedTagList=this._selectedTagList.filter(t=>String(t.tagId)!==String(e)),this._emit("tag-change",{value:this._selectedTagList,customId:this["custom-id"]||"",examId:this["exam-id"]||0})}_chooseTag(){this._emit("choose-tag",{value:this._selectedTagList,customId:this["custom-id"]||"",examId:this["exam-id"]||0})}_onCategoryChange(e){this._categoryId=e,this._emit("category-change",{value:e,customId:this["custom-id"]||"",examId:this["exam-id"]||0})}_setRelation(e,t){const s=e.customAnswerId?{...e}:{...e,customAnswerId:e.answerId||i.uid()};this._answers=this._answers.map((e,i)=>i===t?s:e),this.requestUpdate(),this._emit("set-relation",{customId:this["custom-id"]||"",examId:this["exam-id"]||0,answerIndex:t,answer:s})}_relationLength(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>e+(Array.isArray(t?.relationAnswers)?t.relationAnswers.length:0),0)}_imageResources(){return(this["resource-list"]||[]).filter(e=>1===e.resourceType).map(e=>e.resource.middle||e.resource.url).filter(Boolean)}_videoResource(){return(this["resource-list"]||[]).find(e=>2===e.resourceType)?.resource||null}_openImageViewer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._imageResources().length&&(this._imageViewerIndex=e,this._imageViewerOpen=!0)}_closeImageViewer(){this._imageViewerOpen=!1}_moveImage(e){const t=this._imageResources();t.length&&(this._imageViewerIndex=(this._imageViewerIndex+e+t.length)%t.length)}_openVideoViewer(){this._videoResource()?.url&&(this._videoViewerOpen=!0)}_closeVideoViewer(){this._videoViewerOpen=!1}_label(e){return String.fromCharCode(65+e)}get _titlePlaceholder(){return"single"===this.type?"单选题":"multiple"===this.type?"多选题":"排序题"}_setCorrect(e,t){"single"===this.type?(this._answers.forEach(e=>{e.isCorrect=!1}),e.isCorrect=t):e.isCorrect=t,this.requestUpdate()}_onTitleInput(e){const t=e.target;t.value.length>this.TITLE_MAX&&(t.value=t.value.slice(0,this.TITLE_MAX)),this._title=t.value,this._queueSearch(this._title),this["use-model"]&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}_onAnswerInput(e,t){const s=e.target;s.value.length>this.ANSWER_MAX&&(s.value=s.value.slice(0,this.ANSWER_MAX)),this._answers[t].title=s.value,this.requestUpdate()}_addAnswer(e){if(this["is-save"])return;const t=[...this._answers];t.splice(e+1,0,{title:"",isCorrect:!1,customAnswerId:i.uid()}),this._answers=t}_deleteAnswer(e){this._answers.length<3||this["is-save"]||(this._answers=this._answers.filter((t,s)=>s!==e))}_toggleSortItem(e){const t=this._orderList.indexOf(e);this._orderList=t>=0?this._orderList.filter(t=>t!==e):[...this._orderList,e],this.requestUpdate()}_removeSortItem(e){this._orderList=this._orderList.filter(t=>t!==e),this.requestUpdate()}_getSortOrder(e){const t=this._orderList.indexOf(this._label(e));return t>=0?t+1:null}_sortAnswerValue(e){const t=e.charCodeAt(0)-65,s=this._answers[t];return s?.answerId??t+1}_shouldShowCorrectHint(){return"sort"===this.type?!this._orderList.length:!this._answers.some(e=>!!e.isCorrect)}async toJSON(){return new Promise((e,t)=>{const s={customId:this["custom-id"]||void 0,answerType:this.type,orderIndex:this["order-index"]},i=this["is-edit"]?this._title:this.title||"",r=this["is-edit"]?this._answers:this["answer-list"]||[],o=this["is-edit"]?this._answerCheckType:this["answer-check-type"]||1,a=this["is-edit"]?this._leastAnswerCount:Number(this["least-answer-count"])||0,l=this["is-edit"]?this._analysis:this.analysis||"",c=this._selectedTagList||[],h=this["is-edit"]?this._orderList.map(e=>this._sortAnswerValue(e)).join(","):this["exam-expand"]||"",p=this["is-edit"]?this._showRichText:!!this["rich-text-content"],d=this["is-edit"]?this._richText:this["rich-text-content"]||"",u=this["is-edit"]?this._orderList:(()=>{const e=this["exam-expand"];return e?e.split(",").map(e=>{const t=this["answer-list"]?.findIndex((t,s)=>String(t.answerId??t.orderIndex??s+1)===String(e));return t>=0?this._label(t):""}).filter(Boolean):[]})();if(!i)return void t(new n("题目标题不能为空!","EMPTY_TITLE","title",s));if(this["show-tag"]&&0===c.length)return void t(new n("请选择标签/关键信息","EMPTY_TAGS","tagList",s));if(!o)return void t(new n("请选择答题设置","NO_ANSWER_CHECK_TYPE","answerCheckType",s));let g="",x=!1,m=0;if("multiple"===this.type||"single"===this.type)r.forEach((e,t)=>{e.title?.trim()||(g+=`选项${String.fromCharCode(65+t)}未填写。`),e.isCorrect&&(x=!0,m++)});else if("sort"===this.type&&(u.length&&(x=!0),x&&u.length<a))return void t(new n(`排序题至少需要设置${a}项排序答案`,"SORT_COUNT_INVALID","orderList",s));if(g)return void t(new n(g,"ANSWER_EMPTY","answers",s));if(new Set(r.map(e=>e.title)).size!==r.length)return void t(new n("选项不能重复","DUPLICATE_ANSWERS","answers",s));if("multiple"===this.type){if(1===m)return void t(new n("请至少设置两个支持选项","CORRECT_COUNT_INVALID","answers",s));if(x&&m<a)return void t(new n("至少选几项与支持选项数不符","LEAST_ANSWER_COUNT_INVALID","answers",s))}if((2===o||3===o)&&!x)return void t(new n("请设置支持选项","NO_CORRECT_ANSWER","answers",s));const w={answerType:String(this.type),title:i,answers:r.filter(e=>e.title).map((e,t)=>({...e,orderIndex:t+1})),examExpand:h,analysis:l,isSetCorrectAnswer:x,leastAnswerCount:a||"",examRichTextContent:p?d:"",examAnswerRelationType:this["exam-answer-relation-type"],isKey:this._isKey,answerCheckType:o,categoryId:this._categoryId||"",memberTagInfo:c,tagInfos:c,aiAnswer:this["ai-answer"]||"",resourceList:this["resource-list"]||[],examResourceBOList:this["resource-list"]||[]};this["custom-id"]&&(w.customId=this["custom-id"]),e(w)})}validate(){const e=[],t={customId:this["custom-id"]||void 0,answerType:this.type,orderIndex:this["order-index"]},s=this["is-edit"]?this._title:this.title||"",i=this["is-edit"]?this._answers:this["answer-list"]||[],r=this["is-edit"]?this._answerCheckType:this["answer-check-type"]||1,o=this["is-edit"]?this._leastAnswerCount:Number(this["least-answer-count"])||0,a=this._selectedTagList||[],l=this["is-edit"]?this._orderList:(()=>{const e=this["exam-expand"];return e?e.split(",").map(e=>{const t=this["answer-list"]?.findIndex((t,s)=>String(t.answerId??t.orderIndex??s+1)===String(e));return t>=0?this._label(t):""}).filter(Boolean):[]})();s||e.push(new n("题目标题不能为空!","EMPTY_TITLE","title",t)),this["show-tag"]&&0===a.length&&e.push(new n("请选择标签/关键信息","EMPTY_TAGS","tagList",t)),r||e.push(new n("请选择答题设置","NO_ANSWER_CHECK_TYPE","answerCheckType",t));let c=!1,h=0;"multiple"===this.type||"single"===this.type?i.forEach((s,i)=>{s.title?.trim()||e.push(new n(`选项${String.fromCharCode(65+i)}未填写`,"ANSWER_EMPTY","answers",t)),s.isCorrect&&(c=!0,h++)}):"sort"===this.type&&(l.length&&(c=!0),c&&l.length<o&&e.push(new n(`排序题至少需要设置${o}项排序答案`,"SORT_COUNT_INVALID","orderList",t)));return new Set(i.map(e=>e.title)).size!==i.length&&i.length>0&&e.push(new n("选项不能重复","DUPLICATE_ANSWERS","answers",t)),"multiple"===this.type&&(1===h&&i.length>0&&e.push(new n("请至少设置两个支持选项","CORRECT_COUNT_INVALID","answers",t)),c&&h<o&&e.push(new n("至少选几项与支持选项数不符","LEAST_ANSWER_COUNT_INVALID","answers",t))),2!==r&&3!==r||c||e.push(new n("请设置支持选项","NO_CORRECT_ANSWER","answers",t)),e}_openResultDialog(e){this._resultDialogIndex=e,this._resultDialogValue=this._answers[e].resultItem||"",this._resultDialogOpen=!0}_saveResultDialog(){this._answers[this._resultDialogIndex].resultItem=this._resultDialogValue,this._resultDialogOpen=!1,this.requestUpdate()}_renderCorrectHintDialog(){return this._correctHintDialogOpen?e.html`
2
2
  <div class="modal-backdrop" @click=${()=>{this._correctHintDialogOpen=!1}}>
3
3
  <div class="modal" @click=${e=>e.stopPropagation()}>
4
4
  <div class="modal-header">
@@ -31,13 +31,13 @@
31
31
  </div>
32
32
  </div>
33
33
  </div>
34
- `}_renderSearchDropdown(){return this.isEdit&&(this._searchOpen||this._searchLoading)?e.html`
34
+ `}_renderSearchDropdown(){return this["is-edit"]&&(this._searchOpen||this._searchLoading)?e.html`
35
35
  <div class="search-dropdown">
36
36
  ${this._searchLoading?e.html`<div class="search-empty">搜索中...</div>`:this._searchResults.length?this._searchResults.map(t=>e.html`
37
37
  <div class="search-item" @click=${()=>this._selectSearchResult(t)}>${t.value||t.title}</div>
38
38
  `):e.html`<div class="search-empty">暂无匹配题目</div>`}
39
39
  </div>
40
- `:""}_renderTagSection(){return this.showTag?e.html`
40
+ `:""}_renderTagSection(){return this["show-tag"]?e.html`
41
41
  <div class="flex-items-start section-row">
42
42
  <div class="label"><span>标签:</span></div>
43
43
  <div style="flex:1">
@@ -45,41 +45,41 @@
45
45
  ${this._selectedTagList.length?this._selectedTagList.map(t=>e.html`
46
46
  <span class="tag-item">
47
47
  ${t.tagName}
48
- ${this.isSave?"":e.html`<span class="close" @click=${()=>this._removeTag(t.tagId)}>×</span>`}
48
+ ${this["is-save"]?"":e.html`<span class="close" @click=${()=>this._removeTag(t.tagId)}>×</span>`}
49
49
  </span>
50
50
  `):e.html`<span class="tag-hint">暂无标签/关键信息</span>`}
51
51
  </div>
52
- ${this.isEdit&&!this.isSave?e.html`
52
+ ${this["is-edit"]&&!this["is-save"]?e.html`
53
53
  <div style="margin-top:8px">
54
54
  <span class="el-link" @click=${()=>this._chooseTag()}>选择</span>
55
55
  </div>
56
56
  `:""}
57
57
  </div>
58
58
  </div>
59
- `:""}_renderCategorySection(){return this.showCategory?e.html`
59
+ `:""}_renderCategorySection(){return this["show-category"]?e.html`
60
60
  <div class="flex-items-start section-row">
61
61
  <div class="label"><span>分类:</span></div>
62
62
  <div style="flex:1">
63
- ${this.isEdit?e.html`
64
- <select class="el-select" .value=${String(this._categoryId)} ?disabled=${this.isSave}
63
+ ${this["is-edit"]?e.html`
64
+ <select class="el-select" .value=${String(this._categoryId)} ?disabled=${this["is-save"]}
65
65
  @change=${e=>this._onCategoryChange(e.target.value)}>
66
66
  <option value="">选择分类</option>
67
- ${this.categoryList.map(t=>e.html`
67
+ ${this["category-list"].map(t=>e.html`
68
68
  <option value=${String(t.categoryId)} ?selected=${String(t.categoryId)===String(this._categoryId)}>${t.title}</option>
69
69
  `)}
70
70
  </select>
71
- `:e.html`<span class="value-text">${this.categoryList.find(e=>String(e.categoryId)===String(this._categoryId))?.title||"未选择分类"}</span>`}
71
+ `:e.html`<span class="value-text">${this["category-list"].find(e=>String(e.categoryId)===String(this._categoryId))?.title||"未选择分类"}</span>`}
72
72
  </div>
73
73
  </div>
74
- `:""}_renderAiSection(){return this.showAi&&["single","multiple"].includes(this.type)?e.html`
74
+ `:""}_renderAiSection(){return this["show-ai"]&&["single","multiple"].includes(this.type)?e.html`
75
75
  <div class="flex-items-start section-row">
76
76
  <div class="label"><span>AI推荐:</span></div>
77
77
  <div style="flex:1">
78
- <span class="value-text">${this.aiAnswer||"暂无"}</span>
79
- ${this.isEdit?e.html`<div style="margin-top:8px"><span class="el-link" @click=${()=>this._applyAiAnswer()}>一键勾选</span></div>`:""}
78
+ <span class="value-text">${this["ai-answer"]||"暂无"}</span>
79
+ ${this["is-edit"]?e.html`<div style="margin-top:8px"><span class="el-link" @click=${()=>this._applyAiAnswer()}>一键勾选</span></div>`:""}
80
80
  </div>
81
81
  </div>
82
- `:""}_renderResourceSection(){if(!this.showResource)return"";const t=this._imageResources(),s=this._videoResource();return e.html`
82
+ `:""}_renderResourceSection(){if(!this["show-resource"])return"";const t=this._imageResources(),s=this._videoResource();return e.html`
83
83
  <div class="flex-items-start section-row">
84
84
  <div class="label"><span>资源:</span></div>
85
85
  <div style="flex:1">
@@ -139,23 +139,23 @@
139
139
  </div>
140
140
  </div>
141
141
  </div>
142
- `:""}async _save(e){e?.stopImmediatePropagation();const t=this.validate();if(t.length)u(t[0].message);else if(this._hasShownCorrectHint||!this._shouldShowCorrectHint())try{const e=await this.toJSON();this._emit("save",e)}catch(e){u(e.message)}else this._correctHintDialogOpen=!0}_renderPreview(){const t="single"===this.type?"(单选题)":`(${this._titlePlaceholder}${this.leastAnswerCount?`,至少选${this.leastAnswerCount}项${"sort"===this.type?"并排序":""}`:""})`,s=this.answerList;return e.html`
142
+ `:""}async _save(e){e?.stopImmediatePropagation();const t=this.validate();if(t.length)d(t[0].message);else if(this._hasShownCorrectHint||!this._shouldShowCorrectHint())try{const e=await this.toJSON();this._emit("save",e)}catch(e){d(e.message)}else this._correctHintDialogOpen=!0}_renderPreview(){const t="single"===this.type?"(单选题)":`(${this._titlePlaceholder}${this["least-answer-count"]?`,至少选${this["least-answer-count"]}项${"sort"===this.type?"并排序":""}`:""})`,s=this["answer-list"];return e.html`
143
143
  <div class="preview">
144
- <div><span class="title">${this.orderIndex+1}.${this.title||""}${t}${this.showKey&&this._isKey?e.html`<span class="key-badge">核心题</span>`:""}</span></div>
145
- ${this.richTextContent?e.html`<div class="rich-text" .innerHTML=${this.richTextContent}></div>`:""}
144
+ <div><span class="title">${this["order-index"]+1}.${this.title||""}${t}${this["show-key"]&&this._isKey?e.html`<span class="key-badge">核心题</span>`:""}</span></div>
145
+ ${this["rich-text-content"]?e.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
146
146
  <div class="preview-answer">
147
147
  ${s.map((t,s)=>e.html`
148
148
  <label class="radio">
149
149
  <input type="${"sort"===this.type?"checkbox":"radio"}" .checked=${!!t.isCorrect} disabled />
150
150
  <span class="order">${this._label(s)}.</span> ${t.title}
151
151
  ${"sort"!==this.type&&t.isCorrect?e.html`<span class="correct">(支持选项)</span>`:""}
152
- ${"sort"!==this.type&&1===this.examAnswerRelationType?e.html`<span class="result-info">${t.resultItem?"(已设置结果项)":"(未设置结果项)"}</span>`:""}
153
- ${"sort"!==this.type&&2===this.examAnswerRelationType?e.html`<span class="result-info">${t.answerRelations?.length?"(已设置关联)":"(未设置关联)"}</span>`:""}
152
+ ${"sort"!==this.type&&1===this["exam-answer-relation-type"]?e.html`<span class="result-info">${t.resultItem?"(已设置结果项)":"(未设置结果项)"}</span>`:""}
153
+ ${"sort"!==this.type&&2===this["exam-answer-relation-type"]?e.html`<span class="result-info">${t.answerRelations?.length?"(已设置关联)":"(未设置关联)"}</span>`:""}
154
154
  </label>
155
155
  `)}
156
156
  </div>
157
- ${this.showCategory&&this._categoryId?e.html`<div class="section-row"><span class="value-text">分类:${this.categoryList.find(e=>String(e.categoryId)===String(this._categoryId))?.title||this._categoryId}</span></div>`:""}
158
- ${this._selectedTagList.length&&this.showTag?e.html`
157
+ ${this["show-category"]&&this._categoryId?e.html`<div class="section-row"><span class="value-text">分类:${this["category-list"].find(e=>String(e.categoryId)===String(this._categoryId))?.title||this._categoryId}</span></div>`:""}
158
+ ${this._selectedTagList.length&&this["show-tag"]?e.html`
159
159
  <div class="section-row">
160
160
  <span class="value-text">标签/关键信息:</span>
161
161
  <div class="tag-list" style="margin-top:6px">
@@ -163,14 +163,14 @@
163
163
  </div>
164
164
  </div>
165
165
  `:""}
166
- ${this.showResource?this._renderResourceSection():""}
166
+ ${this["show-resource"]?this._renderResourceSection():""}
167
167
  </div>
168
168
  `}_renderEdit(){return e.html`
169
169
  <div class="flex-items-start">
170
170
  <div class="label"><span>题目:</span></div>
171
171
  <div style="flex:1">
172
172
  <div class="el-input search-wrap">
173
- <textarea rows="2" .value=${this._title} ?disabled=${this.isSave}
173
+ <textarea rows="2" .value=${this._title} ?disabled=${this["is-save"]}
174
174
  maxlength=${this.TITLE_MAX}
175
175
  @input=${e=>this._onTitleInput(e)}
176
176
  placeholder="【${this._titlePlaceholder}】请输入问题"></textarea>
@@ -183,7 +183,7 @@
183
183
  ${["multiple","sort"].includes(this.type)?e.html`
184
184
  <div class="flex-items-start" style="margin-top:12px">
185
185
  <div class="label"><span>设置:</span></div>
186
- <select class="el-select" .value=${this._leastAnswerCount?String(this._leastAnswerCount):""} ?disabled=${this.isSave}
186
+ <select class="el-select" .value=${this._leastAnswerCount?String(this._leastAnswerCount):""} ?disabled=${this["is-save"]}
187
187
  @change=${e=>{const t=e.target.value;this._leastAnswerCount=t?Number(t):0}}>
188
188
  <option value="">至少选择几项</option>
189
189
  ${Array.from({length:Math.max(0,this._answers.length-1)},(e,t)=>t+2).map(t=>e.html`
@@ -198,7 +198,7 @@
198
198
  <div class="answer-item">
199
199
  <span class="label">${this._label(s)}.</span>
200
200
  <div class="input">
201
- <input type="text" .value=${t.title} ?disabled=${this.isSave}
201
+ <input type="text" .value=${t.title} ?disabled=${this["is-save"]}
202
202
  maxlength=${this.ANSWER_MAX}
203
203
  @input=${e=>this._onAnswerInput(e,s)}
204
204
  placeholder="选项${this._label(s)}" />
@@ -209,25 +209,25 @@
209
209
 
210
210
  ${["single","multiple"].includes(this.type)?e.html`
211
211
  <label class="correct ${t.isCorrect?"is-correct":""}">
212
- <input type="checkbox" .checked=${t.isCorrect} ?disabled=${this.isSave}
212
+ <input type="checkbox" .checked=${t.isCorrect} ?disabled=${this["is-save"]}
213
213
  @change=${e=>this._setCorrect(t,e.target.checked)} />
214
214
  支持选项
215
215
  </label>
216
216
  `:""}
217
217
 
218
- <span class="icon ${this.isSave?"disabled":""}"
218
+ <span class="icon ${this["is-save"]?"disabled":""}"
219
219
  @click=${()=>this._addAnswer(s)}>
220
- ${c}
220
+ ${l}
221
221
  </span>
222
- <span class="icon ${this.isSave||this._answers.length<3?"disabled":""}"
222
+ <span class="icon ${this["is-save"]||this._answers.length<3?"disabled":""}"
223
223
  @click=${()=>this._deleteAnswer(s)}>
224
- ${p}
224
+ ${c}
225
225
  </span>
226
226
 
227
- ${1===this.examAnswerRelationType&&"sort"!==this.type?e.html`
227
+ ${1===this["exam-answer-relation-type"]&&"sort"!==this.type?e.html`
228
228
  <span class="link" @click=${()=>this._openResultDialog(s)}>${t.resultItem?"编辑结果":"添加结果"}</span>
229
229
  `:""}
230
- ${2===this.examAnswerRelationType&&"sort"!==this.type?e.html`
230
+ ${2===this["exam-answer-relation-type"]&&"sort"!==this.type?e.html`
231
231
  <span class="link" @click=${()=>this._setRelation(t,s)}>${t.answerRelations?.length?`关联了${this._relationLength(t.answerRelations)}项`:"关联检查"}</span>
232
232
  `:""}
233
233
  </div>
@@ -239,8 +239,8 @@
239
239
  <div class="label"><span>排序答案:</span></div>
240
240
  <div style="flex:1">
241
241
  <div class="multi-select-wrapper">
242
- <div class="multi-select ${this._sortDropdownOpen?"focused":""} ${this.isSave?"disabled":""}"
243
- @click=${()=>{this.isSave||(this._sortDropdownOpen=!this._sortDropdownOpen,this.requestUpdate())}}>
242
+ <div class="multi-select ${this._sortDropdownOpen?"focused":""} ${this["is-save"]?"disabled":""}"
243
+ @click=${()=>{this["is-save"]||(this._sortDropdownOpen=!this._sortDropdownOpen,this.requestUpdate())}}>
244
244
  ${this._orderList.length>0?this._orderList.map(t=>e.html`
245
245
  <span class="tag">
246
246
  ${t}
@@ -278,16 +278,16 @@
278
278
  <div style="flex:1">
279
279
  <qxs-blocksuite-editor
280
280
  .content=${this._richText}
281
- .uploadImage=${this.uploadImage}
281
+ .upload-image=${this["upload-image"]}
282
282
  ?is-edit=${!0}
283
283
  @input=${e=>{this._richText=e.target.getContent()}}
284
284
  ></qxs-blocksuite-editor>
285
- ${this.showAction?"":e.html`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
285
+ ${this["show-action"]?"":e.html`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
286
286
  </div>
287
287
  </div>
288
288
  `:""}
289
289
 
290
- ${this.showAnalysis?e.html`
290
+ ${this["show-analysis"]?e.html`
291
291
  <div class="flex-items-start" style="margin-top:12px">
292
292
  <div class="label"><span>解析:</span></div>
293
293
  <div style="flex:1">
@@ -298,26 +298,26 @@
298
298
  </div>
299
299
  `:""}
300
300
  `}render(){return e.html`
301
- <qxs-subject-layout .showEdit=${this.isEdit}>
301
+ <qxs-subject-layout .show-edit=${this["is-edit"]}>
302
302
  <div slot="preview">${this._renderPreview()}</div>
303
303
  <div slot="edit">${this._renderEdit()}</div>
304
- ${this.showAction?e.html`
304
+ ${this["show-action"]?e.html`
305
305
  <qxs-subject-action
306
- .isEdit=${this.isEdit}
307
- .isSet=${this.isSet}
308
- .isKey=${this._isKey}
309
- .showAdd=${this.showAdd}
310
- .showAnswerSetting=${this.showAnswerSetting&&["single","multiple","sort"].includes(this.type)}
311
- .showKey=${this.showKey&&["single","multiple","sort"].includes(this.type)}
312
- .showRichText=${this._showRichText}
313
- .showJump=${this.showJump}
306
+ .is-edit=${this["is-edit"]}
307
+ .is-set=${this["is-set"]}
308
+ .is-key=${this._isKey}
309
+ .show-add=${this["show-add"]}
310
+ .show-answer-setting=${this["show-answer-setting"]&&["single","multiple","sort"].includes(this.type)}
311
+ .show-key=${this["show-key"]&&["single","multiple","sort"].includes(this.type)}
312
+ .show-rich-text=${this._showRichText}
313
+ .show-jump=${this["show-jump"]}
314
314
  answer-check-type=${this._answerCheckType}
315
- exam-answer-relation-type=${this.examAnswerRelationType}
315
+ exam-answer-relation-type=${this["exam-answer-relation-type"]}
316
316
  @delete=${()=>this._emit("delete")}
317
317
  @save=${this._save}
318
318
  @edit=${()=>this._emit("edit")}
319
319
  @move=${e=>this._emit("move",e.detail)}
320
- @jump=${()=>this._emit("jump",{customId:this.customId||"",examId:this.examId||0,answerType:this.type})}
320
+ @jump=${()=>this._emit("jump",{customId:this["custom-id"]||"",examId:this["exam-id"]||0,answerType:this.type})}
321
321
  @add=${e=>this._emit("add",e.detail)}
322
322
  @set-key=${e=>{this._isKey=e.detail.value,this._emit("set-key",e.detail)}}
323
323
  @set-answer-setting=${e=>{this._answerCheckType=e.detail.value}}
@@ -519,5 +519,5 @@
519
519
  .modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }
520
520
  .modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }
521
521
  .modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }
522
- `,n([t.property({type:Number,attribute:"order-index"})],exports.QxsSubjectSingle.prototype,"orderIndex",2),n([t.property({type:Boolean,attribute:"is-edit"})],exports.QxsSubjectSingle.prototype,"isEdit",2),n([t.property({type:Boolean,attribute:"is-save"})],exports.QxsSubjectSingle.prototype,"isSave",2),n([t.property({type:Boolean,attribute:"is-set"})],exports.QxsSubjectSingle.prototype,"isSet",2),n([t.property({type:Boolean,attribute:"is-key"})],exports.QxsSubjectSingle.prototype,"isKey",2),n([t.property({type:Boolean,attribute:"show-action"})],exports.QxsSubjectSingle.prototype,"showAction",2),n([t.property({type:Boolean,attribute:"show-add"})],exports.QxsSubjectSingle.prototype,"showAdd",2),n([t.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsSubjectSingle.prototype,"showAnswerSetting",2),n([t.property({type:Boolean,attribute:"show-key"})],exports.QxsSubjectSingle.prototype,"showKey",2),n([t.property({type:Boolean,attribute:"show-analysis"})],exports.QxsSubjectSingle.prototype,"showAnalysis",2),n([t.property({attribute:"question-type",reflect:!0})],exports.QxsSubjectSingle.prototype,"type",2),n([t.property({type:Number,attribute:"answer-check-type"})],exports.QxsSubjectSingle.prototype,"answerCheckType",2),n([t.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsSubjectSingle.prototype,"examAnswerRelationType",2),n([t.property({type:String,attribute:"rich-text-content"})],exports.QxsSubjectSingle.prototype,"richTextContent",2),n([t.property({type:String})],exports.QxsSubjectSingle.prototype,"analysis",2),n([t.property({type:Number,attribute:"least-answer-count"})],exports.QxsSubjectSingle.prototype,"leastAnswerCount",2),n([t.property({type:String,attribute:"exam-expand"})],exports.QxsSubjectSingle.prototype,"examExpand",2),n([t.property({type:String,attribute:"custom-id"})],exports.QxsSubjectSingle.prototype,"customId",2),n([t.property({type:Number,attribute:"exam-id"})],exports.QxsSubjectSingle.prototype,"examId",2),n([t.property({type:String,attribute:"category-id"})],exports.QxsSubjectSingle.prototype,"categoryId",2),n([t.property({type:Object})],exports.QxsSubjectSingle.prototype,"uploadImage",2),n([t.property({type:Array,attribute:"answer-list"})],exports.QxsSubjectSingle.prototype,"answerList",1),n([t.property({type:Array,attribute:"tag-list"})],exports.QxsSubjectSingle.prototype,"tagList",2),n([t.property({type:Array,attribute:"category-list"})],exports.QxsSubjectSingle.prototype,"categoryList",2),n([t.property({type:String,attribute:"ai-answer"})],exports.QxsSubjectSingle.prototype,"aiAnswer",2),n([t.property({type:Array,attribute:"resource-list"})],exports.QxsSubjectSingle.prototype,"resourceList",2),n([t.property({type:Boolean,attribute:"show-tag"})],exports.QxsSubjectSingle.prototype,"showTag",2),n([t.property({type:Boolean,attribute:"show-category"})],exports.QxsSubjectSingle.prototype,"showCategory",2),n([t.property({type:Boolean,attribute:"show-ai"})],exports.QxsSubjectSingle.prototype,"showAi",2),n([t.property({type:Boolean,attribute:"show-resource"})],exports.QxsSubjectSingle.prototype,"showResource",2),n([t.property({type:Boolean,attribute:"show-jump"})],exports.QxsSubjectSingle.prototype,"showJump",2),n([t.property({type:Boolean,attribute:"has-jump"})],exports.QxsSubjectSingle.prototype,"hasJump",2),n([t.property({type:String,attribute:"search-api"})],exports.QxsSubjectSingle.prototype,"searchApi",2),n([t.property({type:Object})],exports.QxsSubjectSingle.prototype,"searchHandler",2),n([t.property({type:String,attribute:"model-value"})],exports.QxsSubjectSingle.prototype,"modelValue",2),n([t.property({type:Boolean,attribute:"use-model"})],exports.QxsSubjectSingle.prototype,"useModel",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_answers",2),n([t.property({type:String})],exports.QxsSubjectSingle.prototype,"title",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_title",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_analysis",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_richText",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_showRichText",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_leastAnswerCount",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_answerCheckType",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_isKey",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_orderList",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_selectedTagList",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_categoryId",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_searchResults",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_searchOpen",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_searchLoading",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_resultDialogOpen",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_resultDialogIndex",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_resultDialogValue",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_sortDropdownOpen",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_imageViewerOpen",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_imageViewerIndex",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_videoViewerOpen",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_correctHintDialogOpen",2),n([s.state()],exports.QxsSubjectSingle.prototype,"_hasShownCorrectHint",2),exports.QxsSubjectSingle=n([i.safeCustomElement("qxs-subject-single")],exports.QxsSubjectSingle),exports.SubjectError=l;
522
+ `,a([t.property({type:Number,attribute:"order-index"})],exports.QxsSubjectSingle.prototype,"order-index",2),a([t.property({type:Boolean,attribute:"is-edit"})],exports.QxsSubjectSingle.prototype,"is-edit",2),a([t.property({type:Boolean,attribute:"is-save"})],exports.QxsSubjectSingle.prototype,"is-save",2),a([t.property({type:Boolean,attribute:"is-set"})],exports.QxsSubjectSingle.prototype,"is-set",2),a([t.property({type:Boolean,attribute:"is-key"})],exports.QxsSubjectSingle.prototype,"is-key",2),a([t.property({type:Boolean,attribute:"show-action"})],exports.QxsSubjectSingle.prototype,"show-action",2),a([t.property({type:Boolean,attribute:"show-add"})],exports.QxsSubjectSingle.prototype,"show-add",2),a([t.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsSubjectSingle.prototype,"show-answer-setting",2),a([t.property({type:Boolean,attribute:"show-key"})],exports.QxsSubjectSingle.prototype,"show-key",2),a([t.property({type:Boolean,attribute:"show-analysis"})],exports.QxsSubjectSingle.prototype,"show-analysis",2),a([t.property({attribute:"question-type",reflect:!0})],exports.QxsSubjectSingle.prototype,"type",2),a([t.property({type:Number,attribute:"answer-check-type"})],exports.QxsSubjectSingle.prototype,"answer-check-type",2),a([t.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsSubjectSingle.prototype,"exam-answer-relation-type",2),a([t.property({type:String,attribute:"rich-text-content"})],exports.QxsSubjectSingle.prototype,"rich-text-content",2),a([t.property({type:String})],exports.QxsSubjectSingle.prototype,"analysis",2),a([t.property({type:Number,attribute:"least-answer-count"})],exports.QxsSubjectSingle.prototype,"least-answer-count",2),a([t.property({type:String,attribute:"exam-expand"})],exports.QxsSubjectSingle.prototype,"exam-expand",2),a([t.property({type:String,attribute:"custom-id"})],exports.QxsSubjectSingle.prototype,"custom-id",2),a([t.property({type:Number,attribute:"exam-id"})],exports.QxsSubjectSingle.prototype,"exam-id",2),a([t.property({type:String,attribute:"category-id"})],exports.QxsSubjectSingle.prototype,"category-id",2),a([t.property({type:Object,attribute:"upload-image"})],exports.QxsSubjectSingle.prototype,"upload-image",2),a([t.property({type:Array,attribute:"answer-list"})],exports.QxsSubjectSingle.prototype,"answer-list",1),a([t.property({type:Array,attribute:"tag-list"})],exports.QxsSubjectSingle.prototype,"tag-list",2),a([t.property({type:Array,attribute:"category-list"})],exports.QxsSubjectSingle.prototype,"category-list",2),a([t.property({type:String,attribute:"ai-answer"})],exports.QxsSubjectSingle.prototype,"ai-answer",2),a([t.property({type:Array,attribute:"resource-list"})],exports.QxsSubjectSingle.prototype,"resource-list",2),a([t.property({type:Boolean,attribute:"show-tag"})],exports.QxsSubjectSingle.prototype,"show-tag",2),a([t.property({type:Boolean,attribute:"show-category"})],exports.QxsSubjectSingle.prototype,"show-category",2),a([t.property({type:Boolean,attribute:"show-ai"})],exports.QxsSubjectSingle.prototype,"show-ai",2),a([t.property({type:Boolean,attribute:"show-resource"})],exports.QxsSubjectSingle.prototype,"show-resource",2),a([t.property({type:Boolean,attribute:"show-jump"})],exports.QxsSubjectSingle.prototype,"show-jump",2),a([t.property({type:Boolean,attribute:"has-jump"})],exports.QxsSubjectSingle.prototype,"has-jump",2),a([t.property({type:String,attribute:"search-api"})],exports.QxsSubjectSingle.prototype,"search-api",2),a([t.property({type:Object,attribute:"search-handler"})],exports.QxsSubjectSingle.prototype,"search-handler",2),a([t.property({type:String,attribute:"model-value"})],exports.QxsSubjectSingle.prototype,"model-value",2),a([t.property({type:Boolean,attribute:"use-model"})],exports.QxsSubjectSingle.prototype,"use-model",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_answers",2),a([t.property({type:String})],exports.QxsSubjectSingle.prototype,"title",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_title",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_analysis",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_richText",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_showRichText",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_leastAnswerCount",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_answerCheckType",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_isKey",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_orderList",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_selectedTagList",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_categoryId",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_searchResults",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_searchOpen",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_searchLoading",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_resultDialogOpen",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_resultDialogIndex",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_resultDialogValue",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_sortDropdownOpen",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_imageViewerOpen",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_imageViewerIndex",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_videoViewerOpen",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_correctHintDialogOpen",2),a([t.state()],exports.QxsSubjectSingle.prototype,"_hasShownCorrectHint",2),exports.QxsSubjectSingle=a([s.safeCustomElement("qxs-subject-single")],exports.QxsSubjectSingle),exports.SubjectError=n;
523
523
  //# sourceMappingURL=single.cjs.map